Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-animations/animation-base-response-002.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Test that rem units are responsive to animated font-size on root</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
@keyframes font_size_animation {
from { font-size: 10px; }
to { font-size: 20px; }
}
:root {
font-size: 1px;
animation: font_size_animation steps(2, end) 1000s -500s;
}
#target1 {
width: 1rem;
}
</style>
<div id="target1"></div>
<script>
test(() => {
assert_equals(getComputedStyle(target1).getPropertyValue('width'), '15px');
}, 'Animated font-size on root affects rem units');
</script>