Index: Source/web/ContextMenuClientImpl.cpp |
diff --git a/Source/web/ContextMenuClientImpl.cpp b/Source/web/ContextMenuClientImpl.cpp |
index 517305b7570e797255ab3ac8d6ee9ef5271aafa6..d2a2ab30c29911588d00e59f1f6f51a17f480699 100644 |
--- a/Source/web/ContextMenuClientImpl.cpp |
+++ b/Source/web/ContextMenuClientImpl.cpp |
@@ -220,7 +220,15 @@ void ContextMenuClientImpl::showContextMenu(const blink::ContextMenu* defaultMen |
if (toLocalFrame(m_webView->focusedWebCoreFrame())->editor().canDelete()) |
data.editFlags |= WebContextMenuData::CanDelete; |
// We can always select all... |
- data.editFlags |= WebContextMenuData::CanSelectAll; |
+ Node* node = r.innerNonSharedNode(); |
+ int len = 0; |
+ if (node->isElementNode() && (static_cast<Element *>(node))->isFormControlElement()) { |
darin (slow to review)
2014/07/25 05:11:56
nit: no " " before "*"
|
+ Element* element = toHTMLFormControlElement(node); |
+ if (element->isTextFormControl()) |
+ len = (static_cast<HTMLTextFormControlElement *>(element))->value().length(); |
darin (slow to review)
2014/07/25 05:11:56
I would probably skip the "len" local variable and
|
+ } |
+ if (len > 0) |
+ data.editFlags |= WebContextMenuData::CanSelectAll; |
data.editFlags |= WebContextMenuData::CanTranslate; |
// Links, Images, Media tags, and Image/Media-Links take preference over |