Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 33b1b5a695b255da07ca71d1e0963fa7d513152d
      
https://github.com/WebKit/WebKit/commit/33b1b5a695b255da07ca71d1e0963fa7d513152d
  Author: Anthony Tarbinian <[email protected]>
  Date:   2026-03-25 (Wed, 25 Mar 2026)

  Changed paths:
    M 
LayoutTests/http/tests/security/block-top-level-navigation-to-different-scheme-by-third-party-iframes-expected.txt
    M 
LayoutTests/http/tests/security/block-top-level-navigations-by-third-party-iframes-expected.txt
    M 
LayoutTests/http/tests/security/resources/navigate-top-level-frame-to-failure-page-different-scheme.html
    M 
LayoutTests/http/tests/security/resources/navigate-top-level-frame-to-failure-page.html
    M LayoutTests/platform/ios-site-isolation/TestExpectations
    M LayoutTests/platform/mac-site-isolation/TestExpectations

  Log Message:
  -----------
  [Site Isolation] Inconsistent console message ordering for tests which use 
Document::printNavigationErrorMessage compared to before Site Isolation
https://bugs.webkit.org/show_bug.cgi?id=310676
rdar://173279243

Reviewed by Sihui Liu.

Tests which trigger Document::printNavigationErrorMessage will print out certain
console log messages differently to their -expected.txt when run with Site 
Isolation
enabled vs disabled.

This is due to the fact that printNavigationErrorMessage calls 
frame.documentURLForConsoleLog.
If frame is a LocalFrame, it will grab the document URL synchronously from
document->url(). However, if frame is a RemoteFrame an asynchronous IPC call is
sent to retrieve the URL.

This difference in timing reveals itself in some tests which include the 
separate
JS Exception which gets thrown in their -expected.txt file. With site isolation 
enabled,
the message from printNavigationErrorMessage gets printed out at a later time 
than
without site isolation. This allows the JS Exception to get printed before and
cause a text diff -> test failure.

See the bugzilla for more details on what the text diff looks like.

To have the console messages be consistent with site isolation enabled and 
disabled
(and avoid having to make a site isolation specific -expected.txt), we can catch
the JS Exception to suppress the message that says "SecurityError: The 
operation is insecure".
This way, we only have the message printed from 
Document::printNavigationErrorMessage which
starts with "Unsafe JavaScript attempt to initate navigation". This way the 
test still checks
for the intended blocking of the navigation and the logs are consistent with 
site isolation
enabled and disabled.

* 
LayoutTests/http/tests/security/block-top-level-navigation-to-different-scheme-by-third-party-iframes-expected.txt:
* 
LayoutTests/http/tests/security/block-top-level-navigations-by-third-party-iframes-expected.txt:
* 
LayoutTests/http/tests/security/resources/navigate-top-level-frame-to-failure-page-different-scheme.html:
* 
LayoutTests/http/tests/security/resources/navigate-top-level-frame-to-failure-page.html:
* LayoutTests/platform/ios-site-isolation/TestExpectations:
* LayoutTests/platform/mac-site-isolation/TestExpectations:

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



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

Reply via email to