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

Side by Side Diff: LayoutTests/fast/dom/shadow/host-pseudo-class.html

Issue 208933006: Only :host and :ancestor should ever match the host in a ShadowRoot (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add a test for :first-child too Created 6 years, 9 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/js-test.js"></script> 4 <script src="../../../resources/js-test.js"></script>
5 <script src="resources/shadow-dom.js"></script> 5 <script src="resources/shadow-dom.js"></script>
6 <style> 6 <style>
7 :host { 7 :host {
8 background-color: red; 8 background-color: red;
9 } 9 }
10 </style> 10 </style>
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 debug(':host with * should not match any shadow hosts.'); 46 debug(':host with * should not match any shadow hosts.');
47 47
48 sandbox.appendChild( 48 sandbox.appendChild(
49 createDOM('div', {'id': 'host'}, 49 createDOM('div', {'id': 'host'},
50 createShadowRoot( 50 createShadowRoot(
51 createDOM('style', {}, 51 createDOM('style', {},
52 document.createTextNode('*:host { background-color: green; }')), 52 document.createTextNode('*:host { background-color: green; }')),
53 createDOM('div', {}, 53 createDOM('div', {},
54 document.createTextNode('Hello'))))); 54 document.createTextNode('Hello')))));
55 55
56 backgroundColorShouldBe('host', 'rgb(0, 128, 0)'); 56 backgroundColorShouldBe('host', 'rgba(0, 0, 0, 0)');
57 57
58 cleanUp(); 58 cleanUp();
59 59
60 debug(':host with tag selector should not match any shadow hosts.'); 60 debug(':host with tag selector should not match any shadow hosts.');
61 61
62 sandbox.appendChild( 62 sandbox.appendChild(
63 createDOM('div', {'id': 'host'}, 63 createDOM('div', {'id': 'host'},
64 createShadowRoot( 64 createShadowRoot(
65 createDOM('style', {}, 65 createDOM('style', {},
66 document.createTextNode('div:host { background-color: green; }') ), 66 document.createTextNode('div:host { background-color: green; }') ),
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 document.createTextNode(':host(div) > div { background-color: re d; }')), 271 document.createTextNode(':host(div) > div { background-color: re d; }')),
272 createDOM('div', {'id': 'target'}, 272 createDOM('div', {'id': 'target'},
273 document.createTextNode('Hello'))))); 273 document.createTextNode('Hello')))));
274 274
275 backgroundColorShouldBe('host/target', 'rgb(0, 128, 0)'); 275 backgroundColorShouldBe('host/target', 'rgb(0, 128, 0)');
276 276
277 cleanUp(); 277 cleanUp();
278 278
279 </script> 279 </script>
280 </body> 280 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698