Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

[css-pseudo] ::first-letter should include whitespace #2164

Closed

Description

@csnardi

The section on ::first-letter says nothing about whitespace, and a css-backgrounds WPT test even tests that whitespace is not selected by ::first-letter. However, all implementations fail this test:

  • Edge selects whitespace no matter if it is followed by a non-whitespace character or not
  • Firefox only selects whitespace that is not followed by a non-whitespace character
  • Chrome (and I assume WebKit) only selects whitespace that is followed by a non-whitespace character

Given that all implementations select whitespace of some sort in ::first-letter, but each does it differently, it is probably appropriate to clarify this in the spec.

Activity

  1. Nadya678 commented on Jan 6, 2018

    @Nadya678

    But the name is ::first-LETTER. Whitespace is not letter and also digits are not letters.

    The IE11 behaviour. Letter means letter.

    BTW. Remove HTML bugs from your code. It can enable quirks modes in browsers. I corrected the HTML.
    https://jsfiddle.net/avf3qtrj/

    IE11: after correcting HTML errors (multiple body tags).
    letter

  2. Nadya678 commented on Jan 6, 2018

    @Nadya678

    Test also this on Firefox. It means first letter.
    https://jsfiddle.net/gpq6ncwg/1/

    thinsp, emsp like endash and emdash are general interpuction (decorative) signs. Not letters.
    Due to this thinsp etc. should behave like other UTF-8 interpenction signs even if they are written as entity. MSIE handles that correctly.

  3. csnardi commented on Jan 11, 2018

    @csnardi
    ContributorAuthor

    A real-world example of the interoperability confusion is https://bugs.chromium.org/p/chromium/issues/detail?id=638267.

  4. Nadya678 commented on Jan 12, 2018

    @Nadya678

    Thus, need clarification. I guess the Moz implementation is most logic except for "thinsp, nbsp" etc. The nbsp thinsp and normal spaces (in pre-wrap mode etc.) should be treated like endash and emdash. It is most logic - all signs that are not letters or digits should be included inside ::first-letter pseudoelement.

    But: how to define which ranges of unicode are digits or letters.
    All "General Punctuation unicode subset (0x20xx)" can be treated as not digit and not letter, but Unicode Math Block?

    Here is needed to specify due to UTF-8 - ranges that are letters or digits.

  5. csnardi commented on Jan 23, 2018

    @csnardi
    ContributorAuthor

    Another real-world example: https://bugs.webkit.org/show_bug.cgi?id=163216. Since WebKit selects spaces everywhere, A "b" will have A " selected.

  6. fantasai commented on Dec 31, 2020

    @fantasai
    Collaborator

    We've clarified in #5154 that we capture intervening white space, between a preceding or following punctuation character and the first letter. So I think this issue technically is closed. But the example @csnardi points out shows that this is pretty broken in some cases, so I filed #5830 as a follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions