| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 DOMPatchSupport patchSupport(&domEditor, document); | 75 DOMPatchSupport patchSupport(&domEditor, document); |
| 76 patchSupport.patchDocument(markup); | 76 patchSupport.patchDocument(markup); |
| 77 } | 77 } |
| 78 | 78 |
| 79 DOMPatchSupport::DOMPatchSupport(DOMEditor* domEditor, Document& document) | 79 DOMPatchSupport::DOMPatchSupport(DOMEditor* domEditor, Document& document) |
| 80 : m_domEditor(domEditor) | 80 : m_domEditor(domEditor) |
| 81 , m_document(document) | 81 , m_document(document) |
| 82 { | 82 { |
| 83 } | 83 } |
| 84 | 84 |
| 85 DOMPatchSupport::~DOMPatchSupport() { } | |
| 86 | |
| 87 void DOMPatchSupport::patchDocument(const String& markup) | 85 void DOMPatchSupport::patchDocument(const String& markup) |
| 88 { | 86 { |
| 89 RefPtr<Document> newDocument; | 87 RefPtr<Document> newDocument; |
| 90 if (m_document.isHTMLDocument()) | 88 if (m_document.isHTMLDocument()) |
| 91 newDocument = HTMLDocument::create(); | 89 newDocument = HTMLDocument::create(); |
| 92 else if (m_document.isXHTMLDocument()) | 90 else if (m_document.isXHTMLDocument()) |
| 93 newDocument = HTMLDocument::createXHTML(); | 91 newDocument = HTMLDocument::createXHTML(); |
| 94 else if (m_document.isSVGDocument()) | 92 else if (m_document.isSVGDocument()) |
| 95 newDocument = Document::create(); | 93 newDocument = Document::create(); |
| 96 | 94 |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 void DOMPatchSupport::dumpMap(const ResultMap& map, const String& name) | 507 void DOMPatchSupport::dumpMap(const ResultMap& map, const String& name) |
| 510 { | 508 { |
| 511 fprintf(stderr, "\n\n"); | 509 fprintf(stderr, "\n\n"); |
| 512 for (size_t i = 0; i < map.size(); ++i) | 510 for (size_t i = 0; i < map.size(); ++i) |
| 513 fprintf(stderr, "%s[%lu]: %s (%p) - [%lu]\n", name.utf8().data(), i, map
[i].first ? nodeName(map[i].first->m_node).utf8().data() : "", map[i].first, map
[i].second); | 511 fprintf(stderr, "%s[%lu]: %s (%p) - [%lu]\n", name.utf8().data(), i, map
[i].first ? nodeName(map[i].first->m_node).utf8().data() : "", map[i].first, map
[i].second); |
| 514 } | 512 } |
| 515 #endif | 513 #endif |
| 516 | 514 |
| 517 } // namespace WebCore | 515 } // namespace WebCore |
| 518 | 516 |
| OLD | NEW |