[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

mrobinson at webkit.org mrobinson at webkit.org
Wed Dec 22 13:03:21 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 3b6ef91247b7b699d2a717b55855eda3560228b4
Author: mrobinson at webkit.org <mrobinson at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Sep 6 14:44:42 2010 +0000

    2010-09-06  Martin Robinson  <mrobinson at igalia.com>
    
            Reviewed by Xan Lopez.
    
            [GTK] EventSender should support modifier keys with mouseDown and mouseUp events
            https://bugs.webkit.org/show_bug.cgi?id=45235
    
            * platform/gtk/Skipped: Unskip a test which is now passing.
    2010-09-06  Martin Robinson  <mrobinson at igalia.com>
    
            Reviewed by Xan Lopez.
    
            [GTK] EventSender should support modifier keys with mouseDown and mouseUp events
            https://bugs.webkit.org/show_bug.cgi?id=45235
    
            Add support for interpreting the modifier key arguments to the mouseDown and mouseUp
            methods of the EventSender.
    
            * DumpRenderTree/gtk/EventSender.cpp:
            (prepareMouseButtonEvent): Allow passing in a modifier bitmask, which will be OR'd
            with the current modifiers.
            (contextClickCallback): Always send no modifiers when preparing the mouse event.
            (gdkModifersFromJSValue): Added, converts a JSValue array into a GDK modifier bitmask.
            (mouseDownCallback): Send in the requested modifiers to prepareMouseButtonEvent.
            (mouseUpCallback): Ditto.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66829 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index b5bbfb0..40cda39 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,5 +1,14 @@
 2010-09-06  Martin Robinson  <mrobinson at igalia.com>
 
+        Reviewed by Xan Lopez.
+
+        [GTK] EventSender should support modifier keys with mouseDown and mouseUp events
+        https://bugs.webkit.org/show_bug.cgi?id=45235
+
+        * platform/gtk/Skipped: Unskip a test which is now passing.
+
+2010-09-06  Martin Robinson  <mrobinson at igalia.com>
+
         Reviewed by Antonio Gomes.
 
         Convert editing/selection/shift-click.html to use setEditingBehavior
diff --git a/LayoutTests/platform/gtk/Skipped b/LayoutTests/platform/gtk/Skipped
index 08036e0..a7a50b2 100644
--- a/LayoutTests/platform/gtk/Skipped
+++ b/LayoutTests/platform/gtk/Skipped
@@ -5562,9 +5562,6 @@ inspector/timeline-parse-html.html
 # https://bugs.webkit.org/show_bug.cgi?id=38569
 http/tests/workers/text-encoding.html
 
-# https://bugs.webkit.org/show_bug.cgi?id=38656
-editing/selection/shift-click.html
-
 # https://bugs.webkit.org/show_bug.cgi?id=31302
 fast/css/font-face-woff.html 
 
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 50648b0..c5449ba 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,21 @@
+2010-09-06  Martin Robinson  <mrobinson at igalia.com>
+
+        Reviewed by Xan Lopez.
+
+        [GTK] EventSender should support modifier keys with mouseDown and mouseUp events
+        https://bugs.webkit.org/show_bug.cgi?id=45235
+
+        Add support for interpreting the modifier key arguments to the mouseDown and mouseUp
+        methods of the EventSender.
+
+        * DumpRenderTree/gtk/EventSender.cpp:
+        (prepareMouseButtonEvent): Allow passing in a modifier bitmask, which will be OR'd
+        with the current modifiers.
+        (contextClickCallback): Always send no modifiers when preparing the mouse event.
+        (gdkModifersFromJSValue): Added, converts a JSValue array into a GDK modifier bitmask.
+        (mouseDownCallback): Send in the requested modifiers to prepareMouseButtonEvent.
+        (mouseUpCallback): Ditto.
+
 2010-09-05  Peter Kasting  <pkasting at google.com>
 
         Reviewed by Adam Barth.
diff --git a/WebKitTools/DumpRenderTree/gtk/EventSender.cpp b/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
index 63a4b81..fc118bc 100644
--- a/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
@@ -110,7 +110,7 @@ static JSValueRef leapForwardCallback(JSContextRef context, JSObjectRef function
     return JSValueMakeUndefined(context);
 }
 
-bool prepareMouseButtonEvent(GdkEvent* event, int eventSenderButtonNumber)
+bool prepareMouseButtonEvent(GdkEvent* event, int eventSenderButtonNumber, guint modifiers)
 {
     WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
     if (!view)
@@ -133,7 +133,7 @@ bool prepareMouseButtonEvent(GdkEvent* event, int eventSenderButtonNumber)
     event->button.window = gtk_widget_get_window(GTK_WIDGET(view));
     g_object_ref(event->button.window);
     event->button.device = getDefaultGDKPointerDevice(event->button.window);
-    event->button.state = getStateFlags();
+    event->button.state = modifiers | getStateFlags();
     event->button.time = GDK_CURRENT_TIME;
     event->button.axes = 0;
 
@@ -148,7 +148,7 @@ bool prepareMouseButtonEvent(GdkEvent* event, int eventSenderButtonNumber)
 static JSValueRef contextClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     GdkEvent* pressEvent = gdk_event_new(GDK_BUTTON_PRESS);
-    if (!prepareMouseButtonEvent(pressEvent, 2))
+    if (!prepareMouseButtonEvent(pressEvent, 2, 0))
         return JSValueMakeUndefined(context);
 
     GdkEvent* releaseEvent = gdk_event_copy(pressEvent);
@@ -170,6 +170,36 @@ static void updateClickCount(int button)
         clickCount++;
 }
 
+static guint gdkModifersFromJSValue(JSContextRef context, const JSValueRef modifiers)
+{
+    JSObjectRef modifiersArray = JSValueToObject(context, modifiers, 0);
+    if (!modifiersArray)
+        return 0;
+
+    guint gdkModifiers = 0;
+    int modifiersCount = JSValueToNumber(context, JSObjectGetProperty(context, modifiersArray, JSStringCreateWithUTF8CString("length"), 0), 0);
+    for (int i = 0; i < modifiersCount; ++i) {
+        JSValueRef value = JSObjectGetPropertyAtIndex(context, modifiersArray, i, 0);
+        JSStringRef string = JSValueToStringCopy(context, value, 0);
+        if (JSStringIsEqualToUTF8CString(string, "ctrlKey")
+            || JSStringIsEqualToUTF8CString(string, "addSelectionKey"))
+            gdkModifiers |= GDK_CONTROL_MASK;
+        else if (JSStringIsEqualToUTF8CString(string, "shiftKey")
+                 || JSStringIsEqualToUTF8CString(string, "rangeSelectionKey"))
+            gdkModifiers |= GDK_SHIFT_MASK;
+        else if (JSStringIsEqualToUTF8CString(string, "altKey"))
+            gdkModifiers |= GDK_MOD1_MASK;
+
+        // Currently the metaKey as defined in WebCore/platform/gtk/MouseEventGtk.cpp
+        // is GDK_MOD2_MASK. This code must be kept in sync with that file.
+        else if (JSStringIsEqualToUTF8CString(string, "metaKey"))
+            gdkModifiers |= GDK_MOD2_MASK;
+
+        JSStringRelease(string);
+    }
+    return gdkModifiers;
+}
+
 static JSValueRef mouseDownCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     int button = 0;
@@ -177,9 +207,10 @@ static JSValueRef mouseDownCallback(JSContextRef context, JSObjectRef function,
         button = static_cast<int>(JSValueToNumber(context, arguments[0], exception));
         g_return_val_if_fail((!exception || !*exception), JSValueMakeUndefined(context));
     }
+    guint modifiers = argumentCount >= 2 ? gdkModifersFromJSValue(context, arguments[1]) : 0;
 
     GdkEvent* event = gdk_event_new(GDK_BUTTON_PRESS);
-    if (!prepareMouseButtonEvent(event, button))
+    if (!prepareMouseButtonEvent(event, button, modifiers))
         return JSValueMakeUndefined(context);
 
     buttonCurrentlyDown = event->button.button;
@@ -220,9 +251,10 @@ static JSValueRef mouseUpCallback(JSContextRef context, JSObjectRef function, JS
         button = static_cast<int>(JSValueToNumber(context, arguments[0], exception));
         g_return_val_if_fail((!exception || !*exception), JSValueMakeUndefined(context));
     }
+    guint modifiers = argumentCount >= 2 ? gdkModifersFromJSValue(context, arguments[1]) : 0;
 
     GdkEvent* event = gdk_event_new(GDK_BUTTON_RELEASE);
-    if (!prepareMouseButtonEvent(event, button))
+    if (!prepareMouseButtonEvent(event, button, modifiers))
         return JSValueMakeUndefined(context);
 
     lastClickPositionX = lastMousePositionX;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list