- Notifications
You must be signed in to change notification settings - Fork 3.3k
/
Copy pathfont-size-animation.html
44 lines (44 loc) · 1.41 KB
/
font-size-animation.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE html>
<linkrel="help" href="https://drafts.css-houdini.org/css-properties-values-api-1">
<linkrel="help" href="https://github.com/w3c/csswg-drafts/issues/3751">
<scriptsrc="/resources/testharness.js"></script>
<scriptsrc="/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>
<divid=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>".
//
// See https://github.com/w3c/csswg-drafts/issues/3751
assert_equals(getComputedStyle(target1).getPropertyValue('width'),
getComputedStyle(target1).getPropertyValue('--length'));
},'Animating font-size handled identically for standard and custom properties');
</script>