Upstream version 5.34.92.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / w3c / web-platform-tests / shadow-dom / styles / css-variables / test-001.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_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/#css-variables">
16 <meta name="assert" content="CSS variables: The shadow host styles being inherited by the children of the shadow root must also apply to CSS Variables.">
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 //TODO For now (November, 2012) CSS variables support is not implemented yet
26 // so this test won't work. Treat it as a placeholder for now
27 test(unit(function (ctx) {
28
29     var d = newRenderedHTMLDocument(ctx);
30     d.head.innerHtml = '' +
31         '<style>' +
32         'body {font-size:10px;}' +
33         '</style>';
34
35         d.body.innerHTML =
36                 '<ul id="shHost">' +
37                         '<li id="li1" class="shadow">1</li>' +
38                         '<li id="li2" class="shadow2">2</li>' +
39                         '<li id="li3" class="shadow">3</li>' +
40                         '<li id="li4">4</li>' +
41                         '<li id="li5" class="shadow">5</li>' +
42                         '<li id="li6" class="shadow2">6</li>' +
43                 '</ul>';
44
45
46         var host = d.querySelector('#shHost');
47         var s = createSR(host);
48
49         var div = d.createElement('div');
50         div.innerHTML ='<ul><content select=".shadow"></content></ul>';
51         s.appendChild(div);
52
53         var defHeight1 = d.querySelector('#li1').offsetHeight;
54         var defHeight3 = d.querySelector('#li3').offsetHeight;
55         var defHeight5 = d.querySelector('#li5').offsetHeight;
56
57         var style = d.createElement('style');
58         style.innerHTML =':root {' +
59                 'var-text-size: 30px;' +
60                 '}' +
61                 'body {' +
62                 'font-size: var(text-size);' +
63                 '}';
64         s.appendChild(style);
65
66         assert_true(d.querySelector('#li1').offsetHeight > defHeight1, 'Point 1: Element height should be changed');
67         assert_true(d.querySelector('#li3').offsetHeight > defHeight3, 'Point 2: Element height should be changed');
68         assert_true(d.querySelector('#li5').offsetHeight > defHeight5, 'Point 3: Element height should be changed');
69
70 }), 'A_06_01_01_T01');
71 </script>
72 </body>
73 </html>