Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src="../../../resources/testharness.js"></script> | |
| 3 <script src="../../../resources/testharnessreport.js"></script> | |
| 4 <div id="container" lang="ja"> | |
| 5 <div id="host"></div> | |
| 6 <div id="hostWithContent"><div>Should be visible</div></div> | |
| 7 </div> | |
| 8 <script> | |
| 9 var host = document.getElementById("host"); | |
| 10 var root = host.createShadowRoot(); | |
| 11 root.innerHTML = "<style>:lang(ja) { display:none; }</style><div lang='fr'>Shoul d be visible</div><div>Should be hidden</div>"; | |
| 12 test(function () { | |
| 13 var japanese = root.lastChild; | |
| 14 assert_equals(japanese.offsetHeight, 0); | |
|
hayato
2015/01/21 09:04:50
Could you also assert "<div lang='fr'>Should be vi
kojii
2015/01/21 16:46:20
Done.
| |
| 15 }, "lang inherits into shadow tree"); | |
| 16 | |
| 17 host = document.getElementById("hostWithContent"); | |
| 18 root = host.createShadowRoot(); | |
| 19 root.innerHTML = "<style>:lang(ja) { display:none; }</style><div lang='fr'><cont ent></content></div>"; | |
| 20 test(function () { | |
| 21 var content = host.firstChild; | |
| 22 assert_not_equals(content.offsetHeight, 0); | |
| 23 }, "lang of distributed content traverses composed tree"); | |
| 24 if (window.testRunner) | |
| 25 container.style.display = "none"; | |
| 26 </script> | |
| OLD | NEW |