Index: Source/core/editing/ApplyStyleCommand.cpp |
diff --git a/Source/core/editing/ApplyStyleCommand.cpp b/Source/core/editing/ApplyStyleCommand.cpp |
index 6638f846bd1182d0e3c0efa2753ab91210b6a1d4..d06b74d87e3c4ba5a0de518b45bf2f4b23b6cdb6 100644 |
--- a/Source/core/editing/ApplyStyleCommand.cpp |
+++ b/Source/core/editing/ApplyStyleCommand.cpp |
@@ -265,8 +265,9 @@ void ApplyStyleCommand::applyBlockStyle(EditingStyle *style) |
StyleChange styleChange(style, paragraphStart.deepEquivalent()); |
if (styleChange.cssStyle().length() || m_removeOnly) { |
RefPtrWillBeRawPtr<Node> block = enclosingBlock(paragraphStart.deepEquivalent().deprecatedNode()); |
- if (!m_removeOnly) { |
- RefPtrWillBeRawPtr<Element> newBlock = moveParagraphContentsToNewBlockIfNecessary(paragraphStart.deepEquivalent()); |
+ const Position& paragraphStartToMove = paragraphStart.deepEquivalent(); |
+ if (!m_removeOnly && isEditablePosition(paragraphStartToMove)) { |
+ RefPtrWillBeRawPtr<Element> newBlock = moveParagraphContentsToNewBlockIfNecessary(paragraphStartToMove); |
if (newBlock) |
block = newBlock; |
} |