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

Issue 1854123002: Rebuild layout attributes on layout instead of on layout tree updates (Closed)

Created:
4 years, 8 months ago by fs
Modified:
4 years, 8 months ago
Reviewers:
pdr.
CC:
blink-reviews, blink-reviews-layout_chromium.org, chromium-reviews, krit, eae+blinkwatch, f(malita), gyuyoung2, jchaffraix+rendering, kouhei+svg_chromium.org, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, pdr+svgwatchlist_chromium.org, rwlbuis, Stephen Chennney, szager+layoutwatch_chromium.org, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Rebuild 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)
fs
4 years, 8 months ago (2016-04-04 16:21:06 UTC) #3
fs
https://codereview.chromium.org/1854123002/diff/1/third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp File third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp (right): https://codereview.chromium.org/1854123002/diff/1/third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp#newcode228 third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp:228: m_layoutAttributes.clear(); Should probably just do this directly "on invalidation" ...
4 years, 8 months ago (2016-04-04 20:04:13 UTC) #4
pdr.
LGTM Nice, net -137 LOCC (lines of crazy code). https://codereview.chromium.org/1854123002/diff/1/third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp File third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp (right): https://codereview.chromium.org/1854123002/diff/1/third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp#newcode228 third_party/WebKit/Source/core/layout/svg/LayoutSVGText.cpp:228: ...
4 years, 8 months ago (2016-04-04 22:33:13 UTC) #5
fs
On 2016/04/04 at 22:33:13, pdr wrote: ... > Nice, net -137 LOCC (lines of crazy ...
4 years, 8 months ago (2016-04-05 08:09:43 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1854123002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1854123002/1
4 years, 8 months ago (2016-04-05 10:37:41 UTC) #8
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 8 months ago (2016-04-05 11:29:06 UTC) #9
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/63680ba154b5839ee37ad744caf251ebe41bd3a3 Cr-Commit-Position: refs/heads/master@{#385149}
4 years, 8 months ago (2016-04-05 11:30:19 UTC) #11
pdr.
4 years, 8 months ago (2016-04-05 18:15:47 UTC) #12
Message was sent while issue was closed.
On 2016/04/05 at 08:09:43, fs wrote:
> On 2016/04/04 at 22:33:13, pdr wrote:
> ...
> > Nice, net -137 LOCC (lines of crazy code).
> 
> (I thought  that would be LoCO according to the LocoMo model...)

haha XD

Powered by Google App Engine
This is Rietveld 408576698