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

Side by Side Diff: Source/core/inspector/InspectorDOMAgent.cpp

Issue 23453033: Have DOMPatchSupport and DocumentFragment deal with Document references (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/inspector/DOMPatchSupport.cpp ('k') | Source/core/inspector/InspectorPageAgent.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 Node* node = assertNode(errorString, nodeId); 779 Node* node = assertNode(errorString, nodeId);
780 if (!node) 780 if (!node)
781 return; 781 return;
782 782
783 *outerHTML = createMarkup(node); 783 *outerHTML = createMarkup(node);
784 } 784 }
785 785
786 void InspectorDOMAgent::setOuterHTML(ErrorString* errorString, int nodeId, const String& outerHTML) 786 void InspectorDOMAgent::setOuterHTML(ErrorString* errorString, int nodeId, const String& outerHTML)
787 { 787 {
788 if (!nodeId) { 788 if (!nodeId) {
789 DOMPatchSupport domPatchSupport(m_domEditor.get(), m_document.get()); 789 ASSERT(m_document);
790 DOMPatchSupport domPatchSupport(m_domEditor.get(), *m_document.get());
790 domPatchSupport.patchDocument(outerHTML); 791 domPatchSupport.patchDocument(outerHTML);
791 return; 792 return;
792 } 793 }
793 794
794 Node* node = assertEditableNode(errorString, nodeId); 795 Node* node = assertEditableNode(errorString, nodeId);
795 if (!node) 796 if (!node)
796 return; 797 return;
797 798
798 Document* document = node->isDocumentNode() ? toDocument(node) : node->owner Document(); 799 Document* document = node->isDocumentNode() ? toDocument(node) : node->owner Document();
799 if (!document || (!document->isHTMLDocument() && !document->isXHTMLDocument( ) && !document->isSVGDocument())) { 800 if (!document || (!document->isHTMLDocument() && !document->isXHTMLDocument( ) && !document->isSVGDocument())) {
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1900 1901
1901 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(m ainWorldScriptState(frame)); 1902 InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(m ainWorldScriptState(frame));
1902 if (injectedScript.hasNoValue()) 1903 if (injectedScript.hasNoValue())
1903 return 0; 1904 return 0;
1904 1905
1905 return injectedScript.wrapNode(node, objectGroup); 1906 return injectedScript.wrapNode(node, objectGroup);
1906 } 1907 }
1907 1908
1908 } // namespace WebCore 1909 } // namespace WebCore
1909 1910
OLDNEW
« no previous file with comments | « Source/core/inspector/DOMPatchSupport.cpp ('k') | Source/core/inspector/InspectorPageAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698