summaryrefslogtreecommitdiffstats
path: root/layout/inspector/tests/chrome/test_ua_rule_modification.html
blob: 0628e124a1c34533805918a0bff3acc445d451ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!DOCTYPE html>
<title>Test for bug 1539159</title>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
<p></p>
<script>
function start() {
  let rules = InspectorUtils.getCSSStyleRules(document.querySelector("p"));
  ok(rules.length > 0, "Should have found some rules");
  is(rules[0].type, CSSRule.STYLE_RULE, "Should have found a style rule");

  let selector = rules[0].selectorText;
  isnot(selector, ".xxxxx", "Rule selector should not be something strange");

  try {
    rules[0].selectorText = "img";
  } catch (ex) {
  }
  is(rules[0].selectorText, selector, "Selector text should be unchanged");

  SimpleTest.finish();
}

SimpleTest.waitForExplicitFinish();
document.addEventListener('DOMContentLoaded', start)
</script>