Changeset 127070 in webkit
- Timestamp:
- Aug 29, 2012 5:34:34 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r127069 r127070 1 2012-08-29 José Dapena Paz <jdapena@igalia.com> 2 3 [Gtk] Process Gtk 3.4 smooth scroll events properly. 4 https://bugs.webkit.org/show_bug.cgi?id=88070 5 6 Added layout tests support for smooth scroll in Gtk 3.4, and use smooth 7 scroll for emulating multi-tick mouseScrollBy events. 8 9 Reviewed by Martin Robinson. 10 11 * platform/gtk-wk2/fast/events/wheelevent-in-horizontal-scrollbar-in-rtl-expected.txt: Added. 12 * platform/gtk-wk2/fast/events/wheelevent-in-vertical-scrollbar-in-rtl-expected.txt: Added. 13 * platform/gtk/TestExpectations: 14 * platform/gtk/fast/events/wheelevent-in-horizontal-scrollbar-in-rtl-expected.txt: Added. 15 * platform/gtk/fast/events/wheelevent-in-vertical-scrollbar-in-rtl-expected.txt: Added. 16 1 17 2012-08-29 Dean Jackson <dino@apple.com> 2 18 -
trunk/LayoutTests/platform/gtk/TestExpectations
r127006 r127070 795 795 BUGWK35300 SKIP : http/tests/navigation/post-307-response.html = TEXT 796 796 797 // mouseScrollBy() and continuousMouseScrollBy() are not yet implemented in the GTK EventSender API. 798 BUGWK36003 : fast/events/continuous-platform-wheelevent-in-scrolling-div.html = TEXT 799 BUGWK36003 : fast/events/platform-wheelevent-in-scrolling-div.html = TEXT 800 BUGWK36003 : fast/events/platform-wheelevent-paging-x-in-non-scrolling-div.html = TEXT 801 BUGWK36003 : fast/events/platform-wheelevent-paging-x-in-non-scrolling-page.html = TEXT 802 BUGWK36003 : fast/events/platform-wheelevent-paging-x-in-scrolling-div.html = TEXT 803 BUGWK36003 : fast/events/platform-wheelevent-paging-x-in-scrolling-page.html = TEXT 804 BUGWK36003 : fast/events/platform-wheelevent-paging-xy-in-scrolling-div.html = TEXT 805 BUGWK36003 : fast/events/platform-wheelevent-paging-xy-in-scrolling-page.html = TEXT 806 BUGWK36003 : fast/events/platform-wheelevent-paging-y-in-non-scrolling-div.html = TEXT 807 BUGWK36003 : fast/events/platform-wheelevent-paging-y-in-non-scrolling-page.html = TEXT 808 BUGWK36003 : fast/events/platform-wheelevent-paging-y-in-scrolling-div.html = TEXT 809 BUGWK36003 : fast/events/platform-wheelevent-paging-y-in-scrolling-page.html = TEXT 810 BUGWK36003 SKIP : fast/events/remove-child-onscroll.html = TEXT 811 BUGWK36003 : fast/events/scroll-in-scaled-page-with-overflow-hidden.html = TEXT 812 BUGWK36003 : fast/events/wheelevent-direction-inverted-from-device.html = TEXT 813 BUGWK36003 : fast/events/wheelevent-in-horizontal-scrollbar-in-rtl.html = TEXT 814 BUGWK36003 : fast/events/wheelevent-in-vertical-scrollbar-in-rtl.html = TEXT 797 // Paged continuousMouseScrollBy() events are not supported in GTK. 798 BUGWKGTK : fast/events/platform-wheelevent-paging-x-in-non-scrolling-div.html = TEXT 799 BUGWKGTK : fast/events/platform-wheelevent-paging-x-in-non-scrolling-page.html = TEXT 800 BUGWKGTK : fast/events/platform-wheelevent-paging-x-in-scrolling-div.html = TEXT 801 BUGWKGTK : fast/events/platform-wheelevent-paging-x-in-scrolling-page.html = TEXT 802 BUGWKGTK : fast/events/platform-wheelevent-paging-xy-in-scrolling-div.html = TEXT 803 BUGWKGTK : fast/events/platform-wheelevent-paging-xy-in-scrolling-page.html = TEXT 804 BUGWKGTK : fast/events/platform-wheelevent-paging-y-in-non-scrolling-div.html = TEXT 805 BUGWKGTK : fast/events/platform-wheelevent-paging-y-in-non-scrolling-page.html = TEXT 806 BUGWKGTK : fast/events/platform-wheelevent-paging-y-in-scrolling-div.html = TEXT 807 BUGWKGTK : fast/events/platform-wheelevent-paging-y-in-scrolling-page.html = TEXT 815 808 816 809 // Misses setMediaType() implementation -
trunk/Source/WebCore/ChangeLog
r127064 r127070 1 2012-08-29 José Dapena Paz <jdapena@igalia.com> 2 3 [Gtk] Process Gtk 3.4 smooth scroll events properly. 4 https://bugs.webkit.org/show_bug.cgi?id=88070 5 6 Gtk 3.3.18 added smooth scroll events, adding a new scroll direction that 7 provides detailed delta information. 8 9 Added GDK_SMOOTH_SCROLL_MASK to the events listened, and added 10 code to process properly the new direction GDK_SCROLL_SMOOTH and 11 its deltas. 12 13 Reviewed by Martin Robinson. 14 15 Test: fast/events/continuous-platform-wheelevent-in-scrolling-div.html 16 17 * platform/gtk/PlatformWheelEventGtk.cpp: 18 (WebCore::PlatformWheelEvent::PlatformWheelEvent): 19 1 20 2012-08-29 Dana Jansens <danakj@chromium.org> 2 21 -
trunk/Source/WebCore/platform/gtk/PlatformWheelEventGtk.cpp
r103643 r127070 31 31 32 32 #include <gdk/gdk.h> 33 #include <gtk/gtk.h> 33 34 #include <wtf/CurrentTime.h> 34 35 … … 70 71 m_deltaX = -delta; 71 72 break; 73 #if GTK_CHECK_VERSION(3, 3, 18) 74 case GDK_SCROLL_SMOOTH: { 75 gdouble deltaX, deltaY; 76 gdk_event_get_scroll_deltas(reinterpret_cast<GdkEvent*>(event), &deltaX, &deltaY); 77 m_deltaX = -deltaX; 78 m_deltaY = -deltaY; 79 } 80 break; 81 #endif 72 82 } 73 83 m_wheelTicksX = m_deltaX; -
trunk/Source/WebKit/gtk/ChangeLog
r126964 r127070 1 2012-08-29 José Dapena Paz <jdapena@igalia.com> 2 3 [Gtk] Process Gtk 3.4 smooth scroll events properly. 4 https://bugs.webkit.org/show_bug.cgi?id=88070 5 6 Gtk 3.3.18 added smooth scroll events, adding a new scroll direction that 7 provides detailed delta information. 8 9 Added GDK_SMOOTH_SCROLL_MASK to the events listened, and added 10 code to process properly the new direction GDK_SCROLL_SMOOTH and 11 its deltas. 12 13 Reviewed by Martin Robinson. 14 15 * webkit/webkitwebview.cpp: 16 (webkit_web_view_realize): 17 1 18 2012-08-28 Martin Robinson <mrobinson@igalia.com> 2 19 -
trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp
r126735 r127070 993 993 | GDK_BUTTON_RELEASE_MASK 994 994 | GDK_SCROLL_MASK 995 #if GTK_CHECK_VERSION(3, 3, 18) 996 | GDK_SMOOTH_SCROLL_MASK 997 #endif 995 998 | GDK_POINTER_MOTION_MASK 996 999 | GDK_KEY_PRESS_MASK -
trunk/Source/WebKit2/ChangeLog
r127047 r127070 1 2012-08-29 José Dapena Paz <jdapena@igalia.com> 2 3 [Gtk] Process Gtk 3.4 smooth scroll events properly. 4 https://bugs.webkit.org/show_bug.cgi?id=88070 5 6 Gtk 3.3.18 added smooth scroll events, adding a new scroll direction that 7 provides detailed delta information. 8 9 Added GDK_SMOOTH_SCROLL_MASK to the events listened, and added 10 code to process properly the new direction GDK_SCROLL_SMOOTH and 11 its deltas. 12 13 Reviewed by Martin Robinson. 14 15 * Shared/gtk/WebEventFactory.cpp: 16 (WebKit::WebEventFactory::createWebWheelEvent): 17 * UIProcess/API/gtk/WebKitWebViewBase.cpp: 18 (webkitWebViewBaseRealize): 19 1 20 2012-08-29 Brady Eidson <beidson@apple.com> 2 21 -
trunk/Source/WebKit2/Shared/gtk/WebEventFactory.cpp
r95901 r127070 154 154 wheelTicks = FloatSize(-1, 0); 155 155 break; 156 #if GTK_CHECK_VERSION(3, 3, 18) 157 case GDK_SCROLL_SMOOTH: { 158 double deltaX, deltaY; 159 gdk_event_get_scroll_deltas(event, &deltaX, &deltaY); 160 wheelTicks = FloatSize(-deltaX, -deltaY); 161 } 162 break; 163 #endif 156 164 default: 157 165 ASSERT_NOT_REACHED(); -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp
r126926 r127070 148 148 | GDK_BUTTON_RELEASE_MASK 149 149 | GDK_SCROLL_MASK 150 #if GTK_CHECK_VERSION(3, 3, 18) 151 | GDK_SMOOTH_SCROLL_MASK 152 #endif 150 153 | GDK_POINTER_MOTION_MASK 151 154 | GDK_KEY_PRESS_MASK -
trunk/Tools/ChangeLog
r127061 r127070 1 2012-08-29 José Dapena Paz <jdapena@igalia.com> 2 3 [Gtk] Process Gtk 3.4 smooth scroll events properly 4 https://bugs.webkit.org/show_bug.cgi?id=88070 5 6 Added continousMouseScrollBy support in WebKitTestRunner, and added 7 implementation for gtk, and stub for Qt, mac and EFL. 8 9 Added layout tests support for smooth scroll in Gtk 3.4, and use smooth 10 scroll for emulating multi-tick mouseScrollBy events. 11 12 Reviewed by Martin Robinson. 13 14 * DumpRenderTree/gtk/EventSender.cpp: 15 (mouseScrollByCallback): 16 (continuousMouseScrollByCallback): 17 * WebKitTestRunner/EventSenderProxy.h: 18 (EventSenderProxy): 19 * WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl: 20 * WebKitTestRunner/InjectedBundle/EventSendingController.cpp: 21 (WTR::EventSendingController::mouseScrollBy): 22 (WTR): 23 (WTR::EventSendingController::continuousMouseScrollBy): 24 * WebKitTestRunner/InjectedBundle/EventSendingController.h: 25 (EventSendingController): 26 * WebKitTestRunner/TestController.cpp: 27 (WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle): 28 * WebKitTestRunner/gtk/EventSenderProxyGtk.cpp: 29 (WTR): 30 (WTR::EventSenderProxy::mouseScrollBy): 31 (WTR::EventSenderProxy::continuousMouseScrollBy): 32 * WebKitTestRunner/efl/EventSenderProxyEfl.cpp: 33 (WTR): 34 (WTR::EventSenderProxy::continuousMouseScrollBy): 35 * WebKitTestRunner/mac/EventSenderProxy.mm: 36 (WTR::EventSenderProxy::continuousScrollBy): 37 * WebKitTestRunner/qt/EventSenderProxyQt.cpp: 38 (WTR::EventSenderProxy::continuousMouseScrollBy): 39 (WTR): 40 1 41 2012-08-29 Alex Sakhartchouk <alexst@chromium.org> 2 42 -
trunk/Tools/DumpRenderTree/gtk/EventSender.cpp
r126267 r127070 80 80 static const float zoomMultiplierRatio = 1.2f; 81 81 82 // WebCore and layout tests assume this value. 83 static const float pixelsPerScrollTick = 40; 84 82 85 // Key event location code defined in DOM Level 3. 83 86 enum KeyLocationCode { … … 435 438 g_return_val_if_fail((!exception || !*exception), JSValueMakeUndefined(context)); 436 439 437 // GTK+ doesn't support multiple direction scrolls in the same event!438 g_return_val_if_fail((!vertical || !horizontal), JSValueMakeUndefined(context));439 440 440 GdkEvent* event = gdk_event_new(GDK_SCROLL); 441 441 event->scroll.x = lastMousePositionX; … … 444 444 event->scroll.window = gtk_widget_get_window(GTK_WIDGET(view)); 445 445 g_object_ref(event->scroll.window); 446 447 // GTK+ only supports one tick in each scroll event that is not smooth. For the cases of more than one direction, 448 // and more than one step in a direction, we can only use smooth events, supported from Gtk 3.3.18. 449 #if GTK_CHECK_VERSION(3, 3, 18) 450 if ((horizontal && vertical) || horizontal > 1 || horizontal < -1 || vertical > 1 || vertical < -1) { 451 event->scroll.direction = GDK_SCROLL_SMOOTH; 452 event->scroll.delta_x = -horizontal; 453 event->scroll.delta_y = -vertical; 454 455 sendOrQueueEvent(event); 456 return JSValueMakeUndefined(context); 457 } 458 #else 459 g_return_val_if_fail((!vertical || !horizontal), JSValueMakeUndefined(context)); 460 #endif 446 461 447 462 if (horizontal < 0) … … 462 477 static JSValueRef continuousMouseScrollByCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 463 478 { 464 // GTK doesn't support continuous scroll events. 479 #if GTK_CHECK_VERSION(3, 3, 18) 480 WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); 481 if (!view) 482 return JSValueMakeUndefined(context); 483 484 if (argumentCount < 2) 485 return JSValueMakeUndefined(context); 486 487 int horizontal = JSValueToNumber(context, arguments[0], exception); 488 g_return_val_if_fail((!exception || !*exception), JSValueMakeUndefined(context)); 489 int vertical = JSValueToNumber(context, arguments[1], exception); 490 g_return_val_if_fail((!exception || !*exception), JSValueMakeUndefined(context)); 491 492 g_return_val_if_fail(argumentCount < 3 || !JSValueToBoolean(context, arguments[2]), JSValueMakeUndefined(context)); 493 494 GdkEvent* event = gdk_event_new(GDK_SCROLL); 495 event->scroll.x = lastMousePositionX; 496 event->scroll.y = lastMousePositionY; 497 event->scroll.time = GDK_CURRENT_TIME; 498 event->scroll.window = gtk_widget_get_window(GTK_WIDGET(view)); 499 g_object_ref(event->scroll.window); 500 501 event->scroll.direction = GDK_SCROLL_SMOOTH; 502 event->scroll.delta_x = -horizontal / pixelsPerScrollTick; 503 event->scroll.delta_y = -vertical / pixelsPerScrollTick; 504 505 sendOrQueueEvent(event); 506 #endif 465 507 return JSValueMakeUndefined(context); 466 508 } -
trunk/Tools/WebKitTestRunner/EventSenderProxy.h
r123203 r127070 56 56 void mouseMoveTo(double x, double y); 57 57 void mouseScrollBy(int x, int y); 58 void continuousMouseScrollBy(int x, int y, bool paged); 58 59 59 60 void leapForward(int milliseconds); -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl
r115071 r127070 31 31 void mouseMoveTo(in long x, in long y); 32 32 void mouseScrollBy(in long x, in long y); 33 void continuousMouseScrollBy(in long x, in long y, in [Optional] boolean paged); 33 34 34 35 void leapForward(in long milliseconds); -
trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp
r115071 r127070 266 266 } 267 267 268 void EventSendingController::continuousMouseScrollBy(int x, int y, bool paged) 269 { 270 WKRetainPtr<WKStringRef> EventSenderMessageName(AdoptWK, WKStringCreateWithUTF8CString("EventSender")); 271 WKRetainPtr<WKMutableDictionaryRef> EventSenderMessageBody(AdoptWK, WKMutableDictionaryCreate()); 272 273 WKRetainPtr<WKStringRef> subMessageKey(AdoptWK, WKStringCreateWithUTF8CString("SubMessage")); 274 WKRetainPtr<WKStringRef> subMessageName(AdoptWK, WKStringCreateWithUTF8CString("ContinuousMouseScrollBy")); 275 WKDictionaryAddItem(EventSenderMessageBody.get(), subMessageKey.get(), subMessageName.get()); 276 277 WKRetainPtr<WKStringRef> xKey(AdoptWK, WKStringCreateWithUTF8CString("X")); 278 WKRetainPtr<WKDoubleRef> xRef(AdoptWK, WKDoubleCreate(x)); 279 WKDictionaryAddItem(EventSenderMessageBody.get(), xKey.get(), xRef.get()); 280 281 WKRetainPtr<WKStringRef> yKey(AdoptWK, WKStringCreateWithUTF8CString("Y")); 282 WKRetainPtr<WKDoubleRef> yRef(AdoptWK, WKDoubleCreate(y)); 283 WKDictionaryAddItem(EventSenderMessageBody.get(), yKey.get(), yRef.get()); 284 285 WKRetainPtr<WKStringRef> pagedKey(AdoptWK, WKStringCreateWithUTF8CString("Paged")); 286 WKRetainPtr<WKUInt64Ref> pagedRef(AdoptWK, WKUInt64Create(paged)); 287 WKDictionaryAddItem(EventSenderMessageBody.get(), pagedKey.get(), pagedRef.get()); 288 289 WKBundlePostSynchronousMessage(InjectedBundle::shared().bundle(), EventSenderMessageName.get(), EventSenderMessageBody.get(), 0); 290 } 291 268 292 #ifdef USE_WEBPROCESS_EVENT_SIMULATION 269 293 void EventSendingController::updateClickCount(WKEventMouseButton button) -
trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.h
r123203 r127070 52 52 void mouseMoveTo(int x, int y); 53 53 void mouseScrollBy(int x, int y); 54 void continuousMouseScrollBy(int x, int y, bool paged); 54 55 void leapForward(int milliseconds); 55 56 -
trunk/Tools/WebKitTestRunner/TestController.cpp
r127026 r127070 762 762 } 763 763 764 if (WKStringIsEqualToUTF8CString(subMessageName, "ContinuousMouseScrollBy")) { 765 WKRetainPtr<WKStringRef> xKey = adoptWK(WKStringCreateWithUTF8CString("X")); 766 double x = WKDoubleGetValue(static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, xKey.get()))); 767 768 WKRetainPtr<WKStringRef> yKey = adoptWK(WKStringCreateWithUTF8CString("Y")); 769 double y = WKDoubleGetValue(static_cast<WKDoubleRef>(WKDictionaryGetItemForKey(messageBodyDictionary, yKey.get()))); 770 771 WKRetainPtr<WKStringRef> pagedKey = adoptWK(WKStringCreateWithUTF8CString("Paged")); 772 bool paged = static_cast<bool>(WKUInt64GetValue(static_cast<WKUInt64Ref>(WKDictionaryGetItemForKey(messageBodyDictionary, pagedKey.get())))); 773 774 // Forward to WebProcess 775 WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), true); 776 m_eventSenderProxy->continuousMouseScrollBy(x, y, paged); 777 WKPageSetShouldSendEventsSynchronously(mainWebView()->page(), false); 778 return 0; 779 } 780 764 781 if (WKStringIsEqualToUTF8CString(subMessageName, "LeapForward")) { 765 782 WKRetainPtr<WKStringRef> timeKey = adoptWK(WKStringCreateWithUTF8CString("TimeInMilliseconds")); -
trunk/Tools/WebKitTestRunner/efl/EventSenderProxyEfl.cpp
r124001 r127070 385 385 } 386 386 387 void EventSenderProxy::continuousMouseScrollBy(int horizontal, int vertical, bool paged) 388 { 389 notImplemented(); 390 } 391 387 392 void EventSenderProxy::leapForward(int milliseconds) 388 393 { -
trunk/Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp
r115338 r127070 44 44 45 45 namespace WTR { 46 47 // WebCore and layout tests assume this value 48 static const float pixelsPerScrollTick = 40; 46 49 47 50 // Key event location code defined in DOM Level 3. … … 376 379 event->scroll.y = m_position.y; 377 380 event->scroll.time = GDK_CURRENT_TIME; 378 event->scroll.window = gtk_widget_get_window(GTK_WIDGET(m_testController->mainWebView()->platform Window()));381 event->scroll.window = gtk_widget_get_window(GTK_WIDGET(m_testController->mainWebView()->platformView())); 379 382 g_object_ref(event->scroll.window); 383 gdk_event_set_device(event, gdk_device_manager_get_client_pointer(gdk_display_get_device_manager(gdk_window_get_display(event->scroll.window)))); 384 385 // For more than one tick in a scroll, we need smooth scroll event 386 #if GTK_CHECK_VERSION(3, 3, 18) 387 if ((horizontal && vertical) || horizontal > 1 || horizontal < -1 || vertical > 1 || vertical < -1) { 388 event->scroll.direction = GDK_SCROLL_SMOOTH; 389 event->scroll.delta_x = -horizontal; 390 event->scroll.delta_y = -vertical; 391 392 sendOrQueueEvent(event); 393 return; 394 } 395 #endif 380 396 381 397 if (horizontal < 0) … … 393 409 } 394 410 411 void EventSenderProxy::continuousMouseScrollBy(int horizontal, int vertical, bool paged) 412 { 413 // Gtk+ does not support paged scroll events. 414 g_return_if_fail(!paged); 415 416 #if GTK_CHECK_VERSION(3, 3, 18) 417 GdkEvent* event = gdk_event_new(GDK_SCROLL); 418 event->scroll.x = m_position.x; 419 event->scroll.y = m_position.y; 420 event->scroll.time = GDK_CURRENT_TIME; 421 event->scroll.window = gtk_widget_get_window(GTK_WIDGET(m_testController->mainWebView()->platformView())); 422 g_object_ref(event->scroll.window); 423 gdk_event_set_device(event, gdk_device_manager_get_client_pointer(gdk_display_get_device_manager(gdk_window_get_display(event->scroll.window)))); 424 425 event->scroll.direction = GDK_SCROLL_SMOOTH; 426 event->scroll.delta_x = -horizontal / pixelsPerScrollTick; 427 event->scroll.delta_y = -vertical / pixelsPerScrollTick; 428 429 sendOrQueueEvent(event); 430 #endif 431 } 432 395 433 void EventSenderProxy::leapForward(int milliseconds) 396 434 { -
trunk/Tools/WebKitTestRunner/mac/EventSenderProxy.mm
r118064 r127070 398 398 } 399 399 400 void EventSenderProxy::continuousMouseScrollBy(int x, int y, bool paged) 401 { 402 // FIXME: Implement this. 403 return; 404 } 405 400 406 } // namespace WTR -
trunk/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp
r125365 r127070 307 307 } 308 308 309 void EventSenderProxy::continuousMouseScrollBy(int, int, bool) 310 { 311 // FIXME: Implement this. 312 } 313 309 314 void EventSenderProxy::leapForward(int ms) 310 315 {
Note: See TracChangeset
for help on using the changeset viewer.