W3C home > Mailing lists > Public > public-css-archive@w3.org > July 2019

Re: [csswg-drafts] [resize-observer] device-pixel-border-box size (#3554)

From: Chris Harrelson via GitHub <sysbot+gh@w3.org>
Date: Fri, 19 Jul 2019 00:46:23 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-513046566-1563497181-sysbot+gh@w3.org>
> In particular, there doesn't seem to be a huge difference logically between using ResizeObserver and calling getBoundingClientRect at the top of RAF, given that to be useful the same frame, ResizeObserver must fire /before/ RAF.

ResizeObserver callbacks are not called before rAF callbacks. They are called after all rAFs are done, after layout, and before drawing to the screen. If the ResizeObserver callback mutates DOM state, then layout is re-computed, after which ResizeObserver callbacks are called again. This may happen multiple times (though the number of times is bounded by the DOM depth).

Because ResizeObserver is called after layout and before drawing, it has the opportunity to do things like resizing canvases, without any lost frames, no matter what the layout change was that resulted in the need for canvas resize.

-- 
GitHub Notification of comment by chrishtr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3554#issuecomment-513046566 using your GitHub account
Received on Friday, 19 July 2019 00:46:24 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:50 UTC