OLD | NEW |
1 Test whether CSSHostRule API works correctly or not. | 1 Test whether CSSHostRule API works correctly or not. |
2 | 2 |
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". |
4 | 4 |
5 | 5 |
6 Before inserting a border rule into @host @-rules: | 6 Before inserting a border rule into @host @-rules: |
7 PASS getComputedStyle(host).borderColor is "rgb(0, 0, 0)" | 7 PASS getComputedStyle(host).borderColor is "rgb(0, 0, 0)" |
8 PASS hostRule.cssRules.length is 0 | 8 PASS hostRule.cssRules.length is 0 |
9 PASS hostRule.type is 1001 | 9 PASS hostRule.type is 1001 |
10 After inserting a border rule with an id selector into @host @-rules: | 10 After inserting a border rule with an id selector into @host @-rules: |
11 PASS getComputedStyle(host).borderColor is "rgb(0, 128, 0)" | 11 PASS getComputedStyle(host).borderColor is "rgb(0, 128, 0)" |
12 PASS hostRule.cssRules.length is 1 | 12 PASS hostRule.cssRules.length is 1 |
13 PASS hostRule.cssText is "@host { \n #host { border-color: green; }\n}" | 13 PASS hostRule.cssText is "@host { \n #host { border-color: green; }\n}" |
14 PASS hostRule.cssRules[0].cssText is "#host { border-color: green; }" | 14 PASS hostRule.cssRules[0].cssText is "#host { border-color: green; }" |
15 After inserting a border rule with a tag selector into @host @-rules: | 15 After inserting a border rule with a tag selector into @host @-rules: |
16 PASS getComputedStyle(host).borderColor is "rgb(0, 128, 0)" | 16 PASS getComputedStyle(host).borderColor is "rgb(0, 128, 0)" |
17 PASS hostRule.cssRules.length is 2 | 17 PASS hostRule.cssRules.length is 2 |
18 PASS hostRule.cssText is "@host { \n #host { border-color: green; }\n div { bo
rder-color: blue; }\n}" | 18 PASS hostRule.cssText is "@host { \n #host { border-color: green; }\n div { bo
rder-color: blue; }\n}" |
19 PASS hostRule.cssRules[0].cssText is "#host { border-color: green; }" | 19 PASS hostRule.cssRules[0].cssText is "#host { border-color: green; }" |
20 PASS hostRule.cssRules[1].cssText is "div { border-color: blue; }" | 20 PASS hostRule.cssRules[1].cssText is "div { border-color: blue; }" |
21 After deleting the border rule with an id selector from @host @-rules: | 21 After deleting the border rule with an id selector from @host @-rules: |
22 PASS getComputedStyle(host).borderColor is "rgb(0, 0, 255)" | 22 PASS getComputedStyle(host).borderColor is "rgb(0, 0, 255)" |
23 PASS hostRule.cssRules.length is 1 | 23 PASS hostRule.cssRules.length is 1 |
24 PASS hostRule.cssText is "@host { \n div { border-color: blue; }\n}" | 24 PASS hostRule.cssText is "@host { \n div { border-color: blue; }\n}" |
25 PASS hostRule.cssRules[0].cssText is "div { border-color: blue; }" | 25 PASS hostRule.cssRules[0].cssText is "div { border-color: blue; }" |
| 26 Error cases |
| 27 PASS hostRule.cssRules.length is 1 |
| 28 PASS hostRule.insertRule('#host { border-color: green; }') threw exception TypeE
rror: Not enough arguments. |
| 29 PASS hostRule.cssRules.length is 1 |
| 30 PASS hostRule.insertRule() threw exception TypeError: Not enough arguments. |
| 31 PASS hostRule.cssRules.length is 1 |
| 32 PASS hostRule.deleteRule() threw exception TypeError: Not enough arguments. |
| 33 PASS hostRule.cssRules.length is 1 |
26 PASS successfullyParsed is true | 34 PASS successfullyParsed is true |
27 | 35 |
28 TEST COMPLETE | 36 TEST COMPLETE |
29 | 37 |
OLD | NEW |