Changeset 48735 in webkit
- Timestamp:
- Sep 24, 2009 2:58:59 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r48724 r48735 1 2009-09-24 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> 2 3 Reviewed by Oliver Hunt. 4 5 Test for correct wheel scrolling behavior. 6 7 https://bugs.webkit.org/show_bug.cgi?id=29348 8 [Gtk] Scrollwheel on horizontal scrollbars should slide horizontally 9 10 * platform/gtk/scrollbars/overflow-scrollbar-horizontal-wheel-scroll.html: Added. 11 * platform/gtk/scrollbars/overflow-scrollbar-horizontal-wheel-scroll-expected.txt: Added. 12 1 13 2009-09-24 Philippe Normand <pnormand@igalia.com> 2 14 -
trunk/WebCore/ChangeLog
r48734 r48735 1 2009-09-24 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> 2 3 Reviewed by Oliver Hunt. 4 5 Implement correct horizontal scrollbar behavior for GTK+ also on 6 styled scrollbars. 7 8 https://bugs.webkit.org/show_bug.cgi?id=29348 9 [Gtk] Scrollwheel on horizontal scrollbars should slide horizontally 10 11 Test: platform/gtk/scrollbars/overflow-scrollbar-horizontal-wheel-scroll.html 12 13 * page/EventHandler.cpp: 14 (WebCore::EventHandler::handleWheelEvent): on GTK+, when using the 15 wheel with the pointer on the horizontal scrollbar, scroll 16 horizontally; 17 * platform/PlatformWheelEvent.h: 18 * platform/gtk/WheelEventGtk.cpp: 19 (WebCore::PlatformWheelEvent::swapOrientation): allow adding a 20 vertical scroll to the horizontal one; 21 1 22 2009-09-24 Jeremy Orlow <jorlow@chromium.org> 2 23 -
trunk/WebCore/page/EventHandler.cpp
r48701 r48735 1759 1759 } 1760 1760 1761 #if !PLATFORM(GTK) 1762 bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult& result) const 1763 { 1764 return false; 1765 } 1766 #endif 1767 1761 1768 bool EventHandler::handleWheelEvent(PlatformWheelEvent& e) 1762 1769 { … … 1778 1785 bool didSetLatchedNode = false; 1779 1786 1787 HitTestRequest request(HitTestRequest::ReadOnly); 1788 HitTestResult result(vPoint); 1789 doc->renderView()->layer()->hitTest(request, result); 1790 1780 1791 if (m_useLatchedWheelEventNode) { 1781 1792 if (!m_latchedWheelEventNode) { 1782 HitTestRequest request(HitTestRequest::ReadOnly);1783 HitTestResult result(vPoint);1784 doc->renderView()->layer()->hitTest(request, result);1785 1793 m_latchedWheelEventNode = result.innerNode(); 1786 1794 m_widgetIsLatched = result.isOverWidget(); … … 1796 1804 m_previousWheelScrolledNode = 0; 1797 1805 1798 HitTestRequest request(HitTestRequest::ReadOnly);1799 HitTestResult result(vPoint);1800 doc->renderView()->layer()->hitTest(request, result);1801 1806 node = result.innerNode(); 1802 1807 isOverWidget = result.isOverWidget(); 1803 1808 } 1809 1810 if (shouldTurnVerticalTicksIntoHorizontal(result)) 1811 e.turnVerticalTicksIntoHorizontal(); 1804 1812 1805 1813 if (node) { -
trunk/WebCore/page/EventHandler.h
r48683 r48735 126 126 #endif 127 127 128 bool shouldTurnVerticalTicksIntoHorizontal(const HitTestResult&) const; 129 128 130 bool tabsToLinks(KeyboardEvent*) const; 129 131 bool tabsToAllControls(KeyboardEvent*) const; -
trunk/WebCore/page/gtk/EventHandlerGtk.cpp
r46592 r48735 123 123 } 124 124 125 // GTK+ must scroll horizontally if the mouse pointer is on top of the 126 // horizontal scrollbar while scrolling with the wheel; we need to 127 // add the deltas and ticks here so that this behavior is consistent 128 // for styled scrollbars. 129 bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult& result) const 130 { 131 return result.scrollbar() && result.scrollbar()->orientation() == HorizontalScrollbar; 125 132 } 133 134 } -
trunk/WebCore/platform/PlatformWheelEvent.h
r48177 r48735 94 94 void ignore() { m_isAccepted = false; } 95 95 96 void turnVerticalTicksIntoHorizontal() 97 { 98 m_deltaX = m_deltaY; 99 m_deltaY = 0; 100 101 m_wheelTicksX = m_wheelTicksY; 102 m_wheelTicksY = 0; 103 } 104 96 105 #if PLATFORM(GTK) 97 106 PlatformWheelEvent(GdkEventScroll*); -
trunk/WebKitTools/ChangeLog
r48730 r48735 1 2009-09-24 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> 2 3 Reviewed by Oliver Hunt. 4 5 Add support for DRT to send mouse wheel events. 6 7 https://bugs.webkit.org/show_bug.cgi?id=29348 8 [Gtk] Scrollwheel on horizontal scrollbars should slide horizontally 9 10 * DumpRenderTree/gtk/EventSender.cpp: 11 (mouseWheelToCallback): 12 1 13 2009-09-17 Eric Seidel <eric@webkit.org> 2 14 -
trunk/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
r48343 r48735 228 228 gboolean return_val; 229 229 g_signal_emit_by_name(view, "motion_notify_event", &event, &return_val); 230 } 231 232 return JSValueMakeUndefined(context); 233 } 234 235 static JSValueRef mouseWheelToCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 236 { 237 WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); 238 if (!view) 239 return JSValueMakeUndefined(context); 240 241 if (argumentCount < 2) 242 return JSValueMakeUndefined(context); 243 244 int horizontal = (int)JSValueToNumber(context, arguments[0], exception); 245 g_return_val_if_fail((!exception || !*exception), JSValueMakeUndefined(context)); 246 int vertical = (int)JSValueToNumber(context, arguments[1], exception); 247 g_return_val_if_fail((!exception || !*exception), JSValueMakeUndefined(context)); 248 249 // GTK+ doesn't support multiple direction scrolls in the same event! 250 g_return_val_if_fail((!vertical || !horizontal), JSValueMakeUndefined(context)); 251 252 GdkEvent event; 253 event.type = GDK_SCROLL; 254 event.scroll.x = lastMousePositionX; 255 event.scroll.y = lastMousePositionY; 256 event.scroll.time = GDK_CURRENT_TIME; 257 event.scroll.window = GTK_WIDGET(view)->window; 258 259 if (horizontal < 0) 260 event.scroll.direction = GDK_SCROLL_LEFT; 261 else if (horizontal > 0) 262 event.scroll.direction = GDK_SCROLL_RIGHT; 263 else if (vertical < 0) 264 event.scroll.direction = GDK_SCROLL_UP; 265 else if (vertical > 0) 266 event.scroll.direction = GDK_SCROLL_DOWN; 267 else 268 g_assert_not_reached(); 269 270 if (dragMode && down && !replayingSavedEvents) { 271 msgQueue[endOfQueue].event = event; 272 msgQueue[endOfQueue++].isDragEvent = true; 273 } else { 274 webkit_web_frame_layout(mainFrame); 275 gtk_main_do_event(&event); 230 276 } 231 277 … … 444 490 445 491 static JSStaticFunction staticFunctions[] = { 492 { "mouseWheelTo", mouseWheelToCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 446 493 { "contextClick", contextClickCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 447 494 { "mouseDown", mouseDownCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
Note: See TracChangeset
for help on using the changeset viewer.