Bug 143916

Summary: Implement immediate action support for tel: and mailto: URLs
Product: WebKit Reporter: Tim Horton <thorton>
Component: New BugsAssignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, bfulgham, commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch darin: review+

Description Tim Horton 2015-04-18 00:32:33 PDT
Implement immediate action support for tel: and mailto: URLs
Comment 1 Tim Horton 2015-04-18 00:33:15 PDT
Created attachment 251086 [details]
Patch
Comment 2 WebKit Commit Bot 2015-04-18 00:34:37 PDT
Attachment 251086 [details] did not pass style-queue:


ERROR: Source/WebKit/mac/WebView/WebImmediateActionController.mm:415:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit/mac/WebView/WebImmediateActionController.mm:416:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit/mac/WebView/WebImmediateActionController.mm:418:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm:437:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm:438:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm:441:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 6 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Tim Horton 2015-04-18 00:42:09 PDT
Created attachment 251087 [details]
Patch
Comment 4 Tim Horton 2015-04-18 00:42:50 PDT
<rdar://problem/19721711>
Comment 5 WebKit Commit Bot 2015-04-18 00:45:34 PDT
Attachment 251087 [details] did not pass style-queue:


ERROR: Source/WebKit/mac/WebView/WebImmediateActionController.mm:415:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit/mac/WebView/WebImmediateActionController.mm:416:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit/mac/WebView/WebImmediateActionController.mm:418:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm:437:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm:438:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm:441:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 6 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Darin Adler 2015-04-18 12:09:11 PDT
Comment on attachment 251087 [details]
Patch

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

> Source/WebKit/mac/WebView/WebImmediateActionController.mm:232
> +            RefPtr<TextIndicator> linkTextIndicator = TextIndicator::createWithRange(*linkRange, TextIndicatorPresentationTransition::FadeIn);

Code you just indented: I would call this just indicator or textIndicator; local variables don’t need globally clear names.

> Source/WebKit/mac/WebView/WebImmediateActionController.mm:235
> +            RetainPtr<QLPreviewMenuItem> qlPreviewLinkItem = [NSMenuItem standardQuickLookMenuItem];

Code you just indented: Why does this use a RetainPtr? Does not need one. I would call this just item or menuItem. Local variables don’t need globally clear names.

> Source/WebKit/mac/WebView/WebImmediateActionController.mm:245
> +        if (id<NSImmediateActionAnimationController> animationController = [self _animationControllerForDataDetectedText]) {

Can this use auto?

> Source/WebKit/mac/WebView/WebImmediateActionController.mm:413
> +    RefPtr<TextIndicator> linkTextIndicator = TextIndicator::createWithRange(*linkRange, TextIndicatorPresentationTransition::FadeIn);

Shorter name as I suggested above?

> Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm:294
> +            RetainPtr<QLPreviewMenuItem> qlPreviewLinkItem = [NSMenuItem standardQuickLookMenuItem];
> +            [qlPreviewLinkItem setPreviewStyle:QLPreviewStylePopover];
> +            [qlPreviewLinkItem setDelegate:self];
> +            _currentQLPreviewMenuItem = qlPreviewLinkItem.get();

Really lame that we simply have this duplicated for legacy and modern WebKit. Need a code sharing strategy to avoid doing more and more of this over time for features like this one. All my comments above apply here as well, given that!

> Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm:428
> +    RetainPtr<DDActionContext> actionContext = adoptNS([allocDDActionContextInstance() init]);

Ditto.
Comment 7 Tim Horton 2015-04-19 01:03:15 PDT
(In reply to comment #6)
> Comment on attachment 251087 [details]
> Patch
> 

All the other comments sound good to me!

> Really lame that we simply have this duplicated for legacy and modern
> WebKit. Need a code sharing strategy to avoid doing more and more of this
> over time for features like this one. All my comments above apply here as
> well, given that!

I wholeheartedly agree; the maintenance burden has already been significant. I have a plan for a merger, but haven't had a chance to enact it, and now we've spent months making changes in two places.
Comment 8 Tim Horton 2015-04-20 11:48:42 PDT
http://trac.webkit.org/changeset/183019