| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/js-test.js"></script> | 2 <script src="../../../resources/js-test.js"></script> |
| 3 <script> | 3 <script> |
| 4 description('This tests multiple shadow roots creation with createShadowRoot and
mode parameter.'); | 4 description('This tests multiple shadow roots creation with createShadowRoot and
mode parameter.'); |
| 5 | 5 |
| 6 function shouldBeV0ShadowRoot(root) { | 6 function shouldBeV0ShadowRoot(root) { |
| 7 shouldBeEqualToString('internals.shadowRootType(' + root + ')', 'V0ShadowRoo
t'); | 7 shouldBeEqualToString('internals.shadowRootType(' + root + ')', 'V0ShadowRoo
t'); |
| 8 } | 8 } |
| 9 | 9 |
| 10 function shouldBeOpenShadowRoot(root) { | 10 function shouldBeOpenShadowRoot(root) { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 div = document.createElement('div'); | 53 div = document.createElement('div'); |
| 54 shadow1 = div.attachShadow({mode: "closed"}); | 54 shadow1 = div.attachShadow({mode: "closed"}); |
| 55 shouldBeClosedShadowRoot('shadow1'); | 55 shouldBeClosedShadowRoot('shadow1'); |
| 56 shouldThrow('div.createShadowRoot()'); | 56 shouldThrow('div.createShadowRoot()'); |
| 57 shouldThrow('div.attachShadow({mode: "open"})'); | 57 shouldThrow('div.attachShadow({mode: "open"})'); |
| 58 shouldThrow('div.attachShadow({mode: "closed"})'); | 58 shouldThrow('div.attachShadow({mode: "closed"})'); |
| 59 youngestShadowRootShouldBe('div', 'shadow1'); | 59 youngestShadowRootShouldBe('div', 'shadow1'); |
| 60 | 60 |
| 61 | 61 |
| 62 debug('V1 shadow root cannot be created on UA shadow root'); | 62 debug('V0 shadow root cannot be created on UA shadow root'); |
| 63 var input = document.createElement('input'); | 63 var input = document.createElement('input'); |
| 64 shouldBeUserAgentShadowRoot('internals.shadowRoot(input)'); | 64 shouldBeUserAgentShadowRoot('internals.shadowRoot(input)'); |
| 65 shadow1 = input.createShadowRoot(); | 65 shouldThrow('input.createShadowRoot()'); |
| 66 youngestShadowRootShouldBe('input', 'shadow1'); | |
| 67 shouldBeV0ShadowRoot('shadow1'); | |
| 68 | 66 |
| 69 input = document.createElement('input'); | 67 input = document.createElement('input'); |
| 70 shouldThrow('input.attachShadow({mode: "open"})'); | 68 shouldThrow('input.attachShadow({mode: "open"})'); |
| 71 | 69 |
| 72 input = document.createElement('input'); | 70 input = document.createElement('input'); |
| 73 shouldThrow('input.attachShadow({mode: "closed"})'); | 71 shouldThrow('input.attachShadow({mode: "closed"})'); |
| 74 </script> | 72 </script> |
| OLD | NEW |