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] Should font-synthesis be reset by font shorthand? #1032

Closed
upsuper opened this issue Feb 14, 2017 · 9 comments
Closed

[css-fonts] Should font-synthesis be reset by font shorthand? #1032

upsuper opened this issue Feb 14, 2017 · 9 comments
Assignees
Labels
Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-fonts-3 Needs Testcase (WPT)

Comments

@upsuper
Copy link
Member

upsuper commented Feb 14, 2017

The spec doesn't mention font-synthesis as a subproperty of font shorthand, but given its name, it probably should be.

Gecko resets font-synthesis when setting font, while WebKit doesn't.

Test code:

<!DOCTYPE html>
<div style="font-synthesis: style; font: 14px sans-serif;"></div>
<script>
  alert(document.querySelector('div').style.fontSynthesis);
</script>

cc @nattokirai @litherum

@litherum
Copy link
Contributor

litherum commented Mar 8, 2017

Why should it be reset when none of its values are present in the shorthand? That doesn't make any sense. Just because it starts with the word font doesn't mean that it should be part of the shorthand.

@upsuper
Copy link
Member Author

upsuper commented Mar 8, 2017

Many other font properties do not have any value present in the shorthand, but they are still reset, which makes sense because author should expect font shorthand to reset all the font style, and it is why we have shorthand.

But, yeah, whether font-synthesis should be reset in font shorthand is probably arguable. It is probably not really counted as a font style property like font-kerning or font-language-override. (BTW, probably font-feature-settings should really be reset by font shorthand thereby?)

If it is intentional that font-synthesis should not be reset by font shorthand, I guess it is at least worth a note in the shorthand section stating something like

font-synthesis is not reset by this shorthand, since it is considered a font style property.

WDYT?

@litherum
Copy link
Contributor

litherum commented Mar 9, 2017

I don't have a strong preference. I'm happy to put it in.

@fantasai
Copy link
Collaborator

fantasai commented Aug 3, 2017

There's a similar note wrt text-emphasis-position: https://drafts.csswg.org/css-text-decor-3/#text-emphasis-property

@tabatkins
Copy link
Member

I agree that this shouldn't be reset by 'font'; whether you want to synthesize bolds/etc is mostly independent of the font you choose.

@svgeesus
Copy link
Contributor

@upsuper do you agree with tab that this should not reset?

@upsuper
Copy link
Member Author

upsuper commented Jan 26, 2018

I don't have strong opinion either way. Given @tabatkins and @litherum prefer that way, I'm fine with that. I still think it's worth a note in the spec, though.

@svgeesus svgeesus self-assigned this Jan 26, 2018
@svgeesus
Copy link
Contributor

Happy to note in the spec that this is not reset by the font shorthand.

@svgeesus
Copy link
Contributor

svgeesus commented Jan 28, 2018

Why should it be reset when none of its values are present in the shorthand? That doesn't make any sense. Just because it starts with the word font doesn't mean that it should be part of the shorthand.

On the other hand, we already had (my italics):

Additionally, it is a shorthand for font-size-adjust, font-kerning, and font-language-override, but as these cannot be specified in the syntax, it merely resets these to their initial values.
https://drafts.csswg.org/css-fonts-3/#font-prop

Edited to add: that language was in an older version of the draft, but not in the current version. The new version has different language to express the same thing.

So it certainly seems worthwhile to explicitly state that font-synthesis is not set to the initial value by the font shorthand.

@svgeesus svgeesus added the Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. label Mar 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-fonts-3 Needs Testcase (WPT)
Projects
None yet
Development

No branches or pull requests

5 participants