From f8618081ce1838a90c8d98e3bfa859c2ffeaffde Mon Sep 17 00:00:00 2001 From: Yuni Jeong Date: Thu, 13 Jun 2013 23:13:34 +0900 Subject: [PATCH] Send changed editor rect to UIProcess when editor rect is changed by javascript. [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 | 2 +- Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp | 8 ++++++++ Source/WebKit2/WebProcess/WebPage/WebPage.h | 4 ++++ Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp | 18 ++++++++++++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/Source/WebKit2/UIProcess/efl/InputMethodContextEfl.cpp b/Source/WebKit2/UIProcess/efl/InputMethodContextEfl.cpp index bde3a43..e5a0b88 100755 --- a/Source/WebKit2/UIProcess/efl/InputMethodContextEfl.cpp +++ b/Source/WebKit2/UIProcess/efl/InputMethodContextEfl.cpp @@ -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) diff --git a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp index 204effd..38f813a 100644 --- a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp +++ b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp @@ -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()); diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.h b/Source/WebKit2/WebProcess/WebPage/WebPage.h index 2e356ad..59cf683 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.h +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.h @@ -785,6 +785,10 @@ public: void useSettingsFont(); #endif +#if OS(TIZEN) + void didChangeContents(const WebCore::IntRect&); +#endif + private: WebPage(uint64_t pageID, const WebPageCreationParameters&); diff --git a/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp b/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp index a7b07cc..c2af8d6 100644 --- a/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp +++ b/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp @@ -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 -- 2.7.4