summaryrefslogtreecommitdiffstats
path: root/layout/inspector/tests/test_getRelativeRuleLine.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /layout/inspector/tests/test_getRelativeRuleLine.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'layout/inspector/tests/test_getRelativeRuleLine.html')
-rw-r--r--layout/inspector/tests/test_getRelativeRuleLine.html69
1 files changed, 69 insertions, 0 deletions
diff --git a/layout/inspector/tests/test_getRelativeRuleLine.html b/layout/inspector/tests/test_getRelativeRuleLine.html
new file mode 100644
index 000000000..a1481a49d
--- /dev/null
+++ b/layout/inspector/tests/test_getRelativeRuleLine.html
@@ -0,0 +1,69 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>Test inDOMUtils::getRelativeRuleLine</title>
+ <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+ <style>
+ @supports (not (whatever: 72 zq)) {
+ #test {
+ background-color: #f0c;
+ }
+ }
+
+ #test {
+ color: #f0c;
+ }
+ </style>
+ <style>#test { color: red; }</style>
+ <style>
+ @invalidatkeyword {
+ }
+
+ #test {
+ color: blue;
+ }
+ </style>
+ <script type="application/javascript;version=1.8">
+ let utils = SpecialPowers.Cc["@mozilla.org/inspector/dom-utils;1"]
+ .getService(SpecialPowers.Ci.inIDOMUtils);
+
+ let tests = [
+ { sheetNo: 0, ruleNo: 0, lineNo: 1, columnNo: 1 },
+ { sheetNo: 1, ruleNo: 0, lineNo: 2, columnNo: 15 },
+ { sheetNo: 1, ruleNo: 1, lineNo: 8, columnNo: 5 },
+ { sheetNo: 2, ruleNo: 0, lineNo: 1, columnNo: 1 },
+ { sheetNo: 2, ruleNo: 1, lineNo: 0, columnNo: 1 },
+ { sheetNo: 3, ruleNo: 0, lineNo: 5, columnNo: 6 },
+ ];
+
+ function doTest() {
+ document.styleSheets[2].insertRule("body{}", 1);
+ for (let test of tests) {
+ let sheet = document.styleSheets[test.sheetNo];
+ let rule = sheet.cssRules[test.ruleNo];
+ let line = utils.getRelativeRuleLine(rule);
+ let column = utils.getRuleColumn(rule);
+ info("testing sheet " + test.sheetNo + ", rule " + test.ruleNo);
+ is(line, test.lineNo, "line number is correct");
+ is(column, test.columnNo, "column number is correct");
+ }
+
+ SimpleTest.finish();
+ }
+
+ SimpleTest.waitForExplicitFinish();
+ addLoadEvent(doTest);
+ </script>
+</head>
+<body>
+<h1>Test inDOMUtils::getRelativeRuleLine</h1>
+<p id="display"></p>
+<div id="content" style="display: none">
+
+</div>
+<pre id="test">
+</pre>
+</body>
+</html>