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-fonts-4] Define value of src with a valid value definition #7632

Closed
cdoublev opened this issue Aug 20, 2022 · 2 comments · Fixed by #9387
Closed

[css-fonts-4] Define value of src with a valid value definition #7632

cdoublev opened this issue Aug 20, 2022 · 2 comments · Fixed by #9387

Comments

@cdoublev
Copy link
Collaborator

cdoublev commented Aug 20, 2022

The value field of src is defined with see prose. Would it be possible to use a valid value definition according the CSS value definition syntax?

I know that src must be parsed in a specific way, similarly to <media-query-list> and <forgiving-selector-list>. So I suggest to set its value with something like <font-src-list> that would reference this specific procedure, which should take advantage of parse a comma-separated list according to a CSS grammar with <font-src> as the CSS grammar.

Also, I think it could be helpfull for CSS authors to remove invalid items from the serialization, like invalid media query or selector. edit: invalid selectors in <forgiving-selector-list> and invalid/unknown media queries in <media-query-list> are now preserved - #8356 (comment), #7595 (comment).

@cdoublev cdoublev changed the title [css-fonts-4] Define value of font-size (descriptor) with a valid value definition [css-fonts-4] Define value of src with a valid value definition Aug 23, 2022
@svgeesus svgeesus added the css-fonts-4 Current Work label Nov 16, 2022
@svgeesus
Copy link
Contributor

Want to make a PR for this?

@cdoublev
Copy link
Collaborator Author

Note that one thing I left undefined is the handling of invalid <font-src>. Should they be preserved or removed? At parse time? At serialization time?

Chrome/FF (at least) currently remove invalid <font-src>, like in <forgiving-selector-list> (at parse time, as specified in step 2):

<style>
  @font-face { src: invalid, local(my-font) }
  :is(;, type) {}
</style>
<script>
  document.styleSheets[0].cssRules[0].cssText; // '@font-face { src: local(my-font); }'
  document.styleSheets[0].cssRules[1].cssText; // ':is(type) { }'
</script>

But people now wants to preserve invalid selectors (see issue linked in my first comment).

In <media-query-list>, it is more complex because of back-compat.

That said, consistency may not be mandatory.

You may want to specify the current interoperable behavior right now, or wait for the outcome of the corresponding issues for <forgiving-selector-list> or <media-query-list>.

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

Successfully merging a pull request may close this issue.

2 participants