| 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 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1691 } | 1691 } |
| 1692 | 1692 |
| 1693 bool InspectorDOMAgent::isWhitespace(Node* node) | 1693 bool InspectorDOMAgent::isWhitespace(Node* node) |
| 1694 { | 1694 { |
| 1695 //TODO: pull ignoreWhitespace setting from the frontend and use here. | 1695 //TODO: pull ignoreWhitespace setting from the frontend and use here. |
| 1696 return node && node->nodeType() == Node::TEXT_NODE && node->nodeValue().stri
pWhiteSpace().length() == 0; | 1696 return node && node->nodeType() == Node::TEXT_NODE && node->nodeValue().stri
pWhiteSpace().length() == 0; |
| 1697 } | 1697 } |
| 1698 | 1698 |
| 1699 void InspectorDOMAgent::domContentLoadedEventFired(Frame* frame) | 1699 void InspectorDOMAgent::domContentLoadedEventFired(Frame* frame) |
| 1700 { | 1700 { |
| 1701 if (frame->page()->mainFrame() != frame) | 1701 if (!frame->isMainFrame()) |
| 1702 return; | 1702 return; |
| 1703 | 1703 |
| 1704 // Re-push document once it is loaded. | 1704 // Re-push document once it is loaded. |
| 1705 discardFrontendBindings(); | 1705 discardFrontendBindings(); |
| 1706 if (m_state->getBoolean(DOMAgentState::documentRequested)) | 1706 if (m_state->getBoolean(DOMAgentState::documentRequested)) |
| 1707 m_frontend->documentUpdated(); | 1707 m_frontend->documentUpdated(); |
| 1708 } | 1708 } |
| 1709 | 1709 |
| 1710 void InspectorDOMAgent::invalidateFrameOwnerElement(Frame* frame) | 1710 void InspectorDOMAgent::invalidateFrameOwnerElement(Frame* frame) |
| 1711 { | 1711 { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1723 unbind(frameOwner, &m_documentNodeToIdMap); | 1723 unbind(frameOwner, &m_documentNodeToIdMap); |
| 1724 | 1724 |
| 1725 RefPtr<TypeBuilder::DOM::Node> value = buildObjectForNode(frameOwner, 0, &m_
documentNodeToIdMap); | 1725 RefPtr<TypeBuilder::DOM::Node> value = buildObjectForNode(frameOwner, 0, &m_
documentNodeToIdMap); |
| 1726 Node* previousSibling = innerPreviousSibling(frameOwner); | 1726 Node* previousSibling = innerPreviousSibling(frameOwner); |
| 1727 int prevId = previousSibling ? m_documentNodeToIdMap.get(previousSibling) :
0; | 1727 int prevId = previousSibling ? m_documentNodeToIdMap.get(previousSibling) :
0; |
| 1728 m_frontend->childNodeInserted(parentId, prevId, value.release()); | 1728 m_frontend->childNodeInserted(parentId, prevId, value.release()); |
| 1729 } | 1729 } |
| 1730 | 1730 |
| 1731 void InspectorDOMAgent::didCommitLoad(Frame* frame, DocumentLoader* loader) | 1731 void InspectorDOMAgent::didCommitLoad(Frame* frame, DocumentLoader* loader) |
| 1732 { | 1732 { |
| 1733 // FIXME: If "frame" is always guarenteed to be in the same Page as loader->
frame() |
| 1734 // then all we need to check here is loader->frame()->isMainFrame() |
| 1735 // and we don't need "frame" at all. |
| 1733 Frame* mainFrame = frame->page()->mainFrame(); | 1736 Frame* mainFrame = frame->page()->mainFrame(); |
| 1734 if (loader->frame() != mainFrame) { | 1737 if (loader->frame() != mainFrame) { |
| 1735 invalidateFrameOwnerElement(loader->frame()); | 1738 invalidateFrameOwnerElement(loader->frame()); |
| 1736 return; | 1739 return; |
| 1737 } | 1740 } |
| 1738 | 1741 |
| 1739 setDocument(mainFrame->document()); | 1742 setDocument(mainFrame->document()); |
| 1740 } | 1743 } |
| 1741 | 1744 |
| 1742 void InspectorDOMAgent::didInsertDOMNode(Node* node) | 1745 void InspectorDOMAgent::didInsertDOMNode(Node* node) |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2037 if (!m_documentNodeToIdMap.contains(m_document)) { | 2040 if (!m_documentNodeToIdMap.contains(m_document)) { |
| 2038 RefPtr<TypeBuilder::DOM::Node> root; | 2041 RefPtr<TypeBuilder::DOM::Node> root; |
| 2039 getDocument(errorString, root); | 2042 getDocument(errorString, root); |
| 2040 return errorString->isEmpty(); | 2043 return errorString->isEmpty(); |
| 2041 } | 2044 } |
| 2042 return true; | 2045 return true; |
| 2043 } | 2046 } |
| 2044 | 2047 |
| 2045 } // namespace WebCore | 2048 } // namespace WebCore |
| 2046 | 2049 |
| OLD | NEW |