Commit fba2e748 authored by eric@webkit.org's avatar eric@webkit.org

2010-02-07 Pavel Feldman <pfeldman@chromium.org>

        Reviewed by Timothy Hatcher.

        Web Inspector: Fragment-held Elements Not Shown in Inspector.

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

        * inspector/console-dirxml-expected.txt:
        * inspector/console-dirxml.html:
2010-02-07  Pavel Feldman  <pfeldman@chromium.org>

        Reviewed by Timothy Hatcher.

        Web Inspector: Fragment-held Elements Not Shown in Inspector.

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

        * inspector/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::pushChildNodesToFrontend):
        (WebCore::InspectorDOMAgent::buildObjectForNode):
        * inspector/front-end/ElementsTreeOutline.js:
        (WebInspector.ElementsTreeElement.prototype._nodeTitleInfo):

git-svn-id: svn://svn.chromium.org/blink/trunk@54470 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 9af533cc
2010-02-07 Pavel Feldman <pfeldman@chromium.org>
Reviewed by Timothy Hatcher.
Web Inspector: Fragment-held Elements Not Shown in Inspector.
https://bugs.webkit.org/show_bug.cgi?id=34680
* inspector/console-dirxml-expected.txt:
* inspector/console-dirxml.html:
2010-02-07 Csaba Osztrogonác <ossy@webkit.org>
Rubber-stamped by Kenneth Rohde Christiansen.
......
CONSOLE MESSAGE: line 9: [object HTMLDocument]
CONSOLE MESSAGE: line 12: [object HTMLDocument]
CONSOLE MESSAGE: line 13: [object DocumentFragment]
CONSOLE MESSAGE: line 14: [object HTMLParagraphElement]
CONSOLE MESSAGE: line 15: [object HTMLParagraphElement]
Tests that console logging dumps proper messages.
console-dirxml.html:9Document
console-dirxml.html:12Document
console-dirxml.html:13Document Fragment
console-dirxml.html:14<p>
console-dirxml.html:15[<p>]
......@@ -6,7 +6,13 @@
function doit()
{
var fragment = document.createDocumentFragment();
fragment.appendChild(document.createElement("p"));
console.dirxml(document);
console.dirxml(fragment);
console.dirxml(fragment.firstChild);
console.log([fragment.firstChild]);
dumpConsoleMessages();
}
......
2010-02-07 Pavel Feldman <pfeldman@chromium.org>
Reviewed by Timothy Hatcher.
Web Inspector: Fragment-held Elements Not Shown in Inspector.
https://bugs.webkit.org/show_bug.cgi?id=34680
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::pushChildNodesToFrontend):
(WebCore::InspectorDOMAgent::buildObjectForNode):
* inspector/front-end/ElementsTreeOutline.js:
(WebInspector.ElementsTreeElement.prototype._nodeTitleInfo):
2010-02-07 Jian Li <jianli@chromium.org>
Reviewed by Darin Fisher.
......
......@@ -204,7 +204,7 @@ bool InspectorDOMAgent::pushDocumentToFrontend()
void InspectorDOMAgent::pushChildNodesToFrontend(long nodeId)
{
Node* node = nodeForId(nodeId);
if (!node || (node->nodeType() != Node::ELEMENT_NODE && node->nodeType() != Node::DOCUMENT_NODE))
if (!node || (node->nodeType() != Node::ELEMENT_NODE && node->nodeType() != Node::DOCUMENT_NODE && node->nodeType() != Node::DOCUMENT_FRAGMENT_NODE))
return;
if (m_childrenRequested.contains(nodeId))
return;
......@@ -464,7 +464,7 @@ ScriptObject InspectorDOMAgent::buildObjectForNode(Node* node, int depth, NodeTo
value.set("localName", localName);
value.set("nodeValue", nodeValue);
if (node->nodeType() == Node::ELEMENT_NODE || node->nodeType() == Node::DOCUMENT_NODE) {
if (node->nodeType() == Node::ELEMENT_NODE || node->nodeType() == Node::DOCUMENT_NODE || node->nodeType() == Node::DOCUMENT_FRAGMENT_NODE) {
int nodeCount = innerChildNodeCount(node);
value.set("childNodeCount", nodeCount);
ScriptArray children = buildArrayForContainerChildren(node, depth, nodesMap);
......@@ -478,7 +478,7 @@ ScriptObject InspectorDOMAgent::buildObjectForNode(Node* node, int depth, NodeTo
HTMLFrameOwnerElement* frameOwner = static_cast<HTMLFrameOwnerElement*>(node);
value.set("documentURL", documentURLString(frameOwner->contentDocument()));
}
} else {
} else if (node->nodeType() == Node::DOCUMENT_NODE) {
Document* document = static_cast<Document*>(node);
value.set("documentURL", documentURLString(document));
}
......
......@@ -925,6 +925,10 @@ WebInspector.ElementsTreeElement.prototype = {
info.title = "Document";
break;
case Node.DOCUMENT_FRAGMENT_NODE:
info.title = "Document Fragment";
break;
case Node.ELEMENT_NODE:
info.title = "<span class=\"webkit-html-tag\">&lt;" + node.nodeName.toLowerCase().escapeHTML();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment