Skip to content

Web fonts do not create resource timing entries #41660

@jdm

Description

@jdm

All of the FetchResponseListener implementations in the script crate call submit_timing to record ResourceTiming entries for the request. Web fonts do not have any hooks for that right now:

FetchResponseMsg::ProcessResponseEOF(_, response) => {
trace!(
"@font-face {} EOF={:?}",
self.web_font_family_name, response
);
if response.is_err() || !self.response_valid {
return DownloaderResponseResult::Failure;
}
DownloaderResponseResult::Finished

We should replicate how the font code hooks into the CSP violation reports (

self.state
.as_ref()
.expect("must have download state before termination")
.document_context
.csp_handler
.process_violations(violations);
) so that the code in
pub(crate) fn web_font_context(&self) -> WebFontDocumentContext {
can provide a callback object that submits the timing information appropriately.

This should show some test result changes in ./mach test-wpt tests/wpt/tests/preload/preload-resource-match.https.html.

Metadata

Metadata

Assignees

Labels

A-content/scriptRelated to the script threadA-perf-measurementC-assignedThere is someone working on resolving the issueE-less-complexStraightforward. Recommended for a new contributor.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions