|
SVG objects with same idrefs conflict when under different shadow root
When SVG idrefs are the same, even though the
LayoutSVGResourcesContainers are created under different shadow roots,
they conflict and only the last one is available. The problem is that,
currently, the HashMap mapping id's to LayoutSVGResourcesContainers are
owned/scoped to the document instead of the treeScope.
This CL moves that hash map from document to treeScope, so that
LayoutSVGResourcesContainers with the same id in different shadow roots
won't conflict.
Currently the following 2 maps (which are wrapped into the
SVGDocumentExtensions class) are owned by document instead of treeScope:
HashMap<AtomicString, LayoutSVGResourceContainer*> m_resources;
HeapHashMap<AtomicString, Member<SVGPendingElements>> m_pendingResources;
Thus when a new LayoutSVGResourcesContainer with the same id is created,
it is inserted into m_resources and overwrites the one with the same
key (id).
This CL separates these 2 maps from SVGDocumentExtensions and wrap them
into a new class (named SVGTreeScopeResources), and lets TreeScope have
them as a member variable (m_svgTreeScopedResources).
This CL also moves the corresponding methods accessing these 2 maps into
the new class.
To make this work together with <use>, we need to make sure to use the
TreeScope of the "original" element. Move the helper from LayoutSVGTextPath
to SVGElement::treeScopeForIdResolution and then use that for this.
Based on https://codereview.chromium.org/2107153002 by Taijin Tei.
BUG= 597080
Review-Url: https://codereview.chromium.org/2633143002
Cr-Commit-Position: refs/heads/master@{#445378}
Committed: https://chromium.googlesource.com/chromium/src/+/8138e62d38b64d24e2220d50907b8aeb71efd32e
Total comments: 4
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+329 lines, -213 lines) |
Patch |
|
A |
third_party/WebKit/LayoutTests/svg/custom/shadow-dom-resource-reference.html
|
View
|
1
2
|
1 chunk |
+12 lines, -0 lines |
0 comments
|
Download
|
|
A |
third_party/WebKit/LayoutTests/svg/custom/shadow-dom-resource-reference-2.html
|
View
|
1
2
|
1 chunk |
+16 lines, -0 lines |
0 comments
|
Download
|
|
A |
third_party/WebKit/LayoutTests/svg/custom/shadow-dom-resource-reference-2-expected.html
|
View
|
1
2
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
A |
third_party/WebKit/LayoutTests/svg/custom/shadow-dom-resource-reference-expected.html
|
View
|
1
2
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/dom/Element.cpp
|
View
|
1
2
3
|
2 chunks |
+6 lines, -3 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/dom/TreeScope.h
|
View
|
1
2
3
|
3 chunks |
+5 lines, -0 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/dom/TreeScope.cpp
|
View
|
1
2
3
|
3 chunks |
+8 lines, -0 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.h
|
View
|
1
2
3
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp
|
View
|
1
2
3
|
5 chunks |
+17 lines, -14 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/layout/svg/LayoutSVGResourcePattern.cpp
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/layout/svg/LayoutSVGTextPath.cpp
|
View
|
1
|
2 chunks |
+1 line, -7 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/layout/svg/SVGResources.cpp
|
View
|
1
2
3
|
9 chunks |
+18 lines, -16 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/svg/BUILD.gn
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/svg/SVGDocumentExtensions.h
|
View
|
1
2
3
|
5 chunks |
+0 lines, -24 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/svg/SVGDocumentExtensions.cpp
|
View
|
1
2
3
|
4 chunks |
+0 lines, -117 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/svg/SVGElement.h
|
View
|
1
2
3
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/svg/SVGElement.cpp
|
View
|
1
2
3
|
4 chunks |
+14 lines, -6 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/svg/SVGFEImageElement.cpp
|
View
|
1
2
3
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/svg/SVGMPathElement.cpp
|
View
|
1
2
3
|
2 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/svg/SVGTextPathElement.cpp
|
View
|
1
2
3
|
2 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
|
A |
third_party/WebKit/Source/core/svg/SVGTreeScopeResources.h
|
View
|
1
2
3
|
1 chunk |
+58 lines, -0 lines |
0 comments
|
Download
|
|
A |
third_party/WebKit/Source/core/svg/SVGTreeScopeResources.cpp
|
View
|
1
|
1 chunk |
+135 lines, -0 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/svg/SVGUseElement.cpp
|
View
|
1
2
3
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp
|
View
|
1
2
3
|
3 chunks |
+10 lines, -8 lines |
0 comments
|
Download
|
Total messages: 30 (23 generated)
|