wpt / css / css-shadow / slotted-placeholder.html

Status: PASS | Duration: 9ms | Subtests: 1/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi

/css/css-shadow/slotted-placeholder.html

<!doctype html>
<meta charset="utf-8">
<title>CSS Scoping Test: ::slotted() allows ::placeholder</title>
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<link rel="author" title="Mozilla" href="https://mozilla.org">
<link rel="help" href="https://drafts.csswg.org/css-shadow/#slotted-pseudo">
<link rel="match" href="slotted-placeholder-ref.html">
<div id="host">
  <input placeholder="I should be green">
  <textarea placeholder="I should be green"></textarea>
</div>
<script>
  host.attachShadow({ mode: "open" }).innerHTML = `
    <style>
      ::slotted(*)::placeholder { color: green }
    </style>
    <slot></slot>
  `;
</script>

/css/css-shadow/slotted-placeholder-ref.html

<!doctype html>
<style>
  ::placeholder { color: green }
</style>
<input placeholder="I should be green">
<textarea placeholder="I should be green"></textarea>