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

Side by Side Diff: LayoutTests/fast/dom/shadow/host-pseudo-class.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 <script src="../../../resources/js-test.js"></script> 2 <script src="../../../resources/js-test.js"></script>
3 <script src="resources/shadow-dom.js"></script> 3 <script src="resources/shadow-dom.js"></script>
4 <style> 4 <style>
5 :host { 5 :host {
6 background-color: red; 6 background-color: red;
7 } 7 }
8 </style> 8 </style>
9 <body class='mytheme'> 9 <body class='mytheme'>
10 <div> 10 <div>
11 <div id='sandbox'></div> 11 <div id='sandbox'></div>
12 </div> 12 </div>
13 <pre id='console'></pre> 13 <pre id='console'></pre>
14 <script> 14 <script>
15 description('Test whether :host matches a shadow host correctly.'); 15 description('Test whether :host matches a shadow host correctly.');
16 16
17 var sandbox = document.getElementById('sandbox'); 17 var sandbox = document.getElementById('sandbox');
18 18
19 function backgroundColorOf(selector) {
20 return window.getComputedStyle(getNodeInTreeOfTrees(selector)).backgroundCol or;
21 }
22
23 function backgroundColorShouldBe(selector, expected) {
24 shouldBeEqualToString('backgroundColorOf(\'' + selector + '\')', expected);
25 }
26
27 function cleanUp() { 19 function cleanUp() {
28 sandbox.innerHTML = ''; 20 sandbox.innerHTML = '';
29 } 21 }
30 22
31 debug(':host out of shadow tree should not match any shadow hosts.'); 23 debug(':host out of shadow tree should not match any shadow hosts.');
32 24
33 sandbox.appendChild( 25 sandbox.appendChild(
34 createDOM('div', {'id': 'host'}, 26 createDOM('div', {'id': 'host'},
35 createShadowRoot( 27 createShadowRoot(
36 createDOM('div', {}, 28 createDOM('div', {},
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 createShadowRoot( 271 createShadowRoot(
280 createDOM('style', {}, 272 createDOM('style', {},
281 document.createTextNode(':host.foo { background-color: green; }' ))))); 273 document.createTextNode(':host.foo { background-color: green; }' )))));
282 274
283 backgroundColorShouldBe('host', 'rgba(0, 0, 0, 0)'); 275 backgroundColorShouldBe('host', 'rgba(0, 0, 0, 0)');
284 276
285 cleanUp(); 277 cleanUp();
286 278
287 </script> 279 </script>
288 </body> 280 </body>
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/shadow/focus-with-dom-mutation.html ('k') | LayoutTests/fast/dom/shadow/hostcontext-pseudo-class.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698