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-inline-3] Behavior of initial letter property with 1st argument value set to [0,1) #341

Closed
chenpighead opened this issue Jul 25, 2016 · 5 comments
Labels
css-inline-3 Current Work

Comments

@chenpighead
Copy link

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"?

@upsuper
Copy link
Member

upsuper commented 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 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, +∞).

@frivoal frivoal added the css-inline-3 Current Work label Jul 25, 2016
@frivoal
Copy link
Collaborator

frivoal commented Jul 25, 2016

I agree, values less than 1 don't seem useful. @dauwhe, are we missing something?

@dauwhe
Copy link
Contributor

dauwhe commented Jul 25, 2016

It appears Webkit ignores values less than one for that first argument. I'm fine with changing the spec.

@upsuper
Copy link
Member

upsuper commented 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
Copy link
Author

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

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

No branches or pull requests

4 participants