Added context menu for input field
authorprathmesh.m <prathmesh.m@samsung.com>
Fri, 22 Mar 2013 09:59:53 +0000 (18:59 +0900)
committerGerrit Code Review <gerrit2@kim11>
Tue, 26 Mar 2013 07:44:40 +0000 (16:44 +0900)
[Title] Added context menu for input field
[Issue#] TDIS-2990
[Problem] Unable to paste in input field
[Cause] No context menu items added as its a input filed
[Solution] Added paste item for the context menu

Change-Id: Ie4309c1c770ead5bec444b03906f16491e604d59

Source/WebCore/page/ContextMenuController.cpp
Source/WebKit2/UIProcess/API/efl/tizen/TextSelection.cpp

index 998e748..a05ec15 100755 (executable)
@@ -985,8 +985,13 @@ void ContextMenuController::populate()
             if (spellCheckingEnabled) {
                 // Consider adding spelling-related or grammar-related context menu items (never both, since a single selected range
                 // is never considered a misspelling and bad grammar at the same time)
+#if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
+                bool misspelling = false;
+                bool badGrammar = false;
+#else
                 bool misspelling;
                 bool badGrammar;
+#endif
                 Vector<String> guesses = frame->editor()->guessesForMisspelledOrUngrammaticalSelection(misspelling, badGrammar);
                 if (misspelling || badGrammar) {
                     size_t size = guesses.size();
@@ -1077,7 +1082,7 @@ void ContextMenuController::populate()
         }
 
 #if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
-        if (m_hitTestResult.isSelected()) {
+        if (m_hitTestResult.isSelected() && !inPasswordField) {
             appendItem(CutItem, m_contextMenu.get());
             appendItem(CopyItem, m_contextMenu.get());
         }
@@ -1096,8 +1101,11 @@ void ContextMenuController::populate()
 #if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
         if (frame->selection()) {
             Node* baseNode = frame->selection()->base().containerNode();
-            if (baseNode && baseNode->isTextNode()) {
-                if (!(baseNode->textContent().isEmpty())) {
+            if (baseNode && baseNode->isTextNode() && (!(baseNode->textContent().isEmpty()))) {
+                if (inPasswordField) {
+                    if (!m_hitTestResult.isSelected())
+                        appendItem(SelectWordItem, m_contextMenu.get());
+                } else {
 #endif
 #if PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL)
                     appendItem(SelectAllItem, m_contextMenu.get());
index 84e3f7e..2b542c8 100644 (file)
@@ -228,9 +228,6 @@ void TextSelection::showContextMenu()
         return;
 
     EditorState editorState = m_page->editorState();
-    if (editorState.isInPasswordField)
-        return;
-
     if (!editorState.selectionIsRange && !editorState.isContentEditable)
         return;