Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / layout / style / test / test_bug221428.html
blobb48d276996fd4ff69ef3bab7a1ff2b2c4da88cd8
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=221428
5 -->
6 <head>
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; }">
12 <style>
13 @import url("data:text/css,body { border: 1px solid transparent; }");
14 body { color: black; }
15 </style>
16 <script>
17 var executed = false;
18 </script>
19 <link rel="stylesheet" href="javascript:executed = true;">
20 </head>
21 <body>
22 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=221428">Mozilla Bug 221428</a>
23 <p id="display"></p>
24 <div id="content" style="display: none">
26 </div>
27 <pre id="test">
28 <script class="testbody" type="text/javascript">
30 /** Test for Bug 221428 **/
32 var exceptionThrown = false;
33 try {
34 is(document.styleSheets[1].cssRules[0].cssText, "body { color: green; }",
35 "Should get the color: green rule back");
36 } catch (e) {
37 exceptionThrown = true;
40 ok(!exceptionThrown, "Should be able to access data: <link> stylesheet");
42 exceptionThrown = false;
43 try {
44 is(document.styleSheets[2].cssRules[1].cssText, "body { color: black; }",
45 "Should get the color: black rule back");
46 } catch (e) {
47 exceptionThrown = true;
49 ok(!exceptionThrown, "Should be able to access <style> stylesheet");
51 exceptionThrown = false;
52 try {
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");
56 } catch (e) {
57 exceptionThrown = true;
59 ok(!exceptionThrown, "Should be able to access data: @import stylesheet");
61 ok(!executed,
62 "Shouldn't be executing stylesheet-link javascript: URIs against " +
63 "the page context");
65 </script>
66 </pre>
67 </body>
68 </html>