Bug 10159 - REGRESSION: delegate returning no menu elements crashes webkit
Summary: REGRESSION: delegate returning no menu elements crashes webkit
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P1 Normal
Assignee: Nobody
URL:
Keywords: EasyFix, Regression
Depends on:
Blocks:
 
Reported: 2006-07-30 06:09 PDT by Duncan Wilcox
Modified: 2006-07-31 20:48 PDT (History)
0 users

See Also:


Attachments
Patch (1.02 KB, patch)
2006-07-30 06:11 PDT, Duncan Wilcox
darin: review-
Details | Formatted Diff | Diff
Patch with changelog (1.83 KB, patch)
2006-07-31 00:35 PDT, Duncan Wilcox
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Duncan Wilcox 2006-07-30 06:09:27 PDT
svn r14845 has a fix for <rdar://problem/4498606> REGRESSION (417.8-420+): 3 missing items (but extra separators) in context menu in Mail message body

However if the context menu delegate returns no items, as in:

- (NSArray *)webView:(WebView *)sender contextMenuItemsForElement:(NSDictionary *)element defaultMenuItems:(NSArray *)defaultMenuItems
{
	return [NSArray array];
}

the patch above crashes because it doesn't check for zero menu items.

The fix is trivial, attaching the patch.
Comment 1 Duncan Wilcox 2006-07-30 06:11:41 PDT
Created attachment 9762 [details]
Patch
Comment 2 Darin Adler 2006-07-30 09:27:41 PDT
Comment on attachment 9762 [details]
Patch

Change looks great. Needs a test case and a change log entry.
Comment 3 Duncan Wilcox 2006-07-31 00:35:12 PDT
Created attachment 9769 [details]
Patch with changelog

No automated test, because there's no way to programmatically open a context menu,
no manual test because there's no way to customize the context menu delegate.
Comment 4 Darin Adler 2006-07-31 01:40:53 PDT
Comment on attachment 9769 [details]
Patch with changelog

r=me
Comment 5 Timothy Hatcher 2006-07-31 20:48:14 PDT
Landed in r15726.