Context Navigation


Changeset 75555


Ignore:
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

  • LayoutTests/ChangeLog (modified) (1 diff)
  • LayoutTests/editing/input/page-up-down-scrolls-expected.txt (modified) (1 diff)
  • LayoutTests/editing/input/page-up-down-scrolls.html (modified) (2 diffs)
  • LayoutTests/fast/events/fire-scroll-event-element-expected.txt (added)
  • LayoutTests/fast/events/fire-scroll-event-element.html (added)
  • LayoutTests/fast/events/fire-scroll-event-expected.txt (modified) (1 diff)
  • LayoutTests/fast/events/fire-scroll-event.html (modified) (1 diff)
  • LayoutTests/fast/events/remove-child-onscroll.html (modified) (2 diffs)
  • LayoutTests/fast/events/scroll-during-zoom-change.html (modified) (2 diffs)
  • LayoutTests/fast/events/scroll-event-does-not-bubble.html (modified) (2 diffs)
  • LayoutTests/fast/events/scroll-event-phase-expected.txt (added)
  • LayoutTests/fast/events/scroll-event-phase.html (added)
  • LayoutTests/fast/layers/removed-by-scroll-handler.html (modified) (2 diffs)
  • LayoutTests/fast/overflow/onscroll-layer-self-destruct.html (modified) (2 diffs)
  • LayoutTests/fast/repaint/repaint-during-scroll.html (modified) (2 diffs)
  • Source/WebCore/ChangeLog (modified) (1 diff)
  • Source/WebCore/dom/EventQueue.cpp (modified) (2 diffs)
  • Source/WebCore/dom/EventQueue.h (modified) (3 diffs)
  • Source/WebCore/page/EventHandler.cpp (modified) (2 diffs)
  • Source/WebCore/rendering/RenderLayer.cpp (modified) (2 diffs)
  • Source/WebCore/rendering/RenderListBox.cpp (modified) (2 diffs)

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r75552 r75555  
     12011-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 
    1312011-01-11  Mihai Parparita  <mihaip@chromium.org> 
    232 
  • trunk/LayoutTests/editing/input/page-up-down-scrolls-expected.txt

    r60591 r75555  
    11xx 
    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. 
     2This 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. 
    33PASS 
    44(just here to force scrollbars) 
  • trunk/LayoutTests/editing/input/page-up-down-scrolls.html

    r60591 r75555  
    33<head> 
    44<script> 
    5 if (window.layoutTestController) 
     5if (window.layoutTestController) { 
    66    layoutTestController.dumpAsText(); 
     7    layoutTestController.waitUntilDone(); 
     8} 
    79 
    8 function scr() 
    9 { 
     10var step = 0; 
     11 
     12onscroll = function() { 
    1013    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++; 
    1128} 
    1229 
    1330function runTest() 
    1431{ 
    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'); 
    3134} 
    3235</script> 
     
    3437<body> 
    3538<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> 
    3740<div id="results">FAIL</div> 
    3841<div style="px">(just here to force scrollbars)</div>  
  • trunk/LayoutTests/fast/events/fire-scroll-event-expected.txt

    r20982 r75555  
    1 PASSED 
     1Checks that the scroll event fires on the document asychronously and only once. 
    22 
    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. 
     3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 
    44 
    5 a 
    6 a 
    7 a 
    8 a 
    9 a 
    10 a 
    11 a 
    12 a 
    13 a 
    14 a 
    15 a 
    16 a 
    17 a 
    18 a 
    19 a 
    20 a 
    21 a 
    22 a 
    23 a 
    24 a 
    25 a 
    26 a 
    27 a 
    28 a 
    29 a 
    30 a 
    31 a 
    32 a 
    33 a 
    34 a 
    35 a 
    36 a 
    37 a 
    38 a 
    39 a 
    40 a 
    41 a 
    42 a 
    43 a 
    44 a 
    45 a 
    46 a 
    47 a 
    48 a 
    49 a 
    50 a 
    51 a 
    52 a 
    53 a 
    54 a 
    55 a 
    56 a 
    57 a 
    58 a 
    595 
     6Scroll event bubbles: true 
     7PASS Scroll position: (200, 200) 
     8PASS successfullyParsed is true 
     9 
     10TEST COMPLETE 
     11 
  • trunk/LayoutTests/fast/events/fire-scroll-event.html

    r20982 r75555  
    11<html> 
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.