Skip to content

Commit a4bb346

Browse files
Takayoshi Kochidomenic
authored andcommitted
Remove the concept of "dialog group"
This change mechanically removes the concept of "dialog group", its definition, and its references. In doing so, the three focus fixup rules collapsed to one (now just named "focus fixup rule"), and the concept of "primary control group" became unnecessary. "Dialog group" was used to define the focusing behavior of nested dialogs (mainly for the non-modal case), but actual implementations don't follow that behavior. This is a step toward removing "control groups" completely, per whatwg#2171.
1 parent ac52e65 commit a4bb346

File tree

1 file changed

+9
-130
lines changed

1 file changed

+9
-130
lines changed

source

Lines changed: 9 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -72509,28 +72509,6 @@ END:VCARD</pre>
7250972509

7251072510
<hr>
7251172511

72512-
<p>Each <span>control group owner object</span> can also act as the <dfn data-x="dialog group
72513-
manager">manager</dfn> of a <dfn>dialog group</dfn>.</p>
72514-
72515-
<p>Each <code>dialog</code> element that has an <code data-x="attr-dialog-open">open</code>
72516-
attribute specified and that is <span>being rendered</span> (i.e. that is a <span>control group
72517-
owner object</span>) and is not <span>expressly inert</span>
72518-
belongs to the <span>dialog group</span> whose <span data-x="dialog group manager">manager</span> is
72519-
the <code>dialog</code> element's nearest ancestor <span>control group owner object</span>.</p>
72520-
72521-
<p>If no <code>dialog</code> element has a particular <span>control group owner object</span> as
72522-
its nearest ancestor <span>control group owner object</span>, then that <span>control group owner
72523-
object</span> has no <span>dialog group</span>.</p>
72524-
72525-
<p>Each <span>dialog group</span> can have a <code>dialog</code> designated as the <dfn>focused
72526-
dialog of the dialog group</dfn>. Which <code>dialog</code> is so designated changes over time,
72527-
based on algorithms in this specification.</p>
72528-
72529-
<p>Elements in <span data-x="dialog group">dialog groups</span> are ordered in <span>tree
72530-
order</span>.</p>
72531-
72532-
<hr>
72533-
7253472512
<p>One <span>focusable area</span> in each non-empty <span>control group</span> is designated the
7253572513
<dfn>focused area of the control group</dfn>. Which control is so designated changes over time,
7253672514
based on algorithms in this specification. If a <span>control group</span> is empty, it has no <span
@@ -72554,11 +72532,7 @@ END:VCARD</pre>
7255472532

7255572533
<li>
7255672534

72557-
<p>If <var>candidate</var> has a <span>dialog group</span> with a designated
72558-
<span>focused dialog of the dialog group</span>, then let <var>candidate</var> be the
72559-
designated <span>focused dialog of the dialog group</span>, and redo this step.</p>
72560-
72561-
<p>Otherwise, if <var>candidate</var> has a non-empty <span>control group</span>, and the
72535+
<p>If <var>candidate</var> has a non-empty <span>control group</span>, and the
7256272536
designated <span>focused area of the control group</span> is a <span>browsing context
7256372537
container</span> with a non-null <span>nested browsing context</span>, then let
7256472538
<var>candidate</var> be the <span>active document</span> of that <span>browsing context
@@ -72606,11 +72580,7 @@ END:VCARD</pre>
7260672580

7260772581
<li>
7260872582

72609-
<p>If <var>current object</var> is a <code>dialog</code> object in a <span>dialog group</span>,
72610-
let <var>current object</var> be that <span>dialog group</span>'s <span data-x="dialog group
72611-
manager">manager</span>, and return to the step labeled <i>loop</i>.</p>
72612-
72613-
<p>Otherwise, if <var>current object</var> is a <span>focusable area</span>, let <var>current
72583+
<p>If <var>current object</var> is a <span>focusable area</span>, let <var>current
7261472584
object</var> be that <span>focusable area</span>'s <span>control group</span>'s <span
7261572585
data-x="control group owner object">owner object</span>, and return to the step labeled
7261672586
<i>loop</i>.</p>
@@ -72894,13 +72864,7 @@ END:VCARD</pre>
7289472864

7289572865
<li>
7289672866

72897-
<p>If <var>new focus target</var> is a <span>control group owner object</span> that is
72898-
not a <span>focusable area</span>, but does have a <span>dialog group</span>, and that <span>dialog group</span>
72899-
has a designated <span data-x="focused dialog of the dialog group">focused dialog</span>, then
72900-
let <var>new focus target</var> be the <span>focused dialog of the dialog
72901-
group</span>, and redo this step.</p>
72902-
72903-
<p>Otherwise, if <var>new focus target</var> is a <span>control group owner
72867+
<p>If <var>new focus target</var> is a <span>control group owner
7290472868
object</span> that is not a <span>focusable area</span>, and its <span>control group</span> is not empty,
7290572869
then designate <var>new focus target</var> as the <span>focused area of the control
7290672870
group</span>, and redo this step.</p>
@@ -72969,12 +72933,7 @@ END:VCARD</pre>
7296972933

7297072934
<li>
7297172935

72972-
<p>If <var>old focus target</var> is a <code>dialog</code> in a <span>dialog group</span>, and
72973-
the <span>dialog group manager</span> has a non-empty <span>control group</span>, then let
72974-
<var>new focus target</var> be the designated <span data-x="focused area of the control
72975-
group">focused area of that focus group</span>.</p>
72976-
72977-
<p>Otherwise, if <var>old focus target</var> is a <span>focusable area</span>, then let <var>new
72936+
<p>If <var>old focus target</var> is a <span>focusable area</span>, then let <var>new
7297872937
focus target</var> be the first <span>focusable area</span> of its <span>control group</span>
7297972938
(if the <span>control group owner object</span> is a <code>Document</code>, this will always be
7298072939
a <span>viewport</span>).</p>
@@ -73003,13 +72962,7 @@ END:VCARD</pre>
7300372962
<p>When a <span>focusable area</span> is added to an empty <span>control group</span>, it must be designated
7300472963
the <span>focused area of the control group</span>.</p>
7300572964

73006-
<p>When a <span>dialog group</span> is formed, if the <span>dialog group manager</span> has an empty
73007-
<span>control group</span>, the first non-<span>inert</span> <code>dialog</code> in the <span>dialog
73008-
group</span>, if any, or else the first <code>dialog</code> in the <span>dialog group</span> regardless of
73009-
<span data-x="inert">inertness</span>, must be designated the <span>focused dialog of the dialog
73010-
group</span>.</p>
73011-
73012-
<p><dfn>Focus fixup rule one</dfn>: When the designated <span data-x="focused area of the control
72965+
<p><dfn>Focus fixup rule</dfn>: When the designated <span data-x="focused area of the control
7301372966
group">focused area of a control group</span> is removed from that <span>control group</span> in
7301472967
some way (e.g. it stops being a <span>focusable area</span>, it is removed from the DOM, it
7301572968
becomes <span>expressly inert</span>, etc), and the <span>control group</span> is still not
@@ -73034,60 +72987,6 @@ END:VCARD</pre>
7303472987
data-x="dom-document-activeElement">activeElement</code> API as <span>the body
7303572988
element</span>.</p>
7303672989

73037-
<p><dfn>Focus fixup rule two</dfn>: When a <span>dialog group</span> has no designated <span>focused
73038-
dialog of the dialog group</span>, and its <span>dialog group manager</span>'s <span>control
73039-
group</span> changes from being non-empty to being empty, the first non-<span>inert</span>
73040-
<code>dialog</code> in the <span>dialog group</span>, if any, or else the first <code>dialog</code> in
73041-
the <span>dialog group</span> regardless of <span data-x="inert">inertness</span>, must be designated
73042-
the <span>focused dialog of the dialog group</span>.</p>
73043-
73044-
<p><dfn>Focus fixup rule three</dfn>: When the designated <span data-x="focused dialog of the
73045-
dialog group">focused dialog of a dialog group</span> is removed from that <span>dialog
73046-
group</span> in some way (e.g. it stops <span>being rendered</span>, it loses its <code
73047-
data-x="attr-dialog-open">open</code> attribute, it becomes <span>expressly inert</span>, etc),
73048-
and there is still a <span>dialog group</span> (because the <code>dialog</code> in question was
73049-
not the last <code>dialog</code> in that <span>dialog group</span>): if the <span>dialog
73050-
group</span>'s <span data-x="dialog group manager">manager</span>'s <span>control group</span> is
73051-
non-empty, let there be no designated <span>focused dialog of the dialog group</span> any more;
73052-
otherwise (in the case that the <span>control group</span> is empty), designate the first
73053-
non-<span>inert</span> <code>dialog</code> in the <span>dialog group</span> to be the
73054-
<span>focused dialog of the dialog group</span>, or, if they are all <span>inert</span>, designate
73055-
the first <code>dialog</code> in the <span>dialog group</span> to be the <span>focused dialog of
73056-
the dialog group</span> regardless of <span data-x="inert">inertness</span>.</p>
73057-
73058-
<p>When the <span>currently focused area of a top-level browsing context</span> was a <span>focusable
73059-
area</span> but stops being a <span>focusable area</span>, or when it was a <code>dialog</code> in a
73060-
<span>dialog group</span> and stops being part of that <span>dialog group</span>, or when it
73061-
starts being <span>inert</span>, the user agent must run the following steps:</p>
73062-
73063-
<ol> <!-- this is basically a special-cased version of the focusing steps -->
73064-
73065-
<li><p>Let <var>old focus target</var> be whatever the <span data-x="currently focused
73066-
area of a top-level browsing context">currently focused area of the top-level browsing
73067-
context</span> was immediately before this algorithm became applicable (e.g. before the element
73068-
was disabled, or the dialog was closed, or whatever caused this algorithm to run).</p></li>
73069-
73070-
<li><p>Let <var>old chain</var> be the <span>focus chain</span> of the <span
73071-
data-x="currently focused area of a top-level browsing context">currently focused area of the
73072-
top-level browsing context</span> at the same time.</p></li>
73073-
73074-
<li><p>Make sure that the changes implied by the focus fixup rules <span data-x="focus fixup rule
73075-
one">one</span>, <span data-x="focus fixup rule two">two</span>, and <span data-x="focus fixup
73076-
rule three">three</span> above are applied.</p></li>
73077-
73078-
<li><p>Let <var>new focus target</var> be the <span>currently focused area of a
73079-
top-level browsing context</span>.</p></li>
73080-
73081-
<li><p>If <var>old focus target</var> and <var>new focus target</var> are the
73082-
same, return.</p></li>
73083-
73084-
<li><p>Let <var>new chain</var> be the <span>focus chain</span> of <var>new
73085-
focus target</var>.</p></li>
73086-
73087-
<li><p>Run the <span>focus update steps</span> with <var>old chain</var>, <var>new chain</var>, and <var>new focus target</var> respectively.</p></li>
73088-
73089-
</ol>
73090-
7309172990
<hr>
7309272991

7309372992
<p>The <dfn>focus update steps</dfn>, given an <var>old chain</var>, a <var>new chain</var>, and a <var>new focus target</var> respectively, are as
@@ -73162,17 +73061,10 @@ END:VCARD</pre>
7316273061

7316373062
<ol>
7316473063

73165-
<li><p>If <var>entry</var> is a <code>dialog</code> element: let <var>entry</var> be the
73166-
designated <span data-x="focused dialog of the dialog group">focused dialog of its dialog
73167-
group</span>.</p></li>
73168-
7316973064
<li>
7317073065

7317173066
<p>If <var>entry</var> is a <span>focusable area</span>: designate <var>entry</var> as the
73172-
<span>focused area of the control group</span>. If its <span>control group</span>'s <span
73173-
data-x="control group owner object">owner object</span> is also a <span>dialog group
73174-
manager</span>, then let there be no designated <span data-x="focused dialog of the dialog
73175-
group">focused dialog</span> in that <span>dialog group</span>.</p>
73067+
<span>focused area of the control group</span>.</p>
7317673068

7317773069
<p class="note">It is possible for <var>entry</var> to be both a <code>dialog</code>
7317873070
element and a <span>focusable area</span>, in which case it is its own <span>control group
@@ -73290,11 +73182,7 @@ END:VCARD</pre>
7329073182

7329173183
<li>
7329273184

73293-
<p>If <var>candidate</var> has a <span>dialog group</span> with a designated <span>focused
73294-
dialog of the dialog group</span>, then let <var>candidate</var> be the designated
73295-
<span>focused dialog of the dialog group</span>, and redo this step.</p>
73296-
73297-
<p>Otherwise, if <var>candidate</var> has a non-empty <span>control group</span>, and the
73185+
<p>If <var>candidate</var> has a non-empty <span>control group</span>, and the
7329873186
designated <span>focused area of the control group</span> is a <span>browsing context
7329973187
container</span> with a non-null <span>nested browsing context</span>, and the <span>active
7330073188
document</span> of that <span>browsing context container</span>'s <span>nested browsing
@@ -73435,8 +73323,8 @@ END:VCARD</pre>
7343573323
<tbody>
7343673324
<tr>
7343773325
<th><var>starting point</var> is a <span>browsing context</span>
73438-
<td>Let <var>candidate</var> be the first <span>suitable sequentially focusable area</span> in <var>starting point</var>'s <span>active document</span>'s <span>primary control group</span>, if any; or else null
73439-
<td>Let <var>candidate</var> be the last <span>suitable sequentially focusable area</span> in <var>starting point</var>'s <span>active document</span>'s <span>primary control group</span>, if any; or else null
73326+
<td>Let <var>candidate</var> be the first <span>suitable sequentially focusable area</span> in <var>starting point</var>'s <span>active document</span>'s <span>control group</span>, if any; or else null
73327+
<td>Let <var>candidate</var> be the last <span>suitable sequentially focusable area</span> in <var>starting point</var>'s <span>active document</span>'s <span>control group</span>, if any; or else null
7344073328
<tr>
7344173329
<th><var>selection mechanism</var> is <i>DOM</i>
7344273330
<td>Let <var>candidate</var> be the first <span>suitable sequentially focusable area</span> in the <span>home control group</span> following <var>starting point</var>, if any; or else null
@@ -73452,11 +73340,6 @@ END:VCARD</pre>
7345273340
anchor</span> is not <span>inert</span> and that is in its <span>control group</span>'s <span>sequential
7345373341
focus navigation order</span>.</p>
7345473342

73455-
<p>The <dfn>primary control group</dfn> of a <span>control group owner object</span> <var>X</var> is the <span>control group</span> of <var>X</var> if <var>X</var> has no <span>dialog group</span> or if its <span>dialog group</span> has no
73456-
designated <span>focused dialog of the dialog group</span>, otherwise, it is the <span>primary
73457-
control group</span> of <var>X</var>'s <span>dialog group</span>'s designated
73458-
<span>focused dialog of the dialog group</span>.</p>
73459-
7346073343
<p>The <dfn>home control group</dfn> is the <span>control group</span> to which <var>starting point</var> belongs.</p>
7346173344

7346273345
<p>The <dfn>home sequential focus navigation order</dfn> is the <span>sequential focus
@@ -73601,10 +73484,6 @@ END:VCARD</pre>
7360173484
<ol>
7360273485
<li><p>Let <var>candidate</var> be this <code>Document</code> object.</p></li>
7360373486

73604-
<li><p>While <var>candidate</var> has a <span>dialog group</span> with a designated
73605-
<span>focused dialog of the dialog group</span>, set <var>candidate</var> to the
73606-
designated <span>focused dialog of the dialog group</span>.</p></li>
73607-
7360873487
<li><p>If <var>candidate</var> has a non-empty <span>control group</span>, then set
7360973488
<var>candidate</var> to the designated <span>focused area of the control group</span>.</p></li>
7361073489

0 commit comments

Comments
 (0)