2 <script src=
"/scroll-to-text-fragment/stash.js"></script>
4 <!-- This test is navigated to with the fragment #:~:text=foo -->
7 <div id=childid hidden=until-found
>foo
</div>
12 beforematchFiredOnChild
: false,
13 beforematchFiredOnParent
: false
16 childid
.addEventListener('beforematch', () => {
17 results
.beforematchFiredOnChild
= true;
20 parentid
.addEventListener('beforematch', () => {
21 results
.beforematchFiredOnParent
= true;
24 requestAnimationFrame(() => {
25 requestAnimationFrame(() => {
26 const params
= new URLSearchParams(window
.location
.search
);
27 stashResultsThenClose(params
.get('key'), results
);