blob: e3dc0b0e4e6117cf6dee027183cb27cf39077eb8 [file] [log] [blame]
<!DOCTYPE html>
<meta charset=utf-8>
<title>Test that contentDocument/getSVGDocument() return null for a cross-origin document.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<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>
<script>
const iframe = document.querySelector('iframe');
var t1 = async_test('HTMLIFrameElement.contentDocument for cross-origin document');
window.addEventListener(
'load', t1.step_func_done(() => { assert_equals(iframe.contentDocument, null); }));
var t2 = async_test('HTMLIFrameElement.getSVGDocument() for cross-origin document');
window.addEventListener(
'load', t2.step_func_done(() => { assert_equals(iframe.getSVGDocument(), null); }));
</script>
</body>