From 90a60b2a0dc740b8b0093b07ca0a41e70ba8d83a Mon Sep 17 00:00:00 2001
From: Takayoshi Kochi
An element + is expressly inert if it is inert and its node document is + not inert.
+A Document
document is blocked by a modal dialog
subject if subject is the topmost dialog
element in
document's top layer. While document is so blocked, every node
@@ -72539,103 +72542,36 @@ END:VCARD
The following create control groups: - -
Document
object that have browsing
- contexts.dialog
elements that have an open
- attribute specified and that are being rendered.The corresponding Document
object or dialog
element is the created
- control group's owner object. (There
- is always a 1-to-1 mapping of control groups to control group owner objects.)
Each focusable area belongs to a single control group as follows. If - the DOM anchor of a focusable area is a control group - owner object, then that focusable area belongs to that control group - owner object's control group. Otherwise, the focusable area - belongs to its DOM anchor's nearest ancestor control group owner - object's control group.
+One focusable area in each Document
is designated the focused
+ area of the document. Which control is so designated changes over time, based on algorithms
+ in this specification. If a Document
has no focusable area, it has no
+ focused area.
Thus:
- -A viewport always belongs to the control group of the
- Document
for which the viewport was created.
An input
control belongs to the control group of its nearest
- ancestor dialog
or Document
.
An image map's shapes belong to the nearest ancestor dialog
or
- Document
of the img
elements (not the area
elements
- — this means one area
element might create multiple shapes in different
- control groups).
It is possible for a control group to be empty, i.e. for it to have - no focusable areas.
- -An element - is expressly inert if it is inert and its nearest ancestor control - group owner object is not inert.
- -In a page with no dialog
elements, all elements that are inert are
- expressly inert, and vice-versa.
Inside an inert dialog
element, all descendant elements are not
- expressly inert, even if they are inert.
A dialog
element is expressly inert if it is inert and
- not nested inside another inert dialog.
One focusable area in each non-empty control group is designated the - focused area of the control group. Which control is so designated changes over time, - based on algorithms in this specification. If a control group is empty, it has no focused area.
- -Focusable areas in control groups +
Focusable areas in a Document
are ordered relative to the tree order of their DOM
- anchors. Focusable areas with the same DOM anchor in a
- control group are ordered relative to their CSS box's relative positions in a pre-order,
- depth-first traversal of the box tree.
Document
are ordered relative to their CSS boxes' relative
+ positions in a pre-order, depth-first traversal of the box tree.
The currently focused area of a top-level browsing context at any particular time is
- the focusable area or dialog
returned by this algorithm:
Let candidate be the Document
of the top-level
browsing context.
If candidate has a non-empty control group, and the - designated focused area of the control group is a browsing context - container with a non-null nested browsing context, then let - candidate be the active document of that browsing context - container's nested browsing context, and redo this step.
+If the designated focused area of the document is a browsing context + container with a non-null nested browsing context, then let + candidate be the active document of that browsing context + container's nested browsing context, and redo this step.
Otherwise, if candidate has a non-empty control group, let - candidate be the designated focused area of the control - group.
- - +If candidate has a focused + area, set candidate to candidate's focused area.
Return candidate.
The focus chain of a focusable area or control group owner - object subject is the ordered list constructed as follows:
+The focus chain of a focusable area subject is the ordered + list constructed as follows:
If current object is a focusable area, let current - object be that focusable area's control group's owner object, and return to the step labeled - loop.
- -Otherwise, if current object is a If current object is a If new focus target is neither a If new focus target is not a focusable area, then run the first
+ matching set of steps from the following list: If new focus target is a control group owner
- object that is not a focusable area, and its control group is not empty,
- then designate new focus target as the focused area of the control
- group, and redo this step. Otherwise, if new focus target is a browsing context container with
+ If new focus target is a browsing context container with
non-null nested browsing context, then let new focus target be the
nested browsing context's active document, and redo this step. A If new focus target is a focusable area and its DOM
@@ -72993,8 +72911,8 @@ END:VCARD
Document
in a nested browsing
+ Document
in a nested browsing
context, let current object be its browsing context container,
and return to the step labeled loop.dialog
element that has an
- open
attribute specified and that is being
- rendered (i.e. that is a control group owner object), nor a focusable
- area, then run the first matching set of steps from the following list:
@@ -72957,22 +72886,11 @@ END:VCARD
dialog
element can be both a control group owner
- object and a focusable area, if it has both an open
attribute specified and a tabindex
attribute specified and is being
- rendered.
User agents must immediately run the focusing steps for a focusable area,
- dialog
, or browsing context candidate whenever the
+
User agents must immediately run the focusing steps for a + focusable area or browsing context candidate whenever the user attempts to move the focus to candidate.
The unfocusing steps for an object old focus target that is @@ -73027,9 +72945,7 @@ END:VCARD
If old focus target is a focusable area, then let new
- focus target be the first focusable area of its control group
- (if the control group owner object is a Document
, this will always be
- a viewport).
Document
's viewport.
Otherwise, let new focus target be null.
@@ -73052,33 +72968,28 @@ END:VCARDWhen a focusable area is added to an empty control group, it must be designated - the focused area of the control group.
- -Focus fixup rule: When the designated focused area of a control group is removed from that control group in - some way (e.g. it stops being a focusable area, it is removed from the DOM, it - becomes expressly inert, etc), and the control group is still not - empty: designate the first non-inert focusable area in that - control group to be the new focused area of the control group, if any; - if they are all inert, then designate the first focusable area in that - control group to be the new focused area of the control group regardless - of inertness. If such a removal instead results in the control - group being empty, then there is simply no longer a focused area of the control - group.
+When a focusable area is added to an empty Document
, it must be
+ designated the focused area of the document.
Focus fixup rule: When the designated focused area of the document is removed from that Document
in some
+ way (e.g. it stops being a focusable area, it is removed from the DOM, it becomes
+ expressly inert, etc.), and the Document
is still not empty: designate
+ the Document
's viewport to be the new focused area of the
+ document. If such a removal instead results in the Document
being empty, then
+ there is simply no longer a focused area of the document.
For example, this might happen because an element is removed from its
Document
, or has a hidden
attribute added. It might
also happen to an input
element when the element gets disabled.
In a Document
without dialog
elements, whose focused area is a button
element,
- removing, disabling, or hiding that button would cause the page's new focused area to be the viewport of the
- Document
. This would, in turn, be reflected through the activeElement
API as the body
- element.
In a Document
whose focused area is a button
element, removing, disabling, or hiding
+ that button would cause the page's new focused
+ area to be the viewport of the Document
. This would, in turn,
+ be reflected through the activeElement
API as
+ the body element.
If entry is a focusable area: designate entry as the - focused area of the control group.
- -It is possible for entry to be both a dialog
- element and a focusable area, in which case it is its own control group
- owner object.
If candidate has a non-empty control group, and the
- designated focused area of the control group is a browsing context
+ If candidate is non-empty, and the
+ designated focused area of the document is a browsing context
container with a non-null nested browsing context, and the active
document of that browsing context container's nested browsing
context is target, then return true. Otherwise, if candidate has a non-empty control group, and the
- designated focused area of the control group is a browsing context
+ Otherwise, if candidate is non-empty, and the
+ designated focused area of the document is a browsing context
container with a non-null nested browsing context, then let
candidate be the active document of that browsing context
container's nested browsing context, and redo this step. Each control group has a sequential focus navigation order, which orders some
- or all of the focusable areas in the control group
+ Each There can also be a sequential focus navigation starting point. It is initially
unset. The user agent may set it when the user indicates that it should be moved. Loop: Let selection mechanism be sequential if the starting
point is a browsing context or if starting point is in its
- control group's sequential focus navigation order.Sequential focus navigation
- Document
has a sequential focus navigation order, which orders some
+ or all of the focusable areas in the Document
relative to each other. The order in the sequential focus navigation order does not
- have to be related to the order in the control group itself. If a focusable area is
- omitted from the sequential focus navigation order of its control group, then
- it is unreachable via sequential focus navigation.Document
itself. If a
+ focusable area is omitted from the sequential focus navigation order
+ of its Document
, then it is unreachable via sequential focus
+ navigation.Document
's sequential focus navigation order.
Otherwise, starting point is not in its control group's +
Otherwise, starting point is not in its Document
's
sequential focus navigation order; let selection mechanism be
DOM.
A suitable sequentially focusable area is a focusable area whose DOM - anchor is not inert and that is in its control group's sequential - focus navigation order.
+A suitable sequentially focusable area is a focusable area whose
+ DOM anchor is not inert and that is in its Document
's
+ sequential focus navigation order.
The home control group is the control group to which starting point belongs.
+The home document is the Document
to which starting point
+ belongs.
The home sequential focus navigation order is the sequential focus navigation order to which starting point belongs.
The home sequential focus navigation order is the home - control group's sequential focus navigation order, but is only used when the + document's sequential focus navigation order, but is only used when the starting point is in that sequential focus navigation order (when it's not, selection mechanism will be DOM).
@@ -73577,8 +73490,8 @@ END:VCARDLet candidate be this Document
object.
If candidate has a non-empty control group, then set - candidate to the designated focused area of the control group.
If candidate is not empty, then set candidate to the designated + focused area of the document.
If candidate is a focusable area, then set candidate to candidate's DOM anchor.