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

Issue 2379483002: Use the sibling limit to decide whether to create layout for whitespace (Closed)

Created:
4 years, 2 months ago by dominicc (has gone to gerrit)
Modified:
4 years, 2 months ago
Reviewers:
Nico, kojii
CC:
blink-reviews, blink-reviews-dom_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, rwlbuis, sof
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use the sibling limit to decide whether to create layout for whitespace Text::textLayoutObjectIsNeeded is an optimization which avoids creating layout objects for whitespace text nodes. However LayoutTreeBuilderTraversal::nextSiblingLayoutObject traverses all siblings. For long lists of N space-separated siblings, this degenerates into an N^2 DOM walk. Oops. Text::textLayoutObjectIsNeeded already has a sibling limit; this passes the limit through to prevSiblingLayoutObject/nextSiblingLayoutObject. BUG=650938 Committed: https://crrev.com/99c2073218960208c0f54de95b9c31ff9521ba46 Cr-Commit-Position: refs/heads/master@{#422631}

Patch Set 1 #

Patch Set 2 : Use a signed type for the limit. #

Patch Set 3 : Do not underflow unsigned counter in caller. #

Patch Set 4 : Bring patch to head. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -11 lines) Patch
A third_party/WebKit/PerformanceTests/DOM/long-sibling-list.html View 1 chunk +25 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversal.h View 1 2 3 3 chunks +7 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/dom/LayoutTreeBuilderTraversal.cpp View 1 2 3 2 chunks +7 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Text.cpp View 1 2 3 2 chunks +12 lines, -5 lines 2 comments Download

Messages

Total messages: 35 (23 generated)
dominicc (has gone to gerrit)
PTAL
4 years, 2 months ago (2016-09-28 05:24:07 UTC) #2
kojii
The code looks good to me but there are a few cases where limit == ...
4 years, 2 months ago (2016-09-29 04:52:04 UTC) #11
dominicc (has gone to gerrit)
Good point. The caller underflows the unsigned limit. PTAL.
4 years, 2 months ago (2016-09-29 07:31:30 UTC) #16
kojii
lgtm
4 years, 2 months ago (2016-09-29 08:23:19 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2379483002/40001
4 years, 2 months ago (2016-10-03 05:51:30 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/78946) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, ...
4 years, 2 months ago (2016-10-03 05:53:47 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2379483002/60001
4 years, 2 months ago (2016-10-04 00:25:15 UTC) #28
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 2 months ago (2016-10-04 00:35:41 UTC) #29
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/99c2073218960208c0f54de95b9c31ff9521ba46 Cr-Commit-Position: refs/heads/master@{#422631}
4 years, 2 months ago (2016-10-04 00:39:36 UTC) #31
Nico
https://codereview.chromium.org/2379483002/diff/60001/third_party/WebKit/Source/core/dom/Text.cpp File third_party/WebKit/Source/core/dom/Text.cpp (right): https://codereview.chromium.org/2379483002/diff/60001/third_party/WebKit/Source/core/dom/Text.cpp#newcode311 third_party/WebKit/Source/core/dom/Text.cpp:311: unsigned maxSiblingsToVisit = 50; did you mean to delete ...
4 years, 2 months ago (2016-10-06 15:13:45 UTC) #33
kojii
https://codereview.chromium.org/2379483002/diff/60001/third_party/WebKit/Source/core/dom/Text.cpp File third_party/WebKit/Source/core/dom/Text.cpp (right): https://codereview.chromium.org/2379483002/diff/60001/third_party/WebKit/Source/core/dom/Text.cpp#newcode311 third_party/WebKit/Source/core/dom/Text.cpp:311: unsigned maxSiblingsToVisit = 50; On 2016/10/06 at 15:13:45, Nico ...
4 years, 2 months ago (2016-10-07 03:22:54 UTC) #34
dominicc (has gone to gerrit)
4 years, 2 months ago (2016-10-14 07:51:33 UTC) #35
Message was sent while issue was closed.
On 2016/10/07 at 03:22:54, kojii wrote:
>
https://codereview.chromium.org/2379483002/diff/60001/third_party/WebKit/Sour...
> File third_party/WebKit/Source/core/dom/Text.cpp (right):
> 
>
https://codereview.chromium.org/2379483002/diff/60001/third_party/WebKit/Sour...
> third_party/WebKit/Source/core/dom/Text.cpp:311: unsigned maxSiblingsToVisit =
50;
> On 2016/10/06 at 15:13:45, Nico wrote:
> > did you mean to delete this here? (i'll send a cl to do so, unless you tell
me it's intentionally in two places now)
> 
> Looks like a merge failure, PS3 removed this but not in PS4.

Yes, merge failure. Thank you for cleaning this up jochen.

Powered by Google App Engine
This is Rietveld 408576698