Changeset 230667 in webkit


Ignore:
Timestamp:
Apr 16, 2018 1:47:17 AM (6 years ago)
Author:
graouts@webkit.org
Message:

[Web Animations] Ensure we never return -0 through the API
https://bugs.webkit.org/show_bug.cgi?id=184644

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Record one progression in the Web Animations WPT tests.

  • web-platform-tests/web-animations/timing-model/animations/updating-the-finished-state-expected.txt:

Source/WebCore:

We could sometimes return -0 instead of 0, which is surprising and leads to an error in WPT tests.
This would happen when playbackRate < 0.

  • animation/WebAnimationUtilities.h:

(WebCore::secondsToWebAnimationsAPITime):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r230665 r230667  
     12018-04-16  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Ensure we never return -0 through the API
     4        https://bugs.webkit.org/show_bug.cgi?id=184644
     5
     6        Reviewed by Dean Jackson.
     7
     8        Record one progression in the Web Animations WPT tests.
     9
     10        * web-platform-tests/web-animations/timing-model/animations/updating-the-finished-state-expected.txt:
     11
    1122018-04-15  Antoine Quint  <graouts@apple.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/timing-model/animations/updating-the-finished-state-expected.txt

    r230665 r230667  
    55PASS Updating the finished state when playing in reverse past zero
    66PASS Updating the finished state when seeking a reversed animation past zero
    7 FAIL Updating the finished state when seeking a reversed animation exactly to zero assert_equals: Hold time is set so current time should NOT change expected 0 but got -0
     7PASS Updating the finished state when seeking a reversed animation exactly to zero
    88PASS Updating the finished state when playing before end
    99PASS Updating the finished state when seeking before end
  • trunk/Source/WebCore/ChangeLog

    r230665 r230667  
     12018-04-16  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Ensure we never return -0 through the API
     4        https://bugs.webkit.org/show_bug.cgi?id=184644
     5
     6        Reviewed by Dean Jackson.
     7
     8        We could sometimes return -0 instead of 0, which is surprising and leads to an error in WPT tests.
     9        This would happen when playbackRate < 0.
     10
     11        * animation/WebAnimationUtilities.h:
     12        (WebCore::secondsToWebAnimationsAPITime):
     13
    1142018-04-15  Antoine Quint  <graouts@apple.com>
    215
  • trunk/Source/WebCore/animation/WebAnimationUtilities.h

    r229864 r230667  
    3838    // agents be able to represent input time values with microsecond precision so that a time value (which nominally
    3939    // represents milliseconds) of 0.001 is distinguishable from 0.0.
    40     return std::round(time.microseconds()) / 1000;
     40    auto roundedTime = std::round(time.microseconds()) / 1000;
     41    if (roundedTime == -0)
     42        return 0;
     43    return roundedTime;
    4144}
    4245
Note: See TracChangeset for help on using the changeset viewer.