Summary: | WK2: Need new SPI for Webkit clients to override default immediate action | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Beth Dakin <bdakin> | ||||||
Component: | WebKit2 | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | NEW --- | ||||||||
Severity: | Normal | CC: | bdakin, commit-queue, eric.carlson, glenn, jer.noble, philipj, sergio, thorton | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Beth Dakin
2014-12-11 15:07:52 PST
Created attachment 243155 [details]
Patch
Created attachment 243156 [details]
Patch
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 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 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. (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! Ah, yes. Nevermind! |