mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
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>
This commit is contained in:
parent
79e25a3e77
commit
56da4ad959
4 changed files with 27 additions and 33 deletions
2
tests/wpt/meta/MANIFEST.json
vendored
2
tests/wpt/meta/MANIFEST.json
vendored
|
@ -596238,7 +596238,7 @@
|
|||
]
|
||||
],
|
||||
"fixed-layout-2.html": [
|
||||
"8b805af7669ed914dc5f0d007a2ff8171f45d60a",
|
||||
"d751954714cd7b8c1f5b87182d1025474c5c4939",
|
||||
[
|
||||
null,
|
||||
{}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
[fixed-layout-2.html]
|
||||
[max-content]
|
||||
expected: FAIL
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue