Changeset 287517 in webkit


Ignore:
Timestamp:
Jan 2, 2022 8:12:37 AM (7 months ago)
Author:
graouts@webkit.org
Message:

[Web Animations] getKeyframes() should return an empty object when there are no animatable properties in @keyframes rule
https://bugs.webkit.org/show_bug.cgi?id=234793

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark a new WPT progression.

  • web-platform-tests/css/css-animations/KeyframeEffect-getKeyframes.tentative-expected.txt:

Source/WebCore:

If the keyframes for an animation result from a declarative source, let's not output any data if none of the properties
are animatable.

  • animation/KeyframeEffect.cpp:

(WebCore::KeyframeEffect::getKeyframes):

  • rendering/style/KeyframeList.cpp:

(WebCore::KeyframeList::containsAnimatableProperty const):

  • rendering/style/KeyframeList.h:
Location:
trunk
Files:
6 edited

Legend:

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

    r287509 r287517  
     12022-01-02  Antoine Quint  <graouts@webkit.org>
     2
     3        [Web Animations] getKeyframes() should return an empty object when there are no animatable properties in @keyframes rule
     4        https://bugs.webkit.org/show_bug.cgi?id=234793
     5
     6        Reviewed by Dean Jackson.
     7
     8        Mark a new WPT progression.
     9
     10        * web-platform-tests/css/css-animations/KeyframeEffect-getKeyframes.tentative-expected.txt:
     11
    1122022-01-01  Antoine Quint  <graouts@webkit.org>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/KeyframeEffect-getKeyframes.tentative-expected.txt

    r267650 r287517  
    11
    2 FAIL KeyframeEffect.getKeyframes() returns no frames for various kinds of empty enimations assert_equals: number of frames when @keyframes has empty keyframes expected 0 but got 2
     2PASS KeyframeEffect.getKeyframes() returns no frames for various kinds of empty enimations
    33PASS KeyframeEffect.getKeyframes() returns expected frames for a simple animation
    44PASS KeyframeEffect.getKeyframes() returns frames with expected easing values, when the easing comes from animation-timing-function on the element
  • trunk/Source/WebCore/ChangeLog

    r287515 r287517  
     12022-01-02  Antoine Quint  <graouts@webkit.org>
     2
     3        [Web Animations] getKeyframes() should return an empty object when there are no animatable properties in @keyframes rule
     4        https://bugs.webkit.org/show_bug.cgi?id=234793
     5
     6        Reviewed by Dean Jackson.
     7
     8        If the keyframes for an animation result from a declarative source, let's not output any data if none of the properties
     9        are animatable.
     10
     11        * animation/KeyframeEffect.cpp:
     12        (WebCore::KeyframeEffect::getKeyframes):
     13        * rendering/style/KeyframeList.cpp:
     14        (WebCore::KeyframeList::containsAnimatableProperty const):
     15        * rendering/style/KeyframeList.h:
     16
    1172022-01-02  Alan Bujtas  <zalan@apple.com>
    218
  • trunk/Source/WebCore/animation/KeyframeEffect.cpp

    r286544 r287517  
    633633
    634634    // 3. For each keyframe in keyframes perform the following steps:
    635     if (m_parsedKeyframes.isEmpty() && m_blendingKeyframesSource != BlendingKeyframesSource::WebAnimation) {
     635    if (m_parsedKeyframes.isEmpty() && m_blendingKeyframesSource != BlendingKeyframesSource::WebAnimation && m_blendingKeyframes.containsAnimatableProperty()) {
    636636        auto* target = m_target.get();
    637637        auto* renderer = this->renderer();
  • trunk/Source/WebCore/rendering/style/KeyframeList.cpp

    r284693 r287517  
    2525#include "Animation.h"
    2626#include "CSSKeyframeRule.h"
     27#include "CSSPropertyAnimation.h"
    2728#include "RenderObject.h"
    2829#include "StyleResolver.h"
     
    132133}
    133134
     135bool KeyframeList::containsAnimatableProperty() const
     136{
     137    for (auto cssPropertyId : m_properties) {
     138        if (CSSPropertyAnimation::isPropertyAnimatable(cssPropertyId))
     139            return true;
     140    }
     141    return false;
     142}
     143
    134144} // namespace WebCore
  • trunk/Source/WebCore/rendering/style/KeyframeList.h

    r285397 r287517  
    9292    bool containsProperty(CSSPropertyID prop) const { return m_properties.contains(prop); }
    9393    const HashSet<CSSPropertyID>& properties() const { return m_properties; }
    94    
     94    bool containsAnimatableProperty() const;
     95
    9596    void clear();
    9697    bool isEmpty() const { return m_keyframes.isEmpty(); }
Note: See TracChangeset for help on using the changeset viewer.