Skip to content
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

Fix render-blocking font example #30458

Merged

Conversation

tunetheweb
Copy link
Contributor

@tunetheweb tunetheweb commented Nov 22, 2023

Description

There's a couple of examples like this:

<link blocking="render" href="critical-font.woff2" as="font" />

This doesn't make sense, especially by MDN's own docs:

The rel attribute has no default value. If the attribute is omitted or if none of the values in the attribute are supported, then the document has no particular relationship with the destination resource other than there being a hyperlink between the two. In this case, on and

, if the rel attribute is absent, has no keywords, or if not one or more of the space-separated keywords above, then the element does not create any links. and will still created links, but without a defined relationship.

This was added in #14648 but the linked explainer uses rel=preload and crossorigin which are missing here (crossorigin is needed for preloading fonts for CORS reasons) . So this PR adde those attributes to the example to make it valid.

Motivation

Correct bad examples.

Additional details

whatwg/html#7131

Related issues and pull requests

Corrects example added in #14648

@tunetheweb tunetheweb requested review from a team as code owners November 22, 2023 20:57
@tunetheweb tunetheweb requested review from sideshowbarker and dipikabh and removed request for a team November 22, 2023 20:57
@github-actions github-actions bot added Content:HTML Hypertext Markup Language docs Content:WebAPI Web API docs labels Nov 22, 2023
Copy link
Contributor

@sideshowbarker sideshowbarker merged commit 8a03cbb into mdn:main Nov 23, 2023
6 checks passed
@tunetheweb tunetheweb deleted the fix-render-blocking-font-example branch November 23, 2023 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:HTML Hypertext Markup Language docs Content:WebAPI Web API docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants