mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
85 lines
66 KiB
HTML
85 lines
66 KiB
HTML
|
<!DOCTYPE HTML>
|
||
|
<html>
|
||
|
<!--
|
||
|
https://bugzilla.mozilla.org/show_bug.cgi?id=856317
|
||
|
-->
|
||
|
<head>
|
||
|
<title>Test for Bug 856317</title>
|
||
|
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||
|
<link rel="stylesheet" type="text/css" href="bug856317.css"/>
|
||
|
<style type="text/css" title="bug856317-inline">
|
||
|
/* simplest possible */
|
||
|
.alpha {
|
||
|
}
|
||
|
|
||
|
/* with leading whitespace */
|
||
|
#beta {
|
||
|
}
|
||
|
|
||
|
/* with a comment before the rule */ #gamma {
|
||
|
}
|
||
|
|
||
|
/* mixed spaces and tab characters */
|
||
|
#delta {
|
||
|
}
|
||
|
|
||
|
/* long lines, like those produced by CSS minifiers
|
||
|
* (overflows a 16-bit unsigned int)
|
||
|
*/
|
||
|
.epsilon{ background-image: url("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||
|
</style>
|
||
|
</head>
|
||
|
<body>
|
||
|
<script type="application/javascript">
|
||
|
|
||
|
var expectedResults = {
|
||
|
".alpha": { line: 6, column: 1 },
|
||
|
"#beta": { line: 10, column: 5 },
|
||
|
"#gamma": { line: 13, column: 38 },
|
||
|
"#delta": { line: 17, column: 5 },
|
||
|
".epsilon": { line: 23, column: 2 },
|
||
|
".zeta, .eta": { line: 23, column: 65578 }
|
||
|
};
|
||
|
|
||
|
var domUtils = SpecialPowers.Cc["@mozilla.org/inspector/dom-utils;1"]
|
||
|
.getService(SpecialPowers.Ci.inIDOMUtils);
|
||
|
|
||
|
// tests are run on both the external stylesheet and the embedded stylesheet
|
||
|
function executeTests(lineOffset, stylesheetPredicate) {
|
||
|
var rules;
|
||
|
for (var i=0; i < document.styleSheets.length; ++i) {
|
||
|
var styleSheet = document.styleSheets.item(i);
|
||
|
if (stylesheetPredicate(styleSheet)) {
|
||
|
rules = styleSheet.cssRules;
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
if (!rules) {
|
||
|
ok(false, "stylesheet document not found");
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
for (var i=0; i < rules.length; ++i) {
|
||
|
var rule = rules.item(i);
|
||
|
expected = expectedResults[rule.selectorText];
|
||
|
is(domUtils.getRuleLine(rule), expected.line + lineOffset,
|
||
|
"line number for "+rule.selectorText);
|
||
|
is(domUtils.getRuleColumn(rule), expected.column,
|
||
|
"column number for "+rule.selectorText);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// run tests on external stylesheet
|
||
|
executeTests(0, function (styleSheet) {
|
||
|
return styleSheet.href.indexOf("bug856317.css") > 0;
|
||
|
});
|
||
|
|
||
|
// run tests on embedded stylesheet
|
||
|
executeTests(7, function (styleSheet) {
|
||
|
return styleSheet.title == "bug856317-inline";
|
||
|
});
|
||
|
</script>
|
||
|
</body>
|
||
|
</html>
|