Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 6bab27e2e35e1637493df40e8d4c296586b23f73 https://github.com/WebKit/WebKit/commit/6bab27e2e35e1637493df40e8d4c296586b23f73 Author: Ryan Reno <rr...@apple.com> Date: 2022-10-19 (Wed, 19 Oct 2022)
Changed paths: M LayoutTests/TestExpectations M LayoutTests/imported/w3c/web-platform-tests/content-security-policy/font-src/font-mismatch-blocked.sub-expected.txt M LayoutTests/imported/w3c/web-platform-tests/content-security-policy/font-src/font-none-blocked.sub-expected.txt M LayoutTests/imported/w3c/web-platform-tests/content-security-policy/reporting/report-preload-and-consume.https-expected.txt M Source/WebCore/loader/LinkLoader.cpp M Source/WebCore/loader/LinkLoader.h Log Message: ----------- Fire error event when link preload fails synchronously. https://bugs.webkit.org/show_bug.cgi?id=246663 rdar://101269688 Reviewed by Youenn Fablet. This fires an error event when fetch fails before scheduling with the Network process when preloading a resource specified by a link element. The code path for firing error events in case of a network error is to return a CachedResource with an error state to a LinkPreloadResourceClient. The client then calls the LinkLoader with the resource and the loader in turn has the HTMLLinkElement fire an event depending on the state of the resource returned. This code path never executes when we block due to CSP since we do not get to the point of scheduling the load with the Network process or even creating the LinkPreloadResourceClient. This change detects that condition and has the HTMLLinkElement fire an error event. See the spec for The fetch and process the linked resource steps here: https://html.spec.whatwg.org/multipage/links.html#preload In particular, we are supposed to return a "network error" when blocking due to CSP and so we should fire an error event: https://fetch.spec.whatwg.org/#main-fetch * LayoutTests/TestExpectations: * LayoutTests/imported/w3c/web-platform-tests/content-security-policy/font-src/font-mismatch-blocked.sub-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/content-security-policy/font-src/font-none-blocked.sub-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/content-security-policy/reporting/report-preload-and-consume.https-expected.txt: * Source/WebCore/loader/LinkLoader.cpp: (WebCore::LinkLoader::triggerError): (WebCore::LinkLoader::preloadIfNeeded): * Source/WebCore/loader/LinkLoader.h: Canonical link: https://commits.webkit.org/255740@main _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes