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

Issue 2722543002: Improve handling of duplicate id's for SVG resources (Closed)

Created:
3 years, 9 months ago by fs
Modified:
3 years, 9 months ago
Reviewers:
pdr., Stephen Chennney
CC:
blink-reviews, blink-reviews-layout_chromium.org, chromium-reviews, krit, eae+blinkwatch, fmalita+watch_chromium.org, gyuyoung2, jchaffraix+rendering, kouhei+svg_chromium.org, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, pdr+svgwatchlist_chromium.org, rwlbuis, szager+layoutwatch_chromium.org, zoltan1
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Improve 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+264 lines, -53 lines) Patch
A third_party/WebKit/LayoutTests/svg/custom/duplicate-ids.html View 1 chunk +10 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-addition.html View 1 chunk +22 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-addition-before.html View 1 1 chunk +20 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-addition-before-expected.html View 1 1 chunk +2 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-addition-expected.html View 1 chunk +2 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-expected.html View 1 chunk +2 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-id-mutation.html View 1 chunk +16 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-id-mutation-2.html View 1 chunk +16 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-id-mutation-2-expected.html View 1 chunk +2 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-id-mutation-expected.html View 1 chunk +2 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-removal.html View 1 chunk +16 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-removal-expected.html View 1 chunk +2 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-style-change.html View 1 chunk +16 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-style-change-expected.html View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.h View 1 2 2 chunks +7 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp View 2 chunks +9 lines, -25 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGTreeScopeResources.h View 2 chunks +11 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGTreeScopeResources.cpp View 4 chunks +107 lines, -25 lines 0 comments Download

Messages

Total messages: 34 (21 generated)
fs
So this fixes things up within the current framework. I think we should attempt to ...
3 years, 9 months ago (2017-02-27 14:34:37 UTC) #6
Stephen Chennney
This might be a good time to add comments like crazy. I had a tough ...
3 years, 9 months ago (2017-02-27 16:21:22 UTC) #7
fs
https://codereview.chromium.org/2722543002/diff/1/third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-addition.html File third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-addition.html (right): https://codereview.chromium.org/2722543002/diff/1/third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-addition.html#newcode18 third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-addition.html:18: document.querySelector('svg').insertBefore(gradient, rect); On 2017/02/27 at 16:21:22, Stephen Chennney wrote: ...
3 years, 9 months ago (2017-02-27 17:47:33 UTC) #9
fs
https://codereview.chromium.org/2722543002/diff/1/third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-removal.html File third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-removal.html (right): https://codereview.chromium.org/2722543002/diff/1/third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-removal.html#newcode14 third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-removal.html:14: document.querySelectorAll('lineargradient')[1].remove(); On 2017/02/27 at 17:47:30, fs wrote: > On ...
3 years, 9 months ago (2017-02-27 19:11:25 UTC) #11
Stephen Chennney
On 2017/02/27 19:11:25, fs wrote: > https://codereview.chromium.org/2722543002/diff/1/third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-removal.html > File third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-removal.html > (right): > > https://codereview.chromium.org/2722543002/diff/1/third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-removal.html#newcode14 ...
3 years, 9 months ago (2017-02-27 19:31:29 UTC) #12
fs
On 2017/02/27 at 19:31:29, schenney wrote: > On 2017/02/27 19:11:25, fs wrote: > > https://codereview.chromium.org/2722543002/diff/1/third_party/WebKit/LayoutTests/svg/custom/duplicate-ids-removal.html ...
3 years, 9 months ago (2017-02-27 20:01:15 UTC) #15
Stephen Chennney
On 2017/02/27 20:01:15, fs wrote: > On 2017/02/27 at 19:31:29, schenney wrote: > > On ...
3 years, 9 months ago (2017-02-27 20:16:36 UTC) #16
fs
On 2017/02/27 at 20:16:36, schenney wrote: > On 2017/02/27 20:01:15, fs wrote: > > On ...
3 years, 9 months ago (2017-02-27 20:18:35 UTC) #17
Stephen Chennney
On 2017/02/27 20:18:35, fs wrote: > On 2017/02/27 at 20:16:36, schenney wrote: > > On ...
3 years, 9 months ago (2017-02-27 20:27:32 UTC) #18
pdr.
LGTM 2 https://codereview.chromium.org/2722543002/diff/20001/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.h File third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.h (right): https://codereview.chromium.org/2722543002/diff/20001/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.h#newcode68 third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.h:68: void setRegistered(bool registered) { m_registered = registered; ...
3 years, 9 months ago (2017-02-27 23:06:31 UTC) #19
fs
Since the M58 branch has been cut, I'll go ahead and land this now, with ...
3 years, 9 months ago (2017-03-06 20:49:55 UTC) #28
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/2722543002/60001
3 years, 9 months ago (2017-03-06 20:50:42 UTC) #31
commit-bot: I haz the power
3 years, 9 months ago (2017-03-06 20:56:54 UTC) #34
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/533d683571c860e69bb3ecaf6214...

Powered by Google App Engine
This is Rietveld 408576698