From: Sudarshan C P Date: Fri, 21 Jun 2013 15:30:22 +0000 (+0530) Subject: Text selection handler disappering in Gmail. X-Git-Tag: 2.2.1_release~201 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aeeb58b6a0501150da38fd13825535ff7d313207;p=framework%2Fweb%2Fwebkit-efl.git Text selection handler disappering in Gmail. [Title] Selection handler disappears on changing the device orientation - gmail.com [Issue#] WEB-3299 [Problem] Selection handler disappears on changing the device orientation on all edit box, even issue reproduce in case of scroll the page , single dumbell shown. [Cause] After orientation/scroll offset changed to the editor, new editor rect is not reflecting in updateHandler. [Solution] Required a Message sync call to update, new editor rect on orientation/scroll happens to redraw the update handler. Change-Id: I34d4746d8a762f0e0b997153c4ef9e6d0acac488 --- diff --git a/Source/WebKit2/Platform/CoreIPC/HandleMessage.h b/Source/WebKit2/Platform/CoreIPC/HandleMessage.h old mode 100644 new mode 100755 index 06d6469..3083105 --- a/Source/WebKit2/Platform/CoreIPC/HandleMessage.h +++ b/Source/WebKit2/Platform/CoreIPC/HandleMessage.h @@ -87,6 +87,12 @@ void callMemberFunction(const Arguments0&, Arguments2& replyArgs, C* obj (object->*function)(replyArgs.argument1, replyArgs.argument2); } +template +void callMemberFunction(const Arguments0&, Arguments3& replyArgs, C* object, MF function) +{ + (object->*function)(replyArgs.argument1, replyArgs.argument2, replyArgs.argument3); +} + template void callMemberFunction(const Arguments1& args, Arguments0&, C* object, MF function) { diff --git a/Source/WebKit2/UIProcess/WebPageProxy.h b/Source/WebKit2/UIProcess/WebPageProxy.h index 55c3b41..f7510d3 100755 --- a/Source/WebKit2/UIProcess/WebPageProxy.h +++ b/Source/WebKit2/UIProcess/WebPageProxy.h @@ -1249,7 +1249,6 @@ private: #endif void editorStateChanged(const EditorState&); - // Back/Forward list management void backForwardAddItem(uint64_t itemID); void backForwardGoToItem(uint64_t itemID, SandboxExtension::Handle&); diff --git a/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp b/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp index 5a3a50a..727575a 100755 --- a/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp +++ b/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp @@ -931,10 +931,14 @@ bool WebPageProxy::getSelectionHandlers(IntRect& leftRect, IntRect& rightRect) return false; bool result = false; - process()->sendSync(Messages::WebPage::GetSelectionHandlers(), Messages::WebPage::GetSelectionHandlers::Reply(leftRect, rightRect), m_pageID); + IntRect updateEditorRect(0, 0, 0, 0); + process()->sendSync(Messages::WebPage::GetSelectionHandlers(), Messages::WebPage::GetSelectionHandlers::Reply(leftRect, rightRect, updateEditorRect), m_pageID); if (!leftRect.size().isZero() || !rightRect.size().isZero()) result = true; - + if(m_editorState.editorRect != updateEditorRect) { + m_editorState.editorRect = updateEditorRect; + m_editorState.updateEditorRectOnly = true; + } return result; } diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.h b/Source/WebKit2/WebProcess/WebPage/WebPage.h index 30765cc..0701649 100755 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.h +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.h @@ -344,7 +344,7 @@ public: void selectClosestWord(const WebCore::IntPoint&, bool& result); void setLeftSelection(const WebCore::IntPoint&, const int direction, int& result); void setRightSelection(const WebCore::IntPoint&, const int direction, int& result); - void getSelectionHandlers(WebCore::IntRect& leftRect, WebCore::IntRect& rightRect); + void getSelectionHandlers(WebCore::IntRect& leftRect, WebCore::IntRect& rightRect, WebCore::IntRect& updateEditorRect); void getSelectionText(String& result); void selectionRangeClear(bool& result); void selectionClearAllSelection(WebCore::Frame* frame); diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in index 0986880..e4db491 100755 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in @@ -382,7 +382,7 @@ messages -> WebPage { SelectClosestWord(WebCore::IntPoint point) -> (bool result) SetLeftSelection(WebCore::IntPoint point, int direction) -> (int result) SetRightSelection(WebCore::IntPoint point, int direction) -> (int result) - GetSelectionHandlers() -> (WebCore::IntRect leftRect, WebCore::IntRect rightRect) + GetSelectionHandlers() -> (WebCore::IntRect leftRect, WebCore::IntRect rightRect, WebCore::IntRect updateEditorRect) GetSelectionText() -> (String result) SelectionRangeClear() -> (bool result) ScrollContentByCharacter(WebCore::IntPoint point, int direction) -> (bool result) diff --git a/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp b/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp index 0468bdb..f8d9606 100755 --- a/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp +++ b/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp @@ -1334,8 +1334,8 @@ void WebPage::selectClosestWord(const IntPoint& point, bool& result) // This changes just the 'start' and 'end' positions of the VisibleSelection // Find handlers positions - IntRect leftRect, rightRect; - getSelectionHandlers(leftRect, rightRect); + IntRect leftRect, rightRect, updatedEditorRect; + getSelectionHandlers(leftRect, rightRect, updatedEditorRect); if (leftRect.size().isZero() && rightRect.size().isZero()) { // Sometimes there is no selected text, but isNone() returns TRUE // in this case ewk_frame_selection_handlers_get() returns FALSE and handlers are invalid @@ -1368,8 +1368,8 @@ void WebPage::setLeftSelection(const IntPoint& point, const int direction, int& return; IntPoint pos = frameView->windowToContents(point); - IntRect leftRect, rightRect; - getSelectionHandlers(leftRect, rightRect); + IntRect leftRect, rightRect, updatedEditorRect; + getSelectionHandlers(leftRect, rightRect, updatedEditorRect); if (selectionEndNode->rendererIsEditable() && !selectionEndNode->rendererIsRichlyEditable()) { const int boundariesWidth = 2; @@ -1503,9 +1503,10 @@ void WebPage::setRightSelection(const IntPoint& point, const int direction, int& } } -void WebPage::getSelectionHandlers(IntRect& leftRect, IntRect& rightRect) +void WebPage::getSelectionHandlers(IntRect& leftRect, IntRect& rightRect, WebCore::IntRect& updatedEditorRect) { Frame* focusedFrame = m_page->focusController()->focusedOrMainFrame(); + updatedEditorRect = m_editorState.editorRect; if (!focusedFrame->selection()->isRange()) return; @@ -1533,15 +1534,8 @@ void WebPage::getSelectionHandlers(IntRect& leftRect, IntRect& rightRect) calcFocusedRects(rootEditableElement, rects); IntRect editorRect = unionRect(rects); -#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION) - if (m_editorState.editorRect != editorRect) { - EditorState state = editorState(); - state.updateEditorRectOnly = true; - setEditorState(state); - send(Messages::WebPageProxy::EditorStateChanged(state)); - } -#endif - + if (m_editorState.editorRect != editorRect) + updatedEditorRect = editorRect; if (leftRect.maxY() > editorRect.maxY()) { leftRect.setY(editorRect.y()); leftRect.setHeight(editorRect.height()); @@ -1553,7 +1547,6 @@ void WebPage::getSelectionHandlers(IntRect& leftRect, IntRect& rightRect) } } } - // prevent from selecting zero-length selection if (leftRect.x() == rightRect.x() + rightRect.width() && leftRect.y() == rightRect.y())