From b77ec08ab6e72a607caac61f0518daa6d6009f87 Mon Sep 17 00:00:00 2001 From: Oriol Brufau Date: Wed, 27 Mar 2024 17:46:54 +0100 Subject: [PATCH] Ignore spaces before atomic inline for the min-content size (#31896) * Ignore spaces before atomic inline for the min-content size For the min-content size we should wrap lines wherever is possible, so wrappable spaces shouldn't increase the length of the line, they will just be removed or hang at the end of the line. * Add a clarifying comment Co-authored-by: Martin Robinson --------- Co-authored-by: Martin Robinson --- components/layout_2020/flow/inline.rs | 5 ++++- tests/wpt/meta/css/css-tables/absolute-tables-013.html.ini | 2 -- tests/wpt/meta/css/css-tables/absolute-tables-014.html.ini | 2 -- tests/wpt/meta/css/css-tables/absolute-tables-015.html.ini | 2 -- 4 files changed, 4 insertions(+), 7 deletions(-) delete mode 100644 tests/wpt/meta/css/css-tables/absolute-tables-013.html.ini delete mode 100644 tests/wpt/meta/css/css-tables/absolute-tables-014.html.ini delete mode 100644 tests/wpt/meta/css/css-tables/absolute-tables-015.html.ini diff --git a/components/layout_2020/flow/inline.rs b/components/layout_2020/flow/inline.rs index 1ef642a4405..6e668ec161d 100644 --- a/components/layout_2020/flow/inline.rs +++ b/components/layout_2020/flow/inline.rs @@ -2393,7 +2393,10 @@ impl<'a> ContentSizesComputation<'a> { self.containing_block_writing_mode, ); - self.current_line.min_content += self.pending_whitespace + outer.min_content; + // For the min-content size we should wrap lines wherever is possible, + // so wrappable spaces shouldn't increase the length of the line, + // they will just be removed or hang at the end of the line. + self.current_line.min_content += outer.min_content; self.current_line.max_content += self.pending_whitespace + outer.max_content; self.pending_whitespace = Au::zero(); self.had_content_yet = true; diff --git a/tests/wpt/meta/css/css-tables/absolute-tables-013.html.ini b/tests/wpt/meta/css/css-tables/absolute-tables-013.html.ini deleted file mode 100644 index 3538f440291..00000000000 --- a/tests/wpt/meta/css/css-tables/absolute-tables-013.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[absolute-tables-013.html] - expected: FAIL diff --git a/tests/wpt/meta/css/css-tables/absolute-tables-014.html.ini b/tests/wpt/meta/css/css-tables/absolute-tables-014.html.ini deleted file mode 100644 index df63f4fb359..00000000000 --- a/tests/wpt/meta/css/css-tables/absolute-tables-014.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[absolute-tables-014.html] - expected: FAIL diff --git a/tests/wpt/meta/css/css-tables/absolute-tables-015.html.ini b/tests/wpt/meta/css/css-tables/absolute-tables-015.html.ini deleted file mode 100644 index 01b34aeaa9b..00000000000 --- a/tests/wpt/meta/css/css-tables/absolute-tables-015.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[absolute-tables-015.html] - expected: FAIL