Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Unified Diff: Source/WebCore/inspector/front-end/StylesSidebarPane.js

Issue 7566008: Merge 92167 - Web Inspector: button + "New style rule" (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/inspector/styles/styles-add-new-rule-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/inspector/front-end/StylesSidebarPane.js
===================================================================
--- Source/WebCore/inspector/front-end/StylesSidebarPane.js (revision 92286)
+++ Source/WebCore/inspector/front-end/StylesSidebarPane.js (working copy)
@@ -71,6 +71,7 @@
var addButton = document.createElement("button");
addButton.className = "pane-title-button add";
+ addButton.id = "add-style-button-test-id";
addButton.title = WebInspector.UIString("New Style Rule");
addButton.addEventListener("click", this._createNewRule.bind(this), false);
this.titleElement.appendChild(addButton);
@@ -1285,24 +1286,23 @@
editingSelectorCommitted: function(element, newContent, oldContent, context)
{
- var self = this;
function successCallback(newRule, doesSelectorAffectSelectedNode)
{
- var styleRule = { section: self, style: newRule.style, selectorText: newRule.selectorText, sourceURL: newRule.sourceURL, rule: newRule };
- self.makeNormal(styleRule);
+ var styleRule = { section: this, style: newRule.style, selectorText: newRule.selectorText, sourceURL: newRule.sourceURL, rule: newRule };
+ this.makeNormal(styleRule);
if (!doesSelectorAffectSelectedNode) {
- self.noAffect = true;
- self.element.addStyleClass("no-affect");
+ this.noAffect = true;
+ this.element.addStyleClass("no-affect");
}
- self.subtitleElement.textContent = WebInspector.UIString("via inspector");
- self.expand();
-
- self.addNewBlankProperty().startEditing();
+ this.subtitleElement.textContent = WebInspector.UIString("via inspector");
+ this.expand();
+ if (this.element.parentElement) // Might have been detached already.
+ this.addNewBlankProperty().startEditing();
}
- WebInspector.cssModel.addRule(this.pane.node.id, newContent, successCallback, this.editingSelectorCancelled.bind(this));
+ WebInspector.cssModel.addRule(this.pane.node.id, newContent, successCallback.bind(this), this.editingSelectorCancelled.bind(this));
},
editingSelectorCancelled: function()
« no previous file with comments | « LayoutTests/inspector/styles/styles-add-new-rule-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698