forked from mirrors/gecko-dev
Automatic update from web-platform-tests [TablesNG] min-content sizing fix Table width:min-content + layout:fixed should be treated as layout:fixed. Test case in a separate CL, part of tentative/table-width-redistribution test suite. Bug: 1171407 Change-Id: I2cf5d31b211d4b12f69018b71ad70cf0931fefa2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2653564 Commit-Queue: Aleks Totic <atotic@chromium.org> Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Cr-Commit-Position: refs/heads/master@{#848327} -- wpt-commits: d69e47c4659c318b0c7fb64d72ce387746eb84da wpt-pr: 27378
84 lines
3.4 KiB
HTML
84 lines
3.4 KiB
HTML
<!doctype html>
|
|
<script src='/resources/testharness.js'></script>
|
|
<script src='/resources/testharnessreport.js'></script>
|
|
<link rel='stylesheet' href='./support/base.css' />
|
|
<link rel="help" href="https://drafts.csswg.org/css-tables-3/#in-fixed-mode">
|
|
<main>
|
|
|
|
<h1>Fixed Layout</h1>
|
|
<p>Checks whether fixed layout is implemented properly (width is not definite)</p>
|
|
|
|
<hr/>
|
|
<p>This should be a 100px-wide blue square:</p>
|
|
<p>Table-layout:fixed does not apply to width:auto tables</p>
|
|
<x-table style="table-layout: fixed; border-spacing: 0px">
|
|
<x-tr>
|
|
<x-td style="padding: 0; background: blue; height: 100px;"><div style="width: 100px"></div></x-td>
|
|
<x-td style="padding: 0"></x-td>
|
|
</x-tr>
|
|
</x-table>
|
|
|
|
<hr/>
|
|
<p>This should be a 100px-wide blue square:</p>
|
|
<p>Table-layout:fixed does not apply to width:max-content tables</p>
|
|
<x-table style="table-layout: fixed; width: max-content; border-spacing: 0px">
|
|
<x-tr>
|
|
<x-td style="padding: 0; background: blue; height: 100px;"><div style="width: 100px"></div></x-td>
|
|
<x-td style="padding: 0"></x-td>
|
|
</x-tr>
|
|
</x-table>
|
|
|
|
<hr/>
|
|
<p>This should be a 100px-wide blue square:</p>
|
|
<p>Table-layout:fixed does apply to width:min-content/fit-content tables</p>
|
|
<x-table style="table-layout: fixed; width: fit-content; border-spacing: 0px">
|
|
<x-tr>
|
|
<x-td style="padding: 0; background: blue; height: 50px;"><div style="width: 100px"></div></x-td>
|
|
<x-td style="padding: 0"></x-td>
|
|
</x-tr>
|
|
</x-table>
|
|
<x-table style="table-layout: fixed; width: min-content; border-spacing: 0px">
|
|
<x-tr>
|
|
<x-td style="padding: 0; background: blue; height: 50px;width:100px;"><div style="width: 100px"></div></x-td>
|
|
<x-td style="padding: 0;height:50px"><div style="width: 100px"></div></x-td>
|
|
</x-tr>
|
|
</x-table>
|
|
|
|
</main>
|
|
|
|
<script>
|
|
while(true) {
|
|
var xtd = document.querySelector('x-td[rowspan], x-td[colspan]'); if(!xtd) break;
|
|
var td = document.createElement('td'); for(var i = xtd.attributes.length; i--;) { td.setAttribute(xtd.attributes[i].name,xtd.attributes[i].value) }
|
|
xtd.parentNode.replaceChild(td,xtd);
|
|
}
|
|
|
|
generate_tests(assert_equals, [
|
|
[
|
|
"Table-layout:fixed is not applied when width is auto",
|
|
document.querySelector("x-table:nth-of-type(1) > x-tr:first-child > x-td:first-child").offsetWidth,
|
|
100
|
|
],
|
|
[
|
|
"Table-layout:fixed reports fixed when width is auto",
|
|
getComputedStyle(document.querySelector("x-table:nth-of-type(1)")).tableLayout,
|
|
'fixed'
|
|
],
|
|
[
|
|
"Table-layout:fixed is not applied when width is max-content",
|
|
document.querySelector("x-table:nth-of-type(2) > x-tr:first-child > x-td:first-child").offsetWidth,
|
|
100
|
|
],
|
|
[
|
|
"Table-layout:fixed reports fixed when width is max-content",
|
|
getComputedStyle(document.querySelector("x-table:nth-of-type(2)")).tableLayout,
|
|
'fixed'
|
|
],
|
|
[
|
|
"Table-layout:fixed is applied when width is min-content",
|
|
document.querySelector("x-table:nth-of-type(3) > x-tr:first-child > x-td:first-child").offsetWidth,
|
|
document.querySelector("x-table:nth-of-type(4) > x-tr:first-child > x-td:first-child").offsetWidth
|
|
]
|
|
])
|
|
|
|
</script>
|