OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <script src="../../../resources/js-test.js"></script> | |
5 <script> | |
6 if (window.internals) | |
7 window.internals.settings.setStyleScopedEnabled(false); | |
8 </script> | |
9 </head> | |
10 <body> | |
11 <div id="host"></div> | |
12 <span id='shouldNotBeApplied'>Should not be blue</span> | |
13 <div> | |
14 <style scoped> p { color: red; } </style> | |
15 <p id='insideScope'>Should be red</p> | |
16 </div> | |
17 <p id='shouldNotBeScoped'>Should be red</p> | |
18 <script> | |
19 description("This test ensures content element feature can be disabled"); | |
20 var host = document.getElementById("host"); | |
21 var shadow = host.createShadowRoot(); | |
22 shadow.innerHTML = "<style> span { color: blue; } </style><span id='shouldBeAppl
ied'>Should be blue</span>"; | |
23 var shouldBeApplied = shadow.getElementById("shouldBeApplied"); | |
24 var shouldNotBeApplied = document.getElementById("shouldNotBeApplied"); | |
25 var shouldNotBeScoped = document.getElementById("shouldNotBeScoped"); | |
26 var insideScope = document.getElementById("insideScope"); | |
27 shouldBe("window.getComputedStyle(shouldBeApplied).color", "'rgb(0, 0, 255)'"); | |
28 shouldBe("window.getComputedStyle(shouldNotBeApplied).color", "'rgb(0, 0, 0)'"); | |
29 shouldBe("window.getComputedStyle(insideScope).color", "'rgb(255, 0, 0)'"); | |
30 shouldBe("window.getComputedStyle(shouldNotBeScoped).color", "'rgb(255, 0, 0)'")
; | |
31 finishJSTest(); | |
32 </script> | |
33 </body> | |
34 </html> | |
OLD | NEW |