Title: [251789] trunk/Source/WebCore
Revision
251789
Author
[email protected]
Date
2019-10-30 11:45:38 -0700 (Wed, 30 Oct 2019)

Log Message

[ Mac Debug ] (r251706) webanimations/empty-keyframes-crash.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=203588

Reviewed by Dean Jackson.

The KeyframeEffect for which the blending keyframes were generated for a CSS Transition could be applied to a different animation,
which is not a CSSTransition, which does not change the fact that we can blend the single CSS property with two fully-qualified
keyframes directly. So we can remove that assertion and simply check that we have a single CSS property instead and access the
single CSS property in the KeyframeList.

* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::setAnimatedPropertiesInStyle):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (251788 => 251789)


--- trunk/Source/WebCore/ChangeLog	2019-10-30 18:40:30 UTC (rev 251788)
+++ trunk/Source/WebCore/ChangeLog	2019-10-30 18:45:38 UTC (rev 251789)
@@ -1,3 +1,18 @@
+2019-10-30  Antoine Quint  <[email protected]>
+
+        [ Mac Debug ] (r251706) webanimations/empty-keyframes-crash.html is crashing
+        https://bugs.webkit.org/show_bug.cgi?id=203588
+
+        Reviewed by Dean Jackson.
+
+        The KeyframeEffect for which the blending keyframes were generated for a CSS Transition could be applied to a different animation,
+        which is not a CSSTransition, which does not change the fact that we can blend the single CSS property with two fully-qualified
+        keyframes directly. So we can remove that assertion and simply check that we have a single CSS property instead and access the
+        single CSS property in the KeyframeList.
+
+        * animation/KeyframeEffect.cpp:
+        (WebCore::KeyframeEffect::setAnimatedPropertiesInStyle):
+
 2019-10-30  Chris Dumez  <[email protected]>
 
         WKFrameIsDisplayingMarkupDocument() should return true after a window.open/document.write

Modified: trunk/Source/WebCore/animation/KeyframeEffect.cpp (251788 => 251789)


--- trunk/Source/WebCore/animation/KeyframeEffect.cpp	2019-10-30 18:40:30 UTC (rev 251788)
+++ trunk/Source/WebCore/animation/KeyframeEffect.cpp	2019-10-30 18:45:38 UTC (rev 251789)
@@ -1064,12 +1064,14 @@
 
 void KeyframeEffect::setAnimatedPropertiesInStyle(RenderStyle& targetStyle, double iterationProgress)
 {
+    auto& properties = m_blendingKeyframes.properties();
+
     // In the case of CSS Transitions we already know that there are only two keyframes, one where offset=0 and one where offset=1,
     // and only a single CSS property so we can simply blend based on the style available on those keyframes with the provided iteration
     // progress which already accounts for the transition's timing function.
     if (m_blendingKeyframesSource == BlendingKeyframesSource::CSSTransition) {
-        ASSERT(is<CSSTransition>(animation()));
-        CSSPropertyAnimation::blendProperties(this, downcast<CSSTransition>(animation())->property(), &targetStyle, m_blendingKeyframes[0].style(), m_blendingKeyframes[1].style(), iterationProgress);
+        ASSERT(properties.size() == 1);
+        CSSPropertyAnimation::blendProperties(this, *properties.begin(), &targetStyle, m_blendingKeyframes[0].style(), m_blendingKeyframes[1].style(), iterationProgress);
         return;
     }
 
@@ -1083,7 +1085,7 @@
     if (m_blendingKeyframes.isEmpty())
         return;
 
-    for (auto cssPropertyId : m_blendingKeyframes.properties()) {
+    for (auto cssPropertyId : properties) {
         // 1. If iteration progress is unresolved abort this procedure.
         // 2. Let target property be the longhand property for which the effect value is to be calculated.
         // 3. If animation type of the target property is not animatable abort this procedure since the effect cannot be applied.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to