Skip to content

layout: Add initial support for first-letter pseudo element#58348

Closed
servo-wpt-sync wants to merge 4 commits intoweb-platform-tests:masterfrom
servo:servo_export_43027
Closed

layout: Add initial support for first-letter pseudo element#58348
servo-wpt-sync wants to merge 4 commits intoweb-platform-tests:masterfrom
servo:servo_export_43027

Conversation

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

This and the accompanying stylo PR (servo/stylo#320) is a partial implementation of the first-letter pseudo element. The current implementation doesn't support float and nesting/inheritance (see spec https://drafts.csswg.org/css-pseudo/#first-letter-tree). These will be supported in future PRs.

Because the first letter would be split into a separate InlineItem from the rest of the text, this PR introduces a hack (zero-width joiner codepoint) to address the problem where letters would be written differently when joined together in some languages like Arabic. This hack currently only checks if the language tag is "ar" or "fa" as I have limited knowledge on such writing systems. A proper solution for this is needed.

Testing: Existing WPT tests. There is one WPT test (fcp-typographic-pseudo.html) that servo currently fails would timeout with this PR because nesting/inheritance is not well supported in this PR.
Fixes: #43008
Part of: #15413

Reviewed in servo/servo#43027

Copy link
Copy Markdown
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Servo project.

@servo-wpt-sync servo-wpt-sync force-pushed the servo_export_43027 branch 15 times, most recently from cd87abf to b174056 Compare March 10, 2026 10:12
Signed-off-by: Minghua Wu <michael.wu1107@gmail.com>
Signed-off-by: Minghua Wu <michael.wu1107@gmail.com>
Signed-off-by: minghuaw <michael.wu1107@gmail.com>
Signed-off-by: Minghua Wu <michael.wu1107@gmail.com>
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator Author

👋 Downstream pull request (servo/servo#43027) no longer contains any upstreamable changes. Closing pull request without merging.

@servo-wpt-sync servo-wpt-sync deleted the servo_export_43027 branch March 10, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants