From df3b78b877b88150a090c1c2a9b8dec854086b5e Mon Sep 17 00:00:00 2001
From: Joey Arhar The ancestor details revealing algorithm is to run the following steps on
- currentNode:
Let ancestors be « ».
Let currentNode be target.
While currentNode has a parent node within the flat tree:
+Append currentNode to + ancestors.
Set currentNode to the parent node of currentNode within the + flat tree.
For each ancestor of ancestors:
+If currentNode is slotted into the second slot of a details
+
If ancestor is slotted into the second slot of a details
element:
Set currentNode to the details
element which
- currentNode is slotted into.
Let details be the details
element which
+ ancestor is slotted into.
If the open
attribute is not set on
- currentNode, then set
- the open
attribute on currentNode to the
+ details, then set
+ the open
attribute on details to the
empty string.
Otherwise, set currentNode to the parent node of - currentNode within the flat tree.
The ancestor hidden-until-found revealing algorithm is to run the following steps on - currentNode:
+ target:Let ancestors be « ».
Let currentNode be target.
While currentNode has a parent node within the flat tree:
If currentNode has the hidden
attribute in the
- Hidden Until Found state, then:
Fire an event named beforematch
at currentNode with the bubbles
attribute initialized to true.
Remove the hidden
attribute from
- currentNode.
Append currentNode to + ancestors.
Set currentNode to the parent node of currentNode within the flat tree.
For each ancestor of ancestors:
+ +If ancestor has the hidden
attribute in the
+ Hidden Until Found state, then:
Fire an event named beforematch
at ancestor with the bubbles
attribute initialized to true.
Remove the hidden
attribute from
+ ancestor.
For each ancestor of ancestors:
If ancestor has the hidden
attribute in the
- Hidden Until Found state, then:
If ancestor has the hidden
attribute in the
+ Hidden Until Found state, then:
Fire an event named beforematch
at ancestor with the bubbles
attribute initialized to true.
Fire an event named beforematch
at ancestor with the bubbles
attribute initialized to true.
Remove the hidden
attribute from
- ancestor.
Remove the hidden
attribute from
+ ancestor.
The ancestor details revealing algorithm is to run the following steps on - target:
- -Let ancestors be « ».
Let currentNode be target.
While currentNode has a parent node within the flat tree:
- -Append currentNode to - ancestors.
Set currentNode to the parent node of currentNode within the - flat tree.
For each ancestor of ancestors:
- -If ancestor is slotted into the second slot of a details
- element:
Let details be the details
element which
- ancestor is slotted into.
If the open
attribute is not set on
- details, then set
- the open
attribute on details to the
- empty string.
The following example shows the details
element being used to hide technical
@@ -79730,8 +79688,7 @@ END:VCARD
data-x="navigate-fragid">fragment navigation. When these features attempt to scroll to a
target which is in the element's subtree, the user agent will remove the hidden
attribute in order to reveal the content before scrolling to
- it by running the ancestor hidden-until-found revealing algorithm on the target
- node.
The ancestor hidden-until-found revealing algorithm is to run the following steps on +
The ancestor revealing algorithm is to run the following steps on target:
Let ancestors be « ».
Let hiddenUntilFoundAncestors be « ».
Let currentNode be target.
Let detailsAncestors be « ».
Let ancestor be target.
While currentNode has a parent node within the flat tree:
+While ancestor has a parent node within the flat tree:
Append currentNode to - ancestors.
If ancestor has the hidden
attribute in the
+ Hidden Until Found state, then append ancestor to
+ hiddenUntilFoundAncestors.
Set currentNode to the parent node of currentNode within the +
If ancestor is slotted into the second slot of a details
+ element, then append the details
element which
+ ancestor is slotted into to detailsAncestors.
Set ancestor to the parent node of ancestor within the flat tree.
For each ancestor of ancestors:
+For each hiddenUntilFound of hiddenUntilFoundAncestors:
If ancestor has the hidden
attribute in the
- Hidden Until Found state, then:
Fire an event named beforematch
at ancestor with the bubbles
attribute initialized to true.
Fire an event named beforematch
at ancestor with the bubbles
attribute initialized to true.
Remove the hidden
attribute from
+ ancestor.
Remove the hidden
attribute from
- ancestor.
For each details of detailsAncestors:
+ +If the open
attribute is not set on
+ details, then set
+ the open
attribute on details to the
+ empty string.
Queue a global task on the user interaction task source given - node's relevant global object to run the following steps:
- -Run the ancestor details revealing algorithm on node.
Run the ancestor hidden-until-found revealing algorithm on - node.
@@ -106044,10 +106006,7 @@ location.href = '#foo';
Set document's target element to target.
Run the ancestor details revealing algorithm on target.
Run the ancestor hidden-until-found revealing algorithm on - target.
Run the ancestor revealing algorithm on target.
Scroll target into view,
with behavior set to "auto", block set to "start", and inline
From f7f0dfd636afc5682a37bdaffc4510135057d2e6 Mon Sep 17 00:00:00 2001
From: Joey Arhar
Let hiddenUntilFoundAncestors be « ».
Let detailsAncestors be « ».
Let ancestorsToReveal be « ».
Let ancestor be target.
If ancestor has the hidden
attribute in the
Hidden Until Found state, then append ancestor to
- hiddenUntilFoundAncestors.
If ancestor is slotted into the second slot of a details
- element, then append the details
element which
- ancestor is slotted into to detailsAncestors.
open
attribute, then append the details
element which ancestor
+ is slotted into to ancestorsToReveal.
Set ancestor to the parent node of ancestor within the flat tree.
For each hiddenUntilFound of hiddenUntilFoundAncestors:
+For each ancestorToReveal of ancestorsToReveal:
Fire an event named beforematch
at ancestor with the bubbles
attribute initialized to true.
If ancestorToReveal is not connected, then return.
Remove the hidden
attribute from
- ancestor.
If ancestorToReveal is a details
element:
For each details of detailsAncestors:
+If ancestorToReveal does not have the open
attribute, then return.
If the open
attribute is not set on
- details, then set
- the open
attribute on details to the
- empty string.
Remove the open
attribute from
+ ancestorToReveal.
Otherwise:
+ +Fire an event named beforematch
at ancestor with the bubbles
attribute initialized to true.
If ancestorToReveal is not connected, then return.
If ancestorToReveal's hidden
attribute is
+ not in the Hidden Until Found state, then
+ return.
Remove the hidden
attribute from
+ ancestorToReveal.
If ancestorToReveal is a details
element:
If ancestorToReveal does not have the open
attribute, then return.
If ancestorToReveal does not have the open
attribute, then return.
Remove the open
attribute from
- ancestorToReveal.
Remove the open
attribute from
+ ancestorToReveal.
The ancestor revealing algorithm is to run the following steps on - target:
+The ancestor revealing algorithm given a node target is:
Let ancestorsToReveal be « ».
While ancestor has a parent node within the flat tree:
If ancestor has the hidden
attribute in the
+
If ancestor has a hidden
attribute in the
Hidden Until Found state, then append ancestor to
ancestorsToReveal.
If ancestor is slotted into the second slot of a details
- element which has the open
attribute, then append the details
element which ancestor
- is slotted into to ancestorsToReveal.
open
attribute, then
+ append the details
element which
+ ancestor is slotted into to ancestorsToReveal.
Set ancestor to the parent node of ancestor within the flat tree.
If ancestorToReveal is not connected, then return.
If ancestorToReveal is a details
element:
If ancestorToReveal is a details
element, then set the open
attribute on ancestorToReveal to the empty
+ string.
If ancestorToReveal does not have the open
attribute, then return.
If ancestorToReveal is not connected, then return.
Remove the open
attribute from
- ancestorToReveal.
If ancestorToReveal is not a details
element and does not have
+ the hidden
attribute in the Hidden Until Found state, then return.
Otherwise:
+If ancestorToReveal has a hidden
+ attribute in the Hidden Until Found state,
+ then:
Fire an event named
Date: Mon, 28 Jul 2025 08:11:03 -0700
Subject: [PATCH 07/10] nits
---
source | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/source b/source
index 6936d66dc25..046fcbef12f 100644
--- a/source
+++ b/source
@@ -79886,13 +79886,12 @@ END:VCARD
data-x="attr-hidden-until-found-state">Hidden Until Found state, then return.
If ancestorToReveal has a hidden
- attribute in the Hidden Until Found state,
- then:
If ancestorToReveal has a hidden
attribute in
+ the Hidden Until Found state:
Fire an event named beforematch
at ancestor with the beforematch
at ancestorToReveal with the bubbles
attribute initialized to true.
If ancestorToReveal is not connected, then return.
An ancestor reveal pair is a tuple consisting of a node and a string.
+The ancestor revealing algorithm given a node target is:
If ancestor has a hidden
attribute in the
Hidden Until Found state, then append ancestor to
- ancestorsToReveal.
untilfound
")
+ to ancestorsToReveal.If ancestor is slotted into the second slot of a details
element which does not have an open
attribute, then
- append the details
element which
- ancestor is slotted into to ancestorsToReveal.
details
, "details
") to ancestorsToReveal.
Set ancestor to the parent node of ancestor within the flat tree.
For each ancestorToReveal of ancestorsToReveal:
+For each ancestorToRevealPair of ancestorsToReveal:
If ancestorToReveal is not connected, then return.
If ancestorToReveal is a details
element, then set the open
attribute on ancestorToReveal to the empty
- string.
Let ancestorToReveal be ancestorToRevalPair's node.
If ancestorToReveal is not connected, then return.
If ancestorToReveal is not a details
element and does not have
- the hidden
attribute in the Hidden Until Found state, then return.
If ancestorToReveal has a hidden
attribute in
- the Hidden Until Found state:
If ancestorToRevealPair's string is "untilfound
":
If ancestorToReveal's hidden
attribute is
+ not in the Hidden Until Found state, then
+ return.
Fire an event named beforematch
at ancestorToReveal with the bubbles
attribute initialized to true.
Remove the hidden
attribute from
ancestorToReveal.
Otherwise:
+ +Assert: ancestorToRevealPair's string is "details
".
If ancestorToReveal has the open
+ attribute, then return.
Set ancestorToReveal's open
+ attribute to the empty string.
If ancestor has a hidden
attribute in the
Hidden Until Found state, then append (ancestor, "untilfound
")
+ data-x="list append">append (ancestor, "until-found
")
to ancestorsToReveal.
If ancestor is slotted into the second slot of a details
element which does not have an open
attribute, then
- append (the details
, "append (ancestor's parent node, "
details
") to ancestorsToReveal.
Set ancestor to the parent node of ancestor within the @@ -80558,14 +80558,13 @@ END:VCARD
For each ancestorToRevealPair of ancestorsToReveal:
Let ancestorToReveal be ancestorToRevalPair's node.
Let (ancestorToReveal, revealType) be + ancestorToRevealPair.
If ancestorToReveal is not connected, then return.
If ancestorToRevealPair's string is "untilfound
":
If revealType is "until-found
":
If ancestorToReveal's hidden
attribute is
@@ -80591,11 +80590,10 @@ END:VCARD
Otherwise:
Assert: ancestorToRevealPair's string is " Assert: revealType is "details
".
If ancestorToReveal has the open
+
If ancestorToReveal has an open
attribute, then return.
Set ancestorToReveal's open
From 85646c4e1a4d86e1b392b0a3615e47a8a69ff518 Mon Sep 17 00:00:00 2001
From: Joey Arhar
For each ancestorToRevealPair of ancestorsToReveal:
+For each (ancestorToReveal, revealType) of + ancestorsToReveal:
Let (ancestorToReveal, revealType) be - ancestorToRevealPair.
If ancestorToReveal is not connected, then return.