mirror of
https://github.com/servo/servo.git
synced 2025-08-16 10:55:34 +01:00
Update web-platform-tests to revision 33c263fb308d1c3f6ac6d2590d7292317262819d
This commit is contained in:
parent
5bf00c07c2
commit
482fda3a78
524 changed files with 14686 additions and 3270 deletions
|
@ -0,0 +1,123 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="UTF-8">
|
||||
<title>font-size-adjust interpolation</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-fonts-3/#propdef-font-size-adjust">
|
||||
<meta name="assert" content="font-size-adjust supports animation as a number">
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/interpolation-testcommon.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
.container {
|
||||
font-size: 20px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.parent {
|
||||
font-size-adjust: 3;
|
||||
}
|
||||
|
||||
.target {
|
||||
display: inline-block;
|
||||
font-size-adjust: 1;
|
||||
}
|
||||
|
||||
.expected {
|
||||
color: green;
|
||||
margin-right: 30px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<template id="target-template">
|
||||
<span class="container">
|
||||
<div class="target">x</span>
|
||||
</div>
|
||||
</template>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
test_interpolation({
|
||||
property: 'font-size-adjust',
|
||||
from: neutralKeyframe,
|
||||
to: '2',
|
||||
}, [
|
||||
{at: -2, expect: '0'},
|
||||
{at: -0.3, expect: '0.7'},
|
||||
{at: 0, expect: '1'},
|
||||
{at: 0.3, expect: '1.3'},
|
||||
{at: 0.6, expect: '1.6'},
|
||||
{at: 1, expect: '2'},
|
||||
{at: 1.5, expect: '2.5'},
|
||||
]);
|
||||
|
||||
test_no_interpolation({
|
||||
property: 'font-size-adjust',
|
||||
from: 'initial',
|
||||
to: '2',
|
||||
});
|
||||
|
||||
test_interpolation({
|
||||
property: 'font-size-adjust',
|
||||
from: 'inherit',
|
||||
to: '2',
|
||||
}, [
|
||||
{at: -2, expect: '5'},
|
||||
{at: -0.3, expect: '3.3'},
|
||||
{at: 0, expect: '3'},
|
||||
{at: 0.3, expect: '2.7'},
|
||||
{at: 0.6, expect: '2.4'},
|
||||
{at: 1, expect: '2'},
|
||||
{at: 1.5, expect: '1.5'},
|
||||
]);
|
||||
|
||||
test_interpolation({
|
||||
property: 'font-size-adjust',
|
||||
from: 'unset',
|
||||
to: '2',
|
||||
}, [
|
||||
{at: -2, expect: '5'},
|
||||
{at: -0.3, expect: '3.3'},
|
||||
{at: 0, expect: '3'},
|
||||
{at: 0.3, expect: '2.7'},
|
||||
{at: 0.6, expect: '2.4'},
|
||||
{at: 1, expect: '2'},
|
||||
{at: 1.5, expect: '1.5'},
|
||||
]);
|
||||
|
||||
|
||||
test_interpolation({
|
||||
property: 'font-size-adjust',
|
||||
from: '0',
|
||||
to: '1.2'
|
||||
}, [
|
||||
{at: -2, expect: '0'},
|
||||
{at: -0.3, expect: '0'},
|
||||
{at: 0, expect: '0'},
|
||||
{at: 0.3, expect: '0.36'},
|
||||
{at: 0.6, expect: '0.72'},
|
||||
{at: 1, expect: '1.2'},
|
||||
{at: 1.5, expect: '1.8'},
|
||||
]);
|
||||
|
||||
test_no_interpolation({
|
||||
property: 'font-size-adjust',
|
||||
from: 'none',
|
||||
to: '1.2'
|
||||
});
|
||||
|
||||
test_interpolation({
|
||||
property: 'font-size-adjust',
|
||||
from: '0.2',
|
||||
to: '1.2'
|
||||
}, [
|
||||
{at: -2, expect: '0'}, // CSS font-size-adjust can't be negative.
|
||||
{at: -0.3, expect: '0'},
|
||||
{at: 0, expect: '0.2'},
|
||||
{at: 0.3, expect: '0.5'},
|
||||
{at: 0.6, expect: '0.8'},
|
||||
{at: 1, expect: '1.2'},
|
||||
{at: 1.5, expect: '1.7'},
|
||||
]);
|
||||
</script>
|
|
@ -0,0 +1,103 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="UTF-8">
|
||||
<title>font-size interpolation</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-fonts-3/#propdef-font-size">
|
||||
<meta name="assert" content="font-size supports animation as length">
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/interpolation-testcommon.js"></script>
|
||||
|
||||
<style>
|
||||
.parent {
|
||||
font-size: 30px;
|
||||
}
|
||||
.target {
|
||||
display: inline-block;
|
||||
font: 10px sans-serif;
|
||||
}
|
||||
.expected {
|
||||
color: green;
|
||||
margin-right: 30px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<template id="target-template">
|
||||
<span>
|
||||
<div class="target">Test Text</div>
|
||||
</span>
|
||||
</template>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
test_interpolation({
|
||||
property: 'font-size',
|
||||
from: neutralKeyframe,
|
||||
to: '20px',
|
||||
}, [
|
||||
{at: -2, expect: '0px'},
|
||||
{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: 'font-size',
|
||||
from: 'initial',
|
||||
to: '20px',
|
||||
}, [
|
||||
{at: -2, expect: '8px'},
|
||||
{at: -0.3, expect: '14.8px'},
|
||||
{at: 0, expect: '16px'},
|
||||
{at: 0.3, expect: '17.2px'},
|
||||
{at: 0.6, expect: '18.4px'},
|
||||
{at: 1, expect: '20px'},
|
||||
{at: 1.5, expect: '22px'},
|
||||
]);
|
||||
|
||||
test_interpolation({
|
||||
property: 'font-size',
|
||||
from: 'inherit',
|
||||
to: '20px',
|
||||
}, [
|
||||
{at: -2, expect: '50px'},
|
||||
{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: 'font-size',
|
||||
from: 'unset',
|
||||
to: '20px',
|
||||
}, [
|
||||
{at: -2, expect: '50px'},
|
||||
{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: 'font-size',
|
||||
from: '4px',
|
||||
to: '14px'
|
||||
}, [
|
||||
{at: -2, expect: '0px'}, // CSS font-size can't be negative.
|
||||
{at: -0.3, expect: '1px'},
|
||||
{at: 0, expect: '4px'},
|
||||
{at: 0.3, expect: '7px'},
|
||||
{at: 0.6, expect: '10px'},
|
||||
{at: 1, expect: '14px'},
|
||||
{at: 1.5, expect: '19px'},
|
||||
]);
|
||||
</script>
|
|
@ -0,0 +1,49 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="UTF-8">
|
||||
<title>font-size interpolation</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-fonts-3/#propdef-font-size">
|
||||
<meta name="assert" content="font-size supports animation as length">
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/interpolation-testcommon.js"></script>
|
||||
|
||||
<style>
|
||||
.container {
|
||||
font-size: 10px;
|
||||
}
|
||||
.target {
|
||||
display: inline-block;
|
||||
font: 100px sans-serif;
|
||||
font-size: 20px;
|
||||
}
|
||||
.expected {
|
||||
color: green;
|
||||
margin-right: 30px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<template id="target-template">
|
||||
<span class="container">
|
||||
<div class="target">TT</div>
|
||||
</span>
|
||||
</template>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
// Test the 'unset' case.
|
||||
test_interpolation({
|
||||
property: 'font-size',
|
||||
from: 'unset',
|
||||
to: '20px'
|
||||
}, [
|
||||
{at: -2, expect: '0px'}, // CSS font-size can't be negative.
|
||||
{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'},
|
||||
]);
|
||||
</script>
|
|
@ -0,0 +1,47 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="UTF-8">
|
||||
<title>font-size interpolation with zoom</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-fonts-3/#propdef-font-size">
|
||||
<meta name="assert" content="font-size supports animation as a length, respecting zoom">
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/interpolation-testcommon.js"></script>
|
||||
|
||||
<style>
|
||||
.container {
|
||||
zoom: 2;
|
||||
}
|
||||
.target {
|
||||
display: inline-block;
|
||||
}
|
||||
.expected {
|
||||
color: green;
|
||||
margin-right: 30px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<template id="target-template">
|
||||
<span class="container">
|
||||
<div class="target">TT</div>
|
||||
</span>
|
||||
</template>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
// The container has zoom: 2 applied to it.
|
||||
test_interpolation({
|
||||
property: 'font-size',
|
||||
from: '10px',
|
||||
to: '20px'
|
||||
}, [
|
||||
{at: -2, expect: '0px'}, // CSS font-size can't be negative.
|
||||
{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'},
|
||||
]);
|
||||
</script>
|
|
@ -0,0 +1,132 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="UTF-8">
|
||||
<title>font-variation-settings interpolation</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-fonts-4/#propdef-font-variation-settings">
|
||||
<meta name="assert" content="font-variation-settings supports animation pairwise by 'like' properties">
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/interpolation-testcommon.js"></script>
|
||||
|
||||
<style>
|
||||
.parent {
|
||||
font-variation-settings: "test" 30;
|
||||
}
|
||||
.target {
|
||||
font-variation-settings: "test" 10;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body></body>
|
||||
|
||||
<script>
|
||||
test_interpolation({
|
||||
property: 'font-variation-settings',
|
||||
from: neutralKeyframe,
|
||||
to: '"test" 20',
|
||||
}, [
|
||||
{at: -0.5, expect: "'test' 5"},
|
||||
{at: 0, expect: "'test' 10"},
|
||||
{at: 0.3, expect: "'test' 13"},
|
||||
{at: 0.7, expect: "'test' 17"},
|
||||
{at: 1, expect: "'test' 20"},
|
||||
{at: 1.5, expect: "'test' 25"},
|
||||
]);
|
||||
|
||||
test_no_interpolation({
|
||||
property: 'font-variation-settings',
|
||||
from: 'initial',
|
||||
to: "'test' 50",
|
||||
});
|
||||
|
||||
test_interpolation({
|
||||
property: 'font-variation-settings',
|
||||
from: 'inherit',
|
||||
to: "'test' 20",
|
||||
}, [
|
||||
{at: -0.5, expect: "'test' 35"},
|
||||
{at: 0, expect: "'test' 30"},
|
||||
{at: 0.3, expect: "'test' 27"},
|
||||
{at: 0.7, expect: "'test' 23"},
|
||||
{at: 1, expect: "'test' 20"},
|
||||
{at: 1.5, expect: "'test' 15"},
|
||||
]);
|
||||
|
||||
test_interpolation({
|
||||
property: 'font-variation-settings',
|
||||
from: 'unset',
|
||||
to: "'test' 20",
|
||||
}, [
|
||||
{at: -0.5, expect: "'test' 35"},
|
||||
{at: 0, expect: "'test' 30"},
|
||||
{at: 0.3, expect: "'test' 27"},
|
||||
{at: 0.7, expect: "'test' 23"},
|
||||
{at: 1, expect: "'test' 20"},
|
||||
{at: 1.5, expect: "'test' 15"},
|
||||
]);
|
||||
|
||||
test_no_interpolation({
|
||||
property: 'font-variation-settings',
|
||||
from: "'test' 20",
|
||||
to: "normal",
|
||||
});
|
||||
|
||||
test_interpolation({
|
||||
property: 'font-variation-settings',
|
||||
from: "'test' 20",
|
||||
to: "'test' 30",
|
||||
}, [
|
||||
{at: -0.5, expect: "'test' 15"},
|
||||
{at: 0, expect: "'test' 20"},
|
||||
{at: 0.3, expect: "'test' 23"},
|
||||
{at: 0.7, expect: "'test' 27"},
|
||||
{at: 1, expect: "'test' 30"},
|
||||
{at: 1.5, expect: "'test' 35"},
|
||||
]);
|
||||
|
||||
test_interpolation({
|
||||
property: 'font-variation-settings',
|
||||
from: "'aaaa' 0, 'bbbb' 10, 'cccc' 20",
|
||||
to: "'aaaa' 10, 'bbbb' 20, 'cccc' 30",
|
||||
}, [
|
||||
{at: -0.5, expect: "'aaaa' -5, 'bbbb' 5, 'cccc' 15"},
|
||||
{at: 0, expect: "'aaaa' 0, 'bbbb' 10, 'cccc' 20"},
|
||||
{at: 0.3, expect: "'aaaa' 3, 'bbbb' 13, 'cccc' 23"},
|
||||
{at: 0.7, expect: "'aaaa' 7, 'bbbb' 17, 'cccc' 27"},
|
||||
{at: 1, expect: "'aaaa' 10, 'bbbb' 20, 'cccc' 30"},
|
||||
{at: 1.5, expect: "'aaaa' 15, 'bbbb' 25, 'cccc' 35"},
|
||||
]);
|
||||
|
||||
test_no_interpolation({
|
||||
property: 'font-variation-settings',
|
||||
from: "'aaaa' 0, 'bbbb' 10",
|
||||
to: "'aaaa' 10, 'bbbb' 20, 'cccc' 30",
|
||||
});
|
||||
|
||||
test_no_interpolation({
|
||||
property: 'font-variation-settings',
|
||||
from: "'aaaa' 10, 'bbbb' 20, 'cccc' 30",
|
||||
to: "'aaaa' 0, 'bbbb' 10",
|
||||
});
|
||||
|
||||
test_no_interpolation({
|
||||
property: 'font-variation-settings',
|
||||
from: "'aaaa' 0, 'bbbb' 10, 'cccc' 20",
|
||||
to: "'cccc' 10, 'bbbb' 20, 'aaaa' 30",
|
||||
});
|
||||
|
||||
test_no_interpolation({
|
||||
property: 'font-variation-settings',
|
||||
from: "'aaaa' 0, 'bbbb' 10, 'cccc' 20",
|
||||
to: "'dddd' 10, 'eeee' 20, 'ffff' 30",
|
||||
});
|
||||
|
||||
// crbug.com/910118: Test that ApplyStandardPropertyValue doesn't overflow.
|
||||
test_interpolation({
|
||||
property: 'font-variation-settings',
|
||||
from: "'aaaa' 30, 'bbbb' 20",
|
||||
to: "'aaaa' 20, 'bbbb' 30",
|
||||
}, [
|
||||
{at: 3.40282e+38, expect: "'aaaa' -3.40282e+38, 'bbbb' 3.40282e+38"},
|
||||
]);
|
||||
</script>
|
|
@ -0,0 +1,15 @@
|
|||
<!doctype html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-fonts-4/#font-size-prop">
|
||||
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1572738">
|
||||
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1572451">
|
||||
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
|
||||
<script type="text/javascript" src="/resources/testharness.js"></script>
|
||||
<script type="text/javascript" src="/resources/testharnessreport.js"></script>
|
||||
<div style="font-family: something-non-default; font-size: calc(-100em + 1px);"></div>
|
||||
<div style="font-family: something-non-default; font-size: calc(1em - 100px);"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
for (const element of document.querySelectorAll("div"))
|
||||
assert_equals(getComputedStyle(element).fontSize, "0px");
|
||||
}, "font-size computation isn't messed up when mixing positive and negatives when font-family changes and the parent has a keyword font-size");
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue