Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Issue 2633143002: SVG objects with same idrefs conflict when under different shadow root (Closed)

Created:
3 years, 11 months ago by fs
Modified:
3 years, 11 months ago
Reviewers:
pdr., hayato
CC:
fs, darktears, blink-reviews, blink-reviews-animation_chromium.org, blink-reviews-dom_chromium.org, blink-reviews-layout_chromium.org, chromium-reviews, dglazkov+blink, krit, eae+blinkwatch, Eric Willigers, f(malita), gyuyoung2, jchaffraix+rendering, kouhei+svg_chromium.org, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, pdr+svgwatchlist_chromium.org, rjwright, rwlbuis, Stephen Chennney, shans, sof, szager+layoutwatch_chromium.org, taijin, zoltan1
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

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

Patch Set 1 #

Patch Set 2 : treeScopeForIdResolution #

Patch Set 3 : Tests #

Total comments: 4

Patch Set 4 : ensureSVGTreeScopedResources(); add comment #

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

Messages

Total messages: 30 (23 generated)
fs
This https://codereview.chromium.org/2107153002 respun on a later revision (PS1), with test failures fixed (PS2) and some ...
3 years, 11 months ago (2017-01-18 15:18:28 UTC) #16
hayato
LGTM in terms of treeScope. I think you need a review from pdr@ because I ...
3 years, 11 months ago (2017-01-19 07:06:58 UTC) #17
pdr.
I'm sorry for not getting to this today. I pushed it on the stack for ...
3 years, 11 months ago (2017-01-20 06:32:01 UTC) #18
pdr.
This is great, LGTM! https://codereview.chromium.org/2633143002/diff/40001/third_party/WebKit/Source/core/dom/TreeScope.h File third_party/WebKit/Source/core/dom/TreeScope.h (right): https://codereview.chromium.org/2633143002/diff/40001/third_party/WebKit/Source/core/dom/TreeScope.h#newcode132 third_party/WebKit/Source/core/dom/TreeScope.h:132: SVGTreeScopeResources& accessSVGTreeScopedResources(); optional: ensureSVGTreeScopedResources so ...
3 years, 11 months ago (2017-01-23 04:34:12 UTC) #19
fs
https://codereview.chromium.org/2633143002/diff/40001/third_party/WebKit/Source/core/dom/TreeScope.h File third_party/WebKit/Source/core/dom/TreeScope.h (right): https://codereview.chromium.org/2633143002/diff/40001/third_party/WebKit/Source/core/dom/TreeScope.h#newcode132 third_party/WebKit/Source/core/dom/TreeScope.h:132: SVGTreeScopeResources& accessSVGTreeScopedResources(); On 2017/01/23 at 04:34:12, pdr. wrote: > ...
3 years, 11 months ago (2017-01-23 11:18:24 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2633143002/60001
3 years, 11 months ago (2017-01-23 14:28:44 UTC) #27
commit-bot: I haz the power
3 years, 11 months ago (2017-01-23 15:23:50 UTC) #30
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/8138e62d38b64d24e2220d50907b...

Powered by Google App Engine
This is Rietveld 408576698