[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. Moved from a Reitveld CL[1]. [1] https://codereview.chromium.org/2955843002 Bug: 636993 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng Change-Id: Ideae5ae00374c500f858bb992d5d3203772829a2 Reviewed-on: https://chromium-review.googlesource.com/582249 Commit-Queue: Koji Ishii <kojii@chromium.org> Reviewed-by:Ian Kilpatrick <ikilpatrick@chromium.org> Cr-Commit-Position: refs/heads/master@{#492019}
Showing
Please register or sign in to comment