| Index: Source/core/editing/StyledMarkupSerializer.cpp
|
| diff --git a/Source/core/editing/StyledMarkupSerializer.cpp b/Source/core/editing/StyledMarkupSerializer.cpp
|
| index aba1d8fc7c0dce76e4fb4f464f188a1d845048cd..4b10abcb39f8d0ee3cb0fed86f596222c00ed9ad 100644
|
| --- a/Source/core/editing/StyledMarkupSerializer.cpp
|
| +++ b/Source/core/editing/StyledMarkupSerializer.cpp
|
| @@ -310,11 +310,13 @@ template<typename Strategy>
|
| void StyledMarkupSerializer<Strategy>::wrapWithNode(StyledMarkupAccumulator& accumulator, ContainerNode& node, PassRefPtrWillBeRawPtr<EditingStyle> style)
|
| {
|
| StringBuilder markup;
|
| - if (!node.isElementNode()) {
|
| - accumulator.appendStartMarkup(markup, node);
|
| + if (node.isDocumentNode()) {
|
| + MarkupFormatter::appendXMLDeclaration(markup, toDocument(node));
|
| accumulator.pushMarkup(markup.toString());
|
| return;
|
| }
|
| + if (!node.isElementNode())
|
| + return;
|
| Element& element = toElement(node);
|
| if (accumulator.shouldApplyWrappingStyle(element) || needsInlineStyle(element))
|
| accumulator.appendElementWithInlineStyle(markup, element, style);
|
|
|