Bug 138284 - Implement action menus for editable text
Summary: Implement action menus for editable text
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-01 15:49 PDT by Beth Dakin
Modified: 2014-11-03 10:39 PST (History)
8 users (show)

See Also:


Attachments
Patch (11.76 KB, patch)
2014-11-01 16:21 PDT, Beth Dakin
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Beth Dakin 2014-11-01 15:49:10 PDT
Implement action menus for editable text.

rdar://problem/18742323
Comment 1 Beth Dakin 2014-11-01 16:21:18 PDT
Created attachment 240797 [details]
Patch
Comment 2 WebKit Commit Bot 2014-11-01 16:22:52 PDT
Attachment 240797 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:340:  This { should be at the end of the previous line  [whitespace/braces] [4]
Total errors found: 1 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Tim Horton 2014-11-01 17:10:35 PDT
Comment on attachment 240797 [details]
Patch

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

> Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:339
> +-(void)_paste:(id)sender

"copyText", but "paste"? copy can copy things that aren't text; can we go with _copy and _paste or _performCopy and _performPaste or something?

> Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:496
> +    return hitTestResult;

.release() here, I think

> Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:503
> +        _type = kWKActionMenuNone;

unfortunate that the 'none' case is duplicated now.

> Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:518
> +        if (DDActionContext *actionContext = _hitTestResult.actionContext.get()) {

We should shuffle this out into a "defaultMenuItemsForDataDetectedItem" or something, so that these all look the same.
Comment 4 Beth Dakin 2014-11-03 10:27:41 PST
(In reply to comment #3)
> Comment on attachment 240797 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=240797&action=review
> 
> > Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:339
> > +-(void)_paste:(id)sender
> 
> "copyText", but "paste"? copy can copy things that aren't text; can we go
> with _copy and _paste or _performCopy and _performPaste or something?
> 

They are inconsistent. I do think that copy needs a more specific name because right now it will just copy the current selection. So perhaps copySelection is right for copy. paste still seems like the most accurate way to describe paste, but I suppose we could go with the somewhat redundant pasteFromPasteboard?! I'll think about it, but fix copy for sure.

> > Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:496
> > +    return hitTestResult;
> 
> .release() here, I think
> 

Ah yes.

> > Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:503
> > +        _type = kWKActionMenuNone;
> 
> unfortunate that the 'none' case is duplicated now.
> 

I know. It seems so crazy to have all the rest of it nested in an if though.

> > Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:518
> > +        if (DDActionContext *actionContext = _hitTestResult.actionContext.get()) {
> 
> We should shuffle this out into a "defaultMenuItemsForDataDetectedItem" or
> something, so that these all look the same.

Will do.

Thanks you!
Comment 5 Beth Dakin 2014-11-03 10:39:02 PST
http://trac.webkit.org/changeset/175474