RESOLVED FIXED Bug 222014
Change App Highlight delegate to pass more information about the highlight for display.
https://bugs.webkit.org/show_bug.cgi?id=222014
Summary Change App Highlight delegate to pass more information about the highlight fo...
Megan Gardner
Reported 2021-02-16 17:53:14 PST
Change App Highlight delegate to pass more information about the highlight for display.
Attachments
Patch (14.72 KB, patch)
2021-02-16 17:55 PST, Megan Gardner
ews-feeder: commit-queue-
Patch (14.64 KB, patch)
2021-02-16 18:28 PST, Megan Gardner
ews-feeder: commit-queue-
Patch (22.49 KB, patch)
2021-02-16 19:59 PST, Megan Gardner
no flags
Patch (23.16 KB, patch)
2021-02-17 00:56 PST, Megan Gardner
no flags
Patch (22.55 KB, patch)
2021-02-17 01:12 PST, Megan Gardner
no flags
Patch (22.58 KB, patch)
2021-02-17 02:07 PST, Megan Gardner
no flags
Patch for landing (22.58 KB, patch)
2021-02-17 09:14 PST, Megan Gardner
no flags
Megan Gardner
Comment 1 2021-02-16 17:55:23 PST
Tim Horton
Comment 2 2021-02-16 18:04:10 PST
Comment on attachment 420570 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=420570&action=review > Source/WebKit/UIProcess/API/Cocoa/_WKAppHighlight.h:37 > +- (instancetype) init NS_UNAVAILABLE; )init > Source/WebKit/UIProcess/API/Cocoa/_WKAppHighlight.h:39 > +@property (nonatomic, readonly, copy) NSData *data; I think just "data" is a bit mysterious. This is the thing that you pass to "restore", right? I think we can come up with a name. > Source/WebKit/UIProcess/API/Cocoa/_WKAppHighlight.h:49 > +@property (nonatomic, readonly) BOOL newGroup; This one doesn't make sense here and should be the second parameter on the method, I think > Source/WebKit/UIProcess/API/Cocoa/_WKAppHighlight.mm:2 > + * Copyright (C) 20201 Apple Inc. All rights reserved. Wow that's a distant future you've got there > Source/WebKit/UIProcess/API/Cocoa/_WKAppHighlightDelegate.h:36 > +- (void)_webView:(WKWebView *)webView storeAppHighlight:(_WKAppHighlight *)highlight WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); I propose: _webView:didCreateHighlight:creatingNewGroup:
Tim Horton
Comment 3 2021-02-16 18:06:43 PST
> _webView:didCreateHighlight:creatingNewGroup: or ... _webView:didCreateHighlight:inNewGroup:?
Megan Gardner
Comment 4 2021-02-16 18:08:11 PST
Comment on attachment 420570 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=420570&action=review >> Source/WebKit/UIProcess/API/Cocoa/_WKAppHighlight.h:39 >> +@property (nonatomic, readonly, copy) NSData *data; > > I think just "data" is a bit mysterious. This is the thing that you pass to "restore", right? I think we can come up with a name. I actually call it 'highlight' in much of the previous patch, but if we come up with an even better name, I'll change it everywhere.
Wenson Hsieh
Comment 5 2021-02-16 18:21:38 PST
Comment on attachment 420570 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=420570&action=review > Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:1432 > + _WKAppHighlight *wkHighlight = [[_WKAppHighlight alloc] initWithData:highlight.highlight->createNSData().get() text:text image:nil createNewGroup:highlight.isNewGroup == WebCore::CreateNewGroupForHighlight::Yes ? YES : NO]; It looks like this will leak.
Megan Gardner
Comment 6 2021-02-16 18:28:40 PST
Megan Gardner
Comment 7 2021-02-16 19:59:49 PST
Tim Horton
Comment 8 2021-02-16 20:35:53 PST
Comment on attachment 420586 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=420586&action=review > Source/WebKit/UIProcess/API/Cocoa/_WKAppHighlight.mm:39 > + _text = text; Where'd the image go > Source/WebKit/UIProcess/API/Cocoa/_WKInspectorExtension.mm:29 > + Too many newlines
Megan Gardner
Comment 9 2021-02-17 00:56:09 PST
Megan Gardner
Comment 10 2021-02-17 01:12:43 PST
Tim Horton
Comment 11 2021-02-17 01:23:48 PST
Comment on attachment 420614 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=420614&action=review > Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:1434 > + if ([delegate respondsToSelector:@selector(_webView:storeAppHighlight:inNewGroup:)]) You should probably just bail at the top, none of this work is worth anything if you're not going to call the delegate. > Source/WebKit/UIProcess/API/Cocoa/_WKAppHighlight.h:41 > +@property (nonatomic, readonly, copy) NSString * text; * is a-floating > Source/WebKit/UIProcess/API/Cocoa/_WKInspectorExtension.mm:29 > + This extraneous newline is still here
Tim Horton
Comment 12 2021-02-17 01:24:32 PST
Comment on attachment 420614 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=420614&action=review > Source/WebKit/UIProcess/API/Cocoa/_WKAppHighlight.mm:39 > + _text = text; Where'd the image go? I think you missed my last set of comments
Megan Gardner
Comment 13 2021-02-17 02:07:14 PST
Megan Gardner
Comment 14 2021-02-17 09:14:27 PST
Created attachment 420655 [details] Patch for landing
EWS
Comment 15 2021-02-17 10:38:43 PST
Committed r273013: <https://commits.webkit.org/r273013> All reviewed patches have been landed. Closing bug and clearing flags on attachment 420655 [details].
Radar WebKit Bug Importer
Comment 16 2021-02-17 10:39:13 PST
Note You need to log in before you can comment on or make changes to this bug.