Add the same is<RenderBox> test to KeyframeAnimation::computeExtentOfTransformAnimation()
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Mar 2015 05:31:28 +0000 (05:31 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Mar 2015 05:31:28 +0000 (05:31 +0000)
that ImplicitAnimation::computeExtentOfTransformAnimation() has, and change the latter
to the more canonical is<RenderBox>() form.

Fixes an assertion in animations/animation-on-inline-crash.html

* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::computeExtentOfTransformAnimation):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181521 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/page/animation/ImplicitAnimation.cpp
Source/WebCore/page/animation/KeyframeAnimation.cpp

index dab385d..26b9489 100644 (file)
@@ -1,5 +1,18 @@
 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
 
+        Add the same is<RenderBox> test to KeyframeAnimation::computeExtentOfTransformAnimation()
+        that ImplicitAnimation::computeExtentOfTransformAnimation() has, and change the latter
+        to the more canonical is<RenderBox>() form.
+        
+        Fixes an assertion in animations/animation-on-inline-crash.html
+
+        * page/animation/ImplicitAnimation.cpp:
+        (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation):
+        * page/animation/KeyframeAnimation.cpp:
+        (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
+
+2015-03-15  Simon Fraser  <simon.fraser@apple.com>
+
         And another fix. Thanks to Hunseop Jeong for the fix.
 
         * html/HTMLInputElement.cpp:
index 3b2cfb8..f640940 100644 (file)
@@ -104,8 +104,8 @@ bool ImplicitAnimation::computeExtentOfTransformAnimation(LayoutRect& bounds) co
 {
     ASSERT(hasStyle());
 
-    if (!m_object->isBox())
-        return false;
+    if (!is<RenderBox>(m_object))
+        return true; // Non-boxes don't get transformed;
 
     ASSERT(m_animatingProperty == CSSPropertyWebkitTransform);
 
index bcbb758..352e8a1 100644 (file)
@@ -203,6 +203,9 @@ bool KeyframeAnimation::computeExtentOfTransformAnimation(LayoutRect& bounds) co
 {
     ASSERT(m_keyframes.containsProperty(CSSPropertyWebkitTransform));
 
+    if (!is<RenderBox>(m_object))
+        return true; // Non-boxes don't get transformed;
+
     RenderBox& box = downcast<RenderBox>(*m_object);
     FloatRect rendererBox = snapRectToDevicePixels(box.borderBoxRect(), box.document().deviceScaleFactor());