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

Issue 25054004: Refactor LineBreaker::nextSegmentBreak and add a BreakingContext that holds all its state (Closed)

Created:
7 years, 2 months ago by leviw_travelin_and_unemployed
Modified:
7 years, 2 months ago
Reviewers:
igoroliveira, eae, eseidel
CC:
blink-reviews, eae+blinkwatch, leviw+renderwatch, jchaffraix+rendering
Visibility:
Public.

Description

Refactor LineBreaker::nextSegmentBreak and add a BreakingContext that holds all its state LineBreaker::nextSegmentBreak was around 600 lines of code, including multiple gotos and an enormous amount of state variables. In an effort to make it easier to follow what's going on in this very hot and very important function, I've attempted to refactor it into a series of inline functions representing how it processes different types of inline content. To hold onto all the state, I've added a BreakingContext. This let me get rid of the gotos and bring nextSegmentBreak down to about 50 lines. There's still a lot that can be done to make working with this code not awful. I believe there's a lot of simplification that can continue to occur in handleText, which is still pretty monolithic. Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=158487

Patch Set 1 #

Total comments: 2

Patch Set 2 : Fixing from eae's review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+717 lines, -576 lines) Patch
M Source/core/rendering/RenderBlockLineLayout.cpp View 1 7 chunks +717 lines, -576 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
leviw_travelin_and_unemployed
The diff here is a mess. If you can think of ways to improve BreakingContext ...
7 years, 2 months ago (2013-09-27 22:47:20 UTC) #1
eae
This is a great change, thanks for doing it. While you are cleaning up this ...
7 years, 2 months ago (2013-09-27 22:51:50 UTC) #2
leviw_travelin_and_unemployed
Doing that will cause this patch to balloon out into oblivion. I agree that this ...
7 years, 2 months ago (2013-09-27 23:05:31 UTC) #3
eae
On 2013/09/27 23:05:31, Levi wrote: > Doing that will cause this patch to balloon out ...
7 years, 2 months ago (2013-09-27 23:08:57 UTC) #4
eae
https://codereview.chromium.org/25054004/diff/1/Source/core/rendering/RenderBlockLineLayout.cpp File Source/core/rendering/RenderBlockLineLayout.cpp (left): https://codereview.chromium.org/25054004/diff/1/Source/core/rendering/RenderBlockLineLayout.cpp#oldcode2533 Source/core/rendering/RenderBlockLineLayout.cpp:2533: m_clear = CNONE; Where did this go? https://codereview.chromium.org/25054004/diff/1/Source/core/rendering/RenderBlockLineLayout.cpp File ...
7 years, 2 months ago (2013-09-27 23:09:04 UTC) #5
leviw_travelin_and_unemployed
PTAL
7 years, 2 months ago (2013-09-27 23:21:32 UTC) #6
eae
LGTM
7 years, 2 months ago (2013-09-27 23:23:39 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/leviw@chromium.org/25054004/10001
7 years, 2 months ago (2013-09-27 23:24:55 UTC) #8
commit-bot: I haz the power
7 years, 2 months ago (2013-09-28 04:29:43 UTC) #9
Message was sent while issue was closed.
Change committed as 158487

Powered by Google App Engine
This is Rietveld 408576698