From 0fe453514db9e76e3457a49ddd9960529e560f2a Mon Sep 17 00:00:00 2001 From: Morten Stenshorne Date: Tue, 14 Sep 2021 10:01:04 +0000 Subject: [PATCH] Bug 1729892 [wpt PR 30420] - Improve breaking before nested multicols and their rows., a=testonly Automatic update from web-platform-tests Improve breaking before nested multicols and their rows. 1. Avoid breaking inside an inner multicol fragment if there were suboptimal breaks inside even if the inner multicol container didn't break in the outer fragmentation context. multicol-nested-018.html, multicol-nested-022.html and multicol-nested-023.html test this. 2. Properly constrain balanced column block-size to remaining space in the outer fragmentainer. We used to let unbreakable content override the remaining space, but this is wrong. This fixes forced-break-too-short-column.html and nested-short-first-row-extra-tall-line.html Store break appeal in NGLayoutResult, rather than in NGBreakToken. The reason is that we may have a violating break inside a fragment that happened inside a nested fragmentation context, even if the fragment doesn't necessarily break within the outer fragmentation context. Also create a proper break token inside a nested multicol container if there is none and we want to break before the first piece of column content. Calling SetDidBreakSelf() manually, like we used to, confused FinishFragmentation() into thinking that we were past the end of the block-end content box of the multicol container. This is tested by nested-with-padding.html Because of this change, the code in PreviousInnerFragmentainerIndex() needed an update, to ignore this break token, since break-before tokens don't have a sequence number. Remove the has_violating_descendant_break flag, and use the break appeal in the layout result instead. We had a column-balancing bug where where we were missing break-inside:avoid violations, because such violations don't affect the child's stored break appeal (the reason for this is explained in further detail inside CalculateBreakAppealInside()). Such violations were already propagated correctly to the builder's break appeal, so now it just works. This is tested by multicol-fill-balance-014.html . Also remove LayoutNGBlockFragmentation-specific baselines for moz-multicol3-column-balancing-break-inside-avoid-1.html because of this, as we now render identically to the legacy engine. This change fixes some existing tests. It also made outer-column-break-after-inner-spanner-2.html render correctly, but not according to the expectation, which was written for the legacy engine. The legacy engine fails to push the block with the BR inside entirely to the next outer fragmentainer. So replce it with a correct test: multicol-nested-017.html Bug: 829028 Change-Id: I13b2d95a0eb0407a82c8c24070a6dff4d2f620e1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3150413 Commit-Queue: Morten Stenshorne Reviewed-by: Ian Kilpatrick Cr-Commit-Position: refs/heads/main@{#919825} -- wpt-commits: 3d56f2cc3e241a413c6801597a5895eeb9c1dded wpt-pr: 30420 --- .../multicol-fill-balance-014.html | 14 +++++++++ .../css/css-multicol/multicol-nested-017.html | 20 ++++++++++++ .../css/css-multicol/multicol-nested-018.html | 29 +++++++++++++++++ .../css/css-multicol/multicol-nested-019.html | 31 +++++++++++++++++++ .../css/css-multicol/multicol-nested-020.html | 31 +++++++++++++++++++ .../css/css-multicol/multicol-nested-021.html | 22 +++++++++++++ .../css/css-multicol/multicol-nested-022.html | 14 +++++++++ .../css/css-multicol/multicol-nested-023.html | 14 +++++++++ .../css/css-multicol/multicol-nested-024.html | 16 ++++++++++ 9 files changed, 191 insertions(+) create mode 100644 testing/web-platform/tests/css/css-multicol/multicol-fill-balance-014.html create mode 100644 testing/web-platform/tests/css/css-multicol/multicol-nested-017.html create mode 100644 testing/web-platform/tests/css/css-multicol/multicol-nested-018.html create mode 100644 testing/web-platform/tests/css/css-multicol/multicol-nested-019.html create mode 100644 testing/web-platform/tests/css/css-multicol/multicol-nested-020.html create mode 100644 testing/web-platform/tests/css/css-multicol/multicol-nested-021.html create mode 100644 testing/web-platform/tests/css/css-multicol/multicol-nested-022.html create mode 100644 testing/web-platform/tests/css/css-multicol/multicol-nested-023.html create mode 100644 testing/web-platform/tests/css/css-multicol/multicol-nested-024.html diff --git a/testing/web-platform/tests/css/css-multicol/multicol-fill-balance-014.html b/testing/web-platform/tests/css/css-multicol/multicol-fill-balance-014.html new file mode 100644 index 000000000000..4ed80eb8d82d --- /dev/null +++ b/testing/web-platform/tests/css/css-multicol/multicol-fill-balance-014.html @@ -0,0 +1,14 @@ + + + +

Test passes if there is a filled green square below.

+
+
+
+ + + diff --git a/testing/web-platform/tests/css/css-multicol/multicol-nested-017.html b/testing/web-platform/tests/css/css-multicol/multicol-nested-017.html new file mode 100644 index 000000000000..79952189d517 --- /dev/null +++ b/testing/web-platform/tests/css/css-multicol/multicol-nested-017.html @@ -0,0 +1,20 @@ + + + + + +

Test passes if there is a filled green square and no red.

+
+
+
+
+
+
+
+ +

+
+
+
+
+
diff --git a/testing/web-platform/tests/css/css-multicol/multicol-nested-018.html b/testing/web-platform/tests/css/css-multicol/multicol-nested-018.html new file mode 100644 index 000000000000..3e19ec0f8c1b --- /dev/null +++ b/testing/web-platform/tests/css/css-multicol/multicol-nested-018.html @@ -0,0 +1,29 @@ + + + + + + +

Test passes if there is a filled green square and no red.

+
+
+
+
+

+

+
+
+
diff --git a/testing/web-platform/tests/css/css-multicol/multicol-nested-019.html b/testing/web-platform/tests/css/css-multicol/multicol-nested-019.html new file mode 100644 index 000000000000..13242ff19bf0 --- /dev/null +++ b/testing/web-platform/tests/css/css-multicol/multicol-nested-019.html @@ -0,0 +1,31 @@ + + + + + + + +

Test passes if there is a filled green square and no red.

+
+

+

+

+
+

+

+
+
+
diff --git a/testing/web-platform/tests/css/css-multicol/multicol-nested-020.html b/testing/web-platform/tests/css/css-multicol/multicol-nested-020.html new file mode 100644 index 000000000000..f191fa5f310e --- /dev/null +++ b/testing/web-platform/tests/css/css-multicol/multicol-nested-020.html @@ -0,0 +1,31 @@ + + + + + + + +

Test passes if there is a filled green square and no red.

+
+
+
+
+

+

+
+
+
+
diff --git a/testing/web-platform/tests/css/css-multicol/multicol-nested-021.html b/testing/web-platform/tests/css/css-multicol/multicol-nested-021.html new file mode 100644 index 000000000000..2e82d93ec27e --- /dev/null +++ b/testing/web-platform/tests/css/css-multicol/multicol-nested-021.html @@ -0,0 +1,22 @@ + + + + + +

Test passes if there is a filled green square and no red.

+
+ +
+
+ +
+ +
+ +
+
+
+
+
diff --git a/testing/web-platform/tests/css/css-multicol/multicol-nested-022.html b/testing/web-platform/tests/css/css-multicol/multicol-nested-022.html new file mode 100644 index 000000000000..24ec705202d3 --- /dev/null +++ b/testing/web-platform/tests/css/css-multicol/multicol-nested-022.html @@ -0,0 +1,14 @@ + + + + + +

Test passes if there is a filled green square and no red.

+
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/css/css-multicol/multicol-nested-023.html b/testing/web-platform/tests/css/css-multicol/multicol-nested-023.html new file mode 100644 index 000000000000..df52e8803607 --- /dev/null +++ b/testing/web-platform/tests/css/css-multicol/multicol-nested-023.html @@ -0,0 +1,14 @@ + + + + + +

Test passes if there is a filled green square and no red.

+
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/css/css-multicol/multicol-nested-024.html b/testing/web-platform/tests/css/css-multicol/multicol-nested-024.html new file mode 100644 index 000000000000..e11b27c6823d --- /dev/null +++ b/testing/web-platform/tests/css/css-multicol/multicol-nested-024.html @@ -0,0 +1,16 @@ + + + + + +

Test passes if there is a filled green square and no red.

+
+
+
+
+
+
+
+
+
+