Bug 57958

Summary: Context menu does not show in PDF views if there is no UI delegate
Product: WebKit Reporter: Timothy Hatcher <timothy>
Component: PDFAssignee: Timothy Hatcher <timothy>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
Proposed Change darin: review+, timothy: commit-queue-

Description Timothy Hatcher 2011-04-06 10:04:56 PDT
A WebView with no UI delegate does not show a context menu in PDF view.
Comment 1 Timothy Hatcher 2011-04-06 10:18:07 PDT
Created attachment 88464 [details]
Proposed Change

This bug is blocking me from testing an upcoming context menu change.
Comment 2 WebKit Review Bot 2011-04-06 10:21:12 PDT
Attachment 88464 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style']" exit_code: 1

Source/WebKit/mac/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Darin Adler 2011-04-06 10:39:41 PDT
Comment on attachment 88464 [details]
Proposed Change

View in context: https://bugs.webkit.org/attachment.cgi?id=88464&action=review

> Source/WebKit/mac/WebView/WebView.mm:1277
> +    // CallUIDelegate returns nil if UIDelegate is nil or dosen't respond to the selector. So we need to check that here

Typo: dosen't

> Source/WebKit/mac/WebView/WebView.mm:1281
> +        menuItems = CallUIDelegate(self, selector, element, defaultMenuItems);

Annoying to be doing respondsToSelector twice here.
Comment 4 Timothy Hatcher 2011-04-06 10:46:05 PDT
(In reply to comment #3)
> (From update of attachment 88464 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=88464&action=review
> 
> > Source/WebKit/mac/WebView/WebView.mm:1281
> > +        menuItems = CallUIDelegate(self, selector, element, defaultMenuItems);
> 
> Annoying to be doing respondsToSelector twice here.

We could have an out parameter to know if the delegate responds. But that would be a larger change, and WebKit1 is the past!
Comment 5 Timothy Hatcher 2011-04-11 11:53:32 PDT
Landed in r83464.