Fix DCM-1341
authorMichał Pakuła vel Rutka <m.pakula@samsung.com>
Sun, 28 Apr 2013 15:36:19 +0000 (17:36 +0200)
committerMateusz Leszko <m.leszko@samsung.com>
Tue, 7 May 2013 08:49:06 +0000 (10:49 +0200)
This is a quick fix for a bug DCM-1341 where new paragraph was not
created on contenteditable area with image and text nodes inside
span tag.

Change-Id: I83708d2e816b86a722555729c7348d394917b98f

Conflicts:

Source/WTF/wtf/Platform.h

Source/WTF/wtf/Platform.h
Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp

index 968ed6f..2925e2f 100644 (file)
 #define ENABLE_TIZEN_DRAW_SCALED_PATTERN 1 /* Kyungjin Kim(gen.kim@samsung.com) : Scale image prior to draw it's pattern to enhance performance */
 #define ENABLE_TIZEN_PAINT_SELECTION_ANTIALIAS_NONE 1 /* Hyeonji Kim(hyeonji.kim@samsung.com) : Remove the line between the preceding text block and the next text block which are selected */
 #define ENABLE_TIZEN_USE_SETTINGS_FONT 1 /* Hyeonji Kim(hyeonji.kim@samsung.com) : When font-family is "Tizen", use system's setting font as default font-family */
+#define ENABLE_TIZEN_PARAGRAPH_SEPARATOR_FIX 1 /* Michal Pakula (m.pakula@samsung.com) : This is a quick fix for a bug where new paragraph was not created on contenteditable area with image and text nodes inside span tag */
 #define ENABLE_TIZEN_CONTENT_EDITABLE_BACKSPACE 1 /* Wojciech Bielawski(w.bielawski.com) : This is a quick fix for a bug where after pressing backspace image was moved not correctly */
 
 #if ENABLE(TEXT_AUTOSIZING)
index 10f5889..8996868 100644 (file)
@@ -361,7 +361,12 @@ void InsertParagraphSeparatorCommand::doApply()
     // Move the start node and the siblings of the start node.
     if (VisiblePosition(insertionPosition) != VisiblePosition(positionBeforeNode(blockToInsert.get()))) {
         Node* n;
+#if ENABLE(TIZEN_PARAGRAPH_SEPARATOR_FIX)
+        if (insertionPosition.containerNode() == startBlock
+           || (insertionPosition.containerNode()->parentNode() && insertionPosition.containerNode()->hasChildNodes() && insertionPosition.containerNode()->parentNode() == startBlock))
+#else
         if (insertionPosition.containerNode() == startBlock)
+#endif
             n = insertionPosition.computeNodeAfterPosition();
         else {
             Node* splitTo = insertionPosition.containerNode();