Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / w3c / web-platform-tests / shadow-dom / html-elements-and-their-shadow-trees / test-002.html
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: A_09_00_02</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/#html-elements-and-their-shadow-trees">
16 <meta name="assert" content="HTML Elements and Their Shadow Trees: Elements that have no fallback content should allow the shadow tree to contain no insertion points or an insertion point that matches nothing">
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">
21 </head>
22 <body>
23 <div id="log"></div>
24 <script>
25 //test img
26 test(unit(function (ctx) {
27
28         var d = newRenderedHTMLDocument(ctx);
29
30         // create element
31     var el = d.createElement('img');
32     d.body.appendChild(el);
33
34     var s = el.createShadowRoot();
35
36     s.innerHTML = '<content id="cont" select="#shadow"></content>';
37
38     assert_true(s.querySelector('#cont') != null, 'img should allow one insertion point ' +
39                 'that matches nothing');
40
41 }), 'A_09_00_02_T01');
42
43
44 //test embed
45 test(unit(function (ctx) {
46
47         var d = newRenderedHTMLDocument(ctx);
48
49         // create element
50     var el = d.createElement('embed');
51     d.body.appendChild(el);
52
53     var s = el.createShadowRoot();
54
55     s.innerHTML = '<content id="cont" select="#shadow"></content>';
56
57     assert_true(s.querySelector('#cont') != null, 'embed should allow one insertion point ' +
58                 'that matches nothing');
59
60 }), 'A_09_00_02_T02');
61
62
63 //test embed
64 test(unit(function (ctx) {
65
66         var d = newRenderedHTMLDocument(ctx);
67
68         // create element
69     var el = d.createElement('input');
70     d.body.appendChild(el);
71
72     var s = el.createShadowRoot();
73
74     s.innerHTML = '<content id="cont" select="#shadow"></content>';
75
76     assert_true(s.querySelector('#cont') != null, 'input should allow one insertion point ' +
77                 'that matches nothing');
78
79 }), 'A_09_00_02_T03');
80 </script>
81 </body>
82 </html>