-
Notifications
You must be signed in to change notification settings - Fork 642
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] Computed value for shorthand font: should describe serialization for font-variant-css21 and font-stretch-css3 #1671
Comments
I believe the "computed value" field there is unrelated to how the computed value is serialized. Actually, shorthands in general don't have computed value themselves at all. They are split into their subproperties during parsing. |
Yes. What I suggest to clarify is that a |
I don't think there is even consensus whether |
If @upsuper We should probably open a separate issue to investigate the general case for what happens if you ask getComputeStyle() for a shorthand (and not discuss it here). I see no reason why the |
Yes, and it would help if cases for when it cannot produce a result would be defined, especially with regards to |
It’s defined (for all shorthands) to be empty if any of the subproperties have values that are not accepted by the shorthand. |
Right, the shorthand only accepts the keywords from |
Oh, you're saying that, if we follow specs as they stand today to the letter, it would be impossible to have a non-empty computed value. Is that right? |
Oh, wow, it's really bad that the |
Yes, even if it said: numeric stretch value as percentage. We would serialize to a percentage, which would match none of the |
Thanks for the update. Are you sure this is |
We may need to preserve existing behavior. Today, if you style something with Also, it shouldn't be necessary to keep a bool around in the implementation to distinguish between Because the |
I understand the compatibility concerns, but I see some consistency issues as well. What about the case when you animate from say Otherwise I agree on the part where an extra bool should not be necessary to detect the keyword-matching values. |
I think yes, because compatibility is more important than consistency. |
Just to clarify: How does WebKit serialize the computed style value of font-weight a) in the font: shorthand, b) for the font-weight property: Does it serialize font weight |
We will always use keywords if possible. |
Current proposal (in the spec) is to keep the computed value of (I didn't understand the issue about the |
@fantasai should this go on the weekly agenda, since we didn't get to it at the F2F meeting? |
@astearns yes, pulling to this week's call |
@litherum said:
Agreed, and that is #2529 [cssom] getComputedStyle and shorthands which was recently resolved |
I'm happy with @fantasai's suggestion about the computed value of |
computed value: percentage* *usually |
The CSS Working Group just discussed
The full IRC log of that discussion<dael> Topic: Computed value for shorthand font: should describe serialization for font-variant-css21 and font-stretch-css3<dael> github: https://github.com//issues/1671#issuecomment-400863224 <dael> myles: There's...the issue here recently has migrated. The thing discussed now is the font-stretch <dael> myles: In L3 font-stretch took keywords. In L4 they're % number so you can animate. That's for variable fonts. <dael> myles: Issue is about how the computed style of this property should be a number of % rather then keyword or a number <dael> myles: If you're trying to animated from condenced to 139% if computed is % o r keyword you can't animate. Solution is always a number and getcomputedstyle function returns strings if the computed style is a magic number we define <florian> the explanation did make sense <dael> astearns: Are magic number spec orimpl dependent? <dael> myles: There's a table <chris> its the magic numbers that correspond to the keywords <dael> myles: Not much of an issue, it's do you want to animate from keyword to number. If yes, and I think it's yes, we need backwards compat <dael> florian: Makes total sense to me <chris> +1 this seems good to me <dael> astearns: me too <dael> emilio: Serialize as number? <dael> myles: We're discussing now if computed style of font-stretch shoudl b e a number or as specified. <dael> emilio: Gecko and blink ship as number so web compat not problem. <dael> myles: Backwards is gCS. If you set font-stretch to a value that used to be a keyword do you get numebr or keyword <dael> emilio: number <dael> chris: It's serialization of gCS and I think there's web compat on that <dael> myles: I guess there isn't much web compat if blink and gecko give number. <dael> florian: We can start with that and ifthere is web compat revisit <dael> astearns: Perhaps a note in the draft saying may be web compat with always serialize as number and may need magic conversion at some point. <dael> florian: Reasonable <fremy> +1 <dael> astearns: Anyone with evidence that we need magic number to string conversion in gCS? <dael> astearns: Prop: Have computed value always be a percentage and have serialization always show a percentage. Neither deal with keywords <dael> astearns: Objections? <dael> RESOLVED: Have computed value always be a percentage and have serialization always show a percentage. Neither deal with keywords |
Thanks, I am happy with this resolution. |
Just checking this is resolved. I see in the spec:
@litherum are further edits needed or can this be closed? |
The current text seems at odds with "RESOLVED: Have computed value always be a percentage and have serialization always show a percentage. Neither deal with keywords" |
This looks to have been resolved, as the current spec text is {{getComputedStyle()}} always serializes its value as a <<percentage>>,
regardless of how the value was specified by the author, or whether
or not a keyword happens to map to the value. |
The font shorthand describes the computed value as:
However, the serialization of the computed value for
font-variant-css21
and more importantlyfont-stretch-css3
does not fit under this description. Can we clarify that serialization of a computed style value for the font shorthand fails if the values do not match any of the keyword values described in those two compatibility longhands? And if the values do match those backwards-compatibility longhands then they are serialized as keywords, not as a percentage in the case of font-stretch-css3?The text was updated successfully, but these errors were encountered: