+2013-03-01 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r144449.
+ http://trac.webkit.org/changeset/144449
+ https://bugs.webkit.org/show_bug.cgi?id=111175
+
+ Breaks style-related inspector tests (Requested by apavlov on
+ #webkit).
+
+ * inspector/front-end/CSSStyleModel.js:
+ (WebInspector.CSSRule.prototype.get isRegular):
+ (WebInspector.CSSProperty.prototype.setDisabled):
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylesSidebarPane.prototype._innerRebuildUpdate):
+ (WebInspector.StylePropertiesSection):
+ (.event):
+ (.isRevert):
+
2013-03-01 Alexander Pavlov <apavlov@chromium.org>
Web Inspector: [Styles] Implement navigation to UI locations of property names/values in the source code
get isRegular()
{
return this.origin === "regular";
- },
-
- /**
- * @return {boolean}
- */
- isSourceNavigable: function()
- {
- if (!this.sourceURL)
- return false;
- var resource = WebInspector.resourceTreeModel.resourceForURL(this.sourceURL);
- return !!resource && resource.contentType() === WebInspector.resourceTypes.Stylesheet;
}
}
WebInspector.cssModel._pendingCommandsMajorState.push(false);
CSSAgent.toggleProperty(this.ownerStyle.id, this.index, disabled, callback.bind(this));
- },
-
- /**
- * @param {boolean} forName
- * @return {WebInspector.UILocation}
- */
- uiLocation: function(forName)
- {
- if (!this.range || !this.ownerStyle || !this.ownerStyle.parentRule || !this.ownerStyle.parentRule.sourceURL)
- return null;
-
- var range = this.range;
- var line = forName ? range.startLine : range.endLine;
- // End of range is exclusive, so subtract 1 from the end offset.
- var column = forName ? range.startColumn : range.endColumn - 1;
- var rawLocation = new WebInspector.CSSLocation(this.ownerStyle.parentRule.sourceURL, line, column);
- return WebInspector.cssModel.rawLocationToUILocation(rawLocation);
}
}
this.sections[0] = this._rebuildSectionsForStyleRules(styleRules, usedProperties, 0, null);
var anchorElement = this.sections[0].inheritedPropertiesSeparatorElement;
- if (styles.computedStyle)
+ if (styles.computedStyle)
this.sections[0][0].rebuildComputedTrace(this.sections[0]);
for (var i = 0; i < styles.pseudoElements.length; ++i) {
// Prevent editing the user agent and user rules.
if (this.rule.isUserAgent || this.rule.isUser)
this.editable = false;
- else
- this.navigable = this.rule.isSourceNavigable();
this.titleElement.addStyleClass("styles-selector");
}
if (isInherited)
this.element.addStyleClass("show-inherited"); // This one is related to inherited rules, not computed style.
- if (this.navigable)
- this.element.addStyleClass("navigable");
-
if (!this.editable)
this.element.addStyleClass("read-only");
}
if (!newStyle)
return;
- newStyle.parentRule = this.style.parentRule;
this.style = newStyle;
this._styleRule.style = newStyle;
return;
}
- if (WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && this.section().navigable) {
- this._navigateToSource(event.target);
- return;
- }
-
this.startEditing(event.target);
},
- /**
- * @param {Element} element
- */
- _navigateToSource: function(element)
- {
- console.assert(this.section().navigable);
- var propertyNameClicked = element === this.nameElement;
- var uiLocation = this.property.uiLocation(propertyNameClicked);
- if (!uiLocation)
- return;
- WebInspector.showPanel("scripts").showUISourceCode(uiLocation.uiSourceCode, uiLocation.lineNumber);
- },
-
_isNameElement: function(element)
{
return element.enclosingNodeOrSelfWithClass("webkit-css-property") === this.nameElement;
if (this._newProperty)
this._newPropertyInStyle = true;
- newStyle.parentRule = this.style.parentRule;
this.style = newStyle;
this.property = newStyle.propertyAt(this.property.index);
this._styleRule.style = this.style;
// Synthesize property text disregarding any comments, custom whitespace etc.
this._sidebarPane.applyStyleText(this._sidebarPane.nameElement.textContent + ": " + this._sidebarPane.valueElement.textContent, false, false, false);
}
-
+
// Handle numeric value increment/decrement only at this point.
if (!this._isEditingName && WebInspector.handleElementValueModifications(event, this._sidebarPane.valueElement, finishHandler.bind(this), this._isValueSuggestion.bind(this)))
return true;