Bug 139568

Summary: WK1: Need new SPI for Webkit clients to override default immediate action
Product: WebKit Reporter: Beth Dakin <bdakin>
Component: WebKit APIAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, bdakin, commit-queue, eric.carlson, glenn, jer.noble, mitz, philipj, sergio, thorton
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
mitz: review+
Follow-up: fix a leak mitz: review+

Description Beth Dakin 2014-12-11 16:46:01 PST
WK1: Need new SPI for Webkit clients to override default immediate action

rdar://problem/19225448
Comment 1 Beth Dakin 2014-12-11 17:22:42 PST
Created attachment 243166 [details]
Patch
Comment 2 WebKit Commit Bot 2014-12-11 17:25:23 PST
Attachment 243166 [details] did not pass style-queue:


ERROR: Source/WebKit/mac/WebView/WebImmediateActionController.mm:146:  The parameter name "]" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 mitz 2014-12-11 17:32:17 PST
Comment on attachment 243166 [details]
Patch

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

> Source/WebKit/mac/WebView/WebImmediateActionController.mm:140
> +        defaultAnimationController = (id<NSImmediateActionAnimationController>)qlPreviewLinkItem.get();

Missing space between id and <

> Source/WebKit/mac/WebView/WebImmediateActionController.mm:145
> +    WebElementDictionary *webHitTestResult = [[[WebElementDictionary alloc] initWithHitTestResult:_hitTestResult] autorelease];

We should only make this object if we need it (i.e. if the delegate responds to the selector).
Comment 4 mitz 2014-12-11 17:33:28 PST
Comment on attachment 243166 [details]
Patch

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

>> Source/WebKit/mac/WebView/WebImmediateActionController.mm:145
>> +    WebElementDictionary *webHitTestResult = [[[WebElementDictionary alloc] initWithHitTestResult:_hitTestResult] autorelease];
> 
> We should only make this object if we need it (i.e. if the delegate responds to the selector).

Oh, and instead of autorelease we should RetainPtr it!
Comment 5 Beth Dakin 2014-12-11 17:48:47 PST
Thank you!! I addressed all of the comments.

http://trac.webkit.org/changeset/177199
Comment 6 mitz 2014-12-11 17:59:13 PST
Created attachment 243169 [details]
Follow-up: fix a leak
Comment 7 mitz 2014-12-11 18:00:32 PST
(In reply to comment #5)
> Thank you!! I addressed all of the comments.
> 
> http://trac.webkit.org/changeset/177199

My RetainPtr advice led to a leak. Please review the fix in attachment 243169 [details].
Comment 8 mitz 2014-12-11 18:14:57 PST
Comment on attachment 243169 [details]
Follow-up: fix a leak

Anders reviewed this.
Comment 9 mitz 2014-12-11 18:16:01 PST
Fixed the leak in
http://trac.webkit.org/changeset/177201