From 5ce28ef7736dee50e435bc27ad203a7e94e829fb Mon Sep 17 00:00:00 2001 From: "prathmesh.m" Date: Fri, 22 Mar 2013 18:59:53 +0900 Subject: [PATCH] Added context menu for input field [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 | 14 +++++++++++--- Source/WebKit2/UIProcess/API/efl/tizen/TextSelection.cpp | 3 --- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Source/WebCore/page/ContextMenuController.cpp b/Source/WebCore/page/ContextMenuController.cpp index 998e748..a05ec15 100755 --- a/Source/WebCore/page/ContextMenuController.cpp +++ b/Source/WebCore/page/ContextMenuController.cpp @@ -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 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()); diff --git a/Source/WebKit2/UIProcess/API/efl/tizen/TextSelection.cpp b/Source/WebKit2/UIProcess/API/efl/tizen/TextSelection.cpp index 84e3f7e..2b542c8 100644 --- a/Source/WebKit2/UIProcess/API/efl/tizen/TextSelection.cpp +++ b/Source/WebKit2/UIProcess/API/efl/tizen/TextSelection.cpp @@ -228,9 +228,6 @@ void TextSelection::showContextMenu() return; EditorState editorState = m_page->editorState(); - if (editorState.isInPasswordField) - return; - if (!editorState.selectionIsRange && !editorState.isContentEditable) return; -- 2.7.4