Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c271a9ca5212470e42eb1d041157019bbbee6e1b
      
https://github.com/WebKit/WebKit/commit/c271a9ca5212470e42eb1d041157019bbbee6e1b
  Author: Brent Fulgham <[email protected]>
  Date:   2026-05-01 (Fri, 01 May 2026)

  Changed paths:
    M LayoutTests/platform/mac-wk2/TestExpectations
    M LayoutTests/platform/mac/TestExpectations
    M Source/WebCore/page/EventSource.cpp

  Log Message:
  -----------
  
imported/w3c/web-platform-tests/content-security-policy/connect-src/connect-src-eventsource-allowed.sub.html
 is flaky timing out.
https://bugs.webkit.org/show_bug.cgi?id=313561
<rdar://problem/60512303>

Reviewed by Chris Dumez.

The implementation of ThreadableLoader::create() returns nullptr in certain 
cases.
EventSource::connect() does not handle this possibility, and will be left 
permanently
stuck in CONNECTING state: no open or error event is fired, no reconnection is 
scheduled,
and virtualHasPendingActivity() returns true indefinitely. This can cause 
layout tests to
flake with timeouts, and could be the cause of regular page load issues.

To address this, this patch abort the connection attempt when the loader create 
command
fails (returning a nullptr loader). This matches the existing pattern used for 
access
control failures. This transition the state to CLOSED and fires an error event 
so that
callers can respond.

Tests: http/tests/eventsource/eventsource-cors-non-http.html
       http/tests/inspector/network/eventsource-type.html
       
imported/w3c/web-platform-tests/content-security-policy/connect-src/connect-src-eventsource-allowed.sub.html

* LayoutTests/platform/mac-wk2/TestExpectations:
* LayoutTests/platform/mac/TestExpectations:
* Source/WebCore/page/EventSource.cpp:
(WebCore::EventSource::connect): Call `abortConnectionAttempt()` when the 
loader failed
  to be created during a connection attempt.

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



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

Reply via email to