3 https://bugzilla.mozilla.org/show_bug.cgi?id=734861
6 <title>Test for Bug
734861</title>
7 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
8 <link rel=
"stylesheet" href=
"/tests/SimpleTest/test.css"/>
9 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=734861">Mozilla Bug
734861</a>
12 /** Test for Bug 734861 **/
13 const InspectorUtils
= SpecialPowers
.InspectorUtils
;
15 add_task(async
function() {
16 let sheet
= new CSSStyleSheet();
17 await sheet
.replace(`* { color: blue }`);
19 let host
= document
.querySelector("#host");
20 host
.adoptedStyleSheets
= [sheet
, sheet
];
21 document
.adoptedStyleSheets
.push(sheet
);
23 let res
= InspectorUtils
.getAllStyleSheets(document
);
27 for (let s
of InspectorUtils
.getAllStyleSheets(document
)) {
28 if (SpecialPowers
.unwrap(s
) == sheet
) {
31 if (s
.href
=== "resource://gre-resources/ua.css") {
36 ok(foundUA
, "UA sheet should be returned with all the other sheets.");
37 is(adoptedCount
, 1, "Adopted stylesheet should show up once");