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

Issue 2509813004: Improve strut handling in initial column balancing pass. (Closed)

Created:
4 years, 1 month ago by mstensho (USE GERRIT)
Modified:
4 years, 1 month ago
Reviewers:
eae, szager1
CC:
chromium-reviews, szager+layoutwatch_chromium.org, zoltan1, blink-reviews-layout_chromium.org, pdr+renderingwatchlist_chromium.org, eae+blinkwatch, leviw+renderwatch, jchaffraix+rendering, blink-reviews, mstensho (USE GERRIT)
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Improve strut handling in initial column balancing pass. Only use the pagination strut from the first object or line (in each parallel flow [1]) that we find at a page break. When we need to break before some content, we may end up setting the pagination strut on some ancestor of said content, rather than on the content (layout object or line box). This happens when there's no break opportunity (class A, B or C break point [2]) before the content that doesn't fit in its current fragmentainer (there's no break opportunity before the first line in a block, for instance). In such cases we need to propagate the strut to some ancestor that comes after a valid break opportunity. In such situations, there'll be severeal layout objects or line boxes that start at the exact top of the next fragmentainer. Only the first object in layout tree order will have the strut. Subsequent objects (children, typically) or lines that also are flush with the top of the fragmentainer will have a strut of 0. We shouldn't overwrite the actual strut with 0, or we risk overstretching the columns. At each break we need to know the exact amount of space that was "wasted" because of the break, and subtract it, in order to calculate a minimal column height. [1] https://www.w3.org/TR/css-break-3/#parallel-flows [2] https://www.w3.org/TR/css-break-3/#possible-breaks We also need to make sure that we associate breaks with the right column when balancing, i.e. the former column, not the latter. This distinction matters if the pagination strut is 0 and we're at the exact top/bottom of some column. This CL also enables using specified column height even when balancing a multicol container. It may be that the final column height will actually be the same as the specified height, which means that if we set it right away, we might be able to eliminate a subsequent layout pass [1]. Almost more importantly, doing this will exercise code in the column balancer that was previously only used when balancing inside nested multicol. This in turn means that it will become less cumbersome to write tests for this code, and hopefully more difficult for bugs to hide in there as well. [1] LayoutTests/paint/invalidation/column-rules-fixed-height.html no longer requires the contents of the multicol container to be relaid out when column-rule changes. Committed: https://crrev.com/5c2f73741d5087c50451a67089e26b071982acd1 Cr-Commit-Position: refs/heads/master@{#433166}

Patch Set 1 #

Patch Set 2 : Rebaseline for column-rules-fixed-height. This test no longer triggers deep layout. #

Messages

Total messages: 15 (10 generated)
mstensho (USE GERRIT)
I'm trying to get rid of some pagination code from LayoutBlockFlow::layoutBlockFlow() before I refactor the ...
4 years, 1 month ago (2016-11-17 21:59:13 UTC) #4
eae
This is awesome! LGTM
4 years, 1 month ago (2016-11-17 22:01:24 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2509813004/20001
4 years, 1 month ago (2016-11-18 09:13:20 UTC) #11
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 1 month ago (2016-11-18 10:27:57 UTC) #13
commit-bot: I haz the power
4 years, 1 month ago (2016-11-18 10:30:10 UTC) #15
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/5c2f73741d5087c50451a67089e26b071982acd1
Cr-Commit-Position: refs/heads/master@{#433166}

Powered by Google App Engine
This is Rietveld 408576698