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 <script src="resources/shadow-dom.js"></script> | 4 <script src="resources/shadow-dom.js"></script> |
5 <body> | 5 <body> |
6 <div id="host"> | 6 <div id="host"> |
7 <template mode-data="open"> | 7 <template mode-data="open"> |
8 <link rel="stylesheet" title="preferred1" href="data:text/css,#shadowChild
1 { color: green }"> | 8 <link rel="stylesheet" title="preferred1" href="data:text/css,#shadowChild
1 { color: green }"> |
9 <link rel="stylesheet" title="title1" href="data:text/css,#shadowChild2 {
color: green }"> | 9 <link rel="stylesheet" title="title1" href="data:text/css,#shadowChild2 {
color: green }"> |
10 <link rel="alternate stylesheet" title="prefered1" href="data:text/css,#sh
adowChild3 { color: green }"> | 10 <link rel="alternate stylesheet" title="prefered1" href="data:text/css,#sh
adowChild3 { color: green }"> |
(...skipping 23 matching lines...) Expand all Loading... |
34 test(() => { | 34 test(() => { |
35 assert_equals(colorFor(host.shadowRoot.querySelector('#shadowChild1')), 'rgb(0
, 128, 0)'); | 35 assert_equals(colorFor(host.shadowRoot.querySelector('#shadowChild1')), 'rgb(0
, 128, 0)'); |
36 assert_equals(colorFor(host.shadowRoot.querySelector('#shadowChild2')), 'rgb(0
, 128, 0)'); | 36 assert_equals(colorFor(host.shadowRoot.querySelector('#shadowChild2')), 'rgb(0
, 128, 0)'); |
37 }, '<link rel="stylesheet" title="xxx"> shoule behave as <link rel="stylesheet">
(always enabled because title is ignored) in a connected shadow tree.'); | 37 }, '<link rel="stylesheet" title="xxx"> shoule behave as <link rel="stylesheet">
(always enabled because title is ignored) in a connected shadow tree.'); |
38 | 38 |
39 test(() => { | 39 test(() => { |
40 assert_equals(colorFor(host.shadowRoot.querySelector('#shadowChild3')), 'rgb(0
, 0, 0)'); | 40 assert_equals(colorFor(host.shadowRoot.querySelector('#shadowChild3')), 'rgb(0
, 0, 0)'); |
41 assert_equals(colorFor(host.shadowRoot.querySelector('#shadowChild4')), 'rgb(0
, 0, 0)'); | 41 assert_equals(colorFor(host.shadowRoot.querySelector('#shadowChild4')), 'rgb(0
, 0, 0)'); |
42 }, '<link rel="alternate stylesheet" title="xxx"> shoule behave as <link rel="al
ternate stylesheet"> (never enabled because title is ignored) in a connected sha
dow tree.'); | 42 }, '<link rel="alternate stylesheet" title="xxx"> shoule behave as <link rel="al
ternate stylesheet"> (never enabled because title is ignored) in a connected sha
dow tree.'); |
43 | 43 |
| 44 test(() => { |
| 45 assert_equals(host.shadowRoot.styleSheets.length, 4); |
| 46 assert_equals(host.shadowRoot.styleSheets[0].title, null); |
| 47 assert_equals(host.shadowRoot.styleSheets[1].title, null); |
| 48 assert_equals(host.shadowRoot.styleSheets[2].title, null); |
| 49 assert_equals(host.shadowRoot.styleSheets[3].title, null); |
| 50 }, 'StyleSheet.title should always be null in shadow trees.'); |
44 </script> | 51 </script> |
OLD | NEW |