Bug 1860196 [wpt PR 42652] - Upstream wpt_internal display-lock WPTs, a=testonly
[gecko.git] / testing / web-platform / tests / html / editing / the-hidden-attribute / resources / beforematch-scroll-to-text-fragment-bubble.html
blobabfe8ddd54407c4eb12e5430e72f140e2bad9e24
1 <!DOCTYPE html>
2 <script src="/scroll-to-text-fragment/stash.js"></script>
4 <!-- This test is navigated to with the fragment #:~:text=foo -->
6 <div id=parentid>
7 <div id=childid hidden=until-found>foo</div>
8 </div>
10 <script>
11 const results = {
12 beforematchFiredOnChild: false,
13 beforematchFiredOnParent: false
16 childid.addEventListener('beforematch', () => {
17 results.beforematchFiredOnChild = true;
18 });
20 parentid.addEventListener('beforematch', () => {
21 results.beforematchFiredOnParent = true;
22 });
24 requestAnimationFrame(() => {
25 requestAnimationFrame(() => {
26 const params = new URLSearchParams(window.location.search);
27 stashResultsThenClose(params.get('key'), results);
28 });
29 });
30 </script>