DescriptionRebuild layout attributes on layout instead of on layout tree updates
What layout attributes are used (for a text node; LayoutSVGInlineText),
depends on how many "characters" precedes the node in question.
Layout attributes were updated on insertions and removals on the layout
tree, by find the node to update, and update the surrounding nodes.
It were however trying to depend on the order in which nodes were being
attached, which meant that a sequence of updates could lead to incorrect
layout attribute (indices) being computed. The process per node is also
essentially O(n) (albeit a fairly cheap such.)
Instead of updating on add/remove/update of nodes, just mark the position
data as invalid, and update on the next layout of the <text> root. This
also has the side-effect of simplifying the code quite significantly,
and should avoid repeatedly resolving the layout attribute indices.
Also take the opportunity to pass LayoutSVGText references and simplify
related code a bit.
BUG=405966, 594058
Committed: https://crrev.com/63680ba154b5839ee37ad744caf251ebe41bd3a3
Cr-Commit-Position: refs/heads/master@{#385149}
Patch Set 1 #
Total comments: 2
Messages
Total messages: 12 (4 generated)
|