| 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 194af5574d30cd53575ff8ff06eaa863f27ae660..6bc56742629f03c8eac56ce52cf05704c2ab6741 100644
|
| --- a/third_party/WebKit/Source/core/frame/RootFrameViewport.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/RootFrameViewport.cpp
|
| @@ -13,9 +13,10 @@
|
|
|
| namespace blink {
|
|
|
| -RootFrameViewport::RootFrameViewport(ScrollableArea& visualViewport, ScrollableArea& layoutViewport)
|
| +RootFrameViewport::RootFrameViewport(ScrollableArea& visualViewport, ScrollableArea& layoutViewport, bool invertScrollOrder)
|
| : m_visualViewport(visualViewport)
|
| , m_layoutViewport(layoutViewport)
|
| + , m_invertScrollOrder(invertScrollOrder)
|
| {
|
| }
|
|
|
| @@ -140,22 +141,23 @@
|
| if (delta.isZero())
|
| return;
|
|
|
| - DoublePoint targetPosition = visualViewport().clampScrollPosition(
|
| - visualViewport().scrollAnimator()->currentPosition() + delta);
|
| -
|
| - visualViewport().setScrollPosition(targetPosition, scrollType, behavior);
|
| -
|
| - // Scroll the layout viewport if all of the scroll was not applied to the
|
| - // visual viewport.
|
| - DoublePoint updatedPosition = layoutViewport().scrollAnimator()->currentPosition() + FloatPoint(targetPosition);
|
| + ScrollableArea& primary = !m_invertScrollOrder ? layoutViewport() : visualViewport();
|
| + ScrollableArea& secondary = !m_invertScrollOrder ? visualViewport() : layoutViewport();
|
| +
|
| + DoublePoint targetPosition = primary.clampScrollPosition(primary.scrollAnimator()->currentPosition() + delta);
|
| + primary.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);
|
| DoubleSize applied = updatedPosition - oldPosition;
|
| delta -= applied;
|
|
|
| if (delta.isZero())
|
| return;
|
|
|
| - targetPosition = layoutViewport().clampScrollPosition(layoutViewport().scrollAnimator()->currentPosition() + delta);
|
| - layoutViewport().setScrollPosition(targetPosition, scrollType, behavior);
|
| + targetPosition = secondary.clampScrollPosition(secondary.scrollAnimator()->currentPosition() + delta);
|
| + secondary.setScrollPosition(targetPosition, scrollType, behavior);
|
| }
|
|
|
| IntPoint RootFrameViewport::scrollPosition() const
|
|
|