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

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-13T05:31:16 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 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;
}

Powered by Google App Engine
This is Rietveld 408576698