OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <!-- |
| 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 |
| 5 policies and contribution forms [3]. |
| 6 |
| 7 [1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license |
| 8 [2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license |
| 9 [3] http://www.w3.org/2004/10/27-testcases |
| 10 --> |
| 11 <html> |
| 12 <head> |
| 13 <title>Shadow DOM Test: Window object named properties: "id" attribute</title> |
| 14 <link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru"
> |
| 15 <link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru"> |
| 16 <link rel="author" title="Yuta Kitamura" href="mailto:yutak@google.com"> |
| 17 <link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#upper-b
oundary-encapsulation"> |
| 18 <meta name="assert" content="Upper-boundary encapsulation: The nodes and named e
lements are not accessible from Window object named properties."> |
| 19 <script src="../../../../../resources/testharness.js"></script> |
| 20 <script src="../../../../../resources/testharnessreport.js"></script> |
| 21 <script src="../../testcommon.js"></script> |
| 22 <link rel="stylesheet" href="../../../../../resources/testharness.css"> |
| 23 </head> |
| 24 <body> |
| 25 <div id="log"></div> |
| 26 <script> |
| 27 function testIDAttribute(elementName) { |
| 28 var doc = document.implementation.createHTMLDocument('Title'); |
| 29 var shadowRoot = doc.body.createShadowRoot(); |
| 30 var element = doc.createElement(elementName); |
| 31 element.id = 'test-id'; |
| 32 shadowRoot.appendChild(element); |
| 33 assert_false('test-id' in window); |
| 34 } |
| 35 |
| 36 var idAttributeTestParameter = HTML5_ELEMENT_NAMES.map(function (elementName) { |
| 37 return [ |
| 38 '"' + elementName + '" element with id attribute in a shadow tree ' + |
| 39 'should not be accessible from window object\'s named property.', |
| 40 elementName |
| 41 ]; |
| 42 }); |
| 43 |
| 44 generate_tests(testIDAttribute, idAttributeTestParameter); |
| 45 </script> |
| 46 </body> |
| 47 </html> |
OLD | NEW |