Chromium Code Reviews| Index: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h |
| diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h |
| index 7f1f1ea597075844a9a3a614a7a1dc63580c6326..bf2766edf1621bba431d124f46d26e1ef88a3701 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h |
| +++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h |
| @@ -310,50 +310,24 @@ class CORE_EXPORT PaintLayerScrollableArea final |
| ScrollBehavior scrollBehaviorStyle() const override; |
| CompositorAnimationTimeline* compositorAnimationTimeline() const override; |
| - double scrollXOffset() const { |
| - return m_scrollOffset.width() + scrollOrigin().x(); |
| - } |
| - double scrollYOffset() const { |
| - return m_scrollOffset.height() + scrollOrigin().y(); |
| - } |
| - |
| - DoubleSize scrollOffset() const { return m_scrollOffset; } |
| - |
| // FIXME: We shouldn't allow access to m_overflowRect outside this class. |
| LayoutRect overflowRect() const { return m_overflowRect; } |
| - void scrollToPosition(const DoublePoint& scrollPosition, |
| - ScrollOffsetClamping = ScrollOffsetUnclamped, |
| - ScrollBehavior = ScrollBehaviorInstant, |
| - ScrollType = ProgrammaticScroll); |
| - |
| - void scrollToOffset(const DoubleSize& scrollOffset, |
| - ScrollOffsetClamping clamp = ScrollOffsetUnclamped, |
| - ScrollBehavior scrollBehavior = ScrollBehaviorInstant, |
| - ScrollType scrollType = ProgrammaticScroll) { |
| - scrollToPosition(-scrollOrigin() + scrollOffset, clamp, scrollBehavior, |
| - scrollType); |
| - } |
| - |
| - void scrollToXOffset(double x, |
| - ScrollOffsetClamping clamp = ScrollOffsetUnclamped, |
| - ScrollBehavior scrollBehavior = ScrollBehaviorInstant) { |
| - scrollToOffset(DoubleSize(x, scrollYOffset()), clamp, scrollBehavior); |
| + DoubleSize offsetFromOrigin() const { |
|
bokan
2016/10/01 20:32:47
I find this naming to be confusing, I think what t
szager1
2016/10/02 19:35:28
In discussion with skobes, we had different ideas
|
| + return toDoubleSize(DoublePoint(scrollOrigin())) + m_scrollPosition; |
| } |
| - |
| - void scrollToYOffset(double y, |
| - ScrollOffsetClamping clamp = ScrollOffsetUnclamped, |
| - ScrollBehavior scrollBehavior = ScrollBehaviorInstant) { |
| - scrollToOffset(DoubleSize(scrollXOffset(), y), clamp, scrollBehavior); |
| + void scrollToOffsetFromOrigin( |
| + const DoubleSize& scrollOffset, |
| + ScrollBehavior scrollBehavior = ScrollBehaviorInstant, |
| + ScrollType scrollType = ProgrammaticScroll) { |
| + setScrollPosition(-scrollOrigin() + scrollOffset, scrollType, |
| + scrollBehavior); |
| } |
| - void setScrollPosition( |
| - const DoublePoint& position, |
| - ScrollType scrollType, |
| - ScrollBehavior scrollBehavior = ScrollBehaviorInstant) override { |
| - scrollToOffset(toDoubleSize(position), ScrollOffsetClamped, scrollBehavior, |
| - scrollType); |
| - } |
| + // This will set the scroll position without clamping, and it will do all post-update |
| + // work even if the scroll position didn't change. |
| + void setScrollPositionUnconditionally(const DoublePoint&, |
| + ScrollType = ProgrammaticScroll); |
| // TODO(szager): Actually run these after all of layout is finished. Currently, they |
| // run at the end of box()'es layout (or after all flexbox layout has finished) but while |
| @@ -395,10 +369,6 @@ class CORE_EXPORT PaintLayerScrollableArea final |
| int horizontalScrollbarHeight( |
| OverlayScrollbarClipBehavior = IgnoreOverlayScrollbarSize) const; |
| - DoubleSize adjustedScrollOffset() const { |
| - return DoubleSize(scrollXOffset(), scrollYOffset()); |
| - } |
| - |
| void positionOverflowControls(); |
| // isPointInResizeControl() is used for testing if a pointer/touch position is in the resize control |
| @@ -526,7 +496,7 @@ class CORE_EXPORT PaintLayerScrollableArea final |
| void updateScrollOrigin(); |
| void updateScrollDimensions(); |
| - void setScrollOffset(const DoublePoint&, ScrollType) override; |
| + void updateScrollPosition(const DoublePoint&, ScrollType) override; |
| int verticalScrollbarStart(int minX, int maxX) const; |
| int horizontalScrollbarStart(int minX) const; |
| @@ -588,8 +558,8 @@ class CORE_EXPORT PaintLayerScrollableArea final |
| // ScrollbarManager holds the Scrollbar instances. |
| ScrollbarManager m_scrollbarManager; |
| - // This is the (scroll) offset from scrollOrigin(). |
| - DoubleSize m_scrollOffset; |
| + // This is the absolute scroll position, *not* relative to m_scrollOrigin. |
|
bokan
2016/10/01 20:32:47
Ok, I think I'm missing something. Absolute would
szager1
2016/10/02 19:35:28
Yeah, this is a bad comment; I changed it.
|
| + DoubleSize m_scrollPosition; |
| IntPoint m_cachedOverlayScrollbarOffset; |