Bug 458861. Validate TrueType headers before activating downloaded font. r=roc, sr...
[wine-gecko.git] / layout / style / test / test_visited_pref.html
blobb8162e7d8be7fb5adc0f5e75d15520d41dcd448e
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=147777
5 -->
6 <head>
7 <title>Test for visited link coloring pref Bug 147777</title>
8 <script type="application/javascript" src="/MochiKit/MochiKit.js"></script>
9 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
11 <style type="text/css">
13 :link { float: left; }
15 :visited { float: right; }
17 </style>
18 </head>
19 <body>
20 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=147777">Mozilla Bug 147777</a>
21 <p id="display"><a id="mylink" href="test_visited_pref.html">link to this page</a></p>
22 <pre id="test">
23 <script type="application/javascript">
25 /** Test for Bug 147777 **/
27 function reinsert_node(e) {
28 var sib = e.nextSibling;
29 var par = e.parentNode;
30 par.removeChild(e);
31 par.insertBefore(e, sib);
34 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
35 var prefService = Components.classes["@mozilla.org/preferences-service;1"].
36 getService(Components.interfaces.nsIPrefService);
37 var dispBranch = prefService.getBranch("layout.css.");
39 function get_pref()
41 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
42 return dispBranch.getBoolPref("visited_links_enabled");
45 function set_pref(val)
47 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
48 dispBranch.setBoolPref("visited_links_enabled", val);
51 is(get_pref(), true, "pref defaults to true");
53 var link = document.getElementById("mylink");
54 var cs = getComputedStyle(link, "");
55 is(cs.cssFloat, "right", ":visited selector applies given default preferences");
57 set_pref(false);
59 // we don't handle dynamic changes of this pref; it only takes effect
60 // when a new page loads
61 reinsert_node(link);
63 is(cs.cssFloat, "left", ":visited selector does not apply given false preference");
65 // Set the pref back for the rest of the tests.
66 set_pref(true);
68 </script>
69 </pre>
70 </body>
71 </html>