LibWeb: Implement Element.outerHTML setter

This commit is contained in:
Shannon Booth
2024-05-04 19:48:08 +12:00
committed by Andreas Kling
parent faf33056da
commit e070309258
3 changed files with 47 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
<script src="../include.js"></script>
<div id="oldBox"><p>A box.</p></div>
<script>
test(() => {
let oldElement = document.getElementById("oldBox");
println('');
println(`${oldElement.id}='${oldElement.innerHTML}'`);
oldElement.outerHTML = '<div id="newBox"><p>Changed box.</p></div>';
let newElement = document.getElementById("newBox");
println(`${newElement.id}='${newElement.innerHTML}'`);
try {
document.documentElement.outerHTML = 'should throw exception!';
} catch (e) {
println(e);
}
});
</script>