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

Side by Side Diff: LayoutTests/fast/dom/shadow/dynamically-added-cat-hat-rules.html

Issue 289923004: Rename layout test filenames with "cat" and "hat" combinators (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 <html>
3 <head>
4 <script src="resources/shadow-dom.js"></script>
5 <script src="../../../resources/js-test.js"></script>
6 </head>
7 <body>
8 <div id='sandbox'>
9 <div id='target5' class='bar'>Should have blue background.</div>
10 </div>
11 <pre id='console'></pre>
12 </body>
13 <script>
14
15 function backgroundColorOf(node)
16 {
17 return document.defaultView.getComputedStyle(node, null).getPropertyValue('b ackground-color');
18 }
19
20 function backgroundColorShouldBe(selector, color)
21 {
22 var text = 'backgroundColorOf(getNodeInTreeOfTrees("' + selector + '"))';
23 shouldBeEqualToString(text, color);
24 }
25
26 var sandbox = document.getElementById('sandbox');
27 sandbox.appendChild(
28 createDOM('div', {'id': 'host'},
29 createShadowRoot(
30 createDOM('div', {'id': 'target1', 'class': 'foo'},
31 document.createTextNode('Should have green background')),
32 createDOM('div', {'id': 'target2'},
33 document.createTextNode('Should have green background')),
34 createDOM('div', {'id': 'target3', 'class': 'bar'},
35 document.createTextNode('Should have blue background')),
36 createDOM('div', {'id': 'target4'},
37 document.createTextNode('Should have blue background')))));
38 document.body.offsetLeft;
39
40 var style = document.createElement('style');
41 style.innerHTML = 'div::shadow .foo { background: green; }'
42 + 'div::shadow #target2 { background: green; }'
43 + 'div /deep/ .bar { background: blue; }'
44 + 'div /deep/ #target4 { background: blue; }';
45 document.body.appendChild(style);
46
47 backgroundColorShouldBe('host/target1', 'rgb(0, 128, 0)');
48 backgroundColorShouldBe('host/target2', 'rgb(0, 128, 0)');
49 backgroundColorShouldBe('host/target3', 'rgb(0, 0, 255)');
50 backgroundColorShouldBe('host/target4', 'rgb(0, 0, 255)');
51 backgroundColorShouldBe('target5', 'rgb(0, 0, 255)');
52 </script>
53 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698