Commit ef05503
[Multicolumn] Improve balancing for border/padding and empty block content
[Multicolumn] Improve balancing for border/padding and empty block content
https://bugs.webkit.org/show_bug.cgi?id=250393
rdar://104336682
Reviewed by Alan Baradlay.
This patch is to align WebKit with Blink / Chromium and Gecko / Firefox.
Merge - https://chromium.googlesource.com/chromium/blink/+/89bca046c2cbea43e38ff1901e0739c2eead5b04
In a balancing pass, when a break occurs at borders, padding or empty block
content (the trailing part of a block that has no lines or other content),
we need to report the correct amount of space shortage, so that the balancer
doesn't over-stretch the columns for the next balancing pass.
Breaks triggered by lines are already handled just fine in
adjustLinePositionForPagination(). What we need to handle in
adjustBlockChildForPagination() is everything that has to do with the
child block itself.
If a block is unbreakable and crosses a column/page boundary (and
therefore is moved as a whole to the next column/page), report space
shortage.
After applying pagination struts, if a block is breakable and crosses
yet another column/page boundary, report the space occupied in the next
columns/pages as shortage. We need to report something if all breaks
occur inside freely breakable block content, or the balancer will have
no clue.
If none of the above is true, and the child is at the top of a
column/page, report the total height of the child, in case that turns
out to be the smallest piece of content that causes a break. This also
needs to take place after having applied pagination struts.
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(RenderBlockFlow::adjustBlockChildForPagination): Update balancing criteria
* LayoutTests/fast/multicol/balance-unbreakable.html: Add Test Case
* LayoutTests/fast/multicol/balance-unbreakable-expected.txt: Add Test Case Expectation
* LayoutTests/fast/multicol/trailing-border.html: Add Test Case
* LayoutTests/fast/multicol/trailing-border-expected.txt: Add Test Case Expectation
* LayoutTests/fast/multicol/trailing-border2.html: Add Test Case
* LayoutTests/fast/multicol/trailing-border2-expected.txt: Add Test Case Expectation
* LayoutTests/fast/multicol/balance-short-trailing-empty-block.html: Add Test Case
* LayoutTests/fast/multicol/balance-short-trailing-empty-block-expected.txt: Add Test Case Expectation
* LayoutTests/platform/mac/fast/multicol/border-padding-pagination-expected.png: Rebaselined
* LayoutTests/platform/mac/fast/multicol/border-padding-pagination-expected.txt: Rebaselined
* LayoutTests/platform/mac/fast/multicol/vertical-lr/border-padding-pagination-expected.png: Rebaselined
* LayoutTests/platform/mac/fast/multicol/vertical-lr/border-padding-pagination-expected.txt: Rebaselined
* LayoutTests/platform/mac/fast/multicol/vertical-rl/border-padding-pagination-expected.png: Rebaselined
* LayoutTests/platform/mac/fast/multicol/vertical-rl/border-padding-pagination-expected.txt: Rebaselined
* LayoutTests/platform/glib/fast/multicol/border-padding-pagination-expected.txt: Rebaselined
* LayoutTests/platform/glib/fast/multicol/vertical-lr/border-padding-pagination-expected.txt: Rebaselined
* LayoutTests/platform/glib/fast/multicol/vertical-rl/border-padding-pagination-expected.txt: Rebaselined
* LayoutTests/platform/ios/fast/multicol/border-padding-pagination-expected.txt: Rebaselined
* LayoutTests/platform/ios/fast/multicol/vertical-lr/border-padding-pagination-expected.txt: Rebaselined
* LayoutTests/platform/ios/fast/multicol/vertical-rl/border-padding-pagination-expected.txt: Rebaselined
Deleted these LayoutTests in favor of WPT Tests and also
they render different in all browsers (multicol-fill-balance-0**.html):
* LayoutTests/imported/blink./fast/multicol/span/block-with-top-border-and-margin-around-spanner-exact-fit.html
* LayoutTests/imported/blink./fast/multicol/span/block-with-top-border-and-margin-around-spanner-exact-fit-expected.html
* LayoutTests/imported/blink/fast/multicol/span/block-with-top-border-and-margin-around-spanner-extra-space-expected.html
* LayoutTests/imported/blink/fast/multicol/span/block-with-top-border-and-margin-around-spanner-extra-space.html
Canonical link: https://commits.webkit.org/259246@main1 parent dd7dffb commit ef05503
File tree
25 files changed
+209
-106
lines changed- LayoutTests
- fast/multicol
- imported/blink/fast/multicol/span
- platform
- glib/fast/multicol
- vertical-lr
- vertical-rl
- ios/fast/multicol
- vertical-lr
- vertical-rl
- mac/fast/multicol
- vertical-lr
- vertical-rl
- Source/WebCore/rendering
25 files changed
+209
-106
lines changedLines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 0 additions & 10 deletions
This file was deleted.
0 commit comments