mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
Update web-platform-tests to revision daac9dc806e9571ea856253fcc35a94e73d4f711
This commit is contained in:
parent
1318ea9d02
commit
393fa37c0b
67 changed files with 1485 additions and 146 deletions
|
@ -0,0 +1,117 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="UTF-8">
|
||||
<title>clip interpolation</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/css-masking-1/#clip-property">
|
||||
<meta name="assert" content="clip supports animation">
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/interpolation-testcommon.js"></script>
|
||||
|
||||
<style>
|
||||
.container {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
background: black;
|
||||
display: inline-block;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.container:nth-child(2n) {
|
||||
background: green;
|
||||
}
|
||||
|
||||
.parent {
|
||||
clip: rect(100px, 0px, 100px, 0px);
|
||||
}
|
||||
|
||||
.target {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
background: white;
|
||||
clip: rect(0px, 100px, 0px, 100px);
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<template id="target-template">
|
||||
<div class="container"><div class="target"></div></div>
|
||||
</template>
|
||||
<script>
|
||||
test_interpolation({
|
||||
property: 'clip',
|
||||
from: neutralKeyframe,
|
||||
to: 'rect(20px, 20px, 20px, 20px)',
|
||||
}, [
|
||||
{at: -1, expect: 'rect(-20px 180px -20px 180px)'},
|
||||
{at: 0, expect: 'rect(0px 100px 0px 100px)'},
|
||||
{at: 0.25, expect: 'rect(5px 80px 5px 80px)'},
|
||||
{at: 0.75, expect: 'rect(15px 40px 15px 40px)'},
|
||||
{at: 1, expect: 'rect(20px 20px 20px 20px)'},
|
||||
{at: 2, expect: 'rect(40px -60px 40px -60px)'},
|
||||
]);
|
||||
|
||||
test_no_interpolation({
|
||||
property: 'clip',
|
||||
from: 'initial',
|
||||
to: 'rect(20px, 20px, 20px, 20px)',
|
||||
});
|
||||
|
||||
test_interpolation({
|
||||
property: 'clip',
|
||||
from: 'inherit',
|
||||
to: 'rect(20px, 20px, 20px, 20px)',
|
||||
}, [
|
||||
{at: -1, expect: 'rect(180px -20px 180px -20px)'},
|
||||
{at: 0, expect: 'rect(100px 0px 100px 0px)'},
|
||||
{at: 0.25, expect: 'rect(80px 5px 80px 5px)'},
|
||||
{at: 0.75, expect: 'rect(40px 15px 40px 15px)'},
|
||||
{at: 1, expect: 'rect(20px 20px 20px 20px)'},
|
||||
{at: 2, expect: 'rect(-60px 40px -60px 40px)'},
|
||||
]);
|
||||
|
||||
test_no_interpolation({
|
||||
property: 'clip',
|
||||
from: 'unset',
|
||||
to: 'rect(20px, 20px, 20px, 20px)',
|
||||
});
|
||||
|
||||
test_interpolation({
|
||||
property: 'clip',
|
||||
from: 'rect(0px, 75px, 80px, 10px)',
|
||||
to: 'rect(0px, 100px, 90px, 5px)'
|
||||
}, [
|
||||
{at: -1, expect: 'rect(0px, 50px, 70px, 15px)'},
|
||||
{at: 0, expect: 'rect(0px, 75px, 80px, 10px)'},
|
||||
{at: 0.25, expect: 'rect(0px, 81.25px, 82.5px, 8.75px)'},
|
||||
{at: 0.75, expect: 'rect(0px, 93.75px, 87.5px, 6.25px)'},
|
||||
{at: 1, expect: 'rect(0px, 100px, 90px, 5px)'},
|
||||
{at: 2, expect: 'rect(0px, 125px, 100px, 0px)'},
|
||||
]);
|
||||
|
||||
test_no_interpolation({
|
||||
property: 'clip',
|
||||
from: 'rect(auto, auto, auto, 10px)',
|
||||
to: 'rect(20px, 50px, 50px, auto)'
|
||||
});
|
||||
|
||||
test_no_interpolation({
|
||||
property: 'clip',
|
||||
from: 'rect(auto, 0px, auto, 10px)',
|
||||
to: 'rect(auto, 50px, 50px, auto)'
|
||||
});
|
||||
|
||||
test_no_interpolation({
|
||||
property: 'clip',
|
||||
from: 'auto',
|
||||
to: 'rect(0px, 50px, 50px, 0px)'
|
||||
});
|
||||
|
||||
test_no_interpolation({
|
||||
property: 'clip',
|
||||
from: 'rect(0px, 50px, 50px, 0px)',
|
||||
to: 'auto'
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Masking Module Level 1: parsing mask with invalid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-masking-1/#the-mask">
|
||||
<meta name="assert" content="mask supports only the '<mask-layer>#' grammar.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
test_invalid_value('mask', 'none linear-gradient(to 0% 0%, rgb(0, 0, 0), rgb(0, 0, 255))');
|
||||
test_invalid_value('mask', 'none alpha luminance');
|
||||
test_invalid_value('mask', 'linear-gradient(to 0% 0%, rgb(0, 0, 0), rgb(0, 0, 255)) url("https://example.com/")');
|
||||
|
||||
test_invalid_value('mask', '1px 2px 3px');
|
||||
test_invalid_value('mask', '1px 2px 3px 4px');
|
||||
test_invalid_value('mask', '1px 2px / contain / cover');
|
||||
|
||||
test_invalid_value('mask', 'repeat-y repeat-x');
|
||||
|
||||
test_invalid_value('mask', 'stroke-box no-clip view-box');
|
||||
|
||||
test_invalid_value('mask', 'border-box view-box padding-box');
|
||||
|
||||
test_invalid_value('mask', 'no-clip border-box content-box');
|
||||
|
||||
test_invalid_value('mask', 'content-box stroke-box no-clip');
|
||||
|
||||
test_invalid_value('mask', 'add intersect');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,62 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Masking Module Level 1: parsing mask with valid values</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-masking-1/#the-mask">
|
||||
<meta name="assert" content="mask supports the full '<mask-layer>#' grammar.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/parsing-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
// <mask-layer> = <mask-reference> <masking-mode>? || <position> [ / <bg-size> ]? ||
|
||||
// <repeat-style> || <geometry-box> || [ <geometry-box> | no-clip ] || <compositing-operator>
|
||||
|
||||
// <mask-reference> <masking-mode>?
|
||||
// <mask-reference> = none | <image> | <mask-source>
|
||||
// <masking-mode> = alpha | luminance | auto
|
||||
test_valid_value('mask', 'none');
|
||||
test_valid_value('mask', 'none alpha');
|
||||
test_valid_value('mask', 'linear-gradient(to left bottom, red, blue)');
|
||||
test_valid_value('mask', 'linear-gradient(to left bottom, red, blue) luminance');
|
||||
test_valid_value('mask', 'url("https://{{host}}/")');
|
||||
test_valid_value('mask', 'url("https://{{host}}/") alpha');
|
||||
|
||||
// <position> [ / <bg-size> ]?
|
||||
test_valid_value('mask', 'linear-gradient(to left bottom, red, blue) 1px 2px');
|
||||
test_valid_value('mask', 'url("https://{{host}}/") 1px 2px / contain');
|
||||
|
||||
// <repeat-style> = repeat-x | repeat-y | [repeat | space | round | no-repeat]{1,2}
|
||||
test_valid_value('mask', 'none repeat-y');
|
||||
|
||||
// <geometry-box> = <shape-box> | fill-box | stroke-box | view-box
|
||||
// <shape-box> = <box> | margin-box
|
||||
// <box> = border-box | padding-box | content-box
|
||||
test_valid_value('mask', 'none border-box', 'none');
|
||||
test_valid_value('mask', 'linear-gradient(to left bottom, red, blue) padding-box');
|
||||
test_valid_value('mask', 'none content-box');
|
||||
test_valid_value('mask', 'none margin-box');
|
||||
test_valid_value('mask', 'url("https://{{host}}/") fill-box');
|
||||
test_valid_value('mask', 'linear-gradient(to left bottom, red, blue) stroke-box');
|
||||
test_valid_value('mask', 'none view-box');
|
||||
|
||||
// [ <geometry-box> | no-clip ]
|
||||
test_valid_value('mask', 'none no-clip', 'none border-box no-clip');
|
||||
|
||||
// <compositing-operator> = add | subtract | intersect | exclude
|
||||
test_valid_value('mask', 'url("https://{{host}}/") add', 'url("https://{{host}}/")');
|
||||
test_valid_value('mask', 'none subtract');
|
||||
test_valid_value('mask', 'url("https://{{host}}/") intersect');
|
||||
test_valid_value('mask', 'linear-gradient(to left bottom, red, blue) exclude');
|
||||
|
||||
|
||||
// <mask-layer> = <mask-reference> <masking-mode>? || <position> [ / <bg-size> ]? ||
|
||||
// <repeat-style> || <geometry-box> || [ <geometry-box> | no-clip ] || <compositing-operator>
|
||||
test_valid_value('mask', 'intersect no-clip space round 1px 2px / contain stroke-box linear-gradient(to left bottom, red, blue) luminance', 'linear-gradient(to left bottom, red, blue) luminance 1px 2px / contain space round stroke-box no-clip intersect');
|
||||
|
||||
test_valid_value('mask', 'intersect no-clip space round 1px 2px / contain view-box, stroke-box linear-gradient(to left bottom, red, blue) luminance', 'none 1px 2px / contain space round view-box no-clip intersect, linear-gradient(to left bottom, red, blue) luminance stroke-box');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue