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

Issue 2955843002: [LayoutNG] Make floats push line boxes down if no break opportunities can fit

Created:
3 years, 5 months ago by kojii
Modified:
3 years, 5 months ago
CC:
atotic+reviews_chromium.org, blink-reviews, blink-reviews-layout_chromium.org, cbiesinger, chromium-reviews, dgrogan+ng_chromium.org, eae+blinkwatch, glebl+reviews_chromium.org, jchaffraix+rendering, lchoi+reviews_chromium.org, leviw+renderwatch, ojan+watch_chromium.org, pdr+renderingwatchlist_chromium.org, szager+layoutwatch_chromium.org, zoltan1
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[LayoutNG] Make floats push line boxes down if no break opportunities can fit When no break opportunities can fit in a line that has floats and/or exclusions, such line box should be pushed down to avoid them. A simple example is "float: left; width: 100%". This patch supports both 100% case and other cases in slightly different code paths since NGLayoutOpportunityIterator handles 100% case differently. Rewind() has been used for next lines, but this is the first case where NGLineBreaker rewinds and process the current line again. Initializing states is moved to NextLine() from BreakLine() to make this possible. This patch also includes fix to avoid processing the same floats twice. This should have been an issue when Rewind() is used, but it was not handled properly before. The fix isn't very clean though, this should be revisited. Refactoring suggested in Ian's review[1] is included. This groups states related to current line to a struct. [1] https://codereview.chromium.org/2931363002#msg30 BUG=636993 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_layout_ng

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : Minor fix #

Patch Set 4 : Rebase #

Patch Set 5 : Rebase, cleanup #

Patch Set 6 : Fixes and more cleanup #

Total comments: 6

Patch Set 7 : ikilpatrick review (add STACK_ALLOCATED) #

Patch Set 8 : Rebase #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+185 lines, -86 lines) Patch
M third_party/WebKit/LayoutTests/TestExpectations View 1 2 3 4 5 6 7 2 chunks +0 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.h View 1 2 3 4 5 6 2 chunks +46 lines, -18 lines 0 comments Download
M third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc View 1 2 3 4 5 6 7 24 chunks +133 lines, -64 lines 6 comments Download
M third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.h View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 43 (30 generated)
kojii
PTAL.
3 years, 5 months ago (2017-06-26 15:01:50 UTC) #5
kojii
NG bot test failures are ok, shape-outside tests pass today because of magic, and this ...
3 years, 5 months ago (2017-06-27 02:38:21 UTC) #7
ikilpatrick
On 2017/06/27 02:38:21, kojii wrote: > NG bot test failures are ok, shape-outside tests pass ...
3 years, 5 months ago (2017-06-27 20:33:22 UTC) #12
kojii
On 2017/06/27 at 20:33:22, ikilpatrick wrote: > On 2017/06/27 02:38:21, kojii wrote: > > NG ...
3 years, 5 months ago (2017-06-28 08:53:25 UTC) #13
kojii
Ian, is this now ready to review? Your last commit did not conflict at all, ...
3 years, 5 months ago (2017-07-13 12:54:23 UTC) #26
ianjkilpatrick
https://codereview.chromium.org/2955843002/diff/160001/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc File third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc (right): https://codereview.chromium.org/2955843002/diff/160001/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc#newcode123 third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc:123: PrepareNextLine(line_info); Ah i see, I prefer stack allocating this ...
3 years, 5 months ago (2017-07-14 16:51:21 UTC) #28
kojii
Thanks, CL updated and replies inline: https://codereview.chromium.org/2955843002/diff/160001/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc File third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc (right): https://codereview.chromium.org/2955843002/diff/160001/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc#newcode123 third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc:123: PrepareNextLine(line_info); Understood the ...
3 years, 5 months ago (2017-07-16 13:54:42 UTC) #31
kojii
word-break-all-wrap-with-floats.html may also be interesting. https://cs.chromium.org/chromium/src/third_party/WebKit/LayoutTests/fast/css3-text/css3-word-break/word-break-all-wrap-with-floats.html?q=word-break-all-wrap-with-floats.html&sq=package:chromium&dr When with "word-break: break-all", break opportunities change. This test ...
3 years, 5 months ago (2017-07-16 16:51:13 UTC) #34
kojii
A gentle reminder, just in case you no longer watch Rietveld.
3 years, 5 months ago (2017-07-20 04:18:08 UTC) #35
ianjkilpatrick
So I'm more than fine with the "line_" changes if you just want to submit ...
3 years, 5 months ago (2017-07-21 18:18:43 UTC) #40
kojii
Thank you for having a look, and creative ideas to solve things simpler. Replies inline: ...
3 years, 5 months ago (2017-07-23 07:01:10 UTC) #41
kojii
p.s. About first-line, I found better way to explain; we have IsFirstFormattedLine in NGLineBreaker, we ...
3 years, 5 months ago (2017-07-23 07:47:52 UTC) #42
kojii
3 years, 5 months ago (2017-07-23 14:57:20 UTC) #43
> So I'm more than fine with the "line_" changes if you just want to submit
that.

Let's split this part to avoid reviewing it multiple times then, and due to
deprecation of Reitveld, let me move to Gerrit by splitting.

Powered by Google App Engine
This is Rietveld 408576698