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

Unified Diff: third_party/WebKit/LayoutTests/fast/html/imports/import-css-sheet-in-shadow.html

Issue 2884993002: Don't trigger full active style update on styleSheets access. (Closed)
Patch Set: Not clearing document_scope_dirty_ flag in import styleSheets anymore. Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/StyleEngine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/StyleEngine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698