| 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);
|
|
|