Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-properties-values-api/font-size-animation.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
CSS.registerProperty({
name: '--length',
syntax: '<length>',
initialValue: '0px',
inherits: false
});
</script>
<style>
@keyframes font_size_animation {
from {
font-size: 10px;
width: 10em;
--length: 10em;
}
to {
font-size: 20px;
width: 20em;
--length: 20em;
}
}
#target1 {
font-size: 1px;
animation: font_size_animation 10s -5s linear paused;
}
</style>
<div id=target1></div>
<script>
test(function() {
// At the time of writing, the correct (absolute) answer is not
// yet defined. However, whatever the correct answer is, there should
// be no difference in 'width' and a custom property registered with
// "<length>".
//
assert_equals(getComputedStyle(target1).getPropertyValue('width'),
getComputedStyle(target1).getPropertyValue('--length'));
}, 'Animating font-size handled identically for standard and custom properties');
</script>