mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 17:31:47 +09:00
Issue #1375 - Fix IsWebComponentsEnabled checks
This commit is contained in:
parent
a6f048fc42
commit
ca48752304
13 changed files with 154 additions and 137 deletions
|
|
@ -3,6 +3,11 @@
|
|||
<head>
|
||||
<script>
|
||||
function tweak() {
|
||||
if (!document.body.createShadowRoot) {
|
||||
document.documentElement.className = "";
|
||||
return;
|
||||
}
|
||||
|
||||
var host = document.getElementById("host");
|
||||
var shadow = host.createShadowRoot();
|
||||
|
||||
|
|
|
|||
|
|
@ -7,9 +7,11 @@
|
|||
<script>
|
||||
var host, root;
|
||||
|
||||
host = document.getElementById("host");
|
||||
root = host.attachShadow({mode: 'open'});
|
||||
root.innerHTML = 'a <slot></slot> c';
|
||||
function run() {
|
||||
host = document.getElementById("host");
|
||||
root = host.createShadowRoot();
|
||||
root.innerHTML = 'a <content></content> c';
|
||||
}
|
||||
|
||||
function tweak() {
|
||||
var span = document.createElement("span");
|
||||
|
|
@ -21,7 +23,12 @@
|
|||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
|
||||
window.addEventListener("MozReftestInvalidate", tweak);
|
||||
if (document.body.createShadowRoot) {
|
||||
run();
|
||||
window.addEventListener("MozReftestInvalidate", tweak, false);
|
||||
} else {
|
||||
document.documentElement.className = "";
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -7,9 +7,11 @@
|
|||
<script>
|
||||
var host, root;
|
||||
|
||||
host = document.getElementById("host");
|
||||
root = host.attachShadow({mode: 'open'});
|
||||
root.innerHTML = "<span>a</span>";
|
||||
function run() {
|
||||
host = document.getElementById("host");
|
||||
root = host.createShadowRoot();
|
||||
root.innerHTML = "<span>a</span>";
|
||||
}
|
||||
|
||||
function tweak() {
|
||||
var span = document.createElement("span");
|
||||
|
|
@ -22,7 +24,12 @@
|
|||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
|
||||
window.addEventListener("MozReftestInvalidate", tweak);
|
||||
if (document.body.createShadowRoot) {
|
||||
run();
|
||||
window.addEventListener("MozReftestInvalidate", tweak);
|
||||
} else {
|
||||
document.documentElement.className = "";
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -7,9 +7,11 @@
|
|||
<script>
|
||||
var host, root;
|
||||
|
||||
host = document.getElementById("host");
|
||||
root = host.attachShadow({mode: 'open'});
|
||||
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 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");
|
||||
|
|
@ -19,7 +21,12 @@
|
|||
});
|
||||
}
|
||||
|
||||
window.addEventListener("MozReftestInvalidate", tweak);
|
||||
if (document.body.createShadowRoot) {
|
||||
run();
|
||||
window.addEventListener("MozReftestInvalidate", tweak);
|
||||
} else {
|
||||
document.documentElement.className = "";
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -6,8 +6,10 @@
|
|||
<div id="outer"><span id="distnode">text</span></div>
|
||||
<script>
|
||||
|
||||
var shadowRoot = document.getElementById('outer').attachShadow({mode: 'open'});
|
||||
shadowRoot.innerHTML = '<div><slot></slot></div>';
|
||||
function run() {
|
||||
var shadowRoot = document.getElementById('outer').createShadowRoot();
|
||||
shadowRoot.innerHTML = '<div><content></content></div>';
|
||||
}
|
||||
|
||||
function tweak() {
|
||||
var distNode = document.getElementById("distnode");
|
||||
|
|
@ -16,7 +18,12 @@
|
|||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
|
||||
if (document.body.createShadowRoot) {
|
||||
run();
|
||||
window.addEventListener("MozReftestInvalidate", tweak);
|
||||
} else {
|
||||
document.documentElement.className = "";
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue