Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: af3738924f767a576348b9730ef598920dd722cc
https://github.com/WebKit/WebKit/commit/af3738924f767a576348b9730ef598920dd722cc
Author: David Kilzer <[email protected]>
Date: 2026-07-22 (Wed, 22 Jul 2026)
Changed paths:
M Source/WebCore/loader/DocumentLoader.cpp
M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
A
Tools/TestWebKitAPI/Tests/WebKitLegacy/cocoa/SubstituteDataLocalResourceAccess.mm
Log Message:
-----------
REGRESSION (292080@main): [WK1]
DocumentLoader::m_originalSubstituteDataWasValid is always false because it
reads a moved-from SubstituteData
<https://bugs.webkit.org/show_bug.cgi?id=319892>
<rdar://182804763>
Reviewed by Brent Fulgham.
The constructor initializes `m_substituteData` from the moved-from
`substituteData` parameter, then reads `substituteData.isValid()` to
compute `m_originalSubstituteDataWasValid`. Member initialization
follows declaration order, and `m_substituteData` is declared before
`m_originalSubstituteDataWasValid`, so `substituteData` has already
been moved from by the time `isValid()` is called on it, making the
field always false regardless of the original data's validity.
`m_originalSubstituteDataWasValid` gates the local-resource-load grant
in `DocumentLoader::commitData()`, so this silently drops local
resource access for documents loaded with substitute data.
Test:
Tools/TestWebKitAPI/Tests/WebKitLegacy/cocoa/SubstituteDataLocalResourceAccess.mm
* Source/WebCore/loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::DocumentLoader):
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
*
Tools/TestWebKitAPI/Tests/WebKitLegacy/cocoa/SubstituteDataLocalResourceAccess.mm:
Add.
(TestWebKitAPI::TEST(WebKitLegacy, SubstituteDataDocumentCanLoadLocalResource)):
Canonical link: https://commits.webkit.org/317750@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications