RESOLVED FIXED 187826
Add WKNavigation/WKNavigationAction related SPI
https://bugs.webkit.org/show_bug.cgi?id=187826
Summary Add WKNavigation/WKNavigationAction related SPI
Brady Eidson
Reported 2018-07-19 15:48:15 PDT
Add WKNavigation/WKNavigationAction related SPI This includes: - Exposing the WKNavigation on WKNavigationAction if there is one - Exposing a C-API method to start a load and get back a WKNavigation
Attachments
Patch (15.80 KB, patch)
2018-07-19 15:50 PDT, Brady Eidson
no flags
Patch (14.08 KB, patch)
2018-07-19 15:53 PDT, Brady Eidson
no flags
Patch (15.56 KB, patch)
2018-07-19 18:43 PDT, Brady Eidson
no flags
Archive of layout-test-results from ews206 for win-future (13.03 MB, application/zip)
2018-07-19 22:34 PDT, EWS Watchlist
no flags
Patch (15.56 KB, patch)
2018-07-20 07:40 PDT, Brady Eidson
no flags
Patch (15.56 KB, patch)
2018-07-20 09:29 PDT, Brady Eidson
no flags
Brady Eidson
Comment 1 2018-07-19 15:48:32 PDT
Brady Eidson
Comment 2 2018-07-19 15:50:48 PDT
Tim Horton
Comment 3 2018-07-19 15:52:44 PDT
Comment on attachment 345394 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=345394&action=review > Tools/ChangeLog:13 > +2018-07-19 Brady Eidson <beidson@apple.com> What's going on here
Brady Eidson
Comment 4 2018-07-19 15:53:27 PDT
Chris Dumez
Comment 5 2018-07-19 15:55:18 PDT
Comment on attachment 345395 [details] Patch r=me
Alex Christensen
Comment 6 2018-07-19 15:58:02 PDT
Comment on attachment 345395 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=345395&action=review > Source/WebKit/UIProcess/API/APINavigationAction.h:82 > + NavigationAction(WebKit::NavigationActionData&& navigationActionData, API::FrameInfo* sourceFrame, API::FrameInfo* targetFrame, std::optional<WTF::String> targetFrameName, WebCore::ResourceRequest&& request, const WebCore::URL& originalURL, bool shouldOpenAppLinks, RefPtr<UserInitiatedAction>&& userInitiatedAction) Can't you use a default value instead of making another constructor? API::Navigation* mainFrameNavigation = nullptr
Alex Christensen
Comment 7 2018-07-19 16:03:42 PDT
Comment on attachment 345395 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=345395&action=review > Source/WebKit/UIProcess/API/Cocoa/WKNavigationActionPrivate.h:59 > +@property (nonatomic, readonly) WKNavigation *_mainFrameNavigation WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); This feels messy. Is there really no way to access this from the client? We already tell the client about each navigation, and the client can know whether the frame is the main frame or not. > Source/WebKit/UIProcess/WebPageProxy.cpp:4026 > + API::Navigation *mainFrameNavigation = frame->isMainFrame() ? navigation.get() : nullptr; * is in the wrong place.
Brady Eidson
Comment 8 2018-07-19 17:14:07 PDT
(In reply to Alex Christensen from comment #7) > Comment on attachment 345395 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=345395&action=review > > > Source/WebKit/UIProcess/API/Cocoa/WKNavigationActionPrivate.h:59 > > +@property (nonatomic, readonly) WKNavigation *_mainFrameNavigation WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); > > This feels messy. Is there really no way to access this from the client? > We already tell the client about each navigation, and the client can know > whether the frame is the main frame or not. We do not tell the client about every navigation, that's actually wrong. Regardless, at "decide policy" time the client has no way of knowing which navigation is being considered, and that ability is what this patch adds (Note: Only main frames have WKNavigations, hence the name of the variable) > > Source/WebKit/UIProcess/WebPageProxy.cpp:4026 > > + API::Navigation *mainFrameNavigation = frame->isMainFrame() ? navigation.get() : nullptr; > > * is in the wrong place. Indeed will fix.
Brady Eidson
Comment 9 2018-07-19 17:14:27 PDT
(In reply to Alex Christensen from comment #6) > Comment on attachment 345395 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=345395&action=review > > > Source/WebKit/UIProcess/API/APINavigationAction.h:82 > > + NavigationAction(WebKit::NavigationActionData&& navigationActionData, API::FrameInfo* sourceFrame, API::FrameInfo* targetFrame, std::optional<WTF::String> targetFrameName, WebCore::ResourceRequest&& request, const WebCore::URL& originalURL, bool shouldOpenAppLinks, RefPtr<UserInitiatedAction>&& userInitiatedAction) > > Can't you use a default value instead of making another constructor? > API::Navigation* mainFrameNavigation = nullptr Will do.
Brady Eidson
Comment 10 2018-07-19 18:31:19 PDT
(In reply to Brady Eidson from comment #9) > (In reply to Alex Christensen from comment #6) > > Comment on attachment 345395 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=345395&action=review > > > > > Source/WebKit/UIProcess/API/APINavigationAction.h:82 > > > + NavigationAction(WebKit::NavigationActionData&& navigationActionData, API::FrameInfo* sourceFrame, API::FrameInfo* targetFrame, std::optional<WTF::String> targetFrameName, WebCore::ResourceRequest&& request, const WebCore::URL& originalURL, bool shouldOpenAppLinks, RefPtr<UserInitiatedAction>&& userInitiatedAction) > > > > Can't you use a default value instead of making another constructor? > > API::Navigation* mainFrameNavigation = nullptr > > Will do. Actually, no, sorry I misunderstood in the moment. I think default values to arguments to function calls are bad. :P
Brady Eidson
Comment 11 2018-07-19 18:43:50 PDT
EWS Watchlist
Comment 12 2018-07-19 18:45:26 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
EWS Watchlist
Comment 13 2018-07-19 22:34:00 PDT
Comment on attachment 345416 [details] Patch Attachment 345416 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/8595681 New failing tests: http/tests/security/contentSecurityPolicy/video-with-https-url-allowed-by-csp-media-src-star.html
EWS Watchlist
Comment 14 2018-07-19 22:34:12 PDT
Created attachment 345428 [details] Archive of layout-test-results from ews206 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews206 Port: win-future Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Brady Eidson
Comment 15 2018-07-19 23:18:08 PDT
Layout test failure is unrelated.
Brady Eidson
Comment 16 2018-07-19 23:32:33 PDT
Bizarre, it claims 32bit mac build broke but the output doesn't say why - the compilation of the file it claims failed isn't actually in the output. Will build 32-bit locally I guess... =/
Brady Eidson
Comment 17 2018-07-20 07:39:47 PDT
(In reply to Brady Eidson from comment #16) > Bizarre, it claims 32bit mac build broke but the output doesn't say why - > the compilation of the file it claims failed isn't actually in the output. > > Will build 32-bit locally I guess... =/ I can't even get passed JSC locally with 32 bit. resubmitting the patch to see if i get more helpful info
Brady Eidson
Comment 18 2018-07-20 07:40:53 PDT
Brady Eidson
Comment 19 2018-07-20 09:29:03 PDT
WebKit Commit Bot
Comment 20 2018-07-20 10:33:34 PDT
Comment on attachment 345448 [details] Patch Clearing flags on attachment: 345448 Committed r234052: <https://trac.webkit.org/changeset/234052>
WebKit Commit Bot
Comment 21 2018-07-20 10:33:36 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 22 2018-07-20 10:35:18 PDT
Note You need to log in before you can comment on or make changes to this bug.