Fix for "wrong context menu is displayed"
authorDhirendra Kumar <dhirendra.kr@samsung.com>
Fri, 19 Apr 2013 07:26:33 +0000 (16:26 +0900)
committerGerrit Code Review <gerrit2@kim11>
Fri, 26 Apr 2013 02:06:23 +0000 (11:06 +0900)
 [Title] Fix for displaying correct context menu in case of a link
         tag with image and text tags as children.
 [Issue#] WEB-2938
 [Problem] When user taps on "Selection mode" on a context-menu with images
           below, again the same items are added to the menu rather than
           items specific to images.
 [Cause] When user taps on "Selection mode", various context-menu
           items are added to it. Here check for range selection was missing.
 [Solution] Added condition for frame->selection()->isRange() along with others
            while appending context-menu items.
 [Developer] Dhirendra Kumar(dhirendra.kr@samsung.com)

Change-Id: I1bfc30693c937175fc52cf15ca539a6faddd0682

Source/WebCore/page/ContextMenuController.cpp

index 9a1f4a4..a080388 100755 (executable)
@@ -843,7 +843,7 @@ void ContextMenuController::populate()
 #endif
         if (!linkURL.isEmpty()) {
 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
-            if (m_hitTestResult.isSelected()) {
+            if (m_hitTestResult.isSelected() || frame->selection()->isRange()) {
                 if (selectionContainsPossibleWord(frame)) {
                     appendItem(SearchWebItem, m_contextMenu.get());
                 }