haikuwebkit/LayoutTests/svg/animations/svglength-element-removed-c...

2 lines
12 B
Plaintext
Raw Permalink Normal View History

SMIL animation causes leak of the related Document (and many elements) https://bugs.webkit.org/show_bug.cgi?id=83856 <rdar://problem/11216047> Reviewed by Dean Jackson. The SVGAnimatedProperty cache was previously holding a reference to the properties it contained; said references were cleared in the SVGAnimatedProperty destructor (which was never called because there was always one remaining reference from the cache). The SVGAnimatedProperty cache now holds raw pointers instead of RefPtrs; the SVGAnimateElement now owns its own SVGAnimatedProperties, both for itself and for any <use/> instances of itself. They're cleared and destroyed within SVGAnimateElement::targetElementWillChange, at which time they're removed from the cache. SVGPropertyTearOffs now keep a reference to their SVGElement (m_contextElement) instead of their SVGAnimatedProperty; this way, there is no reference cycle, but the animated property (owned by the element) and the element itself are kept alive until the TearOff is garbage collected. Add a few tests for different parts of this patch: smil-leak-elements tests that animated elements are garbage collected properly after being removed from the page; smil-leak-element-instances and its related smil-leak-element-instances-noBaseValRef test that we don't leak instances after they're removed from the document while the original element is still alive; smil-leak-dynamically-added-element-instances tests the same thing, but adds half of the instances while the animation is in the middle of running; svglength-element-removed-crash ensures that an animated element is not freed if JavaScript code is holding a reference to an animated property wrapper. File lists left off because they're very long. Canonical link: https://commits.webkit.org/102642@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@115518 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-28 00:04:50 +00:00
PASS x = 10