summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/scroll-to-text-fragment/resources/self-text-directive-iframe.html
blob: 43573692ea8e186278f51dc7a4f8204f549c997e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!doctype html>
<!-- This document navigates itself to a text directive and messages the top window with
     the resulting scroll position -->
<style>
  p {
    margin-top: 2000px;
  }
</style>

<script>
  window.onscroll = () => {
    window.top.postMessage("did_scroll", "*");
  };
  window.onload = () => {
    window.location.hash = ':~:text=Target';
  };
</script>

<p>
  Target
</p>