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: A_08_01_01</title>
14 <link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
15 <link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#inert-html-elements">
16 <meta name="assert" content="HTML Elements in shadow trees: base element must behave as inert, or not part of the document tree">
17 <script src="../../../../../resources/testharness.js"></script>
18 <script src="../../../../../resources/testharnessreport.js"></script>
19 <script src="../../testcommon.js"></script>
20 <link rel="stylesheet" href="../../../../../resources/testharness.css">
25 var A_08_01_01_T01 = async_test('A_08_01_01_T01', { timeout: 5000 });
27 A_08_01_01_T01.checkIframeContent = A_08_01_01_T01.step_func(function () {
28 //remember value to check before cleaning the context (it'll destroy the iframe)
29 var valueToCheck = A_08_01_01_T01.iframe.contentWindow;
30 cleanContext(A_08_01_01_T01.ctx);
32 assert_equals(valueToCheck, null,
33 'base html element ih a shadow tree must beahve like inert one');
35 A_08_01_01_T01.done();
39 A_08_01_01_T01.step(function () {
41 A_08_01_01_T01.ctx = newContext();
42 var d = newRenderedHTMLDocument(A_08_01_01_T01.ctx);
45 var iframe = document.createElement('iframe');
47 iframe.src = '../../resources/blank.html';
48 iframe.setAttribute('name', 'targetIframe');
49 d.body.appendChild(iframe);
51 A_08_01_01_T01.iframe = iframe;
54 var link = d.createElement('a');
55 link.setAttribute('href', '../../resources/bobs_page.html');
56 link.innerHTML = 'the link';
57 d.body.appendChild(link);
60 var root = d.createElement('div');
61 d.body.appendChild(root);
62 var s = root.createShadowRoot();
64 // create base element, set iframe as a target
65 var base = d.createElement('base');
66 base.setAttribute('target', 'targetIframe');
72 //Expected: base should be inert therefore document d
73 // should be reloaded, so iframe context shouldn't be affected
75 // set timeout to give the iframe time to load content
76 setTimeout('A_08_01_01_T01.checkIframeContent()', 2000);