Add optional annotation to parameters in FontFaceSet methods#44352
Conversation
This commit updates the following pages: - https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet/check - https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet/forEach - https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet/load Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
|
Preview URLs (3 pages)
External URLs (2)URL:
URL:
(comment last updated: 2026-06-09 08:02:31) |
chrisdavidmills
left a comment
There was a problem hiding this comment.
Thanks, @Juneezee. I've got some comments for you.
Reference: #44352 (review) Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Juneezee
left a comment
There was a problem hiding this comment.
@chrisdavidmills Thanks for reviewing the PR. I have addressed your comments and the changes are ready for your review.
| - : limit the font faces to those whose Unicode range contains at least one of the characters in text. This [does not check for individual glyph coverage](https://lists.w3.org/Archives/Public/www-style/2015Aug/0330.html). | ||
| - : A font specification using the syntax for the CSS {{cssxref("font")}} property, for example `"italic bold 16px Roboto"` | ||
| - `text` {{optional_inline}} | ||
| - : Limit the font faces to those whose Unicode range contains at least one of the characters in text. This [does not check for individual glyph coverage](https://lists.w3.org/Archives/Public/www-style/2015Aug/0330.html). Defaults to [a string containing a single space character (U+0020 SPACE) `" "`](https://drafts.csswg.org/css-font-loading/#find-the-matching-font-faces). |
There was a problem hiding this comment.
Let me know if you think it is better to inform the user about this default value via an alert
Note
According to CSS Font Loading Module Level 3 specification,
- If text was not explicitly provided, let it be a string containing a single space character (U+0020 SPACE).
There was a problem hiding this comment.
No, what you've done is fine, although see my comments.
chrisdavidmills
left a comment
There was a problem hiding this comment.
@Juneezee, a couple more comments for you. Nearly there!
Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
chrisdavidmills
left a comment
There was a problem hiding this comment.
OK, this looks ready to merge. Thanks again, @Juneezee!
Description
This PR updates the following pages to include the inline Optional label for their optional parameters:
Motivation
Adding the Optional label improves readability, prevents confusion about which arguments are strictly required, and maintains consistency with the rest of the MDN Web API reference pages.
Additional details
Related issues and pull requests