| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 public: | 46 public: |
| 47 MarkupAccumulator(EAbsoluteURLs, SerializationType = SerializationType::AsOw
nerDocument); | 47 MarkupAccumulator(EAbsoluteURLs, SerializationType = SerializationType::AsOw
nerDocument); |
| 48 virtual ~MarkupAccumulator(); | 48 virtual ~MarkupAccumulator(); |
| 49 | 49 |
| 50 void appendString(const String&); | 50 void appendString(const String&); |
| 51 virtual void appendStartTag(Node&, Namespaces* = nullptr); | 51 virtual void appendStartTag(Node&, Namespaces* = nullptr); |
| 52 virtual void appendEndTag(const Element&); | 52 virtual void appendEndTag(const Element&); |
| 53 void appendStartMarkup(StringBuilder&, Node&, Namespaces*); | 53 void appendStartMarkup(StringBuilder&, Node&, Namespaces*); |
| 54 void appendEndMarkup(StringBuilder&, const Element&); | 54 void appendEndMarkup(StringBuilder&, const Element&); |
| 55 | 55 |
| 56 size_t length() const { return m_markup.length(); } | |
| 57 void concatenateMarkup(StringBuilder&) const; | |
| 58 | |
| 59 bool serializeAsHTMLDocument(const Node&) const; | 56 bool serializeAsHTMLDocument(const Node&) const; |
| 60 String toString() { return m_markup.toString(); } | 57 String toString() { return m_markup.toString(); } |
| 61 | 58 |
| 62 virtual void appendCustomAttributes(StringBuilder&, const Element&, Namespac
es*); | 59 virtual void appendCustomAttributes(StringBuilder&, const Element&, Namespac
es*); |
| 63 | 60 |
| 64 virtual void appendText(StringBuilder&, Text&); | 61 virtual void appendText(StringBuilder&, Text&); |
| 65 virtual bool shouldIgnoreAttribute(const Attribute&); | 62 virtual bool shouldIgnoreAttribute(const Attribute&); |
| 66 virtual void appendElement(StringBuilder&, Element&, Namespaces*); | 63 virtual void appendElement(StringBuilder&, Element&, Namespaces*); |
| 67 void appendOpenTag(StringBuilder&, const Element&, Namespaces*); | 64 void appendOpenTag(StringBuilder&, const Element&, Namespaces*); |
| 68 void appendCloseTag(StringBuilder&, const Element&); | 65 void appendCloseTag(StringBuilder&, const Element&); |
| 69 void appendAttribute(StringBuilder&, const Element&, const Attribute&, Names
paces*); | 66 void appendAttribute(StringBuilder&, const Element&, const Attribute&, Names
paces*); |
| 70 | 67 |
| 71 EntityMask entityMaskForText(const Text&) const; | 68 EntityMask entityMaskForText(const Text&) const; |
| 72 | 69 |
| 73 private: | 70 private: |
| 74 MarkupFormatter m_formatter; | 71 MarkupFormatter m_formatter; |
| 75 StringBuilder m_markup; | 72 StringBuilder m_markup; |
| 76 }; | 73 }; |
| 77 | 74 |
| 78 template<typename Strategy> | 75 template<typename Strategy> |
| 79 String serializeNodes(MarkupAccumulator&, Node&, EChildrenOnly); | 76 String serializeNodes(MarkupAccumulator&, Node&, EChildrenOnly); |
| 80 | 77 |
| 81 extern template String serializeNodes<EditingStrategy>(MarkupAccumulator&, Node&
, EChildrenOnly); | 78 extern template String serializeNodes<EditingStrategy>(MarkupAccumulator&, Node&
, EChildrenOnly); |
| 82 | 79 |
| 83 } | 80 } |
| 84 | 81 |
| 85 #endif | 82 #endif |
| OLD | NEW |