https://bugs.webkit.org/show_bug.cgi?id=192591
<rdar://problem/
34336946>
Reviewed by Dean Jackson.
Source/WebCore:
Check if the property is supposed to be animated, or has animatable features, before
attempting to calculate the current animated value.
Test: svg/animations/avoid-calculating-for-non-animating-elements.html
* svg/SVGAnimateElementBase.cpp:
(WebCore::SVGAnimateElementBase::calculateAnimatedValue):
LayoutTests:
* svg/animations/avoid-calculating-for-non-animating-elements-expected.txt: Added.
* svg/animations/avoid-calculating-for-non-animating-elements.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239090
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2018-12-11 Brent Fulgham <bfulgham@apple.com>
+
+ Don't attempt to compute animated values when there is no relevant animation
+ https://bugs.webkit.org/show_bug.cgi?id=192591
+ <rdar://problem/34336946>
+
+ Reviewed by Dean Jackson.
+
+ * svg/animations/avoid-calculating-for-non-animating-elements-expected.txt: Added.
+ * svg/animations/avoid-calculating-for-non-animating-elements.html: Added.
+
2018-12-11 Chris Dumez <cdumez@apple.com>
Unreviewed, fix typos in console log from r239087.
--- /dev/null
+The test passes if it does not crash.
+
+A certain amount of content is needed in the page to trigger the bug. A certain amount of content is needed in the page to trigger the bug. A certain amount of content is needed in the page to trigger the bug. A certain amount of content is needed in the page to trigger the bug. A certain amount of content is needed in the page to trigger the bug. A certain amount of content is needed in the page to trigger the bug. A certain amount of content is needed in the page to trigger the bug. A certain amount of content is needed in the page to trigger the bug. A certain amount of content is needed in the page to trigger the bug. A certain amount of content is needed in the page to trigger the bug. A certain amount of content is needed in the page to trigger the bug. A certain amount of content is needed in the page to trigger the bug.
+
--- /dev/null
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Test request animation value for non-animating element</title>
+ <script>
+ if (window.testRunner)
+ testRunner.dumpAsText(true);
+ </script>
+</head>
+<body>
+ <p>The test passes if it does not crash.</p>
+ <div>
+ A certain amount of content is needed in the page to trigger the bug.
+ A certain amount of content is needed in the page to trigger the bug.
+ A certain amount of content is needed in the page to trigger the bug.
+ A certain amount of content is needed in the page to trigger the bug.
+ A certain amount of content is needed in the page to trigger the bug.
+ A certain amount of content is needed in the page to trigger the bug.
+ A certain amount of content is needed in the page to trigger the bug.
+ A certain amount of content is needed in the page to trigger the bug.
+ A certain amount of content is needed in the page to trigger the bug.
+ A certain amount of content is needed in the page to trigger the bug.
+ A certain amount of content is needed in the page to trigger the bug.
+ A certain amount of content is needed in the page to trigger the bug.
+ </div>
+ <svg>
+ <textPath>
+ <animate to="1px" from="0px" attributeName="x" attributeType="XML" />
+ </textPath>
+ </svg>
+</body>
+</html>
+2018-12-11 Brent Fulgham <bfulgham@apple.com>
+
+ Don't attempt to compute animated values when there is no relevant animation
+ https://bugs.webkit.org/show_bug.cgi?id=192591
+ <rdar://problem/34336946>
+
+ Reviewed by Dean Jackson.
+
+ Check if the property is supposed to be animated, or has animatable features, before
+ attempting to calculate the current animated value.
+
+ Test: svg/animations/avoid-calculating-for-non-animating-elements.html
+
+ * svg/SVGAnimateElementBase.cpp:
+ (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
+
2018-12-11 Chris Dumez <cdumez@apple.com>
Unreviewed, fix typos in console log from r239087.
if (!targetElement)
return;
+ const QualifiedName& attributeName = this->attributeName();
+ ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement.get(), attributeName);
+
+ if (shouldApply == DontApplyAnimation)
+ return;
+
ASSERT(m_animatedPropertyType == determineAnimatedPropertyType(*targetElement));
ASSERT(percentage >= 0 && percentage <= 1);
ASSERT(m_fromType->type() == m_animatedPropertyType);
ASSERT(m_toType);
+ if (shouldApply == ApplyXMLAnimation || shouldApply == ApplyXMLandCSSAnimation) {
+ // SVG DOM animVal animation code-path.
+ if (m_animator->findAnimatedPropertiesForAttributeName(*targetElement, attributeName).isEmpty())
+ return;
+ }
+
SVGAnimateElementBase& resultAnimationElement = downcast<SVGAnimateElementBase>(*resultElement);
ASSERT(resultAnimationElement.m_animatedType);
ASSERT(resultAnimationElement.m_animatedPropertyType == m_animatedPropertyType);