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

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

Issue 1165833002: Refactoring: Move StyledMarkupSerializer::m_reversedPrecedingMarkup to StyledMarkupAccumulator (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 7 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 | « no previous file | Source/core/editing/StyledMarkupAccumulator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/StyledMarkupAccumulator.h
diff --git a/Source/core/editing/StyledMarkupAccumulator.h b/Source/core/editing/StyledMarkupAccumulator.h
index cfddc1bfe0f8faebde516a7a0f02acc0abb5acb6..29a22b0f213f59610bd7fdd81442befa28f4c581 100644
--- a/Source/core/editing/StyledMarkupAccumulator.h
+++ b/Source/core/editing/StyledMarkupAccumulator.h
@@ -46,17 +46,13 @@ class StyledMarkupAccumulator final {
public:
enum RangeFullySelectsNode { DoesFullySelectNode, DoesNotFullySelectNode };
- StyledMarkupAccumulator(EAbsoluteURLs, const TextOffset& start, const TextOffset& end, const PassRefPtrWillBeRawPtr<Document>, EAnnotateForInterchange, Node*);
+ StyledMarkupAccumulator(EAbsoluteURLs, const TextOffset& start, const TextOffset& end, const PassRefPtrWillBeRawPtr<Document>, EAnnotateForInterchange, Node*, ConvertBlocksToInlines);
+
+ bool convertBlocksToInlines() const { return m_convertBlocksToInlines == ConvertBlocksToInlines::Convert; }
void appendString(const String&);
void appendStartTag(Node&);
void appendEndTag(const Element&);
- void appendStartMarkup(StringBuilder&, Node&);
- void appendEndMarkup(StringBuilder&, const Element&);
-
- void appendElement(StringBuilder&, Element&);
- void appendElement(StringBuilder&, Element&, bool, RangeFullySelectsNode);
- void appendStyleNodeOpenTag(StringBuilder&, StylePropertySet*, bool isBlock = false);
// TODO(hajimehoshi): These functions are called from the serializer, but
// should not.
@@ -64,8 +60,9 @@ public:
void setHighestNodeToBeSerialized(Node* highestNodeToBeSerialized) { m_highestNodeToBeSerialized = highestNodeToBeSerialized; }
void setWrappingStyle(PassRefPtrWillBeRawPtr<EditingStyle> wrappingStyle) { m_wrappingStyle = wrappingStyle; }
- size_t length() const { return m_accumulator.length(); }
- void concatenateMarkup(StringBuilder&) const;
+ void wrapWithNode(ContainerNode&, RangeFullySelectsNode = DoesFullySelectNode);
+ void wrapWithStyleNode(StylePropertySet*, bool isBlock = false);
+ String takeResults();
private:
void appendText(StringBuilder&, Text&);
@@ -77,13 +74,21 @@ private:
bool shouldAnnotate() const;
+ void appendElement(StringBuilder&, Element&);
+ void appendElement(StringBuilder&, Element&, bool, RangeFullySelectsNode);
+ void appendStartMarkup(StringBuilder&, Node&);
+ void appendEndMarkup(StringBuilder&, const Element&);
+ void appendStyleNodeOpenTag(StringBuilder&, StylePropertySet*, bool isBlock = false);
+
MarkupAccumulator m_accumulator;
const TextOffset m_start;
const TextOffset m_end;
const RefPtrWillBeMember<Document> m_document;
const EAnnotateForInterchange m_shouldAnnotate;
+ const ConvertBlocksToInlines m_convertBlocksToInlines;
RawPtrWillBeMember<Node> m_highestNodeToBeSerialized;
RefPtrWillBeMember<EditingStyle> m_wrappingStyle;
+ Vector<String> m_reversedPrecedingMarkup;
};
} // namespace blink
« no previous file with comments | « no previous file | Source/core/editing/StyledMarkupAccumulator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698