Skip to content
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

Expand <details> for find-in-page and element fragments #6466

Merged
merged 18 commits into from
Aug 6, 2021
Merged
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 57 additions & 2 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -57097,6 +57097,35 @@ interface <dfn>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:</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>.</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 @@ -76140,6 +76169,27 @@ body { display:none }
can navigate through the <span data-x="fip-matches">matches</span> by advancing the <span
data-x="fip-active-match">active match</span> using the <span>find-in-page interface</span>.</p>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "which do not have their open attribute set"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, thanks!

<p>When find-in-page begins searching for matches, all <code>details</code> elements in the page
which do not have their <code data-x="attr-details-open">open</code> attribute set should have the
<a href="https://drafts.csswg.org/css-contain-2/#skips-its-contents">skipped contents</a> of their
second slot become accessible. without modifying the <code data-x="attr-details-open">open</code>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to use "act as if" here as the exact implementation strategy does not matter, as long as you can search through them. That might also allow for removal of the final sentence.

Copy link
Member

@domenic domenic May 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for as-if, but I think the final sentence is still pretty important for clarity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added "act as if", and I also said that it is to make sure the slot can be searched by find-in-page. How does it look?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see "act as if" in the spec text?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added "act as if" in b2dc599 and removed it in 1717601 when I added content-visibility:hidden. We don't need to be vague by using the "act as if" phrase now that we are speccing it to explicitly be content-visibility:hidden.

attribute in order to make find-in-page able to search through it. After find-in-page finishes
searching for matches, those <code>details</code> 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).</p>

<p>When find-in-page chooses a new <span data-x="fip-active-match">active match</span>, perform
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: single-space indentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

the following steps:</p>

<ol>
<li><p>Let <var>node</var> be the first node in the <span data-x="fip-active-match">active
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 <span>ancestor details
revealing algorithm</span> on <var>node</var>.</p></li>
</ol>

<p class="XXX"><a href="https://github.com/whatwg/html/issues/3539">Issue #3539</a> tracks
standardizing how <span>find-in-page</span> underlies the currently-unspecified <code
data-x="">window.find()</code> API.</p>
Expand Down Expand Up @@ -87068,6 +87118,8 @@ new PaymentRequest(&hellip;); // Allowed to use
<li><p>Set the <code>Document</code>'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><span data-x="scroll an element into view">Scroll <var>target</var> into view</span>,
with <var>behavior</var> set to "auto", <var>block</var> set to "start", and <var>inline</var>
set to "nearest". <ref spec=CSSOMVIEW></p></li>
Expand Down Expand Up @@ -115821,8 +115873,11 @@ details[open] > summary {
expected to allow the user to request the details be shown or hidden.</p>

<p>The <code>details</code> element's second <span data-x="concept-slot">slot</span> is expected
to be removed from the rendering when the <code>details</code> element does not have an <code
data-x="attr-details-open">open</code> attribute.</p>
to have its <code data-x="attr-style">style</code> attribute set to "display:block;
content-visibility:hidden" when the <code>details</code> element does not have an <code
data-x="attr-details-open">open</code> attribute. When it does have the <code
data-x="attr-details-open">open</code> attribute, the <code data-x="attr-style">style</code>
attribute is expected to be removed from the second <span data-x="concept-slot">slot</span>.</p>

<!-- https://mail.gnome.org/archives/usability/2006-June/msg00015.html -->

Expand Down