DescriptionRemove SVGUseElement helper subtreeContainsDisallowedElement
The related helper removeDisallowedElementsFromSubtree() already walks
the same subtree and checks with the same predicate[1], so letting the
removing function do all the work should not be a problem.
Also change isDisallowedElement to take a const Node&, and tighten the
type of the subtree root passed to removeDisallowedElementsFromSubtree
(it's always either a SVGSVGElement or a SVGGElement.)
Move the lengthy - and somewhat outdated - comment above
removeDisallowedElementsFromSubtree to just above its definition.
(We aim to align the current behavior to it though, so keeping it
around unchanged.)
[1] subtreeContainsDisallowedElement() was walking the Nodes of the
tree, while removeDisallowedElementsFromSubtree() walks the
Elements. Thus they did not look at the exact same set of nodes.
Since the removal took place on the smaller set though there should
be no change in behavior.
Previously we could end up walking the entire subtree looking for
something to remove (in removeDisallowedElementsFromSubtree)
eventhough we wouldn't find it (like for example a COMMENT node.)
BUG=589682
Committed: https://crrev.com/1b7b24793aceb615c9d54ae73c0cbbd7b9480622
Cr-Commit-Position: refs/heads/master@{#378993}
Patch Set 1 #
Depends on Patchset: Messages
Total messages: 11 (4 generated)
|