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

Issue 303693009: Make SVGResourcesCycleSolver check for cycles beyond one level (and more) (Closed)

Created:
6 years, 6 months ago by fs
Modified:
6 years, 6 months ago
CC:
blink-reviews, blink-reviews-rendering, zoltan1, eae+blinkwatch, leviw+renderwatch, kouhei+svg_chromium.org, ed+blinkwatch_opera.com, gyuyoung.kim_webkit.org, jchaffraix+rendering, pdr., rwlbuis, Stephen Chennney, rune+blink
Visibility:
Public.

Description

Make SVGResourcesCycleSolver check for cycles beyond one level (and more) The SVGResourceCycleSolver checks for cycles from within the resources a RenderObject references to the resources it references, or any resources in the ancestor-chain of the starting RenderObject (including itself if it is a resource container). This suffers from a few issues. One is that a resource that is referenced both by the starting RenderObject and another resource referenced from the starting RenderObject will be flagged as a cycle because all the resources are added to the resources set. Another issue is that longer cycles may not be detected because only the resources referenced by the starting RenderObject is checked, and depending on how the render tree is built, some cycles could be missed. Additionally, a resource defined within another resource can cause a "false cycle" to be flagged when the inner resource references a resource in the resource set - eventhough the inner resource itself is not reachable from the starting RenderObject. To fix the above, make the SVGResourcesCycleSolver traverse the entire resource "graph", and verify that it is acyclic. The cycle-checking is achieved by keeping track of the current "path" through the graph, and checking any discovered references against that set. When traversing a subtree looking for references, any resources discovered will be skipped to avoid inject false dependencies that way. Also keep a simple "cache" of sub-graphs that has been checked already (and verified cycle-free) to avoid having to revisit them. BUG=351713 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=175129

Patch Set 1 #

Total comments: 12

Patch Set 2 : Add additional comment; Move ActiveFrame to cpp-file. #

Total comments: 5

Patch Set 3 : child -> node; Drop ancestor-chain optimization. #

Patch Set 4 : Add dynamic tests. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+291 lines, -84 lines) Patch
A + LayoutTests/svg/custom/pattern-3-step-cycle.html View 1 chunk +6 lines, -7 lines 0 comments Download
A LayoutTests/svg/custom/pattern-3-step-cycle-dynamic-1.html View 1 2 3 1 chunk +34 lines, -0 lines 0 comments Download
A + LayoutTests/svg/custom/pattern-3-step-cycle-dynamic-1-expected.txt View 1 2 3 0 chunks +-1 lines, --1 lines 0 comments Download
A LayoutTests/svg/custom/pattern-3-step-cycle-dynamic-2.html View 1 2 3 1 chunk +34 lines, -0 lines 0 comments Download
A + LayoutTests/svg/custom/pattern-3-step-cycle-dynamic-2-expected.txt View 1 2 3 0 chunks +-1 lines, --1 lines 0 comments Download
A LayoutTests/svg/custom/pattern-3-step-cycle-dynamic-3.html View 1 2 3 1 chunk +42 lines, -0 lines 0 comments Download
A + LayoutTests/svg/custom/pattern-3-step-cycle-dynamic-3-expected.txt View 1 2 3 0 chunks +-1 lines, --1 lines 0 comments Download
A LayoutTests/svg/custom/pattern-3-step-cycle-dynamic-4.html View 1 2 3 1 chunk +51 lines, -0 lines 0 comments Download
A + LayoutTests/svg/custom/pattern-3-step-cycle-dynamic-4-expected.txt View 1 2 3 0 chunks +-1 lines, --1 lines 0 comments Download
A + LayoutTests/svg/custom/pattern-3-step-cycle-expected.txt View 0 chunks +-1 lines, --1 lines 0 comments Download
A LayoutTests/svg/custom/pattern-directly-and-indirectly-referenced.svg View 1 chunk +9 lines, -0 lines 0 comments Download
A LayoutTests/svg/custom/pattern-directly-and-indirectly-referenced-expected.svg View 1 chunk +12 lines, -0 lines 0 comments Download
A LayoutTests/svg/custom/pattern-false-resource-cycle.html View 1 chunk +13 lines, -0 lines 0 comments Download
A LayoutTests/svg/custom/pattern-false-resource-cycle-expected.html View 1 chunk +10 lines, -0 lines 0 comments Download
A LayoutTests/svg/custom/pattern-within-other-pattern.html View 1 chunk +10 lines, -0 lines 0 comments Download
A LayoutTests/svg/custom/pattern-within-other-pattern-expected.html View 1 chunk +7 lines, -0 lines 0 comments Download
M Source/core/rendering/svg/SVGResourcesCycleSolver.h View 1 1 chunk +6 lines, -2 lines 0 comments Download
M Source/core/rendering/svg/SVGResourcesCycleSolver.cpp View 1 2 1 chunk +62 lines, -80 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
fs
This got more involved than had initially had hoped, but bugs with the old code ...
6 years, 6 months ago (2014-05-28 08:45:41 UTC) #1
krit
Btw. does https://bugs.webkit.org/show_bug.cgi?id=130127 pass with the change? https://codereview.chromium.org/303693009/diff/1/Source/core/rendering/svg/SVGResourcesCycleSolver.cpp File Source/core/rendering/svg/SVGResourcesCycleSolver.cpp (right): https://codereview.chromium.org/303693009/diff/1/Source/core/rendering/svg/SVGResourcesCycleSolver.cpp#newcode50 Source/core/rendering/svg/SVGResourcesCycleSolver.cpp:50: class SVGResourcesCycleSolver::ActiveFrame ...
6 years, 6 months ago (2014-05-28 10:22:29 UTC) #2
fs
Thanks for looking. > Btw. does https://bugs.webkit.org/show_bug.cgi?id=130127 pass with the change? I added it as ...
6 years, 6 months ago (2014-05-28 11:23:47 UTC) #3
krit
On 2014/05/28 11:23:47, fs wrote: > https://codereview.chromium.org/303693009/diff/1/Source/core/rendering/svg/SVGResourcesCycleSolver.cpp#newcode65 > Source/core/rendering/svg/SVGResourcesCycleSolver.cpp:65: > RenderSVGResourceContainer* m_resource; > On 2014/05/28 ...
6 years, 6 months ago (2014-05-28 11:33:48 UTC) #4
f(malita)
Looks like a great cleanup, and should be a net improvement but I have some ...
6 years, 6 months ago (2014-05-28 22:30:34 UTC) #5
f(malita)
Please add a couple of dynamic tests where we construct an un-attached subtree (which contains ...
6 years, 6 months ago (2014-05-29 20:49:28 UTC) #6
fs
> Looks like a great cleanup, and should be a net improvement but I have ...
6 years, 6 months ago (2014-05-30 11:13:53 UTC) #7
fs
On 2014/05/30 11:13:53, fs wrote: > > Please add a couple of dynamic tests where ...
6 years, 6 months ago (2014-05-30 12:06:36 UTC) #8
f(malita)
On 2014/05/30 12:06:36, fs wrote: > On 2014/05/30 11:13:53, fs wrote: > > > Please ...
6 years, 6 months ago (2014-05-30 13:06:21 UTC) #9
fs
The CQ bit was checked by fs@opera.com
6 years, 6 months ago (2014-05-30 13:30:42 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fs@opera.com/303693009/60001
6 years, 6 months ago (2014-05-30 13:31:17 UTC) #11
commit-bot: I haz the power
6 years, 6 months ago (2014-05-30 13:55:57 UTC) #12
Message was sent while issue was closed.
Change committed as 175129

Powered by Google App Engine
This is Rietveld 408576698