- From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
- Date: Mon, 13 Nov 2023 12:04:30 +0000
- To: public-css-archive@w3.org
> Compare to this animation which looking up the size to make the canvas via `element.clientWidth` and `element.clientHeight`
These are not observers. What do you use to track changes on clientWidth/clientHeight?
Using `ResizeObserver` should be slower than `requestAnimationFrame`, but faster than 2 rAFs:
```js
new ResizeObserver(() => console.log('ResizeObserver')).observe(document.body);
requestAnimationFrame(() => {
console.log('requestAnimationFrame 1');
requestAnimationFrame(() => console.log('requestAnimationFrame 2'));
});
```
```
requestAnimationFrame 1
ResizeObserver
requestAnimationFrame 2
```
That should be quite fast. So hard to say since you don't provide a testcase, but seems a bug in your browser or your code.
Anyways, the timing of this is part of HTML, not CSS: https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering
--
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9560#issuecomment-1808032883 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 13 November 2023 12:04:35 UTC