Update WPT tests for embedded content
[WebKit-https.git] / LayoutTests / imported / w3c / web-platform-tests / html / semantics / embedded-content / the-iframe-element / document-getters-return-null-for-cross-origin.html
1 <!DOCTYPE html>
2 <meta charset=utf-8>
3 <title>Test that contentDocument/getSVGDocument() return null for a cross-origin document.</title>
4 <script src="/resources/testharness.js"></script>
5 <script src="/resources/testharnessreport.js"></script>
6 <body>
7 <iframe src='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><rect height="100" width="100"/></svg>'></iframe>
8 <script>
9 const iframe = document.querySelector('iframe');
10 var t1 = async_test('HTMLIFrameElement.contentDocument for cross-origin document');
11 window.addEventListener(
12     'load', t1.step_func_done(() => { assert_equals(iframe.contentDocument, null); }));
13 var t2 = async_test('HTMLIFrameElement.getSVGDocument() for cross-origin document');
14 window.addEventListener(
15     'load', t2.step_func_done(() => { assert_equals(iframe.getSVGDocument(), null); }));
16 </script>
17 </body>