| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights
reserved. |
| 3 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. | 3 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 if (!(offset + length)) | 90 if (!(offset + length)) |
| 91 return; | 91 return; |
| 92 | 92 |
| 93 ASSERT(offset + length <= source.length()); | 93 ASSERT(offset + length <= source.length()); |
| 94 if (source.is8Bit()) | 94 if (source.is8Bit()) |
| 95 appendCharactersReplacingEntitiesInternal(result, source.characters8() +
offset, length, entityMaps, WTF_ARRAY_LENGTH(entityMaps), entityMask); | 95 appendCharactersReplacingEntitiesInternal(result, source.characters8() +
offset, length, entityMaps, WTF_ARRAY_LENGTH(entityMaps), entityMask); |
| 96 else | 96 else |
| 97 appendCharactersReplacingEntitiesInternal(result, source.characters16()
+ offset, length, entityMaps, WTF_ARRAY_LENGTH(entityMaps), entityMask); | 97 appendCharactersReplacingEntitiesInternal(result, source.characters16()
+ offset, length, entityMaps, WTF_ARRAY_LENGTH(entityMaps), entityMask); |
| 98 } | 98 } |
| 99 | 99 |
| 100 size_t MarkupFormatter::totalLength(const Vector<String>& strings) | |
| 101 { | |
| 102 size_t length = 0; | |
| 103 for (const auto& string : strings) | |
| 104 length += string.length(); | |
| 105 return length; | |
| 106 } | |
| 107 | |
| 108 MarkupFormatter::MarkupFormatter(EAbsoluteURLs resolveUrlsMethod, SerializationT
ype serializationType) | 100 MarkupFormatter::MarkupFormatter(EAbsoluteURLs resolveUrlsMethod, SerializationT
ype serializationType) |
| 109 : m_resolveURLsMethod(resolveUrlsMethod) | 101 : m_resolveURLsMethod(resolveUrlsMethod) |
| 110 , m_serializationType(serializationType) | 102 , m_serializationType(serializationType) |
| 111 { | 103 { |
| 112 } | 104 } |
| 113 | 105 |
| 114 MarkupFormatter::~MarkupFormatter() | 106 MarkupFormatter::~MarkupFormatter() |
| 115 { | 107 { |
| 116 } | 108 } |
| 117 | 109 |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 } | 460 } |
| 469 | 461 |
| 470 bool MarkupFormatter::serializeAsHTMLDocument(const Node& node) const | 462 bool MarkupFormatter::serializeAsHTMLDocument(const Node& node) const |
| 471 { | 463 { |
| 472 if (m_serializationType == SerializationType::ForcedXML) | 464 if (m_serializationType == SerializationType::ForcedXML) |
| 473 return false; | 465 return false; |
| 474 return node.document().isHTMLDocument(); | 466 return node.document().isHTMLDocument(); |
| 475 } | 467 } |
| 476 | 468 |
| 477 } | 469 } |
| OLD | NEW |