blob: 9915eacee0866260e11fd1e795a9ef940d5a54aa [file] [log] [blame]
<!doctype html>
<html>
<head>
<script src="../../../resources/js-test-pre.js"></script>
<script>
description("Test for https://bugs.webkit.org/show_bug.cgi?id=92899. Dynamically styling ShadowDom content on a node distributed to another shadow insertion point fails.");
if (window.testRunner)
testRunner.dumpAsText();
</script>
</head>
<body>
<div id="box" style="border: 1px solid black;">
<div id="item"><div>Content required here to reproduce bug.</div></div>
</div>
<script>
var box = document.querySelector("#box");
var oldestShadowRoot = box.webkitCreateShadowRoot();
oldestShadowRoot.innerHTML = "<content></content>";
var youngestShadowRoot = document.querySelector("#item").webkitCreateShadowRoot();
youngestShadowRoot.innerHTML = "<style>" +
".selected {background: red;}" +
"</style>" +
"<div id='target'>Content</div>";
document.body.offsetLeft;
target = youngestShadowRoot.querySelector("div");
target.classList.add("selected");
shouldBe('window.getComputedStyle(target).backgroundColor', '"rgb(255, 0, 0)"');
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>