From bb0a18c72f1a4956b4c0839c761a852265271c02 Mon Sep 17 00:00:00 2001
From: Liam Brady User agents must [=immediately=] run the [=focusing steps=] for a
+ [=focusable area=] or [=navigable=] candidate whenever the
+ user attempts to move the focus to candidate. When a user [=activation|activates=] a [=click focusable=] [=focusable area=],
+ the user agent must run the [=focusing steps=] on the [=focusable area=]
+ with focus trigger set to " User agents must [=immediately=] run the [=focusing steps=] for a
- [=focusable area=] or [=navigable=] candidate whenever the
- user attempts to move the focus to candidate.Modifications to the focusing steps algorithm
+
+ Modify the [=focusing steps=] algorithm to take a new optional [=boolean=]
+ argument unfenced that defaults to false.
+
+ Add a new step after step 7 of the algorithm (that defines old chain and new chain) that reads:
+
+ 8. If [=focus-unfenced|unfenced=] is set to false, new chain
+ contains a Document with a [=fenced navigable container/fenced navigable=]
+ nav, and old chain does not also contain
+ an entry with nav, then return.
+
+ Modify the user agent note after the algorithm steps to read:
+
+
+
+
+ Modify the behavior when a user [=activation|activates=] a [=click focusable=] [=focusable area=] to be:
+
+ click event at the element.click" and
+ [=focus-unfenced|unfenced=] set to true.Modifications to the focus chain algorithm
The \`
From 8bd6ee165901e415e57d3e63c13582741c585478 Mon Sep 17 00:00:00 2001
From: Liam Brady Supports-Loading-Mode\` HTTP response header
If previouslyFocusedElement is not null, then:
+ +Set element's [=previously focused element=] to null.
If focusPreviousElement is true, then run the [=focusing steps=] for + previouslyFocusedElement; the viewport should not be scrolled by doing this + step.
Although dismissing a popover manually is a user-initiated gesture, the + [=focusing steps=] will be called with [=focus-unfenced|unfenced=] set to false regardless + of whether this was called from user gesture or via a script call.
+ + Modify the first bullet point of step 3 of the [=interactively validate the constraints=] algorithm to read: + +User agents may focus one of those elements in the process, by running the + [=focusing steps=] for that element, and may change the scrolling position of the + document, or perform some other action that brings the element to the user's attention. + If these steps were invoked by user gesture, [=focusing steps=] can be called with [=focus-unfenced|unfenced=] set to true. + For elements that are [=form-associated custom elements=], user agents + should use their [=face validation anchor=] instead, for the purposes of these actions.
+Supports-Loading-Mode\` HTTP response headerWhen a user clicks on an element like a text area, + because this is a user-initiated action, [=focusing steps=] will be called and will allow + focus to move across a fenced frame boundary. Without allowing that, an element inside of a fenced + frame would never be able to get focus if the user clicks on it.
+ +If an element is focused using the [=focus=] method, an embedder + and its child fenced frame can use a sequence of focus calls and checking the focused element to send + arbitrary binary data across the fenced frame boundary. It is necessary for this to not be + allowed to happen. Therefore, in this case, we sacrifice some functionality for privacy.
+ +User agents must [=immediately=] run the [=focusing steps=] for a @@ -737,6 +774,51 @@ traversables section. +
If currentObject is a [=focusable area=], then set + currentObject to currentObject's [=DOM anchor=]'s + [=Node/node document=].
+ +Otherwise, if currentObject is a Document whose
+ [=node navigable=]'s [=navigable/parent=] is non-null, then set
+ currentObject to currentObject's [=node navigable=]'s [=navigable/parent=].
Otherwise, if currentObject is a Document whose
+ [=node navigable=]'s [=traversable navigable/unfenced parent=] is non-null, then set
+ currentObject to currentObject's [=node navigable=]'s [=traversable navigable/unfenced parent=].
Otherwise, break.
+Return the [=fenced navigable container=]'s [=fenced navigable container/fenced navigable=]'s + [=navigable/active document=].
While candidate's [=focused area=] is either a [=navigable container=] with a non-null [=navigable container/content navigable=] + or a [=fenced navigable container=] with a non-null [=fenced navigable container/fenced navigable=]: + set candidate to the [=navigable/active document=] of either that + [=navigable container=]'s [=navigable container/content navigable=] or + that [=fenced navigable container=]'s [=fenced navigable container/fenced navigable=], whichever is non-null.
Supports-Loading-Mode\` HTTP response headerWhen a user clicks on an element like a <{button}> inside a +<{fencedframe}> while another element *outside* of the <{fencedframe}> is [=focused=], because this +is a user-initiated action, the [=focusing steps=] will allow the <{button}> to [=gain focus=]. +Without allowing that, no element inside of a <{fencedframe}> would never be able [=gain +focus=].
+ +If we were to continue blindly allowing all elements to +be [=focused=] via the {{HTMLOrSVGElement/focus()}} method as is the status quo before this +specification, a [=fenced navigable container=] and its [=fenced navigable container/fenced +navigable=] could use a sequence of {{HTMLOrSVGElement/focus()}} calls to send arbitrary data across +the fenced frame boundary, which is a privacy leak. To avoid this, we effectively "fence" the +{{HTMLOrSVGElement/focus()}} method, which sacrifices some functionality for privacy.
+ +If previouslyFocusedElement is not null, then:
+ +Set element's [=previously focused element=] to null.
If focusPreviousElement is true, then run the [=focusing steps=] for + previouslyFocusedElement; the viewport should not be scrolled by doing this + step.
Although dismissing a popover manually is a user-initiated gesture, the + [=focusing steps=] will be called with [=focus-unfenced|unfenced=] set to false regardless + of whether this was called from user gesture or via a script call.
+User agents may focus one of those elements in the process, by running the + [=focusing steps=] for that element, and may change the scrolling position of the + document, or perform some other action that brings the element to the user's attention. + If these steps were invoked by user gesture, [=focusing steps=] can be called with [=focus-unfenced|unfenced=] set to true. + For elements that are [=form-associated custom elements=], user agents + should use their [=face validation anchor=] instead, for the purposes of these actions.
+If currentObject is a [=focusable area=], then set + currentObject to currentObject's [=DOM anchor=]'s + [=Node/node document=].
+ +Otherwise, if currentObject is a Document whose
+ [=node navigable=]'s [=navigable/parent=] is non-null, then set
+ currentObject to currentObject's [=node navigable=]'s [=navigable/parent=].
Otherwise, if currentObject is a Document whose
+ [=node navigable=]'s [=traversable navigable/unfenced parent=] is non-null, then set
+ currentObject to currentObject's [=node navigable=]'s [=traversable navigable/unfenced parent=].
Otherwise, break.
+Return the [=fenced navigable container=]'s [=fenced navigable container/fenced navigable=]'s + [=navigable/active document=].
While candidate's [=focused area=] is either a [=navigable container=] with a non-null [=navigable container/content navigable=] + or a [=fenced navigable container=] with a non-null [=fenced navigable container/fenced navigable=]: + set candidate to the [=navigable/active document=] of either that + [=navigable container=]'s [=navigable container/content navigable=] or + that [=fenced navigable container=]'s [=fenced navigable container/fenced navigable=], whichever is non-null.
Document |document|
whose [=node navigable=]'s [=navigable/traversable navigable=] is a [=fenced navigable
- container/fenced navigable=], and |old chain| does not also [=list/contain=] |element|, then
+ container/fenced navigable=], and |old chain| does not also [=list/contain=] |document|, then
return.
Note: This is how we bail-out early just before calling the [=focus update steps=], in the case
@@ -878,8 +878,8 @@ move the focus to |candidate|.
Set element's [=previously focused element=] to null.
If focusPreviousElement is true, then run the [=focusing steps=] for - previouslyFocusedElement; the viewport should not be scrolled by doing this - step.
If the [=focused area=] of + candidate is a [=fenced navigable container=] with a non-null [=fenced navigable container/fenced navigable=], + then set candidate to the [=navigable/active document=] of that + [=fenced navigable container=]'s [=fenced navigable container/fenced navigable=].
Otherwise, starting point is a [=focusable area=] in a + [=child navigable=] or [=fenced navigable container/fenced navigable=]. + Set starting point to that + [=child navigable=] or [=fenced navigable container/fenced navigable=]'s + [=traversable navigable/unfenced parent=] and return to the step labeled loop.
If candidate is a [=navigable container=] with a non-null [=navigable container/content navigable=], + then let new candidate be the result of running the + [=sequential navigation search algorithm=] with candidate's [=navigable container/content navigable=] + as the first argument, direction as the second, and + sequential as the third.
+ +If candidate is a [=fenced navigable container=] with a non-null [=fenced navigable container/fenced navigable=], + then let new candidate be the result of running the + [=sequential navigation search algorithm=] with candidate's [=fenced navigable container/fenced navigable=] + as the first argument, direction as the second, and + sequential as the third.
+ +If new candidate is null, then let starting point + be candidate, and return to the top of this algorithm. Otherwise, let + candidate be new candidate.
+Document |document|
- whose [=node navigable=]'s [=navigable/traversable navigable=] is a [=fenced navigable
- container/fenced navigable=], and |old chain| does not also [=list/contain=] |document|, then
- return.
+ 9. If [=focus-unfenced|unfenced=] is false, |new chain| [=list/contains=] a Document
+ |document| whose [=node navigable=]'s [=navigable/traversable navigable=] is a
+ [=fenced navigable container/fenced navigable=], and |old chain| does not also [=list/contain=]
+ |document|, then return.
- Note: This is how we bail-out early just before calling the [=focus update steps=], in the case
- where focus is trying to cross the fence.
+ Note: This is how we bail-out early just before calling the [=focus update steps=], in the case
+ where focus is trying to cross the fence.
If previouslyFocusedElement is not null, then:
+ 10. If |previouslyFocusedElement| is not null, then: + 1. Set element's [=previously focused element=] to null. + 2. If focusPreviousElement is true, then run the [=focusing steps=] for + |previouslyFocusedElement| with [=focus-unfenced|unfenced=] set to true; the viewport + should not be scrolled by doing this step. -Set element's [=previously focused element=] to null.
If focusPreviousElement is true, then run the [=focusing steps=] for - previouslyFocusedElement with [=focus-unfenced|unfenced=] set to true; the viewport - should not be scrolled by doing this step.
Although dismissing a popover manually is a user-initiated gesture, the + Note: Although dismissing a popover manually is a user-initiated gesture, the [=focusing steps=] will be called with [=focus-unfenced|unfenced=] set to false regardless - of whether this was called from user gesture or via a script call.
+ of whether this was called from user gesture or via a script call.User agents may focus one of those elements in the process, by running the - [=focusing steps=] for that element, and may change the scrolling position of the - document, or perform some other action that brings the element to the user's attention. - If these steps were invoked by user gesture, [=focusing steps=] can be called with [=focus-unfenced|unfenced=] set to true. - For elements that are [=form-associated custom elements=], user agents - should use their [=face validation anchor=] instead, for the purposes of these actions.
-If the [=focused area=] of - candidate is a [=fenced navigable container=] with a non-null [=fenced navigable container/fenced navigable=], - then set candidate to the [=navigable/active document=] of that - [=fenced navigable container=]'s [=fenced navigable container/fenced navigable=].
If currentObject is a [=focusable area=], then set - currentObject to currentObject's [=DOM anchor=]'s - [=Node/node document=].
+ 3. If |currentObject| is a [=focusable area=], then set + |currentObject| to |currentObject|'s [=DOM anchor=]'s + [=Node/node document=]. -Otherwise, if currentObject is a Document whose
- [=node navigable=]'s [=navigable/parent=] is non-null, then set
- currentObject to currentObject's [=node navigable=]'s [=navigable/parent=].
Otherwise, if currentObject is a Document whose
- [=node navigable=]'s [=traversable navigable/unfenced parent=] is non-null, then set
- currentObject to currentObject's [=node navigable=]'s [=traversable navigable/unfenced parent=].
Otherwise, break.
-Return the [=fenced navigable container=]'s [=fenced navigable container/fenced navigable=]'s - [=navigable/active document=].
Return the [=fenced navigable container=]'s + [=fenced navigable container/fenced navigable=]'s [=navigable/active document=].
While candidate's [=focused area=] is either a [=navigable container=] with a non-null [=navigable container/content navigable=] - or a [=fenced navigable container=] with a non-null [=fenced navigable container/fenced navigable=]: - set candidate to the [=navigable/active document=] of either that - [=navigable container=]'s [=navigable container/content navigable=] or - that [=fenced navigable container=]'s [=fenced navigable container/fenced navigable=], whichever is non-null.
Otherwise, starting point is a [=focusable area=] in a - [=child navigable=] or [=fenced navigable container/fenced navigable=]. - Set starting point to that + 9. Otherwise, |starting point| is a [=focusable area=] in a [=child navigable=] or + [=fenced navigable container/fenced navigable=]. Set |starting point| to that [=child navigable=] or [=fenced navigable container/fenced navigable=]'s - [=traversable navigable/unfenced parent=] and return to the step labeled loop.
If candidate is a [=navigable container=] with a non-null [=navigable container/content navigable=], - then let new candidate be the result of running the - [=sequential navigation search algorithm=] with candidate's [=navigable container/content navigable=] - as the first argument, direction as the second, and - sequential as the third.
- -If candidate is a [=fenced navigable container=] with a non-null [=fenced navigable container/fenced navigable=], - then let new candidate be the result of running the - [=sequential navigation search algorithm=] with candidate's [=fenced navigable container/fenced navigable=] - as the first argument, direction as the second, and - sequential as the third.
- -If new candidate is null, then let starting point - be candidate, and return to the top of this algorithm. Otherwise, let - candidate be new candidate.
-Return the [=fenced navigable container=]'s [=fenced navigable container/fenced navigable=]'s [=navigable/active document=].
Document
+ 9. If [=focus-unfenced|unfenced=] is false, |new chain| [=list/contains=] a {{Document}}
|document| whose [=node navigable=]'s [=navigable/traversable navigable=] is a
- [=fenced navigable container/fenced navigable=], and |old chain| does not also [=list/contain=]
- |document|, then return.
+ [=fenced navigable container/fenced navigable=], and old chain does not also
+ [=list/contain=] |document|, then return.
Note: This is how we bail-out early just before calling the [=focus update steps=], in the case
where focus is trying to cross the fence.
@@ -888,41 +884,41 @@ the fenced frame boundary, which is a privacy leak. To avoid this, we effectivel
Return the [=fenced navigable container=]'s - [=fenced navigable container/fenced navigable=]'s [=navigable/active document=].
Return the [=fenced navigable container=]'s [=fenced navigable container/fenced + navigable=]'s [=navigable/active document=].