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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/shadow/slotted-pseudo-element-css-text.html

Issue 1607873002: Serialize namespaced type/* selectors according to CSSOM spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@queryselector-no-pseudoelm-20160118
Patch Set: Rebased Created 4 years, 10 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src='../../../resources/testharness.js'></script> 2 <script src='../../../resources/testharness.js'></script>
3 <script src='../../../resources/testharnessreport.js'></script> 3 <script src='../../../resources/testharnessreport.js'></script>
4 <style id="style1"> 4 <style id="style1">
5 ::slotted { display: block; } /* invalid - no parameter */ 5 ::slotted { display: block; } /* invalid - no parameter */
6 ::slotted() { display: block; } /* invalid - empty parameter */ 6 ::slotted() { display: block; } /* invalid - empty parameter */
7 ::slotted(*) { display: block; } 7 ::slotted(*) { display: block; }
8 *::slotted(*) { display: block; } 8 *::slotted(*) { display: block; }
9 ::slotted(div) { display: block; } /* expects universal selector (*) on the left in cssText */ 9 ::slotted(div) { display: block; } /* expects universal selector (*) on the left in cssText */
10 ::slotted( div) { display: block; } /* allow a space on left */ 10 ::slotted( div) { display: block; } /* allow a space on left */
(...skipping 22 matching lines...) Expand all
33 ::slotted(::slotted(div)) { color: red; } /* invalid */ 33 ::slotted(::slotted(div)) { color: red; } /* invalid */
34 </style> 34 </style>
35 <script> 35 <script>
36 'use strict'; 36 'use strict';
37 test(() => { 37 test(() => {
38 var style1 = document.getElementById('style1'); 38 var style1 = document.getElementById('style1');
39 var cssRules = style1.sheet.cssRules; 39 var cssRules = style1.sheet.cssRules;
40 40
41 var expectedCSSTexts = [ 41 var expectedCSSTexts = [
42 "::slotted(*) { display: block; }", 42 "::slotted(*) { display: block; }",
43 "*::slotted(*) { display: block; }", 43 "::slotted(*) { display: block; }",
44 "::slotted(div) { display: block; }", 44 "::slotted(div) { display: block; }",
45 "::slotted(div) { display: block; }", 45 "::slotted(div) { display: block; }",
46 "::slotted(div) { display: block; }", 46 "::slotted(div) { display: block; }",
47 ".foo::slotted(div) { color: blue; }", 47 ".foo::slotted(div) { color: blue; }",
48 "#id::slotted(*) { color: blue; }", 48 "#id::slotted(*) { color: blue; }",
49 "[attr=\"foo\"]::slotted(*) { color: blue; }", 49 "[attr=\"foo\"]::slotted(*) { color: blue; }",
50 ".foo .bar::slotted(div) { color: blue; }", 50 ".foo .bar::slotted(div) { color: blue; }",
51 "slot::slotted(.green) { color: green; }", 51 "slot::slotted(.green) { color: green; }",
52 "slot::slotted(#green) { color: green; }", 52 "slot::slotted(#green) { color: green; }",
53 "slot::slotted([green=\"green\"]) { color: green; }", 53 "slot::slotted([green=\"green\"]) { color: green; }",
54 "slot::slotted(div.green) { color: green; }", 54 "slot::slotted(div.green) { color: green; }",
55 "div ::slotted(div) { color: red; }", 55 "div ::slotted(div) { color: red; }",
56 "div + slot::slotted(div) { color: red; }", 56 "div + slot::slotted(div) { color: red; }",
57 "span::slotted(*) { color: red; }" 57 "span::slotted(*) { color: red; }"
58 ]; 58 ];
59 59
60 for (var i = 0; i < expectedCSSTexts.length; ++i) 60 for (var i = 0; i < expectedCSSTexts.length; ++i)
61 assert_equals(cssRules.item(i).cssText, expectedCSSTexts[i]); 61 assert_equals(cssRules.item(i).cssText, expectedCSSTexts[i]);
62 assert_equals(cssRules.length, expectedCSSTexts.length); 62 assert_equals(cssRules.length, expectedCSSTexts.length);
63 63
64 }, "Test for cssText of '::slotted' rule."); 64 }, "Test for cssText of '::slotted' rule.");
65 </script> 65 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698