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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/css/ignore-pending-link-import.html

Issue 1867753006: Revert of Don't apply style elements or PIs with loading imports. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/css/ignore-pending-link-import-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <h1 id="h1"></h1>
3 <pre id="res"></pre>
4 <script>
5 if (window.testRunner) {
6 testRunner.dumpAsText();
7 testRunner.waitUntilDone();
8 }
9
10 var result = "";
11
12 function expectComputedOnH1(name, expected) {
13 var value = getComputedStyle(h1)[name];
14 result += name + ": ";
15 if (value == expected)
16 result += "PASS\n";
17 else
18 result += "FAIL - " + value + ", expected " + expected + "\n";
19 }
20
21 function sheetLoaded() {
22 // Need to remove the stylesheet used to trigger the ignore-pending-styl esheet
23 // behavior in order to not have pending stylesheets here.
24 document.head.removeChild(document.head.querySelector("style"));
25
26 expectComputedOnH1("backgroundColor", "rgb(0, 128, 0)");
27 expectComputedOnH1("color", "rgb(0, 128, 0)");
28
29 res.innerHTML = result;
30 if (window.testRunner)
31 testRunner.notifyDone();
32 }
33
34 // This style element is required to trigger updateLayoutTreeIgnorePendingSt ylesheets
35 // while the main link css file has loaded while its import has not.
36 var style = document.createElement("style");
37 style.appendChild(document.createTextNode("@import url(resources/slow-loadin g-sheet.php?sleep=10000&color=pink);"));
38 document.head.appendChild(style);
39
40 var link = document.createElement("link");
41 link.setAttribute("onload", "sheetLoaded()");
42 link.setAttribute("rel", "stylesheet");
43 link.setAttribute("href", "data:text/css,@import url(http://localhost:8080/c ss/resources/slow-loading-sheet.php?color=green); h1{color:green}");
44 document.head.appendChild(link);
45
46 document.body.offsetTop;
47 expectComputedOnH1("backgroundColor", "rgba(0, 0, 0, 0)");
48 expectComputedOnH1("color", "rgb(0, 0, 0)");
49
50 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/css/ignore-pending-link-import-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698