2 <html class=
"reftest-wait">
4 Opacity transition and animation overridden by !important rule creates a
16 from, to { opacity:
0; }
19 width:
100px; height:
100px;
21 opacity:
0 ! important;
22 transition: opacity
100s steps(
1, start);
23 animation: Opacity0
100s;
29 window
.addEventListener("load", () => {
30 var target
= document
.getElementById("test");
31 getComputedStyle(target
).opacity
;
33 // Change the opacity style to 100%.
34 target
.style
.setProperty("opacity", "1", "important");
35 // Important style is changed but there is a CSS animation,
36 // so transition won't be visible and the CSS animation is overridden by
37 // the !important rule. As a result opacity style here should be 100%
38 // specified by the important rule, but we should create a stacking
39 // context for it because there are animations.
41 getComputedStyle(target
).opacity
;
42 document
.documentElement
.classList
.remove("reftest-wait");