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

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

Issue 1435233002: Remove invert viewport scroll order setting from Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Build fix after rebase Created 4 years, 12 months 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
Index: third_party/WebKit/Source/core/frame/RootFrameViewport.cpp
diff --git a/third_party/WebKit/Source/core/frame/RootFrameViewport.cpp b/third_party/WebKit/Source/core/frame/RootFrameViewport.cpp
index a18deabaedcc8ad4322b95e344f3c3f1a31d2a46..5496ea1a712c8fcfbb2d5d990bb0498483f70a63 100644
--- a/third_party/WebKit/Source/core/frame/RootFrameViewport.cpp
+++ b/third_party/WebKit/Source/core/frame/RootFrameViewport.cpp
@@ -12,10 +12,9 @@
namespace blink {
-RootFrameViewport::RootFrameViewport(ScrollableArea& visualViewport, ScrollableArea& layoutViewport, bool invertScrollOrder)
+RootFrameViewport::RootFrameViewport(ScrollableArea& visualViewport, ScrollableArea& layoutViewport)
: m_visualViewport(visualViewport)
, m_layoutViewport(layoutViewport)
- , m_invertScrollOrder(invertScrollOrder)
{
}
@@ -140,23 +139,22 @@ void RootFrameViewport::distributeScrollBetweenViewports(const DoublePoint& offs
if (delta.isZero())
return;
- ScrollableArea& primary = !m_invertScrollOrder ? layoutViewport() : visualViewport();
- ScrollableArea& secondary = !m_invertScrollOrder ? visualViewport() : layoutViewport();
+ DoublePoint targetPosition = visualViewport().clampScrollPosition(
+ visualViewport().scrollAnimator().currentPosition() + delta);
- DoublePoint targetPosition = primary.clampScrollPosition(primary.scrollAnimator().currentPosition() + delta);
- primary.setScrollPosition(targetPosition, scrollType, behavior);
+ visualViewport().setScrollPosition(targetPosition, scrollType, behavior);
// Scroll the secondary viewport if all of the scroll was not applied to the
// primary viewport.
- DoublePoint updatedPosition = secondary.scrollAnimator().currentPosition() + FloatPoint(targetPosition);
+ DoublePoint updatedPosition = layoutViewport().scrollAnimator().currentPosition() + FloatPoint(targetPosition);
DoubleSize applied = updatedPosition - oldPosition;
delta -= applied;
if (delta.isZero())
return;
- targetPosition = secondary.clampScrollPosition(secondary.scrollAnimator().currentPosition() + delta);
- secondary.setScrollPosition(targetPosition, scrollType, behavior);
+ targetPosition = layoutViewport().clampScrollPosition(layoutViewport().scrollAnimator().currentPosition() + delta);
+ layoutViewport().setScrollPosition(targetPosition, scrollType, behavior);
}
IntPoint RootFrameViewport::scrollPosition() const

Powered by Google App Engine
This is Rietveld 408576698