4 https://bugzilla.mozilla.org/show_bug.cgi?id=221428
7 <title>Test for Bug
221428</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" href=
"data:text/css,body { color: green; }">
13 @import url(
"data:text/css,body { border: 1px solid transparent; }");
14 body { color: black; }
19 <link rel=
"stylesheet" href=
"javascript:executed = true;">
22 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=221428">Mozilla Bug
221428</a>
24 <div id=
"content" style=
"display: none">
28 <script class=
"testbody" type=
"text/javascript">
30 /** Test for Bug
221428 **/
32 var exceptionThrown = false;
34 is(document.styleSheets[
1].cssRules[
0].cssText,
"body { color: green; }",
35 "Should get the color: green rule back");
37 exceptionThrown = true;
40 ok(!exceptionThrown,
"Should be able to access data: <link> stylesheet");
42 exceptionThrown = false;
44 is(document.styleSheets[
2].cssRules[
1].cssText,
"body { color: black; }",
45 "Should get the color: black rule back");
47 exceptionThrown = true;
49 ok(!exceptionThrown,
"Should be able to access <style> stylesheet");
51 exceptionThrown = false;
53 is(document.styleSheets[
2].cssRules[
0].styleSheet.cssRules[
0].cssText,
54 "body { border: 1px solid transparent; }",
55 "Should get the 'border: 1px solid transparent' rule back");
57 exceptionThrown = true;
59 ok(!exceptionThrown,
"Should be able to access data: @import stylesheet");
62 "Shouldn't be executing stylesheet-link javascript: URIs against " +