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

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

Issue 1913833002: Current work-in-progress crbug.com/567021 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed html import issue. 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script>
4 <link rel="import" href="resources/bye.html"></link>
5 <style>.target { color: green }</style>
6 <link rel="import" href="resources/style-red.html"></link>
7 <div class="target">This text should be green.</div>
8 <script>
9 if (window.testRunner) {
10 testRunner.dumpAsText();
11 testRunner.waitUntilDone();
12 }
13
14 var importDoc = document.querySelectorAll("link")[0].import;
15 var newLink = importDoc.createElement("link");
16 newLink.setAttribute("rel", "import");
17 newLink.setAttribute("href", "style-red.html");
18 var targetElement = document.querySelector(".target");
19
20 test(() => {
21 assert_equals(getComputedStyle(targetElement).color, "rgb(255, 0, 0)");
22 }, ".target should initially be red");
23
24 importDoc.head.appendChild(newLink);
25
26 test(() => {
27 assert_equals(getComputedStyle(targetElement).color, "rgb(0, 128, 0)");
28 }, ".target should be green after style-red.html is inserted as an import ch ild before the inline green style.");
29 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698