| Index: LayoutTests/fast/dom/shadow/remove-and-insert-style.html
|
| diff --git a/LayoutTests/fast/dom/shadow/remove-and-insert-style.html b/LayoutTests/fast/dom/shadow/remove-and-insert-style.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..34955b592ce3432a8e4464b382d35b65cb4bba81
|
| --- /dev/null
|
| +++ b/LayoutTests/fast/dom/shadow/remove-and-insert-style.html
|
| @@ -0,0 +1,64 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| +<head>
|
| +<script src="../../js/resources/js-test-pre.js"></script>
|
| +</head>
|
| +<body>
|
| + <!-- crbug.com/246300 -->
|
| + <!-- #host shadow root -->
|
| + <template id="t">
|
| + <style>
|
| + #host {
|
| + height: 50px;
|
| + width: 50px;
|
| + background: lightgray;
|
| + }
|
| + </style>
|
| + <div id="container"></div>
|
| + </template>
|
| +
|
| + <!-- #container shadow root -->
|
| + <template id="t2">
|
| + <style>
|
| + div {
|
| + background: black;
|
| + height: 40px;
|
| + width: 40px;
|
| + }
|
| + #green {
|
| + background: green;
|
| + }
|
| + </style>
|
| + <div id="green"></div>
|
| + </template>
|
| +
|
| + <div id="host"></div>
|
| +</body>
|
| +<script>
|
| +description('Test for Issue: 246300: Styles in nested shadows are not recalculated correctly on insertion.');
|
| +
|
| +var backgroundColor;
|
| +
|
| +function shouldHaveBackgroundColor(element, bg)
|
| +{
|
| + backgroundColor = window.getComputedStyle(element).backgroundColor;
|
| + shouldBeEqualToString("backgroundColor", bg);
|
| +}
|
| +
|
| +var sr = host.webkitCreateShadowRoot();
|
| +sr.appendChild(t.content.cloneNode(true));
|
| +var container = sr.querySelector('#container');
|
| +var sr2 = container.webkitCreateShadowRoot();
|
| +sr2.appendChild(t2.content.cloneNode(true));
|
| +
|
| +jsTestIsAsync = true;
|
| +setTimeout(function() {
|
| + container.remove();
|
| + sr.appendChild(container);
|
| +
|
| + shouldHaveBackgroundColor(sr2.getElementById('green'), 'rgb(0, 128, 0)');
|
| + finishJSTest();
|
| +}, 0);
|
| +</script>
|
| +<script src="../../js/resources/js-test-post.js"></script>
|
| +</html>
|
|
|