Index: third_party/WebKit/LayoutTests/fast/html/imports/import-css-sheet-in-shadow.html |
diff --git a/third_party/WebKit/LayoutTests/fast/html/imports/import-css-sheet-in-shadow.html b/third_party/WebKit/LayoutTests/fast/html/imports/import-css-sheet-in-shadow.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..af6cab566a465642d807265a79b7288ff58dc7d0 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/html/imports/import-css-sheet-in-shadow.html |
@@ -0,0 +1,25 @@ |
+<!DOCTYPE html> |
+<script src="../../../resources/testharness.js"></script> |
+<script src="../../../resources/testharnessreport.js"></script> |
+<link id="importLink" rel="import" href="data:text/html,<div id=host></div>"> |
+<script> |
+ var importDoc = importLink.import; |
+ var root = importDoc.querySelector("#host").attachShadow({mode:"open"}); |
+ var shadowStyle = importDoc.createElement("style"); |
+ shadowStyle.appendChild(importDoc.createTextNode("div{color:pink}")); |
+ root.appendChild(shadowStyle); |
+ |
+ test(() => { |
+ assert_true(!!shadowStyle.sheet, |
+ "The shadow tree Element.sheet should be defined."); |
+ assert_equals(shadowStyle.sheet.cssRules.length, 1, |
+ "The number of rules in the shadow tree stylesheet should 1."); |
+ }, "Element.sheet on style element in shadow tree in html import."); |
+ |
+ test(() => { |
+ assert_equals(root.styleSheets.length, 1, |
+ "Length of the ShadowRoot.styleSheets should be 1."); |
+ assert_equals(root.styleSheets[0].cssRules.length, 1, |
+ "The number of rules in the shadow stylesheet should be 1."); |
+ }, "ShadowRoot.styleSheets on shadow root in html import."); |
+</script> |