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

Side by Side Diff: LayoutTests/fast/dom/shadow/style-and-shadow-element.html

Issue 1187053004: Move backgroundColorOf/backgroundColorShouldBe to shadow-dom.js (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="resources/shadow-dom.js"></script> 4 <script src="resources/shadow-dom.js"></script>
5 <script src="../../../resources/js-test.js"></script> 5 <script src="../../../resources/js-test.js"></script>
6 </head> 6 </head>
7 <body> 7 <body>
8 <div id='sandbox'></div> 8 <div id='sandbox'></div>
9 <pre id='console'></pre> 9 <pre id='console'></pre>
10 </body> 10 </body>
11 <script> 11 <script>
12 function backgroundColorOf(node)
13 {
14 return document.defaultView.getComputedStyle(node, null).getPropertyValue('b ackground-color');
15 }
16
17 function backgroundColorShouldBe(selector, color)
18 {
19 var text = 'backgroundColorOf(getNodeInTreeOfTrees("' + selector + '"))';
20 shouldBeEqualToString(text, color);
21 }
22
23 function backgroundColorShouldNotBe(selector, color)
24 {
25 var text = 'backgroundColorOf(getNodeInTreeOfTrees("' + selector + '"))';
26 var unevaledString = '"' + color.replace(/\\/g, "\\\\").replace(/"/g, "\"") + '"';
27 shouldNotBe(text, unevaledString);
28 }
29
30 function cleanUp() 12 function cleanUp()
31 { 13 {
32 document.getElementById('sandbox').innerHTML = ''; 14 document.getElementById('sandbox').innerHTML = '';
33 } 15 }
34 16
35 description('Test for http://crbug.com/35340: Style should not be conditioned by the presence of the shadow element.'); 17 description('Test for http://crbug.com/35340: Style should not be conditioned by the presence of the shadow element.');
36 18
37 var sandbox = document.getElementById('sandbox'); 19 var sandbox = document.getElementById('sandbox');
38 20
39 sandbox.appendChild( 21 sandbox.appendChild(
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 document.createTextNode(':host { display: block; background: gre en; }'))), 70 document.createTextNode(':host { display: block; background: gre en; }'))),
89 createShadowRoot( 71 createShadowRoot(
90 createDOM('div', {'id': 'target'}, 72 createDOM('div', {'id': 'target'},
91 document.createTextNode('younger div should be green'))))); 73 document.createTextNode('younger div should be green')))));
92 74
93 backgroundColorShouldBe('host', 'rgb(0, 128, 0)'); 75 backgroundColorShouldBe('host', 'rgb(0, 128, 0)');
94 76
95 cleanUp(); 77 cleanUp();
96 </script> 78 </script>
97 </html> 79 </html>
98
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/shadow/resources/shadow-dom.js ('k') | LayoutTests/fast/dom/shadow/style-and-shadow-element-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698