Update web-platform-tests to revision 43899f53083e4e6285d7a55d66745d8f6518950d

This commit is contained in:
WPT Sync Bot 2020-08-01 08:19:44 +00:00
parent 6499367fe2
commit 60e5c9a277
58 changed files with 359 additions and 134 deletions

View file

@ -4,7 +4,7 @@
expected: TIMEOUT expected: TIMEOUT
[Opening a blob URL in a new window immediately before revoking it works.] [Opening a blob URL in a new window immediately before revoking it works.]
expected: TIMEOUT expected: FAIL
[Fetching a blob URL immediately before revoking it works in an iframe.] [Fetching a blob URL immediately before revoking it works in an iframe.]
expected: FAIL expected: FAIL

View file

@ -0,0 +1,4 @@
[hit-test-floats-002.html]
[Hit test float]
expected: FAIL

View file

@ -0,0 +1,4 @@
[hit-test-floats-003.html]
[Miss float below something else]
expected: FAIL

View file

@ -0,0 +1,4 @@
[hit-test-floats-005.html]
[Miss clipped float]
expected: FAIL

View file

@ -1,2 +0,0 @@
[matchMedia-display-none-iframe.html]
expected: ERROR

View file

@ -312,18 +312,9 @@
[Response: combined response Content-Type: text/html;" \\" text/plain ";charset=GBK] [Response: combined response Content-Type: text/html;" \\" text/plain ";charset=GBK]
expected: NOTRUN expected: NOTRUN
[<iframe>: separate response Content-Type: text/html */*]
expected: FAIL
[<iframe>: separate response Content-Type: text/plain */*;charset=gbk] [<iframe>: separate response Content-Type: text/plain */*;charset=gbk]
expected: FAIL expected: FAIL
[<iframe>: separate response Content-Type: text/html;x=" text/plain]
expected: FAIL
[<iframe>: separate response Content-Type: text/html */*;charset=gbk]
expected: FAIL
[<iframe>: separate response Content-Type: text/plain */*] [<iframe>: separate response Content-Type: text/plain */*]
expected: FAIL expected: FAIL
@ -333,3 +324,15 @@
[<iframe>: combined response Content-Type: text/html;x=" text/plain] [<iframe>: combined response Content-Type: text/html;x=" text/plain]
expected: FAIL expected: FAIL
[<iframe>: combined response Content-Type: */* text/html]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;charset=gbk text/plain text/html]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;" text/plain]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;" \\" text/plain]
expected: FAIL

View file

@ -56,3 +56,9 @@
[separate text/javascript x/x] [separate text/javascript x/x]
expected: FAIL expected: FAIL
[separate text/javascript;charset=windows-1252 error text/javascript]
expected: FAIL
[separate text/javascript error]
expected: FAIL

View file

@ -11,6 +11,3 @@
[X-Content-Type-Options%3A%20nosniff%2C%2C%40%23%24%23%25%25%26%5E%26%5E*()()11!] [X-Content-Type-Options%3A%20nosniff%2C%2C%40%23%24%23%25%25%26%5E%26%5E*()()11!]
expected: FAIL expected: FAIL
[X-Content-Type-Options%3A%20%2Cnosniff]
expected: FAIL

View file

@ -1,4 +0,0 @@
[traverse_the_history_3.html]
[Multiple history traversals, last would be aborted]
expected: FAIL

View file

@ -1,4 +1,4 @@
[traverse_the_history_3.html] [traverse_the_history_5.html]
[Multiple history traversals, last would be aborted] [Multiple history traversals, last would be aborted]
expected: FAIL expected: FAIL

View file

@ -0,0 +1,2 @@
[cross-origin-objects-on-new-window.html]
expected: TIMEOUT

View file

@ -1,4 +1,5 @@
[embedded-opener-remove-frame.html] [embedded-opener-remove-frame.html]
expected: CRASH
[opener of discarded nested browsing context] [opener of discarded nested browsing context]
expected: FAIL expected: FAIL

View file

@ -1,5 +1,5 @@
[iframe_sandbox_popups_escaping-1.html] [iframe_sandbox_popups_escaping-1.html]
expected: TIMEOUT expected: CRASH
[Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used] [Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used]
expected: TIMEOUT expected: TIMEOUT

View file

@ -1,5 +1,5 @@
[iframe_sandbox_popups_escaping-2.html] [iframe_sandbox_popups_escaping-2.html]
expected: TIMEOUT expected: CRASH
[Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used] [Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used]
expected: TIMEOUT expected: TIMEOUT

View file

@ -1,5 +1,4 @@
[iframe_sandbox_popups_escaping-3.html] [iframe_sandbox_popups_escaping-3.html]
expected: TIMEOUT
[Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used] [Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used]
expected: TIMEOUT expected: FAIL

View file

@ -1,4 +1,5 @@
[iframe_sandbox_popups_nonescaping-1.html] [iframe_sandbox_popups_nonescaping-1.html]
expected: TIMEOUT
[Check that popups from a sandboxed iframe do not escape the sandbox] [Check that popups from a sandboxed iframe do not escape the sandbox]
expected: FAIL expected: NOTRUN

View file

@ -1,4 +1,5 @@
[iframe_sandbox_popups_nonescaping-3.html] [iframe_sandbox_popups_nonescaping-3.html]
expected: TIMEOUT
[Check that popups from a sandboxed iframe do not escape the sandbox] [Check that popups from a sandboxed iframe do not escape the sandbox]
expected: FAIL expected: NOTRUN

View file

@ -0,0 +1,4 @@
[DOMContentLoaded-defer.html]
[The end: DOMContentLoaded and defer scripts]
expected: FAIL

View file

@ -1,4 +0,0 @@
[load-event-after-location-set-during-write.window.html]
[Setting location from document.write() call should not trigger load event until that load completes]
expected: FAIL

View file

@ -1,4 +0,0 @@
[module-static-import-delayed.html]
[document.write in an imported module]
expected: FAIL

View file

@ -1,7 +1,6 @@
[promise-rejection-events.html] [promise-rejection-events.html]
expected: TIMEOUT
[delayed handling: delaying handling rejected promise created from createImageBitmap will cause both events to fire] [delayed handling: delaying handling rejected promise created from createImageBitmap will cause both events to fire]
expected: TIMEOUT expected: FAIL
[unhandledrejection: from createImageBitmap which is UA triggered] [unhandledrejection: from createImageBitmap which is UA triggered]
expected: FAIL expected: FAIL

View file

@ -1,5 +1,4 @@
[realtimeanalyser-fft-scaling.html] [realtimeanalyser-fft-scaling.html]
expected: TIMEOUT
[X 2048-point FFT peak position is not equal to 64. Got 0.] [X 2048-point FFT peak position is not equal to 64. Got 0.]
expected: FAIL expected: FAIL

View file

@ -1,5 +0,0 @@
[017.html]
expected: TIMEOUT
[origin of the script that invoked the method, about:blank]
expected: TIMEOUT

View file

@ -1,5 +0,0 @@
[017.html]
expected: TIMEOUT
[origin of the script that invoked the method, about:blank]
expected: TIMEOUT

View file

@ -7,7 +7,7 @@
expected: FAIL expected: FAIL
[Opening a blob URL in a new window immediately before revoking it works.] [Opening a blob URL in a new window immediately before revoking it works.]
expected: TIMEOUT expected: FAIL
[Opening a blob URL in a noopener about:blank window immediately before revoking it works.] [Opening a blob URL in a noopener about:blank window immediately before revoking it works.]
expected: TIMEOUT expected: TIMEOUT

View file

@ -302509,7 +302509,7 @@
], ],
"support": { "support": {
"testing-utils.js": [ "testing-utils.js": [
"217b620463624e2feb294b320e7787f6c91f1932", "30b944265b463fb595f1cb50ae8527ff00291019",
[] []
] ]
} }
@ -367687,7 +367687,7 @@
] ]
], ],
"idbobjectstore_putall.tentative.any.js": [ "idbobjectstore_putall.tentative.any.js": [
"8bdc765906d86504bcb344e1e579a97f8f602c6e", "a312d71d03d59c5c9369afa1492aacd0e91e9a5d",
[ [
"IndexedDB/idbobjectstore_putall.tentative.any.html", "IndexedDB/idbobjectstore_putall.tentative.any.html",
{ {
@ -396976,7 +396976,7 @@
] ]
], ],
"grid-flex-track-intrinsic-sizes-003.html": [ "grid-flex-track-intrinsic-sizes-003.html": [
"81a5d14131078c214b59f236838043870dda2512", "13c968e9150674596088ac3e695fc81df3e951e7",
[ [
null, null,
{} {}
@ -396989,6 +396989,13 @@
{} {}
] ]
], ],
"grid-intrinsic-track-sizes-001.html": [
"15ca612c7cb5a639ba6da6931b2e55775e12d4dc",
[
null,
{}
]
],
"grid-item-margin-auto-columns-rows-001.html": [ "grid-item-margin-auto-columns-rows-001.html": [
"6ae1c50c220cdd07c5fb1fb266e2e2bd11bf2a4e", "6ae1c50c220cdd07c5fb1fb266e2e2bd11bf2a4e",
[ [

View file

@ -0,0 +1,4 @@
[hit-test-floats-002.html]
[Hit test float]
expected: FAIL

View file

@ -0,0 +1,4 @@
[hit-test-floats-003.html]
[Miss float below something else]
expected: FAIL

View file

@ -0,0 +1,4 @@
[hit-test-floats-005.html]
[Miss clipped float]
expected: FAIL

View file

@ -1,2 +0,0 @@
[matchMedia-display-none-iframe.html]
expected: ERROR

View file

@ -312,18 +312,9 @@
[fetch(): separate response Content-Type: text/plain ] [fetch(): separate response Content-Type: text/plain ]
expected: NOTRUN expected: NOTRUN
[<iframe>: separate response Content-Type: text/html */*]
expected: FAIL
[<iframe>: separate response Content-Type: text/plain */*;charset=gbk] [<iframe>: separate response Content-Type: text/plain */*;charset=gbk]
expected: FAIL expected: FAIL
[<iframe>: separate response Content-Type: text/html;x=" text/plain]
expected: FAIL
[<iframe>: separate response Content-Type: text/html */*;charset=gbk]
expected: FAIL
[<iframe>: separate response Content-Type: text/plain */*] [<iframe>: separate response Content-Type: text/plain */*]
expected: FAIL expected: FAIL
@ -333,3 +324,15 @@
[<iframe>: combined response Content-Type: text/html;x=" text/plain] [<iframe>: combined response Content-Type: text/html;x=" text/plain]
expected: FAIL expected: FAIL
[<iframe>: combined response Content-Type: */* text/html]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;charset=gbk text/plain text/html]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;" text/plain]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;" \\" text/plain]
expected: FAIL

View file

@ -56,3 +56,9 @@
[separate text/javascript x/x] [separate text/javascript x/x]
expected: FAIL expected: FAIL
[separate text/javascript;charset=windows-1252 error text/javascript]
expected: FAIL
[separate text/javascript error]
expected: FAIL

View file

@ -11,6 +11,3 @@
[X-Content-Type-Options%3A%20nosniff%2C%2C%40%23%24%23%25%25%26%5E%26%5E*()()11!] [X-Content-Type-Options%3A%20nosniff%2C%2C%40%23%24%23%25%25%26%5E%26%5E*()()11!]
expected: FAIL expected: FAIL
[X-Content-Type-Options%3A%20%2Cnosniff]
expected: FAIL

View file

@ -1,4 +0,0 @@
[traverse_the_history_2.html]
[Multiple history traversals, last would be aborted]
expected: FAIL

View file

@ -1,4 +1,4 @@
[traverse_the_history_2.html] [traverse_the_history_5.html]
[Multiple history traversals, last would be aborted] [Multiple history traversals, last would be aborted]
expected: FAIL expected: FAIL

View file

@ -0,0 +1,2 @@
[cross-origin-objects-on-new-window.html]
expected: TIMEOUT

View file

@ -1,4 +1,5 @@
[embedded-opener-remove-frame.html] [embedded-opener-remove-frame.html]
expected: CRASH
[opener and "removed" embedded documents] [opener and "removed" embedded documents]
expected: FAIL expected: FAIL

View file

@ -1,6 +1,6 @@
[iframe_sandbox_popups_escaping-1.html] [iframe_sandbox_popups_escaping-1.html]
type: testharness type: testharness
expected: TIMEOUT expected: CRASH
[Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used] [Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used]
expected: TIMEOUT expected: TIMEOUT

View file

@ -1,5 +1,5 @@
[iframe_sandbox_popups_escaping-2.html] [iframe_sandbox_popups_escaping-2.html]
expected: TIMEOUT expected: CRASH
[Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used] [Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used]
expected: TIMEOUT expected: TIMEOUT

View file

@ -1,6 +1,5 @@
[iframe_sandbox_popups_escaping-3.html] [iframe_sandbox_popups_escaping-3.html]
type: testharness type: testharness
expected: TIMEOUT
[Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used] [Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used]
expected: TIMEOUT expected: FAIL

View file

@ -1,5 +1,6 @@
[iframe_sandbox_popups_nonescaping-1.html] [iframe_sandbox_popups_nonescaping-1.html]
type: testharness type: testharness
expected: TIMEOUT
[Check that popups from a sandboxed iframe do not escape the sandbox] [Check that popups from a sandboxed iframe do not escape the sandbox]
expected: FAIL expected: NOTRUN

View file

@ -1,5 +1,6 @@
[iframe_sandbox_popups_nonescaping-3.html] [iframe_sandbox_popups_nonescaping-3.html]
type: testharness type: testharness
expected: TIMEOUT
[Check that popups from a sandboxed iframe do not escape the sandbox] [Check that popups from a sandboxed iframe do not escape the sandbox]
expected: FAIL expected: NOTRUN

View file

@ -0,0 +1,4 @@
[DOMContentLoaded-defer.html]
[The end: DOMContentLoaded and defer scripts]
expected: FAIL

View file

@ -1,4 +0,0 @@
[load-event-after-location-set-during-write.window.html]
[Setting location from document.write() call should not trigger load event until that load completes]
expected: FAIL

View file

@ -1,4 +0,0 @@
[module-static-import-delayed.html]
[document.write in an imported module]
expected: FAIL

View file

@ -1,7 +1,6 @@
[promise-rejection-events.html] [promise-rejection-events.html]
expected: TIMEOUT
[delayed handling: delaying handling rejected promise created from createImageBitmap will cause both events to fire] [delayed handling: delaying handling rejected promise created from createImageBitmap will cause both events to fire]
expected: TIMEOUT expected: FAIL
[unhandledrejection: from createImageBitmap which is UA triggered] [unhandledrejection: from createImageBitmap which is UA triggered]
expected: FAIL expected: FAIL

View file

@ -1,5 +1,4 @@
[realtimeanalyser-fft-scaling.html] [realtimeanalyser-fft-scaling.html]
expected: TIMEOUT
[X 2048-point FFT peak position is not equal to 64. Got 0.] [X 2048-point FFT peak position is not equal to 64. Got 0.]
expected: FAIL expected: FAIL

View file

@ -1,5 +0,0 @@
[017.html]
expected: TIMEOUT
[origin of the script that invoked the method, about:blank]
expected: TIMEOUT

View file

@ -1,5 +0,0 @@
[017.html]
expected: TIMEOUT
[origin of the script that invoked the method, about:blank]
expected: TIMEOUT

View file

@ -0,0 +1,4 @@
[hit-test-background.html]
[Hit testing backgrounds of content should report the same element as the content]
expected: FAIL

View file

@ -0,0 +1,4 @@
[hit_test_multiple_sc.html]
[Hit testing works for following stacking contexts]
expected: FAIL

View file

@ -0,0 +1,4 @@
[hit_test_pos_fixed.html]
[Hit-test of an element with position: fixed should discard scroll offset]
expected: FAIL

View file

@ -3,23 +3,24 @@
promise_test(async testCase => { promise_test(async testCase => {
const db = await createDatabase(testCase, db => { const db = await createDatabase(testCase, db => {
const store = createBooksStore(testCase, db); const store = createBooksStore(testCase, db);
let values = [
{isbn: 'one', title: 'title1'},
{isbn: 'two', title: 'title2'},
{isbn: 'three', title: 'title3'}
];
const putAllRequests = store.putAll(values);
putAllRequests.forEach(async request => {
await promiseForRequest(testCase, request);
});
}); });
const txn = db.transaction(['books'], 'readwrite');
const txn = db.transaction(['books'], 'readonly');
const objectStore = txn.objectStore('books'); const objectStore = txn.objectStore('books');
const getRequest1 = objectStore.get('one'); let values = [
const getRequest2 = objectStore.get('two'); {isbn: 'one', title: 'title1'},
const getRequest3 = objectStore.get('three'); {isbn: 'two', title: 'title2'},
{isbn: 'three', title: 'title3'}
];
let putAllRequest = objectStore.putAll(values);
await promiseForRequest(testCase, putAllRequest);
await promiseForTransaction(testCase, txn); await promiseForTransaction(testCase, txn);
const txn2 = db.transaction(['books'], 'readonly');
const objectStore2 = txn2.objectStore('books');
const getRequest1 = objectStore2.get('one');
const getRequest2 = objectStore2.get('two');
const getRequest3 = objectStore2.get('three');
await promiseForTransaction(testCase, txn2);
assert_array_equals( assert_array_equals(
[getRequest1.result.title, [getRequest1.result.title,
getRequest2.result.title, getRequest2.result.title,
@ -27,4 +28,4 @@ promise_test(async testCase => {
['title1', 'title2', 'title3'], ['title1', 'title2', 'title3'],
'All three retrieved titles should match those that were put.'); 'All three retrieved titles should match those that were put.');
db.close(); db.close();
}, 'Data can be successfully inputted into an object store using putAll.'); }, 'Data can be successfully inputted into an object store using putAll.');

View file

@ -12,14 +12,14 @@ var TestingUtils = (function() {
assert_in_array(getComputedStyle(element).gridTemplateRows, value, "gridTemplateRows"); assert_in_array(getComputedStyle(element).gridTemplateRows, value, "gridTemplateRows");
} }
function testGridTemplateColumnsRows(gridId, columnsStyle, rowsStyle, columnsComputedValue, rowsComputedValue) { function testGridTemplateColumnsRows(gridId, columnsStyle, rowsStyle, columnsComputedValue, rowsComputedValue, label) {
test(function() { test(function() {
var grid = document.getElementById(gridId); var grid = document.getElementById(gridId);
grid.style.gridTemplateColumns = columnsStyle; grid.style.gridTemplateColumns = columnsStyle;
grid.style.gridTemplateRows = rowsStyle; grid.style.gridTemplateRows = rowsStyle;
checkGridTemplateColumns(grid, columnsComputedValue); checkGridTemplateColumns(grid, columnsComputedValue);
checkGridTemplateRows(grid, rowsComputedValue); checkGridTemplateRows(grid, rowsComputedValue);
}, "'" + gridId + "' with: grid-template-columns: " + columnsStyle + "; and grid-template-rows: " + rowsStyle + ";"); }, (label ? label + " " : "") + "'" + gridId + "' with: grid-template-columns: " + columnsStyle + "; and grid-template-rows: " + rowsStyle + ";");
} }
function checkGridTemplateAreas(element, value) { function checkGridTemplateAreas(element, value) {

View file

@ -3,14 +3,16 @@
<title>CSS Grid Layout Test: Intrinsic contribution of an item with flex tracks</title> <title>CSS Grid Layout Test: Intrinsic contribution of an item with flex tracks</title>
<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com"> <link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com">
<link rel="author" title="Tab Atkins-Bittner" href="mailto:jackalmage@gmail.com"> <link rel="author" title="Tab Atkins-Bittner" href="mailto:jackalmage@gmail.com">
<link rel="help" href="https://drafts.csswg.org/css-grid/#algo-spanning-items" title="11.5.3 Increase sizes to accommodate spanning items crossing content-sized tracks"> <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
<link rel="help" href="https://drafts.csswg.org/css-grid/#algo-spanning-flex-items" title="11.5.4 Increase sizes to accommodate spanning items crossing flexible tracks"> <link rel="help" href="https://drafts.csswg.org/css-grid-1/#algo-spanning-items">
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#algo-spanning-flex-items">
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#min-size-auto">
<meta name="assert" content="This test checks that the intrinsic contribution of a single grid item is distributed correctly among the tracks it spans when flexible tracks are involved, and the item's size is determined by its children rather than explicitly."> <meta name="assert" content="This test checks that the intrinsic contribution of a single grid item is distributed correctly among the tracks it spans when flexible tracks are involved, and the item's size is determined by its children rather than explicitly.">
<style> <style>
#grid { #grid {
display: grid; display: grid;
width: 50px; width: 60px;
height: 50px; height: 60px;
border: solid; border: solid;
} }
#item { #item {
@ -35,24 +37,81 @@
<script src="../grid-definition/support/testing-utils.js"></script> <script src="../grid-definition/support/testing-utils.js"></script>
<script> <script>
const item = document.getElementById("item"); const item = document.getElementById("item");
let testset = "unlabeled";
function checkTrackSizes(span, trackList, expected) { function checkTrackSizes(span, trackList, expected) {
item.style.gridColumn = item.style.gridRow = `span ${span}`; item.style.gridColumn = item.style.gridRow = `span ${span}`;
TestingUtils.testGridTemplateColumnsRows("grid", trackList, trackList, expected, expected); TestingUtils.testGridTemplateColumnsRows("grid", trackList, trackList, expected, expected, testset);
} }
// Item spanning an intrinsic flexible track // First check for distributing auto minimum ///////////////////////////////////
testset = "auto min item";
// Item spanning an auto flexible track
checkTrackSizes(1, "0fr", "100px"); checkTrackSizes(1, "0fr", "100px");
checkTrackSizes(1, "1fr", "100px"); checkTrackSizes(1, "1fr", "100px");
checkTrackSizes(1, "2fr", "100px"); checkTrackSizes(1, "2fr", "100px");
// Item spanning a fixed flexible track // Item spanning a fixed flexible track
checkTrackSizes(1, "minmax(0, 0fr)", "0px"); checkTrackSizes(1, "minmax(0, 0fr)", "0px");
checkTrackSizes(1, "minmax(0, .5fr)", "25px"); checkTrackSizes(1, "minmax(0, .5fr)", "30px");
checkTrackSizes(1, "minmax(0, 1fr)", "50px"); checkTrackSizes(1, "minmax(0, 1fr)", "60px");
checkTrackSizes(1, "minmax(0, 2fr)", "50px"); checkTrackSizes(1, "minmax(0, 2fr)", "60px");
checkTrackSizes(1, "minmax(75px, 1fr)", "75px"); checkTrackSizes(1, "minmax(75px, 1fr)", "75px");
// Item spanning 2 intrinsic flexible tracks // Item spanning 2 auto flexible tracks
checkTrackSizes(2, "0fr 0fr", "0px 0px");
checkTrackSizes(2, "0fr 1fr", "0px 60px");
checkTrackSizes(2, "1fr 0fr", "60px 0px");
checkTrackSizes(2, "1fr 1fr", "30px 30px");
checkTrackSizes(2, "1fr 3fr", "15px 45px");
checkTrackSizes(2, "0fr 0fr 1fr", "0px 0px 60px");
// Item spanning 2 fixed flexible tracks
checkTrackSizes(2, "minmax(0, 0fr) minmax(0, 0fr)", "0px 0px");
checkTrackSizes(2, "minmax(0, 0fr) minmax(0, 1fr)", "0px 60px");
checkTrackSizes(2, "minmax(15px, 0fr) minmax(0, 1fr)", "15px 45px");
checkTrackSizes(2, "minmax(20px, 1fr) minmax(0, 1fr)", "30px 30px");
checkTrackSizes(2, "minmax(40px, 1fr) minmax(0, 1fr)", "40px 20px");
// Item spanning an auto flexible track and a fixed flexible track
checkTrackSizes(2, "0fr minmax(0, 0fr)", "0px 0px");
checkTrackSizes(2, "0fr minmax(0, 1fr)", "0px 60px");
checkTrackSizes(2, "1fr minmax(0, 1fr)", "30px 30px");
checkTrackSizes(2, "1fr minmax(25px, 1fr)", "30px 30px");
// Item spanning an auto flexible track and an intrinsic non-flexible track
checkTrackSizes(2, "0fr min-content", "0px 0px");
checkTrackSizes(2, "0fr auto", "0px 60px");
checkTrackSizes(2, "0.5fr auto", "30px 30px");
checkTrackSizes(2, "1fr auto", "60px 0px");
checkTrackSizes(2, "1fr max-content", "60px 0px");
checkTrackSizes(2, "1fr min-content", "60px 0px");
// Item spanning a fixed flexible track and an intrinsic non-flexible track
checkTrackSizes(2, "minmax(0, 0fr) min-content", "0px 0px");
checkTrackSizes(2, "minmax(0, 0fr) auto", "0px 60px");
checkTrackSizes(2, "minmax(0, 1fr) auto", "60px 0px");
checkTrackSizes(2, "minmax(25px, 0fr) auto", "25px 35px");
checkTrackSizes(2, "minmax(25px, 1fr) auto", "60px 0px");
// Now check for distributing min content //////////////////////////////////////
item.style.minWidth = "min-content"; // min-content = 100px > grid
item.style.minHeight = "100px"; // min-content doesn't resolve in block axis (yet?)
testset = "min-content min item";
// Item spanning an auto flexible track
checkTrackSizes(1, "0fr", "100px");
checkTrackSizes(1, "1fr", "100px");
checkTrackSizes(1, "2fr", "100px");
// Item spanning a fixed flexible track
checkTrackSizes(1, "minmax(0, 0fr)", "0px");
checkTrackSizes(1, "minmax(0, .5fr)", "30px");
checkTrackSizes(1, "minmax(0, 1fr)", "60px");
checkTrackSizes(1, "minmax(0, 2fr)", "60px");
checkTrackSizes(1, "minmax(75px, 1fr)", "75px");
// Item spanning 2 auto flexible tracks
checkTrackSizes(2, "0fr 0fr", "50px 50px"); checkTrackSizes(2, "0fr 0fr", "50px 50px");
checkTrackSizes(2, "0fr 1fr", "0px 100px"); checkTrackSizes(2, "0fr 1fr", "0px 100px");
checkTrackSizes(2, "1fr 0fr", "100px 0px"); checkTrackSizes(2, "1fr 0fr", "100px 0px");
@ -62,25 +121,82 @@ checkTrackSizes(2, "0fr 0fr 1fr", "50px 50px 0px");
// Item spanning 2 fixed flexible tracks // Item spanning 2 fixed flexible tracks
checkTrackSizes(2, "minmax(0, 0fr) minmax(0, 0fr)", "0px 0px"); checkTrackSizes(2, "minmax(0, 0fr) minmax(0, 0fr)", "0px 0px");
checkTrackSizes(2, "minmax(0, 0fr) minmax(0, 1fr)", "0px 50px"); checkTrackSizes(2, "minmax(0, 0fr) minmax(0, 1fr)", "0px 60px");
checkTrackSizes(2, "minmax(15px, 0fr) minmax(0, 1fr)", "15px 35px"); checkTrackSizes(2, "minmax(15px, 0fr) minmax(0, 1fr)", "15px 45px");
checkTrackSizes(2, "minmax(20px, 1fr) minmax(0, 1fr)", "25px 25px"); checkTrackSizes(2, "minmax(20px, 1fr) minmax(0, 1fr)", "30px 30px");
checkTrackSizes(2, "minmax(30px, 1fr) minmax(0, 1fr)", "30px 20px"); checkTrackSizes(2, "minmax(40px, 1fr) minmax(0, 1fr)", "40px 20px");
// Item spanning an intrinsic flexible track and a fixed flexible track // Item spanning an auto flexible track and a fixed flexible track
checkTrackSizes(2, "0fr minmax(0, 0fr)", "100px 0px"); checkTrackSizes(2, "0fr minmax(0, 0fr)", "100px 0px");
checkTrackSizes(2, "0fr minmax(0, 1fr)", "100px 0px"); checkTrackSizes(2, "0fr minmax(0, 1fr)", "100px 0px");
checkTrackSizes(2, "1fr minmax(0, 1fr)", "100px 0px"); checkTrackSizes(2, "1fr minmax(0, 1fr)", "100px 0px");
checkTrackSizes(2, "1fr minmax(25px, 1fr)", "75px 25px"); checkTrackSizes(2, "1fr minmax(25px, 1fr)", "75px 25px");
// Item spanning an intrinsic flexible track and an intrinsic non-flexible track // Item spanning an auto flexible track and an intrinsic non-flexible track
checkTrackSizes(2, "0fr min-content", "100px 0px");
checkTrackSizes(2, "0fr auto", "100px 0px"); checkTrackSizes(2, "0fr auto", "100px 0px");
checkTrackSizes(2, "0.5fr auto", "100px 0px");
checkTrackSizes(2, "1fr auto", "100px 0px"); checkTrackSizes(2, "1fr auto", "100px 0px");
checkTrackSizes(2, "1fr max-content", "100px 0px"); checkTrackSizes(2, "1fr max-content", "100px 0px");
checkTrackSizes(2, "1fr min-content", "100px 0px");
// Item spanning a fixed flexible track and an intrinsic non-flexible track // Item spanning a fixed flexible track and an intrinsic non-flexible track
checkTrackSizes(2, "minmax(0, 0fr) auto", "0px 100px"); checkTrackSizes(2, "minmax(0, 0fr) min-content", "0px 0px");
checkTrackSizes(2, "minmax(0, 1fr) auto", "0px 100px"); checkTrackSizes(2, "minmax(0, 0fr) auto", "0px 60px");
checkTrackSizes(2, "minmax(25px, 0fr) auto", "25px 75px"); checkTrackSizes(2, "minmax(0, 1fr) auto", "60px 0px");
checkTrackSizes(2, "minmax(25px, 1fr) auto", "25px 75px"); checkTrackSizes(2, "minmax(25px, 0fr) auto", "25px 35px");
checkTrackSizes(2, "minmax(25px, 1fr) auto", "60px 0px");
// Now check for distributing fixed min ////////////////////////////////////////
item.style.minWidth = "50px"; // minimum < grid < min-content
item.style.minHeight = "50px"; // minimum < grid < min-content
testset = "50px min item";
// Item spanning an auto flexible track
checkTrackSizes(1, "0fr", "50px");
checkTrackSizes(1, "1fr", "60px");
checkTrackSizes(1, "2fr", "60px");
// Item spanning a fixed flexible track
checkTrackSizes(1, "minmax(0, 0fr)", "0px");
checkTrackSizes(1, "minmax(0, .5fr)", "30px");
checkTrackSizes(1, "minmax(0, 1fr)", "60px");
checkTrackSizes(1, "minmax(0, 2fr)", "60px");
checkTrackSizes(1, "minmax(75px, 1fr)", "75px");
// Item spanning 2 auto flexible tracks
checkTrackSizes(2, "0fr 0fr", "25px 25px");
checkTrackSizes(2, "0fr 1fr", "0px 60px");
checkTrackSizes(2, "1fr 0fr", "60px 0px");
checkTrackSizes(2, "1fr 1fr", "30px 30px");
checkTrackSizes(2, "1fr 3fr", "15px 45px");
checkTrackSizes(2, "0fr 0fr 1fr", "25px 25px 10px");
// Item spanning 2 fixed flexible tracks
checkTrackSizes(2, "minmax(0, 0fr) minmax(0, 0fr)", "0px 0px");
checkTrackSizes(2, "minmax(0, 0fr) minmax(0, 1fr)", "0px 60px");
checkTrackSizes(2, "minmax(15px, 0fr) minmax(0, 1fr)", "15px 45px");
checkTrackSizes(2, "minmax(20px, 1fr) minmax(0, 1fr)", "30px 30px");
checkTrackSizes(2, "minmax(40px, 1fr) minmax(0, 1fr)", "40px 20px");
// Item spanning an auto flexible track and a fixed flexible track
checkTrackSizes(2, "0fr minmax(0, 0fr)", "50px 0px");
checkTrackSizes(2, "0fr minmax(0, 1fr)", "50px 10px");
checkTrackSizes(2, "1fr minmax(0, 1fr)", "50px 10px");
checkTrackSizes(2, "1fr minmax(25px, 1fr)", "30px 30px");
// Item spanning an auto flexible track and an intrinsic non-flexible track
checkTrackSizes(2, "0fr min-content", "50px 0px");
checkTrackSizes(2, "0fr auto", "50px 10px");
checkTrackSizes(2, "0.5fr auto", "50px 10px");
checkTrackSizes(2, "1fr auto", "60px 0px");
checkTrackSizes(2, "1fr max-content", "60px 0px");
checkTrackSizes(2, "1fr min-content", "60px 0px");
// Item spanning a fixed flexible track and an intrinsic non-flexible track
checkTrackSizes(2, "minmax(0, 0fr) min-content", "0px 0px");
checkTrackSizes(2, "minmax(0, 0fr) auto", "0px 60px");
checkTrackSizes(2, "minmax(0, 1fr) auto", "60px 0px");
checkTrackSizes(2, "minmax(25px, 0fr) auto", "25px 35px");
checkTrackSizes(2, "minmax(25px, 1fr) auto", "60px 0px");
</script> </script>

View file

@ -0,0 +1,89 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Grid Layout Test: Intrinsic contribution of a small item to intrinsic tracks</title>
<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
<link rel="help" href="https://www.w3.org/TR/css-grid-1/#algo-content">
<meta name="assert" content="This test checks that the intrinsic contribution of a single grid item smaller than its container is distributed correctly among the tracks it spans when intrinsic tracks are involved.">
<base href="https://wpt.live/css/css-grid/grid-definition/">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style>
#grid {
display: grid;
width: 120px;
height: 120px;
border: solid;
font: 10px/1 Ahem;
}
#item {
background: blue;
/* make min-content contribution differ from minimum contribution */
min-width: 12px;
min-height: 12px;
}
</style>
<div id="grid">
<div id="item">XXX XX<br>XX<br>XX</div>
</div>
<div id="log"></div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../grid-definition/support/testing-utils.js"></script>
<script>
const item = document.getElementById("item");
function checkTrackSizes(span, trackList, expectedCols, expectedRows) {
item.style.gridColumn = item.style.gridRow = `span ${span}`;
if (!expectedRows) {
expectedRows = expectedCols;
}
TestingUtils.testGridTemplateColumnsRows("grid", trackList, trackList, expectedCols, expectedRows);
}
// Item spanning a single track
checkTrackSizes(1, "auto", "120px");
checkTrackSizes(1, "min-content", "30px", "40px");
checkTrackSizes(1, "max-content", "60px", "30px");
checkTrackSizes(1, "minmax(0, auto)", "120px");
checkTrackSizes(1, "minmax(0, min-content)", "30px", "40px");
checkTrackSizes(1, "minmax(0, max-content)", "60px", "30px");
checkTrackSizes(1, "minmax(auto, 10px)", "12px");
checkTrackSizes(1, "minmax(min-content, 10px)", "30px", "40px");
checkTrackSizes(1, "minmax(max-content, 10px)", "60px", "30px");
// Item spanning two identical tracks
checkTrackSizes(2, "auto auto", "60px 60px");
checkTrackSizes(2, "min-content min-content", "15px 15px", "20px 20px");
checkTrackSizes(2, "max-content max-content", "30px 30px", "15px 15px");
checkTrackSizes(2, "minmax(0, auto) minmax(0, auto)", "60px 60px");
checkTrackSizes(2, "minmax(0, min-content) minmax(0, min-content)", "15px 15px", "20px 20px");
checkTrackSizes(2, "minmax(0, max-content) minmax(0, max-content)", "30px 30px", "15px 15px");
checkTrackSizes(2, "minmax(auto, 4px) minmax(auto, 4px)", "6px 6px");
checkTrackSizes(2, "minmax(auto, 10px) minmax(auto, 10px)", "10px 10px");
checkTrackSizes(2, "minmax(min-content, 10px) minmax(min-content, 10px)", "15px 15px", "20px 20px");
checkTrackSizes(2, "minmax(max-content, 10px) minmax(max-content, 10px)", "30px 30px", "15px 15px");
// Item spanning a fixed track also
checkTrackSizes(2, "20px auto", "20px 100px");
checkTrackSizes(2, "20px min-content", "20px 10px", "20px 20px");
checkTrackSizes(2, "20px max-content", "20px 40px", "20px 10px");
checkTrackSizes(2, "20px minmax(0, auto)", "20px 100px");
checkTrackSizes(2, "20px minmax(0, min-content)", "20px 10px", "20px 20px");
checkTrackSizes(2, "20px minmax(0, max-content)", "20px 40px", "20px 10px");
checkTrackSizes(2, "20px minmax(auto, 30px)", "20px 30px");
checkTrackSizes(2, "20px minmax(min-content, 6px)", "20px 10px", "20px 20px");
checkTrackSizes(2, "20px minmax(min-content, 40px)", "20px 40px", "20px 40px");
checkTrackSizes(2, "20px minmax(max-content, 6px)", "20px 40px", "20px 10px");
checkTrackSizes(2, "20px minmax(max-content, 30px)", "20px 40px", "20px 30px");
// Item spanning two mismatched intrinsic tracks
checkTrackSizes(2, "max-content min-content", "45px 15px", "15px 15px");
</script>