From 82e5eedbe697574a3acc77fecb09c37410ab394f Mon Sep 17 00:00:00 2001 From: SangYong Park Date: Mon, 15 Apr 2013 19:05:17 +0900 Subject: [PATCH] Do not showing keypad when edit field was located outside of screen [Title] Do not showing keypad when edit field was located outside of screen [Issue#] WEB-2654 [Problem] Keypad did showing when tap image in www.tumblr.com [Cause] focus to edit field that located outside of screen [Solution] ignore edit field if located outside of screen Change-Id: I2e92a397d399a856e8afc8465f028ada1d03b61a --- Source/WebKit2/WebProcess/WebPage/WebPage.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp index f40a1ad..acd7f5f 100755 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp @@ -563,11 +563,17 @@ EditorState WebPage::editorState() const result.hasComposition = frame->editor()->hasComposition(); result.shouldIgnoreCompositionSelectionChange = frame->editor()->ignoreCompositionSelectionChange(); -#if ENABLE(TIZEN_ISF_PORT) +#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION) || ENABLE(TIZEN_ISF_PORT) Element* selectionRoot = frame->selection()->rootEditableElementOrDocumentElement(); if (!selectionRoot) return result; + result.editorRect = frame->view()->contentsToWindow(selectionRoot->getPixelSnappedRect()); + if (result.editorRect.maxX() <= 0 || result.editorRect.maxY() <= 0) + result.isContentEditable = false; +#endif + +#if ENABLE(TIZEN_ISF_PORT) Node* hostNode = selectionRoot->shadowAncestorNode(); if (result.isContentEditable) { HTMLTextFormControlElement* formControl = toTextFormControl(hostNode); @@ -583,10 +589,6 @@ EditorState WebPage::editorState() const } #endif -#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION) - result.editorRect = frame->view()->contentsToWindow(selectionRoot->getPixelSnappedRect()); -#endif - #if PLATFORM(QT) size_t location = 0; size_t length = 0; -- 2.7.4