Skip to content

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

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

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

Conversation

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

@servo-wpt-sync servo-wpt-sync commented Mar 5, 2026

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.

minghuaw added 2 commits March 7, 2026 07:55
Signed-off-by: Minghua Wu <michael.wu1107@gmail.com>
Signed-off-by: Minghua Wu <michael.wu1107@gmail.com>
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator Author

🛠 Changes from the source pull request (servo/servo#43027) can no longer be cleanly applied. Waiting for a new version of these changes downstream.

10 similar comments
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator Author

🛠 Changes from the source pull request (servo/servo#43027) can no longer be cleanly applied. Waiting for a new version of these changes downstream.

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator Author

🛠 Changes from the source pull request (servo/servo#43027) can no longer be cleanly applied. Waiting for a new version of these changes downstream.

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator Author

🛠 Changes from the source pull request (servo/servo#43027) can no longer be cleanly applied. Waiting for a new version of these changes downstream.

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator Author

🛠 Changes from the source pull request (servo/servo#43027) can no longer be cleanly applied. Waiting for a new version of these changes downstream.

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator Author

🛠 Changes from the source pull request (servo/servo#43027) can no longer be cleanly applied. Waiting for a new version of these changes downstream.

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator Author

🛠 Changes from the source pull request (servo/servo#43027) can no longer be cleanly applied. Waiting for a new version of these changes downstream.

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator Author

🛠 Changes from the source pull request (servo/servo#43027) can no longer be cleanly applied. Waiting for a new version of these changes downstream.

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator Author

🛠 Changes from the source pull request (servo/servo#43027) can no longer be cleanly applied. Waiting for a new version of these changes downstream.

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator Author

🛠 Changes from the source pull request (servo/servo#43027) can no longer be cleanly applied. Waiting for a new version of these changes downstream.

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator Author

🛠 Changes from the source pull request (servo/servo#43027) can no longer be cleanly applied. Waiting for a new version of these changes downstream.

@servo-wpt-sync servo-wpt-sync deleted the servo_export_43027 branch March 7, 2026 10:47
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