Update WPT tests for embedded content
[WebKit-https.git] / LayoutTests / imported / w3c / web-platform-tests / html / semantics / embedded-content / the-iframe-element / iframe-nosrc.html
1 <!DOCTYPE html>
2 <meta charset="UTF-8">
3 <title>Check processing of iframe without src and srcdoc attribute</title>
4 <link rel="author" title="Xidorn Quan" href="https://www.upsuper.org">
5 <link rel="author" title="Mozilla" href="https://www.mozilla.org">
6 <link rel="help" href="https://html.spec.whatwg.org/multipage/iframe-embed-object.html#process-the-iframe-attributes">
7 <script src="/resources/testharness.js"></script>
8 <script src="/resources/testharnessreport.js"></script>
9
10 <div id="log"></div>
11 <iframe></iframe>
12 <script>
13   let iframe = document.querySelector("iframe");
14
15   async_test(t => {
16     let originDoc = iframe.contentDocument;
17     window.addEventListener("load", t.step_func_done(() => {
18       assert_equals(iframe.contentDocument, originDoc, "contentDocument shouldn't be changed");
19     }));
20   }, "iframe.contentDocument should not be changed");
21
22   async_test(t => {
23     iframe.addEventListener("load", t.unreached_func());
24     window.addEventListener("load", () => t.done());
25   }, "load event of iframe should not be fired after processing the element");
26 </script>