Re: [csswg-drafts] [css-anchor-position] Better handling of scroll position for fixpos elements on first layout (#10999)

> What's the definition of first laid out? With container queries and scroll timelines there may be multiple passes where a box flips between being rendered and not in different passes during the same rendering update.  getComputedStyle().width forces a layout, but should probably not be counted as "first laid out".

The actual spec states it in *slightly* more detail - it's when it starts generating a box (goes from `display:none` or `display:contents` to another value), and also links this to when CSS Animations are created. So at least `gCS()` won't trigger this, tho indeed, more timing detail is needed in general. 

> I think it would make sense to snapshot the scroll position as part of ["run snapshot post-layout state steps"](https://drafts.csswg.org/cssom-view/#run-snapshot-post-layout-state-steps),

Sounds reasonable to me.

> and probably consider the element as "first laid out" for the whole resizeObserver loop in https://html.spec.whatwg.org/multipage/webappapis.html#event-loop-processing-model to account for changing scroll offsets

By that you mean, in each pass of the RO loop, recalculate the offsets? That sounds reasonable to me.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10999#issuecomment-2436042003 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 24 October 2024 18:10:21 UTC