Bug 139564 - WK2: Need new SPI for Webkit clients to override default immediate action
Summary: WK2: Need new SPI for Webkit clients to override default immediate action
Status: NEW
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-12-11 15:07 PST by Beth Dakin
Modified: 2014-12-12 00:27 PST (History)
8 users (show)

See Also:


Attachments
Patch (8.18 KB, patch)
2014-12-11 15:15 PST, Beth Dakin
no flags Details | Formatted Diff | Diff
Patch (8.48 KB, patch)
2014-12-11 15:28 PST, 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-12-11 15:07:52 PST
WK2: Need new SPI for Webkit clients to override default immediate action

rdar://problem/19225448
Comment 1 Beth Dakin 2014-12-11 15:15:55 PST
Created attachment 243155 [details]
Patch
Comment 2 Beth Dakin 2014-12-11 15:28:25 PST
Created attachment 243156 [details]
Patch
Comment 3 WebKit Commit Bot 2014-12-11 15:29:27 PST
Attachment 243156 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm:200:  An else if statement should be written as an if statement when the prior "if" concludes with a return, break, continue or goto statement.  [readability/control_flow] [4]
Total errors found: 1 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Tim Horton 2014-12-11 15:30:20 PST
Comment on attachment 243156 [details]
Patch

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

> Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h:129
> +// do something custom, return an id that conforms to the NSImmediateActionAnimationController protocol.

"an object" instead of "an id", maybe.

> Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm:201
> +    else if (customClientAnimationController && [customClientAnimationController conformsToProtocol:@protocol(NSImmediateActionAnimationController)])

No need for the else if because of the return.
Comment 5 Tim Horton 2014-12-11 15:31:10 PST
Comment on attachment 243156 [details]
Patch

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

> Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm:197
> +    id customClientAnimationController = [_wkView _immediateActionAnimationControllerForHitTestResult:toAPI(hitTestResult.get()) withType:_type userData:toAPI(_userData.get())];

I wonder if we should do this (and the early return) earlier so we avoid building a defaultAnimationController if we don't need it.
Comment 6 Beth Dakin 2014-12-11 16:19:13 PST
(In reply to comment #5)
> Comment on attachment 243156 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=243156&action=review
> 
> > Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm:197
> > +    id customClientAnimationController = [_wkView _immediateActionAnimationControllerForHitTestResult:toAPI(hitTestResult.get()) withType:_type userData:toAPI(_userData.get())];
> 
> I wonder if we should do this (and the early return) earlier so we avoid
> building a defaultAnimationController if we don't need it.

Good idea, but then we won't have the _type set yet!
Comment 7 Tim Horton 2014-12-12 00:27:48 PST
Ah, yes. Nevermind!