Skip to content

Deal with content-visibility during the layout loop. #11241

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all 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
35 changes: 6 additions & 29 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -113769,44 +113769,21 @@ import "https://example.com/foo/../module2.mjs";</code></pre>

<ol>
<li><p>Let <var>resizeObserverDepth</var> be 0.</p></li>
<li><p>Let <var>updateNonInitialContentVisibilityAutoRelevancy</var> be true.</p></li>

<li>
<p>While true:</p>

<ol>
<li><p>Recalculate styles and update layout for <var>doc</var>.</p></li>

<li><p>Let <var>hadInitialVisibleContentVisibilityDetermination</var> be false.</p></li>
<li><p>Let <var>contentVisibilityChanged</var> be the result of calling <span>update
content relevancy for a document</span> with <var>doc</var> and
<var>updateNonInitialContentVisibilityAutoRelevancy</var>.</p></li>

<li>
<p>For each element <var>element</var> with <span
data-x="content-visibility-auto">'auto'</span> used value of
<span>'content-visibility'</span>:</p>

<ol>
<li><p>Let <var>checkForInitialDetermination</var> be true if <var>element</var>'s
<span>proximity to the viewport</span> is not determined and it is not <span>relevant to
the user</span>. Otherwise, let <var>checkForInitialDetermination</var> be
false.</p></li>

<li><p>Determine <span>proximity to the viewport</span> for <var>element</var>.</p></li>
<li><p>Set <var>updateNonInitialContentVisibilityAutoRelevancy</var> to false.</p></li>

<li><p>If <var>checkForInitialDetermination</var> is true and <var>element</var> is now
<span>relevant to the user</span>, then set
<var>hadInitialVisibleContentVisibilityDetermination</var> to true.</p></li>
</ol>
</li>

<li>
<p>If <var>hadInitialVisibleContentVisibilityDetermination</var> is true, then
<span>continue</span>.</p>

<p class="note">The intent of this step is for the initial viewport proximity
determination, which takes effect immediately, to be reflected in the style and layout
calculation which is carried out in a previous step of this loop. Proximity
determinations other than the initial one take effect at the next <span>rendering
opportunity</span>. <ref>CSSCONTAIN</ref></p>
</li>
<li><p>If <var>contentVisibilityChanged</var> is true, then <span>continue</span>.</p></li>

<li><p><span>Gather active resize observations at depth</span>
<var>resizeObserverDepth</var> for <var>doc</var>.</p></li>
Expand Down
Loading