Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain.html - WPT Dashboard Interop Dashboard
<!doctype html>
<title>Sandboxed document.domain</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(() => {
assert_throws_dom("SecurityError", () => { document.domain = document.domain });
});
test(() => {
assert_throws_dom("SecurityError", () => { (new Document).domain = document.domain });
});
test(() => {
assert_throws_dom("SecurityError", () => { document.implementation.createHTMLDocument().domain = document.domain });
});
test(() => {
assert_throws_dom("SecurityError", () => { document.implementation.createDocument(null, "").domain = document.domain });
});
test(() => {
assert_throws_dom("SecurityError", () => { document.createElement("template").content.ownerDocument.domain = document.domain });
});
</script>