atch" href="target-text-dynamic-001-ref.html">
<script src="/common/reftest-wait.js"></script>
<style>
  span::target-text {
    background-color: cyan;
  }

  span {
    background-color: cyan;
  }
</style>

<p>The test passes if the following word has a magenta background.</p>
<div><span>Example</span></div>

<script>
  location.href = "#:~:text=Example";
  requestAnimationFrame(() => requestAnimationFrame(() => {
    document.styleSheets[0].cssRules[0].style.backgroundColor = "magenta";
    takeScreensho