summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/srcdoc-anchor.html
blob: cf26c28f0859ef80ae024b7462ac3ad946238ee1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<title>Verify srcdoc content loads when src is about:srcdoc#foo.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<iframe id=myframe srcdoc='srcdoc_text' src='about:srcdoc#foo'></iframe>

<script>
  async_test(function(t) {
    // Verify that the srcdoc content is loaded before we start.
    window.onload = t.step_func_done(() => {
        assert_true(typeof myframe.contentDocument !== 'undefined',
            'iframe has contentDocument');
        assert_equals(myframe.contentDocument.body.innerText, 'srcdoc_text',
            'iframe contains srcdoc content');
    }, '');
  }, 'Verify srcdoc content loads when src is about:srcdoc#foo.');
</script>