Bug 139423

Summary: Copy and Lookup menu items should be disabled when something is not copyable
Product: WebKit Reporter: Beth Dakin <bdakin>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, commit-queue, esprehn+autocc, glenn, kondapallykalyan, thorton
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch thorton: review+

Description Beth Dakin 2014-12-08 16:58:53 PST
Copy and Lookup menu items should be disabled when something is not selectable

rdar://problem/19149219
Comment 1 Beth Dakin 2014-12-08 17:05:32 PST
Created attachment 242864 [details]
Patch
Comment 2 Tim Horton 2014-12-08 17:12:45 PST
Comment on attachment 242864 [details]
Patch

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

> Source/WebCore/rendering/HitTestResult.cpp:549
> +    Node* node = innerNode();

It seems like we need to run over all of the nodes in the range that we expand out to, not just the HitTestResult's innerNode (for user-select: none).

> Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:783
> +    if (!hitTestResult->allowsCopy()) {

You can move this into the thing that makes them.

> Source/WebKit/mac/WebView/WebActionMenuController.mm:481
> +    if (!_hitTestResult.allowsCopy()) {

Ditto.
Comment 3 Beth Dakin 2014-12-08 17:30:07 PST
Thank you! http://trac.webkit.org/changeset/176999