Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /fetch/api/request/multi-globals/construct-in-detached-frame.window.html - WPT Dashboard Interop Dashboard
test(() => {
const iframe = document.createElement('iframe');
document.body.append(iframe);
const otherRequest = iframe.contentWindow.Request;
iframe.remove();
const r1 = new otherRequest('resource', { method: 'POST', body: 'string' });
const r2 = new otherRequest(r1);
assert_true(r1.bodyUsed);
assert_false(r2.bodyUsed);
}, 'creating a request from another request in a detached realm should work');