Skip to content

Commit

Permalink
layout: Add initial support for row height distribution
Browse files Browse the repository at this point in the history
This change adds a version of row height distribution that follows the
distribtuion algorithm used for tables in Blink's LayoutNG. This is just
an intermediate step toward implementing a distribution algorithm for
both rows and columns more similar to Layout NG.

The CSS Table 3 specification is often wrong with regard to web
compatability, which is why we have abandoned it in favor of the Layout
NG algorithm for row height distribution.  this work.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
  • Loading branch information
mrobinson and Loirooriol committed Feb 29, 2024
1 parent ffc9730 commit b4f605e
Show file tree
Hide file tree
Showing 49 changed files with 587 additions and 298 deletions.
20 changes: 13 additions & 7 deletions components/layout_2020/sizing.rs
Expand Up @@ -24,13 +24,6 @@ pub(crate) struct ContentSizes {

/// <https://drafts.csswg.org/css-sizing/#intrinsic-sizes>
impl ContentSizes {
pub fn zero() -> Self {
Self {
min_content: Au::zero(),
max_content: Au::zero(),
}
}

pub fn map(&self, f: impl Fn(Au) -> Au) -> Self {
Self {
min_content: f(self.min_content),
Expand All @@ -57,6 +50,19 @@ impl ContentSizes {
}
}

impl Zero for ContentSizes {
fn zero() -> Self {
Self {
min_content: Au::zero(),
max_content: Au::zero(),
}
}

fn is_zero(&self) -> bool {
self.min_content.is_zero() && self.max_content.is_zero()
}
}

impl Add for ContentSizes {
type Output = Self;

Expand Down
655 changes: 526 additions & 129 deletions components/layout_2020/table/layout.rs

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions tests/wpt/meta/css/CSS2/tables/height-table-cell-001.xht.ini

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions tests/wpt/meta/css/CSS2/tables/row-visibility-002.xht.ini

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions tests/wpt/meta/css/CSS2/tables/table-cell-001.xht.ini

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

15 changes: 0 additions & 15 deletions tests/wpt/meta/css/css-tables/bounding-box-computation-1.html.ini

This file was deleted.

3 changes: 0 additions & 3 deletions tests/wpt/meta/css/css-tables/chrome-rowspan-bug.html.ini

This file was deleted.

6 changes: 3 additions & 3 deletions tests/wpt/meta/css/css-tables/column-track-merging.html.ini
Expand Up @@ -2,9 +2,6 @@
[main table 1]
expected: FAIL

[main table 2]
expected: FAIL

[main table 4]
expected: FAIL

Expand All @@ -31,3 +28,6 @@

[main table 3]
expected: FAIL

[main table 2]
expected: FAIL

This file was deleted.

@@ -1,10 +1,4 @@
[computing-row-measure-0.html]
[Checking intermediate min-content height for span 1 (1)]
expected: FAIL

[Checking intermediate min-content height for span 1 (3)]
expected: FAIL

[Checking intermediate min-content height for span 1 (2)]
expected: FAIL

Expand Down
@@ -1,9 +1,9 @@
[computing-row-measure-1.html]
[Checking intermediate min-content width for span 2 (1)]
[Checking intermediate min-content width for span 2 (4)]
expected: FAIL

[Checking intermediate min-content width for span 2 (2)]
[Checking intermediate min-content width for span 2 (1)]
expected: FAIL

[Checking intermediate min-content width for span 2 (4)]
[Checking intermediate min-content width for span 2 (2)]
expected: FAIL
12 changes: 0 additions & 12 deletions tests/wpt/meta/css/css-tables/html5-table-formatting-2.html.ini
Expand Up @@ -11,26 +11,14 @@
[Border-spacing is added between any two unmerged columns (2)]
expected: FAIL

[Border-spacing is added between any two unmerged rows (2)]
expected: FAIL

[Border-spacing is added between any two unmerged columns (3)]
expected: FAIL

[Border-spacing is added between any two unmerged rows (3)]
expected: FAIL

[Border-spacing is added between any two unmerged columns (4)]
expected: FAIL

[Border-spacing is added between any two unmerged rows (4)]
expected: FAIL

[Border-spacing is added between any two unmerged columns (5)]
expected: FAIL

[Border-spacing is added between any two unmerged rows (5)]
expected: FAIL

[Explicitely defined rows are not merged]
expected: FAIL

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions tests/wpt/meta/css/css-tables/table-model-fixup.html.ini
Expand Up @@ -2,9 +2,6 @@
[2.1. An anonymous table-row box must be generated around each sequence of consecutive children of a table-root box which are not proper table child boxes. (1/2)]
expected: FAIL

[2.1. An anonymous table-row box must be generated around each sequence of consecutive children of a table-root box which are not proper table child boxes. (2/2)]
expected: FAIL

[2.2. An anonymous table-row box must be generated around each sequence of consecutive children of a table-row-grouping box which are not table-row boxes. (1/3)]
expected: FAIL

Expand Down
9 changes: 0 additions & 9 deletions tests/wpt/meta/css/css-tables/tentative/baseline-td.html.ini
Expand Up @@ -2,14 +2,5 @@
[table, .display-table 1]
expected: FAIL

[table, .display-table 2]
expected: FAIL

[table, .display-table 3]
expected: FAIL

[table, .display-table 4]
expected: FAIL

[table, .display-table 5]
expected: FAIL
Expand Up @@ -14,9 +14,6 @@
[table 6]
expected: FAIL

[table 7]
expected: FAIL

[table 9]
expected: FAIL

Expand Down Expand Up @@ -85,3 +82,6 @@

[table 8]
expected: FAIL

[table 7]
expected: FAIL
@@ -1,4 +1,16 @@
[rowspan-height-redistribution.html]
[table 7]
expected: FAIL

[table 8]
expected: FAIL

[table 22]
expected: FAIL

[table 23]
expected: FAIL

[table 2]
expected: FAIL

Expand All @@ -14,13 +26,19 @@
[table 6]
expected: FAIL

[table 7]
[table 9]
expected: FAIL

[table 8]
[table 10]
expected: FAIL

[table 9]
[table 11]
expected: FAIL

[table 12]
expected: FAIL

[table 13]
expected: FAIL

[table 14]
Expand All @@ -29,23 +47,20 @@
[table 15]
expected: FAIL

[table 16]
expected: FAIL

[table 17]
expected: FAIL

[table 18]
expected: FAIL

[table 19]
[table 20]
expected: FAIL

[table 21]
expected: FAIL

[table 22]
expected: FAIL

[table 23]
expected: FAIL

[table 20]
[table 24]
expected: FAIL
Expand Up @@ -56,9 +56,6 @@
[table 23]
expected: FAIL

[table 24]
expected: FAIL

[table 25]
expected: FAIL

Expand Down
Expand Up @@ -14,9 +14,6 @@
[table 6]
expected: FAIL

[table 7]
expected: FAIL

[table 9]
expected: FAIL

Expand All @@ -37,3 +34,6 @@

[table 15]
expected: FAIL

[table 7]
expected: FAIL
Expand Up @@ -26,9 +26,6 @@
[table 11]
expected: FAIL

[table 12]
expected: FAIL

[table 14]
expected: FAIL

Expand Down Expand Up @@ -58,3 +55,6 @@

[table 26]
expected: FAIL

[table 12]
expected: FAIL
Expand Up @@ -14,9 +14,6 @@
[table 5]
expected: FAIL

[table 6]
expected: FAIL

[table 7]
expected: FAIL

Expand Down
Expand Up @@ -11,9 +11,6 @@
[table 6]
expected: FAIL

[table 7]
expected: FAIL

[table 8]
expected: FAIL

Expand Down

0 comments on commit b4f605e

Please sign in to comment.