<!DOCTYPE html>
<body>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
test(() => {
let textarea = document.createElement('textarea');
document.body.appendChild(textarea);
textarea.select();
getSelection().deleteFromDocument();
let anchor = getSelection().anchorNode;
assert_equals(anchor.getRootNode(), document);
}, 'deleteFromDocument should not leak a UA shadow element in TEXTAREA.');
</script>
</body>