1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:38:11 +00:00

LibWeb: Don't overwrite existing text content when flushing HTML parser

If we run an inline script from the HTML parser, it may append a text
node to the current insertion point.

If there was text content immediately following the script element,
we would previously overwrite the script-inserted text content, due to
an oversight in the way we select an appropriate insertion point

This patch fixes the issue by only inserting parser content into
existing text nodes if they are empty.
This commit is contained in:
Andreas Kling 2023-08-16 10:58:12 +02:00
parent c7f416682b
commit e2740bd19d
3 changed files with 13 additions and 3 deletions

View file

@ -0,0 +1,4 @@
<body></body>
<script>
document.body.appendChild(document.createTextNode("PASS"));
</script>