From: Yuni Jeong Date: Thu, 20 Jun 2013 15:53:01 +0000 (+0900) Subject: Fixed "Select all" menu is not displayed. X-Git-Tag: submit/tizen_2.2/20130714.131554~129 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4ace056a2d5326b9e4514881dfdcd615b6e12dbe;p=framework%2Fweb%2Fwebkit-efl.git Fixed "Select all" menu is not displayed. [Title] Fixed "Select all" menu is not displayed. [Issue#] DCM-1960 [Problem] When longtapping on left/right side position of an image, "Select all" menu is not displayed. [Cause] Condition for adding "Select all" menu is wrong. [Solution] Changed condition for adding "Select all" menu. Change-Id: I20535ed73c6b4867f3239fa774d950f2ef714ac1 --- diff --git a/Source/WebCore/page/ContextMenuController.cpp b/Source/WebCore/page/ContextMenuController.cpp index bd3fc4f..983c1cd 100755 --- a/Source/WebCore/page/ContextMenuController.cpp +++ b/Source/WebCore/page/ContextMenuController.cpp @@ -85,6 +85,11 @@ #include "HTMLInputElement.h" #endif +#if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2) +#include "visible_units.h" +#include "htmlediting.h" +#endif + using namespace WTF; using namespace Unicode; @@ -1130,22 +1135,23 @@ void ContextMenuController::populate() #if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2) if (frame->selection()) { Node* baseNode = frame->selection()->base().containerNode(); - 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) + if (inPasswordField) { + if (baseNode && baseNode->isTextNode() && !(baseNode->textContent().isEmpty()) && !m_hitTestResult.isSelected()) + appendItem(SelectWordItem, m_contextMenu.get()); + } else { + VisiblePosition currentPosition = frame->selection()->selection().visibleStart(); + VisiblePosition startPosition = startOfEditableContent(currentPosition); + VisiblePosition endPosition = endOfEditableContent(currentPosition); + if (comparePositions(startPosition, endPosition)) appendItem(SelectAllItem, m_contextMenu.get()); -#endif -#if ENABLE(TIZEN_CONTEXT_MENU_SELECT) + if (baseNode && baseNode->isTextNode() && !(baseNode->textContent().isEmpty())) appendItem(SelectWordItem, m_contextMenu.get()); -#endif -#if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2) - } } } +#else +#if PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) + appendItem(SelectAllItem, m_contextMenu.get()); +#endif #endif if (!inPasswordField) {