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="test-harness-utils.js"></script> | 4 <script src="test-harness-utils.js"></script> |
5 <body> | 5 <body> |
6 <script> | 6 <script> |
7 function TestRegistrationContextIsolation(windowA, documentA, | 7 function TestRegistrationContextIsolation(windowA, documentA, |
8 windowB, documentB) { | 8 windowB, documentB) { |
9 this.windowA = windowA; | 9 this.windowA = windowA; |
10 this.documentA = documentA; | 10 this.documentA = documentA; |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 var tester = new TestRegistrationContextIsolation( | 141 var tester = new TestRegistrationContextIsolation( |
142 frame.contentWindow, documentA, | 142 frame.contentWindow, documentA, |
143 frame.contentWindow, documentB); | 143 frame.contentWindow, documentB); |
144 tester.testRegistrationContextIsNotShared(); | 144 tester.testRegistrationContextIsNotShared(); |
145 frame.remove(); | 145 frame.remove(); |
146 t.done(); | 146 t.done(); |
147 })); | 147 })); |
148 | 148 |
149 })(); | 149 })(); |
150 | 150 |
| 151 (function () { |
| 152 |
| 153 var t = async_test('registration context should not be created by ' + |
| 154 'DOMImplementation-created documents'); |
| 155 |
| 156 withFrame(t.step_func(function (frame) { |
| 157 // Test transitively sloughing off a registration context through |
| 158 // multiple createDocument/createHTMLDocument steps. |
| 159 |
| 160 var documentA = frame.contentDocument; |
| 161 |
| 162 // This document is not HTML, XHTML; it will not process custom elements. |
| 163 var documentB = documentA.implementation.createDocument(null, ''); |
| 164 assert_throws( |
| 165 'NOT_SUPPORTED_ERR', |
| 166 function() { documentB.registerElement('x-a'); }); |
| 167 |
| 168 // This document will not process custom elements because there is |
| 169 // nothing to inherit from B. |
| 170 var documentC = documentB.implementation.createHTMLDocument(); |
| 171 assert_throws( |
| 172 'NOT_SUPPORTED_ERR', |
| 173 function() { documentC.registerElement('x-b'); }); |
| 174 |
| 175 // Nor this one. |
| 176 var documentD = documentC.implementation.createDocument( |
| 177 'http://www.w3.org/1999/xhtml', 'html'); |
| 178 assert_throws( |
| 179 'NOT_SUPPORTED_ERR', |
| 180 function() { documentD.registerElement('x-c'); }); |
| 181 |
| 182 frame.remove(); |
| 183 t.done(); |
| 184 })); |
| 185 |
| 186 })(); |
| 187 |
151 </script> | 188 </script> |
OLD | NEW |