blob: 47b47ff04a1b24f278b6c3c8b19a044f13e78cc6 [file] [log] [blame]
<html>
<head>
<style>
#inspected {
color: green;
}
</style>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/elements-test.js"></script>
<script>
function test()
{
WebInspector.showPanel("elements");
InspectorTest.selectNodeAndWaitForStyles("inspected", step1);
function step1()
{
InspectorTest.addResult("=== Before selector modification ===");
InspectorTest.dumpSelectedElementStyles(true);
var section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][2];
section.startEditingSelector();
section._selectorElement.textContent = "hr, #inspected ";
section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
InspectorTest.runAfterPendingDispatches(step2);
}
function step2()
{
InspectorTest.addResult("=== After non-affecting selector modification ===");
InspectorTest.dumpSelectedElementStyles(true);
var section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][2];
section.startEditingSelector();
section._selectorElement.textContent = "#inspectedChanged";
section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
InspectorTest.runAfterPendingDispatches(step3);
}
function step3()
{
InspectorTest.addResult("=== After affecting selector modification ===");
InspectorTest.dumpSelectedElementStyles(true);
InspectorTest.completeTest();
}
}
</script>
</head>
<body onload="runTest()">
<p>
Tests that renaming a selector updates element styles. <a href="https://bugs.webkit.org/show_bug.cgi?id=70018">Bug 70018</a>.
</p>
<div id="inspected" style="color: red">Text</div>
<div id="other"></div>
</body>
</html>