haikuwebkit/LayoutTests/webanimations/leak-css-animation-expected...

11 lines
289 B
Plaintext
Raw Permalink Normal View History

DocumentTimeline / CSSTransition objects are leaking on CNN.com https://bugs.webkit.org/show_bug.cgi?id=208069 <rdar://problem/59680143> Reviewed by Simon Fraser, Geoffrey Garen and Darin Adler. Source/WebCore: Test: webanimations/leak-css-animation.html We add a test feature that lets use query the availability of a given WebAnimation by its "id" property in the WebAnimation::instances list. We also fix some build issues that appeared with a change in UnifiedSources order. * animation/ElementAnimationRareData.cpp: (WebCore::ElementAnimationRareData::setAnimationsCreatedByMarkup): * animation/ElementAnimationRareData.h: (WebCore::ElementAnimationRareData::setAnimationsCreatedByMarkup): Deleted. * animation/WebAnimation.h: * testing/Internals.cpp: (WebCore::Internals::animationWithIdExists const): * testing/Internals.h: * testing/Internals.idl: Source/WTF: If a CSSAnimation is set on an element using the `animation-name` CSS property, and later removed, it will leak due to the ListHashSet<RefPtr<CSSAnimation>> (aka CSSAnimationCollection) member on ElementAnimationRareData being replaced to the new list, but the old list not being cleared from its members. We fix the ListHashSet assignment operator to use swap ensuring previously held items are cleared. * wtf/ListHashSet.h: (WTF::=): Tools: Add a test that checks that a ListHashSet containing RefPtr<> types correctly calls the destructor for those items when the assignment operator is used. * TestWebKitAPI/Tests/WTF/ListHashSet.cpp: (TestWebKitAPI::ListHashSetReferencedItem::create): (TestWebKitAPI::ListHashSetReferencedItem::ListHashSetReferencedItem): (TestWebKitAPI::ListHashSetReferencedItem::~ListHashSetReferencedItem): (TestWebKitAPI::FakeElementAnimationRareData::FakeElementAnimationRareData): (TestWebKitAPI::FakeElementAnimationRareData::~FakeElementAnimationRareData): (TestWebKitAPI::FakeElementAnimationRareData::collection): (TestWebKitAPI::FakeElementAnimationRareData::setCollection): (TestWebKitAPI::TEST): LayoutTests: Add a test that checks that setting a CSSAnimation on an element, waiting a frame, and removing it will not leak that CSSAnimation. * webanimations/leak-css-animation-expected.txt: Added. * webanimations/leak-css-animation.html: Added. * webanimations/resources/css-animation-leak-iframe.html: Added. Canonical link: https://commits.webkit.org/222331@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258826 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-23 08:17:26 +00:00
This test asserts that a CSSAnimation doesn't leak after it was removed declaratively and the document was replaced.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS The CSS animation was destroyed.
PASS successfullyParsed is true
TEST COMPLETE