4 https://bugzilla.mozilla.org/show_bug.cgi?id=536379
7 <title>Test for Bug
536379</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" type=
"text/css" href=
"data:text/css,p { color: green }">
11 <link rel=
"stylesheet" type=
"text/css" href=
"data:text/css,p { color: green }">
14 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=536379">Mozilla Bug
536379</a>
17 <script type=
"application/javascript">
19 /** Test for Bug
536379 **/
21 const CI = SpecialPowers.Ci;
22 const CC = SpecialPowers.Cc;
23 const InspectorUtils = SpecialPowers.InspectorUtils;
25 var rules = InspectorUtils.getMatchingCSSRules(document.getElementById(
"display"));
26 var firstPRule = rules[rules.length -
2];
27 firstPRule.style.removeProperty(
"color");
28 ok(true,
"should not crash");
30 var links = document.getElementsByTagName(
"link");
31 is(links.length,
3,
"links.length");
32 is(SpecialPowers.unwrap(firstPRule.parentStyleSheet), links[
1].sheet,
"sheet match for first P rule");
33 var secondPRule = rules[rules.length -
1];
34 is(SpecialPowers.unwrap(secondPRule.parentStyleSheet), links[
2].sheet,
"sheet match for second P rule");
35 is(links[
1].href, links[
2].href,
"links should have same href");
36 isnot(links[
1].sheet, links[
2].sheet,
"links should have different sheets");
37 isnot(firstPRule, secondPRule,
"rules should be different");
38 isnot(firstPRule.cssText, secondPRule.cssText,
"text should be different since property was removed from one");