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: ShadowRoot olderShadowRoot</title>
14 <link rel="author" title="Kenji Baheux" href="mailto:kenjibaheux@google.com">
15 <link rel="author" title="Kyohei Tsukuda" href="tsukuda.kyouhei@gmail.com">
16 <link rel="help" href="http://w3c.github.io/webcomponents/spec/shadow/#widl-ShadowRoot-olderShadowRoot">
17 <meta name="assert" content="The ShadowRoot element: olderShadowRoot attribute">
18 <script src="../../../../../../resources/testharness.js"></script>
19 <script src="../../../../../../resources/testharnessreport.js"></script>
20 <script src="../../../testcommon.js"></script>
21 <link rel="stylesheet" href="../../../../../../resources/testharness.css">
26 test(unit(function (ctx) {
28 var d = newRenderedHTMLDocument(ctx);
30 var host = d.createElement('div');
31 d.body.appendChild(host);
33 // Shadow root and older Shadow root to play with
34 var oldRoot = host.createShadowRoot();
36 var div = d.createElement('div');
38 '<span id="spandex">This is a shadow root content</span>' +
39 '<content><span id="contentId">This is the content fallback</span></content>';
40 oldRoot.appendChild(div);
41 var youngRoot = host.createShadowRoot();
43 assert_equals(oldRoot.olderShadowRoot, null, 'If the context object is the oldest shadow root, return null');
44 assert_equals(youngRoot.olderShadowRoot, oldRoot, 'Return the older shadow root relative to the context object');
46 }), 'ShadowRoot.olderShadowRoot_T01');