Add select all context menu when showing context menu anytime.
authorTaeyun An <ty.an@samsung.com>
Fri, 19 Apr 2013 13:40:25 +0000 (22:40 +0900)
committerTaeyun An <ty.an@samsung.com>
Tue, 23 Apr 2013 11:53:15 +0000 (20:53 +0900)
[Title] Add select all context menu when showing context menu anytime.
[Issue] P130411-5402
[Problem] There is no select all menu in context menu where called body of document
[Cause] There is no select all item append routine.
[Solution] Add select all context menu when showing context menu anytime.

Change-Id: I7a058f31b497083e770d1403c3f7109d2afc9d62

Source/WebCore/dom/Range.cpp
Source/WebCore/page/ContextMenuController.cpp

index 1a0b96d..0edfbcd 100644 (file)
@@ -1662,6 +1662,15 @@ void Range::boundingBoxEx(Vector<IntRect>& rects, bool useSelectionHeight, Range
             rects.append(r);
             allFixed &= isFixed;
             someFixed |= isFixed;
+        } else if (r && node->hasTagName(inputTag)) {
+            RenderBox* renderBox = toRenderBox(r);
+            int startOffset = node == startContainer ? m_start.offset() : 0;
+            int endOffset = node == endContainer ? m_end.offset() : numeric_limits<int>::max();
+            bool isFixed = false;
+            IntRect r = renderBox->absoluteBoundingBoxRect();
+            rects.append(r);
+            allFixed &= isFixed;
+            someFixed |= isFixed;
         }
     }
 
index b2c537c..9a1f4a4 100755 (executable)
@@ -838,6 +838,9 @@ void ContextMenuController::populate()
     if (!m_hitTestResult.isContentEditable()) {
         FrameLoader* loader = frame->loader();
         KURL linkURL = m_hitTestResult.absoluteLinkURL();
+#if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
+        appendItem(SelectAllItem, m_contextMenu.get());
+#endif
         if (!linkURL.isEmpty()) {
 #if ENABLE(TIZEN_WEBKIT2_TEXT_SELECTION)
             if (m_hitTestResult.isSelected()) {