Make ::placeholder public and add property restriction for ::placeholder and ::marker#322
Merged
Loirooriol merged 1 commit intoservo:mainfrom Mar 8, 2026
Merged
Conversation
jdm
approved these changes
Mar 6, 2026
Loirooriol
reviewed
Mar 6, 2026
Collaborator
Loirooriol
left a comment
There was a problem hiding this comment.
Please open a Servo PR to run tests.
Comment on lines
+277
to
+281
| match self { | ||
| PseudoElement::Marker => Some(PropertyFlags::APPLIES_TO_MARKER), | ||
| PseudoElement::Placeholder => Some(PropertyFlags::APPLIES_TO_PLACEHOLDER), | ||
| _ => None, | ||
| } |
Collaborator
There was a problem hiding this comment.
Nit to avoid repeating Some() as we add more of these:
Suggested change
| match self { | |
| PseudoElement::Marker => Some(PropertyFlags::APPLIES_TO_MARKER), | |
| PseudoElement::Placeholder => Some(PropertyFlags::APPLIES_TO_PLACEHOLDER), | |
| _ => None, | |
| } | |
| Some(match self { | |
| PseudoElement::Marker => PropertyFlags::APPLIES_TO_MARKER, | |
| PseudoElement::Placeholder => PropertyFlags::APPLIES_TO_PLACEHOLDER, | |
| _ => return None, | |
| }) |
| pub fn property_restriction(&self) -> Option<PropertyFlags> { | ||
| None | ||
| match self { | ||
| PseudoElement::Marker => Some(PropertyFlags::APPLIES_TO_MARKER), |
Collaborator
There was a problem hiding this comment.
For debugging, would be useful to add if static_prefs::pref!("layout.css.marker.restricted") like Gecko:
stylo/style/gecko/pseudo_element.rs
Line 432 in 9b63562
Member
Author
There was a problem hiding this comment.
Looks like defined only in Gecko. How do we add the pref for Servo Stylo? It is in stylo_static_prefs\src\lib.rs?
Collaborator
There was a problem hiding this comment.
Yes, just add it there with a default value of true
71b2c9b to
77596c1
Compare
77596c1 to
9ecf187
Compare
Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>
9ecf187 to
5bbd659
Compare
Loirooriol
approved these changes
Mar 7, 2026
Collaborator
|
I have force-pushed this after syncing main from upstream. |
github-merge-queue Bot
pushed a commit
to servo/servo
that referenced
this pull request
Mar 8, 2026
…`::placeholder` and `::marker` (#43053) Servo side of servo/stylo#322. Update the WPT expectation following the changes to make `::placeholder` public and adding property restriction to `::placeholder` and `::marker`. Additionally ensure that `getComputedStyle` works for `::placeholder`. Testing: Existing WPTs Fixes: #43034 Fixes: #43035 Fixes: #19808 Signed-off-by: Jo Steven Novaryo <steven.novaryo@gmail.com>
lando-worker Bot
pushed a commit
to mozilla-firefox/firefox
that referenced
this pull request
Apr 3, 2026
…ystem-reviewers,dshin This imports servo/stylo#322 Differential Revision: https://phabricator.services.mozilla.com/D291905
github-actions Bot
pushed a commit
to longvatrong111/stylo
that referenced
this pull request
Apr 4, 2026
…ystem-reviewers,dshin This imports servo#322 Differential Revision: https://phabricator.services.mozilla.com/D291905
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.
The
::placeholderpseudo element should be a public pseudo element. And, both::placeholderand::markershould have a property restriction as defined in the spec. In stylo, the property restriction has been computed inPropertyFlags.Servo PR: servo/servo#43053