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

Unified Diff: LayoutTests/fast/html/imports/import-style-basic.html

Issue 143463011: [import] support document.stylesheets in imported documents. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Landing Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/html/imports/import-style-basic-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/html/imports/import-style-basic.html
diff --git a/LayoutTests/fast/html/imports/import-style-basic.html b/LayoutTests/fast/html/imports/import-style-basic.html
index f819122f7b37fdc40882607fa9d4fa2db1d3c373..65944d726204aee3b584eb8bcbd61ef34fd3e1cd 100644
--- a/LayoutTests/fast/html/imports/import-style-basic.html
+++ b/LayoutTests/fast/html/imports/import-style-basic.html
@@ -23,8 +23,11 @@
<script>
window.jsTestIsAsync = true;
-// CSSOM contains master's sheets only.
+// Master's CSSOM contains master's sheets only.
shouldBe("document.styleSheets.length", "2"); // Extra one comes from js-test.js
+// Import's CSS should have its own
+shouldBe("importLink.import.styleSheets.length", "1");
+
// a trivial case
shouldBeEqualToString("window.getComputedStyle(shouldBeBlue).color", "rgb(0, 0, 255)");
// Nested case
@@ -40,18 +43,22 @@ var styleWithGreen = importLink.import.createElement("style");
styleWithGreen.innerHTML = ".green-from-import { color: green; }";
importLink.import.head.appendChild(styleWithGreen);
shouldBeEqualToString("window.getComputedStyle(shouldBeGreen).color", "rgb(0, 128, 0)");
+shouldBe("importLink.import.styleSheets.length", "2");
// Dyanically removing
Array.prototype.forEach.call(importLink.import.querySelectorAll("style"), function(e) { e.remove(); });
shouldBeEqualToString("window.getComputedStyle(shouldBeBlue).color", "rgb(0, 0, 0)");
shouldBeEqualToString("window.getComputedStyle(shouldBeGreen).color", "rgb(0, 0, 0)");
+shouldBe("importLink.import.styleSheets.length", "0");
// Dymically adding an import
var dynamicLink = document.createElement("link");
dynamicLink.setAttribute("rel", "import");
+dynamicLink.id = "importLinkDynamic";
dynamicLink.setAttribute("href", "resources/style-basic-child-dynamic.html");
dynamicLink.onload = function() {
shouldBeEqualToString("window.getComputedStyle(shouldBeAqua).color", "rgb(0, 255, 255)");
+ shouldBe("importLinkDynamic.import.styleSheets.length", "1");
finishJSTest();
};
« no previous file with comments | « no previous file | LayoutTests/fast/html/imports/import-style-basic-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698