Skip to content

initiatorType does not have a font value #22825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 9, 2022
Merged

Conversation

wbamberg
Copy link
Collaborator

@wbamberg wbamberg commented Dec 8, 2022

"font" is not listed as a value for initiatorType (https://w3c.github.io/resource-timing/#dom-performanceresourcetiming-initiatortype) and in practice, a font loaded using @font-face gets a type of "css" (which we would expect, since it uses url() to load it.

Try https://mdn.github.io/learning-area/css/styling-text/web-fonts/web-font-finished.html with this code:

const observer = new PerformanceObserver((list) => {
  list.getEntries().forEach((entry) => {
    console.log(`${entry.initiatorType} : ${entry.name}`);
  });
});

observer.observe({ type: "resource", buffered: true });

=>

link : https://mdn.github.io/learning-area/css/styling-text/web-fonts/web-font-finished.css
css : https://mdn.github.io/learning-area/css/styling-text/web-fonts/fonts/zantroke-webfont.woff2
css : https://mdn.github.io/learning-area/css/styling-text/web-fonts/fonts/cicle_fina-webfont.woff2
other : https://mdn.github.io/favicon.ico

Also corrected the entry in the parent interface, initiatorType is not the type of resource.

@wbamberg wbamberg requested a review from a team as a code owner December 8, 2022 19:51
@wbamberg wbamberg requested review from sideshowbarker and removed request for a team December 8, 2022 19:51
@github-actions github-actions bot added the Content:WebAPI Web API docs label Dec 8, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2022

@Elchi3
Copy link
Member

Elchi3 commented Dec 8, 2022

fwiw, I asked in the spec repo about a correct list of initiator types: w3c/resource-timing#364

@wbamberg
Copy link
Collaborator Author

wbamberg commented Dec 8, 2022

fwiw, I asked in the spec repo about a correct list of initiator types: w3c/resource-timing#364

Oh, sorry, I wasn't sure if it were better to just ask or file a PR. Then idk 🤷 .

@@ -34,8 +34,6 @@ The `initiatorType` property can have the following values, or `other` if none o
- : If the request was initiated by an {{HTMLElement("embed")}} element's `src` attribute.
- `fetch`
- : If the request was initiated by a {{domxref("fetch()")}} method.
- `font`
- : If the request was initiated by a {{cssxref("@font-face")}} at rule.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was an answer in the spec issue and it seems like font exists but is for HTML <font face=""> loading.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find much documentation of <font face...> but it doesn't appear that it will load a remote font: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/font#attr-face . Even if it does, it seems like this PR is right to remove the existing description of "font", and it's very arguable in any case whether there's any value in documenting usages with <font>.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. Let's remove this, the current text is clearly wrong as well.

@Elchi3 Elchi3 merged commit 9a35e1c into mdn:main Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants