<!DOCTYPE html>
<script src="/scroll-to-text-fragment/stash.js"></script>

<!-- This test is navigated to with the fragment #:~:text=foo -->

<body>
  <div style="height: 4000px;">spacer</div>
  <details>
    <div>foo</div>
  </details>
  <script>
    const details = document.querySelector("details");
    details.ontoggle = () => {
      const results = {};
      // This should be true. The details element should be opened by
      // ScrollToTextFragment because it has matching text.
      results.detailsH