Chromium Code Reviews| 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..3e46026887e47aaafb92bfc0fed22793e55b1942 |
| --- /dev/null |
| +++ b/LayoutTests/fast/dom/shadow/remove-and-insert-style.html |
| @@ -0,0 +1,66 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| +<script src="../../js/resources/js-test-pre.js"></script> |
| +<script> |
| +if (window.testRunner) |
| + testRunner.waitUntilDone(); |
|
Hajime Morrita
2013/06/05 07:21:06
You can just set window.jsTestIsAsync = true. No t
tasak
2013/06/05 08:30:52
Done.
|
| +</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)); |
| + |
| +setTimeout(function() { |
| + container.remove(); |
| + sr.appendChild(container); |
| + |
| + shouldHaveBackgroundColor(sr2.getElementById('green'), 'rgb(0, 128, 0)'); |
| + testRunner.notifyDone(); |
|
Hajime Morrita
2013/06/05 07:21:06
Call fnishJSTest().
tasak
2013/06/05 08:30:52
Done.
|
| +}, 0); |
| +</script> |
| +</html> |