[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 00:55:16 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit c3a1f56d5ed4508337aa0bbdcb9477fb51ffd3df
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 5 23:53:00 2010 +0000

    2010-01-05  Alexander Pavlov  <apavlov at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            Provide the "documentURL" property for documents and frame owner elements
    
            This is necessary to determine owner document URLs for nodes (all nodes have
            the top-level document set as ownerDocument).
            https://bugs.webkit.org/show_bug.cgi?id=33025
    
            * inspector/InspectorDOMAgent.cpp:
            (WebCore::InspectorDOMAgent::buildObjectForNode):
            * inspector/front-end/DOMAgent.js:
            (WebInspector.DOMNode):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52836 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 82aacda..6842cee 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-01-05  Alexander Pavlov  <apavlov at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Provide the "documentURL" property for documents and frame owner elements
+
+        This is necessary to determine owner document URLs for nodes (all nodes have
+        the top-level document set as ownerDocument).
+        https://bugs.webkit.org/show_bug.cgi?id=33025
+
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::buildObjectForNode):
+        * inspector/front-end/DOMAgent.js:
+        (WebInspector.DOMNode):
+
 2010-01-05  Peter Kasting  <pkasting at google.com>
 
         Reviewed by Adam Barth.
diff --git a/WebCore/inspector/InspectorDOMAgent.cpp b/WebCore/inspector/InspectorDOMAgent.cpp
index 6a6ca5f..9632806 100644
--- a/WebCore/inspector/InspectorDOMAgent.cpp
+++ b/WebCore/inspector/InspectorDOMAgent.cpp
@@ -479,6 +479,13 @@ void InspectorDOMAgent::getEventListenersForNode(long callId, long nodeId)
     m_frontend->didGetEventListenersForNode(callId, nodeId, listenersArray);
 }
 
+String InspectorDOMAgent::documentURLString(Document* document) const
+{
+    if (!document || document->url().isNull())
+        return "";
+    return document->url().string();
+}
+
 ScriptObject InspectorDOMAgent::buildObjectForNode(Node* node, int depth, NodeToIdMap* nodesMap)
 {
     ScriptObject value = m_frontend->newScriptObject();
@@ -512,18 +519,25 @@ ScriptObject InspectorDOMAgent::buildObjectForNode(Node* node, int depth, NodeTo
     value.set("localName", localName);
     value.set("nodeValue", nodeValue);
 
-    if (node->nodeType() == Node::ELEMENT_NODE) {
-        Element* element = static_cast<Element*>(node);
-        value.set("attributes", buildArrayForElementAttributes(element));
-    }
     if (node->nodeType() == Node::ELEMENT_NODE || node->nodeType() == Node::DOCUMENT_NODE) {
         int nodeCount = innerChildNodeCount(node);
         value.set("childNodeCount", nodeCount);
         ScriptArray children = buildArrayForContainerChildren(node, depth, nodesMap);
         if (children.length() > 0)
             value.set("children", children);
-    }
-    if (node->nodeType() == Node::DOCUMENT_TYPE_NODE) {
+
+        if (node->nodeType() == Node::ELEMENT_NODE) {
+            Element* element = static_cast<Element*>(node);
+            value.set("attributes", buildArrayForElementAttributes(element));
+            if (node->isFrameOwnerElement()) {
+                HTMLFrameOwnerElement* frameOwner = static_cast<HTMLFrameOwnerElement*>(node);
+                value.set("documentURL", documentURLString(frameOwner->contentDocument()));
+            }
+        } else {
+            Document* document = static_cast<Document*>(node);
+            value.set("documentURL", documentURLString(document));
+        }
+    } else if (node->nodeType() == Node::DOCUMENT_TYPE_NODE) {
         DocumentType* docType = static_cast<DocumentType*>(node);
         value.set("publicId", docType->publicId());
         value.set("systemId", docType->systemId());
diff --git a/WebCore/inspector/InspectorDOMAgent.h b/WebCore/inspector/InspectorDOMAgent.h
index 26df5aa..ae302a8 100644
--- a/WebCore/inspector/InspectorDOMAgent.h
+++ b/WebCore/inspector/InspectorDOMAgent.h
@@ -131,6 +131,7 @@ namespace WebCore {
         bool isWhitespace(Node* node);
 
         Document* mainFrameDocument() const;
+        String documentURLString(Document* document) const;
         void discardBindings();
 
         InspectorFrontend* m_frontend;
diff --git a/WebCore/inspector/front-end/DOMAgent.js b/WebCore/inspector/front-end/DOMAgent.js
index 9900cbb..480a43e 100644
--- a/WebCore/inspector/front-end/DOMAgent.js
+++ b/WebCore/inspector/front-end/DOMAgent.js
@@ -66,11 +66,14 @@ WebInspector.DOMNode = function(doc, payload) {
             this.ownerDocument.documentElement = this;
         if (!this.ownerDocument.body && this.nodeName === "BODY")
             this.ownerDocument.body = this;
+        if (payload.documentURL)
+            this.documentURL = payload.documentURL;
     } else if (this.nodeType === Node.DOCUMENT_TYPE_NODE) {
         this.publicId = payload.publicId;
         this.systemId = payload.systemId;
         this.internalSubset = payload.internalSubset;
-    }
+    } else if (this.nodeType === Node.DOCUMENT_NODE)
+        this.documentURL = payload.documentURL;
 }
 
 WebInspector.DOMNode.prototype = {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list