4 https://bugzilla.mozilla.org/show_bug.cgi?id=1443344
8 <title>Test for Bug
1443344</title>
9 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
11 <script type=
"application/javascript">
13 /** Test for Bug
1443344 **/
14 SimpleTest.waitForExplicitFinish();
16 var sheetURL = new URL(
"file_bug1443344.css", location.href);
17 sheetURL.protocol =
"http";
18 var link = document.createElement(
"link");
19 link.href = `data:text/css,@import url(
"data:text/css,@import url('${sheetURL}');");`
20 link.rel =
"stylesheet";
21 var loadFired = false, errorFired = false;
22 link.onload = () =
> loadFired = true;
23 link.onerror = () =
> errorFired = true;
24 document.head.appendChild(link);
27 is(loadFired, false,
"Should not fire onload for erroring @import");
28 is(errorFired, true,
"Should fire onerror for erroring @import");
29 is(getComputedStyle($(
"importTarget")).color,
"rgb(0, 255, 0)",
30 "Erroring sheet should not load");
36 #importTarget { color: rgb(
0,
255,
0); }
40 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=1443344">Mozilla Bug
1443344</a>
41 <p id=
"display"><div id=
"importTarget"></div></p>
42 <div id=
"content" style=
"display: none">