You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: source
+9-130Lines changed: 9 additions & 130 deletions
Original file line number
Diff line number
Diff line change
@@ -72509,28 +72509,6 @@ END:VCARD</pre>
72509
72509
72510
72510
<hr>
72511
72511
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
-
72534
72512
<p>One <span>focusable area</span> in each non-empty <span>control group</span> is designated the
72535
72513
<dfn>focused area of the control group</dfn>. Which control is so designated changes over time,
72536
72514
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>
72554
72532
72555
72533
<li>
72556
72534
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
72562
72536
designated <span>focused area of the control group</span> is a <span>browsing context
72563
72537
container</span> with a non-null <span>nested browsing context</span>, then let
72564
72538
<var>candidate</var> be the <span>active document</span> of that <span>browsing context
@@ -72606,11 +72580,7 @@ END:VCARD</pre>
72606
72580
72607
72581
<li>
72608
72582
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
72614
72584
object</var> be that <span>focusable area</span>'s <span>control group</span>'s <span
72615
72585
data-x="control group owner object">owner object</span>, and return to the step labeled
72616
72586
<i>loop</i>.</p>
@@ -72894,13 +72864,7 @@ END:VCARD</pre>
72894
72864
72895
72865
<li>
72896
72866
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
72904
72868
object</span> that is not a <span>focusable area</span>, and its <span>control group</span> is not empty,
72905
72869
then designate <var>new focus target</var> as the <span>focused area of the control
72906
72870
group</span>, and redo this step.</p>
@@ -72969,12 +72933,7 @@ END:VCARD</pre>
72969
72933
72970
72934
<li>
72971
72935
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
72978
72937
focus target</var> be the first <span>focusable area</span> of its <span>control group</span>
72979
72938
(if the <span>control group owner object</span> is a <code>Document</code>, this will always be
72980
72939
a <span>viewport</span>).</p>
@@ -73003,13 +72962,7 @@ END:VCARD</pre>
73003
72962
<p>When a <span>focusable area</span> is added to an empty <span>control group</span>, it must be designated
73004
72963
the <span>focused area of the control group</span>.</p>
73005
72964
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
73013
72966
group">focused area of a control group</span> is removed from that <span>control group</span> in
73014
72967
some way (e.g. it stops being a <span>focusable area</span>, it is removed from the DOM, it
73015
72968
becomes <span>expressly inert</span>, etc), and the <span>control group</span> is still not
@@ -73034,60 +72987,6 @@ END:VCARD</pre>
73034
72987
data-x="dom-document-activeElement">activeElement</code> API as <span>the body
73035
72988
element</span>.</p>
73036
72989
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
-
73091
72990
<hr>
73092
72991
73093
72992
<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>
73162
73061
73163
73062
<ol>
73164
73063
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
-
73169
73064
<li>
73170
73065
73171
73066
<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>
73176
73068
73177
73069
<p class="note">It is possible for <var>entry</var> to be both a <code>dialog</code>
73178
73070
element and a <span>focusable area</span>, in which case it is its own <span>control group
@@ -73290,11 +73182,7 @@ END:VCARD</pre>
73290
73182
73291
73183
<li>
73292
73184
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
73298
73186
designated <span>focused area of the control group</span> is a <span>browsing context
73299
73187
container</span> with a non-null <span>nested browsing context</span>, and the <span>active
73300
73188
document</span> of that <span>browsing context container</span>'s <span>nested browsing
@@ -73435,8 +73323,8 @@ END:VCARD</pre>
73435
73323
<tbody>
73436
73324
<tr>
73437
73325
<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
73440
73328
<tr>
73441
73329
<th><var>selection mechanism</var> is <i>DOM</i>
73442
73330
<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>
73452
73340
anchor</span> is not <span>inert</span> and that is in its <span>control group</span>'s <span>sequential
73453
73341
focus navigation order</span>.</p>
73454
73342
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
-
73460
73343
<p>The <dfn>home control group</dfn> is the <span>control group</span> to which <var>starting point</var> belongs.</p>
73461
73344
73462
73345
<p>The <dfn>home sequential focus navigation order</dfn> is the <span>sequential focus
@@ -73601,10 +73484,6 @@ END:VCARD</pre>
73601
73484
<ol>
73602
73485
<li><p>Let <var>candidate</var> be this <code>Document</code> object.</p></li>
73603
73486
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
-
73608
73487
<li><p>If <var>candidate</var> has a non-empty <span>control group</span>, then set
73609
73488
<var>candidate</var> to the designated <span>focused area of the control group</span>.</p></li>
0 commit comments