Changeset 233141 in webkit


Ignore:
Timestamp:
Jun 25, 2018 3:00:42 AM (6 years ago)
Author:
graouts@webkit.org
Message:

[Web Animations] Make imported/mozilla/css-animations/test_animation-pausing.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=183826
<rdar://problem/40997412>

Reviewed by Dean Jackson.

LayoutTests/imported/mozilla:

Mark progressions in the Mozilla CSS Animations tests.

  • css-animations/test_animation-pausing-expected.txt:

Source/WebCore:

The CSS Animations Level 2 specification defines that calling pause() on a CSSAnimation object is "sticky"
until a call to play() is made, meaning that any changes to the running state via the CSS animation-play-state
property is overridden by the stickiness of the pause() call. In this patch we add an m_stickyPaused flag which
is set in API calls to pause() and play(). While this flag is true, changes to the animation-play-state property
to the "running" value are ignored.

  • animation/CSSAnimation.cpp:

(WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
(WebCore::CSSAnimation::bindingsPlay):
(WebCore::CSSAnimation::bindingsPause):

  • animation/CSSAnimation.h:

LayoutTests:

This test now passes reliably.

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r233138 r233141  
     12018-06-25  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Make imported/mozilla/css-animations/test_animation-pausing.html pass reliably
     4        https://bugs.webkit.org/show_bug.cgi?id=183826
     5        <rdar://problem/40997412>
     6
     7        Reviewed by Dean Jackson.
     8
     9        This test now passes reliably.
     10
     11        * TestExpectations:
     12
    1132018-06-25  Zan Dobersek  <zdobersek@igalia.com>
    214
  • trunk/LayoutTests/TestExpectations

    r233099 r233141  
    19311931webkit.org/b/181888 imported/w3c/web-platform-tests/web-animations/timing-model/animation-effects/current-iteration.html [ Pass Failure ]
    19321932
    1933 webkit.org/b/183826 imported/mozilla/css-animations/test_animation-pausing.html [ Pass Failure Timeout ]
    19341933webkit.org/b/183834 imported/mozilla/css-animations/test_animation-starttime.html [ Pass Failure Timeout ]
    19351934webkit.org/b/183836 imported/mozilla/css-animations/test_animations-dynamic-changes.html [ Pass Failure Timeout ]
  • trunk/LayoutTests/imported/mozilla/ChangeLog

    r233140 r233141  
     12018-06-25  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Make imported/mozilla/css-animations/test_animation-pausing.html pass reliably
     4        https://bugs.webkit.org/show_bug.cgi?id=183826
     5        <rdar://problem/40997412>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Mark progressions in the Mozilla CSS Animations tests.
     10
     11        * css-animations/test_animation-pausing-expected.txt:
     12
    1132018-06-25  Antoine Quint  <graouts@apple.com>
    214
  • trunk/LayoutTests/imported/mozilla/css-animations/test_animation-pausing-expected.txt

    r233140 r233141  
    11
    22PASS play() overrides animation-play-state
    3 FAIL pause() overrides animation-play-state assert_equals: Paused value of margin-left is zero expected 0 but got 0.03600386157631874
     3PASS pause() overrides animation-play-state
    44PASS play() is overridden by later setting "animation-play-state: paused"
    55PASS play() flushes pending changes to animation-play-state first
  • trunk/Source/WebCore/ChangeLog

    r233140 r233141  
     12018-06-25  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Make imported/mozilla/css-animations/test_animation-pausing.html pass reliably
     4        https://bugs.webkit.org/show_bug.cgi?id=183826
     5        <rdar://problem/40997412>
     6
     7        Reviewed by Dean Jackson.
     8
     9        The CSS Animations Level 2 specification defines that calling pause() on a CSSAnimation object is "sticky"
     10        until a call to play() is made, meaning that any changes to the running state via the CSS animation-play-state
     11        property is overridden by the stickiness of the pause() call. In this patch we add an m_stickyPaused flag which
     12        is set in API calls to pause() and play(). While this flag is true, changes to the animation-play-state property
     13        to the "running" value are ignored.
     14
     15        * animation/CSSAnimation.cpp:
     16        (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
     17        (WebCore::CSSAnimation::bindingsPlay):
     18        (WebCore::CSSAnimation::bindingsPause):
     19        * animation/CSSAnimation.h:
     20
    1212018-06-25  Antoine Quint  <graouts@apple.com>
    222
  • trunk/Source/WebCore/animation/CSSAnimation.cpp

    r233051 r233141  
    9292
    9393    // Synchronize the play state
    94     if (animation.playState() == AnimationPlayState::Playing && playState() == WebAnimation::PlayState::Paused)
    95         play();
    96     else if (animation.playState() == AnimationPlayState::Paused && playState() == WebAnimation::PlayState::Running)
     94    if (animation.playState() == AnimationPlayState::Playing && playState() == WebAnimation::PlayState::Paused) {
     95        if (!m_stickyPaused)
     96            play();
     97    } else if (animation.playState() == AnimationPlayState::Paused && playState() == WebAnimation::PlayState::Running)
    9798        pause();
    9899
     
    154155{
    155156    flushPendingStyleChanges();
     157    m_stickyPaused = false;
    156158    return DeclarativeAnimation::bindingsPlay();
    157159}
     
    160162{
    161163    flushPendingStyleChanges();
     164    m_stickyPaused = true;
    162165    return DeclarativeAnimation::bindingsPause();
    163166}
  • trunk/Source/WebCore/animation/CSSAnimation.h

    r233051 r233141  
    6565    String m_animationName;
    6666    std::unique_ptr<RenderStyle> m_unanimatedStyle;
     67    bool m_stickyPaused { false };
    6768};
    6869
Note: See TracChangeset for help on using the changeset viewer.