44 lines
1.3 KiB
HTML
44 lines
1.3 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<!--
|
|
Test that css-logic handles inherited properties correctly
|
|
-->
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Test css-logic inheritance</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">
|
|
</head>
|
|
<body>
|
|
<div style="margin-left:10px; font-size: 5px">
|
|
<div id="innerdiv">Inner div</div>
|
|
</div>
|
|
<script type="application/javascript;version=1.8">
|
|
|
|
window.onload = function() {
|
|
var Cu = Components.utils;
|
|
|
|
const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
|
Cu.import("resource://gre/modules/Services.jsm");
|
|
const {CssLogic} = require("devtools/shared/inspector/css-logic");
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
let cssLogic = new CssLogic();
|
|
cssLogic.highlight(document.getElementById("innerdiv"));
|
|
|
|
let marginProp = cssLogic.getPropertyInfo("margin-left");
|
|
is(marginProp.matchedRuleCount, 0,
|
|
"margin-left should not be included in matched selectors.");
|
|
|
|
let fontSizeProp = cssLogic.getPropertyInfo("font-size");
|
|
is(fontSizeProp.matchedRuleCount, 1,
|
|
"font-size should be included in matched selectors.");
|
|
|
|
SimpleTest.finish();
|
|
}
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|