Index: Source/core/editing/ReplaceSelectionCommand.cpp |
diff --git a/Source/core/editing/ReplaceSelectionCommand.cpp b/Source/core/editing/ReplaceSelectionCommand.cpp |
index a37b659fc389f78aa393df244524464cb1451f4a..3980379427ed3f56d5633071b8aca6f6f1b0b343 100644 |
--- a/Source/core/editing/ReplaceSelectionCommand.cpp |
+++ b/Source/core/editing/ReplaceSelectionCommand.cpp |
@@ -53,6 +53,7 @@ |
#include "core/html/HTMLElement.h" |
#include "core/html/HTMLInputElement.h" |
#include "core/html/HTMLLIElement.h" |
+#include "core/html/HTMLSpanElement.h" |
#include "core/rendering/RenderObject.h" |
#include "core/rendering/RenderText.h" |
#include "wtf/StdLibExtras.h" |
@@ -498,10 +499,9 @@ void ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline(Insert |
if (newInlineStyle->conflictsWithImplicitStyleOfElement(htmlElement)) { |
// e.g. <b style="font-weight: normal;"> is converted to <span style="font-weight: normal;"> |
- node = replaceElementWithSpanPreservingChildrenAndAttributes(htmlElement); |
- element = toElement(node); |
+ element = replaceElementWithSpanPreservingChildrenAndAttributes(htmlElement); |
inlineStyle = element->inlineStyle(); |
- insertedNodes.didReplaceNode(*htmlElement, *node); |
+ insertedNodes.didReplaceNode(*htmlElement, *element); |
} else if (newInlineStyle->extractConflictingImplicitStyleOfAttributes(htmlElement, EditingStyle::PreserveWritingDirection, 0, attributes, |
EditingStyle::DoNotExtractMatchingStyle)) { |
// e.g. <font size="3" style="font-size: 20px;"> is converted to <font style="font-size: 20px;"> |