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] Which font properties should be reset by the font shorthand? #1636

Closed
heycam opened this issue Jul 21, 2017 · 12 comments
Closed
Labels
css-fonts-4 Current Work

Comments

@heycam
Copy link
Contributor

heycam commented Jul 21, 2017

https://drafts.csswg.org/css-fonts-4/#font-prop

The canonical order of the font shorthand is defined by reference to its grammar, but that doesn't take into account properties that are reset to their initial value and can't be specified in the shorthand value (such as font-size-adjust).

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

Yeah, I just need to add something describing exactly which properties are set by this shorthand.

See also: #1349

@litherum
Copy link
Contributor

Before I can make these edits, I need to run the experiment to see which properties each browser resets already. Hopefully the results of this experiment are fairly consistent across browsers and I can just document what browsers already do. Otherwise, we will need some way to resolve which properties are in the set an which are not.

@fantasai
Copy link
Collaborator

fantasai commented Aug 2, 2017

@heycam Does the canonical order matter if it can't be represented in the shorthand? The canonical order just exists to define serialization order for reorderable value components, if there's no representation then it can't be part of the order...

@litherum
Copy link
Contributor

litherum commented Aug 2, 2017

I assumed you were talking about an explicit list about which properties are reset by the font shorthand. @heycam Are you talking about something else?

@dbaron
Copy link
Member

dbaron commented Aug 3, 2017

Here's a slightly revised version of the test designed to trigger slightly fewer browser bugs and potentially report an orange state in the presence of others.
test.zip

(Firefox doesn't actually honor the "Computed value: as specified" for font-language-override, and drops things that aren't valid language tags.)

@dbaron
Copy link
Member

dbaron commented Aug 3, 2017

With the revised test:

Chrome 59 screenshot:
font-chromium

Chrome 59 with experimental web platform features screenshot:

font-chromium-experimental

Gecko nightly screenshot:
font-gecko

@litherum
Copy link
Contributor

litherum commented Aug 3, 2017

WebKit on Sierra

screen shot 2017-08-03 at 4 02 54 pm

@litherum
Copy link
Contributor

litherum commented Aug 3, 2017

Thanks for fixing the test, @dbaron!

@litherum litherum changed the title [css-fonts-4] canonical order of font shorthand is underdefined [css-fonts-4] Which font properties should be reset by the font shorthand? Aug 3, 2017
@litherum
Copy link
Contributor

litherum commented Aug 3, 2017

The CSSWG discussed this in #1349. (But, because this one has the test case, duping that thread to this one)

@litherum
Copy link
Contributor

litherum commented Aug 3, 2017

Edge 16

image

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed Which font properties should be reset by the font shorthand?, and agreed to the following resolutions:

  • RESOLVED: All font-* properties are reset by the font shorthand, except font-presentation and font-synthesis.
The full IRC log of that discussion <astearns> topic: Which font properties should be reset by the font shorthand?
<astearns> github: https://github.com//issues/1636
<TabAtkins> myles: Thanks to David, we now have a bunch of correct data.
<TabAtkins> myles: [presents it]
<TabAtkins> myles: I think there's some consensus that 'font' can reset properties that it can't set.
<TabAtkins> TabAtkins: It has some "reset-only sub-properties".
<TabAtkins> myles: [explains table]
<TabAtkins> dbaron: Further question: what's a subproperty of font-variant?
<TabAtkins> myles: So should we look for that data too?
<TabAtkins> myles: So does anyone outside of dbaron have opintions on this?
<TabAtkins> TabAtkins: I think font-synthesis shouldn't be reset, everything else I don't care, probably be reset.
<TabAtkins> dbaron: My pref is for 'font' to reset the font you specified, and not leave a bunch of stuff unresolved.
<TabAtkins> fantasai: I agree with Firefox's group, except maybe font-kerning not being reset.
<TabAtkins> myles: optical-sizing should be reset.
<fantasai> s/maybe font-kerning not being reset/unsure about font-kerning/
<fantasai> s/agree/strongly agree/
<fantasai> ?^: What about the unsupported ones?
<TabAtkins> dbaron: I think it's important that variation-settings and feature-setting get reset.
<TabAtkins> [general agreement]
<fantasai> fantasai^: don't know what optical-sizing is, but agree with resetting all of those as well
<TabAtkins> astearns: Why not font-synthesis?
<TabAtkins> TabAtkins: It seems like it's rarely tied to the precise font; usually if you care, you'll amke sure all your fonts have it.
<TabAtkins> myles: Same probably applies to font-presentation.
<TabAtkins> [general agreement]
<TabAtkins> [general agreement that all the others should be; we went thru several specific examples]
<TabAtkins> Florian: I'm not sure about font-variant
<TabAtkins> myles: That's *set* by the 'font' shorthand, it *must* be reset.
<TabAtkins> RESOLVED: All font-* properties are reset by the font shorthand, except font-presentation and font-synthesis.

@litherum
Copy link
Contributor

litherum commented Aug 3, 2017

... and font-presentation and font-synthesis should not be reset by the shorthand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-fonts-4 Current Work
Projects
None yet
Development

No branches or pull requests

5 participants