[csswg-drafts] [cssom-view] What precision should scroll values be reported in? (#4717)

bokand has just created a new issue for https://github.com/w3c/csswg-drafts:

== [cssom-view] What precision should scroll values be reported in? ==
See https://github.com/bokand/RenderingIndependentScrollOffsets for details.

Summary: `window.scrollY`|`Element.scrollTop` are spec'd as double but in practice they're only reported at physical pixel increments. That means on a DSF 2X screen, the values are in increments of 0.5.

The above behavior is a generalization, details are in my explainer but behavior varies across and within engines, depending on where the scrolls are coming from, whether pinch-zoom is involved.

One idea that's available in Chrome behind a flag (chrome://flags/#fractional-scroll-offsets) is to treat the scroll values on `Element` and `window` as independent values free to take on any double value, with pixel snapping occurring entirely as an artifact of the rendering process. This is similar to how the location of elements is reported using `getBoundingClientRect`

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4717 using your GitHub account

Received on Thursday, 30 January 2020 21:18:31 UTC