Send changed editor rect to UIProcess when editor rect is changed by javascript.
authorYuni Jeong <yhnet.jung@samsung.com>
Thu, 13 Jun 2013 14:13:34 +0000 (23:13 +0900)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Wed, 19 Jun 2013 06:42:15 +0000 (06:42 +0000)
[Title] Send changed editor rect to UIProcess when editor rect is changed by javascript.
[Issue#] N_SE-38730
[Problem] When longtap on input filed in popup menu of TizenWinset,
          magnifier is showned at wrong position and keyboard disappear.
[Cause] When editor rect is changed by javascript,
        editor rect in UIProcess side is not updated.
[Solution] Send changed editor rect to UIProcess when editor rect is changed by javascript.

Change-Id: I6aa80b1e0d259d8c85626cd4121de9a5e721fb31

Source/WebKit2/UIProcess/efl/InputMethodContextEfl.cpp
Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp

index bde3a43..e5a0b88 100755 (executable)
@@ -337,7 +337,7 @@ void InputMethodContextEfl::handleKeyDownEvent(const Evas_Event_Key_Down* downEv
 void InputMethodContextEfl::updateTextInputState()
 {
     const EditorState& editor = m_viewImpl->page()->editorState();
-    if (editor.shouldIgnoreCompositionSelectionChange)
+    if (editor.shouldIgnoreCompositionSelectionChange || editor.updateEditorRectOnly)
         return;
 
     if (editor.isContentEditable && m_useInputMethod)
index 204effd..38f813a 100644 (file)
@@ -89,6 +89,10 @@ void DrawingAreaImpl::setNeedsDisplay(const IntRect& rect)
     if (dirtyRect.isEmpty())
         return;
 
+#if OS(TIZEN)
+    m_webPage->didChangeContents(dirtyRect);
+#endif
+
     if (m_layerTreeHost) {
         ASSERT(m_dirtyRegion.isEmpty());
 
@@ -108,6 +112,10 @@ void DrawingAreaImpl::scroll(const IntRect& scrollRect, const IntSize& scrollOff
     if (!m_isPaintingEnabled)
         return;
 
+#if OS(TIZEN)
+    m_webPage->didChangeContents(scrollRect);
+#endif
+
     if (m_layerTreeHost) {
         ASSERT(m_scrollRect.isEmpty());
         ASSERT(m_scrollOffset.isEmpty());
index 2e356ad..59cf683 100644 (file)
@@ -785,6 +785,10 @@ public:
     void useSettingsFont();
 #endif
 
+#if OS(TIZEN)
+    void didChangeContents(const WebCore::IntRect&);
+#endif
+
 private:
     WebPage(uint64_t pageID, const WebPageCreationParameters&);
 
index a7b07cc..c2af8d6 100644 (file)
@@ -1773,6 +1773,24 @@ void WebPage::useSettingsFont()
     frameView->forceLayout();
 }
 #endif
+
+void WebPage::didChangeContents(const IntRect& rect)
+{
+    Frame* frame = m_page->focusController()->focusedOrMainFrame();
+    if (!frame || !frame->view() || frame->view()->needsLayout())
+        return;
+
+#if ENABLE(TIZEN_ISF_PORT) || ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
+    if (m_editorState.isContentEditable && rect.intersects(m_editorState.editorRect) && frame->selection()->rootEditableElement()) {
+        IntRect currentEditorRect = nodeRect(frame->selection()->rootEditableElement());
+        if (m_editorState.editorRect != currentEditorRect) {
+            m_editorState.editorRect = currentEditorRect;
+            m_editorState.updateEditorRectOnly = true;
+            send(Messages::WebPageProxy::EditorStateChanged(m_editorState));
+        }
+    }
+#endif
+}
 #endif // #if OS(TIZEN)
 
 } // namespace WebKit