Unreviewed, rolling out r144449.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Mar 2013 14:34:09 +0000 (14:34 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Mar 2013 14:34:09 +0000 (14:34 +0000)
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).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-03-01

* 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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@144450 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/CSSStyleModel.js
Source/WebCore/inspector/front-end/StylesSidebarPane.js

index 9fb3b8e..7f56682 100644 (file)
@@ -1,3 +1,21 @@
+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
index 7529d6e..05cb128 100644 (file)
@@ -882,17 +882,6 @@ WebInspector.CSSRule.prototype = {
     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;
     }
 }
 
@@ -1081,23 +1070,6 @@ WebInspector.CSSProperty.prototype = {
 
         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);
     }
 }
 
index b92edab..d439d3a 100644 (file)
@@ -376,7 +376,7 @@ WebInspector.StylesSidebarPane.prototype = {
         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) {
@@ -894,8 +894,6 @@ WebInspector.StylePropertiesSection = function(parentPane, styleRule, editable,
         // 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");
     }
 
@@ -911,9 +909,6 @@ WebInspector.StylePropertiesSection = function(parentPane, styleRule, editable,
     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");
 }
@@ -2050,7 +2045,6 @@ WebInspector.StylePropertyTreeElement.prototype = {
             if (!newStyle)
                 return;
 
-            newStyle.parentRule = this.style.parentRule;
             this.style = newStyle;
             this._styleRule.style = newStyle;
 
@@ -2164,27 +2158,9 @@ WebInspector.StylePropertyTreeElement.prototype = {
             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;
@@ -2604,7 +2580,6 @@ WebInspector.StylePropertyTreeElement.prototype = {
 
             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;
@@ -2698,7 +2673,7 @@ WebInspector.StylesSidebarPane.CSSPropertyPrompt.prototype = {
             // 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;