layout: Make ::placeholder public and add property restriction for ::placeholder and ::marker (#43053)

Servo side of https://github.com/servo/stylo/pull/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>
This commit is contained in:
Steven Novaryo
2026-03-09 07:22:36 +08:00
committed by GitHub
parent a2ca667041
commit ab83e6e448
19 changed files with 45 additions and 87 deletions

View File

@@ -1841,6 +1841,9 @@ impl WindowMethods<crate::DomTypeHolder> for Window {
// Step 3: If pseudoElt is provided, is not the empty string, and starts with a colon, then:
// Step 3.1: Parse pseudoElt as a <pseudo-element-selector>, and let type be the result.
// TODO(#43095): This is quite hacky and it would be better to have a parsing function that
// is integrated with stylo `PseudoElement` itself. Comparing with stylo, we are now currently
// missing `::backdrop`, `::color-swatch`, and `::details-content`.
let pseudo = pseudo.map(|mut s| {
s.make_ascii_lowercase();
s
@@ -1854,6 +1857,7 @@ impl WindowMethods<crate::DomTypeHolder> for Window {
},
Some(ref pseudo) if pseudo == "::selection" => Some(PseudoElement::Selection),
Some(ref pseudo) if pseudo == "::marker" => Some(PseudoElement::Marker),
Some(ref pseudo) if pseudo == "::placeholder" => Some(PseudoElement::Placeholder),
Some(ref pseudo) if pseudo.starts_with(':') => {
// Step 3.2: If type is failure, or is a ::slotted() or ::part()
// pseudo-element, let obj be null.