You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css-inline-3] Behavior of initial letter property with 1st argument value set to [0,1) #341
Per https://drafts.csswg.org/css-inline/#sizing-drop-initials, it says the first argument (size of a initial letter) accepts non-negative . If I read correctly, it means setting initial-letter with size [0, 1) is allowed. However, I wonder: (1) what is the use case for setting initial-letter's size to less than 1? (2) what is the expected behavior for setting initial-letter's size to 0?
Would it be better to specify that the first argument should be "larger or equal to 1"?
In the section "3.5. Sizing Initial Letters", the formula for calculating the font size uses (N-1) * line-height, which means when the number is in [0, 1), this part of the formula would be negative, and if line-height is large enough, the result font size of that formula could be negative as well, which seems unfortunate.
Given this, I believe range of that number should be restricted to [1, +∞).
What's the exact meaning of "ignores values" here? Does it reject the value when parsing, or accept the value but use or compute it to a different value?
Looks like it rejects the value when parsing. It accepts positive integer only, since the non-integer part of the argument specified in the spec. is not implemented yet.
No idea where to paste the source link to webkit. Here are some references: [1] is a github unofficial mirror pointing to the parser for webkit-initial-letter. [2] is the original implementation patch.
Activity
upsuper commentedon Jul 25, 2016
In the section "3.5. Sizing Initial Letters", the formula for calculating the font size uses
(N-1) * line-height, which means when the number is in [0, 1), this part of the formula would be negative, and ifline-heightis large enough, the result font size of that formula could be negative as well, which seems unfortunate.Given this, I believe range of that number should be restricted to [1, +∞).
frivoal commentedon Jul 25, 2016
I agree, values less than 1 don't seem useful. @dauwhe, are we missing something?
dauwhe commentedon Jul 25, 2016
It appears Webkit ignores values less than one for that first argument. I'm fine with changing the spec.
upsuper commentedon Jul 25, 2016
What's the exact meaning of "ignores values" here? Does it reject the value when parsing, or accept the value but use or compute it to a different value?
chenpighead commentedon Jul 26, 2016
Looks like it rejects the value when parsing. It accepts positive integer only, since the non-integer part of the argument specified in the spec. is not implemented yet.
No idea where to paste the source link to webkit. Here are some references: [1] is a github unofficial mirror pointing to the parser for webkit-initial-letter. [2] is the original implementation patch.
[1] https://github.com/WebKit/webkit/blob/master/Source/WebCore/css/CSSParser.cpp#L2545
[2] https://bugs.webkit.org/attachment.cgi?id=237561&action=prettypatch
Merge pull request #341 from saschanaz/patch-1