Skip to content

[css-pseudo] Should ::first-letter range be terminated by a direction-run boundary? #12010

@jfkthame

Description

@jfkthame

The range of content targeted by ::first-letter can include punctuation that precedes the actual initial "letter".

However, in the case where the preceding punctuation has different bidi directionality than the letter, and hence may be visually separated from it, does it make sense to have a ::first-letter range that will be visually fragmented, or should the direction-run boundary forcibly terminate the ::first-letter range?

Example:

data:text/html;charset=utf-8,<style>p::first-letter{background:cyan}</style><p>፠שׁלום is Hebrew...</p>

Or conversely, with RTL punctuation and LTR text:

data:text/html;charset=utf-8,<style>p::first-letter{background:cyan}</style><p dir=rtl>׀Test...</p>

Currently, it appears that Gecko never allows ::first-letter to extend across a direction boundary, while Webkit/Blink do. Should this be clearly specified one way or the other?

There are a number of existing WPT testcases that fail in Firefox because of this; however, this collection of tests look like they were simply generated from a list of Unicode codepoints with punctuation properties, and the question of directionality was probably never considered. I don't think they carry much weight in terms of deciding the desired behavior here.

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