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 AttributeCollection attributes = element.attributes(); | 388 AttributeCollection attributes = element.attributes(); |
389 AttributeCollection::const_iterator end = attributes.end(); | 389 AttributeCollection::iterator end = attributes.end(); |
390 for (AttributeCollection::const_iterator it = attributes.begin(); it != end;
++it) | 390 for (AttributeCollection::iterator it = attributes.begin(); it != end; ++it) |
391 appendAttribute(result, element, *it, namespaces); | 391 appendAttribute(result, element, *it, namespaces); |
392 | 392 |
393 // Give an opportunity to subclasses to add their own attributes. | 393 // Give an opportunity to subclasses to add their own attributes. |
394 appendCustomAttributes(result, element, namespaces); | 394 appendCustomAttributes(result, element, namespaces); |
395 | 395 |
396 appendCloseTag(result, element); | 396 appendCloseTag(result, element); |
397 } | 397 } |
398 | 398 |
399 void MarkupAccumulator::appendOpenTag(StringBuilder& result, const Element& elem
ent, Namespaces* namespaces) | 399 void MarkupAccumulator::appendOpenTag(StringBuilder& result, const Element& elem
ent, Namespaces* namespaces) |
400 { | 400 { |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 } | 558 } |
559 | 559 |
560 bool MarkupAccumulator::serializeAsHTMLDocument(const Node& node) const | 560 bool MarkupAccumulator::serializeAsHTMLDocument(const Node& node) const |
561 { | 561 { |
562 if (m_serializationType == ForcedXML) | 562 if (m_serializationType == ForcedXML) |
563 return false; | 563 return false; |
564 return node.document().isHTMLDocument(); | 564 return node.document().isHTMLDocument(); |
565 } | 565 } |
566 | 566 |
567 } | 567 } |
OLD | NEW |