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

Issue 1164933006: Create LineLayout api (Closed)

Created:
5 years, 6 months ago by pilgrim_google
Modified:
5 years, 5 months ago
CC:
blink-reviews, blink-reviews-rendering, eae+blinkwatch, jchaffraix+rendering, Jeffrey Yasskin, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, szager+layoutwatch_chromium.org, zoltan1
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Create LineLayout api This is a first step in having the line layout code not talk directly to the LayoutObject hierarchy. Eventually, the plan is to fully isolate the LayoutObject hierarchy from the rest of the codebase (editing, DOM, paint, etc) and use include guards to enforce that. In this way, we can be explicit about not relying on implementation details outside of the box layout code. This is implemented by creating a POD wrapper around the equivalent LayoutObject class and passing them around by value. This is similar to what the web/ classes do (e.g. WebNode) and we believe this will be extremely low overhead performance wise and strictly equivalent memory wise. In this patch, there happens to be a LayoutObject class for each LineLayout* wrapper class, but that's not required (or even desired) in the end. The first step here is to isolate all the code to make it explicit which parts of the box layout code line layout current needs and then in a followup step to take a step back and figure out what the desired end result is. Not all files in the layout/line directory have been converted yet. Will occur in following patches. BUG=499321 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=198631

Patch Set 1 #

Total comments: 3

Patch Set 2 : naming nits, remove unimplemented operators #

Total comments: 1

Patch Set 3 : re-add TODO #

Patch Set 4 : rebase #

Total comments: 1

Patch Set 5 : rebase, nits #

Patch Set 6 : rebase after FloatingObjects refactor #

Patch Set 7 : WIP #

Patch Set 8 : WIP #

Patch Set 9 : move LineLayoutBlockFlow implementation to header #

Patch Set 10 : move LineLayoutBox implementation to header #

Patch Set 11 : all line API implementations now in headers #

Total comments: 6

Patch Set 12 : move constructors and destructors to headers as well #

Patch Set 13 : rebase, remove all friend classes within API classes #

Patch Set 14 : fix debug build #

Total comments: 3

Patch Set 15 : remove additional friend classes, restore const in ShapeOutsideInfo::computeDeltasForContainingBloc… #

Patch Set 16 : non-working version without const_cast #

Total comments: 1

Patch Set 17 : non-working version with explicit constructors #

Total comments: 5

Patch Set 18 : explicit constructors #

Patch Set 19 : [non-working] now with UnspecifiedBool #

Patch Set 20 : rebase, add additional equality operators #

Patch Set 21 : . #

Patch Set 22 : . #

Patch Set 23 : operator bool #

Patch Set 24 : no operator bool (causes layout failures?!?) #

Patch Set 25 : investigating test failures #

Patch Set 26 : remove operators #

Total comments: 1

Patch Set 27 : rebase + nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+682 lines, -140 lines) Patch
M Source/core/core.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +5 lines, -0 lines 0 comments Download
M Source/core/dom/Position.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +1 line, -1 line 0 comments Download
M Source/core/layout/BidiRun.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/layout/BidiRunForLine.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 5 chunks +6 lines, -6 lines 0 comments Download
M Source/core/layout/FloatingObjects.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +3 lines, -2 lines 0 comments Download
M Source/core/layout/LayoutBlockFlow.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 5 chunks +15 lines, -8 lines 0 comments Download
M Source/core/layout/LayoutBlockFlow.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/layout/LayoutBlockFlowLine.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 7 chunks +7 lines, -6 lines 0 comments Download
M Source/core/layout/LayoutBox.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 2 chunks +3 lines, -5 lines 0 comments Download
M Source/core/layout/LayoutBox.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 2 chunks +6 lines, -0 lines 0 comments Download
A Source/core/layout/api/LineLayoutBlockFlow.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +166 lines, -0 lines 0 comments Download
A Source/core/layout/api/LineLayoutBox.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +55 lines, -0 lines 0 comments Download
A Source/core/layout/api/LineLayoutInline.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +58 lines, -0 lines 0 comments Download
A Source/core/layout/api/LineLayoutItem.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +176 lines, -0 lines 0 comments Download
A Source/core/layout/api/LineLayoutText.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +57 lines, -0 lines 0 comments Download
M Source/core/layout/line/BreakingContext.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -1 line 0 comments Download
M Source/core/layout/line/BreakingContextInlineHeaders.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 21 chunks +40 lines, -29 lines 0 comments Download
M Source/core/layout/line/EllipsisBox.cpp View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/layout/line/InlineIterator.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 29 chunks +56 lines, -53 lines 0 comments Download
M Source/core/layout/line/LineBreaker.h View 3 chunks +3 lines, -2 lines 0 comments Download
M Source/core/layout/line/LineBreaker.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/layout/line/LineInfo.h View 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/layout/line/LineWidth.h View 1 2 3 4 5 3 chunks +3 lines, -3 lines 0 comments Download
M Source/core/layout/line/LineWidth.cpp View 1 2 3 4 5 6 7 3 chunks +4 lines, -3 lines 0 comments Download
M Source/core/layout/line/RootInlineBox.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/layout/line/TrailingObjects.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +4 lines, -3 lines 0 comments Download
M Source/core/layout/shapes/ShapeOutsideInfo.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/layout/shapes/ShapeOutsideInfo.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -1 line 0 comments Download
M Source/platform/text/BidiResolver.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +0 lines, -9 lines 0 comments Download

Messages

Total messages: 62 (6 generated)
pilgrim_google
forked from https://codereview.chromium.org/1149953007/ and rebased. now with MOAR NULLPTR
5 years, 6 months ago (2015-06-08 14:03:21 UTC) #2
leviw_travelin_and_unemployed
https://codereview.chromium.org/1164933006/diff/1/Source/core/layout/api/LineLayoutBox.h File Source/core/layout/api/LineLayoutBox.h (right): https://codereview.chromium.org/1164933006/diff/1/Source/core/layout/api/LineLayoutBox.h#newcode25 Source/core/layout/api/LineLayoutBox.h:25: LayoutBox* box(); For consistency, this should be toBox(). https://codereview.chromium.org/1164933006/diff/1/Source/core/layout/api/LineLayoutItem.h ...
5 years, 6 months ago (2015-06-08 18:14:28 UTC) #3
pilgrim_google
5 years, 6 months ago (2015-06-08 20:01:24 UTC) #4
leviw_travelin_and_unemployed
https://codereview.chromium.org/1164933006/diff/20001/Source/core/layout/api/LineLayoutItem.h File Source/core/layout/api/LineLayoutItem.h (right): https://codereview.chromium.org/1164933006/diff/20001/Source/core/layout/api/LineLayoutItem.h#newcode22 Source/core/layout/api/LineLayoutItem.h:22: operator LayoutObject*() const { return m_layoutObject; } You should ...
5 years, 6 months ago (2015-06-08 20:05:00 UTC) #5
pilgrim_google
5 years, 6 months ago (2015-06-08 20:08:35 UTC) #6
pilgrim_google
Please re-review.
5 years, 6 months ago (2015-06-10 01:34:03 UTC) #7
leviw_travelin_and_unemployed
I think we need a tracking bug for this (and other) API -- something that ...
5 years, 6 months ago (2015-06-10 21:11:27 UTC) #8
pilgrim_google
On 2015/06/10 at 21:11:27, leviw wrote: > I think we need a tracking bug for ...
5 years, 6 months ago (2015-06-11 14:51:07 UTC) #9
pilgrim_google
rebased, addressed feedback. pls re-review
5 years, 6 months ago (2015-06-11 14:53:19 UTC) #10
leviw_travelin_and_unemployed
On 2015/06/11 at 14:51:07, pilgrim wrote: > On 2015/06/10 at 21:11:27, leviw wrote: > > ...
5 years, 6 months ago (2015-06-11 20:40:27 UTC) #11
pilgrim_google
On 2015/06/11 at 20:40:27, leviw wrote: > On 2015/06/11 at 14:51:07, pilgrim wrote: > > ...
5 years, 6 months ago (2015-06-11 21:49:27 UTC) #12
leviw_travelin_and_unemployed
I'd give Linux a try. Just running the Blink perf tests (run-perf-tests) over the line ...
5 years, 6 months ago (2015-06-11 23:00:29 UTC) #13
pilgrim_google
On 2015/06/11 at 23:00:29, leviw wrote: > I'd give Linux a try. > > Just ...
5 years, 6 months ago (2015-06-12 00:19:55 UTC) #14
leviw_travelin_and_unemployed
On 2015/06/12 at 00:19:55, pilgrim wrote: > On 2015/06/11 at 23:00:29, leviw wrote: > > ...
5 years, 6 months ago (2015-06-12 00:24:16 UTC) #15
pilgrim_google
On 2015/06/12 at 00:24:16, leviw wrote: > Two things: > 1) You need to compare ...
5 years, 6 months ago (2015-06-12 00:56:19 UTC) #16
pilgrim_google
On 2015/06/12 at 00:56:19, pilgrim_google wrote: > On 2015/06/12 at 00:24:16, leviw wrote: > > ...
5 years, 6 months ago (2015-06-12 01:41:35 UTC) #17
leviw_travelin_and_unemployed
On 2015/06/12 at 01:41:35, pilgrim wrote: > On 2015/06/12 at 00:56:19, pilgrim_google wrote: > > ...
5 years, 6 months ago (2015-06-12 18:12:28 UTC) #18
leviw_travelin_and_unemployed
+jyasskin@ to sanity check our approach. Jeffrey, I'm happy to chat with you about this ...
5 years, 6 months ago (2015-06-12 18:14:44 UTC) #20
pilgrim_google
On 2015/06/12 at 18:12:28, leviw wrote: > This (almost surely) is due to the extra ...
5 years, 6 months ago (2015-06-16 14:22:29 UTC) #21
pilgrim_google
move LineLayoutBlockFlow implementation to header
5 years, 6 months ago (2015-06-16 20:46:34 UTC) #22
pilgrim_google
move LineLayoutBox implementation to header
5 years, 6 months ago (2015-06-16 20:53:03 UTC) #23
pilgrim_google
all line API implementations now in headers
5 years, 6 months ago (2015-06-16 21:33:53 UTC) #24
pilgrim_google
On 2015/06/12 at 18:12:28, leviw wrote: > This (almost surely) is due to the extra ...
5 years, 6 months ago (2015-06-16 22:01:43 UTC) #25
pilgrim_google
^^ those performance tests were comparing ToT to ToT+patch 11
5 years, 6 months ago (2015-06-16 22:02:27 UTC) #26
esprehn
https://codereview.chromium.org/1164933006/diff/200001/Source/core/layout/LayoutBlockFlow.h File Source/core/layout/LayoutBlockFlow.h (right): https://codereview.chromium.org/1164933006/diff/200001/Source/core/layout/LayoutBlockFlow.h#newcode500 Source/core/layout/LayoutBlockFlow.h:500: friend class LineLayoutBlockFlow; Please no friends, expose API instead. ...
5 years, 6 months ago (2015-06-17 20:16:27 UTC) #28
esprehn
https://codereview.chromium.org/1164933006/diff/200001/Source/core/layout/api/LineLayoutBox.cpp File Source/core/layout/api/LineLayoutBox.cpp (right): https://codereview.chromium.org/1164933006/diff/200001/Source/core/layout/api/LineLayoutBox.cpp#newcode13 Source/core/layout/api/LineLayoutBox.cpp:13: : LineLayoutItem(layoutBox) All the constructors and destructors need to ...
5 years, 6 months ago (2015-06-17 20:29:53 UTC) #29
pilgrim_google
Baseline (no patch): pilgrim@z620:~/work/src/third_party/WebKit% Tools/Scripts/run-perf-tests PerformanceTests/Layout/line-layout* Running 2 tests Running Layout/line-layout-line-height.html (1 of 2) DESCRIPTION: ...
5 years, 6 months ago (2015-06-18 01:52:35 UTC) #30
pilgrim_google
Will get rid of all my friends tomorrow.
5 years, 6 months ago (2015-06-18 01:53:54 UTC) #31
leviw_travelin_and_unemployed
On 2015/06/18 at 01:52:35, pilgrim wrote: > Baseline (no patch): > > pilgrim@z620:~/work/src/third_party/WebKit% Tools/Scripts/run-perf-tests PerformanceTests/Layout/line-layout* ...
5 years, 6 months ago (2015-06-18 22:45:54 UTC) #32
pilgrim_google
On 2015/06/18 at 22:45:54, leviw wrote: > On 2015/06/18 at 01:52:35, pilgrim wrote: > > ...
5 years, 6 months ago (2015-06-22 14:07:50 UTC) #33
pilgrim_google
5 years, 6 months ago (2015-06-22 14:08:00 UTC) #34
leviw_travelin_and_unemployed
https://codereview.chromium.org/1164933006/diff/260001/Source/core/layout/FloatingObjects.cpp File Source/core/layout/FloatingObjects.cpp (right): https://codereview.chromium.org/1164933006/diff/260001/Source/core/layout/FloatingObjects.cpp#newcode519 Source/core/layout/FloatingObjects.cpp:519: ShapeOutsideDeltas shapeDeltas = shapeOutside->computeDeltasForContainingBlockLine(const_cast<LayoutBlockFlow*>(m_layoutObject), floatingObject, m_lineTop, m_lineBottom - m_lineTop); ...
5 years, 6 months ago (2015-06-23 18:39:19 UTC) #35
pilgrim_google
On 2015/06/23 at 18:39:19, leviw wrote: > https://codereview.chromium.org/1164933006/diff/260001/Source/core/layout/FloatingObjects.cpp > File Source/core/layout/FloatingObjects.cpp (right): > > https://codereview.chromium.org/1164933006/diff/260001/Source/core/layout/FloatingObjects.cpp#newcode519 ...
5 years, 6 months ago (2015-06-23 18:43:15 UTC) #36
pilgrim_google
On 2015/06/23 at 18:43:15, pilgrim_google wrote: > On 2015/06/23 at 18:39:19, leviw wrote: > > ...
5 years, 6 months ago (2015-06-23 19:59:32 UTC) #37
leviw_travelin_and_unemployed
On 2015/06/23 at 19:59:32, pilgrim wrote: > On 2015/06/23 at 18:43:15, pilgrim_google wrote: > > ...
5 years, 6 months ago (2015-06-23 20:07:12 UTC) #38
pilgrim_google
On 2015/06/23 at 20:07:12, leviw wrote: > On 2015/06/23 at 19:59:32, pilgrim wrote: > > ...
5 years, 6 months ago (2015-06-23 20:19:06 UTC) #39
leviw_travelin_and_unemployed
On 2015/06/23 at 20:19:06, pilgrim wrote: > On 2015/06/23 at 20:07:12, leviw wrote: > > ...
5 years, 6 months ago (2015-06-23 20:28:43 UTC) #40
leviw_travelin_and_unemployed
https://codereview.chromium.org/1164933006/diff/300001/Source/core/layout/api/LineLayoutBlockFlow.h File Source/core/layout/api/LineLayoutBlockFlow.h (right): https://codereview.chromium.org/1164933006/diff/300001/Source/core/layout/api/LineLayoutBlockFlow.h#newcode22 Source/core/layout/api/LineLayoutBlockFlow.h:22: LineLayoutBlockFlow(LayoutBlockFlow* blockFlow) We should make all these constructors explicit.
5 years, 6 months ago (2015-06-23 20:29:10 UTC) #41
leviw_travelin_and_unemployed
Perhaps some other folks can understand why this doesn't work. I'm confused. https://codereview.chromium.org/1164933006/diff/320001/Source/core/layout/api/LineLayoutItem.h File Source/core/layout/api/LineLayoutItem.h ...
5 years, 6 months ago (2015-06-23 21:51:46 UTC) #42
esprehn
https://codereview.chromium.org/1164933006/diff/320001/Source/core/layout/api/LineLayoutItem.h File Source/core/layout/api/LineLayoutItem.h (right): https://codereview.chromium.org/1164933006/diff/320001/Source/core/layout/api/LineLayoutItem.h#newcode16 Source/core/layout/api/LineLayoutItem.h:16: class LayoutObject; You don't need this forward decl, you ...
5 years, 6 months ago (2015-06-23 21:57:18 UTC) #43
leviw_travelin_and_unemployed
https://codereview.chromium.org/1164933006/diff/320001/Source/core/layout/api/LineLayoutItem.h File Source/core/layout/api/LineLayoutItem.h (right): https://codereview.chromium.org/1164933006/diff/320001/Source/core/layout/api/LineLayoutItem.h#newcode25 Source/core/layout/api/LineLayoutItem.h:25: explicit LineLayoutItem(const LineLayoutItem& item) : m_layoutObject(item.m_layoutObject) { } The ...
5 years, 6 months ago (2015-06-24 19:10:51 UTC) #44
pilgrim_google
On 2015/06/24 at 19:10:51, leviw wrote: > https://codereview.chromium.org/1164933006/diff/320001/Source/core/layout/api/LineLayoutItem.h > File Source/core/layout/api/LineLayoutItem.h (right): > > https://codereview.chromium.org/1164933006/diff/320001/Source/core/layout/api/LineLayoutItem.h#newcode25 ...
5 years, 6 months ago (2015-06-25 13:04:31 UTC) #45
pilgrim_google
On 2015/06/23 at 21:57:18, esprehn wrote: > https://codereview.chromium.org/1164933006/diff/320001/Source/core/layout/api/LineLayoutItem.h > File Source/core/layout/api/LineLayoutItem.h (right): > > https://codereview.chromium.org/1164933006/diff/320001/Source/core/layout/api/LineLayoutItem.h#newcode16 ...
5 years, 6 months ago (2015-06-25 13:05:03 UTC) #46
esprehn
On 2015/06/25 at 13:05:03, pilgrim wrote: > ... > > > https://codereview.chromium.org/1164933006/diff/320001/Source/core/layout/api/LineLayoutItem.h#newcode35 > > Source/core/layout/api/LineLayoutItem.h:35: ...
5 years, 6 months ago (2015-06-25 15:58:39 UTC) #47
pilgrim_google
On 2015/06/25 at 15:58:39, esprehn wrote: > On 2015/06/25 at 13:05:03, pilgrim wrote: > > ...
5 years, 6 months ago (2015-06-25 16:06:06 UTC) #48
esprehn
On 2015/06/25 at 16:06:06, pilgrim wrote: > ... > > > > You should try ...
5 years, 6 months ago (2015-06-25 16:24:17 UTC) #49
pilgrim_google
On 2015/06/25 at 16:24:17, esprehn wrote: > Copy pasta: > > // This conversion operator ...
5 years, 6 months ago (2015-06-25 17:55:39 UTC) #50
Jeffrey Yasskin
On 2015/06/25 16:24:17, esprehn wrote: > On 2015/06/25 at 16:06:06, pilgrim wrote: > > ...
5 years, 6 months ago (2015-06-25 20:37:01 UTC) #51
pilgrim_google
On 2015/06/25 at 20:37:01, jyasskin wrote: > On 2015/06/25 16:24:17, esprehn wrote: > > On ...
5 years, 6 months ago (2015-06-26 12:58:14 UTC) #52
jsbell
Drive-by: I think you can just add this to LineLayoutItem: + bool operator==(const LineLayoutItem& other) ...
5 years, 6 months ago (2015-06-26 20:29:01 UTC) #53
pilgrim_google
Explicit constructors and UnspecifiedBool work now. Please re-review
5 years, 5 months ago (2015-06-29 14:24:25 UTC) #54
jsbell
Bleah - msvc and gcc might need an explicit operator!
5 years, 5 months ago (2015-06-29 16:56:03 UTC) #55
pilgrim_google
Fancy operators cause crashes in ~dozen layout tests for reasons that are beyond my debugging ...
5 years, 5 months ago (2015-07-09 15:09:21 UTC) #57
leviw_travelin_and_unemployed
LGTM! Nice job! Thanks for sticking with this! https://codereview.chromium.org/1164933006/diff/500001/Source/core/layout/api/LineLayoutItem.h File Source/core/layout/api/LineLayoutItem.h (right): https://codereview.chromium.org/1164933006/diff/500001/Source/core/layout/api/LineLayoutItem.h#newcode34 Source/core/layout/api/LineLayoutItem.h:34: // ...
5 years, 5 months ago (2015-07-09 19:36:52 UTC) #58
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1164933006/520001
5 years, 5 months ago (2015-07-09 20:25:07 UTC) #61
commit-bot: I haz the power
5 years, 5 months ago (2015-07-09 21:40:45 UTC) #62
Message was sent while issue was closed.
Committed patchset #27 (id:520001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=198631

Powered by Google App Engine
This is Rietveld 408576698