Upstream version 7.35.144.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / w3c / web-platform-tests / shadow-dom / styles / test-006.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_06_00_07</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/#styles">
16 <meta name="assert" content="Styles:Rules that contain select reference combinators match elements in the enclosing trees">
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 //Reference combinators are not implemented yet, so the test shouldn't work for now
26 //See the progress at  http://wkb.ug/82169
27 test(unit(function (ctx) {
28         var d = newRenderedHTMLDocument(ctx);
29
30     d.body.innerHTML =
31         '<ul class="cls">' +
32                 '<li id="li1" class="shadow">1</li>' +
33                 '<li id="li2" class="shadow2">2</li>' +
34                 '<li id="li3" class="shadow">3</li>' +
35                 '<li id="li4">4</li>' +
36                 '<li id="li5" class="shadow">5</li>' +
37                 '<li id="li6" class="shadow2">6</li>' +
38         '</ul>' +
39         '<div id="sr">' +
40         '</div>';
41
42         var host = d.querySelector('#sr');
43
44         //Shadow root to play with
45         var s = createSR(host);
46
47         var style = d.createElement('style');
48         style.innerHTML ='ul.cls/select/li.shadow {display:none}';
49         s.appendChild(style);
50
51         var span = d.createElement('span');
52         span.setAttribute('id', 'theShadowSpan');
53         span.setAttribute('class', 'invis');
54         s.appendChild(span);
55
56         //li1, li3 and li5 should be invisible
57         assert_equals(d.querySelector('#li1').offsetTop, 0,
58                 'Point 1: Rules that contain select reference combinators should match elements ' +
59                 'in the enclosing trees');
60         assert_equals(d.querySelector('#li3').offsetTop, 0,
61                 'Point 2: Rules that contain select reference combinators should match elements ' +
62                 'in the enclosing trees');
63         assert_equals(d.querySelector('#li5').offsetTop, 0,
64                 'Point 3: Rules that contain select reference combinators should match elements ' +
65                 'in the enclosing trees');
66
67 }), 'A_06_00_07_T01');
68 </script>
69 </body>
70 </html>