[WK2] select all,select word text selection options are displaying
authorprathmesh.m <prathmesh.m@samsung.com>
Fri, 31 Aug 2012 06:31:57 +0000 (15:31 +0900)
committerprathmesh.m <prathmesh.m@samsung.com>
Fri, 31 Aug 2012 06:31:57 +0000 (15:31 +0900)
for blank form fields.

[Version] N/A
[Project] N/A
[Title] select all,select word text selection options are displaying
for blank form fields.
[BinType] N/A
[Customer] N/A
[Issue#] WEB-1434
[Problem] context menu is shown on blank fields
[Cause] Input box contents are not checked
[Solution] added check for contents
[Team] Browser(WCS)
[Developer] Prathmesh.m
[Request] N/A
[Horizontal expansion] N/A
[SCMRequest] N/A

Change-Id: I06e478732afc20b8f2848cefadedc63378b17acb

Source/WebCore/page/ContextMenuController.cpp

index ffbed1e..e07dc95 100644 (file)
@@ -1050,11 +1050,22 @@ void ContextMenuController::populate()
         appendItem(DeleteItem, m_contextMenu.get());
         appendItem(*separatorItem(), m_contextMenu.get());
 #endif
+#if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
+        if (frame->selection()) {
+            Node* baseNode = frame->selection()->base().containerNode();
+            if (baseNode && baseNode->isTextNode()) {
+                if (!(baseNode->textContent().isEmpty())) {
+#endif
 #if PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL)
-        appendItem(SelectAllItem, m_contextMenu.get());
+                    appendItem(SelectAllItem, m_contextMenu.get());
 #endif
 #if ENABLE(TIZEN_CONTEXT_MENU_SELECT)
-        appendItem(SelectWordItem, m_contextMenu.get());
+                    appendItem(SelectWordItem, m_contextMenu.get());
+#endif
+#if ENABLE(TIZEN_CONTEXT_MENU_WEBKIT_2)
+                }
+            }
+        }
 #endif
 
         if (!inPasswordField) {