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> |