Bug 179815 - ::first-letter should include preceding punctuation and space separators
Summary: ::first-letter should include preceding punctuation and space separators
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 11
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar, WPTImpact
: 216963 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-11-17 02:51 PST by Johannes Odland
Modified: 2023-01-18 15:52 PST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Odland 2017-11-17 02:51:24 PST
According to the specification the following should be included in ::first-letter:
"Punctuation (i.e, characters defined in Unicode in the "open" (Ps), "close" (Pe), "initial" (Pi). "final" (Pf) and "other" (Po) punctuation classes), that precedes or follows the first letter should be included."
https://drafts.csswg.org/selectors-3/#first-letter


It also states:
"In some cases the ::first-letter pseudo-element should include more than just the first non-punctuation character on a line."

In the Norwegian language quotes are started either with Left-pointing Double Angle Quotation Mark '«' or an En Dash '–'. The User agent should treat these equally and include them and the following letter in the ::first-letter pseudo element.
Comment 1 Johannes Odland 2017-11-17 05:59:31 PST
In the following sentence the en dash, space and letter should be included in ::first-letter:

"– Jeg vil bare være et helt vanlig menneske."
Comment 2 Johannes Odland 2017-11-17 06:02:50 PST
Example on NRK P3's webpage (Norwegian Broadcasting Corporation):

http://p3.no/dokumentar/uhelbredelig/
Comment 3 Sam Sneddon [:gsnedders] 2021-08-11 04:39:04 PDT
*** Bug 216963 has been marked as a duplicate of this bug. ***
Comment 4 Sam Sneddon [:gsnedders] 2021-08-11 04:39:48 PDT
there's nothing really specific about Norwegian (in either written form) here; it's just the general punctuation/space issue
Comment 5 Brent Fulgham 2022-06-30 09:43:35 PDT
This appears to be tracked by this radar:
<rdar://69870767>
Comment 7 Johannes Odland 2023-01-18 06:08:51 PST
Forgot to update this issue, but the spec was updated a while ago to include all punctuation characters:

https://www.w3.org/TR/css-pseudo-4/#first-letter-pattern

```
Preceding and following punctuation must also be included as part of the first-letter text in the ::first-letter pseudo-element as follows:

All punctuation—i.e, characters that belong to the Punctuation (P*) Unicode general category [UAX44]—that precedes the first letter.
Any punctuation other than opening punctuation and dashes—i.e. characters that belong to the Punctuation (P*) Unicode general category, excluding Open Punctuation (Ps) and Dash Punctuation (Pd)—that follows the first letter.
Any intervening typographic space—i.e. characters that belong to the Zs Unicode general category [UAX44] other than U+3000 IDEOGRAPHIC SPACE or any word-separator characters
```