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

loislo at chromium.org loislo at chromium.org
Wed Dec 22 12:58:52 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 940d4fe5cc7d06bb5be64b279ac1ec39bf15b5aa
Author: loislo at chromium.org <loislo at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Sep 3 15:17:17 2010 +0000

    2010-09-03  Ilya Tikhonovsky  <loislo at chromium.org>
    
            Reviewed by Yury Semikhatsky.
    
            Web Inspector: cleanup inspector api. getChildNodes should return array of child nodes as an output value.
    
            The current implementation of the inspector api has some unnecessary complexity.
            As example WebInspector is requesting child nodes of a node by getChildNodes
            but DOM agent is actually pushing the child nodes via setChildNodes event call and
            send back an empty response message.
    
            https://bugs.webkit.org/show_bug.cgi?id=45172
    
            * inspector/CodeGeneratorInspector.pm:
            * inspector/Inspector.idl:
            * inspector/InspectorDOMAgent.cpp:
            (WebCore::InspectorDOMAgent::getChildNodesArray):
            (WebCore::InspectorDOMAgent::pushChildNodesToFrontend):
            (WebCore::InspectorDOMAgent::getChildNodes):
            * inspector/InspectorDOMAgent.h:
            * inspector/front-end/DOMAgent.js:
            (WebInspector.DOMAgent.prototype.getChildNodesAsync.mycallback):
            (WebInspector.DOMAgent.prototype.getChildNodesAsync):
            * inspector/front-end/WorkersSidebarPane.js:
            (WebInspector.WorkersSidebarPane.prototype.reset):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66732 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ea62cc6..c43b33d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,29 @@
+2010-09-03  Ilya Tikhonovsky  <loislo at chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: cleanup inspector api. getChildNodes should return array of child nodes as an output value.
+
+        The current implementation of the inspector api has some unnecessary complexity. 
+        As example WebInspector is requesting child nodes of a node by getChildNodes
+        but DOM agent is actually pushing the child nodes via setChildNodes event call and
+        send back an empty response message.
+
+        https://bugs.webkit.org/show_bug.cgi?id=45172
+
+        * inspector/CodeGeneratorInspector.pm:
+        * inspector/Inspector.idl:
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::getChildNodesArray):
+        (WebCore::InspectorDOMAgent::pushChildNodesToFrontend):
+        (WebCore::InspectorDOMAgent::getChildNodes):
+        * inspector/InspectorDOMAgent.h:
+        * inspector/front-end/DOMAgent.js:
+        (WebInspector.DOMAgent.prototype.getChildNodesAsync.mycallback):
+        (WebInspector.DOMAgent.prototype.getChildNodesAsync):
+        * inspector/front-end/WorkersSidebarPane.js:
+        (WebInspector.WorkersSidebarPane.prototype.reset):
+
 2010-09-03  Nikolas Zimmermann  <nzimmermann at rim.com>
 
         Reviewed by Dirk Schulze.
diff --git a/WebCore/inspector/CodeGeneratorInspector.pm b/WebCore/inspector/CodeGeneratorInspector.pm
index d76fbd3..df3fcc4 100644
--- a/WebCore/inspector/CodeGeneratorInspector.pm
+++ b/WebCore/inspector/CodeGeneratorInspector.pm
@@ -537,8 +537,8 @@ WebInspector.InspectorBackendStub.prototype = {
                 console.error("Protocol Error: Optional callback argument for 'InspectorBackend.%s' call should be a function but its type is '%s'.", request.command, typeof args[0]);
                 return;
             }
-            request.seq = WebInspector.Callback.wrap(args[0]);
         }
+        request.seq = WebInspector.Callback.wrap(args[0] ? args[0] : function() { });
 
         var message = JSON.stringify(request);
         InspectorFrontendHost.sendMessageToBackend(message);
diff --git a/WebCore/inspector/Inspector.idl b/WebCore/inspector/Inspector.idl
index 169b188..38bfc92 100644
--- a/WebCore/inspector/Inspector.idl
+++ b/WebCore/inspector/Inspector.idl
@@ -161,7 +161,7 @@ module core {
         [handler=Controller] void addScriptToEvaluateOnLoad(in String scriptSource);
         [handler=Controller] void removeAllScriptsToEvaluateOnLoad();
 
-        [handler=DOM] void getChildNodes(in long nodeId);
+        [handler=DOM] void getChildNodes(in long nodeId, out Array nodes);
         [handler=DOM] void setAttribute(in long elementId, in String name, in String value, out boolean success);
         [handler=DOM] void removeAttribute(in long elementId, in String name, out boolean success);
         [handler=DOM] void setTextNodeValue(in long nodeId, in String value, out boolean success);
diff --git a/WebCore/inspector/InspectorDOMAgent.cpp b/WebCore/inspector/InspectorDOMAgent.cpp
index 23c22aa..01b9b63 100644
--- a/WebCore/inspector/InspectorDOMAgent.cpp
+++ b/WebCore/inspector/InspectorDOMAgent.cpp
@@ -354,18 +354,26 @@ bool InspectorDOMAgent::pushDocumentToFrontend()
     return true;
 }
 
-void InspectorDOMAgent::pushChildNodesToFrontend(long nodeId)
+PassRefPtr<InspectorArray> InspectorDOMAgent::getChildNodesArray(long nodeId)
 {
     Node* node = nodeForId(nodeId);
     if (!node || (node->nodeType() != Node::ELEMENT_NODE && node->nodeType() != Node::DOCUMENT_NODE && node->nodeType() != Node::DOCUMENT_FRAGMENT_NODE))
-        return;
+        return 0;
+
+    NodeToIdMap* nodeMap = m_idToNodesMap.get(nodeId);
+    return buildArrayForContainerChildren(node, 1, nodeMap);
+}
+
+void InspectorDOMAgent::pushChildNodesToFrontend(long nodeId)
+{
     if (m_childrenRequested.contains(nodeId))
         return;
 
-    NodeToIdMap* nodeMap = m_idToNodesMap.get(nodeId);
-    RefPtr<InspectorArray> children = buildArrayForContainerChildren(node, 1, nodeMap);
-    m_childrenRequested.add(nodeId);
-    m_frontend->setChildNodes(nodeId, children.release());
+    PassRefPtr<InspectorArray> nodes = getChildNodesArray(nodeId);
+    if (nodes) {
+        m_frontend->setChildNodes(nodeId, nodes);
+        m_childrenRequested.add(nodeId);
+    }
 }
 
 long InspectorDOMAgent::inspectedNode(unsigned long num)
@@ -396,9 +404,12 @@ Node* InspectorDOMAgent::nodeForId(long id)
     return 0;
 }
 
-void InspectorDOMAgent::getChildNodes(long nodeId)
+void InspectorDOMAgent::getChildNodes(long nodeId, RefPtr<InspectorArray>* nodes)
 {
-    pushChildNodesToFrontend(nodeId);
+    PassRefPtr<InspectorArray> childNodes = getChildNodesArray(nodeId);
+    if (childNodes)
+        *nodes = childNodes;
+    m_childrenRequested.add(nodeId);
 }
 
 long InspectorDOMAgent::pushNodePathToFrontend(Node* nodeToPush)
diff --git a/WebCore/inspector/InspectorDOMAgent.h b/WebCore/inspector/InspectorDOMAgent.h
index 9751e8e..2927fdd 100644
--- a/WebCore/inspector/InspectorDOMAgent.h
+++ b/WebCore/inspector/InspectorDOMAgent.h
@@ -99,7 +99,7 @@ namespace WebCore {
         virtual bool operator==(const EventListener& other);
 
         // Methods called from the frontend for DOM nodes inspection.
-        void getChildNodes(long nodeId);
+        void getChildNodes(long nodeId, RefPtr<InspectorArray>* nodes);
         void setAttribute(long elementId, const String& name, const String& value, bool* success);
         void removeAttribute(long elementId, const String& name, bool* success);
         void removeNode(long nodeId, long* outNodeId);
@@ -148,6 +148,7 @@ namespace WebCore {
         void copyNode(long nodeId);
 
     private:
+        PassRefPtr<InspectorArray> getChildNodesArray(long nodeId);
         static CSSStyleSheet* getParentStyleSheet(CSSStyleDeclaration*);
         void startListening(Document* document);
         void stopListening(Document* document);
diff --git a/WebCore/inspector/front-end/DOMAgent.js b/WebCore/inspector/front-end/DOMAgent.js
index 9b386c3..5797502 100644
--- a/WebCore/inspector/front-end/DOMAgent.js
+++ b/WebCore/inspector/front-end/DOMAgent.js
@@ -341,7 +341,9 @@ WebInspector.DOMAgent.prototype = {
             callback(children);
             return;
         }
-        function mycallback() {
+        function mycallback(nodes) {
+            parent._setChildrenPayload(nodes);
+            WebInspector.domAgent._bindNodes(parent.children);
             callback(parent.children);
         }
         InspectorBackend.getChildNodes(parent.id, mycallback);
diff --git a/WebCore/inspector/front-end/WorkersSidebarPane.js b/WebCore/inspector/front-end/WorkersSidebarPane.js
index 7d6a00f..be8b86f 100644
--- a/WebCore/inspector/front-end/WorkersSidebarPane.js
+++ b/WebCore/inspector/front-end/WorkersSidebarPane.js
@@ -80,7 +80,6 @@ WebInspector.WorkersSidebarPane.prototype = {
 
     reset: function()
     {
-        InspectorBackend.removeAllScriptsToEvaluateOnLoad();
         this.setInstrumentation(this._enableWorkersCheckbox.checked);
         this._treeOutline.removeChildren();
         this._workers = {};

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list