4 https://bugzilla.mozilla.org/show_bug.cgi?id=405818
7 <title>Test for Bug
405818</title>
8 <script type=
"text/javascript" src=
"/MochiKit/MochiKit.js"></script>
9 <script type=
"text/javascript" src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
11 <link rel=
"stylesheet" type=
"text/css" href=
"data:text/css,#nosuchid{color:green;}">
12 <link rel=
"stylesheet" type=
"text/css" href=
"chrome://global/skin/global.css">
13 <!-- Script to make sure sheets gets a chance to load fully in Gecko 1.8 and earlier -->
14 <script type=
"text/javascript" src=
"data:text/javascript,"></script>
15 <link rel=
"stylesheet" type=
"text/css" href=
"data:text/css,#nosuchid{color:green;}">
16 <link rel=
"stylesheet" type=
"text/css" href=
"chrome://global/skin/global.css">
19 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=405818">Mozilla Bug
405818</a>
21 <div id=
"content" style=
"display: none">
25 <script class=
"testbody" type=
"text/javascript">
27 /** Test for Bug
405818 **/
28 SimpleTest.waitForExplicitFinish();
30 addLoadEvent(function() {
31 is(document.styleSheets[
1].href,
32 "data:text/css,#nosuchid{color:green;}",
33 "Unexpected href for linked sheet before cloning");
34 is(document.styleSheets[
3].href,
35 "data:text/css,#nosuchid{color:green;}",
36 "Unexpected href for later linked sheet before cloning");
38 is(document.styleSheets[
2].href,
39 "chrome://global/skin/global.css",
40 "Unexpected href for linked chrome sheet before cloning");
41 is(document.styleSheets[
4].href,
42 "chrome://global/skin/global.css",
43 "Unexpected href for later linked chrome sheet before cloning");
45 // Force cloning of inners
46 document.styleSheets[
1].cssRules[
0];
48 netscape.security.PrivilegeManager.enablePrivilege(
"UniversalXPConnect");
49 document.styleSheets[
2].cssRules[
0];
52 is(document.styleSheets[
1].href,
53 "data:text/css,#nosuchid{color:green;}",
54 "Unexpected href for linked sheet after cloning");
55 is(document.styleSheets[
3].href,
56 "data:text/css,#nosuchid{color:green;}",
57 "Unexpected href for later linked sheet after cloning");
59 is(document.styleSheets[
2].href,
60 "chrome://global/skin/global.css",
61 "Unexpected href for linked chrome sheet after cloning");
62 is(document.styleSheets[
4].href,
63 "chrome://global/skin/global.css",
64 "Unexpected href for later linked chrome sheet after cloning");