You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implement support for ::placeholder pseudo-element #19808
The spec says that all properties that apply to ::first-line also apply to ::placeholder. Is the spec for ::first-line the one that mentionsopacity and color as applicable properties.
Can anyone explain what needs to be done here? Element has a set_placeholder_shown_state() method that marks the node as dirty with a NodeDamage::OtherNodeDamage value when required. I guess what's left is to hook that up also to the ::placeholder pseudo element?
Are there examples of other similar selectors I can look at?
One caveat about this issue is that placeholder in the said shadow DOM implementation is not the direct children of the <input> element, so we would need special cases for that.
Activity
highfive commentedon Jan 18, 2018
cc @emilio
tigercosmos commentedon Jan 18, 2018
I am wondering why the spec doesn't mention about opacity and color for
::placeholder?ferjm commentedon Jan 18, 2018
The spec says that all properties that apply to
::first-linealso apply to::placeholder. Is the spec for::first-linethe one that mentionsopacityandcoloras applicable properties.tigercosmos commentedon Jan 18, 2018
I see. I didn't find that. Thanks!
webbeef commentedon Aug 28, 2024
Can anyone explain what needs to be done here?
Elementhas aset_placeholder_shown_state()method that marks the node as dirty with aNodeDamage::OtherNodeDamagevalue when required. I guess what's left is to hook that up also to the::placeholderpseudo element?Are there examples of other similar selectors I can look at?
jdm commentedon Sep 1, 2024
The ::selection pseudo element might be a useful model, since we supported that in the legacy layout at least. https://github.com/servo/stylo/blob/65f8d1316a0966401bcfb9fa7dd5e3659a1605b2/style/servo/selector_parser.rs#L48 looks like an important note for this work, too.
stevennovaryo commentedon May 30, 2025
I believe this would be manageable with the implementation of shadow tree for text
<input>element. Which would initially be supported by #37065.I picture it would be handled in
dom_traversalsimilar to how::beforeand::afterpseudo element. The following gave more context about the styles.servo/components/shared/script_layout/wrapper_traits.rs
Line 314 in 8716306
One caveat about this issue is that placeholder in the said shadow DOM implementation is not the direct children of the
<input>element, so we would need special cases for that.The note give a very nice context about the status of the parser, we would definitely need to adjust
property_restrictionby following the spec https://drafts.csswg.org/css-pseudo/#placeholder-pseudo.layout: Make `::placeholder` public and add property restriction for …