Title: [202849] trunk
Revision
202849
Author
[email protected]
Date
2016-07-05 23:13:08 -0700 (Tue, 05 Jul 2016)

Log Message

Enhance Windows DRT implementation to support platform scroll wheel events.
https://bugs.webkit.org/show_bug.cgi?id=36002

Reviewed by Brent Fulgham.

Tools:

Implement function continuousMouseScrollBy in Windows event sender.

* DumpRenderTree/win/EventSender.cpp:
(mouseScrollBy):
(continuousMouseScrollBy):

LayoutTests:

Update test expectations.

* platform/win/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (202848 => 202849)


--- trunk/LayoutTests/ChangeLog	2016-07-06 05:51:20 UTC (rev 202848)
+++ trunk/LayoutTests/ChangeLog	2016-07-06 06:13:08 UTC (rev 202849)
@@ -1,5 +1,16 @@
 2016-07-05  Per Arne Vollan  <[email protected]>
 
+        Enhance Windows DRT implementation to support platform scroll wheel events.
+        https://bugs.webkit.org/show_bug.cgi?id=36002
+
+        Reviewed by Brent Fulgham.
+
+        Update test expectations.
+
+        * platform/win/TestExpectations:
+
+2016-07-05  Per Arne Vollan  <[email protected]>
+
         [Win] Layout Test http/tests/security/contentSecurityPolicy/source-list-parsing-10.html is failing
         https://bugs.webkit.org/show_bug.cgi?id=147646
 

Modified: trunk/LayoutTests/platform/win/TestExpectations (202848 => 202849)


--- trunk/LayoutTests/platform/win/TestExpectations	2016-07-06 05:51:20 UTC (rev 202848)
+++ trunk/LayoutTests/platform/win/TestExpectations	2016-07-06 06:13:08 UTC (rev 202849)
@@ -224,23 +224,13 @@
 # TODO Need to add functionality to DumpRenderTree to handle enable/disable Spatial Navigation
 fast/spatial-navigation/ [ Skip ]
 
-# TODO mouseScrollBy() and continuousMouseScrollBy() are not yet implemented in the Windows EventSender API.
-webkit.org/b/36002 fast/events/remove-child-onscroll.html [ Skip ]
-webkit.org/b/36002 fast/events/platform-wheelevent-in-scrolling-div.html [ Skip ]
-webkit.org/b/36002 fast/events/platform-wheelevent-with-delta-zero-crash.html [ Skip ]
-webkit.org/b/36002 fast/events/continuous-platform-wheelevent-in-scrolling-div.html [ Skip ]
-webkit.org/b/36002 fast/events/scroll-in-scaled-page-with-overflow-hidden.html [ Skip ]
-webkit.org/b/36002 fast/events/wheelevent-direction-inverted-from-device.html [ Skip ]
-webkit.org/b/36002 fast/events/wheelevent-in-horizontal-scrollbar-in-rtl.html [ Skip ]
-webkit.org/b/36002 fast/events/wheelevent-in-text-node.html [ Skip ]
-webkit.org/b/36002 fast/events/wheelevent-in-vertical-scrollbar-in-rtl.html [ Skip ]
-webkit.org/b/36002 fast/forms/search/search-scroll-hidden-decoration-container-crash.html [ Skip ]
-webkit.org/b/36002 fast/repaint/overflow-auto-in-overflow-auto-scrolled.html [ Skip ]
-webkit.org/b/36002 fast/repaint/overflow-scroll-in-overflow-scroll-scrolled.html [ Skip ]
-webkit.org/b/36002 fast/repaint/table-overflow-auto-in-overflow-auto-scrolled.html [ Skip ]
-webkit.org/b/36002 fast/repaint/table-overflow-scroll-in-overflow-scroll-scrolled.html [ Skip ]
-webkit.org/b/36002 scrollbars/scrollevent-iframe-no-scrolling-wheel.html [ Skip ]
-webkit.org/b/36002 scrollbars/scroll-rtl-or-bt-layer.html [ Skip ]
+# TODO Investigate why these mouse scroll tests are failing.
+fast/events/platform-wheelevent-in-scrolling-div.html [ Failure ]
+fast/events/continuous-platform-wheelevent-in-scrolling-div.html [ Failure ]
+fast/events/scroll-in-scaled-page-with-overflow-hidden.html [ Failure ]
+fast/events/wheelevent-in-horizontal-scrollbar-in-rtl.html [ Failure ]
+fast/events/wheelevent-in-vertical-scrollbar-in-rtl.html [ Failure ]
+scrollbars/scroll-rtl-or-bt-layer.html [ Timeout ]
 
 # TODO Needs testRunner.enableAutoResizeMode()
 fast/autoresize/ [ Skip ]

Modified: trunk/Tools/ChangeLog (202848 => 202849)


--- trunk/Tools/ChangeLog	2016-07-06 05:51:20 UTC (rev 202848)
+++ trunk/Tools/ChangeLog	2016-07-06 06:13:08 UTC (rev 202849)
@@ -1,3 +1,16 @@
+2016-07-05  Per Arne Vollan  <[email protected]>
+
+        Enhance Windows DRT implementation to support platform scroll wheel events.
+        https://bugs.webkit.org/show_bug.cgi?id=36002
+
+        Reviewed by Brent Fulgham.
+
+        Implement function continuousMouseScrollBy in Windows event sender.
+
+        * DumpRenderTree/win/EventSender.cpp:
+        (mouseScrollBy):
+        (continuousMouseScrollBy):
+
 2016-07-05  Myles C. Maxfield  <[email protected]>
 
         [Sierra] Rebaseline tests to use un-mocked system font metrics

Modified: trunk/Tools/DumpRenderTree/win/EventSender.cpp (202848 => 202849)


--- trunk/Tools/DumpRenderTree/win/EventSender.cpp	2016-07-06 05:51:20 UTC (rev 202848)
+++ trunk/Tools/DumpRenderTree/win/EventSender.cpp	2016-07-06 06:13:08 UTC (rev 202849)
@@ -781,19 +781,49 @@
     return JSValueMakeUndefined(context);
 }
 
+void mouseScrollBy(double x, double y, bool continuous)
+{
+    RECT rect;
+    ::GetWindowRect(webViewWindow, &rect);
+
+    // This value is taken from Source/WebCore/platform/win/WheelEventWin.cpp
+    const float cScrollbarPixelsPerLine = 100.0f / 3.0f;
+
+    if (x) {
+        UINT scrollChars = 1;
+        ::SystemParametersInfo(SPI_GETWHEELSCROLLCHARS, 0, &scrollChars, 0);
+        x *= WHEEL_DELTA / scrollChars;
+        if (continuous)
+            x /= cScrollbarPixelsPerLine;
+        MSG msg = makeMsg(webViewWindow, WM_MOUSEHWHEEL, MAKEWPARAM(0, x), MAKELPARAM(rect.left + lastMousePosition.x, rect.top + lastMousePosition.y));
+        dispatchMessage(&msg);
+    }
+
+    if (y) {
+        UINT scrollLines = 3;
+        ::SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &scrollLines, 0);
+        y *= WHEEL_DELTA / scrollLines;
+        if (continuous)
+            y /= cScrollbarPixelsPerLine;
+        MSG msg = makeMsg(webViewWindow, WM_MOUSEWHEEL, MAKEWPARAM(0, y), MAKELPARAM(rect.left + lastMousePosition.x, rect.top + lastMousePosition.y));
+        dispatchMessage(&msg);
+    }
+}
+
 static JSValueRef mouseScrollBy(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     if (argumentCount < 1)
         return JSValueMakeUndefined(context);
 
-    double delta = JSValueToNumber(context, arguments[1], exception);
+    double deltaX = JSValueToNumber(context, arguments[0], exception);
 
-    RECT rect;
-    ::GetWindowRect(webViewWindow, &rect);
+    double deltaY = 0;
 
-    MSG msg = makeMsg(webViewWindow, WM_MOUSEWHEEL, MAKEWPARAM(0, delta), MAKELPARAM(rect.left + lastMousePosition.x, rect.top + lastMousePosition.y));
-    dispatchMessage(&msg);
+    if (argumentCount >= 2)
+        deltaY = JSValueToNumber(context, arguments[1], exception);
 
+    mouseScrollBy(deltaX, deltaY, false);
+
     return JSValueMakeUndefined(context);
 }
 
@@ -802,6 +832,23 @@
     return mouseScrollBy(context, function, thisObject, argumentCount, arguments, exception);
 }
 
+static JSValueRef continuousMouseScrollBy(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    if (argumentCount < 1)
+        return JSValueMakeUndefined(context);
+
+    double deltaX = JSValueToNumber(context, arguments[0], exception);
+
+    double deltaY = 0;
+
+    if (argumentCount >= 2)
+        deltaY = JSValueToNumber(context, arguments[1], exception);
+
+    mouseScrollBy(deltaX, deltaY, true);
+
+    return JSValueMakeUndefined(context);
+}
+
 static JSStaticFunction staticFunctions[] = {
     { "contextClick", contextClickCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     { "mouseDown", mouseDownCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
@@ -818,6 +865,7 @@
     { "scalePageBy", scalePageByCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     { "mouseScrollBy", mouseScrollBy, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     { "mouseScrollByWithWheelAndMomentumPhases", mouseScrollByWithWheelAndMomentumPhasesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+    { "continuousMouseScrollBy", continuousMouseScrollBy,  kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     { 0, 0, 0 }
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to