Title: [184596] trunk/Source
Revision
184596
Author
[email protected]
Date
2015-05-19 14:58:30 -0700 (Tue, 19 May 2015)

Log Message

REGRESSION(142590): Part 2: Scroll-snap points are improperly snapping to earlier index values (Scrolling Thread) 
https://bugs.webkit.org/show_bug.cgi?id=145175
<rdar://problem/21023785>

Reviewed by Beth Dakin.

Source/WebCore:

Extend the main-thread scrolling changes done in Bug 145140 to also handle Scrolling Thread snapping.
The post-layout fixup (needed to handle window resize and device orientation changes) should not fire
while Scrolling Thread scroll-snap animations are running, since these animations will most likely
move the scroll view into the proper position. If we attempt to 'fix up' the scroll position before
these animations finish, we get an ugly 'jump' in the display.

* page/FrameView.cpp:
(WebCore::FrameView::isScrollSnapInProgress): New method based on isRubberBandInProgress, which considers
both the ScrollAnimator (main thread) scrolling, as well as the ScrollingCoordinator (Scrolling Thread)
scrolling operations. Returns true if a scroll-snap animation is still active.
* page/FrameView.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::isScrollSnapInProgress): Added. Returns scrolling tree's
'isScrollSnapInProgress' state.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::isScrollSnapInProgress): Added default 'false' stub.
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::ScrollingTree): Use modern C++11 initializers.
(WebCore::ScrollingTree::isScrollSnapInProgress): Added.
(WebCore::ScrollingTree::setMainFrameIsScrollSnapping): Added.
* page/scrolling/ScrollingTree.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent): Update scrolling tree state to match the
ScrollController's scroll-snap state.
(WebCore::ScrollingTreeFrameScrollingNodeMac::startScrollSnapTimer): Added. When starting a scroll snap timer,
always set the scrolling tree scroll-snapping state to true.
(WebCore::ScrollingTreeFrameScrollingNodeMac::stopScrollSnapTimer): Added. When ending a scroll snap timer,
only set the scrolling tree scroll-snapping state to false if the other axis animator is inactive.
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::updateScrollSnapState): Revise implementation to use its 'isScrollSnapInProgress'
method, rather than only looking at the ScrollAnimator (main thread) state.
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::isScrollSnapInProgress): Added.
* platform/cocoa/ScrollController.h:
* platform/cocoa/ScrollController.mm:
(WebCore::ScrollController::hasActiveScrollSnapTimerForAxis): Added. Reports if the scroll snap animation
timer on the requested axis is running or not.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::isScrollSnapInProgress): Added.
* rendering/RenderLayer.h:

Source/WebKit2:

Add a stub implementation of isScrollSnapInProgress to match ScrollingCoordinator signature.

* WebProcess/Scrolling/RemoteScrollingCoordinator.h:
* WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
(WebKit::RemoteScrollingCoordinator::isScrollSnapInProgress): Added stub.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (184595 => 184596)


--- trunk/Source/WebCore/ChangeLog	2015-05-19 21:52:15 UTC (rev 184595)
+++ trunk/Source/WebCore/ChangeLog	2015-05-19 21:58:30 UTC (rev 184596)
@@ -1,3 +1,54 @@
+2015-05-19  Brent Fulgham  <[email protected]>
+
+        REGRESSION(142590): Part 2: Scroll-snap points are improperly snapping to earlier index values (Scrolling Thread) 
+        https://bugs.webkit.org/show_bug.cgi?id=145175
+        <rdar://problem/21023785>
+
+        Reviewed by Beth Dakin.
+
+        Extend the main-thread scrolling changes done in Bug 145140 to also handle Scrolling Thread snapping.
+        The post-layout fixup (needed to handle window resize and device orientation changes) should not fire
+        while Scrolling Thread scroll-snap animations are running, since these animations will most likely
+        move the scroll view into the proper position. If we attempt to 'fix up' the scroll position before
+        these animations finish, we get an ugly 'jump' in the display.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::isScrollSnapInProgress): New method based on isRubberBandInProgress, which considers
+        both the ScrollAnimator (main thread) scrolling, as well as the ScrollingCoordinator (Scrolling Thread)
+        scrolling operations. Returns true if a scroll-snap animation is still active.
+        * page/FrameView.h:
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::isScrollSnapInProgress): Added. Returns scrolling tree's
+        'isScrollSnapInProgress' state.
+        * page/scrolling/AsyncScrollingCoordinator.h:
+        * page/scrolling/ScrollingCoordinator.h:
+        (WebCore::ScrollingCoordinator::isScrollSnapInProgress): Added default 'false' stub.
+        * page/scrolling/ScrollingTree.cpp:
+        (WebCore::ScrollingTree::ScrollingTree): Use modern C++11 initializers.
+        (WebCore::ScrollingTree::isScrollSnapInProgress): Added.
+        (WebCore::ScrollingTree::setMainFrameIsScrollSnapping): Added.
+        * page/scrolling/ScrollingTree.h:
+        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
+        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent): Update scrolling tree state to match the
+        ScrollController's scroll-snap state.
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::startScrollSnapTimer): Added. When starting a scroll snap timer,
+        always set the scrolling tree scroll-snapping state to true.
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::stopScrollSnapTimer): Added. When ending a scroll snap timer,
+        only set the scrolling tree scroll-snapping state to false if the other axis animator is inactive.
+        * platform/ScrollableArea.cpp:
+        (WebCore::ScrollableArea::updateScrollSnapState): Revise implementation to use its 'isScrollSnapInProgress'
+        method, rather than only looking at the ScrollAnimator (main thread) state.
+        * platform/ScrollableArea.h:
+        (WebCore::ScrollableArea::isScrollSnapInProgress): Added.
+        * platform/cocoa/ScrollController.h:
+        * platform/cocoa/ScrollController.mm:
+        (WebCore::ScrollController::hasActiveScrollSnapTimerForAxis): Added. Reports if the scroll snap animation
+        timer on the requested axis is running or not.
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::isScrollSnapInProgress): Added.
+        * rendering/RenderLayer.h:
+
 2015-05-19  Roger Fong  <[email protected]>
 
         Media Controls stop updating after hovering for a few seconds.

Modified: trunk/Source/WebCore/page/FrameView.cpp (184595 => 184596)


--- trunk/Source/WebCore/page/FrameView.cpp	2015-05-19 21:52:15 UTC (rev 184595)
+++ trunk/Source/WebCore/page/FrameView.cpp	2015-05-19 21:58:30 UTC (rev 184596)
@@ -905,6 +905,28 @@
     
     updateSnapOffsetsForScrollableArea(*this, *body, *renderView(), body->renderer()->style());
 }
+
+bool FrameView::isScrollSnapInProgress() const
+{
+    if (scrollbarsSuppressed())
+        return false;
+    
+    // If the scrolling thread updates the scroll position for this FrameView, then we should return
+    // ScrollingCoordinator::isScrollSnapInProgress().
+    if (Page* page = frame().page()) {
+        if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) {
+            if (!scrollingCoordinator->shouldUpdateScrollLayerPositionSynchronously())
+                return scrollingCoordinator->isScrollSnapInProgress();
+        }
+    }
+    
+    // If the main thread updates the scroll position for this FrameView, we should return
+    // ScrollAnimator::isScrollSnapInProgress().
+    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
+        return scrollAnimator->isScrollSnapInProgress();
+    
+    return false;
+}
 #endif
 
 bool FrameView::flushCompositingStateForThisFrame(Frame* rootFrameForFlush)

Modified: trunk/Source/WebCore/page/FrameView.h (184595 => 184596)


--- trunk/Source/WebCore/page/FrameView.h	2015-05-19 21:52:15 UTC (rev 184595)
+++ trunk/Source/WebCore/page/FrameView.h	2015-05-19 21:58:30 UTC (rev 184596)
@@ -4,7 +4,7 @@
              (C) 1998, 1999 Torben Weis ([email protected])
              (C) 1999 Lars Knoll ([email protected])
              (C) 1999 Antti Koivisto ([email protected])
-   Copyright (C) 2004-2009, 2014 Apple Inc. All rights reserved.
+   Copyright (C) 2004-2009, 2014-2015 Apple Inc. All rights reserved.
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
@@ -538,7 +538,8 @@
     FloatRect exposedRect() const { return m_exposedRect; }
 
 #if ENABLE(CSS_SCROLL_SNAP)
-    virtual void updateSnapOffsets() override;
+    void updateSnapOffsets() override;
+    bool isScrollSnapInProgress() const override;
 #endif
 
     virtual float adjustScrollStepForFixedContent(float step, ScrollbarOrientation, ScrollGranularity) override;

Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (184595 => 184596)


--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2015-05-19 21:52:15 UTC (rev 184595)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2015-05-19 21:58:30 UTC (rev 184596)
@@ -611,6 +611,13 @@
 }
 #endif
 
+#if ENABLE(CSS_SCROLL_SNAP)
+bool AsyncScrollingCoordinator::isScrollSnapInProgress() const
+{
+    return scrollingTree()->isScrollSnapInProgress();
+}
+#endif
+    
 } // namespace WebCore
 
 #endif // ENABLE(ASYNC_SCROLLING)

Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h (184595 => 184596)


--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h	2015-05-19 21:52:15 UTC (rev 184595)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h	2015-05-19 21:58:30 UTC (rev 184596)
@@ -102,6 +102,10 @@
     virtual bool isRubberBandInProgress() const override;
     virtual void setScrollPinningBehavior(ScrollPinningBehavior) override;
 
+#if ENABLE(CSS_SCROLL_SNAP)
+    bool isScrollSnapInProgress() const override;
+#endif
+
     WEBCORE_EXPORT virtual void syncChildPositions(const LayoutRect& viewportRect) override;
     WEBCORE_EXPORT virtual void scrollableAreaScrollbarLayerDidChange(ScrollableArea&, ScrollbarOrientation) override;
 

Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h (184595 => 184596)


--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h	2015-05-19 21:52:15 UTC (rev 184595)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h	2015-05-19 21:58:30 UTC (rev 184596)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011, 2015 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -176,6 +176,7 @@
     virtual void syncChildPositions(const LayoutRect&) { }
     virtual String scrollingStateTreeAsText() const;
     virtual bool isRubberBandInProgress() const { return false; }
+    virtual bool isScrollSnapInProgress() const { return false; }
     virtual void setScrollPinningBehavior(ScrollPinningBehavior) { }
 
     // Generated a unique id for scroll layers.

Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp (184595 => 184596)


--- trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp	2015-05-19 21:52:15 UTC (rev 184595)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp	2015-05-19 21:58:30 UTC (rev 184596)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012, 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2015 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -39,20 +39,6 @@
 namespace WebCore {
 
 ScrollingTree::ScrollingTree()
-    : m_rubberBandsAtLeft(true)
-    , m_rubberBandsAtRight(true)
-    , m_rubberBandsAtTop(true)
-    , m_rubberBandsAtBottom(true)
-    , m_mainFramePinnedToTheLeft(true)
-    , m_mainFramePinnedToTheRight(true)
-    , m_mainFramePinnedToTheTop(true)
-    , m_mainFramePinnedToTheBottom(true)
-    , m_mainFrameIsRubberBanding(false)
-    , m_scrollPinningBehavior(DoNotPin)
-    , m_latchedNode(0)
-    , m_scrollingPerformanceLoggingEnabled(false)
-    , m_isHandlingProgrammaticScroll(false)
-    , m_fixedOrStickyNodeCount(0)
 {
 }
 
@@ -263,6 +249,20 @@
     m_mainFrameIsRubberBanding = isRubberBanding;
 }
 
+bool ScrollingTree::isScrollSnapInProgress()
+{
+    MutexLocker lock(m_mutex);
+    
+    return m_mainFrameIsScrollSnapping;
+}
+    
+void ScrollingTree::setMainFrameIsScrollSnapping(bool isScrollSnapping)
+{
+    MutexLocker locker(m_mutex);
+    
+    m_mainFrameIsScrollSnapping = isScrollSnapping;
+}
+
 void ScrollingTree::setCanRubberBandState(bool canRubberBandAtLeft, bool canRubberBandAtRight, bool canRubberBandAtTop, bool canRubberBandAtBottom)
 {
     MutexLocker locker(m_swipeStateMutex);

Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.h (184595 => 184596)


--- trunk/Source/WebCore/page/scrolling/ScrollingTree.h	2015-05-19 21:52:15 UTC (rev 184595)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.h	2015-05-19 21:58:30 UTC (rev 184596)
@@ -64,6 +64,8 @@
     
     void setMainFrameIsRubberBanding(bool);
     bool isRubberBandInProgress();
+    void setMainFrameIsScrollSnapping(bool);
+    bool isScrollSnapInProgress();
 
     virtual void invalidate() { }
     WEBCORE_EXPORT virtual void commitNewTreeState(std::unique_ptr<ScrollingStateTree>);
@@ -161,24 +163,25 @@
     FloatPoint m_mainFrameScrollPosition;
 
     Mutex m_swipeStateMutex;
-    bool m_rubberBandsAtLeft;
-    bool m_rubberBandsAtRight;
-    bool m_rubberBandsAtTop;
-    bool m_rubberBandsAtBottom;
-    bool m_mainFramePinnedToTheLeft;
-    bool m_mainFramePinnedToTheRight;
-    bool m_mainFramePinnedToTheTop;
-    bool m_mainFramePinnedToTheBottom;
-    bool m_mainFrameIsRubberBanding;
-    ScrollPinningBehavior m_scrollPinningBehavior;
-    ScrollingNodeID m_latchedNode;
+    ScrollPinningBehavior m_scrollPinningBehavior { DoNotPin };
+    ScrollingNodeID m_latchedNode { 0 };
 
-    bool m_scrollingPerformanceLoggingEnabled;
+    unsigned m_fixedOrStickyNodeCount { 0 };
+
+    bool m_rubberBandsAtLeft { true };
+    bool m_rubberBandsAtRight { true };
+    bool m_rubberBandsAtTop { true };
+    bool m_rubberBandsAtBottom { true };
+    bool m_mainFramePinnedToTheLeft { true };
+    bool m_mainFramePinnedToTheRight { true };
+    bool m_mainFramePinnedToTheTop { true };
+    bool m_mainFramePinnedToTheBottom { true };
+    bool m_mainFrameIsRubberBanding { false };
+    bool m_mainFrameIsScrollSnapping { false };
+    bool m_scrollingPerformanceLoggingEnabled { false };
+    bool m_isHandlingProgrammaticScroll { false };
+};
     
-    bool m_isHandlingProgrammaticScroll;
-    unsigned m_fixedOrStickyNodeCount;
-};
-
 } // namespace WebCore
 
 #define SPECIALIZE_TYPE_TRAITS_SCROLLING_TREE(ToValueTypeName, predicate) \

Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h (184595 => 184596)


--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h	2015-05-19 21:52:15 UTC (rev 184595)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h	2015-05-19 21:58:30 UTC (rev 184596)
@@ -86,6 +86,8 @@
     LayoutUnit scrollOffsetOnAxis(ScrollEventAxis) const override;
     void immediateScrollOnAxis(ScrollEventAxis, float delta) override;
     float pageScaleFactor() const override;
+    void startScrollSnapTimer(ScrollEventAxis) override;
+    void stopScrollSnapTimer(ScrollEventAxis) override;
 #endif
 
     void logExposedUnfilledArea();

Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm (184595 => 184596)


--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm	2015-05-19 21:52:15 UTC (rev 184595)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm	2015-05-19 21:58:30 UTC (rev 184596)
@@ -185,6 +185,7 @@
 
     m_scrollController.handleWheelEvent(wheelEvent);
 #if ENABLE(CSS_SCROLL_SNAP)
+    scrollingTree().setMainFrameIsScrollSnapping(m_scrollController.isScrollSnapInProgress());
     if (m_scrollController.activeScrollSnapIndexDidChange())
         scrollingTree().setActiveScrollSnapIndices(scrollingNodeID(), m_scrollController.activeScrollSnapIndexForAxis(ScrollEventAxis::Horizontal), m_scrollController.activeScrollSnapIndexForAxis(ScrollEventAxis::Vertical));
 #endif
@@ -574,6 +575,18 @@
 {
     return frameScaleFactor();
 }
+
+void ScrollingTreeFrameScrollingNodeMac::startScrollSnapTimer(ScrollEventAxis)
+{
+    scrollingTree().setMainFrameIsScrollSnapping(true);
+}
+
+void ScrollingTreeFrameScrollingNodeMac::stopScrollSnapTimer(ScrollEventAxis axis)
+{
+    ScrollEventAxis otherAxis = (axis == ScrollEventAxis::Horizontal) ? ScrollEventAxis::Vertical : ScrollEventAxis::Horizontal;
+    if (!m_scrollController.hasActiveScrollSnapTimerForAxis(otherAxis))
+        scrollingTree().setMainFrameIsScrollSnapping(false);
+}
 #endif
 
 void ScrollingTreeFrameScrollingNodeMac::deferTestsForReason(WheelEventTestTrigger::ScrollableAreaIdentifier identifier, WheelEventTestTrigger::DeferTestTriggerReason reason) const

Modified: trunk/Source/WebCore/platform/ScrollableArea.cpp (184595 => 184596)


--- trunk/Source/WebCore/platform/ScrollableArea.cpp	2015-05-19 21:52:15 UTC (rev 184595)
+++ trunk/Source/WebCore/platform/ScrollableArea.cpp	2015-05-19 21:58:30 UTC (rev 184596)
@@ -458,13 +458,13 @@
 void ScrollableArea::updateScrollSnapState()
 {
 #if PLATFORM(MAC)
-    if (ScrollAnimator* scrollAnimator = existingScrollAnimator()) {
+    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
         scrollAnimator->updateScrollAnimatorsAndTimers();
-        if (scrollAnimator->isScrollSnapInProgress())
-            return;
-    }
 #endif
 
+    if (isScrollSnapInProgress())
+        return;
+
     IntPoint currentPosition = scrollPosition();
     IntPoint correctedPosition = nearestActiveSnapPoint(currentPosition);
     

Modified: trunk/Source/WebCore/platform/ScrollableArea.h (184595 => 184596)


--- trunk/Source/WebCore/platform/ScrollableArea.h	2015-05-19 21:52:15 UTC (rev 184595)
+++ trunk/Source/WebCore/platform/ScrollableArea.h	2015-05-19 21:58:30 UTC (rev 184596)
@@ -230,6 +230,7 @@
     virtual IntRect scrollableAreaBoundingBox() const = 0;
 
     virtual bool isRubberBandInProgress() const { return false; }
+    virtual bool isScrollSnapInProgress() const { return false; }
 
     virtual bool scrollAnimatorEnabled() const { return false; }
 

Modified: trunk/Source/WebCore/platform/cocoa/ScrollController.h (184595 => 184596)


--- trunk/Source/WebCore/platform/cocoa/ScrollController.h	2015-05-19 21:52:15 UTC (rev 184595)
+++ trunk/Source/WebCore/platform/cocoa/ScrollController.h	2015-05-19 21:58:30 UTC (rev 184596)
@@ -124,6 +124,7 @@
     void setActiveScrollSnapIndexForAxis(ScrollEventAxis, unsigned);
     bool activeScrollSnapIndexDidChange() const { return m_activeScrollSnapIndexDidChange; }
     void setScrollSnapIndexDidChange(bool state) { m_activeScrollSnapIndexDidChange = state; }
+    bool hasActiveScrollSnapTimerForAxis(ScrollEventAxis) const;
 #endif
 
 private:

Modified: trunk/Source/WebCore/platform/cocoa/ScrollController.mm (184595 => 184596)


--- trunk/Source/WebCore/platform/cocoa/ScrollController.mm	2015-05-19 21:52:15 UTC (rev 184595)
+++ trunk/Source/WebCore/platform/cocoa/ScrollController.mm	2015-05-19 21:58:30 UTC (rev 184596)
@@ -477,6 +477,11 @@
     return (axis == ScrollEventAxis::Horizontal) ? *m_horizontalScrollSnapState : *m_verticalScrollSnapState;
 }
 
+bool ScrollController::hasActiveScrollSnapTimerForAxis(ScrollEventAxis axis) const
+{
+    return (axis == ScrollEventAxis::Horizontal) ? m_horizontalScrollSnapTimer.isActive() : m_verticalScrollSnapTimer.isActive();
+}
+
 static inline WheelEventStatus toWheelEventStatus(PlatformWheelEventPhase phase, PlatformWheelEventPhase momentumPhase)
 {
     if (phase == PlatformWheelEventPhaseNone) {

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (184595 => 184596)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2015-05-19 21:52:15 UTC (rev 184595)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2015-05-19 21:58:30 UTC (rev 184596)
@@ -3204,6 +3204,17 @@
     RenderBox* box = enclosingElement()->renderBox();
     updateSnapOffsetsForScrollableArea(*this, *downcast<HTMLElement>(enclosingElement()), *box, box->style());
 }
+
+bool RenderLayer::isScrollSnapInProgress() const
+{
+    if (!scrollsOverflow())
+        return false;
+    
+    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
+        return scrollAnimator->isScrollSnapInProgress();
+    
+    return false;
+}
 #endif
 
 int RenderLayer::verticalScrollbarWidth(OverlayScrollbarSizeRelevancy relevancy) const

Modified: trunk/Source/WebCore/rendering/RenderLayer.h (184595 => 184596)


--- trunk/Source/WebCore/rendering/RenderLayer.h	2015-05-19 21:52:15 UTC (rev 184595)
+++ trunk/Source/WebCore/rendering/RenderLayer.h	2015-05-19 21:58:30 UTC (rev 184596)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2009, 2012, 2015 Apple Inc. All rights reserved.
  *
  * Portions are Copyright (C) 1998 Netscape Communications Corporation.
  *
@@ -877,6 +877,9 @@
     virtual bool isRubberBandInProgress() const override;
     virtual bool updatesScrollLayerPositionOnMainThread() const override { return true; }
     virtual bool forceUpdateScrollbarsOnMainThreadForPerformanceTesting() const override;
+#if ENABLE(CSS_SCROLL_SNAP)
+    bool isScrollSnapInProgress() const override;
+#endif
 
 #if PLATFORM(IOS)
     void registerAsTouchEventListenerForScrolling();

Modified: trunk/Source/WebKit2/ChangeLog (184595 => 184596)


--- trunk/Source/WebKit2/ChangeLog	2015-05-19 21:52:15 UTC (rev 184595)
+++ trunk/Source/WebKit2/ChangeLog	2015-05-19 21:58:30 UTC (rev 184596)
@@ -1,3 +1,17 @@
+2015-05-19  Brent Fulgham  <[email protected]>
+
+        REGRESSION(142590): Part 2: Scroll-snap points are improperly snapping to earlier index values (Scrolling Thread) 
+        https://bugs.webkit.org/show_bug.cgi?id=145175
+        <rdar://problem/21023785>
+
+        Reviewed by Beth Dakin.
+
+        Add a stub implementation of isScrollSnapInProgress to match ScrollingCoordinator signature.
+
+        * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
+        * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
+        (WebKit::RemoteScrollingCoordinator::isScrollSnapInProgress): Added stub.
+
 2015-05-19  Jeremy Jones  <[email protected]>
 
         WebVideoFullscreenManagerProxy has incorrect OS_VERSION_MIN_REQUIRED conditionals.

Modified: trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.h (184595 => 184596)


--- trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.h	2015-05-19 21:52:15 UTC (rev 184595)
+++ trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.h	2015-05-19 21:58:30 UTC (rev 184596)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2015 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -66,6 +66,7 @@
 
     virtual bool isRubberBandInProgress() const override;
     virtual void setScrollPinningBehavior(WebCore::ScrollPinningBehavior) override;
+    bool isScrollSnapInProgress() const override;
 
     // IPC::MessageReceiver
     virtual void didReceiveMessage(IPC::Connection&, IPC::MessageDecoder&) override;

Modified: trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.mm (184595 => 184596)


--- trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.mm	2015-05-19 21:52:15 UTC (rev 184595)
+++ trunk/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.mm	2015-05-19 21:58:30 UTC (rev 184596)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2015 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -79,6 +79,12 @@
     return false;
 }
 
+bool RemoteScrollingCoordinator::isScrollSnapInProgress() const
+{
+    // FIXME: need to maintain state in the web process?
+    return false;
+}
+
 void RemoteScrollingCoordinator::setScrollPinningBehavior(ScrollPinningBehavior)
 {
     // FIXME: send to the UI process.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to