mirror of
https://github.com/servo/servo.git
synced 2025-08-12 00:45:33 +01:00
Update web-platform-tests to revision 9817f7f027fe1e92cc2fce31d6002c4d669918e8
This commit is contained in:
parent
8e52f8a523
commit
f3533538ea
2144 changed files with 21364 additions and 11001 deletions
|
@ -56,7 +56,7 @@
|
|||
<script id="code" type="text/worklet">
|
||||
registerLayout('registered', class {
|
||||
*intrinsicSizes() {}
|
||||
*layout() {}
|
||||
*layout() { throw Error(); }
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
<!DOCTYPE html>
|
||||
<html class=reftest-wait>
|
||||
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#layout-children">
|
||||
<link rel="match" href="layout-child-ref.html">
|
||||
<meta name="assert" content="This test checks that absolute children don't appear in the children array." />
|
||||
|
||||
<style>
|
||||
.test {
|
||||
--child-expected: ["2"];
|
||||
|
||||
background: red;
|
||||
margin: 10px;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.absolute {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
--child: 1;
|
||||
}
|
||||
|
||||
.inflow {
|
||||
visibility: hidden;
|
||||
--child: 2;
|
||||
}
|
||||
|
||||
@supports (display: layout(test)) {
|
||||
.test {
|
||||
background: green;
|
||||
display: layout(test);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script src="/common/reftest-wait.js"></script>
|
||||
<script src="/common/worklet-reftest.js"></script>
|
||||
|
||||
<div class="test">
|
||||
<div class="absolute"></div>
|
||||
<div class="inflow"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: 'support/layout-child-worklet.js'});
|
||||
</script>
|
|
@ -0,0 +1,49 @@
|
|||
<!DOCTYPE html>
|
||||
<html class=reftest-wait>
|
||||
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#layout-children">
|
||||
<link rel="match" href="layout-child-ref.html">
|
||||
<meta name="assert" content="This test checks that boxes created by ::before/::after appear as children." />
|
||||
|
||||
<style>
|
||||
.test {
|
||||
--child-expected: ["1", "2", "3"];
|
||||
|
||||
background: red;
|
||||
margin: 10px;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.test::before {
|
||||
visibility: hidden;
|
||||
content: 'before';
|
||||
--child: 1;
|
||||
}
|
||||
|
||||
.inflow {
|
||||
visibility: hidden;
|
||||
--child: 2;
|
||||
}
|
||||
|
||||
.test::after {
|
||||
visibility: hidden;
|
||||
content: 'after';
|
||||
--child: 3;
|
||||
}
|
||||
|
||||
@supports (display: layout(test)) {
|
||||
.test {
|
||||
background: green;
|
||||
display: layout(test);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script src="/common/reftest-wait.js"></script>
|
||||
<script src="/common/worklet-reftest.js"></script>
|
||||
|
||||
<div class="test">
|
||||
<div class="inflow"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: 'support/layout-child-worklet.js'});
|
||||
</script>
|
|
@ -0,0 +1,44 @@
|
|||
<!DOCTYPE html>
|
||||
<html class=reftest-wait>
|
||||
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#layout-children">
|
||||
<link rel="match" href="layout-child-ref.html">
|
||||
<meta name="assert" content="This test checks that fixed children don't appear in the children array." />
|
||||
|
||||
<style>
|
||||
.test {
|
||||
--child-expected: ["2"];
|
||||
|
||||
background: red;
|
||||
margin: 10px;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.fixed {
|
||||
position: fixed;
|
||||
visibility: hidden;
|
||||
--child: 1;
|
||||
}
|
||||
|
||||
.inflow {
|
||||
visibility: hidden;
|
||||
--child: 2;
|
||||
}
|
||||
|
||||
@supports (display: layout(test)) {
|
||||
.test {
|
||||
background: green;
|
||||
display: layout(test);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script src="/common/reftest-wait.js"></script>
|
||||
<script src="/common/worklet-reftest.js"></script>
|
||||
|
||||
<div class="test">
|
||||
<div class="fixed"></div>
|
||||
<div class="inflow"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: 'support/layout-child-worklet.js'});
|
||||
</script>
|
|
@ -0,0 +1,44 @@
|
|||
<!DOCTYPE html>
|
||||
<html class=reftest-wait>
|
||||
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#layout-children">
|
||||
<link rel="match" href="layout-child-ref.html">
|
||||
<meta name="assert" content="This test checks that float children appear in the children array." />
|
||||
|
||||
<style>
|
||||
.test {
|
||||
--child-expected: ["1", "2"];
|
||||
|
||||
background: red;
|
||||
margin: 10px;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.float {
|
||||
float: right;
|
||||
visibility: hidden;
|
||||
--child: 1;
|
||||
}
|
||||
|
||||
.inflow {
|
||||
visibility: hidden;
|
||||
--child: 2;
|
||||
}
|
||||
|
||||
@supports (display: layout(test)) {
|
||||
.test {
|
||||
background: green;
|
||||
display: layout(test);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script src="/common/reftest-wait.js"></script>
|
||||
<script src="/common/worklet-reftest.js"></script>
|
||||
|
||||
<div class="test">
|
||||
<div class="float"></div>
|
||||
<div class="inflow"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: 'support/layout-child-worklet.js'});
|
||||
</script>
|
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE html>
|
||||
<html class=reftest-wait>
|
||||
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#layout-children">
|
||||
<link rel="match" href="layout-child-ref.html">
|
||||
<meta name="assert" content="This test checks that regular inflow children appear as children." />
|
||||
|
||||
<style>
|
||||
.test {
|
||||
--child-expected: ["1", "2"];
|
||||
|
||||
background: red;
|
||||
margin: 10px;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.inflow-1 {
|
||||
visibility: hidden;
|
||||
--child: 1;
|
||||
}
|
||||
|
||||
.inflow-2 {
|
||||
visibility: hidden;
|
||||
--child: 2;
|
||||
}
|
||||
|
||||
@supports (display: layout(test)) {
|
||||
.test {
|
||||
background: green;
|
||||
display: layout(test);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script src="/common/reftest-wait.js"></script>
|
||||
<script src="/common/worklet-reftest.js"></script>
|
||||
|
||||
<div class="test">
|
||||
<div class="inflow-1"></div>
|
||||
<div class="inflow-2"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: 'support/layout-child-worklet.js'});
|
||||
</script>
|
|
@ -0,0 +1,55 @@
|
|||
<!DOCTYPE html>
|
||||
<html class=reftest-wait>
|
||||
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#layout-children">
|
||||
<link rel="match" href="layout-child-ref.html">
|
||||
<meta name="assert" content="This test checks that inline children are correctly blockified or wrapped in anonymous boxes." />
|
||||
|
||||
<style>
|
||||
/* We have a wrapper in this test to ensure that any text that is positioned
|
||||
* slightly outside the "test" box doesn't affect the rendering.
|
||||
* This wrapper has a 10px inline padding which does the trick. */
|
||||
.wrapper {
|
||||
background: green;
|
||||
padding: 0 10px;
|
||||
margin: 10px;
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
.test {
|
||||
--child-expected: ["1", "default", "3", "4", "5"];
|
||||
|
||||
background: red;
|
||||
color: green;
|
||||
width: 80px;
|
||||
--child: default;
|
||||
}
|
||||
|
||||
.inflow {
|
||||
visibility: hidden;
|
||||
--child: 3;
|
||||
}
|
||||
|
||||
@supports (display: layout(test)) {
|
||||
.test {
|
||||
background: green;
|
||||
display: layout(test);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script src="/common/reftest-wait.js"></script>
|
||||
<script src="/common/worklet-reftest.js"></script>
|
||||
|
||||
<div class="wrapper">
|
||||
<div class="test">
|
||||
<span style="--child: 1;">Text,</span> more text
|
||||
<div class="inflow"></div>
|
||||
<span style="--child: 4;">Text,
|
||||
<div>block!</div>
|
||||
</span>
|
||||
<span style="--child: 5;">Other text</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: 'support/layout-child-worklet.js'});
|
||||
</script>
|
|
@ -0,0 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
.result {
|
||||
background: green;
|
||||
margin: 10px;
|
||||
height: 100px;
|
||||
width: 100px;
|
||||
}
|
||||
</style>
|
||||
<div class="result"></div>
|
|
@ -0,0 +1,52 @@
|
|||
<!DOCTYPE html>
|
||||
<html class=reftest-wait>
|
||||
<link rel="help" href="https://drafts.css-houdini.org/css-layout-api/#layout-children">
|
||||
<link rel="match" href="layout-child-ref.html">
|
||||
<meta name="assert" content="This test checks that text children are correctly blockified." />
|
||||
|
||||
<style>
|
||||
/* We have a wrapper in this test to ensure that any text that is positioned
|
||||
* slightly outside the "test" box doesn't affect the rendering.
|
||||
* This wrapper has a 10px inline padding which does the trick. */
|
||||
.wrapper {
|
||||
background: green;
|
||||
padding: 0 10px;
|
||||
margin: 10px;
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
.test {
|
||||
--child-expected: ["default", "2", "default"];
|
||||
|
||||
background: red;
|
||||
color: green;
|
||||
width: 80px;
|
||||
--child: default;
|
||||
}
|
||||
|
||||
.inflow {
|
||||
visibility: hidden;
|
||||
--child: 2;
|
||||
}
|
||||
|
||||
@supports (display: layout(test)) {
|
||||
.test {
|
||||
background: green;
|
||||
display: layout(test);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script src="/common/reftest-wait.js"></script>
|
||||
<script src="/common/worklet-reftest.js"></script>
|
||||
|
||||
<div class="wrapper">
|
||||
<div class="test">
|
||||
Text text text
|
||||
<div class="inflow"></div>
|
||||
Text text text
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
importWorkletAndTerminateTestAfterAsyncPaint(CSS.layoutWorklet, {url: 'support/layout-child-worklet.js'});
|
||||
</script>
|
|
@ -2,8 +2,8 @@
|
|||
<style>
|
||||
.result {
|
||||
background: green;
|
||||
border-radius: 2px;
|
||||
margin: 10px;
|
||||
margin-left: 2px;
|
||||
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
/* Properties under test. */
|
||||
--foo: bar;
|
||||
border-radius: 2px;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
@supports (display: layout(test)) {
|
||||
|
@ -30,7 +30,7 @@
|
|||
<script id="code" type="text/worklet">
|
||||
registerLayout('test', class {
|
||||
static get inputProperties() {
|
||||
return [ '--bar', '--foo', 'align-items', 'border-top-left-radius'];
|
||||
return [ '--bar', '--foo', 'empty-cells', 'margin-left'];
|
||||
}
|
||||
|
||||
*intrinsicSizes() {}
|
||||
|
@ -38,8 +38,8 @@ registerLayout('test', class {
|
|||
const expected = [
|
||||
{property: '--bar', value: '[CSSUnparsedValue=]'},
|
||||
{property: '--foo', value: '[CSSUnparsedValue= bar]'},
|
||||
{property: 'align-items', value: '[CSSKeywordValue=normal]'},
|
||||
{property: 'border-top-left-radius', value: '[CSSUnitValue=2px]'},
|
||||
{property: 'empty-cells', value: '[CSSKeywordValue=show]'},
|
||||
{property: 'margin-left', value: '[CSSUnitValue=2px]'},
|
||||
];
|
||||
|
||||
const actual = Array.from(styleMap.keys()).sort().map((property) => {
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
<style>
|
||||
.result {
|
||||
background: green;
|
||||
border-radius: 2px;
|
||||
margin: 10px;
|
||||
margin-left: 2px;
|
||||
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
/* Properties under test. */
|
||||
--foo: bar;
|
||||
border-radius: 2px;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
@supports (display: layout(test)) {
|
||||
|
@ -60,8 +60,8 @@ const tmpl = (test, idx) => {
|
|||
const tests = [
|
||||
{property: '--bar', expected: '[CSSUnparsedValue=]'},
|
||||
{property: '--foo', expected: '[CSSUnparsedValue= bar]'},
|
||||
{property: 'align-items', expected: '[CSSKeywordValue=normal]'},
|
||||
{property: 'border-top-left-radius', expected: '[CSSUnitValue=2px]'},
|
||||
{property: 'empty-cells', expected: '[CSSKeywordValue=show]'},
|
||||
{property: 'margin-left', expected: '[CSSUnitValue=2px]'},
|
||||
];
|
||||
|
||||
const workletSource = tests.map(tmpl).join('\n');
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
import {areArraysEqual} from '/common/arrays.js';
|
||||
|
||||
registerLayout('test', class {
|
||||
static get inputProperties() {
|
||||
return [ '--child-expected'];
|
||||
}
|
||||
|
||||
static get childInputProperties() {
|
||||
return [ '--child' ];
|
||||
}
|
||||
|
||||
*intrinsicSizes() {}
|
||||
*layout(children, edges, constraints, styleMap) {
|
||||
const expected = JSON.parse(styleMap.get('--child-expected').toString());
|
||||
const actual = children.map((child) => {
|
||||
return child.styleMap.get('--child').toString().trim();
|
||||
});
|
||||
|
||||
if (!areArraysEqual(expected, actual))
|
||||
return {autoBlockSize: 0};
|
||||
|
||||
return {autoBlockSize: 100};
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue