Files
tubestation/layout/reftests/webcomponents/input-transition-1.html
Cameron McCormack d4b478fc05 Bug 1373155 - Disable Web Components in Servo-styled documents. r=wchen
MozReview-Commit-ID: 5IBBN2Gfazs
2017-06-15 19:39:58 +08:00

33 lines
1.0 KiB
HTML

<!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>