Changeset 233666 in webkit


Ignore:
Timestamp:
Jul 9, 2018 4:48:52 PM (6 years ago)
Author:
graouts@webkit.org
Message:

[Web Animations] Support overlapping keyframes
https://bugs.webkit.org/show_bug.cgi?id=187481
<rdar://problem/41988674>

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark 20 new WPT progressions and 2 different failures.

  • web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-overlapping-keyframes-expected.txt:
  • web-platform-tests/web-animations/interfaces/Animatable/animate-expected.txt:
  • web-platform-tests/web-animations/interfaces/KeyframeEffect/constructor-expected.txt:
  • web-platform-tests/web-animations/interfaces/KeyframeEffect/setKeyframes-expected.txt:

Source/WebCore:

We now support parsing of multiple keyframes for the same offset.

  • animation/KeyframeEffectReadOnly.cpp:

(WebCore::computeMissingKeyframeOffsets): Keyframes with a null offset that don't yet have a non-zero
computed offset are keyframes with an offset that needs to be computed.
(WebCore::KeyframeEffectReadOnly::processKeyframes): Only file an exception if an offset is found that
is lower than a previously-parsed one, allowing offsets with the same value.

  • rendering/style/KeyframeList.cpp:

(WebCore::KeyframeList::insert): Remove the assertion that prevented an offset to be found more than once.

Location:
trunk
Files:
8 edited

Legend:

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

    r233660 r233666  
     12018-07-09  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Support overlapping keyframes
     4        https://bugs.webkit.org/show_bug.cgi?id=187481
     5        <rdar://problem/41988674>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Mark 20 new WPT progressions and 2 different failures.
     10
     11        * web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-overlapping-keyframes-expected.txt:
     12        * web-platform-tests/web-animations/interfaces/Animatable/animate-expected.txt:
     13        * web-platform-tests/web-animations/interfaces/KeyframeEffect/constructor-expected.txt:
     14        * web-platform-tests/web-animations/interfaces/KeyframeEffect/setKeyframes-expected.txt:
     15
    1162018-07-09  Youenn Fablet  <youenn@apple.com>
    217
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-overlapping-keyframes-expected.txt

    r227598 r233666  
    11
    2 FAIL Overlapping keyframes at 0 and 1 use the appropriate value when the progress is outside the range [0, 1] Type error
    3 FAIL Overlapping keyframes between 0 and 1 use the appropriate value on each side of the overlap point Type error
     2FAIL Overlapping keyframes at 0 and 1 use the appropriate value when the progress is outside the range [0, 1] assert_equals: When progress is zero the last keyframe with offset 0 should be used expected "0.2" but got "0.20000000298023224"
     3FAIL Overlapping keyframes between 0 and 1 use the appropriate value on each side of the overlap point assert_equals: Before the overlap point, the first keyframe from the overlap point should be used as interval endpoint expected "0.15" but got "0.15000000596046448"
    44
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/animate-expected.txt

    r233632 r233666  
    5555PASS Element.animate() accepts a keyframe sequence with a CSS variable reference
    5656PASS Element.animate() accepts a keyframe sequence with a CSS variable reference in a shorthand property
    57 FAIL Element.animate() accepts a keyframe sequence with duplicate values for a given interior offset Type error
    58 FAIL Element.animate() accepts a keyframe sequence with duplicate values for offsets 0 and 1 Type error
    59 FAIL Element.animate() accepts a two property four keyframe sequence Type error
     57PASS Element.animate() accepts a keyframe sequence with duplicate values for a given interior offset
     58PASS Element.animate() accepts a keyframe sequence with duplicate values for offsets 0 and 1
     59PASS Element.animate() accepts a two property four keyframe sequence
    6060PASS Element.animate() accepts a single keyframe sequence with omitted offset
    6161PASS Element.animate() accepts a single keyframe sequence with null offset
     
    6565PASS Element.animate() accepts a two property keyframe sequence with some omitted offsets
    6666PASS Element.animate() accepts a one property keyframe sequence with all omitted offsets
    67 FAIL Element.animate() accepts a keyframe sequence with different easing values, but the same easing value for a given offset Type error
    68 FAIL Element.animate() accepts a keyframe sequence with different composite values, but the same composite value for a given offset Type error
     67PASS Element.animate() accepts a keyframe sequence with different easing values, but the same easing value for a given offset
     68PASS Element.animate() accepts a keyframe sequence with different composite values, but the same composite value for a given offset
    6969PASS Element.animate() does not accept keyframes with an out-of-bounded positive offset
    7070PASS Element.animate() does not accept keyframes with an out-of-bounded negative offset
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/KeyframeEffect/constructor-expected.txt

    r233632 r233666  
    100100PASS A KeyframeEffectReadOnly can be constructed with a keyframe sequence with a CSS variable reference in a shorthand property
    101101PASS A KeyframeEffectReadOnly constructed with a keyframe sequence with a CSS variable reference in a shorthand property roundtrips
    102 FAIL A KeyframeEffectReadOnly can be constructed with a keyframe sequence with duplicate values for a given interior offset Type error
    103 FAIL A KeyframeEffectReadOnly constructed with a keyframe sequence with duplicate values for a given interior offset roundtrips Type error
    104 FAIL A KeyframeEffectReadOnly can be constructed with a keyframe sequence with duplicate values for offsets 0 and 1 Type error
    105 FAIL A KeyframeEffectReadOnly constructed with a keyframe sequence with duplicate values for offsets 0 and 1 roundtrips Type error
    106 FAIL A KeyframeEffectReadOnly can be constructed with a two property four keyframe sequence Type error
    107 FAIL A KeyframeEffectReadOnly constructed with a two property four keyframe sequence roundtrips Type error
     102PASS A KeyframeEffectReadOnly can be constructed with a keyframe sequence with duplicate values for a given interior offset
     103PASS A KeyframeEffectReadOnly constructed with a keyframe sequence with duplicate values for a given interior offset roundtrips
     104PASS A KeyframeEffectReadOnly can be constructed with a keyframe sequence with duplicate values for offsets 0 and 1
     105PASS A KeyframeEffectReadOnly constructed with a keyframe sequence with duplicate values for offsets 0 and 1 roundtrips
     106PASS A KeyframeEffectReadOnly can be constructed with a two property four keyframe sequence
     107PASS A KeyframeEffectReadOnly constructed with a two property four keyframe sequence roundtrips
    108108PASS A KeyframeEffectReadOnly can be constructed with a single keyframe sequence with omitted offset
    109109PASS A KeyframeEffectReadOnly constructed with a single keyframe sequence with omitted offset roundtrips
     
    120120PASS A KeyframeEffectReadOnly can be constructed with a one property keyframe sequence with all omitted offsets
    121121PASS A KeyframeEffectReadOnly constructed with a one property keyframe sequence with all omitted offsets roundtrips
    122 FAIL A KeyframeEffectReadOnly can be constructed with a keyframe sequence with different easing values, but the same easing value for a given offset Type error
    123 FAIL A KeyframeEffectReadOnly constructed with a keyframe sequence with different easing values, but the same easing value for a given offset roundtrips Type error
    124 FAIL A KeyframeEffectReadOnly can be constructed with a keyframe sequence with different composite values, but the same composite value for a given offset Type error
    125 FAIL A KeyframeEffectReadOnly constructed with a keyframe sequence with different composite values, but the same composite value for a given offset roundtrips Type error
     122PASS A KeyframeEffectReadOnly can be constructed with a keyframe sequence with different easing values, but the same easing value for a given offset
     123PASS A KeyframeEffectReadOnly constructed with a keyframe sequence with different easing values, but the same easing value for a given offset roundtrips
     124PASS A KeyframeEffectReadOnly can be constructed with a keyframe sequence with different composite values, but the same composite value for a given offset
     125PASS A KeyframeEffectReadOnly constructed with a keyframe sequence with different composite values, but the same composite value for a given offset roundtrips
    126126PASS KeyframeEffectReadOnly constructor throws with keyframes with an out-of-bounded positive offset
    127127PASS KeyframeEffectReadOnly constructor throws with keyframes with an out-of-bounded negative offset
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/KeyframeEffect/setKeyframes-expected.txt

    r233632 r233666  
    4848PASS Keyframes can be replaced with a keyframe sequence with a CSS variable reference
    4949PASS Keyframes can be replaced with a keyframe sequence with a CSS variable reference in a shorthand property
    50 FAIL Keyframes can be replaced with a keyframe sequence with duplicate values for a given interior offset Type error
    51 FAIL Keyframes can be replaced with a keyframe sequence with duplicate values for offsets 0 and 1 Type error
    52 FAIL Keyframes can be replaced with a two property four keyframe sequence Type error
     50PASS Keyframes can be replaced with a keyframe sequence with duplicate values for a given interior offset
     51PASS Keyframes can be replaced with a keyframe sequence with duplicate values for offsets 0 and 1
     52PASS Keyframes can be replaced with a two property four keyframe sequence
    5353PASS Keyframes can be replaced with a single keyframe sequence with omitted offset
    5454PASS Keyframes can be replaced with a single keyframe sequence with null offset
     
    5858PASS Keyframes can be replaced with a two property keyframe sequence with some omitted offsets
    5959PASS Keyframes can be replaced with a one property keyframe sequence with all omitted offsets
    60 FAIL Keyframes can be replaced with a keyframe sequence with different easing values, but the same easing value for a given offset Type error
    61 FAIL Keyframes can be replaced with a keyframe sequence with different composite values, but the same composite value for a given offset Type error
     60PASS Keyframes can be replaced with a keyframe sequence with different easing values, but the same easing value for a given offset
     61PASS Keyframes can be replaced with a keyframe sequence with different composite values, but the same composite value for a given offset
    6262PASS KeyframeEffect constructor throws with keyframes with an out-of-bounded positive offset
    6363PASS KeyframeEffect constructor throws with keyframes with an out-of-bounded negative offset
  • trunk/Source/WebCore/ChangeLog

    r233660 r233666  
     12018-07-09  Antoine Quint  <graouts@apple.com>
     2
     3        [Web Animations] Support overlapping keyframes
     4        https://bugs.webkit.org/show_bug.cgi?id=187481
     5        <rdar://problem/41988674>
     6
     7        Reviewed by Dean Jackson.
     8
     9        We now support parsing of multiple keyframes for the same offset.
     10
     11        * animation/KeyframeEffectReadOnly.cpp:
     12        (WebCore::computeMissingKeyframeOffsets): Keyframes with a null offset that don't yet have a non-zero
     13        computed offset are keyframes with an offset that needs to be computed.
     14        (WebCore::KeyframeEffectReadOnly::processKeyframes): Only file an exception if an offset is found that
     15        is lower than a previously-parsed one, allowing offsets with the same value.
     16        * rendering/style/KeyframeList.cpp:
     17        (WebCore::KeyframeList::insert): Remove the assertion that prevented an offset to be found more than once.
     18
    1192018-07-09  Youenn Fablet  <youenn@apple.com>
    220
  • trunk/Source/WebCore/animation/KeyframeEffectReadOnly.cpp

    r233632 r233666  
    139139    for (size_t i = 1; i < keyframes.size(); ++i) {
    140140        auto& keyframe = keyframes[i];
    141         if (!keyframe.computedOffset)
     141        // Keyframes with a null offset that don't yet have a non-zero computed offset are keyframes
     142        // with an offset that needs to be computed.
     143        if (!keyframe.offset && !keyframe.computedOffset)
    142144            continue;
    143145        if (indexOfLastKeyframeWithNonNullOffset != i - 1) {
     
    632634            continue;
    633635        auto offset = keyframe.offset.value();
    634         if (offset <= lastNonNullOffset || offset < 0 || offset > 1)
     636        if (offset < lastNonNullOffset || offset < 0 || offset > 1)
    635637            return Exception { TypeError };
    636638        lastNonNullOffset = offset;
  • trunk/Source/WebCore/rendering/style/KeyframeList.cpp

    r230100 r233666  
    6060    size_t i = 0;
    6161    for (; i < m_keyframes.size(); ++i) {
    62         if (m_keyframes[i].key() == keyframe.key()) {
    63             ASSERT_NOT_REACHED();
    64             break;
    65         }
    66 
    6762        if (m_keyframes[i].key() > keyframe.key()) {
    6863            // insert before
Note: See TracChangeset for help on using the changeset viewer.