| 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();
|
| };
|
|
|
|
|