[webkit-changes] [WebKit/WebKit] ef0550: [Multicolumn] Improve balancing for border/padding...

Ahmad Saleem noreply at github.com
Mon Jan 23 14:57:02 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ef055036ec5c2072fe0e0b6a0c48124c10ec6ec4
      https://github.com/WebKit/WebKit/commit/ef055036ec5c2072fe0e0b6a0c48124c10ec6ec4
  Author: Ahmad Saleem <ahmad.saleem792+github at gmail.com>
  Date:   2023-01-23 (Mon, 23 Jan 2023)

  Changed paths:
    A LayoutTests/fast/multicol/balance-short-trailing-empty-block-expected.txt
    A LayoutTests/fast/multicol/balance-short-trailing-empty-block.html
    A LayoutTests/fast/multicol/balance-trailing-border-expected.txt
    A LayoutTests/fast/multicol/balance-trailing-border.html
    A LayoutTests/fast/multicol/balance-trailing-border2-expected.txt
    A LayoutTests/fast/multicol/balance-trailing-border2.html
    A LayoutTests/fast/multicol/balance-unbreakable-expected.txt
    A LayoutTests/fast/multicol/balance-unbreakable.html
    R LayoutTests/imported/blink/fast/multicol/span/block-with-top-border-and-margin-around-spanner-exact-fit-expected.html
    R LayoutTests/imported/blink/fast/multicol/span/block-with-top-border-and-margin-around-spanner-exact-fit.html
    R LayoutTests/imported/blink/fast/multicol/span/block-with-top-border-and-margin-around-spanner-extra-space-expected.html
    R LayoutTests/imported/blink/fast/multicol/span/block-with-top-border-and-margin-around-spanner-extra-space.html
    M LayoutTests/platform/glib/fast/multicol/border-padding-pagination-expected.txt
    M LayoutTests/platform/glib/fast/multicol/vertical-lr/border-padding-pagination-expected.txt
    M LayoutTests/platform/glib/fast/multicol/vertical-rl/border-padding-pagination-expected.txt
    M LayoutTests/platform/ios/fast/multicol/border-padding-pagination-expected.txt
    M LayoutTests/platform/ios/fast/multicol/vertical-lr/border-padding-pagination-expected.txt
    M LayoutTests/platform/ios/fast/multicol/vertical-rl/border-padding-pagination-expected.txt
    M LayoutTests/platform/mac/fast/multicol/border-padding-pagination-expected.png
    M LayoutTests/platform/mac/fast/multicol/border-padding-pagination-expected.txt
    M LayoutTests/platform/mac/fast/multicol/vertical-lr/border-padding-pagination-expected.png
    M LayoutTests/platform/mac/fast/multicol/vertical-lr/border-padding-pagination-expected.txt
    M LayoutTests/platform/mac/fast/multicol/vertical-rl/border-padding-pagination-expected.png
    M LayoutTests/platform/mac/fast/multicol/vertical-rl/border-padding-pagination-expected.txt
    M Source/WebCore/rendering/RenderBlockFlow.cpp

  Log Message:
  -----------
  [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@main




More information about the webkit-changes mailing list