From 8a1ee6d01d67bb7dc8e40fdf36b510a1d6b29674 Mon Sep 17 00:00:00 2001 From: Di Zhang Date: Mon, 28 Oct 2024 15:00:58 -0700 Subject: [PATCH] Update definitions to make reading flow item a scope owner --- source | 112 +++++++++++++++++---------------------------------------- 1 file changed, 33 insertions(+), 79 deletions(-) diff --git a/source b/source index 2a3dc121c57..372c7d891a7 100644 --- a/source +++ b/source @@ -79792,7 +79792,8 @@ dictionary ToggleEventInit : EventInit {

A node is a focus navigation scope owner if it is a Document, a shadow host, a slot, an element in the popover showing state which also has a popover - invoker set, or a reading flow scope owner.

+ invoker set, a reading flow container scope owner or a reading flow item.

Each focus navigation scope owner has a focus navigation scope, which is a list of elements. Its contents are determined as follows:

@@ -79804,9 +79805,6 @@ dictionary ToggleEventInit : EventInit {
  1. If element's parent is null, then return null.

  2. -
  3. If element is a reading flow scope owner, then return - element.

  4. -
  5. If element's parent is a shadow host, then return element's assigned slot.

  6. @@ -79819,6 +79817,9 @@ dictionary ToggleEventInit : EventInit {
  7. If element is in the popover showing state and has a popover invoker set, then return element.

  8. +
  9. If element is a reading flow container scope owner or a reading flow item, then return element.

  10. +
  11. Return element's parent's associated focus navigation owner.

@@ -79829,8 +79830,8 @@ dictionary ToggleEventInit : EventInit {

The order of elements within a focus navigation scope does not impact any of the algorithms in this specification. Ordering only becomes important for the tabindex-ordered focus navigation scope, flattened tabindex-ordered focus - navigation scope and reading-flow focus navigation scope concepts defined - below.

+ navigation scope and reading-flow-ordered focus navigation scope concepts + defined below.

A tabindex-ordered focus navigation scope is a list of focusable areas and focus navigation @@ -79850,9 +79851,11 @@ dictionary ToggleEventInit : EventInit {

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

+ element's tabindex value.

+ +

A reading-flow-ordered focus navigation scope is a tabindex-ordered focus + navigation scope whose focus navigation scope owner is a reading flow + container scope owner. Its order is determined by the reading flow order.

The rules there do not give a precise ordering, as they are composed mostly of "should" statements and relative orderings.

@@ -80098,7 +80101,7 @@ dictionary ToggleEventInit : EventInit { 'grid-rows', 'grid-columns' or 'grid-order'.

-

A reading flow scope owner is either:

+

A reading flow container scope owner is either:

A reading flow item is an element whose parent - element is a reading flow scope owner.

+ element is a reading flow container scope owner.

A non-participating reading flow item is @@ -80120,10 +80123,7 @@ dictionary ToggleEventInit : EventInit { data-x="reading-flow-item">reading flow item that is not a non-participating reading flow item.

-

A reading-flow focus navigation scope is the tabindex-ordered focus navigation - scope of a reading flow scope owner.

- - The reading flow order for a reading-flow focus navigation scope is + The reading flow order for a reading-flow-ordered focus navigation scope is determined by the scope owner's computed value of the 'reading-flow' property: +

If a reading flow item has a tabindex value + greater than zero, then let its value be readjusted to zero.

+
@@ -80784,19 +80787,22 @@ dictionary ToggleEventInit : EventInit { focusable.

-
  • If candidate is a reading flow item or - null, direction is forward, and starting point is in a - reading-flow focus navigation scope scope, then let new - candidate be the result of running the reading flow sequential navigation search - algorithm given candidate, direction, and starting - point's focus navigation scope.

  • +
  • +

    If starting point is a reading flow item + in a reading-flow-ordered focus navigation scope scope, then:

    + +
      +
    1. Let reading flow items be the list of reading flow items owned by scope, sorted in + reading flow order.

    2. -
    3. If starting point is a reading flow - item, direction is backward, and starting point is in a - reading-flow focus navigation scope scope, then let new - candidate be the result of running the reading flow sequential navigation search - algorithm given starting point, direction, and starting - point's focus navigation scope.

    4. +
    5. If direction is forward, then let candidate be the item + that comes after starting point in reading flow items.

    6. + +
    7. Otherwise, let candidate be the item that comes before starting + point in reading flow items.

    8. +
    +
  • If candidate is a navigable container with a non-null content @@ -80819,58 +80825,6 @@ dictionary ToggleEventInit : EventInit {

  • Return candidate.

  • -

    The reading flow sequential navigation search algorithm, given a reading flow item current, a sequential focus - direction direction and a reading-flow focus navigation scope - scope, consists of the following steps. They return a focusable - area-or-null.

    - -
      -
    1. Let reading flow items be the list of reading flow items owned by scope, sorted in - reading flow.

    2. - -
    3. If reading flow items is empty, then return null.

    4. - -
    5. -

      If direction is forward, then:

      -
        -
      1. If current is the reading flow - item from reading flow items that comes first in tree order, - return first item in reading flow items.

      2. - -
      3. If current is null, let previous be the reading flow item from reading flow items that - comes last in tree order.

      4. - -
      5. Otherwise, let previous be the reading - flow item that comes before current in tree order.

      6. - -
      7. If previous is the last item in reading flow items, then return - null.

      8. - -
      9. Otherwise, return the reading flow item that - comes after previous in reading flow items.

      10. -
      -
    6. -
    7. -

      Otherwise:

      -
        -
      1. Let previous be the item preceding - current in reading flow items if one exists, and null - otherwise.

      2. - -
      3. If previous is null, then return null.

      4. - -
      5. Otherwise, if previous does not have a child, return previous.

      6. - -
      7. Otherwise, return the last child of - previous.

      8. -
      -
    8. -
    -