Calls to WKPage and WKWebView API used to load data and strings directly should be recognized by the loading code as being from client API calls. This brings these API behaviors into alignment with similar API for loading URLs and URLRequests directly. This change also allows us to enforce stricter handling of Data URLs, and to remove the need to explicitly permit top-level data URL navigation when client APIs are used.
<rdar://problem/59568037>
Created attachment 391103 [details] Patch
Comment on attachment 391103 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=391103&action=review > Source/WebKit/UIProcess/ProvisionalPageProxy.cpp:156 > + m_page.loadDataWithNavigationShared(m_process.copyRef(), m_webPageID, navigation, data, MIMEType, encoding, baseURL, userData, WebCore::ShouldTreatAsContinuingLoad::Yes, WebCore::ShouldTreatAsClientOrUserInput::No, WTFMove(websitePolicies), navigation.lastNavigationAction().shouldOpenExternalURLsPolicy); @Youenn, @Chris: Should we ever treat ProvisionalPageProxy loads as if they were generated from client API? It doesn't look like we do for normal load requests, so I don't think we would for data loads, either.
Created attachment 391108 [details] Patch
Comment on attachment 391108 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=391108&action=review > Source/WebKit/UIProcess/WebPageProxy.cpp:1385 > +void WebPageProxy::loadDataWithNavigationShared(Ref<WebProcessProxy>&& process, WebCore::PageIdentifier webPageID, API::Navigation& navigation, const IPC::DataReference& data, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad, ShouldTreatAsClientOrUserInput shouldTreatAsClientOrUserInput, Optional<WebsitePoliciesData>&& websitePolicies, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy) This is always called from API so it seems odd to take a ShouldTreatAsClientOrUserInput parameter. When is it ever ShouldTreatAsClientOrUserInput::No?
Note: We allowed top-level navigations to Data URLs in r255961. We can go back to our previous state with this change.
(In reply to Chris Dumez from comment #5) > Comment on attachment 391108 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=391108&action=review > > > Source/WebKit/UIProcess/WebPageProxy.cpp:1385 > > +void WebPageProxy::loadDataWithNavigationShared(Ref<WebProcessProxy>&& process, WebCore::PageIdentifier webPageID, API::Navigation& navigation, const IPC::DataReference& data, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad, ShouldTreatAsClientOrUserInput shouldTreatAsClientOrUserInput, Optional<WebsitePoliciesData>&& websitePolicies, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy) > > This is always called from API so it seems odd to take a > ShouldTreatAsClientOrUserInput parameter. When is it ever > ShouldTreatAsClientOrUserInput::No? Excellent -- this can be a much simpler change, then.
Created attachment 391113 [details] Patch
Created attachment 391125 [details] Patch
Comment on attachment 391125 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=391125&action=review > Source/WebCore/ChangeLog:3 > + Recognize WKPage and WKWebView calls as generated by client API use Wrong title here.
Comment on attachment 391125 [details] Patch LGTM too.
Created attachment 391175 [details] Patch for landing
Comment on attachment 391175 [details] Patch for landing Clearing flags on attachment: 391175 Committed r256925: <https://trac.webkit.org/changeset/256925>
All reviewed patches have been landed. Closing bug.