Changeset 66829 in webkit
- Timestamp:
- Sep 6, 2010 7:44:42 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r66828 r66829 1 2010-09-06 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by Xan Lopez. 4 5 [GTK] EventSender should support modifier keys with mouseDown and mouseUp events 6 https://bugs.webkit.org/show_bug.cgi?id=45235 7 8 * platform/gtk/Skipped: Unskip a test which is now passing. 9 1 10 2010-09-06 Martin Robinson <mrobinson@igalia.com> 2 11 -
trunk/LayoutTests/platform/gtk/Skipped
r66827 r66829 5563 5563 http/tests/workers/text-encoding.html 5564 5564 5565 # https://bugs.webkit.org/show_bug.cgi?id=386565566 editing/selection/shift-click.html5567 5568 5565 # https://bugs.webkit.org/show_bug.cgi?id=31302 5569 5566 fast/css/font-face-woff.html -
trunk/WebKitTools/ChangeLog
r66812 r66829 1 2010-09-06 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by Xan Lopez. 4 5 [GTK] EventSender should support modifier keys with mouseDown and mouseUp events 6 https://bugs.webkit.org/show_bug.cgi?id=45235 7 8 Add support for interpreting the modifier key arguments to the mouseDown and mouseUp 9 methods of the EventSender. 10 11 * DumpRenderTree/gtk/EventSender.cpp: 12 (prepareMouseButtonEvent): Allow passing in a modifier bitmask, which will be OR'd 13 with the current modifiers. 14 (contextClickCallback): Always send no modifiers when preparing the mouse event. 15 (gdkModifersFromJSValue): Added, converts a JSValue array into a GDK modifier bitmask. 16 (mouseDownCallback): Send in the requested modifiers to prepareMouseButtonEvent. 17 (mouseUpCallback): Ditto. 18 1 19 2010-09-05 Peter Kasting <pkasting@google.com> 2 20 -
trunk/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
r66666 r66829 111 111 } 112 112 113 bool prepareMouseButtonEvent(GdkEvent* event, int eventSenderButtonNumber )113 bool prepareMouseButtonEvent(GdkEvent* event, int eventSenderButtonNumber, guint modifiers) 114 114 { 115 115 WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); … … 134 134 g_object_ref(event->button.window); 135 135 event->button.device = getDefaultGDKPointerDevice(event->button.window); 136 event->button.state = getStateFlags();136 event->button.state = modifiers | getStateFlags(); 137 137 event->button.time = GDK_CURRENT_TIME; 138 138 event->button.axes = 0; … … 149 149 { 150 150 GdkEvent* pressEvent = gdk_event_new(GDK_BUTTON_PRESS); 151 if (!prepareMouseButtonEvent(pressEvent, 2 ))151 if (!prepareMouseButtonEvent(pressEvent, 2, 0)) 152 152 return JSValueMakeUndefined(context); 153 153 … … 171 171 } 172 172 173 static guint gdkModifersFromJSValue(JSContextRef context, const JSValueRef modifiers) 174 { 175 JSObjectRef modifiersArray = JSValueToObject(context, modifiers, 0); 176 if (!modifiersArray) 177 return 0; 178 179 guint gdkModifiers = 0; 180 int modifiersCount = JSValueToNumber(context, JSObjectGetProperty(context, modifiersArray, JSStringCreateWithUTF8CString("length"), 0), 0); 181 for (int i = 0; i < modifiersCount; ++i) { 182 JSValueRef value = JSObjectGetPropertyAtIndex(context, modifiersArray, i, 0); 183 JSStringRef string = JSValueToStringCopy(context, value, 0); 184 if (JSStringIsEqualToUTF8CString(string, "ctrlKey") 185 || JSStringIsEqualToUTF8CString(string, "addSelectionKey")) 186 gdkModifiers |= GDK_CONTROL_MASK; 187 else if (JSStringIsEqualToUTF8CString(string, "shiftKey") 188 || JSStringIsEqualToUTF8CString(string, "rangeSelectionKey")) 189 gdkModifiers |= GDK_SHIFT_MASK; 190 else if (JSStringIsEqualToUTF8CString(string, "altKey")) 191 gdkModifiers |= GDK_MOD1_MASK; 192 193 // Currently the metaKey as defined in WebCore/platform/gtk/MouseEventGtk.cpp 194 // is GDK_MOD2_MASK. This code must be kept in sync with that file. 195 else if (JSStringIsEqualToUTF8CString(string, "metaKey")) 196 gdkModifiers |= GDK_MOD2_MASK; 197 198 JSStringRelease(string); 199 } 200 return gdkModifiers; 201 } 202 173 203 static JSValueRef mouseDownCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 174 204 { … … 178 208 g_return_val_if_fail((!exception || !*exception), JSValueMakeUndefined(context)); 179 209 } 210 guint modifiers = argumentCount >= 2 ? gdkModifersFromJSValue(context, arguments[1]) : 0; 180 211 181 212 GdkEvent* event = gdk_event_new(GDK_BUTTON_PRESS); 182 if (!prepareMouseButtonEvent(event, button ))213 if (!prepareMouseButtonEvent(event, button, modifiers)) 183 214 return JSValueMakeUndefined(context); 184 215 … … 221 252 g_return_val_if_fail((!exception || !*exception), JSValueMakeUndefined(context)); 222 253 } 254 guint modifiers = argumentCount >= 2 ? gdkModifersFromJSValue(context, arguments[1]) : 0; 223 255 224 256 GdkEvent* event = gdk_event_new(GDK_BUTTON_RELEASE); 225 if (!prepareMouseButtonEvent(event, button ))257 if (!prepareMouseButtonEvent(event, button, modifiers)) 226 258 return JSValueMakeUndefined(context); 227 259
Note: See TracChangeset
for help on using the changeset viewer.