From: commit-queue@webkit.org Date: Wed, 8 Feb 2012 20:16:21 +0000 (+0000) Subject: [Chromium] Don't add selection from password fields to context menu. X-Git-Tag: 070512121124~13429 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=293a7d00ad1b8b64ccf439ab2e409b0a9ebbbae3;p=profile%2Fivi%2Fwebkit-efl.git [Chromium] Don't add selection from password fields to context menu. https://bugs.webkit.org/show_bug.cgi?id=77733 Patch by Bernhard Bauer 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 --- diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog index ebdd38f..1ea255b 100644 --- a/Source/WebKit/chromium/ChangeLog +++ b/Source/WebKit/chromium/ChangeLog @@ -1,3 +1,13 @@ +2012-02-08 Bernhard Bauer + + [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 [chromium] Let -Wglobal-constructors hack in shared build metastasize to mac diff --git a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp index cdceb07..790a9c5 100644 --- a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp +++ b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp @@ -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(r.innerNonSharedNode())->isPasswordField()) + data.selectedText = selectedFrame->editor()->selectedText().stripWhiteSpace(); + } if (r.isContentEditable()) { data.isEditable = true;