Chromium Code Reviews
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. #Messages
Total messages: 15 (0 generated)
|