| Index: Source/core/editing/StyledMarkupSerializer.cpp
|
| diff --git a/Source/core/editing/StyledMarkupSerializer.cpp b/Source/core/editing/StyledMarkupSerializer.cpp
|
| index 504f1e95fe01b1f47623e00eea6c9a05dc836999..aba1d8fc7c0dce76e4fb4f464f188a1d845048cd 100644
|
| --- a/Source/core/editing/StyledMarkupSerializer.cpp
|
| +++ b/Source/core/editing/StyledMarkupSerializer.cpp
|
| @@ -297,16 +297,30 @@ Node* StyledMarkupSerializer<Strategy>::traverseNodesForSerialization(Node* star
|
| }
|
|
|
| template<typename Strategy>
|
| +bool StyledMarkupSerializer<Strategy>::needsInlineStyle(const Element& element)
|
| +{
|
| + if (!element.isHTMLElement())
|
| + return false;
|
| + if (m_shouldAnnotate == AnnotateForInterchange)
|
| + return true;
|
| + return convertBlocksToInlines() && isBlock(&element);
|
| +}
|
| +
|
| +template<typename Strategy>
|
| void StyledMarkupSerializer<Strategy>::wrapWithNode(StyledMarkupAccumulator& accumulator, ContainerNode& node, PassRefPtrWillBeRawPtr<EditingStyle> style)
|
| {
|
| StringBuilder markup;
|
| - if (node.isElementNode())
|
| - accumulator.appendElement(markup, toElement(node), convertBlocksToInlines() && isBlock(&node), style);
|
| - else
|
| + if (!node.isElementNode()) {
|
| accumulator.appendStartMarkup(markup, node);
|
| - accumulator.pushMarkup(markup.toString());
|
| - if (!node.isElementNode())
|
| + accumulator.pushMarkup(markup.toString());
|
| return;
|
| + }
|
| + Element& element = toElement(node);
|
| + if (accumulator.shouldApplyWrappingStyle(element) || needsInlineStyle(element))
|
| + accumulator.appendElementWithInlineStyle(markup, element, style);
|
| + else
|
| + accumulator.appendElement(markup, element);
|
| + accumulator.pushMarkup(markup.toString());
|
| accumulator.appendEndTag(toElement(node));
|
| }
|
|
|
|
|