[Chromium] Don't add selection from password fields to context menu.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Feb 2012 20:16:21 +0000 (20:16 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Feb 2012 20:16:21 +0000 (20:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=77733

Patch by Bernhard Bauer <bauerb@google.com> on 2012-02-08
Reviewed by Adam Barth.

* src/ContextMenuClientImpl.cpp:
(WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107115 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/ContextMenuClientImpl.cpp

index ebdd38f..1ea255b 100644 (file)
@@ -1,3 +1,13 @@
+2012-02-08  Bernhard Bauer  <bauerb@google.com>
+
+        [Chromium] Don't add selection from password fields to context menu.
+        https://bugs.webkit.org/show_bug.cgi?id=77733
+
+        Reviewed by Adam Barth.
+
+        * src/ContextMenuClientImpl.cpp:
+        (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems):
+
 2012-02-08  Nico Weber  <nicolasweber@gmx.de>
 
         [chromium] Let -Wglobal-constructors hack in shared build metastasize to mac
index cdceb07..790a9c5 100644 (file)
@@ -259,8 +259,10 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems(
             data.frameHistoryItem = WebHistoryItem(historyItem);
     }
 
-    if (r.isSelected())
-        data.selectedText = selectedFrame->editor()->selectedText().stripWhiteSpace();
+    if (r.isSelected()) {
+        if (!r.innerNonSharedNode()->hasTagName(HTMLNames::inputTag) || !static_cast<HTMLInputElement*>(r.innerNonSharedNode())->isPasswordField())
+            data.selectedText = selectedFrame->editor()->selectedText().stripWhiteSpace();
+    }
 
     if (r.isContentEditable()) {
         data.isEditable = true;