Changeset 95937 in webkit


Ignore:
Timestamp:
Sep 26, 2011 12:21:45 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

[mac] Timestamp parameter to requestAnimationFrame is busted in USE(REQUEST_ANIMATION_FRAME_TIMER) path
https://bugs.webkit.org/show_bug.cgi?id=68769

Patch by James Robinson <jamesr@chromium.org> on 2011-09-26
Reviewed by Simon Fraser.

Source/WebCore:

Convert the time parameter from double to DOMTimeStamp using convertSecondsToDOMTimeStamp rather than relying on
implicit double->long conversion, which ignores the units of the value.

Test: fast/animation/request-animation-frame-timestamps-advance.html

  • dom/ScriptedAnimationController.cpp:

(WebCore::ScriptedAnimationController::animationTimerFired):

LayoutTests:

Adds a test that the timestamp parameter to the requestAnimationFrame callback advances between calls.

  • fast/animation/request-animation-frame-timestamps-advance-expected.txt: Added.
  • fast/animation/request-animation-frame-timestamps-advance.html: Added.
  • fast/animation/script-tests/request-animation-frame-timestamps-advance.js: Copied from LayoutTests/fast/animation/script-tests/request-animation-frame-timestamps.js.

(busyWait):
(window.webkitRequestAnimationFrame):

  • fast/animation/script-tests/request-animation-frame-timestamps.js:

Remove the element parameter, they aren't a useful part of the test.

Location:
trunk
Files:
2 added
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r95931 r95937  
     12011-09-26  James Robinson  <jamesr@chromium.org>
     2
     3        [mac] Timestamp parameter to requestAnimationFrame is busted in USE(REQUEST_ANIMATION_FRAME_TIMER) path
     4        https://bugs.webkit.org/show_bug.cgi?id=68769
     5
     6        Reviewed by Simon Fraser.
     7
     8        Adds a test that the timestamp parameter to the requestAnimationFrame callback advances between calls.
     9
     10        * fast/animation/request-animation-frame-timestamps-advance-expected.txt: Added.
     11        * fast/animation/request-animation-frame-timestamps-advance.html: Added.
     12        * fast/animation/script-tests/request-animation-frame-timestamps-advance.js: Copied from LayoutTests/fast/animation/script-tests/request-animation-frame-timestamps.js.
     13        (busyWait):
     14        (window.webkitRequestAnimationFrame):
     15        * fast/animation/script-tests/request-animation-frame-timestamps.js:
     16            Remove the element parameter, they aren't a useful part of the test.
     17
    1182011-09-25  Kentaro Hara  <haraken@chromium.org>
    219
  • trunk/LayoutTests/fast/animation/script-tests/request-animation-frame-timestamps-advance.js

    r95936 r95937  
    1 description("Tests the timestamps provided to requestAnimationFrame callbacks");
     1description("Tests the timestamps provided to requestAnimationFrame callbacks advance");
    22
    33function busyWait(millis) {
     
    66}
    77
    8 var e = document.getElementById("e");
    98var firstTimestamp = undefined;
     9var secondTimestamp = undefined;
    1010
    1111window.webkitRequestAnimationFrame(function(timestamp) {
    1212    firstTimestamp = timestamp;
    1313    shouldBeDefined("firstTimestamp");
     14    window.webkitRequestAnimationFrame(function(timestamp) {
     15        secondTimestamp = timestamp;
     16        shouldBeDefined("secondTimestamp");
     17        shouldBeTrue("secondTimestamp > firstTimestamp");
     18        isSuccessfullyParsed();
     19        if (window.layoutTestController)
     20            layoutTestController.notifyDone();
     21    });
    1422    busyWait(10);
    15 }, e);
     23    if (window.layoutTestController)
     24        layoutTestController.display();
     25});
    1626
    17 var secondTimestamp = undefined;
    18 window.webkitRequestAnimationFrame(function(timestamp) {
    19     secondTimestamp = timestamp;
    20     shouldBeDefined("secondTimestamp");
    21     shouldBe("firstTimestamp", "secondTimestamp");
    22 }, e);
    2327
    2428if (window.layoutTestController)
    25     layoutTestController.display();
     29    window.setTimeout(function() {
     30        layoutTestController.display();
     31    });
     32
    2633
    2734if (window.layoutTestController)
    2835    layoutTestController.waitUntilDone();
    2936
    30 setTimeout(function() {
    31     shouldBeDefined("firstTimestamp");
    32 }, 100);
    33 
    3437var successfullyParsed = true;
    35 
    36 setTimeout(function() {
    37     isSuccessfullyParsed();
    38     if (window.layoutTestController)
    39         layoutTestController.notifyDone();
    40 }, 200);
  • trunk/LayoutTests/fast/animation/script-tests/request-animation-frame-timestamps.js

    r93980 r95937  
    66}
    77
    8 var e = document.getElementById("e");
    98var firstTimestamp = undefined;
    109
     
    1312    shouldBeDefined("firstTimestamp");
    1413    busyWait(10);
    15 }, e);
     14});
    1615
    1716var secondTimestamp = undefined;
     
    2019    shouldBeDefined("secondTimestamp");
    2120    shouldBe("firstTimestamp", "secondTimestamp");
    22 }, e);
     21});
    2322
    2423if (window.layoutTestController)
  • trunk/Source/WebCore/ChangeLog

    r95936 r95937  
     12011-09-26  James Robinson  <jamesr@chromium.org>
     2
     3        [mac] Timestamp parameter to requestAnimationFrame is busted in USE(REQUEST_ANIMATION_FRAME_TIMER) path
     4        https://bugs.webkit.org/show_bug.cgi?id=68769
     5
     6        Reviewed by Simon Fraser.
     7
     8        Convert the time parameter from double to DOMTimeStamp using convertSecondsToDOMTimeStamp rather than relying on
     9        implicit double->long conversion, which ignores the units of the value.
     10
     11        Test: fast/animation/request-animation-frame-timestamps-advance.html
     12
     13        * dom/ScriptedAnimationController.cpp:
     14        (WebCore::ScriptedAnimationController::animationTimerFired):
     15
    1162011-09-25  Mark Hahnenberg  <mhahnenberg@apple.com>
    217
  • trunk/Source/WebCore/dom/ScriptedAnimationController.cpp

    r95901 r95937  
    162162{
    163163    m_lastAnimationFrameTime = currentTime();
    164     serviceScriptedAnimations(m_lastAnimationFrameTime);
     164    serviceScriptedAnimations(convertSecondsToDOMTimeStamp(m_lastAnimationFrameTime));
    165165}
    166166#endif
Note: See TracChangeset for help on using the changeset viewer.