Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 9ad018d8745abfa94d8def9d4bded127e9d6e690
https://github.com/WebKit/WebKit/commit/9ad018d8745abfa94d8def9d4bded127e9d6e690
Author: Qianlang Chen <[email protected]>
Date: 2026-01-14 (Wed, 14 Jan 2026)
Changed paths:
M LayoutTests/platform/mac-wk2/TestExpectations
M Source/WebCore/inspector/WebInjectedScriptManager.cpp
Log Message:
-----------
REGRESSION (305166@main): [ macOS ]
http/tests/lists/list-new-parent-no-sibling-append.html is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=305069
rdar://problem/167718210
Reviewed by BJ Burg.
Summary: Restore to the original behavior of discarding injected scripts
instead of deallocating the commandLineAPIHost when the last client
disconnects. Fix the timing bug that prevents deallocation from working
in a follow-up.
Originally, this is how the PageInspectorController handled its
InjectedScriptManager (ISM) while being the sole owner:
1. When the first frontend connects, call ISM->connect to create the
commandLineAPIHost.
2. When the last frontend disconnects, call ISM->discardInjectedScripts
as a clean up but keeping the API host alive.
3. When the page is destroyed while there's connected frontend, call
ISM->disconnect to clean up and also destroy the API host.
Given the presence of frame targets, which in the case of remote frames
may exist without a page target to manage the ISM, in 305166@main we
introduce a client-counting strategy for ISM. That patch mostly retained
the above original behavior, except in case 2 we called ISM->disconnect
instead. The expectation was that all inspector agents should be
notified about the connection closing and will cease using the ISM
again.
However that wasn't the case: in the event of a cross-origin navigation
and PSON triggered, local debugging shows the console agent from a frame
target may still use the ISM unexpectedly after being reported the
frontend disconnection.
To prioritize addressing an observable regression in the build, restore
case 2 to the original behavior. Filed https://webkit.org/b/305415 as
the follow-up to fix this remaining timing issue and make calling
ISM->disconnect work as intended.
The test list-new-parent-no-sibling-append.html should now progress.
* LayoutTests/platform/mac-wk2/TestExpectations:
* Source/WebCore/inspector/WebInjectedScriptManager.cpp:
(WebCore::WebInjectedScriptManager::removeClient):
Canonical link: https://commits.webkit.org/305619@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications