Changeset 144519 in webkit


Ignore:
Timestamp:
Mar 1, 2013 5:08:22 PM (11 years ago)
Author:
tdanderson@chromium.org
Message:

EventHandler::handleGestureScrollUpdate() should invoke the user-generated scroll routines
so its behavior matches other user-initiated scrolls
https://bugs.webkit.org/show_bug.cgi?id=109769

Reviewed by James Robinson.

Source/WebCore:

To ensure that the scrolling behavior of GestureScrollUpdate events are consistent with
the scrolling behavior of mousewheel events, use the existing user-generated scroll logic
instead of calling into RenderLayer::scrollByRecursively(). This patch fixes the bug
reported in https://bugs.webkit.org/show_bug.cgi?id=109316, where the example page can
be scrolled using touch but cannot be scrolled using mousewheels.

Note that this patch does not use any of the mousewheel event-handling code.

Tests: fast/events/touch/gesture/touch-gesture-noscroll-body-propagated.html

fast/events/touch/gesture/touch-gesture-noscroll-body-xhidden.html
fast/events/touch/gesture/touch-gesture-noscroll-body-yhidden.html
fast/events/touch/gesture/touch-gesture-noscroll-body.html

  • page/EventHandler.cpp:

(WebCore::EventHandler::clear):
(WebCore::EventHandler::handleGestureEvent):
(WebCore::EventHandler::handleGestureScrollBegin):
(WebCore::EventHandler::handleGestureScrollUpdate):
(WebCore::EventHandler::sendScrollEventToView):

By calling this function at the start of handleGestureScrollUpdate() in the case
where |m_scrollGestureHandlingNode| is null, we ensure that the scroll updates
can still scroll the page itself, if possible.

(WebCore):
(WebCore::EventHandler::clearGestureScrollNodes):

  • page/EventHandler.h:

(EventHandler):

  • platform/PlatformWheelEvent.h:

(WebCore::PlatformWheelEvent::setHasPreciseScrollingDeltas):

Source/WebKit/chromium:

Clear the nodes corresponding to a fling scroll event when the event ends.

  • src/WebViewImpl.cpp:

(WebKit::WebViewImpl::updateAnimations):

LayoutTests:

Four new layout tests have been added and touch-gesture-scroll-page.html has been
modified to demonstrate that this patch fixes two existing bugs. See the inline
comments below for details.

Because I am now using the existing user-generated scroll logic, the delta for a single
GestureScrollUpdate event will not be propagated to the parent of the targeted node
unless the targeted node has no remaining scrollable area. So the changes to the
existing layout tests have been made to ensure that the targeted node has been fully
scrolled before subsequent GestureScrollUpdate events will scroll the parent(s) of
the targeted node.

I have also removed the function recordScroll() from the existing layout tests
because this function already exists in the included file resources/gesture-helpers.js.

  • fast/events/touch/gesture/touch-gesture-noscroll-body-expected.txt: Added.
  • fast/events/touch/gesture/touch-gesture-noscroll-body-propagated-expected.txt: Added.
  • fast/events/touch/gesture/touch-gesture-noscroll-body-propagated.html: Copied from LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page.html.
  • fast/events/touch/gesture/touch-gesture-noscroll-body-xhidden-expected.txt: Added.
  • fast/events/touch/gesture/touch-gesture-noscroll-body-xhidden.html: Copied from LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page.html.
  • fast/events/touch/gesture/touch-gesture-noscroll-body-yhidden-expected.txt: Added.
  • fast/events/touch/gesture/touch-gesture-noscroll-body-yhidden.html: Copied from LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page.html.
  • fast/events/touch/gesture/touch-gesture-noscroll-body.html: Copied from LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page.html.
  • fast/events/touch/gesture/touch-gesture-scroll-div-not-propagated.html:
  • fast/events/touch/gesture/touch-gesture-scroll-div-propagated.html:
  • fast/events/touch/gesture/touch-gesture-scroll-div-twice-propagated.html:
  • fast/events/touch/gesture/touch-gesture-scroll-iframe-not-propagated.html:
  • fast/events/touch/gesture/touch-gesture-scroll-iframe-propagated.html:
  • fast/events/touch/gesture/touch-gesture-scroll-page-not-propagated.html:
  • fast/events/touch/gesture/touch-gesture-scroll-page-propagated.html:
  • fast/events/touch/gesture/touch-gesture-scroll-page.html:

I modified this layout test in order to add test coverage for another bug
which is fixed by this patch: if the hit test performed on a GestureScrollBegin
does not target a specific node, the subsequent GestureScrollUpdate events should
still attempt to scroll the page itself. This is consistent with how mousewheel
events behave.

  • platform/chromium/fast/events/touch/gesture/touch-gesture-noscroll-body-expected.txt: Added.
  • platform/chromium/fast/events/touch/gesture/touch-gesture-noscroll-body-propagated-expected.txt: Added.
  • platform/chromium/fast/events/touch/gesture/touch-gesture-noscroll-body-xhidden-expected.txt: Added.
  • platform/chromium/fast/events/touch/gesture/touch-gesture-noscroll-body-yhidden-expected.txt: Added.

These four new layout tests verify that a non-scrollable body will not scroll,
as reported in https://bugs.webkit.org/show_bug.cgi?id=109316.

Location:
trunk
Files:
8 added
15 edited
4 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r144516 r144519  
     12013-03-01  Terry Anderson  <tdanderson@chromium.org>
     2
     3        EventHandler::handleGestureScrollUpdate() should invoke the user-generated scroll routines
     4        so its behavior matches other user-initiated scrolls
     5        https://bugs.webkit.org/show_bug.cgi?id=109769
     6
     7        Reviewed by James Robinson.
     8
     9        Four new layout tests have been added and touch-gesture-scroll-page.html has been
     10        modified to demonstrate that this patch fixes two existing bugs. See the inline
     11        comments below for details.
     12
     13        Because I am now using the existing user-generated scroll logic, the delta for a single
     14        GestureScrollUpdate event will not be propagated to the parent of the targeted node
     15        unless the targeted node has no remaining scrollable area. So the changes to the
     16        existing layout tests have been made to ensure that the targeted node has been fully
     17        scrolled before subsequent GestureScrollUpdate events will scroll the parent(s) of
     18        the targeted node.
     19
     20        I have also removed the function recordScroll() from the existing layout tests
     21        because this function already exists in the included file resources/gesture-helpers.js.
     22
     23        * fast/events/touch/gesture/touch-gesture-noscroll-body-expected.txt: Added.
     24        * fast/events/touch/gesture/touch-gesture-noscroll-body-propagated-expected.txt: Added.
     25        * fast/events/touch/gesture/touch-gesture-noscroll-body-propagated.html: Copied from LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page.html.
     26        * fast/events/touch/gesture/touch-gesture-noscroll-body-xhidden-expected.txt: Added.
     27        * fast/events/touch/gesture/touch-gesture-noscroll-body-xhidden.html: Copied from LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page.html.
     28        * fast/events/touch/gesture/touch-gesture-noscroll-body-yhidden-expected.txt: Added.
     29        * fast/events/touch/gesture/touch-gesture-noscroll-body-yhidden.html: Copied from LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page.html.
     30        * fast/events/touch/gesture/touch-gesture-noscroll-body.html: Copied from LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page.html.
     31        * fast/events/touch/gesture/touch-gesture-scroll-div-not-propagated.html:
     32        * fast/events/touch/gesture/touch-gesture-scroll-div-propagated.html:
     33        * fast/events/touch/gesture/touch-gesture-scroll-div-twice-propagated.html:
     34        * fast/events/touch/gesture/touch-gesture-scroll-iframe-not-propagated.html:
     35        * fast/events/touch/gesture/touch-gesture-scroll-iframe-propagated.html:
     36        * fast/events/touch/gesture/touch-gesture-scroll-page-not-propagated.html:
     37        * fast/events/touch/gesture/touch-gesture-scroll-page-propagated.html:
     38        * fast/events/touch/gesture/touch-gesture-scroll-page.html:
     39              I modified this layout test in order to add test coverage for another bug
     40              which is fixed by this patch: if the hit test performed on a GestureScrollBegin
     41              does not target a specific node, the subsequent GestureScrollUpdate events should
     42              still attempt to scroll the page itself. This is consistent with how mousewheel
     43              events behave.
     44        * platform/chromium/fast/events/touch/gesture/touch-gesture-noscroll-body-expected.txt: Added.
     45        * platform/chromium/fast/events/touch/gesture/touch-gesture-noscroll-body-propagated-expected.txt: Added.
     46        * platform/chromium/fast/events/touch/gesture/touch-gesture-noscroll-body-xhidden-expected.txt: Added.
     47        * platform/chromium/fast/events/touch/gesture/touch-gesture-noscroll-body-yhidden-expected.txt: Added.
     48              These four new layout tests verify that a non-scrollable body will not scroll,
     49              as reported in https://bugs.webkit.org/show_bug.cgi?id=109316.
     50
    1512013-03-01  Roger Fong  <roger_fong@apple.com>
    252
  • trunk/LayoutTests/fast/events/touch/gesture/touch-gesture-noscroll-body-propagated.html

    r144518 r144519  
    1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
     1<!DOCTYPE html>
    22<html>
    33<head>
     
    66<script src="resources/gesture-helpers.js"></script>
    77<style type="text/css">
     8#touchtarget {
     9  width: 100px;
     10  height: 100px;
     11  background: white;
     12  overflow:scroll;
     13}
     14
    815::-webkit-scrollbar {
    916    width: 0px;
     
    1825  margin: 0px;
    1926}
     27
    2028#redbox {
    2129  width: 100px;
     
    3139</style>
    3240</head>
    33 <body style="margin:0" onload="runTest();">
     41<body style="margin:0; overflow-y:hidden;" onload="runTest();">
     42
     43<div id="touchtarget">
     44  <table border="0" cellspacing="0px" id="tablefoo">
     45    <tr>
     46      <td><div id="redbox"></div></td>
     47      <td><div id="greenbox"></div></td>
     48    </tr>
     49    <tr>
     50      <td><div id="greenbox"></div></td>
     51      <td><div id="greenbox"></div></td>
     52    </tr>
     53  </table>
     54</div>
    3455
    3556<table id="table_to_fill">
     
    4566var gesturesOccurred = 0;
    4667var scrollAmountX = ['0', '0'];
    47 var scrollAmountY = ['70', '130'];
     68var scrollAmountY = ['0', '0'];
    4869var wheelEventsOccurred = 0;
    4970var expectedWheelEventsOccurred = ['0', '0'];
    5071var scrollEventsOccurred = 0;
     72var expectedScrollEventsOccurred = '0';
    5173var scrolledElement = 'document.body'
    52 var scrollEventsOccurred = 0;
    53 var expectedScrollEventsOccurred = '1';
    54 
    55 function recordScroll(event) {
    56         debug('scroll event ' + scrollEventsOccurred + '+> ' + event.target);
    57         scrollEventsOccurred++;
    58 
    59         if (window.eventSender) {
    60                 // Because scroll events arrive asynchronously, only one will arrive.
    61             if (gesturesOccurred == expectedGesturesTotal) {
    62                         shouldBe('scrollEventsOccurred', expectedScrollEventsOccurred);
    63                 // If we've got here, we've passed.
    64                 successfullyParsed = true;
    65                 isSuccessfullyParsed();
    66                 if (window.testRunner)
    67                     testRunner.notifyDone();
    68                 }
    69     }
    70 }
    7174
    7275// Always construct a page larger than the vertical height of the window.
     
    9497{
    9598    debug("first gesture");
    96     eventSender.gestureScrollBegin(10, 72);
    97     eventSender.gestureScrollUpdate(0, -30);
    98     eventSender.gestureScrollUpdate(0, -40);
     99    eventSender.gestureScrollBegin(95, 12);
     100    eventSender.gestureScrollUpdate(0, -100);
     101    eventSender.gestureScrollUpdate(0, -10);
    99102    eventSender.gestureScrollEnd(0, 0);
    100103
     
    106109{
    107110    debug("second gesture");
    108     eventSender.gestureScrollBegin(12, 40);
    109     eventSender.gestureScrollUpdate(0, -30);
    110     eventSender.gestureScrollUpdate(0, -30);
     111    eventSender.gestureScrollBegin(12, 97);
     112    eventSender.gestureScrollUpdate(0, -95);
     113    eventSender.gestureScrollUpdate(0, -200);
    111114    eventSender.gestureScrollEnd(0, 0);
    112115
    113116    // Wait for layout.
    114117    checkScrollOffset();
     118
     119    // In this test we do not expect any scroll events to
     120    // be received by the event listener, so we signal
     121    // the end of the test by calling this function instead
     122    // of relying on recordScroll() to do it.
     123    finishTest();
    115124}
    116125
     
    122131    buildPage();
    123132    if (window.eventSender) {
    124         description('This tests scroll gesture event scrolling on a whole page.');
     133        description('This tests that a page cannot be scrolled vertically with touch if its body has style overflow-y:hidden ' +
     134                    'and the scroll event is propogated from a scrollable child div.');
     135
    125136        if (checkTestDependencies())
    126137            firstGestureScroll();
     
    128139            exitIfNecessary();
    129140    } else {
    130         debug("This test requires DumpRenderTree.  Gesture-scroll the page to validate the implementation.");
     141        debug("This test requires DumpRenderTree.  Touch scroll the red rect to log.");
     142    }
     143}
     144
     145function finishTest()
     146{
     147    if (window.eventSender) {
     148        if (gesturesOccurred == expectedGesturesTotal) {
     149            shouldBe('scrollEventsOccurred', expectedScrollEventsOccurred);
     150            successfullyParsed = true;
     151            isSuccessfullyParsed();
     152            if (window.testRunner)
     153                testRunner.notifyDone();
     154        }
    131155    }
    132156}
    133157</script>
    134 
    135 
    136 
    137158</body>
    138159</html>
  • trunk/LayoutTests/fast/events/touch/gesture/touch-gesture-noscroll-body-xhidden.html

    r144518 r144519  
    1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
     1<!DOCTYPE html>
    22<html>
    33<head>
     
    66<script src="resources/gesture-helpers.js"></script>
    77<style type="text/css">
     8#touchtarget {
     9  width: 100px;
     10  height: 100px;
     11  background: white;
     12  overflow:hidden;
     13}
     14
    815::-webkit-scrollbar {
    916    width: 0px;
     
    1825  margin: 0px;
    1926}
     27
    2028#redbox {
    2129  width: 100px;
     
    3139</style>
    3240</head>
    33 <body style="margin:0" onload="runTest();">
     41<body style="margin:0; overflow-x:hidden;" onload="runTest();">
    3442
    35 <table id="table_to_fill">
     43<table id="horizontal_table_to_fill">
     44  <tr id="firstrow">
     45    <td><div id="redbox"></div></td>
     46    <td><div id="greenbox"></div></td>
     47  </tr>
     48</table>
     49
     50<table id="vertical_table_to_fill">
    3651    <tr><td><div id="greenbox"></div></td></tr>
    3752    <tr><td><div id="redbox"></div></td></tr>
     
    4560var gesturesOccurred = 0;
    4661var scrollAmountX = ['0', '0'];
    47 var scrollAmountY = ['70', '130'];
     62var scrollAmountY = ['110', '205'];
    4863var wheelEventsOccurred = 0;
    4964var expectedWheelEventsOccurred = ['0', '0'];
    5065var scrollEventsOccurred = 0;
     66var expectedScrollEventsOccurred = '1';
    5167var scrolledElement = 'document.body'
    52 var scrollEventsOccurred = 0;
    53 var expectedScrollEventsOccurred = '1';
    54 
    55 function recordScroll(event) {
    56         debug('scroll event ' + scrollEventsOccurred + '+> ' + event.target);
    57         scrollEventsOccurred++;
    58 
    59         if (window.eventSender) {
    60                 // Because scroll events arrive asynchronously, only one will arrive.
    61             if (gesturesOccurred == expectedGesturesTotal) {
    62                         shouldBe('scrollEventsOccurred', expectedScrollEventsOccurred);
    63                 // If we've got here, we've passed.
    64                 successfullyParsed = true;
    65                 isSuccessfullyParsed();
    66                 if (window.testRunner)
    67                     testRunner.notifyDone();
    68                 }
    69     }
    70 }
    7168
    7269// Always construct a page larger than the vertical height of the window.
    7370function buildPage()
    7471{
    75     var table = document.getElementById('table_to_fill');
     72    // build vertical table
     73    var table = document.getElementById('vertical_table_to_fill');
    7674    var targetHeight = document.body.offsetHeight;
    7775    var cellPairHeight = table.offsetHeight;
     
    8785    }
    8886
     87    // build horizontal table
     88    var horizontalTable = document.getElementById('horizontal_table_to_fill');
     89    var tableRow = document.getElementById('firstrow');
     90    var targetWidth = document.body.offsetWidth;
     91    var cellPairWidth = horizontalTable.offsetWidth;
     92    numberOfReps = targetWidth / cellPairWidth * 2;
     93    for (i = 0; i < numberOfReps; i++) {
     94        var p = document.createElement('td');
     95        p.innerHTML = '<div id="redbox"></div>';
     96        tableRow.appendChild(p);
     97        var p = document.createElement('td');
     98        p.innerHTML = '<div id="greenbox"></div>';
     99        tableRow.appendChild(p);
     100    }
     101
    89102    window.addEventListener("scroll", recordScroll);
    90103    window.addEventListener("mousewheel", recordWheel);
     
    94107{
    95108    debug("first gesture");
    96     eventSender.gestureScrollBegin(10, 72);
    97     eventSender.gestureScrollUpdate(0, -30);
    98     eventSender.gestureScrollUpdate(0, -40);
     109    eventSender.gestureScrollBegin(95, 12);
     110    eventSender.gestureScrollUpdate(-55, -110);
    99111    eventSender.gestureScrollEnd(0, 0);
    100112
     
    106118{
    107119    debug("second gesture");
    108     eventSender.gestureScrollBegin(12, 40);
    109     eventSender.gestureScrollUpdate(0, -30);
    110     eventSender.gestureScrollUpdate(0, -30);
     120    eventSender.gestureScrollBegin(12, 97);
     121    eventSender.gestureScrollUpdate(-42, -95);
    111122    eventSender.gestureScrollEnd(0, 0);
    112123
     
    122133    buildPage();
    123134    if (window.eventSender) {
    124         description('This tests scroll gesture event scrolling on a whole page.');
     135        description('This tests that a page cannot be scrolled horizontally with touch ' +
     136                    '(but can still be scrolled vertically) if its body has style overflow-x:hidden. ' +
     137                    'The scroll events in this test have both an x and y component.');
     138
    125139        if (checkTestDependencies())
    126140            firstGestureScroll();
     
    128142            exitIfNecessary();
    129143    } else {
    130         debug("This test requires DumpRenderTree.  Gesture-scroll the page to validate the implementation.");
     144        debug("This test requires DumpRenderTree.  Touch scroll the red rect to log.");
    131145    }
    132146}
    133147</script>
    134 
    135 
    136 
    137148</body>
    138149</html>
  • trunk/LayoutTests/fast/events/touch/gesture/touch-gesture-noscroll-body-yhidden.html

    r144518 r144519  
    1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
     1<!DOCTYPE html>
    22<html>
    33<head>
     
    66<script src="resources/gesture-helpers.js"></script>
    77<style type="text/css">
     8#touchtarget {
     9  width: 100px;
     10  height: 100px;
     11  background: white;
     12  overflow:hidden;
     13}
     14
    815::-webkit-scrollbar {
    916    width: 0px;
     
    1825  margin: 0px;
    1926}
     27
    2028#redbox {
    2129  width: 100px;
     
    3139</style>
    3240</head>
    33 <body style="margin:0" onload="runTest();">
     41<body style="margin:0; overflow-y:hidden;" onload="runTest();">
    3442
    35 <table id="table_to_fill">
     43<table id="horizontal_table_to_fill">
     44  <tr id="firstrow">
     45    <td><div id="redbox"></div></td>
     46    <td><div id="greenbox"></div></td>
     47  </tr>
     48</table>
     49
     50<table id="vertical_table_to_fill">
    3651    <tr><td><div id="greenbox"></div></td></tr>
    3752    <tr><td><div id="redbox"></div></td></tr>
     
    4459var expectedGesturesTotal = 2;
    4560var gesturesOccurred = 0;
    46 var scrollAmountX = ['0', '0'];
    47 var scrollAmountY = ['70', '130'];
     61var scrollAmountX = ['55', '97'];
     62var scrollAmountY = ['0', '0'];
    4863var wheelEventsOccurred = 0;
    4964var expectedWheelEventsOccurred = ['0', '0'];
    5065var scrollEventsOccurred = 0;
     66var expectedScrollEventsOccurred = '1';
    5167var scrolledElement = 'document.body'
    52 var scrollEventsOccurred = 0;
    53 var expectedScrollEventsOccurred = '1';
    54 
    55 function recordScroll(event) {
    56         debug('scroll event ' + scrollEventsOccurred + '+> ' + event.target);
    57         scrollEventsOccurred++;
    58 
    59         if (window.eventSender) {
    60                 // Because scroll events arrive asynchronously, only one will arrive.
    61             if (gesturesOccurred == expectedGesturesTotal) {
    62                         shouldBe('scrollEventsOccurred', expectedScrollEventsOccurred);
    63                 // If we've got here, we've passed.
    64                 successfullyParsed = true;
    65                 isSuccessfullyParsed();
    66                 if (window.testRunner)
    67                     testRunner.notifyDone();
    68                 }
    69     }
    70 }
    7168
    7269// Always construct a page larger than the vertical height of the window.
    7370function buildPage()
    7471{
    75     var table = document.getElementById('table_to_fill');
     72    // build vertical table
     73    var table = document.getElementById('vertical_table_to_fill');
    7674    var targetHeight = document.body.offsetHeight;
    7775    var cellPairHeight = table.offsetHeight;
     
    8785    }
    8886
     87    // build horizontal table
     88    var horizontalTable = document.getElementById('horizontal_table_to_fill');
     89    var tableRow = document.getElementById('firstrow');
     90    var targetWidth = document.body.offsetWidth;
     91    var cellPairWidth = horizontalTable.offsetWidth;
     92    numberOfReps = targetWidth / cellPairWidth * 2;
     93    for (i = 0; i < numberOfReps; i++) {
     94        var p = document.createElement('td');
     95        p.innerHTML = '<div id="redbox"></div>';
     96        tableRow.appendChild(p);
     97        var p = document.createElement('td');
     98        p.innerHTML = '<div id="greenbox"></div>';
     99        tableRow.appendChild(p);
     100    }
     101
    89102    window.addEventListener("scroll", recordScroll);
    90103    window.addEventListener("mousewheel", recordWheel);
     
    94107{
    95108    debug("first gesture");
    96     eventSender.gestureScrollBegin(10, 72);
    97     eventSender.gestureScrollUpdate(0, -30);
    98     eventSender.gestureScrollUpdate(0, -40);
     109    eventSender.gestureScrollBegin(195, 12);
     110    eventSender.gestureScrollUpdate(-55, -110);
    99111    eventSender.gestureScrollEnd(0, 0);
    100112
     
    106118{
    107119    debug("second gesture");
    108     eventSender.gestureScrollBegin(12, 40);
    109     eventSender.gestureScrollUpdate(0, -30);
    110     eventSender.gestureScrollUpdate(0, -30);
     120    eventSender.gestureScrollBegin(120, 255);
     121    eventSender.gestureScrollUpdate(-42, -95);
    111122    eventSender.gestureScrollEnd(0, 0);
    112123
     
    122133    buildPage();
    123134    if (window.eventSender) {
    124         description('This tests scroll gesture event scrolling on a whole page.');
     135        description('This tests that a page cannot be scrolled vertically with touch ' +
     136                    '(but can still be scrolled horizontally) if its body has style overflow-y:hidden. ' +
     137                    'The scroll events in this test have both an x and y component.');
     138
    125139        if (checkTestDependencies())
    126140            firstGestureScroll();
     
    128142            exitIfNecessary();
    129143    } else {
    130         debug("This test requires DumpRenderTree.  Gesture-scroll the page to validate the implementation.");
     144        debug("This test requires DumpRenderTree.  Touch scroll the red rect to log.");
    131145    }
    132146}
    133147</script>
    134 
    135 
    136 
    137148</body>
    138149</html>
  • trunk/LayoutTests/fast/events/touch/gesture/touch-gesture-noscroll-body.html

    r144518 r144519  
    1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
     1<!DOCTYPE html>
    22<html>
    33<head>
     
    66<script src="resources/gesture-helpers.js"></script>
    77<style type="text/css">
     8#touchtarget {
     9  width: 100px;
     10  height: 100px;
     11  background: white;
     12  overflow:hidden;
     13}
     14
    815::-webkit-scrollbar {
    916    width: 0px;
     
    1825  margin: 0px;
    1926}
     27
    2028#redbox {
    2129  width: 100px;
     
    3139</style>
    3240</head>
    33 <body style="margin:0" onload="runTest();">
     41<body style="margin:0; overflow:hidden;" onload="runTest();">
    3442
    35 <table id="table_to_fill">
     43<table id="horizontal_table_to_fill">
     44  <tr id="firstrow">
     45    <td><div id="redbox"></div></td>
     46    <td><div id="greenbox"></div></td>
     47  </tr>
     48</table>
     49
     50<table id="vertical_table_to_fill">
    3651    <tr><td><div id="greenbox"></div></td></tr>
    3752    <tr><td><div id="redbox"></div></td></tr>
     
    4560var gesturesOccurred = 0;
    4661var scrollAmountX = ['0', '0'];
    47 var scrollAmountY = ['70', '130'];
     62var scrollAmountY = ['0', '0'];
    4863var wheelEventsOccurred = 0;
    4964var expectedWheelEventsOccurred = ['0', '0'];
    5065var scrollEventsOccurred = 0;
     66var expectedScrollEventsOccurred = '0';
    5167var scrolledElement = 'document.body'
    52 var scrollEventsOccurred = 0;
    53 var expectedScrollEventsOccurred = '1';
    54 
    55 function recordScroll(event) {
    56         debug('scroll event ' + scrollEventsOccurred + '+> ' + event.target);
    57         scrollEventsOccurred++;
    58 
    59         if (window.eventSender) {
    60                 // Because scroll events arrive asynchronously, only one will arrive.
    61             if (gesturesOccurred == expectedGesturesTotal) {
    62                         shouldBe('scrollEventsOccurred', expectedScrollEventsOccurred);
    63                 // If we've got here, we've passed.
    64                 successfullyParsed = true;
    65                 isSuccessfullyParsed();
    66                 if (window.testRunner)
    67                     testRunner.notifyDone();
    68                 }
    69     }
    70 }
    7168
    7269// Always construct a page larger than the vertical height of the window.
    7370function buildPage()
    7471{
    75     var table = document.getElementById('table_to_fill');
     72    // build vertical table
     73    var table = document.getElementById('vertical_table_to_fill');
    7674    var targetHeight = document.body.offsetHeight;
    7775    var cellPairHeight = table.offsetHeight;
     
    8785    }
    8886
     87    // build horizontal table
     88    var horizontalTable = document.getElementById('horizontal_table_to_fill');
     89    var tableRow = document.getElementById('firstrow');
     90    var targetWidth = document.body.offsetWidth;
     91    var cellPairWidth = horizontalTable.offsetWidth;
     92    numberOfReps = targetWidth / cellPairWidth * 2;
     93    for (i = 0; i < numberOfReps; i++) {
     94        var p = document.createElement('td');
     95        p.innerHTML = '<div id="redbox"></div>';
     96        tableRow.appendChild(p);
     97        var p = document.createElement('td');
     98        p.innerHTML = '<div id="greenbox"></div>';
     99        tableRow.appendChild(p);
     100    }
     101
    89102    window.addEventListener("scroll", recordScroll);
    90103    window.addEventListener("mousewheel", recordWheel);
     
    94107{
    95108    debug("first gesture");
    96     eventSender.gestureScrollBegin(10, 72);
    97     eventSender.gestureScrollUpdate(0, -30);
    98     eventSender.gestureScrollUpdate(0, -40);
     109    eventSender.gestureScrollBegin(95, 12);
     110    eventSender.gestureScrollUpdate(-55, -110);
    99111    eventSender.gestureScrollEnd(0, 0);
    100112
     
    106118{
    107119    debug("second gesture");
    108     eventSender.gestureScrollBegin(12, 40);
    109     eventSender.gestureScrollUpdate(0, -30);
    110     eventSender.gestureScrollUpdate(0, -30);
     120    eventSender.gestureScrollBegin(12, 97);
     121    eventSender.gestureScrollUpdate(-42, -95);
    111122    eventSender.gestureScrollEnd(0, 0);
    112123
    113124    // Wait for layout.
    114125    checkScrollOffset();
     126
     127    // In this test we do not expect any scroll events to
     128    // be received by the event listener, so we signal
     129    // the end of the test by calling this function instead
     130    // of relying on recordScroll() to do it.
     131    finishTest();
    115132}
    116133
     
    122139    buildPage();
    123140    if (window.eventSender) {
    124         description('This tests scroll gesture event scrolling on a whole page.');
     141        description('This tests that a page cannot be scrolled with touch if its body has style overflow:hidden.');
     142
    125143        if (checkTestDependencies())
    126144            firstGestureScroll();
     
    128146            exitIfNecessary();
    129147    } else {
    130         debug("This test requires DumpRenderTree.  Gesture-scroll the page to validate the implementation.");
     148        debug("This test requires DumpRenderTree.  Touch scroll the red rect to log.");
     149    }
     150}
     151
     152function finishTest()
     153{
     154    if (window.eventSender) {
     155        if (gesturesOccurred == expectedGesturesTotal) {
     156            shouldBe('scrollEventsOccurred', expectedScrollEventsOccurred);
     157            successfullyParsed = true;
     158            isSuccessfullyParsed();
     159            if (window.testRunner)
     160                testRunner.notifyDone();
     161        }
    131162    }
    132163}
    133164</script>
    134 
    135 
    136 
    137165</body>
    138166</html>
  • trunk/LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-div-not-propagated.html

    r142057 r144519  
    9393var expectedScrollEventsOccurred = '1';
    9494
    95 
    96 function recordScroll(event) {
    97         debug('scroll event ' + scrollEventsOccurred + '+> ' + event.target);
    98         scrollEventsOccurred++;
    99 
    100         if (window.eventSender) {
    101                 // Because scroll events arrive asynchronously, only one will arrive.
    102             if (gesturesOccurred == expectedGesturesTotal) {
    103                         shouldBe('scrollEventsOccurred', expectedScrollEventsOccurred);
    104                 // If we've got here, we've passed.
    105                 successfullyParsed = true;
    106                 isSuccessfullyParsed();
    107                 if (window.testRunner)
    108                     testRunner.notifyDone();
    109                 }
    110     }
    111 }
    112 
    113 
    11495function firstGestureScroll()
    11596{
     
    127108    debug("second gesture");
    128109    eventSender.gestureScrollBegin(12, 40);
    129     eventSender.gestureScrollUpdateWithoutPropagation(0, -60);
     110    eventSender.gestureScrollUpdateWithoutPropagation(0, -50);
     111    eventSender.gestureScrollUpdateWithoutPropagation(0, -10);
    130112    eventSender.gestureScrollEnd(0, 0);
    131113
  • trunk/LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-div-propagated.html

    r140177 r144519  
    9393var expectedScrollEventsOccurred = '1';
    9494
    95 
    96 function recordScroll(event) {
    97         debug('scroll event ' + scrollEventsOccurred + '+> ' + event.target);
    98         scrollEventsOccurred++;
    99 
    100         if (window.eventSender) {
    101                 // Because scroll events arrive asynchronously, only one will arrive.
    102             if (gesturesOccurred == expectedGesturesTotal) {
    103                         shouldBe('scrollEventsOccurred', expectedScrollEventsOccurred);
    104                 // If we've got here, we've passed.
    105                 successfullyParsed = true;
    106                 isSuccessfullyParsed();
    107                 if (window.testRunner)
    108                     testRunner.notifyDone();
    109                 }
    110     }
    111 }
    112 
    113 
    11495function firstGestureScroll()
    11596{
     
    127108    debug("second gesture");
    128109    eventSender.gestureScrollBegin(12, 40);
    129     eventSender.gestureScrollUpdate(0, -60);
     110    eventSender.gestureScrollUpdate(0, -50);
     111    eventSender.gestureScrollUpdate(0, -10);
    130112    eventSender.gestureScrollEnd(0, 0);
    131113
  • trunk/LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-div-twice-propagated.html

    r140177 r144519  
    117117var expectedScrollEventsOccurred = '1';
    118118
    119 
    120 function recordScroll(event) {
    121         debug('scroll event ' + scrollEventsOccurred + '+> ' + event.target);
    122         scrollEventsOccurred++;
    123 
    124         if (window.eventSender) {
    125                 // Because scroll events arrive asynchronously, only one will arrive.
    126             if (gesturesOccurred == expectedGesturesTotal) {
    127                         shouldBe('scrollEventsOccurred', expectedScrollEventsOccurred);
    128                 // If we've got here, we've passed.
    129                 successfullyParsed = true;
    130                 isSuccessfullyParsed();
    131                 if (window.testRunner)
    132                     testRunner.notifyDone();
    133                 }
    134     }
    135 }
    136 
    137 
    138119function firstGestureScroll()
    139120{
    140121    debug("first gesture");
    141122    eventSender.gestureScrollBegin(10, 72);
    142     eventSender.gestureScrollUpdate(0, -230);
     123    eventSender.gestureScrollUpdate(0, -200);
     124    eventSender.gestureScrollUpdate(0, -30);
    143125    eventSender.gestureScrollEnd(0, 0);
    144126
     
    151133    debug("second gesture");
    152134    eventSender.gestureScrollBegin(12, 40);
    153     eventSender.gestureScrollUpdate(0, -45);
     135    eventSender.gestureScrollUpdate(0, -20);
     136    eventSender.gestureScrollUpdate(0, -25);
    154137    eventSender.gestureScrollEnd(0, 0);
    155138
  • trunk/LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-iframe-not-propagated.html

    r142057 r144519  
    7272var expectedScrollEventsOccurred = '1';
    7373
    74 
    75 function recordScroll(event) {
    76         debug('scroll event ' + scrollEventsOccurred + '+> ' + event.target);
    77         scrollEventsOccurred++;
    78 
    79         if (window.eventSender) {
    80                 // Because scroll events arrive asynchronously, only one will arrive.
    81             if (gesturesOccurred == expectedGesturesTotal) {
    82                         shouldBe('scrollEventsOccurred', expectedScrollEventsOccurred);
    83                 // If we've got here, we've passed.
    84                 successfullyParsed = true;
    85                 isSuccessfullyParsed();
    86                 if (window.testRunner)
    87                     testRunner.notifyDone();
    88                 }
    89     }
    90 }
    91 
    92 
    9374function firstGestureScroll()
    9475{
     
    10687    debug("second gesture");
    10788    eventSender.gestureScrollBegin(12, 40);
    108     eventSender.gestureScrollUpdateWithoutPropagation(0, -100);
     89    eventSender.gestureScrollUpdateWithoutPropagation(0, -10);
     90    eventSender.gestureScrollUpdateWithoutPropagation(0, -50);
    10991    eventSender.gestureScrollEnd(0, 0);
    11092
  • trunk/LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-iframe-propagated.html

    r140177 r144519  
    7272var expectedScrollEventsOccurred = '1';
    7373
    74 
    75 function recordScroll(event) {
    76         debug('scroll event ' + scrollEventsOccurred + '+> ' + event.target);
    77         scrollEventsOccurred++;
    78 
    79         if (window.eventSender) {
    80                 // Because scroll events arrive asynchronously, only one will arrive.
    81             if (gesturesOccurred == expectedGesturesTotal) {
    82                         shouldBe('scrollEventsOccurred', expectedScrollEventsOccurred);
    83                 // If we've got here, we've passed.
    84                 successfullyParsed = true;
    85                 isSuccessfullyParsed();
    86                 if (window.testRunner)
    87                     testRunner.notifyDone();
    88                 }
    89     }
    90 }
    91 
    92 
    9374function firstGestureScroll()
    9475{
     
    10687    debug("second gesture");
    10788    eventSender.gestureScrollBegin(12, 40);
    108     eventSender.gestureScrollUpdate(0, -100);
     89    eventSender.gestureScrollUpdate(0, -10);
     90    eventSender.gestureScrollUpdate(0, -50);
    10991    eventSender.gestureScrollEnd(0, 0);
    11092
  • trunk/LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page-not-propagated.html

    r142057 r144519  
    8787var expectedScrollEventsOccurred = '1';
    8888
    89 function recordScroll(event) {
    90         debug('scroll event ' + scrollEventsOccurred + '+> ' + event.target);
    91         scrollEventsOccurred++;
    92 
    93         if (window.eventSender) {
    94                 // Because scroll events arrive asynchronously, only one will arrive.
    95             if (gesturesOccurred == expectedGesturesTotal) {
    96                         shouldBe('scrollEventsOccurred', expectedScrollEventsOccurred);
    97                 // If we've got here, we've passed.
    98                 successfullyParsed = true;
    99                 isSuccessfullyParsed();
    100                 if (window.testRunner)
    101                     testRunner.notifyDone();
    102                 }
    103     }
    104 }
    105 
    10689// Always construct a page larger than the vertical height of the window.
    10790function buildPage()
     
    137120    debug("second gesture");
    138121    eventSender.gestureScrollBegin(12, 40);
    139     eventSender.gestureScrollUpdateWithoutPropagation(0, -250);
     122    eventSender.gestureScrollUpdateWithoutPropagation(0, -200);
     123    eventSender.gestureScrollUpdateWithoutPropagation(0, -160);
    140124    eventSender.gestureScrollEnd(0, 0);
    141125
  • trunk/LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page-propagated.html

    r140177 r144519  
    8787var expectedScrollEventsOccurred = '1';
    8888
    89 function recordScroll(event) {
    90         debug('scroll event ' + scrollEventsOccurred + '+> ' + event.target);
    91         scrollEventsOccurred++;
    92 
    93         if (window.eventSender) {
    94                 // Because scroll events arrive asynchronously, only one will arrive.
    95             if (gesturesOccurred == expectedGesturesTotal) {
    96                         shouldBe('scrollEventsOccurred', expectedScrollEventsOccurred);
    97                 // If we've got here, we've passed.
    98                 successfullyParsed = true;
    99                 isSuccessfullyParsed();
    100                 if (window.testRunner)
    101                     testRunner.notifyDone();
    102                 }
    103     }
    104 }
    105 
    10689// Always construct a page larger than the vertical height of the window.
    10790function buildPage()
     
    137120    debug("second gesture");
    138121    eventSender.gestureScrollBegin(12, 40);
    139     eventSender.gestureScrollUpdate(0, -250);
     122    eventSender.gestureScrollUpdate(0, -200);
     123    eventSender.gestureScrollUpdate(0, -160);
    140124    eventSender.gestureScrollEnd(0, 0);
    141125
  • trunk/LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page.html

    r140177 r144519  
    1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
     1<!DOCTYPE html>
    22<html>
    33<head>
     
    106106{
    107107    debug("second gesture");
    108     eventSender.gestureScrollBegin(12, 40);
     108    eventSender.gestureScrollBegin(800, 40);
    109109    eventSender.gestureScrollUpdate(0, -30);
    110110    eventSender.gestureScrollUpdate(0, -30);
  • trunk/Source/WebCore/ChangeLog

    r144517 r144519  
     12013-03-01  Terry Anderson  <tdanderson@chromium.org>
     2
     3        EventHandler::handleGestureScrollUpdate() should invoke the user-generated scroll routines
     4        so its behavior matches other user-initiated scrolls
     5        https://bugs.webkit.org/show_bug.cgi?id=109769
     6
     7        Reviewed by James Robinson.
     8
     9        To ensure that the scrolling behavior of GestureScrollUpdate events are consistent with
     10        the scrolling behavior of mousewheel events, use the existing user-generated scroll logic
     11        instead of calling into RenderLayer::scrollByRecursively(). This patch fixes the bug
     12        reported in https://bugs.webkit.org/show_bug.cgi?id=109316, where the example page can
     13        be scrolled using touch but cannot be scrolled using mousewheels.
     14
     15        Note that this patch does not use any of the mousewheel event-handling code.
     16
     17        Tests: fast/events/touch/gesture/touch-gesture-noscroll-body-propagated.html
     18               fast/events/touch/gesture/touch-gesture-noscroll-body-xhidden.html
     19               fast/events/touch/gesture/touch-gesture-noscroll-body-yhidden.html
     20               fast/events/touch/gesture/touch-gesture-noscroll-body.html
     21
     22        * page/EventHandler.cpp:
     23        (WebCore::EventHandler::clear):
     24        (WebCore::EventHandler::handleGestureEvent):
     25        (WebCore::EventHandler::handleGestureScrollBegin):
     26        (WebCore::EventHandler::handleGestureScrollUpdate):
     27        (WebCore::EventHandler::sendScrollEventToView):
     28            By calling this function at the start of handleGestureScrollUpdate() in the case
     29            where |m_scrollGestureHandlingNode| is null, we ensure that the scroll updates
     30            can still scroll the page itself, if possible.
     31        (WebCore):
     32        (WebCore::EventHandler::clearGestureScrollNodes):
     33        * page/EventHandler.h:
     34        (EventHandler):
     35        * platform/PlatformWheelEvent.h:
     36        (WebCore::PlatformWheelEvent::setHasPreciseScrollingDeltas):
     37
    1382013-03-01  Alec Flett  <alecflett@chromium.org>
    239
  • trunk/Source/WebCore/page/EventHandler.cpp

    r143727 r144519  
    404404    m_scrollGestureHandlingNode = 0;
    405405    m_lastHitTestResultOverWidget = false;
     406    m_previousGestureScrolledNode = 0;
    406407    m_scrollbarHandlingScrollGesture = 0;
    407408#endif
     
    24772478    case PlatformEvent::GestureScrollUpdateWithoutPropagation:
    24782479        return handleGestureScrollUpdate(gestureEvent);
     2480    case PlatformEvent::GestureScrollEnd:
     2481        clearGestureScrollNodes();
     2482        return true;
    24792483    case PlatformEvent::GestureTap:
    24802484        return handleGestureTap(gestureEvent);
     
    24872491    case PlatformEvent::GestureTwoFingerTap:
    24882492        return handleGestureTwoFingerTap(gestureEvent);
    2489     case PlatformEvent::GestureScrollEnd:
    24902493    case PlatformEvent::GestureDoubleTap:
    24912494    case PlatformEvent::GesturePinchBegin:
     
    26152618}
    26162619
    2617 static const Node* closestScrollableNodeCandidate(const Node* node)
    2618 {
    2619     for (EventPathWalker walker(node); walker.node(); walker.moveToParent()) {
    2620         Node* scrollableNode = walker.node();
    2621         if (scrollableNode->isDocumentNode())
    2622             return scrollableNode;
    2623         RenderObject* renderer = scrollableNode->renderer();
    2624         if (renderer && renderer->isBox() && toRenderBox(renderer)->canBeScrolledAndHasScrollableArea())
    2625             return scrollableNode;
    2626     }
    2627     return node;
    2628 }
    2629 
    26302620bool EventHandler::handleGestureScrollBegin(const PlatformGestureEvent& gestureEvent)
    26312621{
     
    26462636    m_lastHitTestResultOverWidget = result.isOverWidget();
    26472637    m_scrollGestureHandlingNode = result.innerNode();
     2638    m_previousGestureScrolledNode = 0;
    26482639
    26492640    Node* node = m_scrollGestureHandlingNode.get();
     
    26562647bool EventHandler::handleGestureScrollUpdate(const PlatformGestureEvent& gestureEvent)
    26572648{
    2658     // Ignore this event if we don't already have a targeted node with a valid renderer.
    2659     const Node* node = m_scrollGestureHandlingNode.get();
    2660     if (!node)
    2661         return false;
    2662 
    2663     RenderObject* latchedRenderer = node->renderer();
    2664     if (!latchedRenderer)
    2665         return false;
    2666 
    2667     IntSize delta(-gestureEvent.deltaX(), -gestureEvent.deltaY());
     2649    FloatSize delta(gestureEvent.deltaX(), gestureEvent.deltaY());
    26682650    if (delta.isZero())
    26692651        return false;
    2670 
    2671     RefPtr<FrameView> protector(m_frame->view());
    2672 
    2673     // Try to send the event to the correct view.
    2674     if (passGestureEventToWidgetIfPossible(gestureEvent, latchedRenderer))
    2675         return true;
    2676 
    2677     // Otherwise if this is the correct view for the event, find the closest scrollable
    2678     // ancestor of the targeted node and scroll the layer that contains this node's renderer.
    2679     node = closestScrollableNodeCandidate(node);
    2680     if (!node)
    2681         return false;
    2682 
    2683     latchedRenderer = node->renderer();
    2684     if (!latchedRenderer)
    2685         return false;
    2686 
    2687     RenderLayer::ScrollPropagation shouldPropagate = RenderLayer::ShouldPropagateScroll;
    2688     if (gestureEvent.type() == PlatformEvent::GestureScrollUpdateWithoutPropagation)
    2689         shouldPropagate = RenderLayer::DontPropagateScroll;
    26902652
    26912653    const float scaleFactor = m_frame->pageZoomFactor() * m_frame->frameScaleFactor();
    26922654    delta.scale(1 / scaleFactor, 1 / scaleFactor);
    26932655
    2694     bool result = latchedRenderer->enclosingLayer()->scrollBy(delta, RenderLayer::ScrollOffsetClamped, shouldPropagate);
    2695 
    2696     if (result)
     2656    Node* node = m_scrollGestureHandlingNode.get();
     2657    if (!node)
     2658        return sendScrollEventToView(gestureEvent, delta);
     2659
     2660    // Ignore this event if the targeted node does not have a valid renderer.
     2661    RenderObject* renderer = node->renderer();
     2662    if (!renderer)
     2663        return false;
     2664
     2665    RefPtr<FrameView> protector(m_frame->view());
     2666
     2667    // Try to send the event to the correct view.
     2668    if (passGestureEventToWidgetIfPossible(gestureEvent, renderer))
     2669        return true;
     2670
     2671    Node* stopNode = 0;
     2672    bool scrollShouldNotPropagate = gestureEvent.type() == PlatformEvent::GestureScrollUpdateWithoutPropagation;
     2673    if (scrollShouldNotPropagate)
     2674        stopNode = m_previousGestureScrolledNode.get();
     2675
     2676    // First try to scroll the closest scrollable RenderBox ancestor of |node|.
     2677    ScrollGranularity granularity = ScrollByPixel;
     2678    bool horizontalScroll = scrollNode(delta.width(), granularity, ScrollLeft, ScrollRight, node, &stopNode);
     2679    bool verticalScroll = scrollNode(delta.height(), granularity, ScrollUp, ScrollDown, node, &stopNode);
     2680
     2681    if (scrollShouldNotPropagate)
     2682        m_previousGestureScrolledNode = stopNode;
     2683
     2684    if (horizontalScroll || verticalScroll) {
    26972685        setFrameWasScrolledByUser();
    2698 
    2699     return result;
     2686        return true;
     2687    }
     2688
     2689    // Otherwise try to scroll the view.
     2690    return sendScrollEventToView(gestureEvent, delta);
     2691}
     2692
     2693bool EventHandler::sendScrollEventToView(const PlatformGestureEvent& gestureEvent, const FloatSize& scaledDelta)
     2694{
     2695    FrameView* view = m_frame->view();
     2696    if (!view)
     2697        return false;
     2698
     2699    const float tickDivisor = static_cast<float>(WheelEvent::TickMultiplier);
     2700    IntPoint point(gestureEvent.position().x(), gestureEvent.position().y());
     2701    IntPoint globalPoint(gestureEvent.globalPosition().x(), gestureEvent.globalPosition().y());
     2702    PlatformWheelEvent syntheticWheelEvent(point, globalPoint,
     2703        scaledDelta.width(), scaledDelta.height(),
     2704        scaledDelta.width() / tickDivisor, scaledDelta.height() / tickDivisor,
     2705        ScrollByPixelWheelEvent,
     2706        gestureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEvent.metaKey());
     2707#if PLATFORM(MAC) || PLATFORM(CHROMIUM)
     2708    syntheticWheelEvent.setHasPreciseScrollingDeltas(true);
     2709#endif
     2710
     2711    bool scrolledFrame = view->wheelEvent(syntheticWheelEvent);
     2712    if (scrolledFrame)
     2713        setFrameWasScrolledByUser();
     2714
     2715    return scrolledFrame;
     2716}
     2717
     2718void EventHandler::clearGestureScrollNodes()
     2719{
     2720    m_scrollGestureHandlingNode = 0;
     2721    m_previousGestureScrolledNode = 0;
    27002722}
    27012723
  • trunk/Source/WebCore/page/EventHandler.h

    r142977 r144519  
    182182    bool handleGestureScrollUpdate(const PlatformGestureEvent&);
    183183    bool handleGestureScrollBegin(const PlatformGestureEvent&);
     184    void clearGestureScrollNodes();
    184185    bool isScrollbarHandlingGestures() const;
    185186#endif
     
    379380    bool passGestureEventToWidget(const PlatformGestureEvent&, Widget*);
    380381    bool passGestureEventToWidgetIfPossible(const PlatformGestureEvent&, RenderObject*);
     382    bool sendScrollEventToView(const PlatformGestureEvent&, const FloatSize&);
    381383#endif
    382384
     
    470472    RefPtr<Node> m_scrollGestureHandlingNode;
    471473    bool m_lastHitTestResultOverWidget;
     474    RefPtr<Node> m_previousGestureScrolledNode;
    472475    RefPtr<Scrollbar> m_scrollbarHandlingScrollGesture;
    473476#endif
  • trunk/Source/WebCore/platform/PlatformWheelEvent.h

    r135638 r144519  
    158158#if PLATFORM(MAC) || PLATFORM(CHROMIUM)
    159159        bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas; }
     160        void setHasPreciseScrollingDeltas(bool b) { m_hasPreciseScrollingDeltas = b; }
    160161#endif
    161162#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
  • trunk/Source/WebKit/chromium/ChangeLog

    r144518 r144519  
     12013-03-01  Terry Anderson  <tdanderson@chromium.org>
     2
     3        EventHandler::handleGestureScrollUpdate() should invoke the user-generated scroll routines
     4        so its behavior matches other user-initiated scrolls
     5        https://bugs.webkit.org/show_bug.cgi?id=109769
     6
     7        Reviewed by James Robinson.
     8
     9        Clear the nodes corresponding to a fling scroll event when the event ends.
     10
     11        * src/WebViewImpl.cpp:
     12        (WebKit::WebViewImpl::updateAnimations):
     13
    1142013-03-01  David Dorwin  <ddorwin@chromium.org>
    215
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r144332 r144519  
    18471847            if (m_layerTreeView)
    18481848                m_layerTreeView->didStopFlinging();
     1849
     1850            mainFrameImpl()->frame()->eventHandler()->clearGestureScrollNodes();
    18491851        }
    18501852    }
Note: See TracChangeset for help on using the changeset viewer.