LibWeb/HTML: Implement inner text set according to spec

Replaced the ad-hoc implementation with a spec compliant one.
This change fixes 36 WPT tests.
This commit is contained in:
samu698 2024-10-20 00:12:05 +02:00 committed by Alexander Kalenik
commit 50f642613d
Notes: github-actions[bot] 2024-10-20 20:15:59 +00:00
4 changed files with 61 additions and 1 deletions

View file

@ -0,0 +1,12 @@
<script src="../include.js"></script>
<script>
test(() => {
let element = document.createElement('div');
element.innerText = "";
println('Empty string: "' + element.innerHTML + '"');
element.innerText = "foo";
println('Simple text: "' + element.innerHTML + '"');
element.innerText = "\rfoo\nbar\r\nbaz\n\rfoobar\n";
println('Text with newlines: "' + element.innerHTML + '"');
});
</script>