-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Prevent infinite loop in revealing algorithms #11457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
df3b78b
1b704f0
291da97
6ef4377
f7f0dfd
a1e9079
7b0c806
ea3aa49
7af4736
61af6a0
80cc559
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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 | ||||||
|
@@ -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> | ||||||
|
||||||
|
@@ -80554,30 +80524,82 @@ 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="">until-found</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> (<var>ancestor</var>'s parent node, "<code | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I see, that works I think. |
||||||
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> | ||||||
josepharhar marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
<ol> | ||||||
<li><p>Let (<var>ancestorToReveal</var>, <var>revealType</var>) be | ||||||
josepharhar marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
<var>ancestorToRevealPair</var>.</p></li> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I meant you could do
|
||||||
|
||||||
<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>revealType</var> is "<code data-x="">until-found</code>":</p> | ||||||
|
||||||
josepharhar marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
<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>revealType</var> is "<code | ||||||
data-x="">details</code>".</p></li> | ||||||
|
||||||
<li><p>If <var>ancestorToReveal</var> has an <code data-x="attr-details-open">open</code> | ||||||
attribute, then return.</p></li> | ||||||
|
||||||
josepharhar marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
<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> | ||||||
|
@@ -84451,15 +84473,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"> | ||||||
|
@@ -106727,10 +106742,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> | ||||||
|
Uh oh!
There was an error while loading. Please reload this page.