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 <title>Shadow DOM Test - Tests CSS rules must not apply in a shadow root</title> |
| 14 <link rel="match" href="not-apply-in-shadow-root-001-ref.html"> |
| 15 <link rel="author" title="Kazuhito Hokamura" href="mailto:k.hokamura@gmail.com"> |
| 16 <link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#styles"
> |
| 17 <meta name="assert" content="Styles: CSS rules declared in an enclosing tree mus
t not apply in a shadow tree if apply-author-styles flag is not set."> |
| 18 <script src="../testcommon.js"></script> |
| 19 <style> |
| 20 div { |
| 21 width: 100px; |
| 22 height: 100px; |
| 23 background: green; |
| 24 } |
| 25 </style> |
| 26 </head> |
| 27 <body> |
| 28 <p>Test passes if following box is green.</p> |
| 29 <div id="shadow-host"></div> |
| 30 <script> |
| 31 var shadowHost = document.getElementById('shadow-host'); |
| 32 var shadowRoot = shadowHost.createShadowRoot(); |
| 33 var style = document.createElement('style'); |
| 34 style.innerHTML = 'div { background: red }'; |
| 35 |
| 36 shadowRoot.appendChild(style); |
| 37 </script> |
| 38 </body> |
| 39 </html> |
OLD | NEW |