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] Font shorthand can not reliably parse oblique <angle>, needs <font-style-css3> exception #1630

Closed
drott opened this issue Jul 20, 2017 · 5 comments

Comments

@drott
Copy link
Collaborator

drott commented Jul 20, 2017

The font shorthand property says:

The font property is, except as described below, a shorthand property for setting font-style, font-variant, font-weight, font-stretch, font-size, line-height, font-family at the same place in the stylesheet.

For font-stretch and font-variant exceptions are specified which restrict them to a restricted keyword syntax.

For font-style, no such exception is defined yet.

I believe however, that allowing oblique <angle> into the font shorthand syntax causes parsing tokenization ambiguities and would not work reliably.

I would suggest to change the syntax rule for font-style to use something like

<font-style-css3> = [normal | italic | oblique]

@drott drott added the css-fonts-4 Current Work label Jul 20, 2017
@litherum
Copy link
Contributor

litherum commented Jul 20, 2017

I don't think there are ambiguities. Nothing else in the font shorthand accepts an <angle>.

WebKit currently parses the full font-style syntax in the font shorthand.

@drott
Copy link
Collaborator Author

drott commented Jul 26, 2017

Thanks for your analysis, I think you're right, since font size and angle need a unit. I had in mind a case like font: oblique 20 sans-serif;

Does WebKit serialize an oblique value - say, 35deg - into the computed style of the font shorthand as ... oblique 35deg ...?

@litherum
Copy link
Contributor

litherum commented Jul 26, 2017

I don't have a build handy right now, so I can't check, but from code inspection, it looks like we don't right now (fontShorthandValueForSelectionProperties()). We probably should, though.

@litherum
Copy link
Contributor

litherum commented Aug 1, 2017

Is there anything left to do here?

@drott
Copy link
Collaborator Author

drott commented Aug 1, 2017

No, I think this can be closed.

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

3 participants