While we added support for true deep-expansion with https://bugs.webkit.org/show_bug.cgi?id=66868, there is (at least) one case where this fails. In InspectorDOMAgent::pushChildNodesToFrontend(), if we find that we'd already requested children for the given node, we return early: if (m_childrenRequested.contains(nodeId)) return; This could easily happen for the <body> or <html> elements, or basically any element that you inspect directly to open the inspector.
<rdar://problem/13260224>
Created attachment 189445 [details] Work-in-progress patch, no tests yet.
Comment on attachment 189445 [details] Work-in-progress patch, no tests yet. View in context: https://bugs.webkit.org/attachment.cgi?id=189445&action=review > Source/WebCore/inspector/InspectorDOMAgent.cpp:453 > + node = node->firstChild(); for (node = innerFirstChild(node); node; node = innerNextSibling(node)) { ... > Source/WebCore/inspector/InspectorDOMAgent.cpp:455 > + nodeId = m_documentNodeToIdMap.get(node); Dangling nodes (the ones printed with console.log(document)) will end up with nodes being a part of another NodeToIdMap instance. m_idToNodesMap knows which map to use. Please do not reuse nodeId, this one is about child node. childNodeId > Source/WebCore/inspector/InspectorDOMAgent.cpp:456 > + if (nodeId) Should be an assertion. We know that m_childrenRequested.contains(nodeId). Hence we've sent its children.
(In reply to comment #3) > (From update of attachment 189445 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=189445&action=review > > > Source/WebCore/inspector/InspectorDOMAgent.cpp:455 > > + nodeId = m_documentNodeToIdMap.get(node); > > Dangling nodes (the ones printed with console.log(document)) will end up with nodes being a part of another NodeToIdMap instance. m_idToNodesMap knows which map to use. Should I simply move the `NodeToIdMap* nodeMap = m_idToNodesMap.get(nodeId);` call to before I enter the `m_childrenRequested.contains(nodeId)` condition and used this nodeMap to get the childNodeId?
Created attachment 190216 [details] Patch
Comment on attachment 190216 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=190216&action=review > Source/WebCore/inspector/InspectorDOMAgent.cpp:457 > + childNodeId = nodeMap->get(node); you never use childNodeId outside for scope - declare it inline.
(In reply to comment #6) > (From update of attachment 190216 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=190216&action=review > > > Source/WebCore/inspector/InspectorDOMAgent.cpp:457 > > + childNodeId = nodeMap->get(node); > > you never use childNodeId outside for scope - declare it inline. Made the change in commit. Thanks for the review Pavel.
Landed in http://trac.webkit.org/changeset/144057.