Re: [compute-pressure] Focus control in privacy test steps (#185)

Let focusedDocument be the topLevelBC's [currently focused area](https://html.spec.whatwg.org/multipage/interaction.html#currently-focused-area-of-a-top-level-browsing-context)'s [node document](https://dom.spec.whatwg.org/#concept-node-document).

// calls this algo:

The currently focused area of a top-level traversable traversable is the [focusable area](https://html.spec.whatwg.org/multipage/interaction.html#focusable-area)-or-null returned by this algorithm:

If traversable does not have [system focus](https://html.spec.whatwg.org/multipage/interaction.html#system-focus), then return null.

Let candidate be traversable's [active document](https://html.spec.whatwg.org/multipage/document-sequences.html#active-document).

While candidate's [focused area](https://html.spec.whatwg.org/multipage/interaction.html#focused-area-of-the-document) is a [navigable container](https://html.spec.whatwg.org/multipage/document-sequences.html#navigable-container) with a non-null [content navigable](https://html.spec.whatwg.org/multipage/document-sequences.html#content-navigable): set candidate to the [active document](https://html.spec.whatwg.org/multipage/document-sequences.html#nav-document) of that [navigable container](https://html.spec.whatwg.org/multipage/document-sequences.html#navigable-container)'s [content navigable](https://html.spec.whatwg.org/multipage/document-sequences.html#content-navigable).

// navigable container == main frame and iframes (and maybe portals in the future) so it iterates to the inner most focused frame

If candidate's [focused area](https://html.spec.whatwg.org/multipage/interaction.html#focused-area-of-the-document) is non-null, set candidate to candidate's [focused area](https://html.spec.whatwg.org/multipage/interaction.html#focused-area-of-the-document).

Return candidate.

-- 
GitHub Notification of comment by kenchris
Please view or discuss this issue at https://github.com/w3c/compute-pressure/issues/185#issuecomment-1431266434 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 15 February 2023 12:06:27 UTC