[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

pfeldman at chromium.org pfeldman at chromium.org
Wed Dec 22 14:45:14 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit dbc100553ebbfff117f517df94e3d235dcf42ca5
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 19 10:38:27 2010 +0000

    2010-10-19  Pavel Feldman  <pfeldman at chromium.org>
    
            Reviewed by Yury Semikhatsky.
    
            Web Inspector: migrate from legacy Object.properties to Object.keys, remove dead code.
            https://bugs.webkit.org/show_bug.cgi?id=47890
    
            * inspector/front-end/ConsoleView.js:
            (WebInspector.ConsoleView.prototype._reportCompletions):
            * inspector/front-end/ElementsPanel.js:
            (WebInspector.ElementsPanel):
            * inspector/front-end/ExtensionServer.js:
            (WebInspector.ExtensionServer.prototype._onGetResources):
            * inspector/front-end/HAREntry.js:
            (WebInspector.HARLog.prototype.build):
            * inspector/front-end/StylesSidebarPane.js:
            (WebInspector.StylePropertyTreeElement.prototype.):
            (WebInspector.StylePropertyTreeElement.prototype):
            * inspector/front-end/utilities.js:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70046 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index be5fe55..a981f0a 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,26 @@
 
         Reviewed by Yury Semikhatsky.
 
+        Web Inspector: migrate from legacy Object.properties to Object.keys, remove dead code.
+        https://bugs.webkit.org/show_bug.cgi?id=47890
+
+        * inspector/front-end/ConsoleView.js:
+        (WebInspector.ConsoleView.prototype._reportCompletions):
+        * inspector/front-end/ElementsPanel.js:
+        (WebInspector.ElementsPanel):
+        * inspector/front-end/ExtensionServer.js:
+        (WebInspector.ExtensionServer.prototype._onGetResources):
+        * inspector/front-end/HAREntry.js:
+        (WebInspector.HARLog.prototype.build):
+        * inspector/front-end/StylesSidebarPane.js:
+        (WebInspector.StylePropertyTreeElement.prototype.):
+        (WebInspector.StylePropertyTreeElement.prototype):
+        * inspector/front-end/utilities.js:
+
+2010-10-19  Pavel Feldman  <pfeldman at chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
         Web Inspector: do not access ResourcePanel from resources directly.
         https://bugs.webkit.org/show_bug.cgi?id=47892
 
diff --git a/WebCore/inspector/Inspector.idl b/WebCore/inspector/Inspector.idl
index b7f4a0d..85c30a8 100644
--- a/WebCore/inspector/Inspector.idl
+++ b/WebCore/inspector/Inspector.idl
@@ -207,7 +207,7 @@ module core {
         [handler=DOM] void getComputedStyle(in long nodeId, out Value style);
         [handler=DOM] void getStyleSheet(in long styleSheetId, out Object styleSheet);
         [handler=DOM] void getStyleSourceData(in long styleSheetId, out Object styleSourceData);
-        [handler=DOM] void applyStyleText(in long styleId, in String styleText, in String propertyName, out boolean success, out Value style, out Array changedProperties);
+        [handler=DOM] void applyStyleText(in long styleId, in String styleText, in String propertyName, out boolean success, out Value style);
         [handler=DOM] void setStyleText(in long styleId, in String styleText, out boolean success);
         [handler=DOM] void setStyleProperty(in long styleId, in String name, in String value, out boolean success);
         [handler=DOM] void toggleStyleEnabled(in long styleId, in String propertyName, in boolean disabled, out Value style);
diff --git a/WebCore/inspector/InspectorDOMAgent.cpp b/WebCore/inspector/InspectorDOMAgent.cpp
index 30bc3dc..f5c5f8b 100644
--- a/WebCore/inspector/InspectorDOMAgent.cpp
+++ b/WebCore/inspector/InspectorDOMAgent.cpp
@@ -1358,7 +1358,7 @@ PassRefPtr<InspectorArray> InspectorDOMAgent::buildArrayForPseudoElements(Elemen
     return result.release();
 }
 
-void InspectorDOMAgent::applyStyleText(long styleId, const String& styleText, const String& propertyName, bool* success, RefPtr<InspectorValue>* styleObject, RefPtr<InspectorArray>* changedPropertiesArray)
+void InspectorDOMAgent::applyStyleText(long styleId, const String& styleText, const String& propertyName, bool* success, RefPtr<InspectorValue>* styleObject)
 {
     CSSStyleDeclaration* style = cssStore()->styleForId(styleId);
     if (!style)
@@ -1395,7 +1395,6 @@ void InspectorDOMAgent::applyStyleText(long styleId, const String& styleText, co
 
     // Notify caller that the property was successfully deleted.
     if (!styleTextLength) {
-        (*changedPropertiesArray)->pushString(propertyName);
         *success = true;
         return;
     }
@@ -1406,7 +1405,6 @@ void InspectorDOMAgent::applyStyleText(long styleId, const String& styleText, co
     // Iterate of the properties on the test element's style declaration and
     // add them to the real style declaration. We take care to move shorthands.
     HashSet<String> foundShorthands;
-    Vector<String> changedProperties;
 
     for (unsigned i = 0; i < tempStyle->length(); ++i) {
         String name = tempStyle->item(i);
@@ -1433,11 +1431,9 @@ void InspectorDOMAgent::applyStyleText(long styleId, const String& styleText, co
         // Remove disabled property entry for property with this name.
         if (disabledStyle)
             disabledStyle->remove(name);
-        changedProperties.append(name);
     }
     *success = true;
     *styleObject = buildObjectForStyle(style, true);
-    *changedPropertiesArray = toArray(changedProperties);
 }
 
 void InspectorDOMAgent::setStyleText(long styleId, const String& cssText, bool* success)
diff --git a/WebCore/inspector/InspectorDOMAgent.h b/WebCore/inspector/InspectorDOMAgent.h
index eeb21a6..03e4d8d 100644
--- a/WebCore/inspector/InspectorDOMAgent.h
+++ b/WebCore/inspector/InspectorDOMAgent.h
@@ -131,7 +131,7 @@ namespace WebCore {
         void getComputedStyle(long nodeId, RefPtr<InspectorValue>* styles);
         void getStyleSheet(long styleSheetId, RefPtr<InspectorObject>* styleSheetObject);
         void getStyleSourceData(long styleId, RefPtr<InspectorObject>* dataObject);
-        void applyStyleText(long styleId, const String& styleText, const String& propertyName, bool* success, RefPtr<InspectorValue>* styleObject, RefPtr<InspectorArray>* changedProperties);
+        void applyStyleText(long styleId, const String& styleText, const String& propertyName, bool* success, RefPtr<InspectorValue>* styleObject);
         void setStyleText(long styleId, const String& cssText, bool* success);
         void setStyleProperty(long styleId, const String& name, const String& value, bool* success);
         void toggleStyleEnabled(long styleId, const String& propertyName, bool disabled, RefPtr<InspectorValue>* styleObject);
diff --git a/WebCore/inspector/front-end/CSSStyleModel.js b/WebCore/inspector/front-end/CSSStyleModel.js
index bda4064..e3e9b4f 100644
--- a/WebCore/inspector/front-end/CSSStyleModel.js
+++ b/WebCore/inspector/front-end/CSSStyleModel.js
@@ -96,13 +96,13 @@ WebInspector.CSSStyleModel.prototype = {
 
     applyStyleText: function(styleId, styleText, propertyName, successCallback, failureCallback)
     {
-        function callback(success, newPayload, changedProperties)
+        function callback(success, newPayload)
         {
             if (!success)
                 failureCallback();
             else {
                 var newStyle = newPayload ? WebInspector.CSSStyleDeclaration.parseStyle(newPayload) : null;
-                successCallback(newStyle, changedProperties);
+                successCallback(newStyle);
             }
         }
 
diff --git a/WebCore/inspector/front-end/ConsoleView.js b/WebCore/inspector/front-end/ConsoleView.js
index 25d81ac..8cd5d52 100644
--- a/WebCore/inspector/front-end/ConsoleView.js
+++ b/WebCore/inspector/front-end/ConsoleView.js
@@ -360,7 +360,7 @@ WebInspector.ConsoleView.prototype = {
         }
 
         var results = [];
-        var properties = Object.sortedProperties(result);
+        var properties = Object.keys(result).sort();
 
         for (var i = 0; i < properties.length; ++i) {
             var property = properties[i];
diff --git a/WebCore/inspector/front-end/ElementsPanel.js b/WebCore/inspector/front-end/ElementsPanel.js
index d6437fc..76c22c5 100644
--- a/WebCore/inspector/front-end/ElementsPanel.js
+++ b/WebCore/inspector/front-end/ElementsPanel.js
@@ -107,7 +107,6 @@ WebInspector.ElementsPanel = function()
     this.element.appendChild(this.sidebarResizeElement);
 
     this._registerShortcuts();
-    this._changedStyles = {};
 
     this.reset();
 }
@@ -346,115 +345,6 @@ WebInspector.ElementsPanel.prototype = {
         // TODO: Implement Shifting the oldSelector, and its contents to a newSelector
     },
 
-    addStyleChange: function(identifier, style, property)
-    {
-        if (!style.parentRule)
-            return;
-
-        var selector = style.parentRule.selectorText;
-        if (!this._changedStyles[identifier])
-            this._changedStyles[identifier] = {};
-
-        if (!this._changedStyles[identifier][selector])
-            this._changedStyles[identifier][selector] = {};
-
-        if (!this._changedStyles[identifier][selector][property])
-            WebInspector.styleChanges += 1;
-
-        this._changedStyles[identifier][selector][property] = style.getPropertyValue(property);
-    },
-
-    removeStyleChange: function(identifier, style, property)
-    {
-        if (!style.parentRule)
-            return;
-
-        var selector = style.parentRule.selectorText;
-        if (!this._changedStyles[identifier] || !this._changedStyles[identifier][selector])
-            return;
-
-        if (this._changedStyles[identifier][selector][property]) {
-            delete this._changedStyles[identifier][selector][property];
-            WebInspector.styleChanges -= 1;
-        }
-    },
-
-    generateStylesheet: function()
-    {
-        if (!WebInspector.styleChanges)
-            return;
-
-        // Merge Down to Just Selectors
-        var mergedSelectors = {};
-        for (var identifier in this._changedStyles) {
-            for (var selector in this._changedStyles[identifier]) {
-                if (!mergedSelectors[selector])
-                    mergedSelectors[selector] = this._changedStyles[identifier][selector];
-                else { // merge on selector
-                    var merge = {};
-                    for (var property in mergedSelectors[selector])
-                        merge[property] = mergedSelectors[selector][property];
-                    for (var property in this._changedStyles[identifier][selector]) {
-                        if (!merge[property])
-                            merge[property] = this._changedStyles[identifier][selector][property];
-                        else { // merge on property within a selector, include comment to notify user
-                            var value1 = merge[property];
-                            var value2 = this._changedStyles[identifier][selector][property];
-
-                            if (value1 === value2)
-                                merge[property] = [value1];
-                            else if (value1 instanceof Array)
-                                merge[property].push(value2);
-                            else
-                                merge[property] = [value1, value2];
-                        }
-                    }
-                    mergedSelectors[selector] = merge;
-                }
-            }
-        }
-
-        var builder = [];
-        builder.push("/**");
-        builder.push(" * Inspector Generated Stylesheet"); // UIString?
-        builder.push(" */\n");
-
-        var indent = "  ";
-        function displayProperty(property, value, comment) {
-            if (comment)
-                return indent + "/* " + property + ": " + value + "; */";
-            else
-                return indent + property + ": " + value + ";";
-        }
-
-        for (var selector in mergedSelectors) {
-            var psuedoStyle = mergedSelectors[selector];
-            var properties = Object.properties(psuedoStyle);
-            if (properties.length) {
-                builder.push(selector + " {");
-                for (var i = 0; i < properties.length; ++i) {
-                    var property = properties[i];
-                    var value = psuedoStyle[property];
-                    if (!(value instanceof Array))
-                        builder.push(displayProperty(property, value));
-                    else {
-                        if (value.length === 1)
-                            builder.push(displayProperty(property, value) + " /* merged from equivalent edits */"); // UIString?
-                        else {                        
-                            builder.push(indent + "/* There was a Conflict... There were Multiple Edits for '" + property + "' */"); // UIString?
-                            for (var j = 0; j < value.length; ++j)
-                                builder.push(displayProperty(property, value, true));
-                        }
-                    }
-                }
-                builder.push("}\n");
-            }
-        }
-
-        WebInspector.showConsole();
-        WebInspector.console.addMessage(WebInspector.ConsoleMessage.createTextMessage(builder.join("\n")));
-    },
-
     get rootDOMNode()
     {
         return this.treeOutline.rootDOMNode;
diff --git a/WebCore/inspector/front-end/ExtensionServer.js b/WebCore/inspector/front-end/ExtensionServer.js
index bc633ca..9ab4c0c 100644
--- a/WebCore/inspector/front-end/ExtensionServer.js
+++ b/WebCore/inspector/front-end/ExtensionServer.js
@@ -263,7 +263,7 @@ WebInspector.ExtensionServer.prototype = {
         if (request.id)
             response = WebInspector.resources[request.id] ? resourceWrapper(request.id) : this._status.E_NOTFOUND(request.id);
         else
-            response = Object.properties(WebInspector.resources).map(resourceWrapper);
+            response = Object.keys(WebInspector.resources).map(resourceWrapper);
         return response;
     },
 
diff --git a/WebCore/inspector/front-end/HAREntry.js b/WebCore/inspector/front-end/HAREntry.js
index 2cf0740..b9f75a2 100644
--- a/WebCore/inspector/front-end/HAREntry.js
+++ b/WebCore/inspector/front-end/HAREntry.js
@@ -181,7 +181,7 @@ WebInspector.HARLog.prototype = {
                 version: webKitVersion ? webKitVersion[1] : "n/a"
             },
             pages: this._buildPages(),
-            entries: Object.properties(WebInspector.resources).map(this._convertResource)
+            entries: Object.keys(WebInspector.resources).map(this._convertResource)
         }
     },
 
diff --git a/WebCore/inspector/front-end/StylesSidebarPane.js b/WebCore/inspector/front-end/StylesSidebarPane.js
index 6aff37d..36d854c 100644
--- a/WebCore/inspector/front-end/StylesSidebarPane.js
+++ b/WebCore/inspector/front-end/StylesSidebarPane.js
@@ -1695,17 +1695,13 @@ WebInspector.StylePropertyTreeElement.prototype = {
                 self.updateTitle();
         }
 
-        function successCallback(newStyle, changedProperties)
+        function successCallback(newStyle)
         {
-            elementsPanel.removeStyleChange(section.identifier, self.style, self.name);
-
             if (!styleTextLength) {
                 // Do remove ourselves from UI when the property removal is confirmed.
                 self.parent.removeChild(self);
             } else {
                 self.style = newStyle;
-                for (var i = 0; i < changedProperties.length; ++i)
-                    elementsPanel.addStyleChange(section.identifier, self.style, changedProperties[i]);
                 self._styleRule.style = self.style;
             }
 
diff --git a/WebCore/inspector/front-end/utilities.js b/WebCore/inspector/front-end/utilities.js
index 036dc17..7f0ee5e 100644
--- a/WebCore/inspector/front-end/utilities.js
+++ b/WebCore/inspector/front-end/utilities.js
@@ -26,19 +26,6 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-Object.properties = function(obj)
-{
-    var properties = [];
-    for (var prop in obj)
-        properties.push(prop);
-    return properties;
-}
-
-Object.sortedProperties = function(obj, sortFunc)
-{
-    return Object.properties(obj).sort(sortFunc);
-}
-
 Function.prototype.bind = function(thisObject)
 {
     var func = this;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list