DescriptionImprove handling of duplicate id's for SVG resources
This CL attempts to fix the known issues with duplicate id's and SVG
resources. There are a variety of cases where this fails, and the added
tests attempt to cover those as well as possible.
The know bugs generally stem from:
* Resources being registered in (layout) tree order after style
recalc. This for instance mean that any later defined resources
will shadow any earlier appearing resource (which would the correct
one.)
* Removing a resource container does not consider that there could now
be another resource that is no longer shadowed by the one removed.
Together with the above, this also meant that removing a resource
from the DOM could invalidate, and break, all occurences of said
resource.
This CL attempts to handle the above by factoring the result of
getElementById into the equation, considering it to be "the truth" when
possible/required. The new methods registerResource and
unregisterResource form the basis of this, codifying the two basic
operations on which the tracking is built. The tracking of the
'registered' flag from LayoutSVGResourceContainer is now handled by
SVGTreeScopeResources. While this flag could be considered an
optimization at this point, DCHECKs are added to attempt to keep it
true to it's purpose.
BUG=454767
Review-Url: https://codereview.chromium.org/2722543002
Cr-Commit-Position: refs/heads/master@{#454951}
Committed: https://chromium.googlesource.com/chromium/src/+/533d683571c860e69bb3ecaf6214c5ceed25a808
Patch Set 1 #
Total comments: 9
Patch Set 2 : More tests #
Total comments: 4
Patch Set 3 : Make setRegistered/isRegistered private friends #Patch Set 4 : Rebase #Messages
Total messages: 34 (21 generated)
|