Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: Source/core/editing/MarkupFormatter.h

Issue 1161463008: Refactoring: Have StyledMarkupAccumulator use MarkupFormatter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 static void appendComment(StringBuilder&, const String&); 72 static void appendComment(StringBuilder&, const String&);
73 static void appendDocumentType(StringBuilder&, const DocumentType&); 73 static void appendDocumentType(StringBuilder&, const DocumentType&);
74 static void appendNamespace(StringBuilder&, const AtomicString& prefix, cons t AtomicString& namespaceURI, Namespaces&); 74 static void appendNamespace(StringBuilder&, const AtomicString& prefix, cons t AtomicString& namespaceURI, Namespaces&);
75 static void appendProcessingInstruction(StringBuilder&, const String& target , const String& data); 75 static void appendProcessingInstruction(StringBuilder&, const String& target , const String& data);
76 static void appendXMLDeclaration(StringBuilder&, const Document&); 76 static void appendXMLDeclaration(StringBuilder&, const Document&);
77 static size_t totalLength(const Vector<String>&); 77 static size_t totalLength(const Vector<String>&);
78 78
79 MarkupFormatter(EAbsoluteURLs, SerializationType = SerializationType::AsOwne rDocument); 79 MarkupFormatter(EAbsoluteURLs, SerializationType = SerializationType::AsOwne rDocument);
80 ~MarkupFormatter(); 80 ~MarkupFormatter();
81 81
82 void appendStartMarkup(StringBuilder&, const Node&, Namespaces*);
82 void appendEndMarkup(StringBuilder&, const Element&); 83 void appendEndMarkup(StringBuilder&, const Element&);
83 84
84 bool serializeAsHTMLDocument(const Node&) const; 85 bool serializeAsHTMLDocument(const Node&) const;
85 86
86 void appendText(StringBuilder&, Text&); 87 void appendText(StringBuilder&, Text&);
87 void appendOpenTag(StringBuilder&, const Element&, Namespaces*); 88 void appendOpenTag(StringBuilder&, const Element&, Namespaces*);
88 void appendCloseTag(StringBuilder&, const Element&); 89 void appendCloseTag(StringBuilder&, const Element&);
89 void appendAttribute(StringBuilder&, const Element&, const Attribute&, Names paces*); 90 void appendAttribute(StringBuilder&, const Element&, const Attribute&, Names paces*);
90 91
91 bool shouldAddNamespaceElement(const Element&, Namespaces&) const; 92 bool shouldAddNamespaceElement(const Element&, Namespaces&) const;
92 bool shouldAddNamespaceAttribute(const Attribute&, const Element&) const; 93 bool shouldAddNamespaceAttribute(const Attribute&, const Element&) const;
93 EntityMask entityMaskForText(const Text&) const; 94 EntityMask entityMaskForText(const Text&) const;
94 bool shouldSelfClose(const Element&) const; 95 bool shouldSelfClose(const Element&) const;
95 96
96 private: 97 private:
97 String resolveURLIfNeeded(const Element&, const String&) const; 98 String resolveURLIfNeeded(const Element&, const String&) const;
98 void appendQuotedURLAttributeValue(StringBuilder&, const Element&, const Att ribute&); 99 void appendQuotedURLAttributeValue(StringBuilder&, const Element&, const Att ribute&);
99 100
100 const EAbsoluteURLs m_resolveURLsMethod; 101 const EAbsoluteURLs m_resolveURLsMethod;
101 SerializationType m_serializationType; 102 SerializationType m_serializationType;
102 }; 103 };
103 104
104 } 105 }
105 106
106 #endif 107 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698