Parent: #268. Release trackers: #264 and #227.
Proven gap
At unchanged Code OSS revision 645f29cc3176500b4b5762ba887cf2a7f0ffdf2c, the webview prelude handles the host focus command with activeFrame.contentWindow.focus() and repeats that handoff when replacing the visible Markdown frame. It polls document.hasFocus() to publish did-focus/did-blur.
Chrome 153 makes the iframe the outer document's activeElement, reports the child document focused, keeps that ownership when an inner control focuses, then restores the child activeElement to BODY and reports the child unfocused when an outer control focuses. Current WebScene returns from child Window.focus() without changing focus ownership and derives every document's hasFocus() from one top-level boolean.
Scope
- Track the focused browsing-context/document owner for same-origin nested documents.
- Make child
Window.focus() enter that browsing context without requesting operating-system activation.
- Keep outer/inner
activeElement and per-document hasFocus() consistent across inner/outer element focus, replacement, navigation, detach, and host focus loss/return.
- Preserve browser-ordered focus/blur/focusin/focusout transitions and clear stale owners during teardown.
- Add a Chrome/native contract plus the unchanged Markdown focus handoff, bounded latency/memory, and 100-cycle replacement/detach evidence.
Security and collision boundary
Opaque and cross-origin frame access remains unavailable and must not gain a focus side channel. Top-level Window.focus() retains its typed host request and admission behavior. This issue does not change keyboard routing, CSS, File APIs, accessibility publication, packaging, navigation/origin/CSP semantics owned by #267 and its active work, or AppScene host focus implementation.
Parent: #268. Release trackers: #264 and #227.
Proven gap
At unchanged Code OSS revision
645f29cc3176500b4b5762ba887cf2a7f0ffdf2c, the webview prelude handles the hostfocuscommand withactiveFrame.contentWindow.focus()and repeats that handoff when replacing the visible Markdown frame. It pollsdocument.hasFocus()to publishdid-focus/did-blur.Chrome 153 makes the iframe the outer document's
activeElement, reports the child document focused, keeps that ownership when an inner control focuses, then restores the childactiveElementtoBODYand reports the child unfocused when an outer control focuses. Current WebScene returns from childWindow.focus()without changing focus ownership and derives every document'shasFocus()from one top-level boolean.Scope
Window.focus()enter that browsing context without requesting operating-system activation.activeElementand per-documenthasFocus()consistent across inner/outer element focus, replacement, navigation, detach, and host focus loss/return.Security and collision boundary
Opaque and cross-origin frame access remains unavailable and must not gain a focus side channel. Top-level
Window.focus()retains its typed host request and admission behavior. This issue does not change keyboard routing, CSS, File APIs, accessibility publication, packaging, navigation/origin/CSP semantics owned by #267 and its active work, or AppScene host focus implementation.