4 https://bugzilla.mozilla.org/show_bug.cgi?id=221428
7 <title>Test for Bug
221428</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
10 <link rel=
"stylesheet" href=
"data:text/css,body { color: green; }">
12 @import url(
"data:text/css,body { border: 1px solid transparent; }");
13 body { color: black; }
18 <link rel=
"stylesheet" href=
"javascript:executed = true;">
21 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=221428">Mozilla Bug
221428</a>
23 <div id=
"content" style=
"display: none">
27 <script class=
"testbody" type=
"text/javascript">
29 /** Test for Bug
221428 **/
31 var exceptionThrown = false;
33 is(document.styleSheets[
1].cssRules[
0].cssText,
"body { color: green; }",
34 "Should get the color: green rule back");
36 exceptionThrown = true;
39 ok(!exceptionThrown,
"Should be able to access data: <link> stylesheet");
41 exceptionThrown = false;
43 is(document.styleSheets[
2].cssRules[
1].cssText,
"body { color: black; }",
44 "Should get the color: black rule back");
46 exceptionThrown = true;
48 ok(!exceptionThrown,
"Should be able to access <style> stylesheet");
50 exceptionThrown = false;
52 is(document.styleSheets[
2].cssRules[
0].styleSheet.cssRules[
0].cssText,
53 "body { border: 1px solid transparent; }",
54 "Should get the 'border: 1px solid transparent' rule back");
56 exceptionThrown = true;
58 ok(!exceptionThrown,
"Should be able to access data: @import stylesheet");
61 "Shouldn't be executing stylesheet-link javascript: URIs against " +