[webkit-changes] [WebKit/WebKit] 38a194: Implement printNavigationErrorMessage with site is...

Alex Christensen noreply at github.com
Thu Apr 4 09:06:46 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 38a194b1080ba3d5db300fabc999b8e8fc30225e
      https://github.com/WebKit/WebKit/commit/38a194b1080ba3d5db300fabc999b8e8fc30225e
  Author: Alex Christensen <achristensen at apple.com>
  Date:   2024-04-04 (Thu, 04 Apr 2024)

  Changed paths:
    M LayoutTests/fast/loader/window-open-to-invalid-url-calls-policy-delegate.html
    M LayoutTests/platform/mac-site-isolation/TestExpectations
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/page/Frame.h
    M Source/WebCore/page/LocalFrame.cpp
    M Source/WebCore/page/LocalFrame.h
    M Source/WebCore/page/RemoteFrame.cpp
    M Source/WebCore/page/RemoteFrame.h
    M Source/WebCore/page/RemoteFrameClient.h
    M Source/WebKit/UIProcess/API/C/WKPageInjectedBundleClient.h
    M Source/WebKit/UIProcess/WebPageInjectedBundleClient.cpp
    M Source/WebKit/UIProcess/WebPageInjectedBundleClient.h
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/UIProcess/WebPageProxy.messages.in
    M Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
    M Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.h
    M Source/WebKit/WebProcess/WebCoreSupport/WebRemoteFrameClient.cpp
    M Source/WebKit/WebProcess/WebCoreSupport/WebRemoteFrameClient.h
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.h
    M Tools/DumpRenderTree/TestRunner.cpp
    M Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
    M Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
    M Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
    M Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
    M Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
    M Tools/WebKitTestRunner/TestController.cpp

  Log Message:
  -----------
  Implement printNavigationErrorMessage with site isolation
https://bugs.webkit.org/show_bug.cgi?id=272135
rdar://125885740

Reviewed by Charlie Wolfe.

printNavigationErrorMessage would be easy to implement if we didn't want to print the URL of
the frame whose navigation was unsuccessfully attempted.  Having both URLs is useful for
the web inspector, but if the target frame is a RemoteFrame, then the current process does
not and should not have the URL.  To keep the test output the same and keep the inspector
log useful, if the Frame is a RemoteFrame, then send an asynchronous message to a process
that has the URL before printing to the console.

When we do this, we now have console output that doesn't appear immediately.  We have to
wait for it to arrive.  I implemented this by adding TestRunner.flushConsoleLogs, which just
needs to send a round trip message to the UI process.  Unfortunately, in order to have the
reply sent to the right process, we can't just use WKPagePostMessageToInjectedBundle like
we have so far because that always sends a message to the main frame's process.  We need
a new bundle SPI, WKBundlePagePostMessageWithAsyncReply, which sends the reply to whatever
process sent the message.  Migrating other use of cacheTestRunnerCallback and
callTestRunnerCallback to this will probably make our test infrastructure a little more
site-isolation-friendly.

* LayoutTests/fast/loader/window-open-to-invalid-url-calls-policy-delegate.html:
* LayoutTests/platform/mac-site-isolation/TestExpectations:
* Source/WebCore/dom/Document.cpp:
(WebCore::printNavigationErrorMessage):
(WebCore::Document::canNavigate):
(WebCore::Document::canNavigateInternal):
* Source/WebCore/page/Frame.h:
* Source/WebCore/page/LocalFrame.cpp:
(WebCore::LocalFrame::documentURLForConsoleLog):
* Source/WebCore/page/LocalFrame.h:
* Source/WebCore/page/RemoteFrame.cpp:
(WebCore::RemoteFrame::documentURLForConsoleLog):
* Source/WebCore/page/RemoteFrame.h:
* Source/WebCore/page/RemoteFrameClient.h:
* Source/WebKit/UIProcess/API/C/WKPageInjectedBundleClient.h:
* Source/WebKit/UIProcess/WebPageInjectedBundleClient.cpp:
(WebKit::WebPageInjectedBundleClient::didReceiveAsyncMessageFromInjectedBundle):
* Source/WebKit/UIProcess/WebPageInjectedBundleClient.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleMessageWithAsyncReply):
(WebKit::WebPageProxy::documentURLForConsoleLog):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.messages.in:
* Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePagePostMessageWithAsyncReply):
* Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* Source/WebKit/WebProcess/WebCoreSupport/WebRemoteFrameClient.cpp:
(WebKit::WebRemoteFrameClient::documentURLForConsoleLog):
* Source/WebKit/WebProcess/WebCoreSupport/WebRemoteFrameClient.h:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::postMessageWithAsyncReply):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Tools/DumpRenderTree/TestRunner.cpp:
(flushConsoleLogsCallback):
(TestRunner::staticFunctions):
* Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::firstRootFrame):
(WTR::firstRootFrameJSContext):
(WTR::asyncReplyHandler):
(WTR::postMessageWithAsyncReply):
* Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h:
* Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::flushConsoleLogs):
* Tools/WebKitTestRunner/InjectedBundle/TestRunner.h:
* Tools/WebKitTestRunner/TestController.cpp:
(WTR::TestController::createOtherPlatformWebView):
(WTR::TestController::createWebViewWithOptions):

Canonical link: https://commits.webkit.org/277055@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list