Title: [167634] trunk/Source/WebCore
Revision
167634
Author
[email protected]
Date
2014-04-21 17:05:02 -0700 (Mon, 21 Apr 2014)

Log Message

[Mac] Difficulty gesture scrolling vertically with trackpad after scrolling horizontally 
https://bugs.webkit.org/show_bug.cgi?id=131959
<rdar://problem/16654523>

Reviewed by Simon Fraser.

* page/mac/EventHandlerMac.mm:
(WebCore::deltaIsPredominantlyVertical): Added.
(WebCore::scrolledToEdgeInDominantDirection): Only consider current mouse wheel event. We don't care about
overall history when deciding if we are bumping against the edge of a scrollable region. Short-circuit if
the element style indicates that overflow is hidden, since this means there is no scroll possible in that
direction.
(WebCore::EventHandler::platformPrepareForWheelEvents): Update for new signature.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (167633 => 167634)


--- trunk/Source/WebCore/ChangeLog	2014-04-21 23:51:15 UTC (rev 167633)
+++ trunk/Source/WebCore/ChangeLog	2014-04-22 00:05:02 UTC (rev 167634)
@@ -1,3 +1,19 @@
+2014-04-21  Brent Fulgham  <[email protected]>
+
+        [Mac] Difficulty gesture scrolling vertically with trackpad after scrolling horizontally 
+        https://bugs.webkit.org/show_bug.cgi?id=131959
+        <rdar://problem/16654523>
+
+        Reviewed by Simon Fraser.
+
+        * page/mac/EventHandlerMac.mm:
+        (WebCore::deltaIsPredominantlyVertical): Added.
+        (WebCore::scrolledToEdgeInDominantDirection): Only consider current mouse wheel event. We don't care about
+        overall history when deciding if we are bumping against the edge of a scrollable region. Short-circuit if
+        the element style indicates that overflow is hidden, since this means there is no scroll possible in that
+        direction.
+        (WebCore::EventHandler::platformPrepareForWheelEvents): Update for new signature.
+
 2014-04-21  Eric Carlson  <[email protected]>
 
         [Mac] implement WebKitDataCue

Modified: trunk/Source/WebCore/page/mac/EventHandlerMac.mm (167633 => 167634)


--- trunk/Source/WebCore/page/mac/EventHandlerMac.mm	2014-04-21 23:51:15 UTC (rev 167633)
+++ trunk/Source/WebCore/page/mac/EventHandlerMac.mm	2014-04-22 00:05:02 UTC (rev 167634)
@@ -752,15 +752,31 @@
     return nullptr;
 }
 
-static bool scrolledToEdgeInDominantDirection(const ScrollableArea& area, DominantScrollGestureDirection direction, float deltaX, float deltaY)
+static bool deltaIsPredominantlyVertical(float deltaX, float deltaY)
 {
-    if (DominantScrollGestureDirection::Horizontal == direction && deltaX) {
+    return std::abs(deltaY) > std::abs(deltaX);
+}
+    
+static bool scrolledToEdgeInDominantDirection(const ContainerNode& container, const ScrollableArea& area, float deltaX, float deltaY)
+{
+    if (!container.renderer())
+        return true;
+
+    const RenderStyle& style = container.renderer()->style();
+
+    if (!deltaIsPredominantlyVertical(deltaX, deltaY) && deltaX) {
+        if (style.overflowX() == OHIDDEN)
+            return true;
+
         if (deltaX < 0)
             return area.scrolledToRight();
         
         return area.scrolledToLeft();
     }
-    
+
+    if (style.overflowY() == OHIDDEN)
+        return true;
+
     if (deltaY < 0)
         return area.scrolledToBottom();
     
@@ -790,7 +806,7 @@
     
     if (wheelEvent.shouldConsiderLatching()) {
         if (scrollableArea)
-            m_startedGestureAtScrollLimit = scrolledToEdgeInDominantDirection(*scrollableArea, m_recentWheelEventDeltaTracker->dominantScrollGestureDirection(), wheelEvent.deltaX(), wheelEvent.deltaY());
+            m_startedGestureAtScrollLimit = scrolledToEdgeInDominantDirection(*scrollableContainer, *scrollableArea, wheelEvent.deltaX(), wheelEvent.deltaY());
         else
             m_startedGestureAtScrollLimit = false;
         m_latchedWheelEventElement = wheelEventTarget;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to