In bug 1944779 we made a change due to the recent CSSWG resolution to allow intervening space between punctuation and the actual letter when determining the range of the `::first-letter` pseudo. However, more careful reading of the [spec text](https://drafts.csswg.org/css-pseudo/#first-letter-pattern) reveals that the change was incomplete: the pattern described in the spec allows potentially multiple space-separated punctuation elements before the letter, and similarly after it, all to be included in the `::first-letter` pseudo. (With the caveat that after the letter, a *word-separating* space will end the `::first-letter` pseudo; but other Unicode whitespace may be included.) Thus, in an extreme (and somewhat silly) example, ``` data:text/html;charset=utf-8,<style>::first-letter{background:cyan;font-size:2em}</style> <p> - – — (&%23x2008;“&%23x2009;T&%23x2009;”&%23x2008;)est ``` my understanding is that `::first-letter` should match everything up to and including the ")" character. (There isn't currently WPT coverage for stuff like this, but I notice that https://github.com/web-platform-tests/wpt/pull/51361 proposes to substantially extend ::first-letter coverage, including some cases with intervening space.)
Bug 1957384 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
In bug 1944779 we made a change due to the recent CSSWG resolution to allow intervening space between punctuation and the actual letter when determining the range of the `::first-letter` pseudo. However, more careful reading of the [spec text](https://drafts.csswg.org/css-pseudo/#first-letter-pattern) reveals that the change was incomplete: the pattern described in the spec allows potentially multiple space-separated punctuation elements before the letter, and similarly after it, all to be included in the `::first-letter` pseudo. (With the caveat that after the letter, a *word-separating* space will end the `::first-letter` pseudo; but other Unicode whitespace may be included.) Thus, in an extreme (and somewhat silly) example, ``` data:text/html;charset=utf-8,<style>::first-letter{background:cyan;font-size:2em}</style> <p> - – — (&%23x2008;“&%23x2009;T&%23x2009;”&%23x2008;)&%23x2008;est ``` my understanding is that `::first-letter` should match everything up to and including the ")" character (but not the U+2008 "punctuation space" character following it). (There isn't currently WPT coverage for stuff like this, but I notice that https://github.com/web-platform-tests/wpt/pull/51361 proposes to substantially extend ::first-letter coverage, including some cases with intervening space.)
In bug 1944779 we made a change due to the recent CSSWG resolution to allow intervening space between punctuation and the actual letter when determining the range of the `::first-letter` pseudo. However, more careful reading of the [spec text](https://drafts.csswg.org/css-pseudo/#first-letter-pattern) reveals that the change was incomplete: the pattern described in the spec allows potentially *multiple* space-separated punctuation elements before the letter, and similarly after it, all to be included in the `::first-letter` pseudo. (With the caveat that after the letter, a *word-separating* space will end the `::first-letter` pseudo; but other Unicode whitespace may be included.) Thus, in an extreme (and somewhat silly) example, ``` data:text/html;charset=utf-8,<style>::first-letter{background:cyan;font-size:2em}</style> <p> - – — (&%23x2008;“&%23x2009;T&%23x2009;”&%23x2008;)&%23x2008;est ``` my understanding is that `::first-letter` should match everything up to and including the ")" character (but not the U+2008 "punctuation space" character following it). (There isn't currently WPT coverage for stuff like this, but I notice that https://github.com/web-platform-tests/wpt/pull/51361 proposes to substantially extend ::first-letter coverage, including some cases with intervening space.)