Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1178)

Side by Side Diff: LayoutTests/imported/web-platform-tests/shadow-dom/styles/test-007.html

Issue 560893005: First checked-in import of the W3C's test suites. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add new expectations for newly failing w3c tests Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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: A_06_00_08</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:The @host @-rule matches a shadow host in th e nesting 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">
21 </head>
22 <body>
23 <div id="log"></div>
24 <script>
25 // The some of the tests below fails.
26 // See https://bugs.webkit.org/show_bug.cgi?id=103608
27
28
29
30 //Test fails. See https://bugs.webkit.org/show_bug.cgi?id=103608
31 test(unit(function (ctx) {
32 var d = newRenderedHTMLDocument(ctx);
33
34 d.head.innerHTML = ':host {display:none;}';
35
36 d.body.innerHTML =
37 '<ul class="cls">' +
38 '<li id="li1" class="shadow">1</li>' +
39 '<li id="li2" class="shadow2">2</li>' +
40 '<li id="li3" class="shadow">3</li>' +
41 '<li id="li4">4</li>' +
42 '<li id="li5" class="shadow">5</li>' +
43 '<li id="li6" class="shadow2">6</li>' +
44 '</ul>';
45
46 var host = d.querySelector('.cls');
47 //Shadow root to play with
48 var s = host.createShadowRoot();
49
50 var div = d.createElement('div');
51 div.innerHTML ='<ul><content select=".shadow"></content></ul>';
52 s.appendChild(div);
53
54 //:host rule shouldn't take any effect
55 assert_true(d.querySelector('#li1').offsetTop > 0,
56 'Point 1: element should be rendered');
57 assert_true(d.querySelector('#li3').offsetTop > 0,
58 'Point 2: element should be rendered');
59 assert_true(d.querySelector('#li5').offsetTop > 0,
60 'Point 3: element should be rendered');
61
62
63 }), 'A_06_00_08_T01');
64
65 //TODO (sgrekhov) Check the expected result at https://www.w3.org/Bugs/Public/sh ow_bug.cgi?id=20150
66 test(unit(function (ctx) {
67 var d = newRenderedHTMLDocument(ctx);
68
69 d.body.innerHTML =
70 '<ul class="cls">' +
71 '<li id="li1" class="shadow">1</li>' +
72 '<li id="li2" class="shadow2">2</li>' +
73 '<li id="li3" class="shadow">3</li>' +
74 '<li id="li4">4</li>' +
75 '<li id="li5" class="shadow">5</li>' +
76 '<li id="li6" class="shadow2">6</li>' +
77 '</ul>';
78
79 var host = d.querySelector('.cls');
80 //Shadow root to play with
81 var s = host.createShadowRoot();
82
83 var div = d.createElement('div');
84 div.innerHTML ='<ul><content select=".shadow"></content></ul>';
85 s.appendChild(div);
86
87 var style = d.createElement('style');
88 style.innerHTML = ':host ul {display:none;}';
89 s.appendChild(style);
90
91 assert_equals(d.querySelector('#li1').offsetTop, 0,
92 'Point 1: element should be rendered');
93 assert_equals(d.querySelector('#li3').offsetTop, 0,
94 'Point 2: element should be rendered');
95 assert_equals(d.querySelector('#li5').offsetTop, 0,
96 'Point 3: element should be rendered');
97
98
99 }), 'A_06_00_08_T02');
100
101
102 //Test fails. See https://bugs.webkit.org/show_bug.cgi?id=103608
103 test(unit(function (ctx) {
104 var d = newRenderedHTMLDocument(ctx);
105
106 var host = d.createElement('div');
107 host.className = 'gone';
108 d.body.appendChild(host);
109
110 //Older tree
111 var s1 = host.createShadowRoot();
112 var div1 = d.createElement('div');
113 div1.innerHTML = '<span id="shd1">This is an old shadow tree</span>';
114 s1.appendChild(div1);
115
116 //Younger tree
117 var s2 = host.createShadowRoot();
118 var div1 = d.createElement('div');
119 div1.innerHTML = '<span id="shd2">This is a young shadow tree</span>' +
120 '<shadow><span id="shd3">This is the shadow tree fallback conten t</span></shadow>';
121 s2.appendChild(div1);
122
123 var style = d.createElement('style');
124 style.innerHTML = ':host {display:none;}';
125 s2.appendChild(style);
126
127 assert_equals(s1.querySelector('#shd1').offsetTop, 0,
128 'Point 1: element should not be rendered');
129
130
131 }), 'A_06_00_08_T03');
132 </script>
133 </body>
134 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698