Title: [165069] trunk/Source/WebCore
Revision
165069
Author
[email protected]
Date
2014-03-04 12:22:03 -0800 (Tue, 04 Mar 2014)

Log Message

REGRESSION: Overlay scrollbars that have grown are sometimes askew in the track
https://bugs.webkit.org/show_bug.cgi?id=129691
-and corresponding-
<rdar://problem/15666846>

Reviewed by Simon Fraser.

This regression started happening after we adopted the setPresentationValue 
ScrollbarPainter API which allows us to update the position of the scrollbar knob 
from our secondary scrolling thread. The bug occurs when the scrollbar grows while 
it still thinks it is in presentation-value mode. Whenever the scrollbar grows, it 
should be in non-presentation value mode.

If the wheel event has ended or been cancelled, we can switch out of presentation 
value mode.
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
(WebCore::ScrollingTreeScrollingNodeMac::handleWheelEvent):

Sometimes we will grow the scrollbar before we have received a wheel event with 
the end or cancelled phase, and so automatically switch out of presentation-value 
mode whenever we start one of these animations.
* platform/mac/ScrollAnimatorMac.mm:
(-[WebScrollbarPainterDelegate scrollerImp:animateUIStateTransitionWithDuration:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (165068 => 165069)


--- trunk/Source/WebCore/ChangeLog	2014-03-04 20:15:38 UTC (rev 165068)
+++ trunk/Source/WebCore/ChangeLog	2014-03-04 20:22:03 UTC (rev 165069)
@@ -1,3 +1,29 @@
+2014-03-04  Beth Dakin  <[email protected]>
+
+        REGRESSION: Overlay scrollbars that have grown are sometimes askew in the track
+        https://bugs.webkit.org/show_bug.cgi?id=129691
+        -and corresponding-
+        <rdar://problem/15666846>
+
+        Reviewed by Simon Fraser.
+
+        This regression started happening after we adopted the setPresentationValue 
+        ScrollbarPainter API which allows us to update the position of the scrollbar knob 
+        from our secondary scrolling thread. The bug occurs when the scrollbar grows while 
+        it still thinks it is in presentation-value mode. Whenever the scrollbar grows, it 
+        should be in non-presentation value mode.
+
+        If the wheel event has ended or been cancelled, we can switch out of presentation 
+        value mode.
+        * page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
+        (WebCore::ScrollingTreeScrollingNodeMac::handleWheelEvent):
+
+        Sometimes we will grow the scrollbar before we have received a wheel event with 
+        the end or cancelled phase, and so automatically switch out of presentation-value 
+        mode whenever we start one of these animations.
+        * platform/mac/ScrollAnimatorMac.mm:
+        (-[WebScrollbarPainterDelegate scrollerImp:animateUIStateTransitionWithDuration:]):
+
 2014-03-04  Zan Dobersek  <[email protected]>
 
         Move Source/WebCore/html/track/ code to std::unique_ptr

Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm (165068 => 165069)


--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm	2014-03-04 20:15:38 UTC (rev 165068)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm	2014-03-04 20:22:03 UTC (rev 165069)
@@ -136,6 +136,15 @@
     if (!canHaveScrollbars())
         return;
 
+    if (wheelEvent.phase() == PlatformWheelEventPhaseEnded || wheelEvent.phase() == PlatformWheelEventPhaseCancelled) {
+        // If the wheel event is ending or cancelled, then we can tell the ScrollbarPainter API that we won't
+        // be updating the position from our scrolling thread anymore for the time being.
+        if (m_verticalScrollbarPainter)
+            [m_verticalScrollbarPainter setUsePresentationValue:NO];
+        if (m_horizontalScrollbarPainter)
+            [m_horizontalScrollbarPainter setUsePresentationValue:NO];
+    }
+
     m_scrollElasticityController.handleWheelEvent(wheelEvent);
     scrollingTree().setOrClearLatchedNode(wheelEvent, scrollingNodeID());
     scrollingTree().handleWheelEventPhase(wheelEvent.phase());

Modified: trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm (165068 => 165069)


--- trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm	2014-03-04 20:15:38 UTC (rev 165068)
+++ trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm	2014-03-04 20:22:03 UTC (rev 165069)
@@ -563,6 +563,10 @@
     // UIStateTransition always animates to 1. In case an animation is in progress this avoids a hard transition.
     [scrollbarPainter setUiStateTransitionProgress:1 - [scrollerImp uiStateTransitionProgress]];
 
+    // If the UI state transition is happening, then we are no longer moving the scrollbar on the scrolling thread.
+    if (_scrollbar->supportsUpdateOnSecondaryThread())
+        [scrollbarPainter setUsePresentationValue:NO];
+
     if (!_uiStateTransitionAnimation)
         _uiStateTransitionAnimation = adoptNS([[WebScrollbarPartAnimation alloc] initWithScrollbar:_scrollbar 
                                                                                 featureToAnimate:UIStateTransition
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to