Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=536379
5 -->
6 <head>
7 <title>Test for Bug 536379</title>
8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
10 <link rel="stylesheet" type="text/css" href="data:text/css,p { color: green }">
11 <link rel="stylesheet" type="text/css" href="data:text/css,p { color: green }">
12 </head>
13 <body>
14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=536379">Mozilla Bug 536379</a>
15 <p id="display"></p>
16 <pre id="test">
17 <script type="application/javascript">
19 /** Test for Bug 536379 **/
21 const CI = SpecialPowers.Ci;
22 const CC = SpecialPowers.Cc;
24 var domUtils =
25 CC["@mozilla.org/inspector/dom-utils;1"].getService(CI.inIDOMUtils);
26 var rules = domUtils.getCSSStyleRules(document.getElementById("display"));
27 var firstPRule =
28 rules.GetElementAt(rules.Count() - 2).QueryInterface(CI.nsIDOMCSSStyleRule);
29 firstPRule.style.removeProperty("color");
30 ok(true, "should not crash");
32 var links = document.getElementsByTagName("link");
33 is(links.length, 3, "links.length");
34 is(SpecialPowers.unwrap(firstPRule.parentStyleSheet), links[1].sheet, "sheet match for first P rule");
35 var secondPRule =
36 rules.GetElementAt(rules.Count() - 1).QueryInterface(CI.nsIDOMCSSStyleRule);
37 is(SpecialPowers.unwrap(secondPRule.parentStyleSheet), links[2].sheet, "sheet match for second P rule");
38 is(links[1].href, links[2].href, "links should have same href");
39 isnot(links[1].sheet, links[2].sheet, "links should have different sheets");
40 isnot(firstPRule, secondPRule, "rules should be different");
41 isnot(firstPRule.cssText, secondPRule.cssText, "text should be different since property was removed from one");
43 </script>
44 </pre>
45 </body>
46 </html>