RESOLVED FIXED 36848
Menu items appropriate only for rich-content editing can appear in plain-text contexts
https://bugs.webkit.org/show_bug.cgi?id=36848
Summary Menu items appropriate only for rich-content editing can appear in plain-text...
John Sullivan
Reported 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.
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+
John Sullivan
Comment 1 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.
mitz
Comment 2 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.
John Sullivan
Comment 3 2010-03-30 13:38:44 PDT
Alexey Proskuryakov
Comment 4 2010-03-30 15:47:47 PDT
See also: bug 8714.
Note You need to log in before you can comment on or make changes to this bug.