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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 result.append(' '); | 379 result.append(' '); |
380 result.append(data); | 380 result.append(data); |
381 result.appendLiteral("?>"); | 381 result.appendLiteral("?>"); |
382 } | 382 } |
383 | 383 |
384 void MarkupAccumulator::appendElement(StringBuilder& result, Element& element, N
amespaces* namespaces) | 384 void MarkupAccumulator::appendElement(StringBuilder& result, Element& element, N
amespaces* namespaces) |
385 { | 385 { |
386 appendOpenTag(result, element, namespaces); | 386 appendOpenTag(result, element, namespaces); |
387 | 387 |
388 if (element.hasAttributes()) { | 388 if (element.hasAttributes()) { |
389 AttributeIteratorAccessor attributes = element.attributesIterator(); | 389 AttributeCollection attributes = element.attributes(); |
390 AttributeConstIterator end = attributes.end(); | 390 AttributeCollection::const_iterator end = attributes.end(); |
391 for (AttributeConstIterator it = attributes.begin(); it != end; ++it) | 391 for (AttributeCollection::const_iterator it = attributes.begin(); it !=
end; ++it) |
392 appendAttribute(result, element, **it, namespaces); | 392 appendAttribute(result, element, *it, namespaces); |
393 } | 393 } |
394 | 394 |
395 // Give an opportunity to subclasses to add their own attributes. | 395 // Give an opportunity to subclasses to add their own attributes. |
396 appendCustomAttributes(result, element, namespaces); | 396 appendCustomAttributes(result, element, namespaces); |
397 | 397 |
398 appendCloseTag(result, element); | 398 appendCloseTag(result, element); |
399 } | 399 } |
400 | 400 |
401 static String nodeNamePreservingCase(const Element& element) | 401 static String nodeNamePreservingCase(const Element& element) |
402 { | 402 { |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 } | 561 } |
562 | 562 |
563 bool MarkupAccumulator::serializeAsHTMLDocument(const Node& node) const | 563 bool MarkupAccumulator::serializeAsHTMLDocument(const Node& node) const |
564 { | 564 { |
565 if (m_serializationType == ForcedXML) | 565 if (m_serializationType == ForcedXML) |
566 return false; | 566 return false; |
567 return node.document().isHTMLDocument(); | 567 return node.document().isHTMLDocument(); |
568 } | 568 } |
569 | 569 |
570 } | 570 } |
OLD | NEW |