mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Update web-platform-tests to revision 3503c50a6452e153bde906a9c6644cb6237224fc
This commit is contained in:
parent
3db473714b
commit
dc71e05859
379 changed files with 37923 additions and 5120 deletions
|
@ -0,0 +1,97 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="UTF-8">
|
||||
<title>calc interpolation</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-values-3/#calc-notation">
|
||||
<meta name="assert" content="calc supports animation by computed value">
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/interpolation-testcommon.js"></script>
|
||||
|
||||
<style>
|
||||
.container {
|
||||
position: relative;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border: black solid 2px;
|
||||
display: inline-block;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
background-color: white;
|
||||
}
|
||||
.target {
|
||||
position: absolute;
|
||||
width: 10px;
|
||||
height: 50px;
|
||||
background-color: black;
|
||||
}
|
||||
.expected {
|
||||
background-color: green;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<template id="target-template">
|
||||
<div class="container">
|
||||
<div class="target"></div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
test_interpolation({
|
||||
property: 'left',
|
||||
from: 'calc(50% - 25px)',
|
||||
to: 'calc(100% - 10px)'
|
||||
}, [
|
||||
{at: -0.25, expect: '-10px'},
|
||||
{at: 0, expect: '0px'},
|
||||
{at: 0.25, expect: '10px'},
|
||||
{at: 0.5, expect: '20px'},
|
||||
{at: 0.75, expect: '30px'},
|
||||
{at: 1, expect: '40px'},
|
||||
{at: 1.25, expect: '50px'}
|
||||
]);
|
||||
|
||||
test_interpolation({
|
||||
property: 'text-indent',
|
||||
from: 'calc(50% - 25px)',
|
||||
to: 'calc(100% - 10px)'
|
||||
}, [
|
||||
{at: -0.25, expect: 'calc(((50% - 25px) * 1.25) + ((100% - 10px) * -0.25))'},
|
||||
{at: 0, expect: 'calc(50% - 25px)'},
|
||||
{at: 0.25, expect: 'calc(((50% - 25px) * 0.75) + ((100% - 10px) * 0.25))'},
|
||||
{at: 0.5, expect: 'calc(((50% - 25px) * 0.5) + ((100% - 10px) * 0.5))'},
|
||||
{at: 0.75, expect: 'calc(((50% - 25px) * 0.25) + ((100% - 10px) * 0.75))'},
|
||||
{at: 1, expect: 'calc(100% - 10px)'},
|
||||
{at: 1.25, expect: 'calc(((50% - 25px) * -0.25) + ((100% - 10px) * 1.25))'}
|
||||
]);
|
||||
|
||||
test_interpolation({
|
||||
property: 'text-indent',
|
||||
from: '0em',
|
||||
to: '100px'
|
||||
}, [
|
||||
{at: -0.25, expect: '-25px'},
|
||||
{at: 0, expect: '0em'},
|
||||
{at: 0.25, expect: '25px'},
|
||||
{at: 0.5, expect: '50px'},
|
||||
{at: 0.75, expect: '75px'},
|
||||
{at: 1, expect: '100px'},
|
||||
{at: 1.25, expect: '125px'}
|
||||
]);
|
||||
|
||||
test_interpolation({
|
||||
property: 'text-indent',
|
||||
from: '0%',
|
||||
to: '100px'
|
||||
}, [
|
||||
{at: -0.25, expect: 'calc(0% + -25px)'},
|
||||
{at: 0, expect: '0%'},
|
||||
{at: 0.25, expect: 'calc(0% + 25px)'},
|
||||
{at: 0.5, expect: 'calc(0% + 50px)'},
|
||||
{at: 0.75, expect: 'calc(0% + 75px)'},
|
||||
{at: 1, expect: 'calc(0% + 100px)'},
|
||||
{at: 1.25, expect: 'calc(0% + 125px)'}
|
||||
]);
|
||||
|
||||
</script>
|
||||
</body>
|
Loading…
Add table
Add a link
Reference in a new issue