Changeset 244276 in webkit
- Timestamp:
- Apr 15, 2019 11:54:21 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r244269 r244276 1 2019-04-15 Said Abou-Hallawa <said@apple.com> 2 3 ASSERT fires when removing a disallowed clone from the shadow tree without reseting its corresponding element 4 https://bugs.webkit.org/show_bug.cgi?id=196895 5 6 Reviewed by Darin Adler. 7 8 * svg/custom/use-disallowed-element-clear-corresponding-element-expected.txt: Added. 9 * svg/custom/use-disallowed-element-clear-corresponding-element.html: Added. 10 1 11 2019-04-15 Devin Rousso <drousso@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r244269 r244276 1 2019-04-15 Said Abou-Hallawa <said@apple.com> 2 3 ASSERT fires when removing a disallowed clone from the shadow tree without reseting its corresponding element 4 https://bugs.webkit.org/show_bug.cgi?id=196895 5 6 Reviewed by Darin Adler. 7 8 When cloning elements to the shadow tree of an SVGUseElement, the 9 corresponding element links are set from the clones to the originals. 10 Later some of the elements may be disallowed to exist in the shadow tree. 11 For example the SVGPatternElement is disallowed and has to be removed 12 even after cloning. The problem is the corresponding elements are not 13 reset to null. Usually this is not a problem because the removed elements 14 will be deleted and the destructor of SVGElement will reset the corresponding 15 element links. However in some cases, the cloned element is referenced 16 from another SVGElement, for example the target of a SVGTRefElement. In 17 this case the clone won't be deleted but it will be linked to the original 18 and the event listeners won't be copied from the original. When the 19 original is deleted, its event listeners have to be removed. The event 20 listeners of the clones also ave to be removed. But because the event 21 listeners of the original were not copied when cloning, the assertion in 22 SVGElement::removeEventListener() fires. 23 24 Test: svg/custom/use-disallowed-element-clear-corresponding-element.html 25 26 * svg/SVGUseElement.cpp: 27 (WebCore::disassociateAndRemoveClones): 28 1 29 2019-04-15 Devin Rousso <drousso@apple.com> 2 30 -
trunk/Source/WebCore/svg/SVGUseElement.cpp
r243515 r244276 322 322 for (auto& descendant : descendantsOfType<SVGElement>(*clone)) 323 323 descendant.setCorrespondingElement(nullptr); 324 if (is<SVGElement>(clone)) 325 downcast<SVGElement>(*clone).setCorrespondingElement(nullptr); 324 326 clone->parentNode()->removeChild(*clone); 325 327 }
Note: See TracChangeset
for help on using the changeset viewer.