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

[css-font-loading] FontFace constructor section 2.1 need clarifying #4771

Open
nmoucht opened this issue Feb 12, 2020 · 3 comments
Open

[css-font-loading] FontFace constructor section 2.1 need clarifying #4771

nmoucht opened this issue Feb 12, 2020 · 3 comments

Comments

@nmoucht
Copy link

nmoucht commented Feb 12, 2020

https://drafts.csswg.org/css-font-loading/#dom-fontface-fontface

Section 2.1:

"If any of them fail to parse correctly, reject font face’s [[FontStatusPromise]] with a DOMException named "SyntaxError", set font face’s corresponding attributes to the empty string, and set font face’s status attribute to "error". Otherwise, set font face’s corresponding attributes to the serialization of the parsed values."

This section should specify when there is a parsing failure, if the all of the font face's attributes should be empty string, or just those that failed to parse. Currently Firefox and Chrome seem to set all attributes to some default string when there is a parsing error, rather than an empty string, so some clarification to this section would be beneficial to have the same behavior across all browsers.

@litherum
Copy link
Contributor

@tabatkins

Gecko and Blink agree that all the attributes get set to the empty string, so we've modified WebKit to match.

Now that all browsers match, the spec should be changed to reflect the agreement between all the browsers.

@tabatkins
Copy link
Member

I don't think that was my original intention, but the spec is unclear, and it also doesn't really matter. So yes, I agree the spec should match impls here.

However, note:

Currently Firefox and Chrome seem to set all attributes to some default string when there is a parsing error,

which I've confirmed is true. Does Safari do that, @litherum, or set to an empty string?

@litherum
Copy link
Contributor

Oh, I said the wrong thing. We now set all attributes to a default value.

Sorry 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants