Changeset 21240 in webkit
- Timestamp:
- May 3, 2007, 4:08:28 PM (18 years ago)
- Location:
- trunk/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/ChangeLog
r21238 r21240 1 2007-05-03 TImothy Hatcher <timothy@apple.com> 2 3 Reviewed by Kevin. 4 5 <rdar://problem/4975212> REGRESSION: With NetNewsWire 2.1.1, the contextual menu shows extra menu items when focus 6 is placed in input or textarea field 7 8 The NetNewsWire UI delegate isn't expecting calls for form controls, so we need to do a linked-on-or-after check. 9 If the application was linked against Tiger or earlier and the element is a text form control, just return the 10 default menu items and bypass the delegate call completely. 11 12 * WebCoreSupport/WebContextMenuClient.mm: 13 (isPreVersion3Client): Cache the result of the WebKitLinkedOnOrAfter call 14 (fixMenusToSendToOldClients): Call the new isPreVersion3Client() 15 (fixMenusReceivedFromOldClients): Ditto. 16 (WebContextMenuClient::getCustomMenuFromDefaultItems): Return the default menu items if the element is a text form control. 17 1 18 2007-05-03 Mark Rowe <mrowe@apple.com> 2 19 -
trunk/WebKit/WebCoreSupport/WebContextMenuClient.mm
r21234 r21240 43 43 #import <WebCore/ContextMenu.h> 44 44 #import <WebCore/KURL.h> 45 #import <WebKit/DOMPrivate.h> 45 46 46 47 using namespace WebCore; … … 65 66 } 66 67 68 static BOOL isPreVersion3Client(void) 69 { 70 static BOOL preVersion3Client = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_3_0_CONTEXT_MENU_TAGS); 71 return preVersion3Client; 72 } 73 67 74 static void fixMenusToSendToOldClients(NSMutableArray *defaultMenuItems) 68 75 { 69 BOOL preVersion3Client = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_3_0_CONTEXT_MENU_TAGS);76 BOOL preVersion3Client = isPreVersion3Client(); 70 77 if (!preVersion3Client) 71 78 return; … … 121 128 static void fixMenusReceivedFromOldClients(NSMutableArray *newMenuItems) 122 129 { 123 BOOL preVersion3Client = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_3_0_CONTEXT_MENU_TAGS);130 BOOL preVersion3Client = isPreVersion3Client(); 124 131 if (!preVersion3Client) 125 132 return; … … 216 223 if (![delegate respondsToSelector:@selector(webView:contextMenuItemsForElement:defaultMenuItems:)]) 217 224 return defaultMenu->platformDescription(); 218 225 219 226 NSDictionary *element = [[[WebElementDictionary alloc] initWithHitTestResult:defaultMenu->hitTestResult()] autorelease]; 227 228 BOOL preVersion3Client = isPreVersion3Client(); 229 if (preVersion3Client) { 230 DOMNode *node = [element objectForKey:WebElementDOMNodeKey]; 231 if ([node isKindOfClass:[DOMHTMLInputElement class]] && [(DOMHTMLInputElement *)node _isTextField]) 232 return defaultMenu->platformDescription(); 233 if ([node isKindOfClass:[DOMHTMLTextAreaElement class]]) 234 return defaultMenu->platformDescription(); 235 } 236 220 237 NSMutableArray *defaultMenuItems = defaultMenu->platformDescription(); 221 238
Note:
See TracChangeset
for help on using the changeset viewer.