Changeset 75555
- Timestamp:
- 01/11/11 14:47:10 (23 months ago)
- Author:
- mihaip@chromium.org
- Message:
-
2011-01-11 Mihai Parparita <mihaip@chromium.org>
Reviewed by Darin Fisher.
Scroll event should be fired asynchronously
https://bugs.webkit.org/show_bug.cgi?id=45631
Update existing tests that assumed that scroll events fired
synchronously.
- editing/input/page-up-down-scrolls-expected.txt:
- editing/input/page-up-down-scrolls.html:
- fast/events/fire-scroll-event-element-expected.txt: Copied from LayoutTests/fast/events/fire-scroll-event-expected.txt.
- fast/events/fire-scroll-event-element.html: Added. Does the same
tests as fire-scroll-event.html, but on an individual element instead
of the whole document.
- fast/events/fire-scroll-event-expected.txt:
- fast/events/fire-scroll-event.html: Now explicitly tests for
synchronous behavior when scrolling the document, and that we don't
fire the event more than once.
- fast/events/remove-child-onscroll.html:
- fast/events/scroll-during-zoom-change.html:
- fast/events/scroll-event-does-not-bubble.html:
- fast/events/scroll-event-phase-expected.txt: Added.
- fast/events/scroll-event-phase.html: Added. Checks that we can listen
for scroll events in both the capture and bubble phase.
- fast/layers/removed-by-scroll-handler.html:
- fast/overflow/onscroll-layer-self-destruct.html:
- fast/repaint/repaint-during-scroll.html:
2011-01-11 Mihai Parparita <mihaip@chromium.org>
Reviewed by Darin Fisher.
Scroll event should be fired asynchronously
https://bugs.webkit.org/show_bug.cgi?id=45631
Tests: fast/events/fire-scroll-event.html
fast/events/fire-scroll-event-element.html
fast/events/scroll-event-phase.html
Makes scroll events fire asynchronously to be in compliance with the
CSSOM View Module and consistent with Gecko, Opera and (to some degree)
IE.
Implemented via the EventQueue class added by r74062 (EventQueue now
has a convenience enqueueScrollEvent method).
- dom/EventQueue.cpp: (WebCore::EventQueue::enqueueScrollEvent): (WebCore::EventQueue::pendingEventTimerFired):
- dom/EventQueue.h:
- page/EventHandler.cpp: (WebCore::EventHandler::sendScrollEvent):
- rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollToOffset):
- rendering/RenderListBox.cpp: (WebCore::RenderListBox::valueChanged):
- Location:
- trunk
- Files:
-
- 4 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r75552 r75555 1 2011-01-11 Mihai Parparita <mihaip@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 Scroll event should be fired asynchronously 6 https://bugs.webkit.org/show_bug.cgi?id=45631 7 8 Update existing tests that assumed that scroll events fired 9 synchronously. 10 11 * editing/input/page-up-down-scrolls-expected.txt: 12 * editing/input/page-up-down-scrolls.html: 13 * fast/events/fire-scroll-event-element-expected.txt: Copied from LayoutTests/fast/events/fire-scroll-event-expected.txt. 14 * fast/events/fire-scroll-event-element.html: Added. Does the same 15 tests as fire-scroll-event.html, but on an individual element instead 16 of the whole document. 17 * fast/events/fire-scroll-event-expected.txt: 18 * fast/events/fire-scroll-event.html: Now explicitly tests for 19 synchronous behavior when scrolling the document, and that we don't 20 fire the event more than once. 21 * fast/events/remove-child-onscroll.html: 22 * fast/events/scroll-during-zoom-change.html: 23 * fast/events/scroll-event-does-not-bubble.html: 24 * fast/events/scroll-event-phase-expected.txt: Added. 25 * fast/events/scroll-event-phase.html: Added. Checks that we can listen 26 for scroll events in both the capture and bubble phase. 27 * fast/layers/removed-by-scroll-handler.html: 28 * fast/overflow/onscroll-layer-self-destruct.html: 29 * fast/repaint/repaint-during-scroll.html: 30 1 31 2011-01-11 Mihai Parparita <mihaip@chromium.org> 2 32 -
trunk/LayoutTests/editing/input/page-up-down-scrolls-expected.txt
r60591 r75555 1 1 xx 2 This test simulates hitting page up and page down once each. Both keypresses should generate exactly one scroll event. This test requires DRT to pass.2 This test simulates hitting page up and page down once each. Both keypresses should generate exactly one scroll event. If running manually, press the keys now. 3 3 PASS 4 4 (just here to force scrollbars) -
trunk/LayoutTests/editing/input/page-up-down-scrolls.html
r60591 r75555 3 3 <head> 4 4 <script> 5 if (window.layoutTestController) 5 if (window.layoutTestController) { 6 6 layoutTestController.dumpAsText(); 7 layoutTestController.waitUntilDone(); 8 } 7 9 8 function scr() 9 { 10 var step = 0; 11 12 onscroll = function() { 10 13 document.getElementById('log').innerText += 'x'; 14 15 switch (step) { 16 case 0: 17 if (window.eventSender) 18 eventSender.keyDown('pageUp'); 19 break; 20 case 1: 21 document.getElementById('results').innerText = 'PASS'; 22 if (window.layoutTestController) 23 layoutTestController.notifyDone(); 24 break; 25 } 26 27 step++; 11 28 } 12 29 13 30 function runTest() 14 31 { 15 if (!window.eventSender) 16 return; 17 18 window.addEventListener('scroll', scr, false); 19 20 eventSender.keyDown("pageDown"); 21 var text = document.getElementById('log').innerText; 22 if (text != "x") 23 throw "log should contain x, not " + text; 24 25 eventSender.keyDown("pageUp"); 26 var text = document.getElementById('log').innerText; 27 if (text != "xx") 28 throw "log should contain xx, not " + text; 29 30 document.getElementById("results").innerText = "PASS"; 32 if (window.eventSender) 33 eventSender.keyDown('pageDown'); 31 34 } 32 35 </script> … … 34 37 <body> 35 38 <span id="log" style="position:fixed"></span> 36 <div>This test simulates hitting page up and page down once each. Both keypresses should generate exactly one scroll event. This test requires DRT to pass.</div>39 <div>This test simulates hitting page up and page down once each. Both keypresses should generate exactly one scroll event. If running manually, press the keys now.</div> 37 40 <div id="results">FAIL</div> 38 41 <div style="px">(just here to force scrollbars)</div> -
trunk/LayoutTests/fast/events/fire-scroll-event-expected.txt
r20982 r75555 1 PASSED 1 Checks that the scroll event fires on the document asychronously and only once. 2 2 3 If the word 'PASSED' does not appear above, then the test has failed. If the test fails, it means that a scroll event did not fire.3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20 a21 a22 a23 a24 a25 a26 a27 a28 a29 a30 a31 a32 a33 a34 a35 a36 a37 a38 a39 a40 a41 a42 a43 a44 a45 a46 a47 a48 a49 a50 a51 a52 a53 a54 a55 a56 a57 a58 a59 5 6 Scroll event bubbles: true 7 PASS Scroll position: (200, 200) 8 PASS successfullyParsed is true 9 10 TEST COMPLETE 11 -
trunk/LayoutTests/fast/events/fire-scroll-event.html
r20982 r75555 1 1 <html>