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 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 if (m_revalidateStyleAttrTask) | 536 if (m_revalidateStyleAttrTask) |
537 m_revalidateStyleAttrTask->reset(); | 537 m_revalidateStyleAttrTask->reset(); |
538 } | 538 } |
539 | 539 |
540 void InspectorDOMAgent::discardBackendBindings() | 540 void InspectorDOMAgent::discardBackendBindings() |
541 { | 541 { |
542 m_backendIdToNode.clear(); | 542 m_backendIdToNode.clear(); |
543 m_nodeGroupToBackendIdMap.clear(); | 543 m_nodeGroupToBackendIdMap.clear(); |
544 } | 544 } |
545 | 545 |
546 int InspectorDOMAgent::pushNodeToFrontend(ErrorString* errorString, int document
NodeId, Node* nodeToPush) | |
547 { | |
548 Document* document = assertDocument(errorString, documentNodeId); | |
549 if (!document) | |
550 return 0; | |
551 if (nodeToPush->document() != document) { | |
552 *errorString = "Node is not part of the document with given id"; | |
553 return 0; | |
554 } | |
555 | |
556 return pushNodePathToFrontend(nodeToPush); | |
557 } | |
558 | |
559 Node* InspectorDOMAgent::nodeForId(int id) | 546 Node* InspectorDOMAgent::nodeForId(int id) |
560 { | 547 { |
561 if (!id) | 548 if (!id) |
562 return 0; | 549 return 0; |
563 | 550 |
564 HashMap<int, Node*>::iterator it = m_idToNode.find(id); | 551 HashMap<int, Node*>::iterator it = m_idToNode.find(id); |
565 if (it != m_idToNode.end()) | 552 if (it != m_idToNode.end()) |
566 return it->value; | 553 return it->value; |
567 return 0; | 554 return 0; |
568 } | 555 } |
(...skipping 1546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2115 if (!m_documentNodeToIdMap.contains(m_document)) { | 2102 if (!m_documentNodeToIdMap.contains(m_document)) { |
2116 RefPtr<TypeBuilder::DOM::Node> root; | 2103 RefPtr<TypeBuilder::DOM::Node> root; |
2117 getDocument(errorString, root); | 2104 getDocument(errorString, root); |
2118 return errorString->isEmpty(); | 2105 return errorString->isEmpty(); |
2119 } | 2106 } |
2120 return true; | 2107 return true; |
2121 } | 2108 } |
2122 | 2109 |
2123 } // namespace WebCore | 2110 } // namespace WebCore |
2124 | 2111 |
OLD | NEW |