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: 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-Shad
owRoot-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"> |
| 22 </head> |
| 23 <body> |
| 24 <div id="log"></div> |
| 25 <script> |
| 26 test(unit(function (ctx) { |
| 27 |
| 28 var d = newRenderedHTMLDocument(ctx); |
| 29 |
| 30 var host = d.createElement('div'); |
| 31 d.body.appendChild(host); |
| 32 |
| 33 // Shadow root and older Shadow root to play with |
| 34 var oldRoot = host.createShadowRoot(); |
| 35 |
| 36 var div = d.createElement('div'); |
| 37 div.innerHTML = '' + |
| 38 '<span id="spandex">This is a shadow root content</span>' + |
| 39 '<content><span id="contentId">This is the content fallback</spa
n></content>'; |
| 40 oldRoot.appendChild(div); |
| 41 var youngRoot = host.createShadowRoot(); |
| 42 |
| 43 assert_equals(oldRoot.olderShadowRoot, null, 'If the context object is t
he oldest shadow root, return null'); |
| 44 assert_equals(youngRoot.olderShadowRoot, oldRoot, 'Return the older shad
ow root relative to the context object'); |
| 45 |
| 46 }), 'ShadowRoot.olderShadowRoot_T01'); |
| 47 </script> |
| 48 </body> |
| 49 </html> |
OLD | NEW |