3 <title>Tests that animations respond to changes to variables
</title>
4 <script src=
"/resources/testharness.js"></script>
5 <script src=
"/resources/testharnessreport.js"></script>
6 <script src=
"../testcommon.js"></script>
15 to { margin-left: var(--width) }
23 const div
= document
.createElement('div');
24 document
.body
.append(div
);
26 div
.style
.animation
= 'widen step-start 100s';
27 assert_equals(getComputedStyle(div
).marginLeft
, '100px',
28 'Animation value before updating CSS variable');
30 div
.classList
.add('wider');
32 assert_equals(getComputedStyle(div
).marginLeft
, '200px',
33 'Animation value after updating CSS variable');
36 }, 'Animation reflects changes to custom properties');
39 const parent
= document
.createElement('div');
40 const child
= document
.createElement('div');
42 document
.body
.append(parent
);
44 child
.style
.animation
= 'widen step-start 100s';
45 assert_equals(getComputedStyle(child
).marginLeft
, '100px',
46 'Animation value before updating CSS variable');
48 parent
.classList
.add('wider');
50 assert_equals(getComputedStyle(child
).marginLeft
, '200px',
51 'Animation value after updating CSS variable');
55 }, 'Animation reflect changes to custom properties on parent');