Re: [csswg-drafts] [cssom] `ComputedStyleObserver` to observe changes in elements' computed styles (#8982)

@keithamus if the callback is ran only once per frame you will not be able to handle all the occurrences before they are painted.
Before `ResizeObserver` means that you'll miss the ones triggered there.
After `ResizeObserver` means that now the `ResizeObserver` will miss resize notifications.
In both cases, you'll miss the ones triggered by other concurrent ComputedStyleObservers.

So I personally believe this needs to act like `MutationObserver`, i.e. it queues its callbacks in a microtask. Jake proposed that the changes occurring outside of the *update the rendering* special task are delayed until this task, and I agree. Delaying just before the `ResizeObserver` callback makes even more sense since we can leverage the recalc that's needed for RO to work. But I believe we need to have it fire new callbacks in microtasks up until the paint.

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


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

Received on Friday, 14 February 2025 14:11:14 UTC