DescriptionRefactor 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 #Messages
Total messages: 9 (0 generated)
|