Commit c2822b4a authored by kouhei@chromium.org's avatar kouhei@chromium.org

SVG: no need to call |clearAnimatedType| at SVGAnimate{,Motion}Element dtor.

The deleted code was used to ensure the ASSERT(!isAnimating()) on ~SVGAnimatedProperty.
The assert checks that animation is always stopped when the element is dead. However, the assert is removed now, so we don't need to ensure it.

The deleted code |clearAnimatedType| in ~SVGAnimateElement was triggered when a document was unloaded and its <animate> element was destructed before its target svg element. This stopped animation on the target svg elements before the ASSERT run.

BUG=370834

Review URL: https://codereview.chromium.org/327463002

git-svn-id: svn://svn.chromium.org/blink/trunk@175989 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent f8a98672
Test passes if unloading this document does not fail ASSERTs on debug builds.
<!DOCTYPE html>
<svg>
<!-- animate element is destructed before rect elements -->
<animate xlink:href="#rect" attributeName="x" attributeType="XML" begin="0s" dur="10s" fill="freeze" from="0" to="100" />
<g id="usetarget">
<rect id="rect" x="10" y="10" width="10" height="10" fill="red"></rect>
</g>
<use xlink:href="#usetarget"></use>
</svg>
<p>Test passes if unloading this document does not fail ASSERTs on debug builds.</p>
<script>
// This test doesn't use js-test.js to avoid unexpected DOM references.
if (window.testRunner)
testRunner.dumpAsText();
</script>
...@@ -47,11 +47,6 @@ PassRefPtrWillBeRawPtr<SVGAnimateElement> SVGAnimateElement::create(Document& do ...@@ -47,11 +47,6 @@ PassRefPtrWillBeRawPtr<SVGAnimateElement> SVGAnimateElement::create(Document& do
SVGAnimateElement::~SVGAnimateElement() SVGAnimateElement::~SVGAnimateElement()
{ {
// FIXME: Oilpan: Below prevent stopAnimValAnimation being called on |targetElement|. This should be moved to |removeFrom| equivalent.
#if !ENABLE(OILPAN)
if (targetElement())
clearAnimatedType(targetElement());
#endif
} }
AnimatedPropertyType SVGAnimateElement::animatedPropertyType() AnimatedPropertyType SVGAnimateElement::animatedPropertyType()
......
...@@ -51,11 +51,6 @@ DEFINE_NODE_FACTORY(SVGAnimateMotionElement) ...@@ -51,11 +51,6 @@ DEFINE_NODE_FACTORY(SVGAnimateMotionElement)
SVGAnimateMotionElement::~SVGAnimateMotionElement() SVGAnimateMotionElement::~SVGAnimateMotionElement()
{ {
// FIXME: Oilpan: We should not comment this out and this should be moved to |removeFrom| equivalent.
#if !ENABLE(OILPAN)
if (targetElement())
clearAnimatedType(targetElement());
#endif
} }
bool SVGAnimateMotionElement::hasValidAttributeType() bool SVGAnimateMotionElement::hasValidAttributeType()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment