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

Issue 23785014: [SVG] Resources should be laid out in dependecy order. (Closed)

Created:
7 years, 3 months ago by f(malita)
Modified:
7 years, 2 months ago
CC:
blink-reviews, eae+blinkwatch, leviw+renderwatch, jchaffraix+rendering, pdr, inferno
Visibility:
Public.

Description

[SVG] Resources should be laid out in dependecy order. We're currently laying out resources in tree order, while they are (conceptually) forming a DAG - and this disconnect results in complicated logic and an extra layout pass attempting to re-validate nodes that might have been invalidated by the resource layout. This is broken in (at least) two ways: * two passes are not guaranteed to be enough, we could need an arbitrary number of passes to stabilize the tree. * the re-layout logic hangs off RenderSVGRoot, and falls apart when multiple root nodes are present (html doc with multiple svg fragments). Recently introduced asserts are testing for render tree nodes which are still marked for layout at paint time, and are catching several invariant violations due to the above. To address this problem, we should lay out resources in transitive dependency order (where node A depends on resource B if it references it directly: <rect id="a" filter="url(#b)"/>). Turns out this is not as complicated as it sounds, and we can avoid building an explicit resources DAG because we already have the sparse version: each node tracks the list of resources it is referencing. So before laying out a node, we should ensure that its resources are laid out first. Applying this recursively, we are effectively traversing the dependency DAG in the correct order. (This relies on the assumption that a resource' layout does not depend on its in-tree parent layout - which should be the case as resources only make sense in the context of their clients). The CL also removes the RenderSVGRoot re-layout logic added in http://trac.webkit.org/changeset/111601 as it is no longer needed: a resource is now guaranteed to be laid out before any of its clients. BUG=282925, 294237, 294238 R=pdr@chromium.org,schenney@chromium.org,dschulze@chromium.org,ojan@chromium.org,eseidel@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=158480

Patch Set 1 #

Total comments: 3

Patch Set 2 : Review nit + more test tweaks to get some baseline green runs. #

Patch Set 3 : Invalidate relative-length resources on viewport change. #

Patch Set 4 : Set #3 rebased. #

Total comments: 9

Patch Set 5 : Updated per review. #

Patch Set 6 : text-layout-crash.html needs image result update. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+150 lines, -47 lines) Patch
M LayoutTests/TestExpectations View 1 2 3 4 5 2 chunks +3 lines, -6 lines 0 comments Download
M LayoutTests/platform/win/svg/W3C-SVG-1.1/masking-path-04-b-expected.txt View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M LayoutTests/svg/custom/circular-marker-reference-4-expected.txt View 1 1 chunk +3 lines, -3 lines 0 comments Download
A LayoutTests/svg/custom/cross-referenced-resources.html View 1 chunk +19 lines, -0 lines 0 comments Download
A LayoutTests/svg/custom/cross-referenced-resources-expected.html View 1 chunk +11 lines, -0 lines 0 comments Download
M LayoutTests/svg/custom/unicode-in-tspan-multi-svg-crash.html View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/svg/custom/unicode-in-tspan-multi-svg-crash-expected.txt View 1 chunk +2 lines, -1 line 0 comments Download
M LayoutTests/svg/text/text-layout-crash-expected.txt View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/rendering/RenderView.cpp View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGResourceContainer.h View 1 1 chunk +2 lines, -1 line 0 comments Download
M Source/core/rendering/svg/RenderSVGResourceContainer.cpp View 1 2 3 4 3 chunks +10 lines, -2 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGResourceMarker.cpp View 1 2 3 4 2 chunks +9 lines, -2 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGRoot.h View 2 chunks +0 lines, -5 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGRoot.cpp View 1 3 chunks +2 lines, -22 lines 0 comments Download
M Source/core/rendering/svg/SVGRenderSupport.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/rendering/svg/SVGRenderSupport.cpp View 1 2 3 4 2 chunks +16 lines, -1 line 0 comments Download
M Source/core/rendering/svg/SVGResources.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/rendering/svg/SVGResources.cpp View 1 chunk +21 lines, -0 lines 0 comments Download
M Source/core/svg/SVGElement.h View 1 2 3 4 3 chunks +7 lines, -0 lines 0 comments Download
M Source/core/svg/SVGElement.cpp View 1 2 3 4 4 chunks +28 lines, -0 lines 0 comments Download
M Source/core/svg/SVGSVGElement.cpp View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
f(malita)
I don't think this fixes all the resource related issues, but it should at least ...
7 years, 3 months ago (2013-09-18 22:34:58 UTC) #1
pdr.
Really really really amazing Florin! https://codereview.chromium.org/23785014/diff/1/LayoutTests/svg/text/text-layout-crash-expected.txt File LayoutTests/svg/text/text-layout-crash-expected.txt (right): https://codereview.chromium.org/23785014/diff/1/LayoutTests/svg/text/text-layout-crash-expected.txt#newcode2 LayoutTests/svg/text/text-layout-crash-expected.txt:2: bc These test failures ...
7 years, 3 months ago (2013-09-18 22:47:35 UTC) #2
f(malita)
https://codereview.chromium.org/23785014/diff/1/LayoutTests/svg/text/text-layout-crash-expected.txt File LayoutTests/svg/text/text-layout-crash-expected.txt (right): https://codereview.chromium.org/23785014/diff/1/LayoutTests/svg/text/text-layout-crash-expected.txt#newcode2 LayoutTests/svg/text/text-layout-crash-expected.txt:2: bc On 2013/09/18 22:47:35, pdr wrote: > These test ...
7 years, 3 months ago (2013-09-19 15:13:21 UTC) #3
ojan
> * Marking nodes for layout during layout seems like asking for trouble. The > ...
7 years, 3 months ago (2013-09-19 19:18:11 UTC) #4
f(malita)
Figured where some of the minor test layout diffs are coming from, and it's not ...
7 years, 3 months ago (2013-09-20 23:04:29 UTC) #5
pdr.
I think we should get this in sooner rather than later. It solves a bunch ...
7 years, 2 months ago (2013-09-23 22:26:00 UTC) #6
f(malita)
https://codereview.chromium.org/23785014/diff/12001/Source/core/rendering/RenderView.cpp File Source/core/rendering/RenderView.cpp (right): https://codereview.chromium.org/23785014/diff/12001/Source/core/rendering/RenderView.cpp#newcode278 Source/core/rendering/RenderView.cpp:278: // SVG resource containers need to be invalidated outside ...
7 years, 2 months ago (2013-09-23 23:20:33 UTC) #7
Stephen Chennney
While this leaves me feeling embarassed, I'm not convinced this solves the problem. I'm concerned ...
7 years, 2 months ago (2013-09-25 19:31:36 UTC) #8
Stephen Chennney
Sorry, not quite right about marking something deep in a subtree for layout during layout. ...
7 years, 2 months ago (2013-09-25 19:33:32 UTC) #9
f(malita)
On 2013/09/25 19:31:36, Stephen Chenney wrote: > I'm concerned about the case where the resource ...
7 years, 2 months ago (2013-09-25 21:13:44 UTC) #10
Stephen Chennney
On 2013/09/25 21:13:44, Florin Malita wrote: > On 2013/09/25 19:31:36, Stephen Chenney wrote: > > ...
7 years, 2 months ago (2013-09-25 21:33:35 UTC) #11
pdr.
On 2013/09/25 21:33:35, Stephen Chenney wrote: > On 2013/09/25 21:13:44, Florin Malita wrote: > > ...
7 years, 2 months ago (2013-09-25 22:35:39 UTC) #12
pdr.
On 2013/09/25 22:35:39, pdr wrote: > On 2013/09/25 21:33:35, Stephen Chenney wrote: > > On ...
7 years, 2 months ago (2013-09-28 00:15:51 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fmalita@chromium.org/23785014/48001
7 years, 2 months ago (2013-09-28 00:40:22 UTC) #14
commit-bot: I haz the power
7 years, 2 months ago (2013-09-28 04:17:29 UTC) #15
Message was sent while issue was closed.
Change committed as 158480

Powered by Google App Engine
This is Rietveld 408576698