Bug 196291 - Add SPI to access the WKNavigation from the navigation action and response
Summary: Add SPI to access the WKNavigation from the navigation action and response
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-03-27 00:00 PDT by David Quesada
Modified: 2019-04-09 15:21 PDT (History)
6 users (show)

See Also:


Attachments
Patch (22.99 KB, patch)
2019-03-27 00:09 PDT, David Quesada
no flags Details | Formatted Diff | Diff
Patch v2 (23.21 KB, patch)
2019-03-27 09:47 PDT, David Quesada
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Quesada 2019-03-27 00:00:39 PDT
There is WKNavigationAction._mainFrameNavigation to access the navigation from the action. There should be similar SPI that works for subframe navigation actions and for the WKNavigationResponse.
Comment 1 David Quesada 2019-03-27 00:02:02 PDT
rdar://problem/49310648
Comment 2 David Quesada 2019-03-27 00:09:06 PDT
Created attachment 366059 [details]
Patch
Comment 3 David Quesada 2019-03-27 09:47:10 PDT
Created attachment 366076 [details]
Patch v2

Try to fix the GTK and WPE builds
Comment 4 Sam Weinig 2019-03-27 11:21:16 PDT
This seems odd to me. WKNavigation is supposed to represent, and is publicly document as such, the navigation of a "webpage", which maps to main-frame navigations. I'm not sure exposing, even as SPI, navigation objects for subframes makes all that much sense.
Comment 5 Chris Dumez 2019-04-09 12:30:07 PDT
Comment on attachment 366076 [details]
Patch v2

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

> Source/WebKit/ChangeLog:9
> +        Given a WKNavigationAction or a WKNavigationResponse, it should be possible to determine

Sam is right that WKNavigation is supposed to represent a page (aka main frame) navigation so exposing it for subframes seems odd.
Comment 6 Geoffrey Garen 2019-04-09 12:58:38 PDT
I think you could achieve your stated goal by giving WKNavigationAction a property indicating whether it has the download attribute, and giving WKNavigationResponse a pointer to WKNavigationAction. That would avoid introducing a WKNavigation object for things that are not main frame navigations.
Comment 7 David Quesada 2019-04-09 15:21:39 PDT
Comment on attachment 366076 [details]
Patch v2

After talking about this a bit more, Alex and I came up with another solution.