OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src='../resources/testharness.js'></script> | 2 <script src='../resources/testharness.js'></script> |
3 <script src='../resources/testharnessreport.js'></script> | 3 <script src='../resources/testharnessreport.js'></script> |
4 <style> | 4 <style> |
5 div { color: red; } | 5 div { color: red; } |
6 </style> | 6 </style> |
7 <div id='host'></div> | 7 <div id='host'></div> |
8 <div id='dummy'></div> | 8 <div id='dummy'></div> |
9 <script> | 9 <script> |
10 'use strict'; | 10 'use strict'; |
11 | 11 |
12 var root = host.createShadowRoot(); | 12 var root = host.createShadowRoot(); |
13 root.innerHTML = '<style>:host(#host) { color: green; }</style>'; | 13 root.innerHTML = '<style>:host(#host) { color: green; }</style>'; |
14 | 14 |
15 test(() => { | 15 test(() => { |
16 assert_equals(window.getComputedStyle(host).color, 'rgb(0, 128, 0)'); | 16 assert_equals(window.getComputedStyle(host).color, 'rgb(0, 128, 0)'); |
17 // Trigger "V1" shadow cascading order. | 17 // Trigger "V1" shadow cascading order. |
18 dummy.attachShadow({mode: 'open'}); | 18 dummy.attachShadow({mode: 'open'}); |
19 assert_equals(window.getComputedStyle(host).color, 'rgb(255, 0, 0)'); | 19 assert_equals(window.getComputedStyle(host).color, 'rgb(255, 0, 0)'); |
20 }, 'Upgrading V0 to V1 should cause style recalculation.'); | 20 }, 'Upgrading V0 to V1 should cause style recalculation.'); |
21 </script> | 21 </script> |
OLD | NEW |