Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce the amount of SVGElement::updateRelativeLengthsInformation() c…
…alls https://bugs.webkit.org/show_bug.cgi?id=260971 Reviewed by Ryosuke Niwa. Reduce the amount of SVGElement::updateRelativeLengthsInformation() calls. In SVGElement::removedFromAncestor(), if `removalType.disconnectedFromDocument` was true, we would call `updateRelativeLengthsInformation(false, *this)` to remove the element from m_elementsWithRelativeLengths and from our ancestor's map. However, when SVGElement::removedFromAncestor() gets called, we know that the element either doesn't have a parent or that it's parent is not connected (I added an assertion to this effect). As a result, recursively calling `updateRelativeLengthsInformation(false, element)` on the ancestors had no effect, since the function would early return at the `!isConnected()` check. As a result, it is sufficient to clear m_elementsWithRelativeLengths in SVGElement::removedFromAncestor(), without calling `updateRelativeLengthsInformation(false, *this)` or worrying about the ancestors. * Source/WebCore/svg/SVGElement.cpp: (WebCore::SVGElement::removedFromAncestor): Canonical link: https://commits.webkit.org/267517@main
- Loading branch information