mirror of
https://github.com/servo/servo.git
synced 2025-10-04 02:29:12 +01:00
Update web-platform-tests to revision c583bcd7eb30f38cb2d673031cde245776f1da5a
This commit is contained in:
parent
ba1ed11ced
commit
bd791500b2
107 changed files with 2870 additions and 469 deletions
|
@ -0,0 +1,49 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<title>Registering a property causes invalidation for initial value</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-paint-api-1/#examples">
|
||||
<link rel="match" href="parse-input-arguments-ref.html">
|
||||
<script src="/common/reftest-wait.js"></script>
|
||||
<script src="/common/worklet-reftest.js"></script>
|
||||
<body>
|
||||
<style>
|
||||
#target {
|
||||
background: paint(geometry);
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
||||
<div id="target"></div>
|
||||
<script id="code" type="text/worklet">
|
||||
registerPaint('geometry', class {
|
||||
static get inputProperties() { return ['--color']; }
|
||||
paint(ctx, geom, styleMap) {
|
||||
ctx.strokeStyle = styleMap.get('--color').toString();
|
||||
ctx.lineWidth = 4;
|
||||
ctx.strokeRect(0, 0, geom.width, geom.height);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
async function test() {
|
||||
getComputedStyle(target);
|
||||
let code = document.getElementById('code').textContent;
|
||||
await importWorklet(CSS.paintWorklet, code);
|
||||
await workletPainted();
|
||||
CSS.registerProperty({
|
||||
name: '--color',
|
||||
syntax: '<color>',
|
||||
initialValue: 'green',
|
||||
inherits: false
|
||||
});
|
||||
await workletPainted();
|
||||
takeScreenshot();
|
||||
}
|
||||
|
||||
test();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<title>Registering a property causes invalidation for applied value</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-paint-api-1/#examples">
|
||||
<link rel="match" href="parse-input-arguments-ref.html">
|
||||
<script src="/common/reftest-wait.js"></script>
|
||||
<script src="/common/worklet-reftest.js"></script>
|
||||
<body>
|
||||
<style>
|
||||
#target {
|
||||
background: paint(geometry);
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
--length: 100px;
|
||||
}
|
||||
</style>
|
||||
<div id="target"></div>
|
||||
<script id="code" type="text/worklet">
|
||||
registerPaint('geometry', class {
|
||||
static get inputProperties() { return ['--length']; }
|
||||
paint(ctx, geom, styleMap) {
|
||||
let value = styleMap.get('--length');
|
||||
let pass = value.value === 100 && value.unit === 'px';
|
||||
ctx.strokeStyle = pass ? 'green' : 'red';
|
||||
ctx.lineWidth = 4;
|
||||
ctx.strokeRect(0, 0, geom.width, geom.height);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
async function test() {
|
||||
getComputedStyle(target);
|
||||
let code = document.getElementById('code').textContent;
|
||||
await importWorklet(CSS.paintWorklet, code);
|
||||
await workletPainted();
|
||||
CSS.registerProperty({
|
||||
name: '--length',
|
||||
syntax: '<length>',
|
||||
initialValue: '0px',
|
||||
inherits: false
|
||||
});
|
||||
await workletPainted();
|
||||
takeScreenshot();
|
||||
}
|
||||
|
||||
test();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue