Do not showing keypad when edit field was located outside of screen
[framework/web/webkit-efl.git] / 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;