aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wpt
diff options
context:
space:
mode:
authorOriol Brufau <obrufau@igalia.com>2025-03-10 15:09:43 +0100
committerGitHub <noreply@github.com>2025-03-10 14:09:43 +0000
commit56da4ad959a7679dce76fc1cc92c43e38b64472a (patch)
treec9e2ac94a4221312831b0b9086ee54a4d0488960 /tests/wpt
parent79e25a3e770ac5d25a79ba94be684e1dc6bdf9c1 (diff)
downloadservo-56da4ad959a7679dce76fc1cc92c43e38b64472a.tar.gz
servo-56da4ad959a7679dce76fc1cc92c43e38b64472a.zip
layout: Only prevent fixed table layout when `inline-size` is `auto` (#35882)
We were ignoring `table-layout: fixed` both for `inline-size: auto` and `inline-size: max-content`. However, the CSSWG resolved that fixed table layout should be triggered except when `inline-size` is `auto`. https://github.com/w3c/csswg-drafts/issues/10937#issuecomment-2669150397 Blink has already adopted this change, and they modified the WPT `/css/css-tables/fixed-layout-2.html` accordingly. Here I'm doing some further cosmetic cleanups to the test. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Diffstat (limited to 'tests/wpt')
-rw-r--r--tests/wpt/meta/MANIFEST.json2
-rw-r--r--tests/wpt/meta/css/css-tables/fixed-layout-2.html.ini3
-rw-r--r--tests/wpt/tests/css/css-tables/fixed-layout-2.html41
3 files changed, 22 insertions, 24 deletions
diff --git a/tests/wpt/meta/MANIFEST.json b/tests/wpt/meta/MANIFEST.json
index 3d9ae7c946f..28ef2f13014 100644
--- a/tests/wpt/meta/MANIFEST.json
+++ b/tests/wpt/meta/MANIFEST.json
@@ -596238,7 +596238,7 @@
]
],
"fixed-layout-2.html": [
- "8b805af7669ed914dc5f0d007a2ff8171f45d60a",
+ "d751954714cd7b8c1f5b87182d1025474c5c4939",
[
null,
{}
diff --git a/tests/wpt/meta/css/css-tables/fixed-layout-2.html.ini b/tests/wpt/meta/css/css-tables/fixed-layout-2.html.ini
deleted file mode 100644
index 387f3f4261a..00000000000
--- a/tests/wpt/meta/css/css-tables/fixed-layout-2.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[fixed-layout-2.html]
- [max-content]
- expected: FAIL
diff --git a/tests/wpt/tests/css/css-tables/fixed-layout-2.html b/tests/wpt/tests/css/css-tables/fixed-layout-2.html
index 8b805af7669..d751954714c 100644
--- a/tests/wpt/tests/css/css-tables/fixed-layout-2.html
+++ b/tests/wpt/tests/css/css-tables/fixed-layout-2.html
@@ -3,6 +3,7 @@
<link rel="author" title="Oriol Brufau" href="obrufau@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css-tables-3/#in-fixed-mode">
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/10937">
+<meta name="assert" content="Fixed table layout is triggered except when inline-size is auto.">
<link rel="stylesheet" href="./support/base.css">
<style>
@@ -52,26 +53,25 @@ x-td > div {
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
-let sizeData = {
- "10px": true,
- "100%": true,
- "calc(10px + 100%)": true,
- "auto": false,
- "min-content": true,
- "max-content": true,
- "fit-content": true,
- "calc-size(any, 10px + 100%)": true,
+let sizes = [
+ "10px",
+ "100%",
+ "calc(10px + 100%)",
+ "auto",
+ "min-content",
+ "max-content",
+ "fit-content",
+ "calc-size(any, 10px + 100%)",
+ "fit-content(0)",
+ "stretch",
+ "contain",
- // These expectations are tentative, see https://github.com/w3c/csswg-drafts/issues/10937
- "fit-content(0)": true,
- "stretch": true,
-
- // These are non-standard, expect the most popular behavior among the supporting implementations.
- "-moz-available": true,
- "-webkit-fill-available": true,
- "intrinsic": true,
- "min-intrinsic": true,
-};
+ // These are non-standard sizes.
+ "-moz-available",
+ "-webkit-fill-available",
+ "intrinsic",
+ "min-intrinsic",
+];
function checkSize(size, allowsFixed) {
let fragment = template.content.cloneNode(true);
@@ -101,8 +101,9 @@ function checkSize(size, allowsFixed) {
}, size);
}
-for (let [size, allowsFixed] of Object.entries(sizeData)) {
+for (let size of sizes) {
if (CSS.supports("width", size)) {
+ let allowsFixed = size !== "auto";
checkSize(size, allowsFixed);
// calc-size() should trigger fixed table layout.