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

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

Issue 1523843004: Add support for new CSS ::slotted() pseudo element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase / fix comments for tests (FYI) Created 4 years, 11 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
(Empty)
1 <!DOCTYPE html>
2 <script src='../../../resources/testharness.js'></script>
3 <script src='../../../resources/testharnessreport.js'></script>
4 <style id="style1">
5 .foo::slotted(div) .bar::before { display: block; }
6 ::slotted { display: block; } /* invalid - no parameter */
7 ::slotted() { display: block; } /* invalid - empty parameter */
8 slot::slotted(div, div) { display: block; } /* invalid - selector list */
9 slot::slotted(div div) { display: block; } /* invalid - complex selector (combin ator) */
10 slot::slotted(.green) { color: green; }
11 slot::slotted(#green) { color: green; }
12 slot::slotted([green=green]) { color: green; }
13 slot::slotted(div.green) { color: green; }
14 *::slotted(*) { color: blue; }
15 .foo::slotted(*) { color: blue; }
16 #id::slotted(*) { color: blue; }
17 [attr=foo]::slotted(*) { color: blue; }
18 span::slotted(*) { color: blue; } /* never matches, but valid */
19 </style>
20 <script>
21 'use strict';
22 test(() => {
23 assert_equals(document.getElementById('style1').sheet.cssRules.item(0).cssText ,
24 ".foo::slotted(div) .bar::before { display: block; }");
25 assert_equals(document.getElementById('style1').sheet.cssRules.item(1).cssText ,
26 "slot::slotted(.green) { color: green; }");
27 assert_equals(document.getElementById('style1').sheet.cssRules.item(2).cssText ,
28 "slot::slotted(#green) { color: green; }");
29 assert_equals(document.getElementById('style1').sheet.cssRules.item(3).cssText ,
30 "slot::slotted([green=\"green\"]) { color: green; }");
31 assert_equals(document.getElementById('style1').sheet.cssRules.item(4).cssText ,
32 "slot::slotted(div.green) { color: green; }");
33 assert_equals(document.getElementById('style1').sheet.cssRules.item(5).cssText ,
34 "*::slotted(*) { color: blue; }");
35 assert_equals(document.getElementById('style1').sheet.cssRules.item(6).cssText ,
36 ".foo::slotted(*) { color: blue; }");
37 assert_equals(document.getElementById('style1').sheet.cssRules.item(7).cssText ,
38 "#id::slotted(*) { color: blue; }");
39 assert_equals(document.getElementById('style1').sheet.cssRules.item(8).cssText ,
40 "[attr=\"foo\"]::slotted(*) { color: blue; }");
41 assert_equals(document.getElementById('style1').sheet.cssRules.item(9).cssText ,
42 "span::slotted(*) { color: blue; }");
43 }, "Test for cssText of '::slotted' rule.");
44 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698