Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Unified Diff: Source/WebCore/inspector/InspectorDOMAgent.cpp

Issue 7147011: Merge 88331 - 2011-06-07 Andrey Kosyakov <caseq@chromium.org> (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/782/
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/inspector/InspectorDOMAgent.h ('k') | Source/WebCore/inspector/front-end/DOMAgent.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/inspector/InspectorDOMAgent.cpp
===================================================================
--- Source/WebCore/inspector/InspectorDOMAgent.cpp (revision 88781)
+++ Source/WebCore/inspector/InspectorDOMAgent.cpp (working copy)
@@ -75,7 +75,6 @@
#include "RenderStyle.h"
#include "RenderStyleConstants.h"
#include "ScriptEventListener.h"
-#include "ShadowRoot.h"
#include "StyleSheetList.h"
#include "Text.h"
@@ -451,7 +450,7 @@
void InspectorDOMAgent::pushChildNodesToFrontend(int nodeId)
{
Node* node = nodeForId(nodeId);
- if (!node || !isContainerNode(*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;
@@ -1058,7 +1057,6 @@
case Node::ATTRIBUTE_NODE:
localName = node->localName();
break;
- case Node::SHADOW_ROOT_NODE:
case Node::DOCUMENT_FRAGMENT_NODE:
break;
case Node::DOCUMENT_NODE:
@@ -1075,7 +1073,7 @@
value->setString("localName", localName);
value->setString("nodeValue", nodeValue);
- if (isContainerNode(*node)) {
+ if (node->nodeType() == Node::ELEMENT_NODE || node->nodeType() == Node::DOCUMENT_NODE || node->nodeType() == Node::DOCUMENT_FRAGMENT_NODE) {
int nodeCount = innerChildNodeCount(node);
value->setNumber("childNodeCount", nodeCount);
RefPtr<InspectorArray> children = buildArrayForContainerChildren(node, depth, nodesMap);
@@ -1089,8 +1087,6 @@
HTMLFrameOwnerElement* frameOwner = static_cast<HTMLFrameOwnerElement*>(node);
value->setString("documentURL", documentURLString(frameOwner->contentDocument()));
}
- if (ShadowRoot* shadowRoot = element->shadowRoot())
- value->setObject("shadowRoot", buildObjectForNode(shadowRoot, depth, nodesMap));
} else if (node->nodeType() == Node::DOCUMENT_NODE) {
Document* document = static_cast<Document*>(node);
value->setString("documentURL", documentURLString(document));
@@ -1263,17 +1259,12 @@
// We could be attaching existing subtree. Forget the bindings.
unbind(node, &m_documentNodeToIdMap);
- ContainerNode* parent = node->isShadowRoot() ? node->shadowHost() : node->parentNode();
+ ContainerNode* parent = node->parentNode();
int parentId = m_documentNodeToIdMap.get(parent);
// Return if parent is not mapped yet.
if (!parentId)
return;
- if (node->isShadowRoot()) {
- RefPtr<InspectorObject> value = buildObjectForNode(node, 0, &m_documentNodeToIdMap);
- m_frontend->shadowRootUpdated(parentId, value.release());
- return;
- }
if (!m_childrenRequested.contains(parentId)) {
// No children are mapped yet -> only notify on changes of hasChildren.
m_frontend->childNodeCountUpdated(parentId, innerChildNodeCount(parent));
@@ -1291,7 +1282,7 @@
if (isWhitespace(node))
return;
- ContainerNode* parent = node->isShadowRoot() ? node->shadowHost() : node->parentNode();
+ ContainerNode* parent = node->parentNode();
int parentId = m_documentNodeToIdMap.get(parent);
// If parent is not mapped yet -> ignore the event.
if (!parentId)
@@ -1300,9 +1291,7 @@
if (m_domListener)
m_domListener->didRemoveDOMNode(node);
- if (node->isShadowRoot())
- m_frontend->shadowRootUpdated(parentId, 0);
- else if (!m_childrenRequested.contains(parentId)) {
+ if (!m_childrenRequested.contains(parentId)) {
// No children are mapped yet -> only notify on changes of hasChildren.
if (innerChildNodeCount(parent) == 1)
m_frontend->childNodeCountUpdated(parentId, 0);
@@ -1451,15 +1440,6 @@
DOMNodeHighlighter::DrawNodeHighlight(context, m_highlightedNode.get(), mode);
}
-bool InspectorDOMAgent::isContainerNode(const Node& node)
-{
- Node::NodeType type = node.nodeType();
- return type == Node::ELEMENT_NODE
- || type == Node::DOCUMENT_NODE
- || type == Node::DOCUMENT_FRAGMENT_NODE
- || type == Node::SHADOW_ROOT_NODE;
-}
-
} // namespace WebCore
#endif // ENABLE(INSPECTOR)
« no previous file with comments | « Source/WebCore/inspector/InspectorDOMAgent.h ('k') | Source/WebCore/inspector/front-end/DOMAgent.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698