Diff
Modified: trunk/LayoutTests/ChangeLog (122398 => 122399)
--- trunk/LayoutTests/ChangeLog 2012-07-12 01:24:05 UTC (rev 122398)
+++ trunk/LayoutTests/ChangeLog 2012-07-12 01:29:03 UTC (rev 122399)
@@ -1,3 +1,20 @@
+2012-07-11 Robert Kroeger <[email protected]>
+
+ Suppress horizontal conversion of PlatformWheelEvents when hasPreciseScrollingDeltas is true
+ https://bugs.webkit.org/show_bug.cgi?id=89580
+
+ WebKit GTK and Chromium Linux force vertical wheel events to
+ scroll horizontally when over horizontal scroll bars. This is
+ undesirable for touchpad scrolling with
+ hasPreciseScrollingDeltas() == true. Added a layout test showing
+ that change correctly suppresses this behaviour.
+
+ Reviewed by Adam Barth.
+
+ * fast/events/touch/gesture/touch-gesture-scroll-sideways-expected.txt: Added.
+ * fast/events/touch/gesture/touch-gesture-scroll-sideways.html: Added.
+ * platform/chromium-linux/fast/events/touch/gesture/touch-gesture-scroll-sideways-expected.txt: Added. Note: test has intentional platform difference.
+
2012-07-11 Filip Pizlo <[email protected]>
DFG should have fast virtual calls
Added: trunk/LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-sideways-expected.txt (0 => 122399)
--- trunk/LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-sideways-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-sideways-expected.txt 2012-07-12 01:29:03 UTC (rev 122399)
@@ -0,0 +1,20 @@
+This tests that precise scrolls on a horizontal scroll bar move vertically.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+first wheel event
+wheel event 0+> [object HTMLDivElement]
+PASS movingdiv.scrollTop is 19
+PASS movingdiv.scrollLeft is 0
+PASS wheelEventsOccurred is 1
+second wheel event
+wheel event 1+> [object HTMLDivElement]
+without precise deltas, scrollLeft: 0 scrollTop: 44
+PASS wheelEventsOccurred is 2
+scroll event 0+> [object HTMLDivElement]
+PASS scrollEventsOccurred is 1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-sideways.html (0 => 122399)
--- trunk/LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-sideways.html (rev 0)
+++ trunk/LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-sideways.html 2012-07-12 01:29:03 UTC (rev 122399)
@@ -0,0 +1,156 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+<script src=""
+<style type="text/css">
+#touchtarget {
+ width: 100px;
+ height: 100px;
+ position: relative;
+ background: white;
+}
+
+/*
+ Make sure that scrollbar has a known size and
+ shape so that events can hit on it more reliably
+ across multiple platforms.
+*/
+::-webkit-scrollbar {
+ width: 20px;
+ height: 20px;
+}
+
+::-webkit-scrollbar-track {
+ -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
+}
+
+#movingbox {
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ word-wrap: break-word;
+ overflow-y: scroll;
+ overflow-x: scroll;
+ display: block;
+}
+
+#greenbox {
+ width: 100px;
+ height: 100px;
+ background: green;
+ padding: 0px;
+ margin: 0px;
+}
+
+#redbox {
+ width: 100px;
+ height: 100px;
+ background: red;
+ padding: 0px;
+ margin: 0px;
+}
+
+td {
+ padding: 0px;
+}
+</style>
+</head>
+<body style="margin:0" _onload_="runTest();">
+<div id="touchtarget">
+ <div id="movingbox">
+ <table border="0" cellspacing="0px" id="tablefoo">
+ <tr>
+ <td><div id="redbox"></div></td>
+ <td><div id="greenbox"></div></td>
+ </tr>
+ <tr>
+ <td><div id="greenbox"></div></td>
+ <td><div id="greenbox"></div></td>
+ </tr>
+ </table>
+ </div>
+</div>
+
+<p id="description"></p>
+<div id="console"></div>
+<script type="text/_javascript_">
+
+var movingdiv;
+var expectedGesturesTotal = 2;
+var gesturesOccurred = 0;
+var scrollAmountX = ['0', '0'];
+var scrollAmountY = ['19', '44'];
+var wheelEventsOccurred = 0;
+var expectedWheelEventsOccurred = ['1', '2'];
+var scrollEventsOccurred = 0;
+var expectedScrollEventsOccurred = '1';
+var scrolledElement = 'movingdiv'
+
+function checkWheelScrollOffset()
+{
+ if (!window.eventSender)
+ return;
+
+ if (gesturesOccurred == 0) {
+ shouldBe(scrolledElement + '.' + 'scrollTop', scrollAmountY[gesturesOccurred]);
+ shouldBe(scrolledElement + '.' + 'scrollLeft', scrollAmountX[gesturesOccurred]);
+ shouldBe('wheelEventsOccurred', expectedWheelEventsOccurred[gesturesOccurred]);
+ gesturesOccurred++;
+ secondWheelScroll();
+ return;
+ }
+
+ if (gesturesOccurred == 1) {
+ debug("without precise deltas, scrollLeft: " + movingdiv.scrollLeft + " scrollTop: " + movingdiv.scrollTop);
+ shouldBe('wheelEventsOccurred', expectedWheelEventsOccurred[gesturesOccurred]);
+ gesturesOccurred++;
+ return;
+ }
+
+ if (gesturesOccurred == expectedGesturesTotal) {
+ successfullyParsed = true;
+ isSuccessfullyParsed();
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }
+}
+
+function firstWheelScroll()
+{
+ debug("first wheel event");
+ eventSender.mouseMoveTo(3, 90); // Over Scrollbar
+ eventSender.continuousMouseScrollBy(0, -19, false, true);
+ checkWheelScrollOffset();
+}
+
+function secondWheelScroll()
+{
+ debug("second wheel event");
+ eventSender.continuousMouseScrollBy(0, -25, false, false);
+ checkWheelScrollOffset();
+}
+
+if (window.testRunner)
+ testRunner.waitUntilDone();
+
+function runTest()
+{
+ movingdiv = document.getElementById('movingbox');
+ movingdiv.addEventListener("scroll", recordScroll);
+ window.addEventListener("mousewheel", recordWheel);
+
+ if (window.eventSender) {
+ description('This tests that precise scrolls on a horizontal scroll bar move vertically.');
+
+ if (checkTestDependencies())
+ firstWheelScroll();
+ else
+ exitIfNecessary();
+ } else {
+ debug("This test requires DumpRenderTree. Touchpad scroll the red rect to log.");
+ }
+}
+</script>
+</body>
+</html>
Added: trunk/LayoutTests/platform/chromium-linux/fast/events/touch/gesture/touch-gesture-scroll-sideways-expected.txt (0 => 122399)
--- trunk/LayoutTests/platform/chromium-linux/fast/events/touch/gesture/touch-gesture-scroll-sideways-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/chromium-linux/fast/events/touch/gesture/touch-gesture-scroll-sideways-expected.txt 2012-07-12 01:29:03 UTC (rev 122399)
@@ -0,0 +1,20 @@
+This tests that precise scrolls on a horizontal scroll bar move vertically.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+first wheel event
+wheel event 0+> [object HTMLDivElement]
+PASS movingdiv.scrollTop is 19
+PASS movingdiv.scrollLeft is 0
+PASS wheelEventsOccurred is 1
+second wheel event
+wheel event 1+> [object HTMLDivElement]
+without precise deltas, scrollLeft: 25 scrollTop: 19
+PASS wheelEventsOccurred is 2
+scroll event 0+> [object HTMLDivElement]
+PASS scrollEventsOccurred is 1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Modified: trunk/Source/WebCore/ChangeLog (122398 => 122399)
--- trunk/Source/WebCore/ChangeLog 2012-07-12 01:24:05 UTC (rev 122398)
+++ trunk/Source/WebCore/ChangeLog 2012-07-12 01:29:03 UTC (rev 122399)
@@ -1,3 +1,28 @@
+2012-07-11 Robert Kroeger <[email protected]>
+
+ Suppress horizontal conversion of PlatformWheelEvents when hasPreciseScrollingDeltas is true
+ https://bugs.webkit.org/show_bug.cgi?id=89580
+
+ WebKit GTK and Chromium Linux force vertical wheel events to
+ scroll horizontally when over horizontal scroll bars. This is
+ undesirable for touchpad scrolling with
+ hasPreciseScrollingDeltas() == true. Modified shouldTurnVerticalTicksIntoHorizontal
+ to not perform this conversion for PlatformWheelEvents with preciseScrollingDeltas.
+
+ Reviewed by Adam Barth.
+
+ Tests: fast/events/touch/gesture/touch-gesture-scroll-sideways.html
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal):
+ (WebCore::EventHandler::handleWheelEvent):
+ * page/EventHandler.h:
+ (EventHandler):
+ * page/chromium/EventHandlerChromium.cpp:
+ (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal):
+ * page/gtk/EventHandlerGtk.cpp:
+ (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal):
+
2012-07-11 Hayato Ito <[email protected]>
Unreviewed gardening.
Modified: trunk/Source/WebCore/page/EventHandler.cpp (122398 => 122399)
--- trunk/Source/WebCore/page/EventHandler.cpp 2012-07-12 01:24:05 UTC (rev 122398)
+++ trunk/Source/WebCore/page/EventHandler.cpp 2012-07-12 01:29:03 UTC (rev 122399)
@@ -2290,7 +2290,7 @@
}
#if !PLATFORM(GTK) && !(PLATFORM(CHROMIUM) && (OS(UNIX) && !OS(DARWIN)))
-bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult&) const
+bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult&, const PlatformWheelEvent&) const
{
return false;
}
@@ -2345,7 +2345,7 @@
// Instead, the handlers should know convert vertical scrolls
// appropriately.
PlatformWheelEvent event = e;
- if (m_baseEventType == PlatformEvent::NoType && shouldTurnVerticalTicksIntoHorizontal(result))
+ if (m_baseEventType == PlatformEvent::NoType && shouldTurnVerticalTicksIntoHorizontal(result, e))
event = event.copyTurningVerticalTicksIntoHorizontalTicks();
if (node) {
Modified: trunk/Source/WebCore/page/EventHandler.h (122398 => 122399)
--- trunk/Source/WebCore/page/EventHandler.h 2012-07-12 01:24:05 UTC (rev 122398)
+++ trunk/Source/WebCore/page/EventHandler.h 2012-07-12 01:29:03 UTC (rev 122399)
@@ -266,7 +266,7 @@
void autoscrollTimerFired(Timer<EventHandler>*);
bool logicalScrollOverflow(ScrollLogicalDirection, ScrollGranularity, Node* startingNode = 0);
- bool shouldTurnVerticalTicksIntoHorizontal(const HitTestResult&) const;
+ bool shouldTurnVerticalTicksIntoHorizontal(const HitTestResult&, const PlatformWheelEvent&) const;
bool mouseDownMayStartSelect() const { return m_mouseDownMayStartSelect; }
static bool isKeyboardOptionTab(KeyboardEvent*);
Modified: trunk/Source/WebCore/page/chromium/EventHandlerChromium.cpp (122398 => 122399)
--- trunk/Source/WebCore/page/chromium/EventHandlerChromium.cpp 2012-07-12 01:24:05 UTC (rev 122398)
+++ trunk/Source/WebCore/page/chromium/EventHandlerChromium.cpp 2012-07-12 01:29:03 UTC (rev 122399)
@@ -158,9 +158,9 @@
// GTK+ must scroll horizontally if the mouse pointer is on top of the
// horizontal scrollbar while scrolling with the wheel.
// This code comes from gtk/EventHandlerGtk.cpp.
-bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult& result) const
+bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult& result, const PlatformWheelEvent& event) const
{
- return result.scrollbar() && result.scrollbar()->orientation() == HorizontalScrollbar;
+ return !event.hasPreciseScrollingDeltas() && result.scrollbar() && result.scrollbar()->orientation() == HorizontalScrollbar;
}
#endif
Modified: trunk/Source/WebCore/page/gtk/EventHandlerGtk.cpp (122398 => 122399)
--- trunk/Source/WebCore/page/gtk/EventHandlerGtk.cpp 2012-07-12 01:24:05 UTC (rev 122398)
+++ trunk/Source/WebCore/page/gtk/EventHandlerGtk.cpp 2012-07-12 01:29:03 UTC (rev 122399)
@@ -126,7 +126,7 @@
// horizontal scrollbar while scrolling with the wheel; we need to
// add the deltas and ticks here so that this behavior is consistent
// for styled scrollbars.
-bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult& result) const
+bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult& result, const PlatformWheelEvent&) const
{
return result.scrollbar() && result.scrollbar()->orientation() == HorizontalScrollbar;
}
Modified: trunk/Tools/ChangeLog (122398 => 122399)
--- trunk/Tools/ChangeLog 2012-07-12 01:24:05 UTC (rev 122398)
+++ trunk/Tools/ChangeLog 2012-07-12 01:29:03 UTC (rev 122399)
@@ -1,3 +1,20 @@
+2012-07-11 Robert Kroeger <[email protected]>
+
+ Suppress horizontal conversion of PlatformWheelEvents when hasPreciseScrollingDeltas is true
+ https://bugs.webkit.org/show_bug.cgi?id=89580
+
+ WebKit GTK and Chromium Linux force vertical wheel events to
+ scroll horizontally when over horizontal scroll bars. This is
+ undesirable for touchpad scrolling with
+ hasPreciseScrollingDeltas() == true. Modified DumpRenderTree to
+ let a layout test specify this attribute so that the change's impact
+ on scrolling can be tested in a layout test.
+
+ Reviewed by Adam Barth.
+
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (EventSender::handleMouseWheel):
+
2012-07-11 Simon Fraser <[email protected]>
Fix the build by declaring -isPaginated before use.
Modified: trunk/Tools/DumpRenderTree/chromium/EventSender.cpp (122398 => 122399)
--- trunk/Tools/DumpRenderTree/chromium/EventSender.cpp 2012-07-12 01:24:05 UTC (rev 122398)
+++ trunk/Tools/DumpRenderTree/chromium/EventSender.cpp 2012-07-12 01:29:03 UTC (rev 122399)
@@ -1043,10 +1043,14 @@
int horizontal = arguments[0].toInt32();
int vertical = arguments[1].toInt32();
int paged = false;
+ int hasPreciseScrollingDeltas = false;
if (arguments.size() > 2 && arguments[2].isBool())
paged = arguments[2].toBoolean();
+ if (arguments.size() > 3 && arguments[3].isBool())
+ hasPreciseScrollingDeltas = arguments[3].toBoolean();
+
WebMouseWheelEvent event;
initMouseEvent(WebInputEvent::MouseWheel, pressedButton, lastMousePos, &event);
event.wheelTicksX = static_cast<float>(horizontal);
@@ -1054,6 +1058,8 @@
event.deltaX = event.wheelTicksX;
event.deltaY = event.wheelTicksY;
event.scrollByPage = paged;
+ event.hasPreciseScrollingDeltas = hasPreciseScrollingDeltas;
+
if (continuous) {
event.wheelTicksX /= scrollbarPixelsPerTick;
event.wheelTicksY /= scrollbarPixelsPerTick;