return "[" + selectors.join(", ") + "]";
}
+InspectorTest.addNewRuleInStyleSheet = function(styleSheetHeader, selector, callback)
+{
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_addBlankSection", onBlankSection.bind(null, selector, callback));
+ WebInspector.panels.elements.sidebarPanes.styles._createNewRuleInStyleSheet(styleSheetHeader);
+}
+
InspectorTest.addNewRule = function(selector, callback)
{
// Click "Add new rule".
document.getElementById("add-style-button-test-id").click();
- InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_addBlankSection", onBlankSection);
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_addBlankSection", onBlankSection.bind(null, selector, callback));
+}
- function onBlankSection()
- {
- var section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][2];
- if (typeof selector === "string")
- section._selectorElement.textContent = selector;
- section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
- InspectorTest.runAfterPendingDispatches(callback.bind(null, section));
- }
+function onBlankSection(selector, callback)
+{
+ var section = WebInspector.panels.elements.sidebarPanes.styles.sections[0][2];
+ if (typeof selector === "string")
+ section._selectorElement.textContent = selector;
+ section._selectorElement.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
+ InspectorTest.runAfterPendingDispatches(callback.bind(null, section));
}
InspectorTest.dumpInspectorHighlight = function(node, callback)