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].
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
13 <title>Shadow DOM Test: Upper-boundary encapsuration on ownerDocument: with all HTML5 elements</title>
14 <link rel="author" title="Aleksei Yu. Semenov" href="mailto:sgrekhov@unipro.ru">
15 <link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
16 <link rel="author" title="Mikhail Fursov" href="mailto:mfursov@unipro.ru">
17 <link rel="author" title="Yuta Kitamura" href="mailto:yutak@google.com">
18 <link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#upper-boundary-encapsulation">
19 <meta name="assert" content="Upper-boundary encapsulation: The ownerDocument property of all nodes in shadow tree refers to the document of the shadow host.">
20 <script src="../../../../../resources/testharness.js"></script>
21 <script src="../../../../../resources/testharnessreport.js"></script>
22 <script src="../../testcommon.js"></script>
23 <link rel="stylesheet" href="../../../../../resources/testharness.css">
28 function testElement(elementName) {
29 var doc = document.implementation.createHTMLDocument('Test');
30 var element = doc.createElement(elementName);
31 doc.body.appendChild(element);
32 var shadowRoot = element.createShadowRoot();
33 HTML5_ELEMENT_NAMES.forEach(function (name) {
34 shadowRoot.appendChild(doc.createElement(name));
37 var iterator = doc.createNodeIterator(shadowRoot, 0xFFFFFFFF, null);
39 while (node = iterator.nextNode()) {
40 assert_equals(node.ownerDocument, doc);
44 var testParameters = HTML5_ELEMENT_NAMES.map(function (name) {
46 'ownerDocument property of any elements in a shadow tree should ' +
47 'match the document of the shadow host, when the host is a "' +
53 generate_tests(testElement, testParameters);