| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 String serializeNodes(Node& targetNode, EChildrenOnly, Vector<QualifiedName>
* tagNamesToSkip = 0); | 72 String serializeNodes(Node& targetNode, EChildrenOnly, Vector<QualifiedName>
* tagNamesToSkip = 0); |
| 73 | 73 |
| 74 static void appendComment(StringBuilder&, const String&); | 74 static void appendComment(StringBuilder&, const String&); |
| 75 | 75 |
| 76 static void appendCharactersReplacingEntities(StringBuilder&, const String&,
unsigned, unsigned, EntityMask); | 76 static void appendCharactersReplacingEntities(StringBuilder&, const String&,
unsigned, unsigned, EntityMask); |
| 77 | 77 |
| 78 protected: | 78 protected: |
| 79 void appendString(const String&); | 79 void appendString(const String&); |
| 80 void appendStartTag(Node&, Namespaces* = 0); | 80 void appendStartTag(Node&, Namespaces* = 0); |
| 81 virtual void appendEndTag(const Node&); | 81 virtual void appendEndTag(const Element&); |
| 82 static size_t totalLength(const Vector<String>&); | 82 static size_t totalLength(const Vector<String>&); |
| 83 size_t length() const { return m_markup.length(); } | 83 size_t length() const { return m_markup.length(); } |
| 84 void concatenateMarkup(StringBuilder&); | 84 void concatenateMarkup(StringBuilder&); |
| 85 void appendAttributeValue(StringBuilder&, const String&, bool); | 85 void appendAttributeValue(StringBuilder&, const String&, bool); |
| 86 virtual void appendCustomAttributes(StringBuilder&, const Element&, Namespac
es*); | 86 virtual void appendCustomAttributes(StringBuilder&, const Element&, Namespac
es*); |
| 87 bool shouldAddNamespaceElement(const Element&, Namespaces&); | 87 bool shouldAddNamespaceElement(const Element&, Namespaces&); |
| 88 bool shouldAddNamespaceAttribute(const Attribute&, const Element&); | 88 bool shouldAddNamespaceAttribute(const Attribute&, const Element&); |
| 89 | 89 |
| 90 void appendNamespace(StringBuilder&, const AtomicString& prefix, const Atomi
cString& namespaceURI, Namespaces&); | 90 void appendNamespace(StringBuilder&, const AtomicString& prefix, const Atomi
cString& namespaceURI, Namespaces&); |
| 91 EntityMask entityMaskForText(const Text&) const; | 91 EntityMask entityMaskForText(const Text&) const; |
| 92 virtual void appendText(StringBuilder&, Text&); | 92 virtual void appendText(StringBuilder&, Text&); |
| 93 void appendXMLDeclaration(StringBuilder&, const Document&); | 93 void appendXMLDeclaration(StringBuilder&, const Document&); |
| 94 void appendDocumentType(StringBuilder&, const DocumentType&); | 94 void appendDocumentType(StringBuilder&, const DocumentType&); |
| 95 void appendProcessingInstruction(StringBuilder&, const String& target, const
String& data); | 95 void appendProcessingInstruction(StringBuilder&, const String& target, const
String& data); |
| 96 virtual void appendElement(StringBuilder&, Element&, Namespaces*); | 96 virtual void appendElement(StringBuilder&, Element&, Namespaces*); |
| 97 void appendOpenTag(StringBuilder&, const Element&, Namespaces*); | 97 void appendOpenTag(StringBuilder&, const Element&, Namespaces*); |
| 98 void appendCloseTag(StringBuilder&, const Element&); | 98 void appendCloseTag(StringBuilder&, const Element&); |
| 99 void appendAttribute(StringBuilder&, const Element&, const Attribute&, Names
paces*); | 99 void appendAttribute(StringBuilder&, const Element&, const Attribute&, Names
paces*); |
| 100 void appendCDATASection(StringBuilder&, const String&); | 100 void appendCDATASection(StringBuilder&, const String&); |
| 101 void appendStartMarkup(StringBuilder&, Node&, Namespaces*); | 101 void appendStartMarkup(StringBuilder&, Node&, Namespaces*); |
| 102 bool shouldSelfClose(const Node&); | 102 bool shouldSelfClose(const Element&); |
| 103 bool elementCannotHaveEndTag(const Node&); | 103 bool elementCannotHaveEndTag(const Node&); |
| 104 void appendEndMarkup(StringBuilder&, const Node&); | 104 void appendEndMarkup(StringBuilder&, const Element&); |
| 105 | 105 |
| 106 RawPtrWillBeMember<WillBeHeapVector<RawPtrWillBeMember<Node> > > const m_nod
es; | 106 RawPtrWillBeMember<WillBeHeapVector<RawPtrWillBeMember<Node> > > const m_nod
es; |
| 107 RawPtrWillBeMember<const Range> const m_range; | 107 RawPtrWillBeMember<const Range> const m_range; |
| 108 | 108 |
| 109 private: | 109 private: |
| 110 String resolveURLIfNeeded(const Element&, const String&) const; | 110 String resolveURLIfNeeded(const Element&, const String&) const; |
| 111 void appendQuotedURLAttributeValue(StringBuilder&, const Element&, const Att
ribute&); | 111 void appendQuotedURLAttributeValue(StringBuilder&, const Element&, const Att
ribute&); |
| 112 void serializeNodesWithNamespaces(Node& targetNode, EChildrenOnly, const Nam
espaces*, Vector<QualifiedName>* tagNamesToSkip); | 112 void serializeNodesWithNamespaces(Node& targetNode, EChildrenOnly, const Nam
espaces*, Vector<QualifiedName>* tagNamesToSkip); |
| 113 bool serializeAsHTMLDocument(const Node&) const; | 113 bool serializeAsHTMLDocument(const Node&) const; |
| 114 | 114 |
| 115 StringBuilder m_markup; | 115 StringBuilder m_markup; |
| 116 const EAbsoluteURLs m_resolveURLsMethod; | 116 const EAbsoluteURLs m_resolveURLsMethod; |
| 117 SerializationType m_serializationType; | 117 SerializationType m_serializationType; |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 } | 120 } |
| 121 | 121 |
| 122 #endif | 122 #endif |
| OLD | NEW |