Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /dom/nodes/moveBefore/tentative/nonce.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Nonce attribute is not cleared</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<section id="new_parent"></section>
<script>
test(t => {
const div = document.createElement('div');
document.body.append(div);
const kNonce = '8IBTHwOdqNKAWeKl7plt8g==';
div.setAttribute('nonce', kNonce);
assert_equals(div.getAttribute('nonce'), kNonce);
new_parent.moveBefore(div, null);
assert_equals(div.getAttribute('nonce'), kNonce);
new_parent.insertBefore(div, null);
assert_equals(div.getAttribute('nonce'), "");
}, "Element nonce content attribute is not cleared after move");
</script>