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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 : m_nodes(nodes) | 104 : m_nodes(nodes) |
105 , m_range(range) | 105 , m_range(range) |
106 , m_resolveURLsMethod(resolveUrlsMethod) | 106 , m_resolveURLsMethod(resolveUrlsMethod) |
107 { | 107 { |
108 } | 108 } |
109 | 109 |
110 MarkupAccumulator::~MarkupAccumulator() | 110 MarkupAccumulator::~MarkupAccumulator() |
111 { | 111 { |
112 } | 112 } |
113 | 113 |
114 String MarkupAccumulator::serializeNodes(Node* targetNode, EChildrenOnly childre
nOnly) | |
115 { | |
116 return serializeNodes(targetNode, childrenOnly, 0); | |
117 } | |
118 | |
119 String MarkupAccumulator::serializeNodes(Node* targetNode, EChildrenOnly childre
nOnly, Vector<QualifiedName>* tagNamesToSkip) | 114 String MarkupAccumulator::serializeNodes(Node* targetNode, EChildrenOnly childre
nOnly, Vector<QualifiedName>* tagNamesToSkip) |
120 { | 115 { |
121 serializeNodesWithNamespaces(targetNode, childrenOnly, 0, tagNamesToSkip); | 116 serializeNodesWithNamespaces(targetNode, childrenOnly, 0, tagNamesToSkip); |
122 return m_markup.toString(); | 117 return m_markup.toString(); |
123 } | 118 } |
124 | 119 |
125 void MarkupAccumulator::serializeNodesWithNamespaces(Node* targetNode, EChildren
Only childrenOnly, const Namespaces* namespaces, Vector<QualifiedName>* tagNames
ToSkip) | 120 void MarkupAccumulator::serializeNodesWithNamespaces(Node* targetNode, EChildren
Only childrenOnly, const Namespaces* namespaces, Vector<QualifiedName>* tagNames
ToSkip) |
126 { | 121 { |
127 if (tagNamesToSkip) { | 122 if (tagNamesToSkip) { |
128 for (size_t i = 0; i < tagNamesToSkip->size(); ++i) { | 123 for (size_t i = 0; i < tagNamesToSkip->size(); ++i) { |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 if (!node->isElementNode() || shouldSelfClose(node) || (!node->hasChildNodes
() && elementCannotHaveEndTag(node))) | 543 if (!node->isElementNode() || shouldSelfClose(node) || (!node->hasChildNodes
() && elementCannotHaveEndTag(node))) |
549 return; | 544 return; |
550 | 545 |
551 result.append('<'); | 546 result.append('<'); |
552 result.append('/'); | 547 result.append('/'); |
553 result.append(toElement(node)->nodeNamePreservingCase()); | 548 result.append(toElement(node)->nodeNamePreservingCase()); |
554 result.append('>'); | 549 result.append('>'); |
555 } | 550 } |
556 | 551 |
557 } | 552 } |
OLD | NEW |