css-scoping-shadow-with-outside-rules.html (1174B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>CSS Scoping Module Level 1 - a selector outside a shadow tree should not match nodes inside the shadow tree</title> 5 <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/> 6 <link rel="help" href="http://www.w3.org/TR/css-scoping-1/#selectors-data-model"> 7 <link rel="match" href="reference/green-box.html"/> 8 </head> 9 <body> 10 <style> 11 12 my-host { 13 display: block; 14 width: 100px; 15 height: 100px; 16 background: green; 17 } 18 19 div { 20 width: 100%; 21 height: 100%; 22 background: red; 23 content: "FAIL"; 24 } 25 26 </style> 27 <p>Test passes if you see a single 100px by 100px green box below.</p> 28 <my-host> 29 <div>FAIL</div> 30 </my-host> 31 <script> 32 33 try { 34 var shadowHost = document.querySelector('my-host'); 35 shadowRoot = shadowHost.attachShadow({mode: 'open'}); 36 shadowRoot.innerHTML = '<div></div>'; 37 } catch (exception) { 38 document.body.appendChild(document.createTextNode(exception)); 39 } 40 41 </script> 42 </body> 43 </html>