| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 newDocument = XMLDocument::createSVG(); | 89 newDocument = XMLDocument::createSVG(); |
| 90 else if (document().isXHTMLDocument()) | 90 else if (document().isXHTMLDocument()) |
| 91 newDocument = XMLDocument::createXHTML(); | 91 newDocument = XMLDocument::createXHTML(); |
| 92 else if (document().isXMLDocument()) | 92 else if (document().isXMLDocument()) |
| 93 newDocument = XMLDocument::create(); | 93 newDocument = XMLDocument::create(); |
| 94 | 94 |
| 95 ASSERT(newDocument); | 95 ASSERT(newDocument); |
| 96 newDocument->setContextFeatures(document().contextFeatures()); | 96 newDocument->setContextFeatures(document().contextFeatures()); |
| 97 if (!document().isHTMLDocument()) { | 97 if (!document().isHTMLDocument()) { |
| 98 RefPtrWillBeRawPtr<DocumentParser> parser = XMLDocumentParser::create(*n
ewDocument, nullptr); | 98 RefPtrWillBeRawPtr<DocumentParser> parser = XMLDocumentParser::create(*n
ewDocument, nullptr); |
| 99 parser->pinToMainThread(); | |
| 100 parser->append(markup.impl()); | 99 parser->append(markup.impl()); |
| 101 parser->finish(); | 100 parser->finish(); |
| 102 parser->detach(); | 101 parser->detach(); |
| 103 | 102 |
| 104 // Avoid breakage on non-well-formed documents. | 103 // Avoid breakage on non-well-formed documents. |
| 105 if (!static_cast<XMLDocumentParser*>(parser.get())->wellFormed()) | 104 if (!static_cast<XMLDocumentParser*>(parser.get())->wellFormed()) |
| 106 return; | 105 return; |
| 107 } | 106 } |
| 108 newDocument->setContent(markup); | 107 newDocument->setContent(markup); |
| 109 OwnPtr<Digest> oldInfo = createDigest(document().documentElement(), 0); | 108 OwnPtr<Digest> oldInfo = createDigest(document().documentElement(), 0); |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 void DOMPatchSupport::dumpMap(const ResultMap& map, const String& name) | 510 void DOMPatchSupport::dumpMap(const ResultMap& map, const String& name) |
| 512 { | 511 { |
| 513 fprintf(stderr, "\n\n"); | 512 fprintf(stderr, "\n\n"); |
| 514 for (size_t i = 0; i < map.size(); ++i) | 513 for (size_t i = 0; i < map.size(); ++i) |
| 515 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 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); |
| 516 } | 515 } |
| 517 #endif | 516 #endif |
| 518 | 517 |
| 519 } // namespace blink | 518 } // namespace blink |
| 520 | 519 |
| OLD | NEW |