From ead19e78f6744861bb67683ae167d93ed4a8b24a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 21 Apr 2025 13:59:20 +0200 Subject: [PATCH] Deal with content-visibility during the layout loop. Partially fixes #11210 --- source | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/source b/source index 4c41dd21485..bc3c12aa60a 100644 --- a/source +++ b/source @@ -113769,6 +113769,7 @@ import "https://example.com/foo/../module2.mjs";
  1. Let resizeObserverDepth be 0.

  2. +
  3. Let updateNonInitialContentVisibilityAutoRelevancy be true.

  4. While true:

    @@ -113776,37 +113777,13 @@ import "https://example.com/foo/../module2.mjs";
    1. Recalculate styles and update layout for doc.

    2. -
    3. Let hadInitialVisibleContentVisibilityDetermination be false.

    4. +
    5. Let contentVisibilityChanged be the result of calling update + content relevancy for a document with doc and + updateNonInitialContentVisibilityAutoRelevancy.

    6. -
    7. -

      For each element element with 'auto' used value of - 'content-visibility':

      - -
        -
      1. Let checkForInitialDetermination be true if element's - proximity to the viewport is not determined and it is not relevant to - the user. Otherwise, let checkForInitialDetermination be - false.

      2. - -
      3. Determine proximity to the viewport for element.

      4. +
      5. Set updateNonInitialContentVisibilityAutoRelevancy to false.

      6. -
      7. If checkForInitialDetermination is true and element is now - relevant to the user, then set - hadInitialVisibleContentVisibilityDetermination to true.

      8. -
      -
    8. - -
    9. -

      If hadInitialVisibleContentVisibilityDetermination is true, then - continue.

      - -

      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 rendering - opportunity. CSSCONTAIN

      -
    10. +
    11. If contentVisibilityChanged is true, then continue.

    12. Gather active resize observations at depth resizeObserverDepth for doc.