Index: third_party/WebKit/LayoutTests/fast/dom/shadow/slotted-pseudo-element-css-text.html |
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/slotted-pseudo-element-css-text.html b/third_party/WebKit/LayoutTests/fast/dom/shadow/slotted-pseudo-element-css-text.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2d1fd34aa17ec7e9af90f67c7d5c585fc9a69782 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/slotted-pseudo-element-css-text.html |
@@ -0,0 +1,44 @@ |
+<!DOCTYPE html> |
+<script src='../../../resources/testharness.js'></script> |
+<script src='../../../resources/testharnessreport.js'></script> |
+<style id="style1"> |
+.foo::slotted(div) .bar::before { display: block; } |
rune
2016/01/09 01:15:36
This should be invalid, I think. ::slotted should
kochi
2016/01/13 07:49:31
Done.
|
+::slotted { display: block; } /* invalid - no parameter */ |
+::slotted() { display: block; } /* invalid - empty parameter */ |
+slot::slotted(div, div) { display: block; } /* invalid - selector list */ |
+slot::slotted(div div) { display: block; } /* invalid - complex selector (combinator) */ |
+slot::slotted(.green) { color: green; } |
+slot::slotted(#green) { color: green; } |
+slot::slotted([green=green]) { color: green; } |
+slot::slotted(div.green) { color: green; } |
+*::slotted(*) { color: blue; } |
+.foo::slotted(*) { color: blue; } |
+#id::slotted(*) { color: blue; } |
+[attr=foo]::slotted(*) { color: blue; } |
+span::slotted(*) { color: blue; } /* never matches, but valid */ |
rune
2016/01/09 01:15:36
could you add a case or two where you have a compo
kochi
2016/01/13 07:49:31
Done.
|
+</style> |
+<script> |
+'use strict'; |
+test(() => { |
+ assert_equals(document.getElementById('style1').sheet.cssRules.item(0).cssText, |
+ ".foo::slotted(div) .bar::before { display: block; }"); |
+ assert_equals(document.getElementById('style1').sheet.cssRules.item(1).cssText, |
+ "slot::slotted(.green) { color: green; }"); |
+ assert_equals(document.getElementById('style1').sheet.cssRules.item(2).cssText, |
+ "slot::slotted(#green) { color: green; }"); |
+ assert_equals(document.getElementById('style1').sheet.cssRules.item(3).cssText, |
+ "slot::slotted([green=\"green\"]) { color: green; }"); |
+ assert_equals(document.getElementById('style1').sheet.cssRules.item(4).cssText, |
+ "slot::slotted(div.green) { color: green; }"); |
+ assert_equals(document.getElementById('style1').sheet.cssRules.item(5).cssText, |
+ "*::slotted(*) { color: blue; }"); |
rune
2016/01/09 01:15:36
Why does the serialization contain the (first) '*'
kochi
2016/01/13 07:49:31
Because we add an implicit universal type selector
rune
2016/01/13 10:02:30
Implicit means we shouldn't need to serialize it,
|
+ assert_equals(document.getElementById('style1').sheet.cssRules.item(6).cssText, |
+ ".foo::slotted(*) { color: blue; }"); |
+ assert_equals(document.getElementById('style1').sheet.cssRules.item(7).cssText, |
+ "#id::slotted(*) { color: blue; }"); |
+ assert_equals(document.getElementById('style1').sheet.cssRules.item(8).cssText, |
+ "[attr=\"foo\"]::slotted(*) { color: blue; }"); |
+ assert_equals(document.getElementById('style1').sheet.cssRules.item(9).cssText, |
+ "span::slotted(*) { color: blue; }"); |
+}, "Test for cssText of '::slotted' rule."); |
+</script> |