Bug 1443652 part 1. Fix the buggy existing load-event test for stylesheets. r=bholley
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 07 Mar 2018 16:06:48 -0500
changeset 407092 ba6cef216a171782bd8abcd00a08c9ae88cbfe43
parent 407091 79044302abd1165ed375708201090281972d32d8
child 407093 7daaf289c085e05e0e4a0327a13748002fb467a0
push id33589
push usercsabou@mozilla.com
push dateThu, 08 Mar 2018 03:59:55 +0000
treeherdermozilla-central@888f3dded126 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1443652
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1443652 part 1. Fix the buggy existing load-event test for stylesheets. r=bholley The test was adding the load listener to the <link> _after_ the load event on the <link> had already fired. MozReview-Commit-ID: JAS94H9SNOo
testing/web-platform/tests/html/semantics/document-metadata/the-link-element/link-load-event.html
--- a/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/link-load-event.html
+++ b/testing/web-platform/tests/html/semantics/document-metadata/the-link-element/link-load-event.html
@@ -1,18 +1,17 @@
 <!DOCTYPE html>
 <link rel="author" title="Josh Matthews" href="mailto:josh@joshmatthews.net">
 <link rel="help" href="https://html.spec.whatwg.org/multipage/#the-link-element">
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
-<link href="style.css?pipe=trickle(d3)" rel="stylesheet" id="style_test"></link>
 <script>
 var saw_link_onload = false;
 var t = async_test("Check if the stylesheet's load event blocks the document load event");
-document.getElementById('style_test').onload = t.step_func(function() {
-  saw_link_onload = true;
-});
 window.addEventListener('load', t.step_func_done(function() {
   assert_true(saw_link_onload);
 }));
 </script>
+<link href="style.css?pipe=trickle(d3)" rel="stylesheet" id="style_test"
+      onload="t.step(function() { saw_link_onload = true; });"
+      onerror="t.step(function() { assert_unreached('Sheet should load OK'); });"></link>
 </head>
 </html>