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

Unified Diff: Source/core/editing/StyledMarkupSerializer.cpp

Issue 1184303002: Refactoring: Introduce StyledMarkupSerializer::shouldAnnotate() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/editing/StyledMarkupSerializer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/StyledMarkupSerializer.cpp
diff --git a/Source/core/editing/StyledMarkupSerializer.cpp b/Source/core/editing/StyledMarkupSerializer.cpp
index 4b10abcb39f8d0ee3cb0fed86f596222c00ed9ad..71363895718ed27610c085bbaecf662566bc5941 100644
--- a/Source/core/editing/StyledMarkupSerializer.cpp
+++ b/Source/core/editing/StyledMarkupSerializer.cpp
@@ -124,7 +124,7 @@ String StyledMarkupSerializer<Strategy>::createMarkup()
Node* firstNode = m_start.nodeAsRangeFirstNode();
VisiblePosition visibleStart(toPositionInDOMTree(m_start), VP_DEFAULT_AFFINITY);
VisiblePosition visibleEnd(toPositionInDOMTree(m_end), VP_DEFAULT_AFFINITY);
- if (m_shouldAnnotate == AnnotateForInterchange && needInterchangeNewlineAfter(visibleStart)) {
+ if (shouldAnnotate() && needInterchangeNewlineAfter(visibleStart)) {
markupAccumulator.appendInterchangeNewline();
if (visibleStart == visibleEnd.previous())
return markupAccumulator.takeResults();
@@ -188,7 +188,7 @@ String StyledMarkupSerializer<Strategy>::createMarkup()
}
// FIXME: The interchange newline should be placed in the block that it's in, not after all of the content, unconditionally.
- if (m_shouldAnnotate == AnnotateForInterchange && needInterchangeNewlineAt(visibleEnd))
+ if (shouldAnnotate() && needInterchangeNewlineAt(visibleEnd))
markupAccumulator.appendInterchangeNewline();
return markupAccumulator.takeResults();
@@ -204,8 +204,7 @@ Node* StyledMarkupSerializer<Strategy>::serializeNodes(Node* startNode, Node* pa
Node* highestNodeToBeSerialized = markupAccumulator->highestNodeToBeSerialized();
if (highestNodeToBeSerialized && Strategy::parent(*highestNodeToBeSerialized)) {
- bool shouldAnnotate = m_shouldAnnotate == AnnotateForInterchange;
- RefPtrWillBeRawPtr<EditingStyle> wrappingStyle = EditingStyle::wrappingStyleForSerialization(Strategy::parent(*highestNodeToBeSerialized), shouldAnnotate);
+ RefPtrWillBeRawPtr<EditingStyle> wrappingStyle = EditingStyle::wrappingStyleForSerialization(Strategy::parent(*highestNodeToBeSerialized), shouldAnnotate());
markupAccumulator->setWrappingStyle(wrappingStyle.release());
}
return traverseNodesForSerialization(startNode, pastEnd, markupAccumulator);
@@ -301,7 +300,7 @@ bool StyledMarkupSerializer<Strategy>::needsInlineStyle(const Element& element)
{
if (!element.isHTMLElement())
return false;
- if (m_shouldAnnotate == AnnotateForInterchange)
+ if (shouldAnnotate())
return true;
return convertBlocksToInlines() && isBlock(&element);
}
« no previous file with comments | « Source/core/editing/StyledMarkupSerializer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698