Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-transitions/no-transition-for-unchanged-pointer-valued-properties.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Transitions: no transition when a restyle leaves these values unchanged</title>
<meta name="assert" content="A restyle that changes no computed value starts no transition.">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
#target {
transition: 100s allow-discrete;
transition-property: scrollbar-color, quotes, list-style-type,
font-feature-settings, font-variant-alternates;
scrollbar-color: red blue;
quotes: "<" ">";
list-style-type: square;
font-feature-settings: "liga" 0;
font-variant-alternates: historical-forms;
}
</style>
<div id="target">x</div>
<script>
test(() => {
const target = document.getElementById('target');
assert_array_equals(target.getAnimations(), []);
target.style = '--unused: 1';
getComputedStyle(target).scrollbarColor;
assert_array_equals(target.getAnimations(), []);
}, 'Restyling without changing computed values starts no transitions');
</script>