Update web-platform-tests to revision 33fa44546cbd74796eebfd7e8a33d6fc2f4e020a

This commit is contained in:
WPT Sync Bot 2019-10-11 10:24:47 +00:00
parent 0e503a0e0c
commit e10932a8f7
2576 changed files with 7707 additions and 6192 deletions

View file

@ -14,6 +14,7 @@
overflow: visible;
}
.target {
font-size: 16px;
background-color: black;
width: 10px;
height: 10px;
@ -95,5 +96,32 @@ test_interpolation({
{at: 1, expect: '100px'},
{at: 1.5, expect: '145px'}
]);
// The "vw" unit equals to 1% of the width of the viewport's initial containing
// block:
// https://developer.mozilla.org/en-US/docs/Web/CSS/length
function vw(x) {
return (x * window.innerWidth / 100);
}
// In here, 16 is the font-size which is the value of 1em, and vw(10) is the
// value of 10vw. The calc here takes the "at" in the next interpolation test
// and computes the expected value.
function calc(x) {
return Math.max(16 + (vw(10) - 16) * x, 0).toFixed(2) + "px";
}
test_interpolation({
property: 'width',
from: '1em',
to: '10vw'
}, [
{at: -0.3, expect: calc(-0.3)},
{at: 0, expect: calc(0)},
{at: 0.3, expect: calc(0.3)},
{at: 0.6, expect: calc(0.6)},
{at: 1, expect: calc(1)},
{at: 1.5, expect: calc(1.5)}
]);
</script>
</body>