Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src="../../js/resources/js-test-pre.js"></script> | |
| 5 <script> | |
| 6 if (window.testRunner) | |
| 7 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.
| |
| 8 </script> | |
| 9 </head> | |
| 10 <body> | |
| 11 <!-- crbug.com/246300 --> | |
| 12 <!-- #host shadow root --> | |
| 13 <template id="t"> | |
| 14 <style> | |
| 15 #host { | |
| 16 height: 50px; | |
| 17 width: 50px; | |
| 18 background: lightgray; | |
| 19 } | |
| 20 </style> | |
| 21 <div id="container"></div> | |
| 22 </template> | |
| 23 | |
| 24 <!-- #container shadow root --> | |
| 25 <template id="t2"> | |
| 26 <style> | |
| 27 div { | |
| 28 background: black; | |
| 29 height: 40px; | |
| 30 width: 40px; | |
| 31 } | |
| 32 #green { | |
| 33 background: green; | |
| 34 } | |
| 35 </style> | |
| 36 <div id="green"></div> | |
| 37 </template> | |
| 38 | |
| 39 <div id="host"></div> | |
| 40 </body> | |
| 41 <script> | |
| 42 description('Test for Issue: 246300: Styles in nested shadows are not recalculat ed correctly on insertion.'); | |
| 43 | |
| 44 var backgroundColor; | |
| 45 | |
| 46 function shouldHaveBackgroundColor(element, bg) | |
| 47 { | |
| 48 backgroundColor = window.getComputedStyle(element).backgroundColor; | |
| 49 shouldBeEqualToString("backgroundColor", bg); | |
| 50 } | |
| 51 | |
| 52 var sr = host.webkitCreateShadowRoot(); | |
| 53 sr.appendChild(t.content.cloneNode(true)); | |
| 54 var container = sr.querySelector('#container'); | |
| 55 var sr2 = container.webkitCreateShadowRoot(); | |
| 56 sr2.appendChild(t2.content.cloneNode(true)); | |
| 57 | |
| 58 setTimeout(function() { | |
| 59 container.remove(); | |
| 60 sr.appendChild(container); | |
| 61 | |
| 62 shouldHaveBackgroundColor(sr2.getElementById('green'), 'rgb(0, 128, 0)'); | |
| 63 testRunner.notifyDone(); | |
|
Hajime Morrita
2013/06/05 07:21:06
Call fnishJSTest().
tasak
2013/06/05 08:30:52
Done.
| |
| 64 }, 0); | |
| 65 </script> | |
| 66 </html> | |
| OLD | NEW |