blob: 8b6ed5127848458eba5640015a679a648b517f14 [file] [log] [blame]
<html>
<head>
<script src="../http/tests/inspector/inspector-test.js"></script>
<script src="elements-tests.js"></script>
<script>
function doit()
{
function callback(result)
{
dumpArray(result);
notifyDone();
}
evaluateInWebInspector("frontend_runTest", callback);
}
// Frontend functions.
function frontend_runTest(testController)
{
testController.waitUntilDone();
frontend_expandDOMSubtreeAndRun(testController, null, frontend_selectNestedElement);
}
function frontend_selectNestedElement(testController)
{
frontend_selectElementAndRun(testController, "nested", frontend_dumpNestedStyle);
}
function frontend_dumpNestedStyle(testController)
{
var treeItem = frontend_getElementStylePropertyTreeItem("font-weight");
testController.results.push("Before disable");
testController.results = testController.results.concat(frontend_getSelectedElementStyles(true));
frontend_selectElementAndRun(testController, "container", frontend_disableContainerStyle);
}
function frontend_disableContainerStyle(testController)
{
var treeItem = frontend_getElementStylePropertyTreeItem("font-weight");
treeItem.toggleEnabled({ target: { checked: false } });
testController.runAfterPendingDispatches(frontend_dumpResults.bind(this, testController));
}
function frontend_dumpResults(testController)
{
function reportResults()
{
testController.results.push("After disable:");
testController.results = testController.results.concat(frontend_getSelectedElementStyles(true));
testController.notifyDone(window.__result);
}
frontend_selectElementAndRun(testController, "nested", reportResults);
}
</script>
</head>
<body onload="onload()">
<p>
Tests that disabling inherited style property does not break further style inspection.
</p>
<div id="container" style="font-weight:bold">
<div id="nested"></div>
</div>
</body>
</html>