New issue
Advanced search Search tips

Issue 641625 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

scrollY not matching -htmlElementRect.top (same for scrollX/rect.left)

Project Member Reported by valdrin@google.com, Aug 27 2016

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.

 
Project Member

Comment 1 by sheriffbot@chromium.org, Aug 28 2016

Labels: Hotlist-Google
Labels: Needs-Bisect
Cc: bokan@chromium.org
Components: Blink>Scroll

Comment 4 by bokan@chromium.org, Sep 1 2016

Labels: -Needs-Bisect
Status: WontFix (was: Unconfirmed)
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