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

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

Issue 1159033006: Refactoring: Replace boolean parameters with enum classes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rename values 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 | « 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 79b958b7b3271f10bf5d2267eae84bfd7f04a10e..d243adc2ea931856594ff4601e50589144468903 100644
--- a/Source/core/editing/StyledMarkupSerializer.cpp
+++ b/Source/core/editing/StyledMarkupSerializer.cpp
@@ -47,11 +47,11 @@ namespace blink {
namespace {
-const String& styleNodeCloseTag(bool isBlock)
+const String& styleNodeCloseTag(StyleTagType isBlock)
{
DEFINE_STATIC_LOCAL(const String, divClose, ("</div>"));
DEFINE_STATIC_LOCAL(const String, styleSpanClose, ("</span>"));
- return isBlock ? divClose : styleSpanClose;
+ return isBlock == StyleTagType::Block ? divClose : styleSpanClose;
}
template<typename PositionType>
@@ -176,12 +176,12 @@ String StyledMarkupSerializer<Strategy>::createMarkup()
fullySelectedRootStyle->style()->setProperty(CSSPropertyTextDecoration, CSSValueNone);
if (!propertyMissingOrEqualToNone(fullySelectedRootStyle->style(), CSSPropertyWebkitTextDecorationsInEffect))
fullySelectedRootStyle->style()->setProperty(CSSPropertyWebkitTextDecorationsInEffect, CSSValueNone);
- wrapWithStyleNode(fullySelectedRootStyle->style(), true);
+ wrapWithStyleNode(fullySelectedRootStyle->style(), StyleTagType::Block);
}
} else {
// Since this node and all the other ancestors are not in the selection we want to set RangeFullySelectsNode to DoesNotFullySelectNode
// so that styles that affect the exterior of the node are not included.
- wrapWithNode(*ancestor, StyledMarkupAccumulator::DoesNotFullySelectNode);
+ wrapWithNode(*ancestor, RangeFullySelectsNode::DoesNotSelect);
}
if (ancestor == m_highestNodeToBeSerialized)
@@ -197,20 +197,22 @@ String StyledMarkupSerializer<Strategy>::createMarkup()
}
template<typename Strategy>
-void StyledMarkupSerializer<Strategy>::wrapWithNode(ContainerNode& node, typename StyledMarkupAccumulator::RangeFullySelectsNode rangeFullySelectsNode)
+void StyledMarkupSerializer<Strategy>::wrapWithNode(ContainerNode& node, RangeFullySelectsNode rangeFullySelectsNode)
{
StringBuilder markup;
- if (node.isElementNode())
- m_markupAccumulator.appendElement(markup, toElement(node), convertBlocksToInlines() && isBlock(&node), rangeFullySelectsNode);
- else
+ if (node.isElementNode()) {
+ AddDisplayInline addDisplayInline = convertBlocksToInlines() && isBlock(&node) ? AddDisplayInline::DoesAdd : AddDisplayInline::DoesNotAdd;
+ m_markupAccumulator.appendElement(markup, toElement(node), addDisplayInline, rangeFullySelectsNode);
+ } else {
m_markupAccumulator.appendStartMarkup(markup, node, 0);
+ }
m_reversedPrecedingMarkup.append(markup.toString());
if (node.isElementNode())
m_markupAccumulator.appendEndTag(toElement(node));
}
template<typename Strategy>
-void StyledMarkupSerializer<Strategy>::wrapWithStyleNode(StylePropertySet* style, bool isBlock)
+void StyledMarkupSerializer<Strategy>::wrapWithStyleNode(StylePropertySet* style, StyleTagType isBlock)
{
StringBuilder openTag;
m_markupAccumulator.appendStyleNodeOpenTag(openTag, style, isBlock);
« 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