Bug 36848 - Menu items appropriate only for rich-content editing can appear in plain-text contexts
Summary: Menu items appropriate only for rich-content editing can appear in plain-text...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.6
: P2 Normal
Assignee: John Sullivan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2010-03-30 13:21 PDT by John Sullivan
Modified: 2010-03-30 15:47 PDT (History)
0 users

See Also:


Attachments
Patch that does returns self for non-string content only if _canEditRichly is true (1.91 KB, patch)
2010-03-30 13:25 PDT, John Sullivan
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Sullivan 2010-03-30 13:21:27 PDT
In Radar as 7362913.

To reproduce:

1. Launch Safari
2. Paste this into the URL field, and hit enter: data:text/html,%3Cinput%20type=%22password%22%3E
3. Right-click the password field

The context menu shows "Import Image" and "Capture Selection from Screen" context menu items, which don't make sense for a password field.
Comment 1 John Sullivan 2010-03-30 13:25:59 PDT
Created attachment 52075 [details]
Patch that does returns self for non-string content only if _canEditRichly is true

Based on a patch by Peter Ammon in the associated radar.
Comment 2 mitz 2010-03-30 13:36:58 PDT
Comment on attachment 52075 [details]
Patch that does returns self for non-string content only if _canEditRichly is true

> Index: WebKit/mac/ChangeLog
> ===================================================================
> --- WebKit/mac/ChangeLog	(revision 56805)
> +++ WebKit/mac/ChangeLog	(working copy)
> @@ -1,3 +1,15 @@
> +2010-03-30  John Sullivan  <sullivan@apple.com>
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        https://bugs.webkit.org/show_bug.cgi?id=36848
> +        <rdar://problem/7362913>
> +        Menu items appropriate only for rich-content editing can appear in plain-text contexts
> +
> +        * WebView/WebHTMLView.mm:
> +        (-[WebHTMLView validRequestorForSendType:returnType:]):
> +        Don't return self for non-string content if _canEditRichly is false.
> +
>  2010-03-29  Alexey Proskuryakov  <ap@apple.com>
>  
>          Reviewed by Darin Adler.
> Index: WebKit/mac/WebView/WebHTMLView.mm
> ===================================================================
> --- WebKit/mac/WebView/WebHTMLView.mm	(revision 56664)
> +++ WebKit/mac/WebView/WebHTMLView.mm	(working copy)
> @@ -2539,7 +2539,13 @@ - (BOOL)readSelectionFromPasteboard:(NSP
>  - (id)validRequestorForSendType:(NSString *)sendType returnType:(NSString *)returnType
>  {
>      BOOL isSendTypeOK = !sendType || ([[self pasteboardTypesForSelection] containsObject:sendType] && [self _hasSelection]);
> -    BOOL isReturnTypeOK = !returnType || ([[[self class] _insertablePasteboardTypes] containsObject:returnType] && [self _isEditable]);
> +        BOOL isReturnTypeOK = NO;
> +    if (!returnType)

Weird indentation.
Comment 3 John Sullivan 2010-03-30 13:38:44 PDT
Committed in http://trac.webkit.org/changeset/56806
Comment 4 Alexey Proskuryakov 2010-03-30 15:47:47 PDT
See also: bug 8714.