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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 } | 132 } |
133 | 133 |
134 Namespaces namespaceHash; | 134 Namespaces namespaceHash; |
135 if (namespaces) | 135 if (namespaces) |
136 namespaceHash = *namespaces; | 136 namespaceHash = *namespaces; |
137 | 137 |
138 if (!childrenOnly) | 138 if (!childrenOnly) |
139 appendStartTag(targetNode, &namespaceHash); | 139 appendStartTag(targetNode, &namespaceHash); |
140 | 140 |
141 if (!(serializeAsHTMLDocument(targetNode) && elementCannotHaveEndTag(targetN
ode))) { | 141 if (!(serializeAsHTMLDocument(targetNode) && elementCannotHaveEndTag(targetN
ode))) { |
142 Node* current = targetNode.hasTagName(templateTag) ? toHTMLTemplateEleme
nt(targetNode).content()->firstChild() : targetNode.firstChild(); | 142 Node* current = isHTMLTemplateElement(targetNode) ? toHTMLTemplateElemen
t(targetNode).content()->firstChild() : targetNode.firstChild(); |
143 for ( ; current; current = current->nextSibling()) | 143 for ( ; current; current = current->nextSibling()) |
144 serializeNodesWithNamespaces(*current, IncludeNode, &namespaceHash,
tagNamesToSkip); | 144 serializeNodesWithNamespaces(*current, IncludeNode, &namespaceHash,
tagNamesToSkip); |
145 } | 145 } |
146 | 146 |
147 if (!childrenOnly) | 147 if (!childrenOnly) |
148 appendEndTag(targetNode); | 148 appendEndTag(targetNode); |
149 } | 149 } |
150 | 150 |
151 String MarkupAccumulator::resolveURLIfNeeded(const Element& element, const Strin
g& urlString) const | 151 String MarkupAccumulator::resolveURLIfNeeded(const Element& element, const Strin
g& urlString) const |
152 { | 152 { |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 } | 550 } |
551 | 551 |
552 bool MarkupAccumulator::serializeAsHTMLDocument(const Node& node) const | 552 bool MarkupAccumulator::serializeAsHTMLDocument(const Node& node) const |
553 { | 553 { |
554 if (m_serializationType == ForcedXML) | 554 if (m_serializationType == ForcedXML) |
555 return false; | 555 return false; |
556 return node.document().isHTMLDocument(); | 556 return node.document().isHTMLDocument(); |
557 } | 557 } |
558 | 558 |
559 } | 559 } |
OLD | NEW |