Move shadow stuff to its own test in link-rel-attribute.html

This commit is contained in:
Anthony Ramine 2018-04-24 12:21:18 +02:00
parent f9fb610c1b
commit cd2b3017c3
3 changed files with 10 additions and 7 deletions

View file

@ -16,11 +16,6 @@
</div>
<script>
var host = document.querySelector("#host");
var shadow = host.attachShadow({ mode: "open" });
var tmpl = document.querySelector("template#shadow-dom");
var clone = document.importNode(tmpl.content, true);
shadow.appendChild(clone);
function testLinkRelModification(testDiv, testLink) {
assert_equals(getComputedStyle(testDiv).color, "rgb(0, 128, 0)");
@ -38,6 +33,11 @@ test (() => {
}, "Removing stylesheet from link rel attribute should remove the stylesheet for light DOM");
test (() => {
var host = document.querySelector("#host");
var shadow = host.attachShadow({ mode: "open" });
var tmpl = document.querySelector("template#shadow-dom");
var clone = document.importNode(tmpl.content, true);
shadow.appendChild(clone);
testLinkRelModification(shadow.querySelector("#shadow-div"),
shadow.querySelector("#shadow-link"));
}, "Removing stylesheet from link rel attribute should remove the stylesheet for shadow DOM");