New issue
Advanced search Search tips

Issue 747413 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 1
Type: Bug



Sign in to add a comment

Element.scroll methods are relative to visual viewport

Project Member Reported by bokan@chromium.org, Jul 21 2017

Issue description

Chrome Version: 61.0.3163.0
OS: All

What steps will reproduce the problem?
(1) Find a page with no horizontal scrolling
(2) Pinch-zoom in and make sure the viewport is scrolled all the way to the top left (window.visualViewport.pageLeft == 0, window.visualViepwort.pageTop == 0)
(3) From console, execute `document.body.scrollTo(1000, 0)`

What is the expected result?
The page shouldn't move at all

What happens instead?
The page scrolls horizontally

Since shipping inert-visual-viewport in M61, the `window` scrolling properties and methods must be relative to the layout viewport. When Element == document.scrollingElement (i.e. document.body), the scrollLeft, scrollTo, etc should delegate to `window`. The bug is that Element.scroll, Element.scrollTo, Element.scrollBy are relative to the visual viewport for the scrollingElement. (Element.scrollLeft|Top, Element.scrollWidth|Height are correctly relative to the layout viewport).
 

Comment 1 by bokan@chromium.org, Jul 24 2017

Labels: M-61
Project Member

Comment 2 by bugdroid1@chromium.org, Jul 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/59c99225580e691a55daf1f070ee2a19166abac9

commit 59c99225580e691a55daf1f070ee2a19166abac9
Author: David Bokan <bokan@chromium.org>
Date: Mon Jul 24 15:11:53 2017

Element.scroll methods should be layout relative

When Element == document.scrollingElement, these methods should delegate
to the `window` object's scrolling methods. With the inert visual
viewport change shipping in M61, these methods are relative to the
layout viewport so calling through document.scrollingElement should
behave the same way.

Bug:  747413 
Change-Id: Ibb1d1bb29545161f1768110b22d63ea4a2d4f708
Reviewed-on: https://chromium-review.googlesource.com/581876
Commit-Queue: David Bokan <bokan@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488970}
[add] https://crrev.com/59c99225580e691a55daf1f070ee2a19166abac9/third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-scrolling-element-inert.html
[modify] https://crrev.com/59c99225580e691a55daf1f070ee2a19166abac9/third_party/WebKit/Source/core/dom/Element.cpp

Cc: pbomm...@chromium.org
 bokan@ can you please merge above Cl to M61 branch 3163 by tomorrow i.e., 07/25 so that the Cl can be made into Dev refresh on Wednesday.
Project Member

Comment 4 by bugdroid1@chromium.org, Jul 24 2017

Labels: merge-merged-3163
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/274dd3f45bcef073bdef01abf7c176a46f0372ff

commit 274dd3f45bcef073bdef01abf7c176a46f0372ff
Author: David Bokan <bokan@chromium.org>
Date: Mon Jul 24 22:50:04 2017

Element.scroll methods should be layout relative

When Element == document.scrollingElement, these methods should delegate
to the `window` object's scrolling methods. With the inert visual
viewport change shipping in M61, these methods are relative to the
layout viewport so calling through document.scrollingElement should
behave the same way.

TBR=bokan@chromium.org

(cherry picked from commit 59c99225580e691a55daf1f070ee2a19166abac9)

Bug:  747413 
Change-Id: Ibb1d1bb29545161f1768110b22d63ea4a2d4f708
Reviewed-on: https://chromium-review.googlesource.com/581876
Commit-Queue: David Bokan <bokan@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#488970}
Reviewed-on: https://chromium-review.googlesource.com/584028
Reviewed-by: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/branch-heads/3163@{#16}
Cr-Branched-From: ff259bab28b35d242e10186cd63af7ed404fae0d-refs/heads/master@{#488528}
[add] https://crrev.com/274dd3f45bcef073bdef01abf7c176a46f0372ff/third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-scrolling-element-inert.html
[modify] https://crrev.com/274dd3f45bcef073bdef01abf7c176a46f0372ff/third_party/WebKit/Source/core/dom/Element.cpp

Comment 5 by bokan@chromium.org, Jul 24 2017

Status: Fixed (was: Assigned)
Done.

Sign in to add a comment