Index: Source/core/editing/ApplyStyleCommand.cpp |
diff --git a/Source/core/editing/ApplyStyleCommand.cpp b/Source/core/editing/ApplyStyleCommand.cpp |
index 847f85f3c853d8301ae8c9359d166750d1bf33e0..1ba9ec84ef58cbb153b9bad74e83d074cae8be0f 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; |
} |