scrollY not matching -htmlElementRect.top (same for scrollX/rect.left) |
||||
Issue description
Chrome Version : 52.0.2743.116 (Official Build) (64-bit)
URLs (if applicable) :
Other browsers tested:
Add OK or FAIL, along with the version, after other browsers where you
have tested this issue:
Safari: OK
What steps will reproduce the problem?
(1) pinch-zoom a non-scrollable document (e.g. <body> empty </body>), then scroll
(2) compare window.scrollY (or window.pageYOffset) with document.documentElement.getBoundingClientRect().top
What is the expected result? scrollY should be equal to -htmlElementRect.top
What happens instead?
Please provide any additional information below. Attach a screenshot if
possible.
,
Aug 31 2016
,
Aug 31 2016
,
Sep 1 2016
This is working as intended. getBoundingClientRect returns coordinates relative to the layout viewport, which is basically the "as-if we haven't zoomed" viewport (see http://bokan.ca/viewport/index.html for a visual example). On a non-scrollable page, getBoundingClientRect will thus always return the same coordinates regardless of the position of the visual viewport. The fact that it doesn't match scrollX|Y is a problem that we're looking at addressing. See issue 489206 . I'm closing this as WontFix. Feel free to reopen or comment if I'm misunderstanding the issue. |
||||
►
Sign in to add a comment |
||||
Comment 1 by sheriffbot@chromium.org
, Aug 28 2016