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 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |