OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Distributed under both the W3C Test Suite License [1] and the W3C | 3 Distributed under both the W3C Test Suite License [1] and the W3C |
4 3-clause BSD License [2]. To contribute to a W3C Test Suite, see the | 4 3-clause BSD License [2]. To contribute to a W3C Test Suite, see the |
5 policies and contribution forms [3]. | 5 policies and contribution forms [3]. |
6 | 6 |
7 [1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license | 7 [1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license |
8 [2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license | 8 [2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license |
9 [3] http://www.w3.org/2004/10/27-testcases | 9 [3] http://www.w3.org/2004/10/27-testcases |
10 --> | 10 --> |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 ); | 120 ); |
121 | 121 |
122 test(function () { | 122 test(function () { |
123 var doc = document.implementation.createHTMLDocument(''); | 123 var doc = document.implementation.createHTMLDocument(''); |
124 populateTestContentToHostDocument(doc); | 124 populateTestContentToHostDocument(doc); |
125 var shadowRoot = doc.documentElement.createShadowRoot(); | 125 var shadowRoot = doc.documentElement.createShadowRoot(); |
126 populateTestContentToShadowRoot(shadowRoot); | 126 populateTestContentToShadowRoot(shadowRoot); |
127 | 127 |
128 // Replace the content of <title> to distinguish elements in a host | 128 // Replace the content of <title> to distinguish elements in a host |
129 // document and a shadow tree. | 129 // document and a shadow tree. |
130 doc.getElementsByTagName('title')[0].innerText = 'Title of host document'; | 130 doc.getElementsByTagName('title')[0].textContent = 'Title of host document'; |
131 shadowRoot.getElementsByTagName('title')[0].innerText = | 131 shadowRoot.getElementsByTagName('title')[0].textContent = |
132 'Title of shadow tree'; | 132 'Title of shadow tree'; |
133 | 133 |
134 assert_equals(doc.title, 'Title of host document'); | 134 assert_equals(doc.title, 'Title of host document'); |
135 }, | 135 }, |
136 'The content of title element in a shadow tree should not be accessible ' + | 136 'The content of title element in a shadow tree should not be accessible ' + |
137 'from owner document\'s "title" attribute.' | 137 'from owner document\'s "title" attribute.' |
138 ); | 138 ); |
139 | 139 |
140 function testHTMLCollection(accessor) { | 140 function testHTMLCollection(accessor) { |
141 var doc = createDocumentForTesting(); | 141 var doc = createDocumentForTesting(); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 | 216 |
217 shadowRoot.getElementsByTagName('p')[0].id = 'test-id'; | 217 shadowRoot.getElementsByTagName('p')[0].id = 'test-id'; |
218 assert_equals(doc.getElementById('test-id'), null); | 218 assert_equals(doc.getElementById('test-id'), null); |
219 }, | 219 }, |
220 'Elements in a shadow tree should not be accessible from owner ' + | 220 'Elements in a shadow tree should not be accessible from owner ' + |
221 'document\'s getElementById() method.' | 221 'document\'s getElementById() method.' |
222 ); | 222 ); |
223 </script> | 223 </script> |
224 </body> | 224 </body> |
225 </html> | 225 </html> |
OLD | NEW |