Changeset 230594 in webkit


Ignore:
Timestamp:
Apr 12, 2018 2:23:48 PM (6 years ago)
Author:
graouts@webkit.org
Message:

[Web Animations] Only cancel declarative animations upon element removal
https://bugs.webkit.org/show_bug.cgi?id=184553

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Make some WPT tests opt into the CSS Animations and CSS Transtions as Web Animations flag.

  • web-platform-tests/web-animations/interfaces/Animation/ready.html:
  • web-platform-tests/web-animations/timing-model/animations/playing-an-animation.html:
  • web-platform-tests/web-animations/timing-model/animations/reversing-an-animation.html:

Source/WebCore:

Ensure we only call cancel() on CSSAnimation and CSSTransition objects as we might otherwise reject
the ready promise and produce spurious logging from WPT tests.

  • animation/AnimationTimeline.cpp:

(WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement):
(WebCore::AnimationTimeline::cancelAnimationsForElement): Deleted.

  • animation/AnimationTimeline.h:
  • dom/Element.cpp:

(WebCore::Element::removedFromAncestor):

  • dom/PseudoElement.cpp:

(WebCore::PseudoElement::clearHostElement):

  • rendering/updating/RenderTreeUpdater.cpp:

(WebCore::RenderTreeUpdater::tearDownRenderers):

Location:
trunk
Files:
10 edited

Legend:

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

    r230574 r230594  
     12018-04-12  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Only cancel declarative animations upon element removal
     4        https://bugs.webkit.org/show_bug.cgi?id=184553
     5
     6        Reviewed by Dean Jackson.
     7
     8        Make some WPT tests opt into the CSS Animations and CSS Transtions as Web Animations flag.
     9
     10        * web-platform-tests/web-animations/interfaces/Animation/ready.html:
     11        * web-platform-tests/web-animations/timing-model/animations/playing-an-animation.html:
     12        * web-platform-tests/web-animations/timing-model/animations/reversing-an-animation.html:
     13
    1142018-04-11  Antoine Quint  <graouts@apple.com>
    215
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animation/ready.html

    r227598 r230594  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22<meta charset=utf-8>
    33<title>Animation.ready</title>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/timing-model/animations/playing-an-animation.html

    r227598 r230594  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22<meta charset=utf-8>
    33<title>Playing an animation</title>
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/timing-model/animations/reversing-an-animation.html

    r227598 r230594  
    1 <!DOCTYPE html>
     1<!DOCTYPE html><!-- webkit-test-runner [ enableCSSAnimationsAndCSSTransitionsBackedByWebAnimations=true ] -->
    22<meta charset=utf-8>
    33<title>Reverse an animation</title>
  • trunk/Source/WebCore/ChangeLog

    r230586 r230594  
     12018-04-12  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Only cancel declarative animations upon element removal
     4        https://bugs.webkit.org/show_bug.cgi?id=184553
     5
     6        Reviewed by Dean Jackson.
     7
     8        Ensure we only call cancel() on CSSAnimation and CSSTransition objects as we might otherwise reject
     9        the ready promise and produce spurious logging from WPT tests.
     10
     11        * animation/AnimationTimeline.cpp:
     12        (WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement):
     13        (WebCore::AnimationTimeline::cancelAnimationsForElement): Deleted.
     14        * animation/AnimationTimeline.h:
     15        * dom/Element.cpp:
     16        (WebCore::Element::removedFromAncestor):
     17        * dom/PseudoElement.cpp:
     18        (WebCore::PseudoElement::clearHostElement):
     19        * rendering/updating/RenderTreeUpdater.cpp:
     20        (WebCore::RenderTreeUpdater::tearDownRenderers):
     21
    1222018-04-12  Ryan Haddad  <ryanhaddad@apple.com>
    223
  • trunk/Source/WebCore/animation/AnimationTimeline.cpp

    r230578 r230594  
    128128}
    129129
    130 void AnimationTimeline::cancelAnimationsForElement(Element& element)
    131 {
    132     for (const auto& animation : animationsForElement(element))
    133         animation->cancel();
     130void AnimationTimeline::cancelDeclarativeAnimationsForElement(Element& element)
     131{
     132    for (const auto& animation : animationsForElement(element)) {
     133        if (is<DeclarativeAnimation>(animation))
     134            animation->cancel();
     135    }
    134136}
    135137
  • trunk/Source/WebCore/animation/AnimationTimeline.h

    r230578 r230594  
    6060    const ListHashSet<RefPtr<WebAnimation>>& animations() const { return m_animations; }
    6161    Vector<RefPtr<WebAnimation>> animationsForElement(Element&) const;
    62     void cancelAnimationsForElement(Element&);
     62    void cancelDeclarativeAnimationsForElement(Element&);
    6363    void animationWasAddedToElement(WebAnimation&, Element&);
    6464    void animationWasRemovedFromElement(WebAnimation&, Element&);
  • trunk/Source/WebCore/dom/Element.cpp

    r230211 r230594  
    17981798    if (RuntimeEnabledFeatures::sharedFeatures().cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled()) {
    17991799        if (auto* timeline = document().existingTimeline())
    1800             timeline->cancelAnimationsForElement(*this);
     1800            timeline->cancelDeclarativeAnimationsForElement(*this);
    18011801    } else if (frame)
    18021802        frame->animation().cancelAnimations(*this);
  • trunk/Source/WebCore/dom/PseudoElement.cpp

    r229890 r230594  
    9393    if (RuntimeEnabledFeatures::sharedFeatures().cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled()) {
    9494        if (auto* timeline = document().existingTimeline())
    95             timeline->cancelAnimationsForElement(*this);
     95            timeline->cancelDeclarativeAnimationsForElement(*this);
    9696    } else if (auto* frame = document().frame())
    9797        frame->animation().cancelAnimations(*this);
  • trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp

    r229890 r230594  
    556556                if (RuntimeEnabledFeatures::sharedFeatures().cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled()) {
    557557                    if (timeline)
    558                         timeline->cancelAnimationsForElement(element);
     558                        timeline->cancelDeclarativeAnimationsForElement(element);
    559559                } else
    560560                    animationController.cancelAnimations(element);
Note: See TracChangeset for help on using the changeset viewer.