Skip to content

[css-inline-3] Behavior of initial letter property with 1st argument value set to [0,1) #341

Closed

Description

@chenpighead

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

Activity

  1. upsuper commented on Jul 25, 2016

    @upsuper
    Member

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

  2. frivoal commented on Jul 25, 2016

    @frivoal
    Collaborator

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

  3. dauwhe commented on Jul 25, 2016

    @dauwhe
    Contributor

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

  4. upsuper commented on Jul 25, 2016

    @upsuper
    Member

    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?

  5. chenpighead commented on Jul 26, 2016

    @chenpighead
    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

  6. added a commit that references this issue on Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions