WebKit Bugzilla
Attachment 357072 Details for
Bug 192591
: Don't attempt to compute animated values when there is no relevant animation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192591-20181211132625.patch (text/plain), 6.25 KB, created by
Brent Fulgham
on 2018-12-11 13:26:25 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Brent Fulgham
Created:
2018-12-11 13:26:25 PST
Size:
6.25 KB
patch
obsolete
>Subversion Revision: 239073 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 6bc33384e05e35cfba4b62827b51ac87e0f8d606..0a1d2fbe59bc780e54dd26bbc7d0108a90d8b093 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+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 NOBODY (OOPS!). >+ >+ 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-10 Brent Fulgham <bfulgham@apple.com> > > SVGViewSpec objects should mark relevant SVG elements >diff --git a/Source/WebCore/svg/SVGAnimateElementBase.cpp b/Source/WebCore/svg/SVGAnimateElementBase.cpp >index 2a7e079755fe22f1bffd9109d71df07d50d20df0..a4a24faf871504c1d73c3bf20ffd3edc6b6de84d 100644 >--- a/Source/WebCore/svg/SVGAnimateElementBase.cpp >+++ b/Source/WebCore/svg/SVGAnimateElementBase.cpp >@@ -91,6 +91,12 @@ void SVGAnimateElementBase::calculateAnimatedValue(float percentage, unsigned re > 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); >@@ -102,6 +108,12 @@ void SVGAnimateElementBase::calculateAnimatedValue(float percentage, unsigned re > 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); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 9bfefe1ff268380444c6541d6d5d6cffb53aab7d..4f6b081c11ca671576c033a7476102cd9794d600 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+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 NOBODY (OOPS!). >+ >+ * svg/animations/avoid-calculating-for-non-animating-elements-expected.txt: Added. >+ * svg/animations/avoid-calculating-for-non-animating-elements.html: Added. >+ > 2018-12-10 Brent Fulgham <bfulgham@apple.com> > > SVGViewSpec objects should mark relevant SVG elements >diff --git a/LayoutTests/svg/animations/avoid-calculating-for-non-animating-elements-expected.txt b/LayoutTests/svg/animations/avoid-calculating-for-non-animating-elements-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..ee5be92eb9b937e6142589ec894502f85bb7c0ab >--- /dev/null >+++ b/LayoutTests/svg/animations/avoid-calculating-for-non-animating-elements-expected.txt >@@ -0,0 +1,4 @@ >+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. >+ >diff --git a/LayoutTests/svg/animations/avoid-calculating-for-non-animating-elements.html b/LayoutTests/svg/animations/avoid-calculating-for-non-animating-elements.html >new file mode 100644 >index 0000000000000000000000000000000000000000..9d0b0f8f818c884ce5a994be4e847f088d6f2ddf >--- /dev/null >+++ b/LayoutTests/svg/animations/avoid-calculating-for-non-animating-elements.html >@@ -0,0 +1,32 @@ >+<!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>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192591
:
357052
| 357072