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

Unified Diff: third_party/WebKit/LayoutTests/fast/html/imports/import-add-child-to-change-order-of-dup-css.html

Issue 2551473002: Correctly re-collect active style for html imports. (Closed)
Patch Set: Created 4 years 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-add-child-to-change-order-of-dup-css.html
diff --git a/third_party/WebKit/LayoutTests/fast/html/imports/import-add-child-to-change-order-of-dup-css.html b/third_party/WebKit/LayoutTests/fast/html/imports/import-add-child-to-change-order-of-dup-css.html
new file mode 100644
index 0000000000000000000000000000000000000000..585bc24710dee90b811fa72ba2f6f16eb7bb7dde
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/html/imports/import-add-child-to-change-order-of-dup-css.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<link rel="import" href="resources/bye.html"></link>
+<style>.target { color: green }</style>
+<link rel="import" href="resources/style-red.html"></link>
+<div class="target">This text should be green.</div>
+<script>
+ var importDoc = document.querySelectorAll("link")[0].import;
+ var newLink = importDoc.createElement("link");
+ newLink.setAttribute("rel", "import");
+ newLink.setAttribute("href", "style-red.html");
+ var targetElement = document.querySelector(".target");
+
+ test(() => {
+ assert_equals(getComputedStyle(targetElement).color, "rgb(255, 0, 0)");
+ }, ".target should initially be red");
+
+ importDoc.head.appendChild(newLink);
+
+ test(() => {
+ assert_equals(getComputedStyle(targetElement).color, "rgb(0, 128, 0)");
+ }, ".target should be green after style-red.html is inserted as an import child before the inline green style.");
+</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