Skip to content

Order nested document visibility and unload teardown #581

Description

@wieslawsoltes

Parent: #267. Webview epic: #264.

Problem

After an allowed nested navigation or non-cancelable detach, the outgoing document needs one ordered lifecycle path: pagehide, transition to hidden with visibilitychange, then unload, before task/resource retirement and generation replacement. Descendants must unload before owners, handlers must see the outgoing document and stable WindowProxy, and reentrant same-frame work must not admit a new generation or resource.

Implemented boundary

  • Consolidate outgoing lifecycle into a guarded pagehide → hidden visibilitychange → unload sequence.
  • Apply it to allowed navigation and non-cancelable detach/discard.
  • Unload detached descendants before their owners.
  • Retain the outgoing Document/WindowProxy through handlers.
  • Block same-frame reentrant generation/resource admission and restore the initiating src.
  • Cancel outgoing-context tasks before generation advance.
  • Bound hidden-root and one-shot state through activation and teardown.
  • Add WPT-shaped/native source contracts and a validation/deferred-work note.

Deferred to #267/#268

Explicit reload/history lifecycle, cross-origin WindowProxy behavior, and cumulative unchanged Markdown/notebook/custom-editor/extension webview acceptance.

Validation boundary

git diff --check passed. Authored contracts were not executed under the current implementation-throughput direction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    vscode-oss/plannedPlanned for the AppScene/WebScene VS Code OSS integration

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions