From c607b2546f9e1973666addc59f543b5299084900 Mon Sep 17 00:00:00 2001 From: Rakina Zata Amni Date: Wed, 24 Jul 2019 21:53:40 +0900 Subject: [PATCH 1/8] Handle shadow host with delegatesFocus=true in Element.focus() --- source | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source b/source index 5699ab6fbee..4f2a9eb7045 100644 --- a/source +++ b/source @@ -74076,6 +74076,17 @@ END:VCARD +
If new focus target is a shadow host whose + shadow + root's delegates focus is true and whose flattened tabindex-ordered + focus navigation scope scope is not empty
+ +
+ +

Let new focus target be the first focusable area in + scope.

+ +
Otherwise
From 99079f145fcaf682acb92a72b8ae6d6fe7fda8e2 Mon Sep 17 00:00:00 2001 From: Rakina Zata Amni Date: Wed, 25 Sep 2019 16:15:35 +0900 Subject: [PATCH 2/8] Rebase & use first in flat tree order --- source | 44 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/source b/source index 4f2a9eb7045..99ea892bf3d 100644 --- a/source +++ b/source @@ -3921,6 +3921,12 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute algorithms for DOMMatrix2DInit or DOMMatrixInit +

The following terms are defined in the CSS Scoping:

+ + +
Intersection Observer
@@ -73696,7 +73702,7 @@ END:VCARD

If the activation behavior of a click focusable focusable area is triggered, the user agent must run the focusing steps on the - focusable area's DOM anchor.

+ focusable area with focus trigger set to "click".


@@ -74009,7 +74015,7 @@ END:VCARD

The focusing steps for an object new focus target that is either a focusable area, or an element that is not a focusable area, or a browsing context, are as follows. They can optionally be run with a fallback - target.

+ target and a string focus trigger.

    @@ -74078,27 +74084,42 @@ END:VCARD
    If new focus target is a shadow host whose shadow - root's delegates focus is true and whose flattened tabindex-ordered - focus navigation scope scope is not empty
    + root's delegates focus is true
    -

    Let new focus target be the first focusable area in - scope.

    +

    If focus trigger is "click", then let new focus target be the first + click focusable focusable area whose DOM anchor is + positioned after new focus target in the flat tree, in tree + order, or null if it does not exist.

    + +

    Otherwise, let new focus target be the first focusable area + whose DOM anchor is positioned after new focus target in the + flat tree, in tree order, or null if it does not exist.

    Otherwise
    +

    Set new focus target to null.

    +
    + + -

    If no fallback target was specified, abort the focusing steps.

    + -

    Otherwise, let new focus target be the fallback target.

    +
  1. - +

    If new focus target is null, then:

    - +
      +
    1. If no fallback target was specified, abort the focusing + steps.

    2. + +
    3. Otherwise, let new focus target be the fallback + target.

    4. +
  2. @@ -123692,6 +123713,9 @@ INSERT INTERFACES HERE
    [CSSRUBY]
    CSS3 Ruby Module, R. Ishida. W3C.
    +
    [CSSSCOPING]
    +
    CSS Scoping Module, T. Atkins. W3C.
    +
    [CSSSIZING]
    CSS Intrinsic & Extrinsic Sizing Module, T. Atkins, E. Etemad. W3C.
    From 7e3ea9a0b199e11e615137e893cf6c5ca1316851 Mon Sep 17 00:00:00 2001 From: Rakina Zata Amni Date: Wed, 25 Sep 2019 17:45:57 +0900 Subject: [PATCH 3/8] Can only delegate focus to descendants --- source | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/source b/source index 99ea892bf3d..f4f42e2e407 100644 --- a/source +++ b/source @@ -74088,14 +74088,17 @@ END:VCARD
    -

    If focus trigger is "click", then let new focus target be the first - click focusable focusable area whose DOM anchor is - positioned after new focus target in the flat tree, in tree - order, or null if it does not exist.

    - -

    Otherwise, let new focus target be the first focusable area - whose DOM anchor is positioned after new focus target in the - flat tree, in tree order, or null if it does not exist.

    +

    If focus trigger is "click", then let possible focus delegates be + the list of all click focusable focusable + areas whose DOM anchor is a descendant of new focus target + in the flat tree.

    +

    Otherwise, let possible focus delegates be the list of all focusable areas whose DOM anchor is a descendant + of new focus target in the flat tree.

    + +

    Let new focus target be the first focusable area in tree + order of its DOM anchor in possible focus delegates, or + null if possible focus delegates is empty.

    From a384915aae63e420a4b37e9b8000c2d768e48931 Mon Sep 17 00:00:00 2001 From: Rakina Zata Amni Date: Fri, 27 Sep 2019 13:26:30 +0900 Subject: [PATCH 4/8] Add note about click() --- source | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/source b/source index f4f42e2e407..fcc33eff0d0 100644 --- a/source +++ b/source @@ -73700,9 +73700,15 @@ END:VCARD focusable via user interaction, only via programmatic APIs.

    -

    If the activation behavior of a click focusable focusable - area is triggered, the user agent must run the focusing steps on the - focusable area with focus trigger set to "click".

    +

    When a user activates a click focusable focusable + area, the user agent must run the focusing steps on the focusable + area with focus trigger set to "click".

    + +
    + Note that focusing is not an activation behavior, i.e. calling the click() method on an element or dispatching a synthetic click event on it won't cause the element to get focused. +

    From 5bf29d7983b3621d1066e851659f5ca4d811723c Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Thu, 26 Sep 2019 17:19:18 +0900 Subject: [PATCH 5/8] Editorial tweaks, including to pre-existing text; add a note --- source | 56 +++++++++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/source b/source index fcc33eff0d0..49ed3915bfe 100644 --- a/source +++ b/source @@ -74020,8 +74020,8 @@ END:VCARD

    The focusing steps for an object new focus target that is either a focusable area, or an element that is not a focusable area, or - a browsing context, are as follows. They can optionally be run with a fallback - target and a string focus trigger.

    + a browsing context, are as follows. They can optionally be run with a fallback + target and a string focus trigger.

      @@ -74040,8 +74040,8 @@ END:VCARD
      -

      Let new focus target be the shape corresponding to the first - img element in tree order that uses the image map to which the area +

      Set new focus target to the shape corresponding to the first img + element in tree order that uses the image map to which the area element belongs.

      @@ -74052,8 +74052,8 @@ END:VCARD
      -

      Let new focus target be the element's first scrollable region, - according to a pre-order, depth-first traversal of the box tree.

      +

      Set new focus target to the element's first scrollable region, according to a + pre-order, depth-first traversal of the box tree.

      @@ -74072,7 +74072,7 @@ END:VCARD
      -

      Let new focus target be the browsing context's +

      Set new focus target to the browsing context's active document.

      @@ -74083,28 +74083,35 @@ END:VCARD
      -

      Let new focus target be the browsing context container's nested browsing context's - active document.

      +

      Set new focus target to the browsing context container's + nested browsing context's active document.

      -
      If new focus target is a shadow host whose - shadow - root's delegates focus is true
      +
      If new focus target is a shadow host whose shadow root's delegates focus is + true
      -

      If focus trigger is "click", then let possible focus delegates be - the list of all click focusable focusable - areas whose DOM anchor is a descendant of new focus target - in the flat tree.

      +

      If focus trigger is "click", then let possible focus + delegates be the list of all click focusable focusable areas whose DOM anchor is a descendant of new focus + target in the flat tree.

      +

      Otherwise, let possible focus delegates be the list of all focusable areas whose DOM anchor is a descendant of new focus target in the flat tree.

      -

      Let new focus target be the first focusable area in tree - order of its DOM anchor in possible focus delegates, or - null if possible focus delegates is empty.

      +

      Set new focus target to the first focusable area in tree + order of their DOM anchors in possible focus + delegates, or null if possible focus delegates is empty.

      + +

      For sequential focusability, the + handling of shadow hosts and delegates focus is + done when constructing the sequential focus navigation order. That is, the + focusing steps will never be called on such shadow + hosts as part of sequential focus navigation.

      @@ -74123,11 +74130,10 @@ END:VCARD

      If new focus target is null, then:

        -
      1. If no fallback target was specified, abort the focusing - steps.

      2. +
      3. If no fallback target was specified, then return.

      4. -
      5. Otherwise, let new focus target be the fallback - target.

      6. +
      7. Otherwise, set new focus target to the fallback + target.

      @@ -74136,7 +74142,7 @@ END:VCARD

      If new focus target is a browsing context container with - non-null nested browsing context, then let new focus target be the + non-null nested browsing context, then set new focus target to the nested browsing context's active document, and redo this step.

      @@ -84804,7 +84810,7 @@ new PaymentRequest(…); // Allowed to use set to "nearest".

    1. Run the focusing steps for target, with the - Document's viewport as the fallback target.

    2. + Document's viewport as the fallback target.

    3. Move the sequential focus navigation starting point to target.

    4. From f90ea02fecb0162b4f3c40a46bbff04c9acd50cf Mon Sep 17 00:00:00 2001 From: Rakina Zata Amni Date: Tue, 1 Oct 2019 12:30:27 +0900 Subject: [PATCH 6/8] remove box tree --- source | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/source b/source index 49ed3915bfe..ca3c9be86ed 100644 --- a/source +++ b/source @@ -73572,13 +73572,6 @@ END:VCARD in this specification.

      -

      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 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 @@ -74053,7 +74046,7 @@ END:VCARD

      Set new focus target to the element's first scrollable region, according to a - pre-order, depth-first traversal of the box tree.

      + pre-order, depth-first traversal of the flat tree.

      From 36ed900a1fa6db6c55c22b6591071af5e9eefee2 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Wed, 16 Oct 2019 15:01:33 +0900 Subject: [PATCH 7/8] Final tweaksgit add . --- source | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/source b/source index ca3c9be86ed..1c53f5e82ba 100644 --- a/source +++ b/source @@ -73570,9 +73570,6 @@ END:VCARD

      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.

      - - -

      The currently focused area of a top-level browsing context at any particular time is the focusable area returned by this algorithm:

      @@ -73695,13 +73692,11 @@ END:VCARD

      When a user activates a click focusable focusable area, the user agent must run the focusing steps on the focusable - area with focus trigger set to "click".

      + area with focus trigger set to "click".

      -
      - Note that focusing is not an activation behavior, i.e. calling the click() method on an element or dispatching a synthetic click event on it won't cause the element to get focused. -
      +

      Note that focusing is not an activation behavior, i.e. calling the click() method on an element or dispatching a synthetic click event on it won't cause the element to get focused.


      From f4f734aaaa915804d9f35923bbf69541cea18a29 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Wed, 16 Oct 2019 15:39:01 +0900 Subject: [PATCH 8/8] Also link activation behavior --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index 1c53f5e82ba..1316abbbad4 100644 --- a/source +++ b/source @@ -73694,8 +73694,8 @@ END:VCARD area, the user agent must run the focusing steps on the focusable area with focus trigger set to "click".

      -

      Note that focusing is not an activation behavior, i.e. calling the click() method on an element or dispatching a synthetic Note that focusing is not an activation behavior, i.e. calling the + click() method on an element or dispatching a synthetic click event on it won't cause the element to get focused.