Do not showing keypad when edit field was located outside of screen
authorSangYong Park <sy302.park@samsung.com>
Mon, 15 Apr 2013 10:05:17 +0000 (19:05 +0900)
committerGerrit Code Review <gerrit2@kim11>
Mon, 15 Apr 2013 12:28:44 +0000 (21:28 +0900)
[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

index f40a1ad..acd7f5f 100755 (executable)
@@ -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;