| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>CSS Scoping Module Level 1 - Only rules outside a shadow tree must ap
ply to nodes assigned to a slot in the shadow tree.</title> | 4 <title>CSS Scoping Module Level 1 - Ensure that slot's style is inherited by
slotted children</title> |
| 5 <link rel="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/> | 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-mo
del"> | 6 <link rel="help" href="http://www.w3.org/TR/css-scoping-1/#selectors-data-mo
del"> |
| 7 <link rel="match" href="reference/green-box.html"/> | 7 <link rel="match" href="reference/green-box.html"/> |
| 8 </head> | 8 </head> |
| 9 <body> | 9 <body> |
| 10 <style> | 10 <style> |
| 11 my-host { | 11 my-host, my-non-host { |
| 12 display: block; | 12 display: block; |
| 13 width: 100px; | 13 width: 100px; |
| 14 height: 100px; | 14 height: 50px; |
| 15 overflow: hidden; | 15 overflow: hidden; |
| 16 background: green; | 16 background: red; |
| 17 color: red; |
| 17 } | 18 } |
| 18 div { | 19 div { |
| 19 width: 100%; | 20 width: 100%; |
| 20 height: 50%; | 21 height: 50%; |
| 21 } | 22 } |
| 22 .green { | |
| 23 color: green; | |
| 24 } | |
| 25 .red { | |
| 26 color: red; | |
| 27 } | |
| 28 </style> | 23 </style> |
| 29 <p>Test passes if you see a single 100px by 100px green box below.</p> | 24 <p>Test passes if you see a single 100px by 100px green box below.</p> |
| 30 <my-host> | 25 <my-host> |
| 31 <div class="red">FAIL</div> | 26 <div slot="green" style="background: green;">FAIL</div> |
| 32 <div class="green" slot="green">FAIL</div> | 27 <div slot="green" style="background: inherit;">FAIL</div> |
| 33 <div class="red" slot="invalid">FAIL</div> | |
| 34 <div class="green" slot="green">FAIL</div> | |
| 35 </my-host> | 28 </my-host> |
| 29 <my-non-host> |
| 30 <slot name="green" style="color: green; background: green"> |
| 31 <div slot="green" style="background: green;">FAIL</div> |
| 32 <div slot="green" style="background: inherit;">FAIL</div> |
| 33 </slot> |
| 34 </my-non-host> |
| 36 <script> | 35 <script> |
| 37 | 36 |
| 38 try { | 37 try { |
| 39 var shadowHost = document.querySelector('my-host'); | 38 var shadowHost = document.querySelector('my-host'); |
| 40 shadowRoot = shadowHost.attachShadow({mode: 'open'}); | 39 shadowRoot = shadowHost.attachShadow({mode: 'open'}); |
| 41 shadowRoot.innerHTML = '<style> div { color: yellow; } </style><slot nam
e="green"></slot>'; | 40 shadowRoot.innerHTML = '<slot name="green" style="color: green; backgrou
nd: green"></slot>'; |
| 42 } catch (exception) { | 41 } catch (exception) { |
| 43 document.body.appendChild(document.createTextNode(exception)); | 42 document.body.appendChild(document.createTextNode(exception)); |
| 44 } | 43 } |
| 45 | 44 |
| 46 </script> | 45 </script> |
| 47 </body> | 46 </body> |
| 48 </html> | 47 </html> |
| OLD | NEW |