Update web-platform-tests to revision fb898b46adaf656c9807ed0b8adb39d84162cb98

This commit is contained in:
WPT Sync Bot 2019-08-30 10:51:05 +00:00
parent 6a4e6174a7
commit eed68f662b
222 changed files with 12791 additions and 14492 deletions

View file

@ -0,0 +1,120 @@
<!DOCTYPE html>
<meta charset="UTF-8">
<title>border-color interpolation</title>
<link rel="help" href="https://drafts.csswg.org/css-backgrounds-3/#border-color">
<meta name="assert" content="border-color 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>
.parent {
border-color: white;
}
.target {
width: 50px;
height: 50px;
background-color: blue;
display: inline-block;
border: 12px solid;
border-color: darkblue;
}
.expected {
background-color: green;
margin-right: 2px;
}
</style>
<body></body>
<script>
// As per https://bugzilla.mozilla.org/show_bug.cgi?id=137688, Firefox does not
// support getComputedStyle for shorthands. As such, we have one test for this
// which explicitly checks the shorthand variant, but most tests use one of the
// longhands instead.
function compareNotEmpty(actual, expected) {
assert_equals(actual, expected);
assert_not_equals(actual, '');
}
test_interpolation({
property: 'border-color',
from: 'rgb(20, 30, 40) rgb(40, 50, 60)',
to: 'rgb(10, 20, 30) rgb(40, 50, 60) rgb(30, 40, 50) rgb(50, 60, 70)',
comparisonFunction: compareNotEmpty,
}, [
{at: -0.3, expect: 'rgb(23, 33, 43) rgb(40, 50, 60) rgb(17, 27, 37) rgb(37, 47, 57)'},
{at: 0, expect: 'rgb(20, 30, 40) rgb(40, 50, 60)'},
{at: 0.3, expect: 'rgb(17, 27, 37) rgb(40, 50, 60) rgb(23, 33, 43) rgb(43, 53, 63)'},
{at: 0.6, expect: 'rgb(14, 24, 34) rgb(40, 50, 60) rgb(26, 36, 46) rgb(46, 56, 66)'},
{at: 1, expect: 'rgb(10, 20, 30) rgb(40, 50, 60) rgb(30, 40, 50) rgb(50, 60, 70)'},
{at: 1.5, expect: 'rgb(5, 15, 25) rgb(40, 50, 60) rgb(35, 45, 55) rgb(55, 65, 75)'},
]);
test_interpolation({
property: 'border-top-color',
from: neutralKeyframe,
to: 'orange',
}, [
{at: -0.3, expect: 'rgb(0, 0, 181)'},
{at: 0, expect: 'rgb(0, 0, 139)'},
{at: 0.3, expect: 'rgb(77, 50, 97)'},
{at: 0.6, expect: 'rgb(153, 99, 56)'},
{at: 1, expect: 'rgb(255, 165, 0)'},
{at: 1.5, expect: 'rgb(255, 248, 0)'},
]);
test_interpolation({
property: 'border-top-color',
from: 'initial',
to: 'orange',
}, [
{at: -0.3, expect: 'rgb(0, 0, 0)'},
{at: 0, expect: 'rgb(0, 0, 0)'},
{at: 0.3, expect: 'rgb(77, 50, 0)'},
{at: 0.6, expect: 'rgb(153, 99, 0)'},
{at: 1, expect: 'rgb(255, 165, 0)'},
{at: 1.5, expect: 'rgb(255, 248, 0)'},
]);
test_interpolation({
property: 'border-top-color',
from: 'inherit',
to: 'orange',
}, [
{at: -0.3, expect: 'rgb(255, 255, 255)'},
{at: 0, expect: 'rgb(255, 255, 255)'},
{at: 0.3, expect: 'rgb(255, 228, 179)'},
{at: 0.6, expect: 'rgb(255, 201, 102)'},
{at: 1, expect: 'rgb(255, 165, 0)'},
{at: 1.5, expect: 'rgb(255, 120, 0)'},
]);
test_interpolation({
property: 'border-top-color',
from: 'unset',
to: 'orange',
}, [
{at: -0.3, expect: 'rgb(0, 0, 0)'},
{at: 0, expect: 'rgb(0, 0, 0)'},
{at: 0.3, expect: 'rgb(77, 50, 0)'},
{at: 0.6, expect: 'rgb(153, 99, 0)'},
{at: 1, expect: 'rgb(255, 165, 0)'},
{at: 1.5, expect: 'rgb(255, 248, 0)'},
]);
test_interpolation({
property: 'border-top-color',
from: 'white',
to: 'orange'
}, [
{at: -0.3, expect: 'white'},
{at: 0, expect: 'white'},
{at: 0.3, expect: 'rgb(255, 228, 179)'},
{at: 0.6, expect: 'rgb(255, 201, 102)'},
{at: 1, expect: 'orange'},
{at: 1.5, expect: 'rgb(255, 120, 0)'},
]);
</script>

View file

@ -0,0 +1,125 @@
<!DOCTYPE html>
<meta charset="UTF-8">
<title>border-image-outset interpolation</title>
<link rel="help" href="https://drafts.csswg.org/css-backgrounds-3/#border-image-outset">
<meta name="assert" content="border-image-outset 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>
.parent {
border-image-outset: 10px;
}
.target {
width: 50px;
height: 50px;
background-color: black;
display: inline-block;
border: 25px;
margin-right: 50px;
border-image-slice: 30%;
background-clip: content-box;
border-image-source: linear-gradient(45deg, pink, blue, white, black, green);
border-image-outset: 1px;
}
.expected {
background-color: green;
}
</style>
<body></body>
<script>
test_interpolation({
property: 'border-image-outset',
from: neutralKeyframe,
to: '2px',
}, [
{at: -0.3, expect: '0.7px'},
{at: 0, expect: '1px'},
{at: 0.3, expect: '1.3px'},
{at: 0.6, expect: '1.6px'},
{at: 1, expect: '2px'},
{at: 1.5, expect: '2.5px'},
]);
test_interpolation({
property: 'border-image-outset',
from: 'initial',
to: '2px',
}, [
{at: -0.3, expect: '0px'}, // Non-negative
{at: 0, expect: '0px'},
{at: 0.3, expect: '0.6px'},
{at: 0.6, expect: '1.2px'},
{at: 1, expect: '2px'},
{at: 1.5, expect: '3px'},
]);
test_interpolation({
property: 'border-image-outset',
from: 'inherit',
to: '2px',
}, [
{at: -0.3, expect: '12.4px'},
{at: 0, expect: '10px'},
{at: 0.3, expect: '7.6px'},
{at: 0.6, expect: '5.2px'},
{at: 1, expect: '2px'},
{at: 1.5, expect: '0px'},
]);
test_interpolation({
property: 'border-image-outset',
from: 'unset',
to: '2px',
}, [
{at: -0.3, expect: '0px'}, // Non-negative
{at: 0, expect: '0px'},
{at: 0.3, expect: '0.6px'},
{at: 0.6, expect: '1.2px'},
{at: 1, expect: '2px'},
{at: 1.5, expect: '3px'},
]);
test_interpolation({
property: 'border-image-outset',
from: '0px',
to: '5px',
}, [
{at: -0.3, expect: '0px'}, // Non-negative
{at: 0, expect: '0px'},
{at: 0.3, expect: '1.5px'},
{at: 0.6, expect: '3px'},
{at: 1, expect: '5px'},
{at: 1.5, expect: '7.5px'},
]);
test_interpolation({
property: 'border-image-outset',
from: '0',
to: '1',
}, [
{at: -0.3, expect: '0'}, // Non-negative
{at: 0, expect: '0'},
{at: 0.3, expect: '0.3'},
{at: 0.6, expect: '0.6'},
{at: 1, expect: '1'},
{at: 1.5, expect: '1.5'},
]);
test_interpolation({
property: 'border-image-outset',
from: '1 2 3px 4px',
to: '101 102 103px 104px',
}, [
{at: -0.3, expect: '0 0 0px 0px'}, // Non-negative
{at: 0, expect: '1 2 3px 4px'},
{at: 0.3, expect: '31 32 33px 34px'},
{at: 0.6, expect: '61 62 63px 64px'},
{at: 1, expect: '101 102 103px 104px'},
{at: 1.5, expect: '151 152 153px 154px'},
]);
</script>

View file

@ -0,0 +1,175 @@
<!DOCTYPE html>
<meta charset="UTF-8">
<title>border-image-slice interpolation</title>
<link rel="help" href="https://drafts.csswg.org/css-backgrounds-3/#border-image-slice">
<meta name="assert" content="border-image-slice 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>
.parent {
border-image-slice: 50%;
}
.target {
width: 50px;
height: 50px;
background-color: black;
display: inline-block;
border: 25px;
border-image-source: linear-gradient(45deg, red, blue, green);
border-image-slice: 20%;
}
.expected {
background-color: green;
margin-right: 2px;
}
</style>
<body></body>
<script>
test_interpolation({
property: 'border-image-slice',
from: neutralKeyframe,
to: '10%',
}, [
{at: -0.3, expect: '23%'},
{at: 0, expect: '20%'},
{at: 0.3, expect: '17%'},
{at: 0.5, expect: '15%'},
{at: 0.6, expect: '14%'},
{at: 1, expect: '10%'},
{at: 1.5, expect: '5%'},
]);
test_interpolation({
property: 'border-image-slice',
from: 'initial',
to: '10%',
}, [
{at: -0.3, expect: '127%'},
{at: 0, expect: '100%'},
{at: 0.3, expect: '73%'},
{at: 0.5, expect: '55%'},
{at: 0.6, expect: '46%'},
{at: 1, expect: '10%'},
{at: 1.5, expect: '0%'},
]);
test_interpolation({
property: 'border-image-slice',
from: 'inherit',
to: '10%',
}, [
{at: -0.3, expect: '62%'},
{at: 0, expect: '50%'},
{at: 0.3, expect: '38%'},
{at: 0.5, expect: '30%'},
{at: 0.6, expect: '26%'},
{at: 1, expect: '10%'},
{at: 1.5, expect: '0%'},
]);
test_interpolation({
property: 'border-image-slice',
from: 'unset',
to: '10%',
}, [
{at: -0.3, expect: '127%'},
{at: 0, expect: '100%'},
{at: 0.3, expect: '73%'},
{at: 0.5, expect: '55%'},
{at: 0.6, expect: '46%'},
{at: 1, expect: '10%'},
{at: 1.5, expect: '0%'},
]);
test_interpolation({
property: 'border-image-slice',
from: '0%',
to: '50%',
}, [
{at: -0.3, expect: '0%'}, // CSS border-image-slice can't be negative.
{at: 0, expect: '0%'},
{at: 0.3, expect: '15%'},
{at: 0.5, expect: '25%'},
{at: 0.6, expect: '30%'},
{at: 1, expect: '50%'},
{at: 1.5, expect: '75%'},
]);
test_interpolation({
property: 'border-image-slice',
from: '0% 10% 20% 30%',
to: '40% 50% 60% 70%',
}, [
{at: -0.5, expect: '0% 0% 0% 10%'},
{at: 0, expect: '0% 10% 20% 30%'},
{at: 0.3, expect: '12% 22% 32% 42%'},
{at: 0.5, expect: '20% 30% 40% 50%'},
{at: 0.6, expect: '24% 34% 44% 54%'},
{at: 1, expect: '40% 50% 60% 70%'},
{at: 1.5, expect: '60% 70% 80% 90%'},
]);
test_interpolation({
property: 'border-image-slice',
from: '0 10 20 30 fill',
to: '40 50 60 70 fill',
}, [
{at: -0.5, expect: '0 0 0 10 fill'}, // CSS border-image-slice can't be negative.
{at: 0, expect: '0 10 20 30 fill'},
{at: 0.3, expect: '12 22 32 42 fill'},
{at: 0.5, expect: '20 30 40 50 fill'},
{at: 0.6, expect: '24 34 44 54 fill'},
{at: 1, expect: '40 50 60 70 fill'},
{at: 1.5, expect: '60 70 80 90 fill'},
]);
test_interpolation({
property: 'border-image-slice',
from: '0% 10 20% 30 fill',
to: '40% 50 60% 70 fill',
}, [
{at: -0.5, expect: '0% 0 0% 10 fill'}, // CSS border-image-slice can't be negative.
{at: 0, expect: '0% 10 20% 30 fill'},
{at: 0.3, expect: '12% 22 32% 42 fill'},
{at: 0.5, expect: '20% 30 40% 50 fill'},
{at: 0.6, expect: '24% 34 44% 54 fill'},
{at: 1, expect: '40% 50 60% 70 fill'},
{at: 1.5, expect: '60% 70 80% 90 fill'},
]);
test_no_interpolation({
property: 'border-image-slice',
from: '0% fill',
to: '50%',
});
test_no_interpolation({
property: 'border-image-slice',
from: '50%',
to: '100',
});
test_no_interpolation({
property: 'border-image-slice',
from: '50% fill',
to: '100 fill',
});
test_no_interpolation({
property: 'border-image-slice',
from: '0% 10 20% 30 fill',
to: '40% 50 60% 70',
});
test_no_interpolation({
property: 'border-image-slice',
from: '0% 10 20 30 fill',
to: '40 50 60% 70',
});
</script>
</body>

View file

@ -0,0 +1,82 @@
<!DOCTYPE html>
<meta charset="UTF-8">
<title>border-image-source interpolation</title>
<link rel="help" href="https://drafts.csswg.org/css-backgrounds-3/#border-image-source">
<meta name="assert" content="border-image-source has discrete animation">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/interpolation-testcommon.js"></script>
<style>
.parent {
border-image-source: url(../support/green.png);
}
.target {
width: 50px;
height: 50px;
background-color: black;
display: inline-block;
border: 5px solid aqua;
border-image-source: url(../support/blue_color.png);
border-image-slice: 10%;
}
.expected {
background-color: green;
margin-right: 2px;
}
</style>
<body></body>
<script>
// initial
test_no_interpolation({
property: 'border-image-source',
from: 'initial',
to: 'url(../support/orange_color.png)',
});
// inherit
test_no_interpolation({
property: 'border-image-source',
from: 'inherit',
to: 'url(../support/orange_color.png)',
});
// unset
test_no_interpolation({
property: 'border-image-source',
from: 'unset',
to: 'url(../support/orange_color.png)',
});
// None to image
test_no_interpolation({
property: 'border-image-source',
from: 'none',
to: 'url(../support/orange_color.png)',
});
// Image to image
test_no_interpolation({
property: 'border-image-source',
from: 'url(../support/aqua_color.png)',
to: 'url(../support/orange_color.png)',
});
// Image to gradient
test_no_interpolation({
property: 'border-image-source',
from: 'url(../support/aqua_color.png)',
to: 'linear-gradient(45deg, blue, orange)',
});
// Gradient to gradient
test_no_interpolation({
property: 'border-image-source',
from: 'linear-gradient(-45deg, red, yellow)',
to: 'linear-gradient(45deg, blue, orange)',
});
</script>
</body>

View file

@ -0,0 +1,192 @@
<!DOCTYPE html>
<meta charset="UTF-8">
<title>border-image-width interpolation</title>
<link rel="help" href="https://drafts.csswg.org/css-backgrounds-3/#border-image-width">
<meta name="assert" content="border-image-width 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>
.parent {
border-image-width: 100px;
}
.target {
width: 80px;
height: 80px;
background-color: black;
display: inline-block;
border: 10px;
border-image-source: linear-gradient(45deg, red, blue, green);
border-image-width: 10px;
}
.expected {
background-color: green;
margin-right: 2px;
}
</style>
<body></body>
<script>
test_interpolation({
property: 'border-image-width',
from: neutralKeyframe,
to: '20px',
}, [
{at: -0.3, expect: '7px'},
{at: 0, expect: '10px'},
{at: 0.3, expect: '13px'},
{at: 0.6, expect: '16px'},
{at: 1, expect: '20px'},
{at: 1.5, expect: '25px'},
{at: 5, expect: '60px'},
{at: 10, expect: '110px'},
]);
test_no_interpolation({
property: 'border-image-width',
from: 'initial',
to: '20px',
});
test_interpolation({
property: 'border-image-width',
from: 'inherit',
to: '20px',
}, [
{at: -0.3, expect: '124px'},
{at: 0, expect: '100px'},
{at: 0.3, expect: '76px'},
{at: 0.6, expect: '52px'},
{at: 1, expect: '20px'},
{at: 1.5, expect: '0px'},
{at: 5, expect: '0px'},
{at: 10, expect: '0px'},
]);
test_no_interpolation({
property: 'border-image-width',
from: 'unset',
to: '20px',
});
test_interpolation({
property: 'border-image-width',
from: '0px',
to: '20px'
}, [
{at: -0.3, expect: '0px'}, // CSS border-image-width can't be negative.
{at: 0, expect: '0px'},
{at: 0.3, expect: '6px'},
{at: 0.6, expect: '12px'},
{at: 1, expect: '20px'},
{at: 1.5, expect: '30px'},
{at: 5, expect: '100px'},
{at: 10, expect: '200px'}
]);
test_interpolation({
property: 'border-image-width',
from: '0%',
to: '20%'
}, [
{at: -0.3, expect: '0%'}, // CSS border-image-width can't be negative.
{at: 0, expect: '0%'},
{at: 0.3, expect: '6%'},
{at: 0.6, expect: '12%'},
{at: 1, expect: '20%'},
{at: 1.5, expect: '30%'},
{at: 5, expect: '100%'},
{at: 10, expect: '200%'}
]);
test_interpolation({
property: 'border-image-width',
from: '0',
to: '20'
}, [
{at: -0.3, expect: '0'}, // CSS border-image-width can't be negative.
{at: 0, expect: '0'},
{at: 0.3, expect: '6'},
{at: 0.6, expect: '12'},
{at: 1, expect: '20'},
{at: 1.5, expect: '30'},
{at: 5, expect: '100'},
{at: 10, expect: '200'}
]);
test_interpolation({
property: 'border-image-width',
from: '10px 20% 30 40px',
to: '80px 70% 60 50px'
}, [
{at: -0.3, expect: '0px 5% 21 37px'}, // CSS border-image-width can't be negative.
{at: 0, expect: '10px 20% 30 40px'},
{at: 0.3, expect: '31px 35% 39 43px'},
{at: 0.6, expect: '52px 50% 48 46px'},
{at: 1, expect: '80px 70% 60 50px'},
{at: 1.5, expect: '115px 95% 75 55px'},
{at: 5, expect: '360px 270% 180 90px'},
{at: 10, expect: '710px 520% 330 140px'}
]);
test_interpolation({
property: 'border-image-width',
from: '10%',
to: '20px'
}, [
// Percentages are relative to the size of the border image area, which is 120px.
{at: -0.3, expect: 'calc(13% + -6px)'}, // Should be parsed as 16px - 6px = 10px
{at: 0, expect: '10%'}, // Should be parsed as 12px
{at: 0.3, expect: 'calc(7% + 6px)'}, // Should be parsed as 8px + 6px = 14px
{at: 0.6, expect: 'calc(4% + 12px)'}, // Should be parsed as 5px + 12px = 17px
{at: 1, expect: 'calc(0% + 20px)'},
{at: 1.5, expect: 'calc(-5% + 30px)'}, // Should be parsed as -6px + 30px = 24px
]);
test_interpolation({
property: 'border-image-width',
from: '10px',
to: '20%'
}, [
// Percentages are relative to the size of the border image area, which is 120px.
{at: -0.3, expect: 'calc(13px + -6%)'}, // Should be parsed as 13px - 7px = 6px
{at: 0, expect: 'calc(0% + 10px)'},
{at: 0.3, expect: 'calc(7px + 6%)'}, // Should be parsed as 7px + 7px = 14px
{at: 0.6, expect: 'calc(4px + 12%)'}, // Should be parsed as 4px + 14px = 18px
{at: 1, expect: '20%'}, // Should be parsed as 24px
{at: 1.5, expect: 'calc(-5px + 30%)'}, // Should be parsed as -5px + 36px = 31px
]);
test_interpolation({
property: 'border-image-width',
from: '10px auto auto 20',
to: '110px auto auto 120'
}, [
{at: -0.3, expect: ' 0px auto auto 0'},
{at: 0, expect: ' 10px auto auto 20'},
{at: 0.3, expect: ' 40px auto auto 50'},
{at: 0.6, expect: ' 70px auto auto 80'},
{at: 1, expect: '110px auto auto 120'},
{at: 1.5, expect: '160px auto auto 170'},
]);
test_no_interpolation({
property: 'border-image-width',
from: '10px auto auto 20',
to: '110px auto 120 auto'
});
test_no_interpolation({
property: 'border-image-width',
from: '10px',
to: '20'
});
test_no_interpolation({
property: 'border-image-width',
from: '10',
to: '20px'
});
test_no_interpolation({
property: 'border-image-width',
from: '10%',
to: '20'
});
test_no_interpolation({
property: 'border-image-width',
from: '10',
to: '20%'
});
</script>

View file

@ -0,0 +1,141 @@
<!DOCTYPE html>
<meta charset="UTF-8">
<title>border-radius interpolation</title>
<link rel="help" href="https://drafts.csswg.org/css-backgrounds-3/#border-radius">
<meta name="assert" content="border-radius 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>
.parent {
border-radius: 30px;
}
.target {
width: 80px;
height: 80px;
display: inline-block;
background-color: black;
margin-right: 5px;
border-radius: 10px;
}
.expected {
background-color: green;
margin-right: 15px;
}
</style>
<body></body>
<script>
// As per https://bugzilla.mozilla.org/show_bug.cgi?id=137688, Firefox does not
// support getComputedStyle for shorthands. As such, we have one test for this
// which explicitly checks the shorthand variant, but most tests use one of the
// longhands instead.
function compareNotEmpty(actual, expected) {
assert_equals(actual, expected);
assert_not_equals(actual, '');
}
test_interpolation({
property: 'border-radius',
from: '20px 40px 60px 80px / 120px 140px 160px 180px',
to: '30px 50px 70px 90px / 130px 150px 170px 190px',
comparisonFunction: compareNotEmpty,
}, [
{at: -0.3, expect: '17px 37px 57px 77px / 117px 137px 157px 177px'},
{at: 0, expect: '20px 40px 60px 80px / 120px 140px 160px 180px'},
{at: 0.3, expect: '23px 43px 63px 83px / 123px 143px 163px 183px'},
{at: 0.6, expect: '26px 46px 66px 86px / 126px 146px 166px 186px'},
{at: 1, expect: '30px 50px 70px 90px / 130px 150px 170px 190px'},
{at: 1.5, expect: '35px 55px 75px 95px / 135px 155px 175px 195px'}
]);
test_interpolation({
property: 'border-top-left-radius',
from: neutralKeyframe,
to: '20px',
}, [
{at: -0.3, expect: '7px'},
{at: 0, expect: '10px'},
{at: 0.3, expect: '13px'},
{at: 0.6, expect: '16px'},
{at: 1, expect: '20px'},
{at: 1.5, expect: '25px'},
]);
test_interpolation({
property: 'border-top-left-radius',
from: 'initial',
to: '20px',
}, [
{at: -0.3, expect: '0px'},
{at: 0, expect: '0px'},
{at: 0.3, expect: '6px'},
{at: 0.6, expect: '12px'},
{at: 1, expect: '20px'},
{at: 1.5, expect: '30px'},
]);
test_interpolation({
property: 'border-top-left-radius',
from: 'inherit',
to: '20px',
}, [
{at: -0.3, expect: '33px'},
{at: 0, expect: '30px'},
{at: 0.3, expect: '27px'},
{at: 0.6, expect: '24px'},
{at: 1, expect: '20px'},
{at: 1.5, expect: '15px'},
]);
test_interpolation({
property: 'border-top-left-radius',
from: 'unset',
to: '20px',
}, [
{at: -0.3, expect: '0px'},
{at: 0, expect: '0px'},
{at: 0.3, expect: '6px'},
{at: 0.6, expect: '12px'},
{at: 1, expect: '20px'},
{at: 1.5, expect: '30px'},
]);
test_interpolation({
property: 'border-top-left-radius',
from: '10px',
to: '50px'
}, [
{at: -0.3, expect: '0px'}, // CSS border-top-left-radius can't be negative.
{at: 0, expect: '10px'},
{at: 0.3, expect: '22px'},
{at: 0.6, expect: '34px'},
{at: 1, expect: '50px'},
{at: 1.5, expect: '70px'},
]);
test_interpolation({
property: 'border-top-left-radius',
from: '10px',
to: '100%'
}, [
{at: -0.3, expect: 'calc(13px + -30%)'},
{at: 0, expect: 'calc(10px + 0%)'},
{at: 0.3, expect: 'calc(7px + 30%)'},
{at: 0.6, expect: 'calc(4px + 60%)'},
{at: 1, expect: '100%'},
{at: 1.5, expect: 'calc(-5px + 150%)'},
]);
test_interpolation({
property: 'border-top-left-radius',
from: '20px',
to: '10px 30px'
}, [
{at: -2, expect: '40px 0px'},
{at: -0.3, expect: '23px 17px'},
{at: 0, expect: '20px'},
{at: 0.3, expect: '17px 23px'},
{at: 0.6, expect: '14px 26px'},
{at: 1, expect: '10px 30px'},
{at: 1.5, expect: '5px 35px'}
]);
</script>

View file

@ -0,0 +1,175 @@
<!DOCTYPE html>
<meta charset="UTF-8">
<title>border-width interpolation</title>
<link rel="help" href="https://drafts.csswg.org/css-backgrounds-3/#border-width">
<meta name="assert" content="border-width 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>
.parent {
border-width: 30px;
}
.target {
width: 50px;
height: 50px;
background-color: black;
display: inline-block;
border: 2px solid orange;
margin: 18px;
border-width: 10px;
}
.expected {
background-color: green;
}
</style>
<body></body>
<script>
// As per https://bugzilla.mozilla.org/show_bug.cgi?id=137688, Firefox does not
// support getComputedStyle for shorthands. As such, we have one test for this
// which explicitly checks the shorthand variant, but most tests use one of the
// longhands instead.
function compareNotEmpty(actual, expected) {
assert_equals(actual, expected);
assert_not_equals(actual, '');
}
test_interpolation({
property: 'border-width',
from: '20px 40px 60px 80px',
to: '30px 50px 70px 90px',
comparisonFunction: compareNotEmpty,
}, [
{at: -0.3, expect: '17px 37px 57px 77px'},
{at: 0, expect: '20px 40px 60px 80px'},
{at: 0.3, expect: '23px 43px 63px 83px'},
{at: 0.6, expect: '26px 46px 66px 86px'},
{at: 1, expect: '30px 50px 70px 90px'},
{at: 1.5, expect: '35px 55px 75px 95px'}
]);
test_interpolation({
property: 'border-left-width',
from: neutralKeyframe,
to: '20px',
}, [
{at: -0.3, expect: '7px'},
{at: 0, expect: '10px'},
{at: 0.3, expect: '13px'},
{at: 0.6, expect: '16px'},
{at: 1, expect: '20px'},
{at: 1.5, expect: '25px'},
]);
test_interpolation({
property: 'border-left-width',
from: 'initial',
to: '20px',
}, [
{at: -0.3, expect: '0px'},
{at: 0, expect: '3px'},
{at: 0.3, expect: '8.1px'},
{at: 0.6, expect: '13.2px'},
{at: 1, expect: '20px'},
{at: 1.5, expect: '28.5px'},
]);
test_interpolation({
property: 'border-left-width',
from: 'inherit',
to: '20px',
}, [
{at: -0.3, expect: '0px'},
{at: 0, expect: '0px'},
{at: 0.3, expect: '6px'},
{at: 0.6, expect: '12px'},
{at: 1, expect: '20px'},
{at: 1.5, expect: '30px'},
]);
test_interpolation({
property: 'border-left-width',
from: 'unset',
to: '20px',
}, [
{at: -0.3, expect: '0px'},
{at: 0, expect: '3px'},
{at: 0.3, expect: '8.1px'},
{at: 0.6, expect: '13.2px'},
{at: 1, expect: '20px'},
{at: 1.5, expect: '28.5px'},
]);
test_interpolation({
property: 'border-left-width',
from: '0px',
to: '10px'
}, [
{at: -0.3, expect: '0px'}, // CSS border-left-width can't be negative.
{at: 0, expect: '0px'},
{at: 0.3, expect: '3px'},
{at: 0.6, expect: '6px'},
{at: 1, expect: '10px'},
{at: 1.5, expect: '15px'}
]);
test_interpolation({
property: 'border-bottom-width',
from: 'thick',
to: '15px'
}, [
{at: -2, expect: '0px'}, // CSS border-bottom-width can't be negative.
{at: -0.3, expect: '2px'},
{at: 0, expect: '5px'},
{at: 0.3, expect: '8px'},
{at: 0.6, expect: '11px'},
{at: 1, expect: '15px'},
{at: 1.5, expect: '20px'}
]);
test_interpolation({
property: 'border-left-width',
from: 'medium',
to: '13px'
}, [
{at: -2, expect: '0px'}, // CSS border-left-width can't be negative.
{at: -0.25, expect: '0.5px'},
{at: 0, expect: '3px'},
{at: 0.3, expect: '6px'},
{at: 0.6, expect: '9px'},
{at: 1, expect: '13px'},
{at: 1.5, expect: '18px'}
]);
test_interpolation({
property: 'border-right-width',
from: 'thin',
to: '11px'
}, [
{at: -2, expect: '0px'}, // CSS border-right-width can't be negative.
{at: -0.3, expect: '0px'}, // CSS border-right-width can't be negative.
{at: 0, expect: '1px'},
{at: 0.3, expect: '4px'},
{at: 0.6, expect: '7px'},
{at: 1, expect: '11px'},
{at: 1.5, expect: '16px'}
]);
test_interpolation({
property: 'border-top-width',
from: '15px',
to: 'thick'
}, [
{at: -2, expect: '35px'},
{at: -0.3, expect: '18px'},
{at: 0, expect: '15px'},
{at: 0.3, expect: '12px'},
{at: 0.6, expect: '9px'},
{at: 1, expect: '5px'},
{at: 1.5, expect: '0px'}
]);
</script>