script: Some failed requests should record resource timing entries (#41804)

Some failed requests should record resource timing entries

Testing: ./mach test-wpt
tests/wpt/tests/resource-timing/entries-for-network-errors.sub.https.html
Fixes: https://github.com/servo/servo/issues/41667

---------

Signed-off-by: bellau <laurent.belmonte@gmail.com>
This commit is contained in:
Laurent Belmonte
2026-01-14 14:20:12 +01:00
committed by GitHub
parent 77a1a2546c
commit 0dc28296e0
31 changed files with 182 additions and 212 deletions

View File

@@ -3825,7 +3825,12 @@ impl FetchResponseListener for HTMLMediaElementFetchListener {
}
}
fn process_response_eof(self, _: RequestId, status: Result<ResourceFetchTiming, NetworkError>) {
fn process_response_eof(
self,
_: RequestId,
status: Result<(), NetworkError>,
timing: ResourceFetchTiming,
) {
let element = self.element.root();
// <https://html.spec.whatwg.org/multipage/#media-data-processing-steps-list>
@@ -3884,9 +3889,7 @@ impl FetchResponseListener for HTMLMediaElementFetchListener {
element.media_data_processing_failure_steps();
}
if let Ok(response) = status {
network_listener::submit_timing(&self, &response, CanGc::note());
}
network_listener::submit_timing(&self, &status, &timing, CanGc::note());
}
fn process_csp_violations(&mut self, _request_id: RequestId, violations: Vec<Violation>) {