Title: [184296] trunk/Source/WebCore
Revision
184296
Author
[email protected]
Date
2015-05-13 12:26:50 -0700 (Wed, 13 May 2015)

Log Message

Scrollbars in overflow regions are not vanishing after scrolling with scroll snap points
https://bugs.webkit.org/show_bug.cgi?id=142521
<rdar://problem/20100706>

Reviewed by Darin Adler.

The scrollbars were not being dismissed because they were not being notified that the wheel
gesture was finished. This was happening because the wheel event 'ended' state has zero
deltaX and deltaY. If the region did not allow stretching, it would exit early, never passing
through the 'handleWheelEventPhase' code that would notify the scrollbar controller that
the gesture had ended.

* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::mouseExitedContentArea): The wrong ScrollAnimator method was being
called when the mouse exited the content area.
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::handleWheelEvent): Do not early return when the wheel event has
no change in X or Y coordinate.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (184295 => 184296)


--- trunk/Source/WebCore/ChangeLog	2015-05-13 19:24:10 UTC (rev 184295)
+++ trunk/Source/WebCore/ChangeLog	2015-05-13 19:26:50 UTC (rev 184296)
@@ -1,3 +1,24 @@
+2015-05-13  Brent Fulgham  <[email protected]>
+
+        Scrollbars in overflow regions are not vanishing after scrolling with scroll snap points
+        https://bugs.webkit.org/show_bug.cgi?id=142521
+        <rdar://problem/20100706>
+
+        Reviewed by Darin Adler.
+
+        The scrollbars were not being dismissed because they were not being notified that the wheel
+        gesture was finished. This was happening because the wheel event 'ended' state has zero
+        deltaX and deltaY. If the region did not allow stretching, it would exit early, never passing
+        through the 'handleWheelEventPhase' code that would notify the scrollbar controller that
+        the gesture had ended.
+
+        * platform/ScrollableArea.cpp:
+        (WebCore::ScrollableArea::mouseExitedContentArea): The wrong ScrollAnimator method was being
+        called when the mouse exited the content area.
+        * platform/mac/ScrollAnimatorMac.mm:
+        (WebCore::ScrollAnimatorMac::handleWheelEvent): Do not early return when the wheel event has
+        no change in X or Y coordinate.
+
 2015-05-12  David Hyatt  <[email protected]>
 
         Don't compute selection painting info when we don't have selection.

Modified: trunk/Source/WebCore/platform/ScrollableArea.cpp (184295 => 184296)


--- trunk/Source/WebCore/platform/ScrollableArea.cpp	2015-05-13 19:24:10 UTC (rev 184295)
+++ trunk/Source/WebCore/platform/ScrollableArea.cpp	2015-05-13 19:26:50 UTC (rev 184296)
@@ -253,7 +253,7 @@
 void ScrollableArea::mouseExitedContentArea() const
 {
     if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
-        scrollAnimator->mouseEnteredContentArea();
+        scrollAnimator->mouseExitedContentArea();
 }
 
 void ScrollableArea::mouseMovedInContentArea() const

Modified: trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm (184295 => 184296)


--- trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm	2015-05-13 19:24:10 UTC (rev 184295)
+++ trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm	2015-05-13 19:26:50 UTC (rev 184296)
@@ -1091,16 +1091,18 @@
     if (!wheelEvent.hasPreciseScrollingDeltas() || !rubberBandingEnabledForSystem())
         return ScrollAnimator::handleWheelEvent(wheelEvent);
 
-    // FIXME: This is somewhat roundabout hack to allow forwarding wheel events
-    // up to the parent scrollable area. It takes advantage of the fact that
-    // the base class implementation of handleWheelEvent will not accept the
-    // wheel event if there is nowhere to scroll.
-    if (fabsf(wheelEvent.deltaY()) >= fabsf(wheelEvent.deltaX())) {
-        if (!allowsVerticalStretching(wheelEvent))
-            return ScrollAnimator::handleWheelEvent(wheelEvent);
-    } else {
-        if (!allowsHorizontalStretching(wheelEvent))
-            return ScrollAnimator::handleWheelEvent(wheelEvent);
+    if (wheelEvent.deltaX() || wheelEvent.deltaY()) {
+        // FIXME: This is somewhat roundabout hack to allow forwarding wheel events
+        // up to the parent scrollable area. It takes advantage of the fact that
+        // the base class implementation of handleWheelEvent will not accept the
+        // wheel event if there is nowhere to scroll.
+        if (fabsf(wheelEvent.deltaY()) >= fabsf(wheelEvent.deltaX())) {
+            if (!allowsVerticalStretching(wheelEvent))
+                return ScrollAnimator::handleWheelEvent(wheelEvent);
+        } else {
+            if (!allowsHorizontalStretching(wheelEvent))
+                return ScrollAnimator::handleWheelEvent(wheelEvent);
+        }
     }
 
     bool didHandleEvent = m_scrollController.handleWheelEvent(wheelEvent);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to