2009-08-15 Pavel Feldman <pfeldman@chromium.org>
authorpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Aug 2009 09:02:45 +0000 (09:02 +0000)
committerpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Aug 2009 09:02:45 +0000 (09:02 +0000)
        Reviewed by Timothy Hatcher.

        WebInspector: Minor DOMAgent bugfixes.

        https://bugs.webkit.org/show_bug.cgi?id=28177

        * inspector/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::nodeForId):
        * inspector/front-end/DOMAgent.js:
        (WebInspector.DOMAgent):
        * inspector/front-end/ElementsPanel.js:
        (WebInspector.ElementsPanel.this.treeOutline.focusedNodeChanged):

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

WebCore/ChangeLog
WebCore/inspector/InspectorDOMAgent.cpp
WebCore/inspector/front-end/DOMAgent.js
WebCore/inspector/front-end/ElementsPanel.js

index e86372c..e90c233 100644 (file)
@@ -2,6 +2,21 @@
 
         Reviewed by Timothy Hatcher.
 
+        WebInspector: Minor DOMAgent bugfixes.
+
+        https://bugs.webkit.org/show_bug.cgi?id=28177
+
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::nodeForId):
+        * inspector/front-end/DOMAgent.js:
+        (WebInspector.DOMAgent):
+        * inspector/front-end/ElementsPanel.js:
+        (WebInspector.ElementsPanel.this.treeOutline.focusedNodeChanged):
+
+2009-08-15  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
         WebInspector: Evaluating objects while on a breakpoint dumps string
         representation instead of live object. 
 
index 46d6ab7..95e5a7c 100644 (file)
@@ -231,7 +231,7 @@ void InspectorDOMAgent::discardBindings()
 Node* InspectorDOMAgent::nodeForId(long id)
 {
     if (!id)
-        return mainFrameDocument();
+        return 0;
 
     HashMap<long, Node*>::iterator it = m_idToNode.find(id);
     if (it != m_idToNode.end())
index 85fbc08..6ef6761 100644 (file)
@@ -58,10 +58,12 @@ WebInspector.DOMNode = function(doc, payload) {
     this.style = null;
     this._matchedCSSRules = [];
 
-    if (this.nodeType == Node.DOCUMENT_NODE)
-        this.ownerDocument.documentElement = this;
-    if (this.nodeType == Node.ELEMENT_NODE && this.nodeName == "BODY")
-        this.ownerDocument.body = this;
+    if (this.nodeType == Node.ELEMENT_NODE) {
+        if (this.nodeName == "HTML")
+            this.ownerDocument.documentElement = this;
+        if (this.nodeName == "BODY")
+            this.ownerDocument.body = this;
+    }
 }
 
 WebInspector.DOMNode.prototype = {
index 3fead6f..3f6265d 100644 (file)
@@ -61,7 +61,8 @@ WebInspector.ElementsPanel = function()
             InspectorController.toggleNodeSearch();
             this.panel.nodeSearchButton.removeStyleClass("toggled-on");
         }
-        InspectorController.addInspectedNode(this._focusedDOMNode.id, function() {});
+        if (this._focusedDOMNode)
+            InspectorController.addInspectedNode(this._focusedDOMNode.id, function() {});
     };
 
     this.contentElement.appendChild(this.treeOutline.element);