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

Unified Diff: Source/core/editing/MarkupAccumulator.h

Issue 1148633010: Refactoring: Separate MarkupAccumulator into MarkupFormatter and MarkupAccumulator (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/editing/MarkupAccumulator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/MarkupAccumulator.h
diff --git a/Source/core/editing/MarkupAccumulator.h b/Source/core/editing/MarkupAccumulator.h
index 11630f843065f146eb2b0c6f16d5c128348894b5..7767522b986256d96ba808ee96af4e560ca2c53e 100644
--- a/Source/core/editing/MarkupAccumulator.h
+++ b/Source/core/editing/MarkupAccumulator.h
@@ -27,6 +27,7 @@
#define MarkupAccumulator_h
#include "core/editing/EditingStrategy.h"
+#include "core/editing/MarkupFormatter.h"
#include "core/editing/markup.h"
#include "wtf/HashMap.h"
#include "wtf/Vector.h"
@@ -39,37 +40,10 @@ class DocumentType;
class Element;
class Node;
-typedef HashMap<AtomicString, AtomicString> Namespaces;
-
-enum EntityMask {
- EntityAmp = 0x0001,
- EntityLt = 0x0002,
- EntityGt = 0x0004,
- EntityQuot = 0x0008,
- EntityNbsp = 0x0010,
-
- // Non-breaking space needs to be escaped in innerHTML for compatibility reason. See http://trac.webkit.org/changeset/32879
- // However, we cannot do this in a XML document because it does not have the entity reference defined (See the bug 19215).
- EntityMaskInCDATA = 0,
- EntityMaskInPCDATA = EntityAmp | EntityLt | EntityGt,
- EntityMaskInHTMLPCDATA = EntityMaskInPCDATA | EntityNbsp,
- EntityMaskInAttributeValue = EntityAmp | EntityQuot | EntityLt | EntityGt,
- EntityMaskInHTMLAttributeValue = EntityAmp | EntityQuot | EntityNbsp,
-};
-
-enum class SerializationType {
- AsOwnerDocument,
- ForcedXML
-};
-
class MarkupAccumulator {
WTF_MAKE_NONCOPYABLE(MarkupAccumulator);
STACK_ALLOCATED();
public:
- static void appendComment(StringBuilder&, const String&);
- static void appendCharactersReplacingEntities(StringBuilder&, const String&, unsigned, unsigned, EntityMask);
- static size_t totalLength(const Vector<String>&);
-
MarkupAccumulator(EAbsoluteURLs, SerializationType = SerializationType::AsOwnerDocument);
virtual ~MarkupAccumulator();
@@ -106,12 +80,8 @@ public:
bool shouldSelfClose(const Element&) const;
private:
- String resolveURLIfNeeded(const Element&, const String&) const;
- void appendQuotedURLAttributeValue(StringBuilder&, const Element&, const Attribute&);
-
+ MarkupFormatter m_formatter;
StringBuilder m_markup;
- const EAbsoluteURLs m_resolveURLsMethod;
- SerializationType m_serializationType;
};
template<typename Strategy>
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/editing/MarkupAccumulator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698