Bug 137891

Summary: Add action menu support
Product: WebKit Reporter: Beth Dakin <bdakin>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, bdakin, commit-queue, jonlee, sam, simon.fraser, thorton
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch with slightly different WK2 spin andersca: review+

Description Beth Dakin 2014-10-20 12:54:37 PDT
WK2 should support action menus.

rdar://problem/18451638
rdar://problem/18694470
Comment 1 Beth Dakin 2014-10-20 12:56:03 PDT
Created attachment 240141 [details]
Patch
Comment 2 WebKit Commit Bot 2014-10-20 12:59:04 PDT
Attachment 240141 [details] did not pass style-queue:


ERROR: Source/WebKit2/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
ERROR: Source/WebCore/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Total errors found: 2 in 13 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Beth Dakin 2014-10-20 13:01:31 PDT
(In reply to comment #2)
> Attachment 240141 [details] did not pass style-queue:
> 
> 
> ERROR: Source/WebKit2/ChangeLog:1:  ChangeLog entry has no bug number 
> [changelog/bugnumber] [5]
> ERROR: Source/WebCore/ChangeLog:1:  ChangeLog entry has no bug number 
> [changelog/bugnumber] [5]
> Total errors found: 2 in 13 files
> 
> 
> If any of these errors are false positives, please file a bug against
> check-webkit-style.

Oops! Fixed this.
Comment 4 Beth Dakin 2014-10-20 13:41:07 PDT
Created attachment 240143 [details]
Patch with slightly different WK2 spin
Comment 5 Anders Carlsson 2014-10-20 13:46:52 PDT
Comment on attachment 240143 [details]
Patch with slightly different WK2 spin

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

> Source/WebKit2/UIProcess/API/mac/WKView.mm:3710
> +    NSMutableArray *menuItems = [NSMutableArray array];
> +
> +    if (!hitTestResult)
> +        return menuItems;
> +
> +    if (!hitTestResult->absoluteLinkURL().isEmpty())
> +        return [self _defaultMenuItemsForLink];

I'd write this as 

if (WebHitTestResult* hitTestResult = _data->_page->activeActionMenuHitTestResult()) {
    if (!hitTestResult->absoluteLinkURL().isEmpty())
        return [self _defaultMenuItemsForLink];
}

return @[]
Comment 6 Beth Dakin 2014-10-20 14:00:45 PDT
Thanks Anders! http://trac.webkit.org/changeset/174908