| 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 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 DOMPatchSupport domPatchSupport(m_domEditor.get(), *m_document.get()); | 804 DOMPatchSupport domPatchSupport(m_domEditor.get(), *m_document.get()); |
| 805 domPatchSupport.patchDocument(outerHTML); | 805 domPatchSupport.patchDocument(outerHTML); |
| 806 return; | 806 return; |
| 807 } | 807 } |
| 808 | 808 |
| 809 Node* node = assertEditableNode(errorString, nodeId); | 809 Node* node = assertEditableNode(errorString, nodeId); |
| 810 if (!node) | 810 if (!node) |
| 811 return; | 811 return; |
| 812 | 812 |
| 813 Document* document = node->isDocumentNode() ? toDocument(node) : node->owner
Document(); | 813 Document* document = node->isDocumentNode() ? toDocument(node) : node->owner
Document(); |
| 814 if (!document || (!document->isHTMLDocument() && !document->isXHTMLDocument(
) && !document->isSVGDocument())) { | 814 if (!document || (!document->isHTMLDocument() && !document->isXMLDocument())
) { |
| 815 *errorString = "Not an HTML/XML document"; | 815 *errorString = "Not an HTML/XML document"; |
| 816 return; | 816 return; |
| 817 } | 817 } |
| 818 | 818 |
| 819 Node* newNode = 0; | 819 Node* newNode = 0; |
| 820 if (!m_domEditor->setOuterHTML(node, outerHTML, &newNode, errorString)) | 820 if (!m_domEditor->setOuterHTML(node, outerHTML, &newNode, errorString)) |
| 821 return; | 821 return; |
| 822 | 822 |
| 823 if (!newNode) { | 823 if (!newNode) { |
| 824 // The only child node has been deleted. | 824 // The only child node has been deleted. |
| (...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2028 if (!m_documentNodeToIdMap.contains(m_document)) { | 2028 if (!m_documentNodeToIdMap.contains(m_document)) { |
| 2029 RefPtr<TypeBuilder::DOM::Node> root; | 2029 RefPtr<TypeBuilder::DOM::Node> root; |
| 2030 getDocument(errorString, root); | 2030 getDocument(errorString, root); |
| 2031 return errorString->isEmpty(); | 2031 return errorString->isEmpty(); |
| 2032 } | 2032 } |
| 2033 return true; | 2033 return true; |
| 2034 } | 2034 } |
| 2035 | 2035 |
| 2036 } // namespace WebCore | 2036 } // namespace WebCore |
| 2037 | 2037 |
| OLD | NEW |