Register the ::marker pseudo-element#202
Open
jhaygood86 wants to merge 1 commit into
Open
Conversation
jhaygood86
marked this pull request as ready for review
July 22, 2026 22:32
::marker is a standard pseudo-element (CSS Lists 3 6.1), but it was
absent from PseudoElementSelectorFactory's registered set, so a rule
that used it - "li::marker { … }" - failed to parse and was dropped
whole rather than producing a PseudoElementSelector.
Add it to the factory (and PseudoElementNames). Only the two-colon form
is registered; unlike ::before/::after, ::marker has no one-colon legacy
spelling.
jhaygood86
force-pushed
the
feature/marker-pseudo-element
branch
from
July 23, 2026 22:24
6c3930e to
f2c9670
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
li::marker { color: red }fails to parse —sheet.Rules.Lengthis 0, the whole rule is dropped.::markeris a standard pseudo-element (CSS Lists 3 §6.1), but it is missing from the registered set inPseudoElementSelectorFactory:So
Create("marker")returns null (unlessAllowInvalidSelectorsis set), and the selector — and its rule — is discarded.Fix
Add
PseudoElementNames.Marker = "marker"and register it in the factory, exactly like the other pseudo-elements. It now parses to aPseudoElementSelectorwithName == "marker"and round-trips as::marker.Only the two-colon form is registered. Unlike
::before/::after,::markerhas no one-colon legacy spelling (it postdates CSS2), so:markerstays invalid.Scope note
This is the parse fix only. In the fork this came from,
::markerregistration rode along with a larger rework that also gives:first-child/:only-child/etc. dedicated selector subtypes — but those already parse correctly here (identical text and specificity), so that part is an object-model change specific to that fork's matching engine, not a parsing or spec-conformance fix, and is left out.Tests
3 tests in
SelectorsTests.cs:li::markerand bare::markerparse and round-trip, and the subject is aPseudoElementSelectornamedmarker. All 3 fail onmaster. The full suite (1263 existing tests) stays green, and all seven target frameworks build with no new warnings.