From 6150b78331facf00e4ece3bb39192aa8319ce8ad Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Wed, 17 Feb 2021 17:34:48 -0800 Subject: [PATCH 01/17] Expand
for find-in-page and element fragments Addresses #4051 --- source | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/source b/source index 475ddd6c3e4..18d8b6294cd 100644 --- a/source +++ b/source @@ -75340,6 +75340,13 @@ body { display:none } can navigate through the matches by advancing the active match using the find-in-page interface.

+

When a find-in-page search encounters a details element which is not open, it should search the hidden contents inside the + details element as if it were open, but without adding the open attribute. If a match inside the closed contents becomes + the active match, the details element as well as any other + details elements in the ancestor chain containing the match should be opened. +

Issue #3539 tracks standardizing how find-in-page underlies the currently-unspecified window.find() API.

@@ -86015,6 +86022,11 @@ new PaymentRequest(…); // Allowed to use
  • Set the Document's target element to target.

  • +
  • If there are one or more details elements in the ancestor chain of + target which are not open, then open the details element(s) containing + target. +

  • Scroll target into view, with behavior set to "auto", block set to "start", and inline set to "nearest".

  • @@ -114491,8 +114503,9 @@ details[open] > summary { expected to allow the user to request the details be shown or hidden.

    The details element's second slot is expected - to be removed from the rendering when the details element does not have an open attribute.

    + to be hidden when the details element does not have an open attribute. The method used to hide the content is a + user-agent choice.

    From 2ff7386cf8ccb3ae24c7fc09eb25034f4913c370 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Mon, 8 Mar 2021 18:52:02 -0800 Subject: [PATCH 02/17] Rewrite find-in-page section and revert rendering section --- source | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/source b/source index 18d8b6294cd..8ca7bcf8955 100644 --- a/source +++ b/source @@ -75340,12 +75340,16 @@ body { display:none } can navigate through the matches by advancing the active match using the find-in-page interface.

    -

    When a find-in-page search encounters a details element which is not open, it should search the hidden contents inside the - details element as if it were open, but without adding the open attribute. If a match inside the closed contents becomes - the active match, the details element as well as any other - details elements in the ancestor chain containing the match should be opened. +

    When a find-in-page search begins, all details elements in the page which are not + open should be rendered as if they were open so that + find-in-page can look for matches inside of them, but without modifying the open attribute. After the find-in-page search is done, the + closed details elements should go back to not being rendered. + + When find-in-page chooses a new active match, all + details elements in the flat tree ancestor chain of the active match must be opened if the are not already open before + the active match is scrolled into view.

    Issue #3539 tracks standardizing how find-in-page underlies the currently-unspecified summary { expected to allow the user to request the details be shown or hidden.

    The details element's second slot is expected - to be hidden when the details element does not have an open attribute. The method used to hide the content is a - user-agent choice.

    + to be removed from the rendering when the details element does not have an open attribute.

    From 738da4bfce02bcd907f435a6e1ab161c333e4254 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Wed, 7 Apr 2021 16:55:09 -0700 Subject: [PATCH 03/17] Add ancestor details revealing algorithm --- source | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/source b/source index 8ca7bcf8955..7ee6ea4957e 100644 --- a/source +++ b/source @@ -56988,6 +56988,18 @@ interface HTMLDetailsElement : HTMLElement { <p>Direction: North</p> </details>
    +

    The ancestor details revealing algorithm is to run the following steps on + currentNode:

    + +
      +
    1. If currentNode is slotted into the second slot of a details element, open the details + element and add the open attribute to the details + element. Then, let currentNode be the details element which was just opened and go to step + 1.

    2. + +
    3. If currentNode has a parent node, let currentNode be the parent and go to step 1.

    4. +
    + @@ -75340,16 +75352,15 @@ body { display:none } can navigate through the matches by advancing the active match using the find-in-page interface.

    -

    When a find-in-page search begins, all details elements in the page which are not - open should be rendered as if they were open so that - find-in-page can look for matches inside of them, but without modifying the open attribute. After the find-in-page search is done, the - closed details elements should go back to not being rendered. +

    When find-in-page begins searching for matches, all details elements in the page + which are not open should have their second slot be added + to the rendering without modifying the open attribute. + After find-in-page finishes searching for matches, those details elements should have their second + slot be removed from the rendering again.

    - When find-in-page chooses a new active match, all - details elements in the flat tree ancestor chain of the active match must be opened if the are not already open before - the active match is scrolled into view. +

    When find-in-page chooses a new active match, run the + ancestor details revealing algorithm on the first node in the active match.

    Issue #3539 tracks standardizing how find-in-page underlies the currently-unspecified

    Set the Document's target element to target.

    -
  • If there are one or more details elements in the ancestor chain of - target which are not open, then open the details element(s) containing - target. +

  • Run the ancestor details revealing algorithm on target.

  • Scroll target into view, with behavior set to "auto", block set to "start", and inline From 21ee9bda19c2a2db8e554072034e0dd3940dafc1 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Wed, 28 Apr 2021 19:46:27 -0700 Subject: [PATCH 04/17] Adjust algorithms --- source | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/source b/source index 7ee6ea4957e..b297a580c2c 100644 --- a/source +++ b/source @@ -56992,12 +56992,12 @@ interface HTMLDetailsElement : HTMLElement { currentNode:

      -
    1. If currentNode is slotted into the second slot of a details element, open the details - element and add the open attribute to the details - element. Then, let currentNode be the details element which was just opened and go to step - 1.

    2. +
    3. While currentNode has a parent node, perform the following steps:

    4. -
    5. If currentNode has a parent node, let currentNode be the parent and go to step 1.

    6. +
    7. If currentNode is slotted into the second slot of a details element, add the open attribute to the details element. Then, let currentNode + be the details element which was just opened. Otherwise, let currentNode be the parent node of + currentNode.

    @@ -75362,6 +75362,17 @@ body { display:none } ancestor details revealing algorithm on the first node in the active match. +

    When find-in-page chooses a new active match, perform + the following steps:

    + +
      +
    1. Let node be the first node in the active + match.

    2. + +
    3. Queue a global task on the user interaction task source given node's relevant global + object to run the ancestor details revealing algorithm on node.

    4. +
    +

    Issue #3539 tracks standardizing how find-in-page underlies the currently-unspecified window.find() API.

    From 0e4b44a350258b4b3dddac94da436316976490bd Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Wed, 5 May 2021 18:35:02 -0700 Subject: [PATCH 05/17] Add s and s, use list for conditional --- source | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/source b/source index b297a580c2c..e64be9a6203 100644 --- a/source +++ b/source @@ -56992,12 +56992,21 @@ interface HTMLDetailsElement : HTMLElement { currentNode:

      -
    1. While currentNode has a parent node, perform the following steps:

    2. +
    3. While currentNode has a parent node, perform the following steps:

    4. -
    5. If currentNode is slotted into the second slot of a details element, add the open attribute to the details element. Then, let currentNode - be the details element which was just opened. Otherwise, let currentNode be the parent node of - currentNode.

    6. +
    7. If currentNode is slotted into the second slot of a details + element:

      + +
        +
      1. let currentNode be the details element which + currentNode is slotted into.

      2. + +
      3. Add the open attribute to + currentNode.

      4. +
      + +
    8. Otherwise, let currentNode be the parent node of + currentNode.

    9. .
    @@ -75356,21 +75365,19 @@ body { display:none } which are not open should have their second slot be added to the rendering without modifying the open attribute. After find-in-page finishes searching for matches, those details elements should have their second - slot be removed from the rendering again.

    - -

    When find-in-page chooses a new active match, run the - ancestor details revealing algorithm on the first node in the active match. + slot be removed from the rendering again. This entire process must happen synchronously (and so is + not observable to users or to author code).

    When find-in-page chooses a new active match, perform the following steps:

      -
    1. Let node be the first node in the active +

    2. Let node be the first node in the active match.

    3. -
    4. Queue a global task on the user interaction task source given node's relevant global - object to run the ancestor details revealing algorithm on node.

    5. +
    6. Queue a global task on the user interaction task source given + node's relevant global object to run the ancestor details + revealing algorithm on node.

    Issue #3539 tracks @@ -86048,7 +86055,7 @@ new PaymentRequest(…); // Allowed to use

  • Set the Document's target element to target.

  • -
  • Run the ancestor details revealing algorithm on target. +

  • Run the ancestor details revealing algorithm on target.

  • Scroll target into view, with behavior set to "auto", block set to "start", and inline From 60e8e57f3b3d385d2d2bc2038ebb83a908c72837 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Thu, 6 May 2021 09:24:46 -0700 Subject: [PATCH 06/17] Fixed

    after
  • --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index e64be9a6203..a57da453dbc 100644 --- a/source +++ b/source @@ -57006,7 +57006,7 @@ interface HTMLDetailsElement : HTMLElement {
  • Otherwise, let currentNode be the parent node of - currentNode.

  • . + currentNode.

    . From f07c1fba5b0d5f033cbd695f9c3eacecd7bae89c Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Thu, 6 May 2021 20:08:27 -0700 Subject: [PATCH 07/17] More formatting --- source | 54 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/source b/source index cf7aa618060..c99326f0a71 100644 --- a/source +++ b/source @@ -57097,6 +57097,33 @@ interface HTMLDetailsElement : HTMLElement { +

    The ancestor details revealing algorithm is to run the following steps on + currentNode:

    + +
      +
    1. +

      While currentNode has a parent node, perform the following steps:

      + +
        +
      1. If currentNode is slotted into the second slot of a details + element:

        + +
          +
        1. Set currentNode to the details element which + currentNode is slotted into.

        2. + +
        3. Set the open attribute on currentNode to the empty + string.

        4. +
        +
      2. + +
      3. Otherwise, set currentNode to the parent node of + currentNode.

      4. . +
      +
    2. +
    +

    The following example shows the details element being used to hide technical @@ -57158,27 +57185,6 @@ interface HTMLDetailsElement : HTMLElement { <p>Direction: North</p> </details> -

    The ancestor details revealing algorithm is to run the following steps on - currentNode:

    - -
      -
    1. While currentNode has a parent node, perform the following steps:

    2. - -
    3. If currentNode is slotted into the second slot of a details - element:

      - -
        -
      1. let currentNode be the details element which - currentNode is slotted into.

      2. - -
      3. Add the open attribute to - currentNode.

      4. -
      - -
    4. Otherwise, let currentNode be the parent node of - currentNode.

    5. . -
    -
    @@ -76164,9 +76170,9 @@ body { display:none }

    When find-in-page begins searching for matches, all details elements in the page which are not open should have their second slot be added to the rendering without modifying the open attribute. - After find-in-page finishes searching for matches, those details elements should have their second - slot be removed from the rendering again. This entire process must happen synchronously (and so is - not observable to users or to author code).

    + After find-in-page finishes searching for matches, those details elements should have + their second slot be removed from the rendering again. This entire process must happen + synchronously (and so is not observable to users or to author code).

    When find-in-page chooses a new active match, perform the following steps:

    From 96b233db6432b1a1bc05e3c99207667e402ba32b Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Fri, 7 May 2021 18:19:33 -0400 Subject: [PATCH 08/17] Final nit --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index c99326f0a71..51299fb93b1 100644 --- a/source +++ b/source @@ -57102,7 +57102,7 @@ interface HTMLDetailsElement : HTMLElement {
    1. -

      While currentNode has a parent node, perform the following steps:

      +

      While currentNode has a parent node:

      1. If currentNode is slotted into the second slot of a details From b2dc5996bc05f47cea4a00a3c081ba7faf7bf035 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Tue, 11 May 2021 10:43:22 -0700 Subject: [PATCH 09/17] Address comments --- source | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/source b/source index 51299fb93b1..d51217905f5 100644 --- a/source +++ b/source @@ -57105,8 +57105,9 @@ interface HTMLDetailsElement : HTMLElement {

        While currentNode has a parent node:

          -
        1. If currentNode is slotted into the second slot of a details - element:

          +
        2. +

          If currentNode is slotted into the second slot of a details + element:

          1. Set currentNode to the details element which @@ -76168,22 +76169,23 @@ body { display:none } data-x="fip-active-match">active match using the find-in-page interface.

            When find-in-page begins searching for matches, all details elements in the page - which are not open should have their second slot be added - to the rendering without modifying the open attribute. - After find-in-page finishes searching for matches, those details elements should have - their second slot be removed from the rendering again. This entire process must happen + which do not have their open attribute set should have + their second slot act as if it is added to the rendering without modifying the open attribute in order to make find-in-page able to search + through it. After find-in-page finishes searching for matches, those details elements + should have their second slot be removed from the rendering again. This entire process must happen synchronously (and so is not observable to users or to author code).

            When find-in-page chooses a new active match, perform the following steps:

              -
            1. Let node be the first node in the active - match.

            2. +
            3. Let node be the first node in the active + match.

            4. -
            5. Queue a global task on the user interaction task source given - node's relevant global object to run the ancestor details - revealing algorithm on node.

            6. +
            7. Queue a global task on the user interaction task source given + node's relevant global object to run the ancestor details + revealing algorithm on node.

            Issue #3539 tracks From a3dadcf22ab0bfcfe6ccd1ad583c2c136b2ec734 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Tue, 18 May 2021 17:23:04 -0700 Subject: [PATCH 10/17] Add case for open attribute already set --- source | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source b/source index d51217905f5..5f2b12c14c4 100644 --- a/source +++ b/source @@ -57113,9 +57113,10 @@ interface HTMLDetailsElement : HTMLElement {

          2. Set currentNode to the details element which currentNode is slotted into.

          3. -
          4. Set the open attribute on currentNode to the empty - string.

          5. +
          6. If the open attribute is not set on + currentNode, then Set + the open attribute on currentNode to the + empty string.

        3. From 17176013dab9e9dabe8dbae51dbd4645cc9bd5a4 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Wed, 9 Jun 2021 15:24:34 -0700 Subject: [PATCH 11/17] Added content-visibility:hidden --- source | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/source b/source index 5f2b12c14c4..1be7807fcba 100644 --- a/source +++ b/source @@ -76170,12 +76170,13 @@ body { display:none } data-x="fip-active-match">active match using the find-in-page interface.

          When find-in-page begins searching for matches, all details elements in the page - which do not have their open attribute set should have - their second slot act as if it is added to the rendering without modifying the open attribute in order to make find-in-page able to search - through it. After find-in-page finishes searching for matches, those details elements - should have their second slot be removed from the rendering again. This entire process must happen - synchronously (and so is not observable to users or to author code).

          + which do not have their open attribute set should have the + skipped contents of their + second slot become accessible. without modifying the open + attribute in order to make find-in-page able to search through it. After find-in-page finishes + searching for matches, those details elements should have their contents become + skipped again. This entire process must happen synchronously (and so is not observable to users or + to author code).

          When find-in-page chooses a new active match, perform the following steps:

          @@ -115871,9 +115872,9 @@ details[open] > summary {

          The details element's first summary element child, if any, is expected to allow the user to request the details be shown or hidden.

          -

          The details element's second slot is expected - to be removed from the rendering when the details element does not have an open attribute.

          +

          The details element's second slot must have the + style "display:block; content-visibility:hidden" when the details + element does not have an open attribute.

          From b6bd17a2cd71867ed131ddd2a4915f475ec802c1 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Wed, 16 Jun 2021 13:59:15 -0700 Subject: [PATCH 12/17] must -> expected to --- source | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source b/source index 1be7807fcba..dd179a1741d 100644 --- a/source +++ b/source @@ -115872,9 +115872,10 @@ details[open] > summary {

          The details element's first summary element child, if any, is expected to allow the user to request the details be shown or hidden.

          -

          The details element's second slot must have the - style "display:block; content-visibility:hidden" when the details - element does not have an open attribute.

          +

          The details element's second slot is expected + to have the style "display:block; content-visibility:hidden" when the + details element does not have an open + attribute.

          From 3cdc0be508366d9717d365f7e105901cc996d51c Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Wed, 16 Jun 2021 15:37:54 -0700 Subject: [PATCH 13/17] Use style attribute --- source | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source b/source index dd179a1741d..182b04bf298 100644 --- a/source +++ b/source @@ -115873,9 +115873,10 @@ details[open] > summary { expected to allow the user to request the details be shown or hidden.

          The details element's second slot is expected - to have the style "display:block; content-visibility:hidden" when the + to have its style attribute set to "display:block; content-visibility:hidden" when the details element does not have an open - attribute.

          + attribute. When it does have the open attribute, the style + attribute is expected to be removed from the second slot.

          From 07f4bd8f71f65a7305fdca89b7da74d2f6232a6a Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Wed, 16 Jun 2021 15:40:47 -0700 Subject: [PATCH 14/17] Add missing
          --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index 182b04bf298..44f3b03a976 100644 --- a/source +++ b/source @@ -115876,7 +115876,7 @@ details[open] > summary { to have its style attribute set to "display:block; content-visibility:hidden" when the details element does not have an open attribute. When it does have the open attribute, the style - attribute is expected to be removed from the second slot.

          + attribute is expected to be removed from the second slot.

          From 5d1e8c7829e0ba8158655052fbda10946a7be2df Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Thu, 17 Jun 2021 09:40:30 -0700 Subject: [PATCH 15/17] Add to style attribute --- source | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source b/source index 44f3b03a976..30b4bf6ae8d 100644 --- a/source +++ b/source @@ -115873,9 +115873,10 @@ details[open] > summary { expected to allow the user to request the details be shown or hidden.

          The details element's second slot is expected - to have its style attribute set to "display:block; content-visibility:hidden" when the - details element does not have an open - attribute. When it does have the open attribute, the style + to have its style attribute set to "display:block; + content-visibility:hidden" when the details element does not have an open attribute. When it does have the open attribute, the style attribute is expected to be removed from the second slot.

          From 295912a091dd61c64803d0faaa503df64335f635 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Wed, 28 Jul 2021 13:10:05 -0700 Subject: [PATCH 16/17] Add flat tree --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index 30b4bf6ae8d..c08f45cedaf 100644 --- a/source +++ b/source @@ -57121,7 +57121,7 @@ interface HTMLDetailsElement : HTMLElement {
        4. Otherwise, set currentNode to the parent node of - currentNode.

        5. . + currentNode within the flat tree.

          .
      From 4054db908d715dabe996dc4e494e9f628c294305 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Thu, 5 Aug 2021 14:27:32 -0400 Subject: [PATCH 17/17] Editorial tweaks --- source | 51 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/source b/source index c08f45cedaf..23a5b9c61ed 100644 --- a/source +++ b/source @@ -3757,6 +3757,12 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
      • '::file-selector-button'
      + +

      The following term is defined in CSS Containment:

      + +
        +
      • skips its contents
      • +
      @@ -57102,7 +57108,7 @@ interface HTMLDetailsElement : HTMLElement {
      1. -

        While currentNode has a parent node:

        +

        While currentNode has a parent node within the flat tree:

        1. @@ -57114,14 +57120,14 @@ interface HTMLDetailsElement : HTMLElement { currentNode is slotted into.

        2. If the open attribute is not set on - currentNode, then Set + currentNode, then set the open attribute on currentNode to the empty string.

      2. Otherwise, set currentNode to the parent node of - currentNode within the flat tree.

      3. . + currentNode within the flat tree.

    @@ -76169,14 +76175,20 @@ body { display:none } can navigate through the matches by advancing the active match using the find-in-page interface.

    +

    Issue #3539 tracks + standardizing how find-in-page underlies the currently-unspecified window.find() API.

    + +

    Interaction with details

    +

    When find-in-page begins searching for matches, all details elements in the page - which do not have their open attribute set should have the - skipped contents of their - second slot become accessible. without modifying the open - attribute in order to make find-in-page able to search through it. After find-in-page finishes - searching for matches, those details elements should have their contents become - skipped again. This entire process must happen synchronously (and so is not observable to users or - to author code).

    + which do not have their open attribute set should have + the skipped contents of their second slot become + accessible, without modifying the open attribute, in + order to make find-in-page able to search through it. After find-in-page finishes searching for + matches, those details elements should have their contents become skipped again. + This entire process must happen synchronously (and so is not observable to users or to author + code).

    When find-in-page chooses a new active match, perform the following steps:

    @@ -76190,10 +76202,6 @@ body { display:none } revealing algorithm on node.

    -

    Issue #3539 tracks - standardizing how find-in-page underlies the currently-unspecified window.find() API.

    -

    Interaction with selection

    The find-in-page process is invoked in the context of a document, and may have an effect on @@ -115873,12 +115881,18 @@ details[open] > summary { expected to allow the user to request the details be shown or hidden.

    The details element's second slot is expected - to have its style attribute set to "display:block; - content-visibility:hidden" when the details element does not have an open attribute. When it does have the style attribute set to "display: + block; content-visibility: hidden;" when the details element does not have an + open attribute. When it does have the open attribute, the style attribute is expected to be removed from the second slot.

    +

    Because the slots are hidden inside a shadow tree, this style attribute is not directly visible to author code. Its impacts, + however, are visible. Notably, the choice of content-visibility: hidden + instead of, e.g., display: none, impacts the results of various APIs that + query layout information.

    + @@ -123920,6 +123934,9 @@ INSERT INTERFACES HERE
    [CSSCASCADE]
    CSS Cascading and Inheritance, E. Etemad, T. Atkins. W3C.
    +
    [CSSCONTAIN]
    +
    CSS Containment, T. Atkins, F. Rivoal, V. Levin. W3C.
    +
    [CSSCOLOR]
    CSS Color Module, T. Çelik, C. Lilley, L. Baron. W3C.