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

Unified Diff: Source/core/editing/StyledMarkupAccumulator.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/StyledMarkupAccumulator.h ('k') | Source/core/editing/StyledMarkupSerializer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/StyledMarkupAccumulator.cpp
diff --git a/Source/core/editing/StyledMarkupAccumulator.cpp b/Source/core/editing/StyledMarkupAccumulator.cpp
index a4496f6efe65f489376710645441bc4c0fea2117..e0d76a74aff50c15136289a1df774818b0790541 100644
--- a/Source/core/editing/StyledMarkupAccumulator.cpp
+++ b/Source/core/editing/StyledMarkupAccumulator.cpp
@@ -143,15 +143,15 @@ void StyledMarkupAccumulator::appendText(StringBuilder& out, Text& text)
void StyledMarkupAccumulator::appendElement(StringBuilder& out, Element& element, Namespaces*)
{
- appendElement(out, element, false, DoesFullySelectNode);
+ appendElement(out, element, AddDisplayInline::DoesNotAdd, RangeFullySelectsNode::DoesSelect);
}
-void StyledMarkupAccumulator::appendElement(StringBuilder& out, Element& element, bool addDisplayInline, StyledMarkupAccumulator::RangeFullySelectsNode rangeFullySelectsNode)
+void StyledMarkupAccumulator::appendElement(StringBuilder& out, Element& element, AddDisplayInline addDisplayInline, RangeFullySelectsNode rangeFullySelectsNode)
{
const bool documentIsHTML = element.document().isHTMLDocument();
m_accumulator.appendOpenTag(out, element, 0);
- const bool shouldAnnotateOrForceInline = element.isHTMLElement() && (shouldAnnotate() || addDisplayInline);
+ const bool shouldAnnotateOrForceInline = element.isHTMLElement() && (shouldAnnotate() || addDisplayInline == AddDisplayInline::DoesAdd);
const bool shouldOverrideStyleAttr = shouldAnnotateOrForceInline || shouldApplyWrappingStyle(element);
AttributeCollection attributes = element.attributes();
@@ -180,12 +180,12 @@ void StyledMarkupAccumulator::appendElement(StringBuilder& out, Element& element
if (shouldAnnotate())
newInlineStyle->mergeStyleFromRulesForSerialization(&toHTMLElement(element));
- if (addDisplayInline)
+ if (addDisplayInline == AddDisplayInline::DoesAdd)
newInlineStyle->forceInline();
// If the node is not fully selected by the range, then we don't want to keep styles that affect its relationship to the nodes around it
// only the ones that affect it and the nodes within it.
- if (rangeFullySelectsNode == DoesNotFullySelectNode && newInlineStyle->style())
+ if (rangeFullySelectsNode == RangeFullySelectsNode::DoesNotSelect && newInlineStyle->style())
newInlineStyle->style()->removeProperty(CSSPropertyFloat);
}
@@ -199,11 +199,11 @@ void StyledMarkupAccumulator::appendElement(StringBuilder& out, Element& element
m_accumulator.appendCloseTag(out, element);
}
-void StyledMarkupAccumulator::appendStyleNodeOpenTag(StringBuilder& out, StylePropertySet* style, bool isBlock)
+void StyledMarkupAccumulator::appendStyleNodeOpenTag(StringBuilder& out, StylePropertySet* style, StyleTagType isBlock)
{
// wrappingStyleForSerialization should have removed -webkit-text-decorations-in-effect
ASSERT(propertyMissingOrEqualToNone(style, CSSPropertyWebkitTextDecorationsInEffect));
- if (isBlock)
+ if (isBlock == StyleTagType::Block)
out.appendLiteral("<div style=\"");
else
out.appendLiteral("<span style=\"");
« no previous file with comments | « Source/core/editing/StyledMarkupAccumulator.h ('k') | Source/core/editing/StyledMarkupSerializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698