Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(908)

Unified Diff: Source/core/editing/ApplyStyleCommand.cpp

Issue 335773002: Don't move uneditable paragraph contents in CompositeEditCommand::moveParagraphContentsToNewBlockIfN (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2014-06-16T12:44:07 Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}

Powered by Google App Engine
This is Rietveld 408576698