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

@juj @jdashg a polling API introduces all sorts of problems like forcing a layout, as @chrishtr has shown, which can easily cause major performance and correctness issues in applications. @grorg also raised this issue early on while the WebGL working group was considering adding new properties to the canvas element providing the size in device pixels.

ResizeObserver has solved this problem elegantly - the ability to observe resizes of individual HTML elements, which has been a longstanding missing feature on the web.

Given the problems with adding synchronous polling APIs for this functionality, can you support adding this functionality to ResizeObserver? I don't think there's any application which resizes its elements on a continuous basis - it would be too jarring for the user. The scenario that needs to be addressed is getting accurate, steady-state measurement of the canvas's size in device pixels, and adding this device pixel box size to ResizeObserver will do it. I think that in both existing JS code bases as well as WebAssembly compiled applications it should be feasible to integrate the ResizeObserver-based solution. For the entire time OpenGL has been available as an API, GLUT's callback-based [glutReshapeFunc](https://www.opengl.org/resources/libraries/glut/spec3/node48.html) has been the way to respond to window resizing in OpenGL applications.

If we can simply reach agreement that this small addition is an acceptable step forward, then we can collectively make a lot of progress with client applications. Thanks for considering this.

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

Received on Thursday, 20 June 2019 23:09:04 UTC