Skip to content

Route keyboard focus and Tab traversal across nested webviews #526

Description

@wieslawsoltes

Parent epic: #268. Top-level webview epic: #264. Release epic: #227.

Proven gap

After unchanged Code OSS calls frame.contentWindow.focus(), the child document correctly owns focus with BODY active, but native keyboard dispatch still selects the top-level realm when no native element is active. Sequential Tab order is also computed only from the current document root, so focus cannot enter and leave nested webviews in browser order.

Focused implementation

  • Route keyboard events through the tracked focused child browsing context while its BODY is active.
  • Build sequential focus order across the unified top-level DOM so Tab and Shift+Tab cross iframe boundaries.
  • Start forward traversal at the first inner control after child Window.focus() and reverse traversal at the preceding outer control.
  • Preserve existing key/code/keyCode/modifier/repeat/trust fields and honor preventDefault() before the focus default action.
  • Add a Code-shaped trusted Ctrl+F handoff regression and a browser/native cross-frame Tab contract.

Acceptance and deferred gates

  • Implementation rebased on WebScene main 346f1412432f582ee8fd80942975075f031b06c5.
  • Focused native and WPT contract sources authored.
  • git diff --check passed.
  • Execute Chromium/native comparisons and positive-tabindex/empty-frame edge cases.
  • Run lifecycle, performance, memory, accessibility, and exact unchanged Code OSS acceptance.

Execution is deferred under the current implementation-first direction.

Activity

  1. wieslawsoltes commented on Sep 19, 2026

    @wieslawsoltes
    CollaboratorAuthor

    Completed by #527 and merged to WebScene main as 59d143e1480d8fed170cf1434c3c5d5101cfed54. BODY-focused child keyboard routing and cross-frame Tab/Shift+Tab default traversal are implemented with authored native/browser contracts. Only git diff --check ran; parent #268 records the remaining interaction and acceptance work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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