Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: os == 'android'
- Manifest: layout/inspector/tests/chrome/chrome.toml
<!DOCTYPE html>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<p></p>
<script>
function start() {
let rules = InspectorUtils.getMatchingCSSRules(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>