Title: [127446] releases/WebKitGTK/webkit-1.10
Revision
127446
Author
[email protected]
Date
2012-09-04 01:38:18 -0700 (Tue, 04 Sep 2012)

Log Message

Merge r127070 - Source/WebCore: [Gtk] Process Gtk 3.4 smooth scroll events properly.
https://bugs.webkit.org/show_bug.cgi?id=88070

Gtk 3.3.18 added smooth scroll events, adding a new scroll direction that
provides detailed delta information.

Added GDK_SMOOTH_SCROLL_MASK to the events listened, and added
code to process properly the new direction GDK_SCROLL_SMOOTH and
its deltas.

Patch by José Dapena Paz <[email protected]> on 2012-08-29
Reviewed by Martin Robinson.

Test: fast/events/continuous-platform-wheelevent-in-scrolling-div.html

* platform/gtk/PlatformWheelEventGtk.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):

Source/WebKit/gtk: [Gtk] Process Gtk 3.4 smooth scroll events properly.
https://bugs.webkit.org/show_bug.cgi?id=88070

Gtk 3.3.18 added smooth scroll events, adding a new scroll direction that
provides detailed delta information.

Added GDK_SMOOTH_SCROLL_MASK to the events listened, and added
code to process properly the new direction GDK_SCROLL_SMOOTH and
its deltas.

Patch by José Dapena Paz <[email protected]> on 2012-08-29
Reviewed by Martin Robinson.

* webkit/webkitwebview.cpp:
(webkit_web_view_realize):

Source/WebKit2: [Gtk] Process Gtk 3.4 smooth scroll events properly.
https://bugs.webkit.org/show_bug.cgi?id=88070

Gtk 3.3.18 added smooth scroll events, adding a new scroll direction that
provides detailed delta information.

Added GDK_SMOOTH_SCROLL_MASK to the events listened, and added
code to process properly the new direction GDK_SCROLL_SMOOTH and
its deltas.

Patch by José Dapena Paz <[email protected]> on 2012-08-29
Reviewed by Martin Robinson.

* Shared/gtk/WebEventFactory.cpp:
(WebKit::WebEventFactory::createWebWheelEvent):
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseRealize):

Tools: [Gtk] Process Gtk 3.4 smooth scroll events properly
https://bugs.webkit.org/show_bug.cgi?id=88070

Added continousMouseScrollBy support in WebKitTestRunner, and added
implementation for gtk, and stub for Qt, mac and EFL.

Added layout tests support for smooth scroll in Gtk 3.4, and use smooth
scroll for emulating multi-tick mouseScrollBy events.

Patch by José Dapena Paz <[email protected]> on 2012-08-29
Reviewed by Martin Robinson.

* DumpRenderTree/gtk/EventSender.cpp:
(mouseScrollByCallback):
(continuousMouseScrollByCallback):
* WebKitTestRunner/EventSenderProxy.h:
(EventSenderProxy):
* WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl:
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseScrollBy):
(WTR):
(WTR::EventSendingController::continuousMouseScrollBy):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
(EventSendingController):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle):
* WebKitTestRunner/gtk/EventSenderProxyGtk.cpp:
(WTR):
(WTR::EventSenderProxy::mouseScrollBy):
(WTR::EventSenderProxy::continuousMouseScrollBy):
* WebKitTestRunner/efl/EventSenderProxyEfl.cpp:
(WTR):
(WTR::EventSenderProxy::continuousMouseScrollBy):
* WebKitTestRunner/mac/EventSenderProxy.mm:
(WTR::EventSenderProxy::continuousScrollBy):
* WebKitTestRunner/qt/EventSenderProxyQt.cpp:
(WTR::EventSenderProxy::continuousMouseScrollBy):
(WTR):

LayoutTests: [Gtk] Process Gtk 3.4 smooth scroll events properly.
https://bugs.webkit.org/show_bug.cgi?id=88070

Added layout tests support for smooth scroll in Gtk 3.4, and use smooth
scroll for emulating multi-tick mouseScrollBy events.

Patch by José Dapena Paz <[email protected]> on 2012-08-29
Reviewed by Martin Robinson.

* platform/gtk-wk2/fast/events/wheelevent-in-horizontal-scrollbar-in-rtl-expected.txt: Added.
* platform/gtk-wk2/fast/events/wheelevent-in-vertical-scrollbar-in-rtl-expected.txt: Added.
* platform/gtk/TestExpectations:
* platform/gtk/fast/events/wheelevent-in-horizontal-scrollbar-in-rtl-expected.txt: Added.
* platform/gtk/fast/events/wheelevent-in-vertical-scrollbar-in-rtl-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-1.10/LayoutTests/ChangeLog (127445 => 127446)


--- releases/WebKitGTK/webkit-1.10/LayoutTests/ChangeLog	2012-09-04 08:38:04 UTC (rev 127445)
+++ releases/WebKitGTK/webkit-1.10/LayoutTests/ChangeLog	2012-09-04 08:38:18 UTC (rev 127446)
@@ -1,3 +1,19 @@
+2012-08-29  José Dapena Paz  <[email protected]>
+
+        [Gtk] Process Gtk 3.4 smooth scroll events properly.
+        https://bugs.webkit.org/show_bug.cgi?id=88070
+
+        Added layout tests support for smooth scroll in Gtk 3.4, and use smooth
+        scroll for emulating multi-tick mouseScrollBy events.
+
+        Reviewed by Martin Robinson.
+
+        * platform/gtk-wk2/fast/events/wheelevent-in-horizontal-scrollbar-in-rtl-expected.txt: Added.
+        * platform/gtk-wk2/fast/events/wheelevent-in-vertical-scrollbar-in-rtl-expected.txt: Added.
+        * platform/gtk/TestExpectations:
+        * platform/gtk/fast/events/wheelevent-in-horizontal-scrollbar-in-rtl-expected.txt: Added.
+        * platform/gtk/fast/events/wheelevent-in-vertical-scrollbar-in-rtl-expected.txt: Added.
+
 2012-08-30  MORITA Hajime  <[email protected]>
 
         Unreviewed, rolling out r126127.

Modified: releases/WebKitGTK/webkit-1.10/LayoutTests/platform/gtk/TestExpectations (127445 => 127446)


--- releases/WebKitGTK/webkit-1.10/LayoutTests/platform/gtk/TestExpectations	2012-09-04 08:38:04 UTC (rev 127445)
+++ releases/WebKitGTK/webkit-1.10/LayoutTests/platform/gtk/TestExpectations	2012-09-04 08:38:18 UTC (rev 127446)
@@ -785,24 +785,17 @@
 BUGWK35300 : http/tests/loading/307-after-303-after-post.html = TEXT
 BUGWK35300 SKIP : http/tests/navigation/post-307-response.html = TEXT
 
-// mouseScrollBy() and continuousMouseScrollBy() are not yet implemented in the GTK EventSender API.
-BUGWK36003 : fast/events/continuous-platform-wheelevent-in-scrolling-div.html = TEXT
-BUGWK36003 : fast/events/platform-wheelevent-in-scrolling-div.html = TEXT
-BUGWK36003 : fast/events/platform-wheelevent-paging-x-in-non-scrolling-div.html = TEXT
-BUGWK36003 : fast/events/platform-wheelevent-paging-x-in-non-scrolling-page.html = TEXT
-BUGWK36003 : fast/events/platform-wheelevent-paging-x-in-scrolling-div.html = TEXT
-BUGWK36003 : fast/events/platform-wheelevent-paging-x-in-scrolling-page.html = TEXT
-BUGWK36003 : fast/events/platform-wheelevent-paging-xy-in-scrolling-div.html = TEXT
-BUGWK36003 : fast/events/platform-wheelevent-paging-xy-in-scrolling-page.html = TEXT
-BUGWK36003 : fast/events/platform-wheelevent-paging-y-in-non-scrolling-div.html = TEXT
-BUGWK36003 : fast/events/platform-wheelevent-paging-y-in-non-scrolling-page.html = TEXT
-BUGWK36003 : fast/events/platform-wheelevent-paging-y-in-scrolling-div.html = TEXT
-BUGWK36003 : fast/events/platform-wheelevent-paging-y-in-scrolling-page.html = TEXT
-BUGWK36003 SKIP : fast/events/remove-child-onscroll.html = TEXT
-BUGWK36003 : fast/events/scroll-in-scaled-page-with-overflow-hidden.html = TEXT
-BUGWK36003 : fast/events/wheelevent-direction-inverted-from-device.html = TEXT
-BUGWK36003 : fast/events/wheelevent-in-horizontal-scrollbar-in-rtl.html = TEXT
-BUGWK36003 : fast/events/wheelevent-in-vertical-scrollbar-in-rtl.html = TEXT
+// Paged continuousMouseScrollBy() events are not supported in GTK.
+BUGWKGTK : fast/events/platform-wheelevent-paging-x-in-non-scrolling-div.html = TEXT
+BUGWKGTK : fast/events/platform-wheelevent-paging-x-in-non-scrolling-page.html = TEXT
+BUGWKGTK : fast/events/platform-wheelevent-paging-x-in-scrolling-div.html = TEXT
+BUGWKGTK : fast/events/platform-wheelevent-paging-x-in-scrolling-page.html = TEXT
+BUGWKGTK : fast/events/platform-wheelevent-paging-xy-in-scrolling-div.html = TEXT
+BUGWKGTK : fast/events/platform-wheelevent-paging-xy-in-scrolling-page.html = TEXT
+BUGWKGTK : fast/events/platform-wheelevent-paging-y-in-non-scrolling-div.html = TEXT
+BUGWKGTK : fast/events/platform-wheelevent-paging-y-in-non-scrolling-page.html = TEXT
+BUGWKGTK : fast/events/platform-wheelevent-paging-y-in-scrolling-div.html = TEXT
+BUGWKGTK : fast/events/platform-wheelevent-paging-y-in-scrolling-page.html = TEXT
 
 // Misses setMediaType() implementation
 BUGWKGTK SKIP : fast/media/print-restores-previous-mediatype.html = TIMEOUT

Added: releases/WebKitGTK/webkit-1.10/LayoutTests/platform/gtk/fast/events/wheelevent-in-horizontal-scrollbar-in-rtl-expected.txt (0 => 127446)


--- releases/WebKitGTK/webkit-1.10/LayoutTests/platform/gtk/fast/events/wheelevent-in-horizontal-scrollbar-in-rtl-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-1.10/LayoutTests/platform/gtk/fast/events/wheelevent-in-horizontal-scrollbar-in-rtl-expected.txt	2012-09-04 08:38:18 UTC (rev 127446)
@@ -0,0 +1,3 @@
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
+window.scrollX: -120
+window.scrollY: 80

Added: releases/WebKitGTK/webkit-1.10/LayoutTests/platform/gtk/fast/events/wheelevent-in-vertical-scrollbar-in-rtl-expected.txt (0 => 127446)


--- releases/WebKitGTK/webkit-1.10/LayoutTests/platform/gtk/fast/events/wheelevent-in-vertical-scrollbar-in-rtl-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-1.10/LayoutTests/platform/gtk/fast/events/wheelevent-in-vertical-scrollbar-in-rtl-expected.txt	2012-09-04 08:38:18 UTC (rev 127446)
@@ -0,0 +1,3 @@
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
+window.scrollX: 80
+window.scrollY: -120

Added: releases/WebKitGTK/webkit-1.10/LayoutTests/platform/gtk-wk2/fast/events/wheelevent-in-horizontal-scrollbar-in-rtl-expected.txt (0 => 127446)


--- releases/WebKitGTK/webkit-1.10/LayoutTests/platform/gtk-wk2/fast/events/wheelevent-in-horizontal-scrollbar-in-rtl-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-1.10/LayoutTests/platform/gtk-wk2/fast/events/wheelevent-in-horizontal-scrollbar-in-rtl-expected.txt	2012-09-04 08:38:18 UTC (rev 127446)
@@ -0,0 +1,3 @@
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
+window.scrollX: -122
+window.scrollY: 78

Added: releases/WebKitGTK/webkit-1.10/LayoutTests/platform/gtk-wk2/fast/events/wheelevent-in-vertical-scrollbar-in-rtl-expected.txt (0 => 127446)


--- releases/WebKitGTK/webkit-1.10/LayoutTests/platform/gtk-wk2/fast/events/wheelevent-in-vertical-scrollbar-in-rtl-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-1.10/LayoutTests/platform/gtk-wk2/fast/events/wheelevent-in-vertical-scrollbar-in-rtl-expected.txt	2012-09-04 08:38:18 UTC (rev 127446)
@@ -0,0 +1,3 @@
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
+window.scrollX: 78
+window.scrollY: -122

Modified: releases/WebKitGTK/webkit-1.10/Source/WebCore/ChangeLog (127445 => 127446)


--- releases/WebKitGTK/webkit-1.10/Source/WebCore/ChangeLog	2012-09-04 08:38:04 UTC (rev 127445)
+++ releases/WebKitGTK/webkit-1.10/Source/WebCore/ChangeLog	2012-09-04 08:38:18 UTC (rev 127446)
@@ -1,3 +1,22 @@
+2012-08-29  José Dapena Paz  <[email protected]>
+
+        [Gtk] Process Gtk 3.4 smooth scroll events properly.
+        https://bugs.webkit.org/show_bug.cgi?id=88070
+
+        Gtk 3.3.18 added smooth scroll events, adding a new scroll direction that
+        provides detailed delta information.
+
+        Added GDK_SMOOTH_SCROLL_MASK to the events listened, and added
+        code to process properly the new direction GDK_SCROLL_SMOOTH and
+        its deltas.
+
+        Reviewed by Martin Robinson.
+
+        Test: fast/events/continuous-platform-wheelevent-in-scrolling-div.html
+
+        * platform/gtk/PlatformWheelEventGtk.cpp:
+        (WebCore::PlatformWheelEvent::PlatformWheelEvent):
+
 2012-08-30  MORITA Hajime  <[email protected]>
 
         Unreviewed, rolling out r126127.

Modified: releases/WebKitGTK/webkit-1.10/Source/WebCore/platform/gtk/PlatformWheelEventGtk.cpp (127445 => 127446)


--- releases/WebKitGTK/webkit-1.10/Source/WebCore/platform/gtk/PlatformWheelEventGtk.cpp	2012-09-04 08:38:04 UTC (rev 127445)
+++ releases/WebKitGTK/webkit-1.10/Source/WebCore/platform/gtk/PlatformWheelEventGtk.cpp	2012-09-04 08:38:18 UTC (rev 127446)
@@ -30,6 +30,7 @@
 #include "Scrollbar.h"
 
 #include <gdk/gdk.h>
+#include <gtk/gtk.h>
 #include <wtf/CurrentTime.h>
 
 namespace WebCore {
@@ -69,6 +70,15 @@
         case GDK_SCROLL_RIGHT:
             m_deltaX = -delta;
             break;
+#if GTK_CHECK_VERSION(3, 3, 18)
+        case GDK_SCROLL_SMOOTH: {
+                gdouble deltaX, deltaY;
+                gdk_event_get_scroll_deltas(reinterpret_cast<GdkEvent*>(event), &deltaX, &deltaY);
+                m_deltaX = -deltaX;
+                m_deltaY = -deltaY;
+            }
+            break;
+#endif
     }
     m_wheelTicksX = m_deltaX;
     m_wheelTicksY = m_deltaY;

Modified: releases/WebKitGTK/webkit-1.10/Source/WebKit/gtk/ChangeLog (127445 => 127446)


--- releases/WebKitGTK/webkit-1.10/Source/WebKit/gtk/ChangeLog	2012-09-04 08:38:04 UTC (rev 127445)
+++ releases/WebKitGTK/webkit-1.10/Source/WebKit/gtk/ChangeLog	2012-09-04 08:38:18 UTC (rev 127446)
@@ -1,3 +1,20 @@
+2012-08-29  José Dapena Paz  <[email protected]>
+
+        [Gtk] Process Gtk 3.4 smooth scroll events properly.
+        https://bugs.webkit.org/show_bug.cgi?id=88070
+
+        Gtk 3.3.18 added smooth scroll events, adding a new scroll direction that
+        provides detailed delta information.
+
+        Added GDK_SMOOTH_SCROLL_MASK to the events listened, and added
+        code to process properly the new direction GDK_SCROLL_SMOOTH and
+        its deltas.
+
+        Reviewed by Martin Robinson.
+
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_realize):
+
 2012-08-23  Carlos Garcia Campos  <[email protected]>
 
         Unreviewed. Update NEWS and configure.ac for 1.9.90 release

Modified: releases/WebKitGTK/webkit-1.10/Source/WebKit/gtk/webkit/webkitwebview.cpp (127445 => 127446)


--- releases/WebKitGTK/webkit-1.10/Source/WebKit/gtk/webkit/webkitwebview.cpp	2012-09-04 08:38:04 UTC (rev 127445)
+++ releases/WebKitGTK/webkit-1.10/Source/WebKit/gtk/webkit/webkitwebview.cpp	2012-09-04 08:38:18 UTC (rev 127446)
@@ -992,6 +992,9 @@
                             | GDK_BUTTON_PRESS_MASK
                             | GDK_BUTTON_RELEASE_MASK
                             | GDK_SCROLL_MASK
+#if GTK_CHECK_VERSION(3, 3, 18)
+                            | GDK_SMOOTH_SCROLL_MASK
+#endif
                             | GDK_POINTER_MOTION_MASK
                             | GDK_KEY_PRESS_MASK
                             | GDK_KEY_RELEASE_MASK

Modified: releases/WebKitGTK/webkit-1.10/Source/WebKit2/ChangeLog (127445 => 127446)


--- releases/WebKitGTK/webkit-1.10/Source/WebKit2/ChangeLog	2012-09-04 08:38:04 UTC (rev 127445)
+++ releases/WebKitGTK/webkit-1.10/Source/WebKit2/ChangeLog	2012-09-04 08:38:18 UTC (rev 127446)
@@ -1,3 +1,22 @@
+2012-08-29  José Dapena Paz  <[email protected]>
+
+        [Gtk] Process Gtk 3.4 smooth scroll events properly.
+        https://bugs.webkit.org/show_bug.cgi?id=88070
+
+        Gtk 3.3.18 added smooth scroll events, adding a new scroll direction that
+        provides detailed delta information.
+
+        Added GDK_SMOOTH_SCROLL_MASK to the events listened, and added
+        code to process properly the new direction GDK_SCROLL_SMOOTH and
+        its deltas.
+
+        Reviewed by Martin Robinson.
+
+        * Shared/gtk/WebEventFactory.cpp:
+        (WebKit::WebEventFactory::createWebWheelEvent):
+        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+        (webkitWebViewBaseRealize):
+
 2012-08-23  Carlos Garcia Campos  <[email protected]>
 
         REGRESSION(r126306): it broke the plugin process

Modified: releases/WebKitGTK/webkit-1.10/Source/WebKit2/Shared/gtk/WebEventFactory.cpp (127445 => 127446)


--- releases/WebKitGTK/webkit-1.10/Source/WebKit2/Shared/gtk/WebEventFactory.cpp	2012-09-04 08:38:04 UTC (rev 127445)
+++ releases/WebKitGTK/webkit-1.10/Source/WebKit2/Shared/gtk/WebEventFactory.cpp	2012-09-04 08:38:18 UTC (rev 127446)
@@ -153,6 +153,14 @@
     case GDK_SCROLL_RIGHT:
         wheelTicks = FloatSize(-1, 0);
         break;
+#if GTK_CHECK_VERSION(3, 3, 18)
+    case GDK_SCROLL_SMOOTH: {
+            double deltaX, deltaY;
+            gdk_event_get_scroll_deltas(event, &deltaX, &deltaY);
+            wheelTicks = FloatSize(-deltaX, -deltaY);
+        }
+        break;
+#endif
     default:
         ASSERT_NOT_REACHED();
     }

Modified: releases/WebKitGTK/webkit-1.10/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp (127445 => 127446)


--- releases/WebKitGTK/webkit-1.10/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp	2012-09-04 08:38:04 UTC (rev 127445)
+++ releases/WebKitGTK/webkit-1.10/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp	2012-09-04 08:38:18 UTC (rev 127446)
@@ -147,6 +147,9 @@
         | GDK_BUTTON_PRESS_MASK
         | GDK_BUTTON_RELEASE_MASK
         | GDK_SCROLL_MASK
+#if GTK_CHECK_VERSION(3, 3, 18)
+        | GDK_SMOOTH_SCROLL_MASK
+#endif
         | GDK_POINTER_MOTION_MASK
         | GDK_KEY_PRESS_MASK
         | GDK_KEY_RELEASE_MASK

Modified: releases/WebKitGTK/webkit-1.10/Tools/ChangeLog (127445 => 127446)


--- releases/WebKitGTK/webkit-1.10/Tools/ChangeLog	2012-09-04 08:38:04 UTC (rev 127445)
+++ releases/WebKitGTK/webkit-1.10/Tools/ChangeLog	2012-09-04 08:38:18 UTC (rev 127446)
@@ -1,3 +1,43 @@
+2012-08-29  José Dapena Paz  <[email protected]>
+
+        [Gtk] Process Gtk 3.4 smooth scroll events properly
+        https://bugs.webkit.org/show_bug.cgi?id=88070
+
+        Added continousMouseScrollBy support in WebKitTestRunner, and added
+        implementation for gtk, and stub for Qt, mac and EFL.
+
+        Added layout tests support for smooth scroll in Gtk 3.4, and use smooth
+        scroll for emulating multi-tick mouseScrollBy events.
+
+        Reviewed by Martin Robinson.
+
+        * DumpRenderTree/gtk/EventSender.cpp:
+        (mouseScrollByCallback):
+        (continuousMouseScrollByCallback):
+        * WebKitTestRunner/EventSenderProxy.h:
+        (EventSenderProxy):
+        * WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl:
+        * WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
+        (WTR::EventSendingController::mouseScrollBy):
+        (WTR):
+        (WTR::EventSendingController::continuousMouseScrollBy):
+        * WebKitTestRunner/InjectedBundle/EventSendingController.h:
+        (EventSendingController):
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle):
+        * WebKitTestRunner/gtk/EventSenderProxyGtk.cpp:
+        (WTR):
+        (WTR::EventSenderProxy::mouseScrollBy):
+        (WTR::EventSenderProxy::continuousMouseScrollBy):
+        * WebKitTestRunner/efl/EventSenderProxyEfl.cpp:
+        (WTR):
+        (WTR::EventSenderProxy::continuousMouseScrollBy):
+        * WebKitTestRunner/mac/EventSenderProxy.mm:
+        (WTR::EventSenderProxy::continuousScrollBy):
+        * WebKitTestRunner/qt/EventSenderProxyQt.cpp:
+        (WTR::EventSenderProxy::continuousMouseScrollBy):
+        (WTR):
+
 2012-08-23  Carlos Garcia Campos  <[email protected]>
 
         REGRESSION(r126306): it broke the plugin process

Modified: releases/WebKitGTK/webkit-1.10/Tools/DumpRenderTree/gtk/EventSender.cpp (127445 => 127446)


--- releases/WebKitGTK/webkit-1.10/Tools/DumpRenderTree/gtk/EventSender.cpp	2012-09-04 08:38:04 UTC (rev 127445)
+++ releases/WebKitGTK/webkit-1.10/Tools/DumpRenderTree/gtk/EventSender.cpp	2012-09-04 08:38:18 UTC (rev 127446)
@@ -79,6 +79,9 @@
 
 static const float zoomMultiplierRatio = 1.2f;
 
+// WebCore and layout tests assume this value.
+static const float pixelsPerScrollTick = 40;
+
 // Key event location code defined in DOM Level 3.
 enum KeyLocationCode {
     DOM_KEY_LOCATION_STANDARD      = 0x00,
@@ -434,9 +437,6 @@
     int vertical = (int)JSValueToNumber(context, arguments[1], exception);
     g_return_val_if_fail((!exception || !*exception), JSValueMakeUndefined(context));
 
-    // GTK+ doesn't support multiple direction scrolls in the same event!
-    g_return_val_if_fail((!vertical || !horizontal), JSValueMakeUndefined(context));
-
     GdkEvent* event = gdk_event_new(GDK_SCROLL);
     event->scroll.x = lastMousePositionX;
     event->scroll.y = lastMousePositionY;
@@ -444,6 +444,21 @@
     event->scroll.window = gtk_widget_get_window(GTK_WIDGET(view));
     g_object_ref(event->scroll.window);
 
+    // GTK+ only supports one tick in each scroll event that is not smooth. For the cases of more than one direction,
+    // and more than one step in a direction, we can only use smooth events, supported from Gtk 3.3.18.
+#if GTK_CHECK_VERSION(3, 3, 18)
+    if ((horizontal && vertical) || horizontal > 1 || horizontal < -1 || vertical > 1 || vertical < -1) {
+        event->scroll.direction = GDK_SCROLL_SMOOTH;
+        event->scroll.delta_x = -horizontal;
+        event->scroll.delta_y = -vertical;
+
+        sendOrQueueEvent(event);
+        return JSValueMakeUndefined(context);
+    }
+#else
+    g_return_val_if_fail((!vertical || !horizontal), JSValueMakeUndefined(context));
+#endif
+
     if (horizontal < 0)
         event->scroll.direction = GDK_SCROLL_RIGHT;
     else if (horizontal > 0)
@@ -461,7 +476,34 @@
 
 static JSValueRef continuousMouseScrollByCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
-    // GTK doesn't support continuous scroll events.
+#if GTK_CHECK_VERSION(3, 3, 18)
+    WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
+    if (!view)
+        return JSValueMakeUndefined(context);
+
+    if (argumentCount < 2)
+        return JSValueMakeUndefined(context);
+
+    int horizontal = JSValueToNumber(context, arguments[0], exception);
+    g_return_val_if_fail((!exception || !*exception), JSValueMakeUndefined(context));
+    int vertical = JSValueToNumber(context, arguments[1], exception);
+    g_return_val_if_fail((!exception || !*exception), JSValueMakeUndefined(context));
+
+    g_return_val_if_fail(argumentCount < 3 || !JSValueToBoolean(context, arguments[2]), JSValueMakeUndefined(context));
+    
+    GdkEvent* event = gdk_event_new(GDK_SCROLL);
+    event->scroll.x = lastMousePositionX;
+    event->scroll.y = lastMousePositionY;
+    event->scroll.time = GDK_CURRENT_TIME;
+    event->scroll.window = gtk_widget_get_window(GTK_WIDGET(view));
+    g_object_ref(event->scroll.window);
+
+    event->scroll.direction = GDK_SCROLL_SMOOTH;
+    event->scroll.delta_x = -horizontal / pixelsPerScrollTick;
+    event->scroll.delta_y = -vertical / pixelsPerScrollTick;
+
+    sendOrQueueEvent(event);
+#endif
     return JSValueMakeUndefined(context);
 }
 

Modified: releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/EventSenderProxy.h (127445 => 127446)


--- releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/EventSenderProxy.h	2012-09-04 08:38:04 UTC (rev 127445)
+++ releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/EventSenderProxy.h	2012-09-04 08:38:18 UTC (rev 127446)
@@ -55,6 +55,7 @@
     void mouseUp(unsigned button, WKEventModifiers);
     void mouseMoveTo(double x, double y);
     void mouseScrollBy(int x, int y);
+    void continuousMouseScrollBy(int x, int y, bool paged);
 
     void leapForward(int milliseconds);
 

Modified: releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl (127445 => 127446)


--- releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl	2012-09-04 08:38:04 UTC (rev 127445)
+++ releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl	2012-09-04 08:38:18 UTC (rev 127446)
@@ -30,6 +30,7 @@
         void mouseUp(in long buttonNumber, in object modifierArray);
         void mouseMoveTo(in long x, in long y);
         void mouseScrollBy(in long x, in long y);
+        void continuousMouseScrollBy(in long x, in long y, in [Optional] boolean paged);
 
         void leapForward(in long milliseconds);
 

Modified: releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp (127445 => 127446)


--- releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp	2012-09-04 08:38:04 UTC (rev 127445)
+++ releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp	2012-09-04 08:38:18 UTC (rev 127446)
@@ -265,6 +265,30 @@
     WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
 }
 
+void EventSendingController::continuousMouseScrollBy(int x, int y, bool paged)
+{
+    WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender"));
+    WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate());
+
+    WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage"));
+    WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("ContinuousMouseScrollBy"));
+    WKDictionaryAddItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get());
+
+    WKRetainPtr<WKStringRef> xKey(AdoptWK, WKStringCreateWithUTF8CString("X"));
+    WKRetainPtr<WKDoubleRef> xRef(AdoptWK, WKDoubleCreate(x));
+    WKDictionaryAddItem(EventSenderMessageBody.get(), xKey.get(), xRef.get());
+
+    WKRetainPtr<WKStringRef> yKey(AdoptWK, WKStringCreateWithUTF8CString("Y"));
+    WKRetainPtr<WKDoubleRef> yRef(AdoptWK, WKDoubleCreate(y));
+    WKDictionaryAddItem(EventSenderMessageBody.get(), yKey.get(), yRef.get());
+
+    WKRetainPtr<WKStringRef> pagedKey(AdoptWK, WKStringCreateWithUTF8CString("Paged"));
+    WKRetainPtr<WKUInt64Ref> pagedRef(AdoptWK, WKUInt64Create(paged));
+    WKDictionaryAddItem(EventSenderMessageBody.get(), pagedKey.get(), pagedRef.get());
+
+    WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0);
+}
+
 #ifdef USE_WEBPROCESS_EVENT_SIMULATION
 void EventSendingController::updateClickCount(WKEventMouseButton button)
 {

Modified: releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.h (127445 => 127446)


--- releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.h	2012-09-04 08:38:04 UTC (rev 127445)
+++ releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.h	2012-09-04 08:38:18 UTC (rev 127446)
@@ -51,6 +51,7 @@
     void mouseUp(int button, JSValueRef modifierArray);
     void mouseMoveTo(int x, int y);
     void mouseScrollBy(int x, int y);
+    void continuousMouseScrollBy(int x, int y, bool paged);
     void leapForward(int milliseconds);
 
     void keyDown(JSStringRef key, JSValueRef modifierArray, int location);

Modified: releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/TestController.cpp (127445 => 127446)


--- releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/TestController.cpp	2012-09-04 08:38:04 UTC (rev 127445)
+++ releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/TestController.cpp	2012-09-04 08:38:18 UTC (rev 127446)
@@ -752,6 +752,23 @@
             return 0;
         }
 
+        if (WKStringIsEqualToUTF8CString(subMessageName, "ContinuousMouseScrollBy")) {
+            WKRetainPtr<WKStringRef> xKey = adoptWK(WKStringCreateWithUTF8CString("X"));
+            double x = WKDoubleGetValue(static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, xKey.get())));
+
+            WKRetainPtr<WKStringRef> yKey = adoptWK(WKStringCreateWithUTF8CString("Y"));
+            double y = WKDoubleGetValue(static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, yKey.get())));
+
+            WKRetainPtr<WKStringRef> pagedKey = adoptWK(WKStringCreateWithUTF8CString("Paged"));
+            bool paged = static_cast<bool>(WKUInt64GetValue(static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, pagedKey.get()))));
+
+            // Forward to WebProcess
+            WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), true);
+            m_eventSenderProxy->continuousMouseScrollBy(x, y, paged);
+            WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), false);
+            return 0;
+        }
+
         if (WKStringIsEqualToUTF8CString(subMessageName, "LeapForward")) {
             WKRetainPtr<WKStringRef> timeKey = adoptWK(WKStringCreateWithUTF8CString("TimeInMilliseconds"));
             unsigned time = static_cast<unsigned>(WKUInt64GetValue(static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, timeKey.get()))));

Modified: releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/efl/EventSenderProxyEfl.cpp (127445 => 127446)


--- releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/efl/EventSenderProxyEfl.cpp	2012-09-04 08:38:04 UTC (rev 127445)
+++ releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/efl/EventSenderProxyEfl.cpp	2012-09-04 08:38:18 UTC (rev 127446)
@@ -384,6 +384,11 @@
     sendOrQueueEvent(event);
 }
 
+void EventSenderProxy::continuousMouseScrollBy(int horizontal, int vertical, bool paged)
+{
+    notImplemented();
+}
+
 void EventSenderProxy::leapForward(int milliseconds)
 {
     if (m_eventQueue.isEmpty())

Modified: releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp (127445 => 127446)


--- releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp	2012-09-04 08:38:04 UTC (rev 127445)
+++ releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp	2012-09-04 08:38:18 UTC (rev 127446)
@@ -44,6 +44,9 @@
 
 namespace WTR {
 
+// WebCore and layout tests assume this value
+static const float pixelsPerScrollTick = 40;
+
 // Key event location code defined in DOM Level 3.
 enum KeyLocationCode {
     DOMKeyLocationStandard      = 0x00,
@@ -375,9 +378,22 @@
     event->scroll.x = m_position.x;
     event->scroll.y = m_position.y;
     event->scroll.time = GDK_CURRENT_TIME;
-    event->scroll.window = gtk_widget_get_window(GTK_WIDGET(m_testController->mainWebView()->platformWindow()));
+    event->scroll.window = gtk_widget_get_window(GTK_WIDGET(m_testController->mainWebView()->platformView()));
     g_object_ref(event->scroll.window);
+    gdk_event_set_device(event, gdk_device_manager_get_client_pointer(gdk_display_get_device_manager(gdk_window_get_display(event->scroll.window))));
 
+    // For more than one tick in a scroll, we need smooth scroll event
+#if GTK_CHECK_VERSION(3, 3, 18)
+    if ((horizontal && vertical) || horizontal > 1 || horizontal < -1 || vertical > 1 || vertical < -1) {
+        event->scroll.direction = GDK_SCROLL_SMOOTH;
+        event->scroll.delta_x = -horizontal;
+        event->scroll.delta_y = -vertical;
+
+        sendOrQueueEvent(event);
+        return;
+    }
+#endif
+
     if (horizontal < 0)
         event->scroll.direction = GDK_SCROLL_RIGHT;
     else if (horizontal > 0)
@@ -392,6 +408,28 @@
     sendOrQueueEvent(event);
 }
 
+void EventSenderProxy::continuousMouseScrollBy(int horizontal, int vertical, bool paged)
+{
+    // Gtk+ does not support paged scroll events.
+    g_return_if_fail(!paged);
+
+#if GTK_CHECK_VERSION(3, 3, 18)
+    GdkEvent* event = gdk_event_new(GDK_SCROLL);
+    event->scroll.x = m_position.x;
+    event->scroll.y = m_position.y;
+    event->scroll.time = GDK_CURRENT_TIME;
+    event->scroll.window = gtk_widget_get_window(GTK_WIDGET(m_testController->mainWebView()->platformView()));
+    g_object_ref(event->scroll.window);
+    gdk_event_set_device(event, gdk_device_manager_get_client_pointer(gdk_display_get_device_manager(gdk_window_get_display(event->scroll.window))));
+
+    event->scroll.direction = GDK_SCROLL_SMOOTH;
+    event->scroll.delta_x = -horizontal / pixelsPerScrollTick;
+    event->scroll.delta_y = -vertical / pixelsPerScrollTick;
+
+    sendOrQueueEvent(event);
+#endif
+}
+
 void EventSenderProxy::leapForward(int milliseconds)
 {
     if (m_eventQueue.isEmpty())

Modified: releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/mac/EventSenderProxy.mm (127445 => 127446)


--- releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/mac/EventSenderProxy.mm	2012-09-04 08:38:04 UTC (rev 127445)
+++ releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/mac/EventSenderProxy.mm	2012-09-04 08:38:18 UTC (rev 127446)
@@ -397,4 +397,10 @@
         [targetView scrollWheel:event];
 }
 
+void EventSenderProxy::continuousMouseScrollBy(int x, int y, bool paged)
+{
+    // FIXME: Implement this.
+    return;
+}
+
 } // namespace WTR

Modified: releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp (127445 => 127446)


--- releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp	2012-09-04 08:38:04 UTC (rev 127445)
+++ releases/WebKitGTK/webkit-1.10/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp	2012-09-04 08:38:18 UTC (rev 127446)
@@ -306,6 +306,11 @@
     // FIXME: Implement this.
 }
 
+void EventSenderProxy::continuousMouseScrollBy(int, int, bool)
+{
+    // FIXME: Implement this.
+}
+
 void EventSenderProxy::leapForward(int ms)
 {
     eventQueue[endOfQueue].m_delay = ms;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to