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

Issue 2107153002: SVG object with same idrefs get conflicted even they are under different shadow root

Created:
4 years, 5 months ago by taijin
Modified:
3 years, 11 months ago
Reviewers:
hayato
CC:
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, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Overview : When SVG idrefs is same, even though the LayoutSVGResourcesContainers are created under different shadow root, they got conflicted and only the latest created one is reflected. The problem is that, currently, the HashMap mapping LayoutSVGResourcesContainers to its id is owned by the document instead of treeScope. This CL moves that hash map from document to treeScope, so that LayoutSVGResourcesContainers with same id in different shadow root won’t get conflict. Detail : Currently below 3 HashMap/HeapHashMap (which are wrapped into class SVGDocumentExtensions) are owned by document instead of treeScope. (Member<SVGDocumentExtensions> m_svgExtensions) HashMap<AtomicString, LayoutSVGResourceContainer*> m_resources; HeapHashMap<AtomicString, Member<SVGPendingElements>> m_pendingResources; HeapHashMap<AtomicString, Member<SVGPendingElements>> m_pendingResourcesForRemoval; Thus when a new LayoutSVGResourcesContainer with same id is created, it is inserted into m_resources and overwrites the one with the same key(id). Solution : This CL separated these 3 HashMap/HeapHashMap from SVGDocumentExtensions and wrapped them into a new class(which is named SVGTreeScopeResources), and let treeScope have them as member variable(Member<SVGTreeScopeResources> m_svgTreeScopedResources). Also this CL moved corresponding methods using these 3 HashMap/HeapHashMap into the new class SVGTreeScopeResources. BUG=597080

Patch Set 1 #

Total comments: 2

Patch Set 2 : rename the method in TreeScope class #

Unified diffs Side-by-side diffs Delta from patch set Stats (+319 lines, -245 lines) Patch
M AUTHORS View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/core.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Element.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/TreeScope.h View 1 3 chunks +7 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/TreeScope.cpp View 1 2 chunks +13 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp View 5 chunks +15 lines, -15 lines 0 comments Download
M third_party/WebKit/Source/core/layout/svg/ReferenceFilterBuilder.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/svg/SVGResources.cpp View 7 chunks +12 lines, -13 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGDocumentExtensions.h View 3 chunks +0 lines, -25 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGDocumentExtensions.cpp View 3 chunks +0 lines, -173 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGElement.cpp View 3 chunks +6 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGFEImageElement.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/svg/SVGMPathElement.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGTextPathElement.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
A third_party/WebKit/Source/core/svg/SVGTreeScopeResources.h View 1 chunk +56 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/svg/SVGTreeScopeResources.cpp View 1 1 chunk +194 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGUseElement.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp View 2 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 11 (2 generated)
hayato
Thanks. Looks promising. I will take a look tomorrow.
4 years, 5 months ago (2016-06-30 03:38:18 UTC) #2
hayato
https://codereview.chromium.org/2107153002/diff/1/third_party/WebKit/Source/core/dom/TreeScope.cpp File third_party/WebKit/Source/core/dom/TreeScope.cpp (right): https://codereview.chromium.org/2107153002/diff/1/third_party/WebKit/Source/core/dom/TreeScope.cpp#newcode496 third_party/WebKit/Source/core/dom/TreeScope.cpp:496: const SVGTreeScopeResources* TreeScope::svgTreeScopedResources() Could we rename this to TreeScope::svgExtensions()? ...
4 years, 5 months ago (2016-07-04 04:27:29 UTC) #4
taijin
https://codereview.chromium.org/2107153002/diff/1/third_party/WebKit/Source/core/dom/TreeScope.cpp File third_party/WebKit/Source/core/dom/TreeScope.cpp (right): https://codereview.chromium.org/2107153002/diff/1/third_party/WebKit/Source/core/dom/TreeScope.cpp#newcode496 third_party/WebKit/Source/core/dom/TreeScope.cpp:496: const SVGTreeScopeResources* TreeScope::svgTreeScopedResources() On 2016/07/04 04:27:29, hayato wrote: > ...
4 years, 5 months ago (2016-07-05 06:37:14 UTC) #5
taijin
On 2016/07/04 04:27:29, hayato wrote: > https://codereview.chromium.org/2107153002/diff/1/third_party/WebKit/Source/core/dom/TreeScope.cpp > File third_party/WebKit/Source/core/dom/TreeScope.cpp (right): > > https://codereview.chromium.org/2107153002/diff/1/third_party/WebKit/Source/core/dom/TreeScope.cpp#newcode496 > ...
4 years, 5 months ago (2016-07-05 15:43:57 UTC) #6
hayato
Thank you. I will take another look later.
4 years, 5 months ago (2016-07-07 08:29:21 UTC) #7
hayato
Could you add a test? I am not familiar with how *resources* are used in ...
4 years, 5 months ago (2016-07-12 00:56:57 UTC) #8
taijin
On 2016/07/12 00:56:57, hayato wrote: > Could you add a test? > I am not ...
4 years, 5 months ago (2016-07-12 08:46:12 UTC) #9
fs
On 2016/07/12 at 08:46:12, taijin.passion wrote: > On 2016/07/12 00:56:57, hayato wrote: > > Could ...
4 years, 2 months ago (2016-10-12 11:08:15 UTC) #10
fs
3 years, 11 months ago (2017-01-16 15:31:21 UTC) #11
On 2016/10/12 at 11:08:15, fs wrote:
> On 2016/07/12 at 08:46:12, taijin.passion wrote:
> > On 2016/07/12 00:56:57, hayato wrote:
> > > Could you add a test?
> > > I am not familiar with how *resources* are used in SVG world.
> > > You might want to add a reviewer who is familiar with svg.
> > 
> > Sure will do both. Thanks:)
> 
> Any chance to see movement on this? From an SVG PoV I think what you need to
worry about is references from within <use> instances. Picking the right
TreeScope within SVGResources::buildResources should hopefully enough to handle
that (for now.) I hope there are at least some tests covering that.

I rebased and updated this to current master and uploaded it to
https://codereview.chromium.org/2633143002 . Trybots seem to indicate that there
indeed is problem with resource references from within <use> instances.

Powered by Google App Engine
This is Rietveld 408576698