Skip to content
107 changes: 53 additions & 54 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -61532,35 +61532,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 @@ -79717,8 +79688,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 @@ -79873,30 +79843,69 @@ 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>The <dfn>ancestor revealing algorithm</dfn> is to run the following steps on
<var>target</var>:</p>
Comment thread
josepharhar marked this conversation as resolved.
Outdated

<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>ancestor</var> has a parent node within the <span>flat tree</span>:</p>

<ol>
<li><p>If <var>ancestor</var> has the <code data-x="attr-hidden">hidden</code> attribute in the
Comment thread
josepharhar marked this conversation as resolved.
Outdated
<span data-x="attr-hidden-until-found-state">Hidden Until Found</span> state, then <span
data-x="list append">append</span> <var>ancestor</var> 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 has the <code data-x="attr-details-open">open</code> attribute, then <span
Comment thread
josepharhar marked this conversation as resolved.
Outdated
data-x="list append">append</span> the <code>details</code> element which <var>ancestor</var>
Comment thread
annevk marked this conversation as resolved.
Outdated
is slotted into 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>While <var>currentNode</var> has a parent node within the <span>flat tree</span>:</p>
<p>For each <var>ancestorToReveal</var> of <var>ancestorsToReveal</var>:</p>

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

<li>
<p>If <var>ancestorToReveal</var> is a <code>details</code> element:</p>

<ol>
<li><p>If <var>ancestorToReveal</var> does not have the <code
data-x="attr-details-open">open</code> attribute, then return.</p></li>
Comment thread
annevk marked this conversation as resolved.
Outdated

<li><p>Remove the <code data-x="attr-details-open">open</code> attribute from
<var>ancestorToReveal</var>.</p></li>
Comment thread
josepharhar marked this conversation as resolved.
Outdated
Comment thread
josepharhar marked this conversation as resolved.
Outdated
</ol>
</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>Otherwise:</p>
Comment thread
annevk marked this conversation as resolved.
Outdated

<ol>
<li><p><span data-x="concept-event-fire">Fire an event</span> named <code
Comment thread
josepharhar marked this conversation as resolved.
Outdated
data-x="event-beforematch">beforematch</code> at <var>currentNode</var> with the <code
data-x="event-beforematch">beforematch</code> at <var>ancestor</var> with the <code
data-x="dom-Event-bubbles">bubbles</code> attribute initialized to true.</p></li>
Comment thread
josepharhar marked this conversation as resolved.

<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><p>Set <var>currentNode</var> to the parent node of <var>currentNode</var> within the
<span>flat tree</span>.</p></li>
</ol>
</li>
</ol>
Expand Down Expand Up @@ -83770,15 +83779,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 @@ -106018,10 +106020,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