OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1358 void InspectorDOMAgent::loadEventFired(Document* document) | 1358 void InspectorDOMAgent::loadEventFired(Document* document) |
1359 { | 1359 { |
1360 Element* frameOwner = document->ownerElement(); | 1360 Element* frameOwner = document->ownerElement(); |
1361 if (!frameOwner) | 1361 if (!frameOwner) |
1362 return; | 1362 return; |
1363 | 1363 |
1364 int frameOwnerId = m_documentNodeToIdMap.get(frameOwner); | 1364 int frameOwnerId = m_documentNodeToIdMap.get(frameOwner); |
1365 if (!frameOwnerId) | 1365 if (!frameOwnerId) |
1366 return; | 1366 return; |
1367 | 1367 |
1368 if (!m_childrenRequested.contains(frameOwnerId)) { | 1368 // Re-add frame owner element together with its new children. |
1369 // No children are mapped yet -> only notify on changes of hasChildren. | 1369 int parentId = m_documentNodeToIdMap.get(innerParentNode(frameOwner)); |
1370 m_frontend->childNodeCountUpdated(frameOwnerId, innerChildNodeCount(fram
eOwner)); | 1370 m_frontend->childNodeRemoved(parentId, frameOwnerId); |
1371 } else { | 1371 unbind(frameOwner, &m_documentNodeToIdMap); |
1372 // Re-add frame owner element together with its new children. | 1372 RefPtr<InspectorObject> value = buildObjectForNode(frameOwner, 0, &m_documen
tNodeToIdMap); |
1373 int parentId = m_documentNodeToIdMap.get(innerParentNode(frameOwner)); | 1373 Node* previousSibling = innerPreviousSibling(frameOwner); |
1374 m_frontend->childNodeRemoved(parentId, frameOwnerId); | 1374 int prevId = previousSibling ? m_documentNodeToIdMap.get(previousSibling) :
0; |
1375 RefPtr<InspectorObject> value = buildObjectForNode(frameOwner, 0, &m_doc
umentNodeToIdMap); | 1375 m_frontend->childNodeInserted(parentId, prevId, value.release()); |
1376 Node* previousSibling = innerPreviousSibling(frameOwner); | |
1377 int prevId = previousSibling ? m_documentNodeToIdMap.get(previousSibling
) : 0; | |
1378 m_frontend->childNodeInserted(parentId, prevId, value.release()); | |
1379 // Invalidate children requested flag for the element. | |
1380 m_childrenRequested.remove(m_childrenRequested.find(frameOwnerId)); | |
1381 } | |
1382 } | 1376 } |
1383 | 1377 |
1384 void InspectorDOMAgent::didInsertDOMNode(Node* node) | 1378 void InspectorDOMAgent::didInsertDOMNode(Node* node) |
1385 { | 1379 { |
1386 if (isWhitespace(node)) | 1380 if (isWhitespace(node)) |
1387 return; | 1381 return; |
1388 | 1382 |
1389 // We could be attaching existing subtree. Forget the bindings. | 1383 // We could be attaching existing subtree. Forget the bindings. |
1390 unbind(node, &m_documentNodeToIdMap); | 1384 unbind(node, &m_documentNodeToIdMap); |
1391 | 1385 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1581 { | 1575 { |
1582 if (!m_highlightData) | 1576 if (!m_highlightData) |
1583 return; | 1577 return; |
1584 | 1578 |
1585 DOMNodeHighlighter::getHighlight(m_highlightData->node ? m_highlightData->no
de->document() : m_document.get(), m_highlightData.get(), highlight); | 1579 DOMNodeHighlighter::getHighlight(m_highlightData->node ? m_highlightData->no
de->document() : m_document.get(), m_highlightData.get(), highlight); |
1586 } | 1580 } |
1587 | 1581 |
1588 } // namespace WebCore | 1582 } // namespace WebCore |
1589 | 1583 |
1590 #endif // ENABLE(INSPECTOR) | 1584 #endif // ENABLE(INSPECTOR) |
OLD | NEW |