Skip to content

Commit

Permalink
Update definitions to make reading flow item a scope owner
Browse files Browse the repository at this point in the history
  • Loading branch information
dizhang168 committed Oct 28, 2024
1 parent 33c0f64 commit 93ec208
Showing 1 changed file with 33 additions and 79 deletions.
112 changes: 33 additions & 79 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -79792,7 +79792,8 @@ dictionary <dfn dictionary>ToggleEventInit</dfn> : <span>EventInit</span> {
<p>A node is a <dfn>focus navigation scope owner</dfn> if it is a <code>Document</code>, a
<span>shadow host</span>, a <span>slot</span>, an element in the <span
data-x="popover-showing-state">popover showing state</span> which also has a <span>popover
invoker</span> set, or a <span>reading flow scope owner</span>.</p>
invoker</span> set, a <span>reading flow container scope owner</span> or a <span
data-x="reading-flow-item">reading flow item</span>.</p>

<p>Each <span>focus navigation scope owner</span> has a <dfn>focus navigation scope</dfn>, which
is a list of elements. Its contents are determined as follows:</p>
Expand All @@ -79804,9 +79805,6 @@ dictionary <dfn dictionary>ToggleEventInit</dfn> : <span>EventInit</span> {
<ol>
<li><p>If <var>element</var>'s parent is null, then return null.</p></li>

<li><p>If <var>element</var> is a <span>reading flow scope owner</span>, then return
<var>element</var>.</p></li>

<li><p>If <var>element</var>'s parent is a <span>shadow host</span>, then return
<var>element</var>'s <span>assigned slot</span>.</p></li>

Expand All @@ -79819,6 +79817,9 @@ dictionary <dfn dictionary>ToggleEventInit</dfn> : <span>EventInit</span> {
<li><p>If <var>element</var> is in the <span data-x="popover-showing-state">popover showing
state</span> and has a <span>popover invoker</span> set, then return <var>element</var>.</p></li>

<li><p>If <var>element</var> is a <span>reading flow container scope owner</span> or a <span
data-x="reading-flow-item">reading flow item</span>, then return <var>element</var>.</p></li>

<li><p>Return <var>element</var>'s parent's <span>associated focus navigation owner</span>.</p></li>
</ol>

Expand All @@ -79829,8 +79830,8 @@ dictionary <dfn dictionary>ToggleEventInit</dfn> : <span>EventInit</span> {
<p class="note">The order of elements within a <span>focus navigation scope</span> does not impact
any of the algorithms in this specification. Ordering only becomes important for the
<span>tabindex-ordered focus navigation scope</span>, <span>flattened tabindex-ordered focus
navigation scope</span> and <span>reading-flow focus navigation scope</span> concepts defined
below.</p>
navigation scope</span> and <span>reading-flow-ordered focus navigation scope</span> concepts
defined below.</p>

<p>A <dfn>tabindex-ordered focus navigation scope</dfn> is a list of <span data-x="focusable
area">focusable areas</span> and <span data-x="focus navigation scope owner">focus navigation
Expand All @@ -79850,9 +79851,11 @@ dictionary <dfn dictionary>ToggleEventInit</dfn> : <span>EventInit</span> {
</ul>

<p>The order within a <span>tabindex-ordered focus navigation scope</span> is determined by each
element's <span>tabindex value</span> and, for <span>reading-flow focus navigation scope</span>,
by the special rules provided by the <span>sequential navigation search algorithm</span>. The
<span>tabindex value</span> takes precedence over <span>reading flow</span>.</p>
element's <span>tabindex value</span>.</p>

<p>A <dfn>reading-flow-ordered focus navigation scope</dfn> is a <span>tabindex-ordered focus
navigation scope</span> whose <span>focus navigation scope owner</span> is a <span>reading flow
container scope owner</span>. Its order is determined by the <span>reading flow order</span>.</p>

<p class="note">The rules there do not give a precise ordering, as they are composed mostly of
"<!--non-normative-->should" statements and relative orderings.</p>
Expand Down Expand Up @@ -80098,7 +80101,7 @@ dictionary <dfn dictionary>ToggleEventInit</dfn> : <span>EventInit</span> {
<span>'grid-rows'</span>, <span>'grid-columns'</span> or <span>'grid-order'</span>.</p></li>
</ul>

<p>A <dfn>reading flow scope owner</dfn> is either:</p>
<p>A <dfn>reading flow container scope owner</dfn> is either:</p>

<ul>
<li><p>a <span>reading flow container</span>.</p></li>
Expand All @@ -80108,7 +80111,7 @@ dictionary <dfn dictionary>ToggleEventInit</dfn> : <span>EventInit</span> {
</ul>

<p>A <dfn data-x="reading-flow-item">reading flow item</dfn> is an element whose <span>parent
element</span> is a <span>reading flow scope owner</span>.</p>
element</span> is a <span>reading flow container scope owner</span>.</p>

<p>A <dfn data-x="non-participating-reading-flow-item">non-participating reading flow item</dfn> is

Expand All @@ -80120,10 +80123,7 @@ dictionary <dfn dictionary>ToggleEventInit</dfn> : <span>EventInit</span> {
data-x="reading-flow-item">reading flow item</span> that is not a <span
data-x="non-participating-reading-flow-item">non-participating reading flow item</span>.</p>

<p>A <dfn>reading-flow focus navigation scope</dfn> is the <span>tabindex-ordered focus navigation
scope</span> of a <span>reading flow scope owner</span>.</p>

The <dfn>reading flow</dfn> order for a <span>reading-flow focus navigation scope</span> is
The <dfn>reading flow order</dfn> for a <span>reading-flow-ordered focus navigation scope</span> is
determined by the scope owner's computed value of the <span>'reading-flow'</span> property:

<ul>
Expand Down Expand Up @@ -80158,6 +80158,9 @@ dictionary <dfn dictionary>ToggleEventInit</dfn> : <span>EventInit</span> {
<span>tree order</span>.</p></li>
</ul>

<p>If a <span data-x="reading-flow-item">reading flow item</span> has a <span>tabindex value</span>
greater than zero, then let its value be readjusted to zero.</p>

</div>

<div w-nodev>
Expand Down Expand Up @@ -80784,19 +80787,22 @@ dictionary <dfn dictionary>ToggleEventInit</dfn> : <span>EventInit</span> {
focusable</span>.</p>
</li>

<li><p>If <var>candidate</var> is a <span data-x="reading-flow-item">reading flow item</span> or
null, <var>direction</var> is <i>forward</i>, and <var>starting point</var> is in a
<span>reading-flow focus navigation scope</span> <var>scope</var>, then let <var>new
candidate</var> be the result of running the <span>reading flow sequential navigation search
algorithm</span> given <var>candidate</var>, <var>direction</var>, and <var>starting
point</var>'s focus navigation <var>scope</var>.</p></li>
<li>
<p>If <var>starting point</var> is a <span data-x="reading-flow-item">reading flow item</span>
in a <span>reading-flow-ordered focus navigation scope</span> <var>scope</var>, then:</p>

<ol>
<li><p>Let <var>reading flow items</var> be the list of <span
data-x="reading-flow-item">reading flow items</span> owned by <var>scope</var>, sorted in
<span>reading flow order</span>.</p></li>

<li><p>If <var>starting point</var> is a <span data-x="reading-flow-item">reading flow
item</span>, <var>direction</var> is <i>backward</i>, and <var>starting point</var> is in a
<span>reading-flow focus navigation scope</span> <var>scope</var>, then let <var>new
candidate</var> be the result of running the <span>reading flow sequential navigation search
algorithm</span> given <var>starting point</var>, <var>direction</var>, and <var>starting
point</var>'s focus navigation <var>scope</var>.</p></li>
<li><p>If <var>direction</var> is <i>forward</i>, then let <var>candidate</var> be the item
that comes after <var>starting point</var> in <var>reading flow items</var>.</p></li>

<li><p>Otherwise, let <var>candidate</var> be the item that comes before <var>starting
point</var> in <var>reading flow items</var>.</p></li>
</ol>
</li>

<li>
<p>If <var>candidate</var> is a <span>navigable container</span> with a non-null <span>content
Expand Down Expand Up @@ -80829,58 +80835,6 @@ dictionary <dfn dictionary>ToggleEventInit</dfn> : <span>EventInit</span> {
<li><p>Return <var>candidate</var>.</p></li>
</ol>

<p>The <dfn>reading flow sequential navigation search algorithm</dfn>, given a <span
data-x="reading-flow-item">reading flow item</span> <var>current</var>, a sequential focus
direction <var>direction</var> and a <span>reading-flow focus navigation scope</span>
<var>scope</var>, consists of the following steps. They return a <span>focusable
area</span>-or-null.</p>

<ol>
<li><p> Let <var>reading flow items</var> be the list of <span
data-x="reading-flow-item">reading flow items</span> owned by <var>scope</var>, sorted in
<span>reading flow</span>.</p></li>

<li><p>If <var>reading flow items</var> is empty, then return null.</p></li>

<li>
<p>If <var>direction</var> is <i>forward</i>, then:</p>
<ol>
<li><p>If <var>current</var> is the <span data-x="reading-flow-item">reading flow
item</span> from <var>reading flow items</var> that comes first in <span>tree order</span>,
return first item in <var>reading flow items</var>.</p></li>

<li><p>If <var>current</var> is null, let <var>previous</var> be the <span
data-x="reading-flow-item">reading flow item</span> from <var>reading flow items</var> that
comes last in <span>tree order</span>.</p></li>

<li><p>Otherwise, let <var>previous</var> be the <span data-x="reading-flow-item">reading
flow item</span> that comes before <var>current</var> in <span>tree order</span>.</p></li>

<li><p>If <var>previous</var> is the last item in <var>reading flow items</var>, then return
null. </p></li>

<li><p>Otherwise, return the <span data-x="reading-flow-item">reading flow item</span> that
comes after <var>previous</var> in <var>reading flow items</var>.</p></li>
</ol>
</li>
<li>
<p>Otherwise:</p>
<ol>
<li><p>Let <var>previous</var> be the <span data-x="list item">item</span> preceding
<var>current</var> in <var>reading flow items</var> if one exists, and null
otherwise.</p></li>

<li><p>If <var>previous</var> is null, then return null.</p></li>

<li><p>Otherwise, if <var>previous</var> does not have a <span
data-x="concept-tree-child">child</span>, return <var>previous</var>.</p></li>

<li><p>Otherwise, return the <span data-x="concept-tree-last-child">last child</span> of
<var>previous</var>.</p></li>
</ol>
</li>
</ol>

</div>


Expand Down

0 comments on commit 93ec208

Please sign in to comment.