Skip to content
122 changes: 68 additions & 54 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -62186,35 +62186,6 @@ interface <dfn interface>HTMLDetailsElement</dfn> : <span>HTMLElement</span> {

</div>

<p>The <dfn>ancestor details revealing algorithm</dfn> is to run the following steps on
<var>currentNode</var>:</p>

<ol>
<li>
<p>While <var>currentNode</var> has a parent node within the <span>flat tree</span>:</p>

<ol>
<li>
<p>If <var>currentNode</var> is slotted into the second slot of a <code>details</code>
element:</p>

<ol>
<li><p>Set <var>currentNode</var> to the <code>details</code> element which
<var>currentNode</var> is slotted into.</p></li>

<li><p>If the <code data-x="attr-details-open">open</code> attribute is not set on
<var>currentNode</var>, then <span data-x="concept-element-attributes-set-value">set</span>
the <code data-x="attr-details-open">open</code> attribute on <var>currentNode</var> to the
empty string.</p></li>
</ol>
</li>

<li><p>Otherwise, set <var>currentNode</var> to the parent node of
<var>currentNode</var> within the <span>flat tree</span>.</p></li>
</ol>
</li>
</ol>

<div class="example">

<p>The following example shows the <code>details</code> element being used to hide technical
Expand Down Expand Up @@ -80398,8 +80369,7 @@ END:VCARD</pre>
data-x="navigate-fragid">fragment navigation</span>. When these features attempt to scroll to a
target which is in the element's subtree, the user agent will remove the <code
data-x="attr-hidden">hidden</code> attribute in order to reveal the content before scrolling to
it by running the <span>ancestor hidden-until-found revealing algorithm</span> on the target
node.</p>
it by running the <span>ancestor revealing algorithm</span> on the target node.</p>

<div w-nodev>

Expand Down Expand Up @@ -80554,30 +80524,84 @@ END:VCARD</pre>
string.</p></li>
</ol>

<p>The <dfn>ancestor hidden-until-found revealing algorithm</dfn> is to run the following steps on
<var>currentNode</var>:</p>
<p>An <dfn>ancestor reveal pair</dfn> is a <span>tuple</span> consisting of a <dfn
data-x="ancestor-reveal-pair-node">node</dfn> and a <dfn
data-x="ancestor-reveal-pair-string">string</dfn>.</p>

<p>The <dfn>ancestor revealing algorithm</dfn> given a node <var>target</var> is:</p>

<ol>
<li><p>Let <var>ancestorsToReveal</var> be « ».</p></li>

<li><p>Let <var>ancestor</var> be <var>target</var>.</p></li>

<li>
<p>While <var>currentNode</var> has a parent node within the <span>flat tree</span>:</p>
<p>While <var>ancestor</var> has a parent node within the <span>flat tree</span>:</p>

<ol>
<li><p>If <var>ancestor</var> has a <code data-x="attr-hidden">hidden</code> attribute in the
<span data-x="attr-hidden-until-found-state">Hidden Until Found</span> state, then <span
data-x="list append">append</span> (<var>ancestor</var>, "<code data-x="">untilfound</code>")
to <var>ancestorsToReveal</var>.</p></li>

<li><p>If <var>ancestor</var> is slotted into the second slot of a <code>details</code>
element which does not have an <code data-x="attr-details-open">open</code> attribute, then
<span data-x="list append">append</span> (the <code>details</code>, "<code
data-x="">details</code>") to <var>ancestorsToReveal</var>.</p></li>

<li><p>Set <var>ancestor</var> to the parent node of <var>ancestor</var> within the
<span>flat tree</span>.</p></li>
</ol>
</li>

<li>
<p>For each <var>ancestorToRevealPair</var> of <var>ancestorsToReveal</var>:</p>

<ol>
<li><p>Let <var>ancestorToReveal</var> be <var>ancestorToRevalPair</var>'s <span
data-x="ancestor-reveal-pair-node">node</span>.</p></li>

<li><p>If <var>ancestorToReveal</var> is not <span>connected</span>, then return.</p></li>

<li>
<p>If <var>currentNode</var> has the <code data-x="attr-hidden">hidden</code> attribute in the
<span data-x="attr-hidden-until-found-state">Hidden Until Found</span> state, then:</p>
<p>If <var>ancestorToRevealPair</var>'s <span
data-x="ancestor-reveal-pair-string">string</span> is "<code data-x="">untilfound</code>":</p>

<ol>
<li><p>If <var>ancestorToReveal</var>'s <code data-x="attr-hidden">hidden</code> attribute is
not in the <span data-x="attr-hidden-until-found-state">Hidden Until Found</span> state, then
return.</p></li>

<li><p><span data-x="concept-event-fire">Fire an event</span> named <code
data-x="event-beforematch">beforematch</code> at <var>currentNode</var> with the <code
data-x="event-beforematch">beforematch</code> at <var>ancestorToReveal</var> with the <code
data-x="dom-Event-bubbles">bubbles</code> attribute initialized to true.</p></li>

<li><p>If <var>ancestorToReveal</var> is not <span>connected</span>, then return.</p></li>

<li><p>If <var>ancestorToReveal</var>'s <code data-x="attr-hidden">hidden</code> attribute is
not in the <span data-x="attr-hidden-until-found-state">Hidden Until Found</span> state, then
return.</p></li>

<li><p>Remove the <code data-x="attr-hidden">hidden</code> attribute from
<var>currentNode</var>.</p></li>
<var>ancestorToReveal</var>.</p></li>
</ol>
</li>
<li>

<li><p>Set <var>currentNode</var> to the parent node of <var>currentNode</var> within the
<span>flat tree</span>.</p></li>
<li>
<p>Otherwise:</p>

<ol>
<li><p><span>Assert</span>: <var>ancestorToRevealPair</var>'s <span
data-x="ancestor-reveal-pair-string">string</span> is "<code
data-x="">details</code>".</p></li>

<li><p>If <var>ancestorToReveal</var> has the <code data-x="attr-details-open">open</code>
attribute, then return.</p></li>

<li><p>Set <var>ancestorToReveal</var>'s <code data-x="attr-details-open">open</code>
attribute to the empty string.</p></li>
</ol>
</li>
</ol>
</li>
</ol>
Expand Down Expand Up @@ -84451,15 +84475,8 @@ body { display:none }
match</span>.</p></li>

<li><p><span>Queue a global task</span> on the <span>user interaction task source</span> given
<var>node</var>'s <span>relevant global object</span> to run the following steps:</p>

<ol>
<li><p>Run the <span>ancestor details revealing algorithm</span> on <var>node</var>.</p></li>

<li><p>Run the <span>ancestor hidden-until-found revealing algorithm</span> on
<var>node</var>.</p></li>
</ol>
</li>
<var>node</var>'s <span>relevant global object</span> to run the <span>ancestor revealing
algorithm</span> on <var>node</var>.</p></li>
</ol>

<p class="warning">
Expand Down Expand Up @@ -106727,10 +106744,7 @@ location.href = '#foo';</code></pre>

<li><p>Set <var>document</var>'s <span>target element</span> to <var>target</var>.</p></li>

<li><p>Run the <span>ancestor details revealing algorithm</span> on <var>target</var>.</p></li>

<li><p>Run the <span>ancestor hidden-until-found revealing algorithm</span> on
<var>target</var>.</p></li>
<li><p>Run the <span>ancestor revealing algorithm</span> on <var>target</var>.</p></li>

<li><p><span data-x="scroll a target into view">Scroll <var>target</var> into view</span>,
with <i>behavior</i> set to "auto", <i>block</i> set to "start", and <i>inline</i>
Expand Down