From f14c37e0b676d56109a95dbfb01eea90380e60b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 21 Apr 2025 13:32:26 +0200 Subject: [PATCH 1/3] [css-contain-2] Fix typo in closing tag. This prevents bikeshed from generating the spec locally. --- css-contain-2/Overview.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css-contain-2/Overview.bs b/css-contain-2/Overview.bs index ff10724d7a2..614339e5a8a 100644 --- a/css-contain-2/Overview.bs +++ b/css-contain-2/Overview.bs @@ -707,7 +707,7 @@ Size Containment contain-size-064.html - + Note: [=Size containment=] does not suppress baseline alignment. From 7218b11b95371bc93afb1aa634e05575f5dee61d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 21 Apr 2025 13:33:23 +0200 Subject: [PATCH 2/3] [css-contain-2] Stop monkey-patching the HTML spec. --- css-contain-2/Overview.bs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/css-contain-2/Overview.bs b/css-contain-2/Overview.bs index 614339e5a8a..837e3375be9 100644 --- a/css-contain-2/Overview.bs +++ b/css-contain-2/Overview.bs @@ -1994,6 +1994,18 @@ Suppressing An Element's Contents Entirely: the 'content-visibility' property {# When the element becomes disconnected, the element's [=proximity to the viewport=] becomes [=not determined=]. +
+ All elements have a currently relevant to the user flag, initially false. +
+ +
+ To update content relevancy for a document doc: + + 1. For each element [=connected=] to doc with ''auto'' used value of ''content-visibility'' + 1. If element is [=relevant to the user=], then set element's [=currently relevant to the user=] flag to true. + 1. Otherwise, set element's [=currently relevant to the user=] flag to false. +
+
An element is relevant to the user if any of the following conditions are true: @@ -2308,14 +2320,7 @@ Restrictions and Clarifications {#cv-notes} 3. If an element starts or stops [=skipped contents|skipping its contents=], - this change happens - after the requestAnimationFrame callbacks - of the frame that renders the effects of the change - have run. - Specifically, such changes will take effect between steps 13 and 14 - of [=update the rendering=] step of the Processing Model - (between “run the animation frame callbacks” - and “run the update intersection observations steps”). + this change happens when [=update content relevancy for a document=] runs.
Determining the viewport intersection of the element From d4c4952d1e360f0d2d35105a3b09012cbfc2a24e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 21 Apr 2025 13:54:22 +0200 Subject: [PATCH 3/3] [css-contain-2] More refined approach, I think. --- css-contain-2/Overview.bs | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/css-contain-2/Overview.bs b/css-contain-2/Overview.bs index 837e3375be9..69849fe5b4c 100644 --- a/css-contain-2/Overview.bs +++ b/css-contain-2/Overview.bs @@ -1999,11 +1999,30 @@ Suppressing An Element's Contents Entirely: the 'content-visibility' property {#
- To update content relevancy for a document doc: + To update content relevancy for a document given a document doc, and a boolean isFirstIteration: + 1. Let changed be false. 1. For each element [=connected=] to doc with ''auto'' used value of ''content-visibility'' - 1. If element is [=relevant to the user=], then set element's [=currently relevant to the user=] flag to true. - 1. Otherwise, set element's [=currently relevant to the user=] flag to false. + 1. Determine proximity to the viewport for element. + 1. If element is not [=currently relevant to the user=] and element is [=relevant to the user=], then: + 2. Set changed to true. + 2. Set element's [=currently relevant to the user=] flag to true. + 1. If isFirstIteration is false, then [=continue=]. + 1. If element is [=relevant to the user=], then: + 1. If element's [=currently relevant to the user=] flag is false, set changed to true. + 1. Set element's [=currently relevant to the user=] flag to true. + 1. Otherwise: + 1. If element's [=currently relevant to the user=] flag is true, set changed to true. + 1. Set element's [=currently relevant to the user=] flag to false. + 1. return changed. + +
+ The intent of the changed variable 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. +