Cancel composition when focused node was changed
authorSangYong Park <sy302.park@samsung.com>
Thu, 8 Aug 2013 06:40:36 +0000 (15:40 +0900)
committerSangYong Park <sy302.park@samsung.com>
Thu, 8 Aug 2013 06:50:36 +0000 (15:50 +0900)
[Title] Cancel composition when focused node was changed
[Issue#] N_SE-47443
[Problem] Composition in progress, can not enter number when opening 'change page'
[Cause] composition information was not cleared
[Solution] Cancel composition when focused node was changed

Change-Id: I73d8febc92d3c1e1bf37b50059f6bd1b979173df

Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h

index 0f3c11f..b191233 100755 (executable)
@@ -191,7 +191,12 @@ void WebEditorClient::respondToChangedSelection(Frame* frame)
         return;
 
     EditorState state = m_page->editorState();
-#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
+
+#if ENABLE(TIZEN_ISF_PORT) || ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
+    const EditorState& currentState = m_page->currentEditorState();
+    if (currentState.hasComposition && currentState.inputMethodContextID != state.inputMethodContextID)
+        didCancelComposition(reinterpret_cast<Node*>(currentState.inputMethodContextID));
+
     m_page->setEditorState(state);
 #endif
 
index d90c3df..42bb838 100755 (executable)
@@ -444,8 +444,10 @@ public:
     PassRefPtr<Plugin> createPlugin(WebFrame*, WebCore::HTMLPlugInElement*, const Plugin::Parameters&);
 
     EditorState editorState() const;
-#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
-    void setEditorState(const EditorState& editorState) { m_editorState = editorState;}
+
+#if ENABLE(TIZEN_ISF_PORT) || ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
+    const EditorState& currentEditorState() { return m_editorState; }
+    void setEditorState(const EditorState& editorState) { m_editorState = editorState; }
 #endif
 
     String renderTreeExternalRepresentation() const;
@@ -1205,7 +1207,7 @@ private:
     WebCore::IntRect m_focusedRect;
 #endif
 
-#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
+#if ENABLE(TIZEN_ISF_PORT) || ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
     EditorState m_editorState;
 #endif