| 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..394146ba66319bfb8e6b1b57b1128f86f6305400
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/fast/html/imports/import-add-child-to-change-order-of-dup-css.html
|
| @@ -0,0 +1,29 @@
|
| +<!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>
|
| + if (window.testRunner) {
|
| + testRunner.dumpAsText();
|
| + testRunner.waitUntilDone();
|
| + }
|
| +
|
| + 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>
|
|
|