Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (233665 => 233666)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2018-07-09 23:46:26 UTC (rev 233665)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2018-07-09 23:48:52 UTC (rev 233666)
@@ -1,3 +1,18 @@
+2018-07-09 Antoine Quint <[email protected]>
+
+ [Web Animations] Support overlapping keyframes
+ https://bugs.webkit.org/show_bug.cgi?id=187481
+ <rdar://problem/41988674>
+
+ Reviewed by Dean Jackson.
+
+ 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:
+
2018-07-09 Youenn Fablet <[email protected]>
StringView operator==(char*) should check the length of the string
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-overlapping-keyframes-expected.txt (233665 => 233666)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-overlapping-keyframes-expected.txt 2018-07-09 23:46:26 UTC (rev 233665)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-overlapping-keyframes-expected.txt 2018-07-09 23:48:52 UTC (rev 233666)
@@ -1,4 +1,4 @@
-FAIL Overlapping keyframes at 0 and 1 use the appropriate value when the progress is outside the range [0, 1] Type error
-FAIL Overlapping keyframes between 0 and 1 use the appropriate value on each side of the overlap point Type error
+FAIL 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"
+FAIL 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"
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/animate-expected.txt (233665 => 233666)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/animate-expected.txt 2018-07-09 23:46:26 UTC (rev 233665)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/animate-expected.txt 2018-07-09 23:48:52 UTC (rev 233666)
@@ -54,9 +54,9 @@
PASS Element.animate() accepts a one property two keyframe sequence that needs to stringify its values
PASS Element.animate() accepts a keyframe sequence with a CSS variable reference
PASS Element.animate() accepts a keyframe sequence with a CSS variable reference in a shorthand property
-FAIL Element.animate() accepts a keyframe sequence with duplicate values for a given interior offset Type error
-FAIL Element.animate() accepts a keyframe sequence with duplicate values for offsets 0 and 1 Type error
-FAIL Element.animate() accepts a two property four keyframe sequence Type error
+PASS Element.animate() accepts a keyframe sequence with duplicate values for a given interior offset
+PASS Element.animate() accepts a keyframe sequence with duplicate values for offsets 0 and 1
+PASS Element.animate() accepts a two property four keyframe sequence
PASS Element.animate() accepts a single keyframe sequence with omitted offset
PASS Element.animate() accepts a single keyframe sequence with null offset
PASS Element.animate() accepts a single keyframe sequence with string offset
@@ -64,8 +64,8 @@
PASS Element.animate() accepts a one property keyframe sequence with some null offsets
PASS Element.animate() accepts a two property keyframe sequence with some omitted offsets
PASS Element.animate() accepts a one property keyframe sequence with all omitted offsets
-FAIL Element.animate() accepts a keyframe sequence with different easing values, but the same easing value for a given offset Type error
-FAIL Element.animate() accepts a keyframe sequence with different composite values, but the same composite value for a given offset Type error
+PASS Element.animate() accepts a keyframe sequence with different easing values, but the same easing value for a given offset
+PASS Element.animate() accepts a keyframe sequence with different composite values, but the same composite value for a given offset
PASS Element.animate() does not accept keyframes with an out-of-bounded positive offset
PASS Element.animate() does not accept keyframes with an out-of-bounded negative offset
PASS Element.animate() does not accept property-indexed keyframes not loosely sorted by offset
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/KeyframeEffect/constructor-expected.txt (233665 => 233666)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/KeyframeEffect/constructor-expected.txt 2018-07-09 23:46:26 UTC (rev 233665)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/KeyframeEffect/constructor-expected.txt 2018-07-09 23:48:52 UTC (rev 233666)
@@ -99,12 +99,12 @@
PASS A KeyframeEffectReadOnly constructed with a keyframe sequence with a CSS variable reference roundtrips
PASS A KeyframeEffectReadOnly can be constructed with a keyframe sequence with a CSS variable reference in a shorthand property
PASS A KeyframeEffectReadOnly constructed with a keyframe sequence with a CSS variable reference in a shorthand property roundtrips
-FAIL A KeyframeEffectReadOnly can be constructed with a keyframe sequence with duplicate values for a given interior offset Type error
-FAIL A KeyframeEffectReadOnly constructed with a keyframe sequence with duplicate values for a given interior offset roundtrips Type error
-FAIL A KeyframeEffectReadOnly can be constructed with a keyframe sequence with duplicate values for offsets 0 and 1 Type error
-FAIL A KeyframeEffectReadOnly constructed with a keyframe sequence with duplicate values for offsets 0 and 1 roundtrips Type error
-FAIL A KeyframeEffectReadOnly can be constructed with a two property four keyframe sequence Type error
-FAIL A KeyframeEffectReadOnly constructed with a two property four keyframe sequence roundtrips Type error
+PASS A KeyframeEffectReadOnly can be constructed with a keyframe sequence with duplicate values for a given interior offset
+PASS A KeyframeEffectReadOnly constructed with a keyframe sequence with duplicate values for a given interior offset roundtrips
+PASS A KeyframeEffectReadOnly can be constructed with a keyframe sequence with duplicate values for offsets 0 and 1
+PASS A KeyframeEffectReadOnly constructed with a keyframe sequence with duplicate values for offsets 0 and 1 roundtrips
+PASS A KeyframeEffectReadOnly can be constructed with a two property four keyframe sequence
+PASS A KeyframeEffectReadOnly constructed with a two property four keyframe sequence roundtrips
PASS A KeyframeEffectReadOnly can be constructed with a single keyframe sequence with omitted offset
PASS A KeyframeEffectReadOnly constructed with a single keyframe sequence with omitted offset roundtrips
PASS A KeyframeEffectReadOnly can be constructed with a single keyframe sequence with null offset
@@ -119,10 +119,10 @@
PASS A KeyframeEffectReadOnly constructed with a two property keyframe sequence with some omitted offsets roundtrips
PASS A KeyframeEffectReadOnly can be constructed with a one property keyframe sequence with all omitted offsets
PASS A KeyframeEffectReadOnly constructed with a one property keyframe sequence with all omitted offsets roundtrips
-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
-FAIL A KeyframeEffectReadOnly constructed with a keyframe sequence with different easing values, but the same easing value for a given offset roundtrips Type error
-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
-FAIL A KeyframeEffectReadOnly constructed with a keyframe sequence with different composite values, but the same composite value for a given offset roundtrips Type error
+PASS A KeyframeEffectReadOnly can be constructed with a keyframe sequence with different easing values, but the same easing value for a given offset
+PASS A KeyframeEffectReadOnly constructed with a keyframe sequence with different easing values, but the same easing value for a given offset roundtrips
+PASS A KeyframeEffectReadOnly can be constructed with a keyframe sequence with different composite values, but the same composite value for a given offset
+PASS A KeyframeEffectReadOnly constructed with a keyframe sequence with different composite values, but the same composite value for a given offset roundtrips
PASS KeyframeEffectReadOnly constructor throws with keyframes with an out-of-bounded positive offset
PASS KeyframeEffectReadOnly constructor throws with keyframes with an out-of-bounded negative offset
PASS KeyframeEffectReadOnly constructor throws with property-indexed keyframes not loosely sorted by offset
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/KeyframeEffect/setKeyframes-expected.txt (233665 => 233666)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/KeyframeEffect/setKeyframes-expected.txt 2018-07-09 23:46:26 UTC (rev 233665)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/KeyframeEffect/setKeyframes-expected.txt 2018-07-09 23:48:52 UTC (rev 233666)
@@ -47,9 +47,9 @@
PASS Keyframes can be replaced with a one property two keyframe sequence that needs to stringify its values
PASS Keyframes can be replaced with a keyframe sequence with a CSS variable reference
PASS Keyframes can be replaced with a keyframe sequence with a CSS variable reference in a shorthand property
-FAIL Keyframes can be replaced with a keyframe sequence with duplicate values for a given interior offset Type error
-FAIL Keyframes can be replaced with a keyframe sequence with duplicate values for offsets 0 and 1 Type error
-FAIL Keyframes can be replaced with a two property four keyframe sequence Type error
+PASS Keyframes can be replaced with a keyframe sequence with duplicate values for a given interior offset
+PASS Keyframes can be replaced with a keyframe sequence with duplicate values for offsets 0 and 1
+PASS Keyframes can be replaced with a two property four keyframe sequence
PASS Keyframes can be replaced with a single keyframe sequence with omitted offset
PASS Keyframes can be replaced with a single keyframe sequence with null offset
PASS Keyframes can be replaced with a single keyframe sequence with string offset
@@ -57,8 +57,8 @@
PASS Keyframes can be replaced with a one property keyframe sequence with some null offsets
PASS Keyframes can be replaced with a two property keyframe sequence with some omitted offsets
PASS Keyframes can be replaced with a one property keyframe sequence with all omitted offsets
-FAIL Keyframes can be replaced with a keyframe sequence with different easing values, but the same easing value for a given offset Type error
-FAIL Keyframes can be replaced with a keyframe sequence with different composite values, but the same composite value for a given offset Type error
+PASS Keyframes can be replaced with a keyframe sequence with different easing values, but the same easing value for a given offset
+PASS Keyframes can be replaced with a keyframe sequence with different composite values, but the same composite value for a given offset
PASS KeyframeEffect constructor throws with keyframes with an out-of-bounded positive offset
PASS KeyframeEffect constructor throws with keyframes with an out-of-bounded negative offset
PASS KeyframeEffect constructor throws with property-indexed keyframes not loosely sorted by offset
Modified: trunk/Source/WebCore/ChangeLog (233665 => 233666)
--- trunk/Source/WebCore/ChangeLog 2018-07-09 23:46:26 UTC (rev 233665)
+++ trunk/Source/WebCore/ChangeLog 2018-07-09 23:48:52 UTC (rev 233666)
@@ -1,3 +1,21 @@
+2018-07-09 Antoine Quint <[email protected]>
+
+ [Web Animations] Support overlapping keyframes
+ https://bugs.webkit.org/show_bug.cgi?id=187481
+ <rdar://problem/41988674>
+
+ Reviewed by Dean Jackson.
+
+ 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.
+
2018-07-09 Youenn Fablet <[email protected]>
StringView operator==(char*) should check the length of the string
Modified: trunk/Source/WebCore/animation/KeyframeEffectReadOnly.cpp (233665 => 233666)
--- trunk/Source/WebCore/animation/KeyframeEffectReadOnly.cpp 2018-07-09 23:46:26 UTC (rev 233665)
+++ trunk/Source/WebCore/animation/KeyframeEffectReadOnly.cpp 2018-07-09 23:48:52 UTC (rev 233666)
@@ -138,7 +138,9 @@
size_t indexOfLastKeyframeWithNonNullOffset = 0;
for (size_t i = 1; i < keyframes.size(); ++i) {
auto& keyframe = keyframes[i];
- if (!keyframe.computedOffset)
+ // 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.
+ if (!keyframe.offset && !keyframe.computedOffset)
continue;
if (indexOfLastKeyframeWithNonNullOffset != i - 1) {
double lastNonNullOffset = keyframes[indexOfLastKeyframeWithNonNullOffset].computedOffset;
@@ -631,7 +633,7 @@
if (!keyframe.offset)
continue;
auto offset = keyframe.offset.value();
- if (offset <= lastNonNullOffset || offset < 0 || offset > 1)
+ if (offset < lastNonNullOffset || offset < 0 || offset > 1)
return Exception { TypeError };
lastNonNullOffset = offset;
}
Modified: trunk/Source/WebCore/rendering/style/KeyframeList.cpp (233665 => 233666)
--- trunk/Source/WebCore/rendering/style/KeyframeList.cpp 2018-07-09 23:46:26 UTC (rev 233665)
+++ trunk/Source/WebCore/rendering/style/KeyframeList.cpp 2018-07-09 23:48:52 UTC (rev 233666)
@@ -59,11 +59,6 @@
bool inserted = false;
size_t i = 0;
for (; i < m_keyframes.size(); ++i) {
- if (m_keyframes[i].key() == keyframe.key()) {
- ASSERT_NOT_REACHED();
- break;
- }
-
if (m_keyframes[i].key() > keyframe.key()) {
// insert before
m_keyframes.insert(i, WTFMove(keyframe));