Skip to content

Enabling parsing first-letter pseudo element for servo#320

Merged
Loirooriol merged 6 commits intoservo:mainfrom
minghuaw:feat/first-letter
Mar 11, 2026
Merged

Enabling parsing first-letter pseudo element for servo#320
Loirooriol merged 6 commits intoservo:mainfrom
minghuaw:feat/first-letter

Conversation

@minghuaw
Copy link
Copy Markdown
Contributor

@minghuaw minghuaw commented Mar 5, 2026

This PR enables parsing first-letter pseudo element for servo. An accompanying servo PR (servo/servo#43027) is open

@Loirooriol
Copy link
Copy Markdown
Collaborator

Please rebase this, you are including commits from other PRs.

Comment thread style/servo/selector_parser.rs
@minghuaw minghuaw force-pushed the feat/first-letter branch from d6494fb to dc0726b Compare March 5, 2026 09:21
@minghuaw
Copy link
Copy Markdown
Contributor Author

minghuaw commented Mar 5, 2026

Please rebase this, you are including commits from other PRs.

Thanks! Rebased

Comment thread style/servo/selector_parser.rs Outdated
Comment thread style/servo/selector_parser.rs Outdated
Comment thread style/data.rs
@minghuaw
Copy link
Copy Markdown
Contributor Author

minghuaw commented Mar 8, 2026

@Loirooriol Addressed the comments in 65ed94c. Would you mind taking a look at the servo PR as well? It's much simplified after addressing Xiaocheng's comment

@minghuaw minghuaw requested a review from Loirooriol March 8, 2026 05:39
@Loirooriol Loirooriol changed the title Enabling parsing first-letter psuedo element for servo Enabling parsing first-letter pseudo element for servo Mar 8, 2026
@minghuaw minghuaw force-pushed the feat/first-letter branch from 5a11443 to 643db54 Compare March 9, 2026 01:44
minghuaw added 3 commits March 9, 2026 22:05
Signed-off-by: Minghua Wu <michael.wu1107@gmail.com>
Signed-off-by: Minghua Wu <michael.wu1107@gmail.com>
Signed-off-by: Minghua Wu <michael.wu1107@gmail.com>
@minghuaw minghuaw force-pushed the feat/first-letter branch from 643db54 to 80316b5 Compare March 9, 2026 14:05
Comment thread style/servo/selector_parser.rs Outdated
Comment thread style/servo/selector_parser.rs Outdated
Comment on lines +281 to +285
@@ -279,6 +282,7 @@ impl PseudoElement {
PropertyFlags::APPLIES_TO_MARKER
},
PseudoElement::Placeholder => PropertyFlags::APPLIES_TO_PLACEHOLDER,
PseudoElement::FirstLetter => PropertyFlags::APPLIES_TO_FIRST_LETTER,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ditto

            PseudoElement::FirstLetter => PropertyFlags::APPLIES_TO_FIRST_LETTER,
            PseudoElement::Marker if static_prefs::pref!("layout.css.marker.restricted") => {
                PropertyFlags::APPLIES_TO_MARKER
            },
            PseudoElement::Placeholder => PropertyFlags::APPLIES_TO_PLACEHOLDER,

minghuaw and others added 3 commits March 11, 2026 09:14
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: minghuaw <michael.wu1107@gmail.com>
Signed-off-by: Minghua Wu <michael.wu1107@gmail.com>
@minghuaw
Copy link
Copy Markdown
Contributor Author

@Loirooriol All checks (including WPT: https://github.com/servo/servo/actions/runs/22933642417) in the accompanying servo PR have passed

@Loirooriol Loirooriol added this pull request to the merge queue Mar 11, 2026
Merged via the queue into servo:main with commit dca3934 Mar 11, 2026
5 checks passed
github-merge-queue Bot pushed a commit to servo/servo that referenced this pull request Mar 11, 2026
This and the accompanying stylo PR
(servo/stylo#320) is a partial implementation of
the `first-letter` pseudo element.

Testing: Existing WPT tests. There is one WPT test
(fcp-typographic-pseudo.html) that servo currently fails would timeout
with this PR because opacity of `TextFragment` is taken from the
`InlineFormattingContext` instead of the pseudo element.
Fixes: #43008 
Part of: #15413

---------

Signed-off-by: Minghua Wu <michael.wu1107@gmail.com>
Signed-off-by: minghuaw <michael.wu1107@gmail.com>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Xiaocheng Hu <xiaochengh.work@gmail.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
github-merge-queue Bot pushed a commit to servo/servo that referenced this pull request Mar 11, 2026
This and the accompanying stylo PR
(servo/stylo#320) is a partial implementation of
the `first-letter` pseudo element.

Testing: Existing WPT tests. There is one WPT test
(fcp-typographic-pseudo.html) that servo currently fails would timeout
with this PR because opacity of `TextFragment` is taken from the
`InlineFormattingContext` instead of the pseudo element.
Fixes: #43008 
Part of: #15413

---------

Signed-off-by: Minghua Wu <michael.wu1107@gmail.com>
Signed-off-by: minghuaw <michael.wu1107@gmail.com>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Xiaocheng Hu <xiaochengh.work@gmail.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
@minghuaw minghuaw deleted the feat/first-letter branch March 16, 2026 01:20
lando-worker Bot pushed a commit to mozilla-firefox/firefox that referenced this pull request Apr 3, 2026
github-actions Bot pushed a commit to longvatrong111/stylo that referenced this pull request Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants