Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /svg/animations/animate-currentcolor-in-visited-link.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>SMIL animating 'currentcolor' on target within visited link</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
a:link { color: blue; }
a:visited { color: lightblue; }
</style>
<a href="">
<svg>
<rect id="r" width="100" height="100">
<set attributeName="fill" to="currentcolor"/>
</rect>
</svg>
</a>
<script>
async_test(t => {
const rect = document.getElementById('r');
const set = rect.firstElementChild;
set.onbegin = t.step_func_done(() => {
const style = getComputedStyle(rect);
assert_equals(style.fill, style.color, `currentcolor animation does not leak :visited`);
});
});
</script>