Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: third_party/WebKit/Source/core/frame/VisualViewport.cpp

Issue 1509783002: Revert of Remove invert viewport scroll order setting from Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/frame/Settings.in ('k') | third_party/WebKit/Source/web/WebSettingsImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/VisualViewport.cpp
diff --git a/third_party/WebKit/Source/core/frame/VisualViewport.cpp b/third_party/WebKit/Source/core/frame/VisualViewport.cpp
index 27d28a57431ab7d5584dcbb09901899c7f6e79c9..b13c3b0c43bfa85d046121437ee380efda5b999e 100644
--- a/third_party/WebKit/Source/core/frame/VisualViewport.cpp
+++ b/third_party/WebKit/Source/core/frame/VisualViewport.cpp
@@ -253,6 +253,14 @@
// First try to use the anchor's delta to scroll the FrameView.
FloatSize anchorDeltaUnusedByScroll = anchorDelta;
+ if (!frameHost().settings().invertViewportScrollOrder()) {
+ FrameView* view = mainFrame()->view();
+ DoublePoint oldPosition = view->scrollPositionDouble();
+ view->scrollBy(DoubleSize(anchorDelta.width(), anchorDelta.height()), UserScroll);
+ DoublePoint newPosition = view->scrollPositionDouble();
+ anchorDeltaUnusedByScroll -= toFloatSize(newPosition - oldPosition);
+ }
+
// Manually bubble any remaining anchor delta up to the visual viewport.
FloatPoint newLocation(location() + anchorDeltaUnusedByScroll);
setScaleAndLocation(newPageScale, newLocation);
« no previous file with comments | « third_party/WebKit/Source/core/frame/Settings.in ('k') | third_party/WebKit/Source/web/WebSettingsImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698