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; } |
+::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 */ |
+</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; }"); |
+ 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> |