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

Unified Diff: Source/devtools/front_end/StylesSidebarPane.js

Issue 177963004: DevTools: Split creating inspector stylesheet and adding a new rule into stylesheet in protocol. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Comments addressed Created 6 years, 10 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
Index: Source/devtools/front_end/StylesSidebarPane.js
diff --git a/Source/devtools/front_end/StylesSidebarPane.js b/Source/devtools/front_end/StylesSidebarPane.js
index 2db819ef25f0a260be4b232a5c10eff028d4dc76..247eb6a7033b9fe41fb048441a8ccff0e8565fc1 100644
--- a/Source/devtools/front_end/StylesSidebarPane.js
+++ b/Source/devtools/front_end/StylesSidebarPane.js
@@ -1697,7 +1697,21 @@ WebInspector.BlankStylePropertiesSection.prototype = {
if (newContent)
newContent = newContent.trim();
this._parentPane._userOperation = true;
- WebInspector.cssModel.addRule(this.pane.node.id, newContent, successCallback.bind(this), this.editingSelectorCancelled.bind(this));
+
+ WebInspector.cssModel.requestViaInspectorStylesheet(this.pane.node, viaInspectorCallback.bind(this));
+
+ /**
+ * @this {WebInspector.BlankStylePropertiesSection}
+ * @param {?WebInspector.CSSStyleSheetHeader} styleSheetHeader
+ */
+ function viaInspectorCallback(styleSheetHeader)
+ {
+ if (!styleSheetHeader) {
+ this.editingSelectorCancelled();
+ return;
+ }
+ WebInspector.cssModel.addRule(styleSheetHeader.id, this.pane.node, newContent, successCallback.bind(this), this.editingSelectorCancelled.bind(this));
+ }
},
editingSelectorCancelled: function()

Powered by Google App Engine
This is Rietveld 408576698