Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /css/css-gaps/animation/rule-color-interpolation-conversion-001.html - WPT Dashboard Interop Dashboard
<html>
<head>
<meta charset="utf-8">
<title>CSS gap color change computed value to non compatible value mid-animation</title>
<link rel="author" title="Javier Contreras" href="mailto:javiercon@microsoft.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/web-animations/testcommon.js"></script>
<style>
#target {
column-rule-color: blue;
animation: color-anim 2s linear paused;
}
@keyframes color-anim {
from { column-rule-color: red; }
}
</style>
</head>
<body>
<div id="target">Dynamic Gap-Color Test</div>
<script>
promise_test(async () => {
const el = document.getElementById('target');
const anim = el.getAnimations()[0];
assert_equals(getComputedStyle(el).columnRuleColor, 'rgb(255, 0, 0)');
// Jump to 50% of the animation.
anim.currentTime = anim.effect.getComputedTiming().duration / 2;
const intermediate = getComputedStyle(el).columnRuleColor;
assert_equals(
intermediate,
'rgb(128, 0, 128)' // The color at 50% of the animation.
);
el.style.columnRuleColor = 'repeat(auto, red)';
const snapped = getComputedStyle(el).columnRuleColor;
assert_equals(
snapped,
'repeat(auto, rgb(255, 0, 0))'
);
});
</script>
</body>
</html>