Open krpano opened 2 years ago
Same as and window.requestAnimationFrame.
It not fired because there are not contents that should be synchronised with page draw - page not draw more.
Looks like as optimization. Browser supress any elements reflow.
So that's intentional? If yes, then this behavior should be documented in some spec, or?!
Working around that is not a big problem, but when that behavior might change in future it could become a problem!
Here more information for better understanding the usage-case/problem: in my case I'm rendering dynamic html-textfields to canvas for using them as textures in WebGL (and further also in WebXR). And for tracking dynamic changes the ResizeObserver is a nice tool here. As workaround for ResizeObserver not getting called I'm checking at the moment if WebXR is enabled and then do a manual size-change tracking and checking in the WebXR frameloop.
So if one day ResizeObserver would start running also when in WebXR mode, this could case conflicts...
Therefore it would be good know what's the actual and intended state here and if it keeps as it is! (even when others eventually notice that problem later too and request changes)
Following to spec this is normally. ResizeObeserver called in:
Recalc styles
Update layout
Paint
https://www.w3.org/TR/resize-observer/#html-event-loop
In XR state there are not Paint at all, and other reconciling states (how i know).
After entering WebXR mode the ResizeObserver doesn't run / get called anymore...
Is this intentional or a bug?