Skip to content

Commit afa16aa

Browse files
Loirooriolservo-wpt-sync
authored andcommitted
layout: Only prevent fixed table layout when inline-size is auto
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`. w3c/csswg-drafts#10937 (comment) 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 <[email protected]>
1 parent 827d52c commit afa16aa

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

css/css-tables/fixed-layout-2.html

+21-20
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<link rel="author" title="Oriol Brufau" href="[email protected]">
44
<link rel="help" href="https://drafts.csswg.org/css-tables-3/#in-fixed-mode">
55
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/10937">
6+
<meta name="assert" content="Fixed table layout is triggered except when inline-size is auto.">
67
<link rel="stylesheet" href="./support/base.css">
78

89
<style>
@@ -52,26 +53,25 @@ <h1>Fixed Layout</h1>
5253
<script src="/resources/testharness.js"></script>
5354
<script src="/resources/testharnessreport.js"></script>
5455
<script>
55-
let sizeData = {
56-
"10px": true,
57-
"100%": true,
58-
"calc(10px + 100%)": true,
59-
"auto": false,
60-
"min-content": true,
61-
"max-content": true,
62-
"fit-content": true,
63-
"calc-size(any, 10px + 100%)": true,
56+
let sizes = [
57+
"10px",
58+
"100%",
59+
"calc(10px + 100%)",
60+
"auto",
61+
"min-content",
62+
"max-content",
63+
"fit-content",
64+
"calc-size(any, 10px + 100%)",
65+
"fit-content(0)",
66+
"stretch",
67+
"contain",
6468

65-
// These expectations are tentative, see https://github.com/w3c/csswg-drafts/issues/10937
66-
"fit-content(0)": true,
67-
"stretch": true,
68-
69-
// These are non-standard, expect the most popular behavior among the supporting implementations.
70-
"-moz-available": true,
71-
"-webkit-fill-available": true,
72-
"intrinsic": true,
73-
"min-intrinsic": true,
74-
};
69+
// These are non-standard sizes.
70+
"-moz-available",
71+
"-webkit-fill-available",
72+
"intrinsic",
73+
"min-intrinsic",
74+
];
7575

7676
function checkSize(size, allowsFixed) {
7777
let fragment = template.content.cloneNode(true);
@@ -101,8 +101,9 @@ <h1>Fixed Layout</h1>
101101
}, size);
102102
}
103103

104-
for (let [size, allowsFixed] of Object.entries(sizeData)) {
104+
for (let size of sizes) {
105105
if (CSS.supports("width", size)) {
106+
let allowsFixed = size !== "auto";
106107
checkSize(size, allowsFixed);
107108

108109
// calc-size() should trigger fixed table layout.

0 commit comments

Comments
 (0)