Changeset 66666 in webkit
- Timestamp:
- Sep 2, 2010 6:14:24 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r66663 r66666 1 2010-09-02 Peter Kasting <pkasting@google.com> 2 3 Reviewed by Dimitri Glazkov. 4 5 Implement [continuous]MouseScrollBy() on Chromium, and partly on GTK. 6 https://bugs.webkit.org/show_bug.cgi?id=45073 7 8 * platform/chromium/test_expectations.txt: Unskip tests that should now pass. 9 * platform/gtk/scrollbars/overflow-scrollbar-horizontal-wheel-scroll.html: Convert mouseWheelTo() to mouseScrollBy(). 10 1 11 2010-09-01 Ilya Tikhonovsky <loislo@chromium.org> 2 12 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r66663 r66666 2477 2477 BUG38376 WIN : editing/deleting/5390681-2.html = IMAGE+TEXT 2478 2478 2479 // WebKit roll 56004 -> 560262480 BUG38278 : fast/events/continuous-platform-wheelevent-in-scrolling-div.html = TIMEOUT2481 BUG38278 : fast/events/platform-wheelevent-in-scrolling-div.html = TIMEOUT2482 2483 2479 // The touch targeting logic was recently changed. 2484 2480 BUG36415 : fast/events/touch/touch-target.html = TEXT -
trunk/LayoutTests/platform/gtk/scrollbars/overflow-scrollbar-horizontal-wheel-scroll.html
r48735 r66666 89 89 var y = overflow.offsetTop + overflow.offsetHeight - 50; 90 90 eventSender.mouseMoveTo(x, y); 91 eventSender.mouse WheelTo(0,1);91 eventSender.mouseScrollBy(0, -1); 92 92 93 93 if (overflow.scrollTop != 40 || overflow.scrollLeft != 0) … … 98 98 var y = overflow.offsetTop + overflow.offsetHeight - 6; 99 99 eventSender.mouseMoveTo(x, y); 100 eventSender.mouse WheelTo(0,1);100 eventSender.mouseScrollBy(0, -1); 101 101 102 102 if (overflow.scrollTop != 40 || overflow.scrollLeft != 40) … … 107 107 var y = overflow.offsetTop + overflow.offsetHeight - 50; 108 108 eventSender.mouseMoveTo(x, y); 109 eventSender.mouse WheelTo(0,1);109 eventSender.mouseScrollBy(0, -1); 110 110 111 111 if (overflow.scrollTop != 80 || overflow.scrollLeft != 40) … … 118 118 var y = styled.offsetTop + styled.offsetHeight - 50; 119 119 eventSender.mouseMoveTo(x, y); 120 eventSender.mouse WheelTo(0,1);120 eventSender.mouseScrollBy(0, -1); 121 121 122 122 if (styled.scrollTop != 40 || styled.scrollLeft != 0) … … 127 127 var y = styled.offsetTop + styled.offsetHeight - 6; 128 128 eventSender.mouseMoveTo(x, y); 129 eventSender.mouse WheelTo(0,1);129 eventSender.mouseScrollBy(0, -1); 130 130 131 131 if (styled.scrollTop != 40 || styled.scrollLeft != 40) … … 136 136 var y = styled.offsetTop + styled.offsetHeight - 50; 137 137 eventSender.mouseMoveTo(x, y); 138 eventSender.mouse WheelTo(0,1);138 eventSender.mouseScrollBy(0, -1); 139 139 140 140 if (styled.scrollTop != 80 || styled.scrollLeft != 40) -
trunk/WebKitTools/ChangeLog
r66640 r66666 1 2010-09-02 Peter Kasting <pkasting@google.com> 2 3 Reviewed by Dimitri Glazkov. 4 5 Implement [continuous]MouseScrollBy() on Chromium, and partly on GTK. 6 https://bugs.webkit.org/show_bug.cgi?id=45073 7 8 * DumpRenderTree/chromium/EventSender.cpp: 9 (EventSender::EventSender): 10 (EventSender::mouseScrollBy): 11 (EventSender::continuousMouseScrollBy): 12 (EventSender::sendCurrentTouchEvent): 13 (EventSender::handleMouseWheel): 14 * DumpRenderTree/chromium/EventSender.h: 15 * DumpRenderTree/gtk/EventSender.cpp: 16 (mouseScrollByCallback): 17 (continuousMouseScrollByCallback): 18 1 19 2010-09-01 Dirk Pranke <dpranke@chromium.org> 2 20 -
trunk/WebKitTools/DumpRenderTree/chromium/EventSender.cpp
r66351 r66666 256 256 bindMethod("contextClick", &EventSender::contextClick); 257 257 bindMethod("mouseMoveTo", &EventSender::mouseMoveTo); 258 bindMethod("mouseWheelTo", &EventSender::mouseWheelTo);259 258 bindMethod("leapForward", &EventSender::leapForward); 260 259 bindMethod("keyDown", &EventSender::keyDown); … … 267 266 bindMethod("zoomPageIn", &EventSender::zoomPageIn); 268 267 bindMethod("zoomPageOut", &EventSender::zoomPageOut); 268 bindMethod("mouseScrollBy", &EventSender::mouseScrollBy); 269 bindMethod("continuousMouseScrollBy", &EventSender::continuousMouseScrollBy); 269 270 bindMethod("scheduleAsynchronousClick", &EventSender::scheduleAsynchronousClick); 270 271 bindMethod("beginDragWithFiles", &EventSender::beginDragWithFiles); … … 471 472 doMouseMove(event); 472 473 } 473 }474 475 void EventSender::mouseWheelTo(const CppArgumentList& arguments, CppVariant* result)476 {477 result->setNull();478 479 if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber())480 return;481 482 // Force a layout here just to make sure every position has been483 // determined before we send events (as well as all the other methods484 // that send an event do). The layout test calling this485 // (scrollbars/overflow-scrollbar-horizontal-wheel-scroll.html, only one486 // for now) does not rely on this though.487 webview()->layout();488 489 int horizontal = arguments[0].toInt32();490 int vertical = arguments[1].toInt32();491 492 WebMouseWheelEvent event;493 initMouseEvent(WebInputEvent::MouseWheel, pressedButton, lastMousePos, &event);494 event.wheelTicksX = static_cast<float>(horizontal);495 event.wheelTicksY = static_cast<float>(vertical);496 event.deltaX = -horizontal * scrollbarPixelsPerTick;497 event.deltaY = -vertical * scrollbarPixelsPerTick;498 webview()->handleInputEvent(event);499 474 } 500 475 … … 715 690 } 716 691 692 void EventSender::mouseScrollBy(const CppArgumentList& arguments, CppVariant* result) 693 { 694 handleMouseWheel(arguments, result, false); 695 } 696 697 void EventSender::continuousMouseScrollBy(const CppArgumentList& arguments, CppVariant* result) 698 { 699 handleMouseWheel(arguments, result, true); 700 } 701 717 702 void EventSender::replaySavedEvents() 718 703 { … … 890 875 } 891 876 877 void EventSender::handleMouseWheel(const CppArgumentList& arguments, CppVariant* result, bool continuous) 878 { 879 result->setNull(); 880 881 if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber()) 882 return; 883 884 // Force a layout here just to make sure every position has been 885 // determined before we send events (as well as all the other methods 886 // that send an event do). 887 webview()->layout(); 888 889 int horizontal = arguments[0].toInt32(); 890 int vertical = arguments[1].toInt32(); 891 892 WebMouseWheelEvent event; 893 initMouseEvent(WebInputEvent::MouseWheel, pressedButton, lastMousePos, &event); 894 event.wheelTicksX = static_cast<float>(horizontal); 895 event.wheelTicksY = static_cast<float>(vertical); 896 event.deltaX = event.wheelTicksX; 897 event.deltaY = event.wheelTicksY; 898 if (!continuous) { 899 event.deltaX *= scrollbarPixelsPerTick; 900 event.deltaY *= scrollbarPixelsPerTick; 901 } 902 webview()->handleInputEvent(event); 903 } 904 892 905 void EventSender::touchEnd(const CppArgumentList&, CppVariant* result) 893 906 { -
trunk/WebKitTools/DumpRenderTree/chromium/EventSender.h
r59193 r66666 67 67 void mouseUp(const CppArgumentList&, CppVariant*); 68 68 void mouseMoveTo(const CppArgumentList&, CppVariant*); 69 void mouseWheelTo(const CppArgumentList&, CppVariant*);70 69 void leapForward(const CppArgumentList&, CppVariant*); 71 70 void keyDown(const CppArgumentList&, CppVariant*); … … 75 74 void zoomPageIn(const CppArgumentList&, CppVariant*); 76 75 void zoomPageOut(const CppArgumentList&, CppVariant*); 76 void mouseScrollBy(const CppArgumentList&, CppVariant*); 77 void continuousMouseScrollBy(const CppArgumentList&, CppVariant*); 77 78 void scheduleAsynchronousClick(const CppArgumentList&, CppVariant*); 78 79 void beginDragWithFiles(const CppArgumentList&, CppVariant*); … … 138 139 void sendCurrentTouchEvent(const WebKit::WebInputEvent::Type); 139 140 141 // Handle a request to send a wheel event. 142 void handleMouseWheel(const CppArgumentList&, CppVariant*, bool continuous); 143 140 144 ScopedRunnableMethodFactory<EventSender> m_methodFactory; 141 145 -
trunk/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
r66404 r66666 270 270 } 271 271 272 static JSValueRef mouse WheelToCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)272 static JSValueRef mouseScrollByCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 273 273 { 274 274 WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); … … 295 295 296 296 if (horizontal < 0) 297 event->scroll.direction = GDK_SCROLL_RIGHT; 298 else if (horizontal > 0) 297 299 event->scroll.direction = GDK_SCROLL_LEFT; 298 else if (horizontal > 0)299 event->scroll.direction = GDK_SCROLL_RIGHT;300 300 else if (vertical < 0) 301 event->scroll.direction = GDK_SCROLL_DOWN; 302 else if (vertical > 0) 301 303 event->scroll.direction = GDK_SCROLL_UP; 302 else if (vertical > 0)303 event->scroll.direction = GDK_SCROLL_DOWN;304 304 else 305 305 g_assert_not_reached(); 306 306 307 307 sendOrQueueEvent(event); 308 return JSValueMakeUndefined(context); 309 } 310 311 static JSValueRef continuousMouseScrollByCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 312 { 313 // GTK doesn't support continuous scroll events. 308 314 return JSValueMakeUndefined(context); 309 315 } … … 597 603 598 604 static JSStaticFunction staticFunctions[] = { 599 { "mouseWheelTo", mouseWheelToCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 605 { "mouseScrollBy", mouseScrollByCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 606 { "continuousMouseScrollBy", continuousMouseScrollByCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 600 607 { "contextClick", contextClickCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 601 608 { "mouseDown", mouseDownCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
Note: See TracChangeset
for help on using the changeset viewer.