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

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

Issue 692073003: DevTools: [SSP] update style rules of SectionPropertyTreeElements (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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/elements/styles/styles-disable-property-after-selector-edit-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/elements/StylesSidebarPane.js
diff --git a/Source/devtools/front_end/elements/StylesSidebarPane.js b/Source/devtools/front_end/elements/StylesSidebarPane.js
index 6a42183aada574a0c3fa6d3d8dea608939d737bf..f2052bf81c31b0e381a8af03d5be843732dd2296 100644
--- a/Source/devtools/front_end/elements/StylesSidebarPane.js
+++ b/Source/devtools/front_end/elements/StylesSidebarPane.js
@@ -1859,6 +1859,23 @@ WebInspector.StylePropertiesSection.prototype = {
}
},
+ /**
+ * @param {!WebInspector.CSSStyleDeclaration} newStyle
+ */
+ _propogateNewStyle: function(newStyle)
vsevik 2014/11/05 07:52:05 propagate
+ {
+ if (this.rule) {
+ newStyle.parentRule = this.rule;
+ this.rule.style = newStyle;
+ }
+ this.styleRule.style = newStyle;
+ for (var i = 0; i < this.propertiesTreeOutline.children.length; ++i) {
+ var treeElement = this.propertiesTreeOutline.children[i];
+ treeElement.style = newStyle;
+ treeElement._styleRule.style = newStyle;
+ }
+ },
+
editingSelectorCommitted: function(element, newContent, oldContent, context, moveDirection)
{
this._editingSelectorEnded();
@@ -1891,8 +1908,9 @@ WebInspector.StylePropertiesSection.prototype = {
var oldSelectorRange = this.rule.selectorRange;
this.rule = newRule;
this.styleRule = { section: this, style: newRule.style, selectorText: newRule.selectorText, media: newRule.media, rule: newRule };
-
+ this._propogateNewStyle(this.rule.style);
this._parentPane.update(selectedNode);
+
this._parentPane._styleSheetRuleEdited(this.rule, oldSelectorRange, this.rule.selectorRange);
finishOperationAndMoveEditor.call(this, moveDirection);
@@ -2813,11 +2831,9 @@ WebInspector.StylePropertyTreeElement.prototype = {
*/
_applyNewStyle: function(newStyle)
{
- newStyle.parentRule = this.style.parentRule;
var oldStyleRange = /** @type {!WebInspector.TextRange} */ (this.style.range);
var newStyleRange = /** @type {!WebInspector.TextRange} */ (newStyle.range);
- this.style = newStyle;
- this._styleRule.style = newStyle;
+ this.parent.section._propogateNewStyle(newStyle);
if (this.style.parentRule) {
this.style.parentRule.style = this.style;
this._parentPane._styleSheetRuleEdited(this.style.parentRule, oldStyleRange, newStyleRange);
« no previous file with comments | « LayoutTests/inspector/elements/styles/styles-disable-property-after-selector-edit-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698