OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <!-- |
| 3 Distributed under both the W3C Test Suite License [1] and the W3C |
| 4 3-clause BSD License [2]. To contribute to a W3C Test Suite, see the |
| 5 policies and contribution forms [3]. |
| 6 |
| 7 [1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license |
| 8 [2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license |
| 9 [3] http://www.w3.org/2004/10/27-testcases |
| 10 --> |
| 11 <html> |
| 12 <head> |
| 13 <meta charset="utf-8"> |
| 14 <title>Shadow DOM Test: Basic distribution</title> |
| 15 <link rel="match" href="shadow-root-002-ref.html"> |
| 16 <link rel="author" title="Anna Ogawa" href="mailto:anna.ogawa.0219@gmail.com"> |
| 17 <link rel="author" title="Yuta Kitamura" href="mailto:yutak@google.com"> |
| 18 <link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#shadow-
trees"> |
| 19 <meta name="assert" content="On distribution, content element is replaced with t
he shadow host's children."> |
| 20 <script src="../testcommon.js"></script> |
| 21 <style> |
| 22 p { color: black; } |
| 23 .pass { color: green; } |
| 24 * { color: red; } |
| 25 </style> |
| 26 </head> |
| 27 <body> |
| 28 <p> |
| 29 You should see four lines of green text "A", "B", "C" and "D" below, |
| 30 in this order. |
| 31 </p> |
| 32 <div id="host"> |
| 33 <div class="pass">B</div> |
| 34 <div class="pass">C</div> |
| 35 </div> |
| 36 <script> |
| 37 var shadowRoot = window.host.createShadowRoot(); |
| 38 |
| 39 shadowRoot.innerHTML = |
| 40 '<style>\n' + |
| 41 '.shadow-pass { color: green; }\n' + |
| 42 '* { color: red; }\n' + |
| 43 '</style>' + |
| 44 '<div class="shadow-pass">A</div>\n' + |
| 45 '<content>FAIL</content>' + |
| 46 '<div class="shadow-pass">D</div>'; |
| 47 </script> |
| 48 </body> |
| 49 </html> |
OLD | NEW |