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: "name" 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 testNameAttribute(elementName) { |
| 28 var doc = document.implementation.createHTMLDocument('Title'); |
| 29 var shadowRoot = doc.body.createShadowRoot(); |
| 30 var element = doc.createElement(elementName); |
| 31 element.name = 'test-name'; |
| 32 shadowRoot.appendChild(element); |
| 33 assert_false('test-name' in window); |
| 34 } |
| 35 |
| 36 var namedElements = [ |
| 37 'a', 'applet', 'area', 'embed', 'form', 'frameset', 'img', 'object' |
| 38 ]; |
| 39 |
| 40 var nameAttributeTestParameter = namedElements.map(function (elementName) { |
| 41 return [ |
| 42 '"' + elementName + '" element with name attribute in a shadow tree ' + |
| 43 'should not be accessible from window object\'s named property.', |
| 44 elementName |
| 45 ]; |
| 46 }); |
| 47 |
| 48 generate_tests(testNameAttribute, nameAttributeTestParameter); |
| 49 </script> |
| 50 </body> |
| 51 </html> |
OLD | NEW |