123456789101112131415161718192021222324252627282930313233 |
- <!DOCTYPE html>
- <html class="reftest-wait">
- <head>
- </head>
- <body>
- <div id="host"></div>
- <script>
- var host, root;
- function run() {
- host = document.getElementById("host");
- root = host.createShadowRoot();
- root.innerHTML = '<style>input ~ div { background: red; transition: background 100ms; } input:checked ~ div { background: green; }</style><input id="one" type="checkbox"><div style="height: 50px; width: 50px;"></div>';
- }
- function tweak() {
- var el = root.getElementById("one");
- el.checked = true;
- el.nextSibling.addEventListener("transitionend", function() {
- setTimeout(()=>{document.documentElement.removeAttribute("class")}, 1000); // wait for the checkbox SVG image to load on Android
- });
- }
- if (document.body.createShadowRoot) {
- run();
- window.addEventListener("MozReftestInvalidate", tweak);
- } else {
- document.documentElement.className = "";
- }
- </script>
- </body>
- </html>
|