mirror of
https://github.com/RGBCube/serenity
synced 2025-05-21 16:05:07 +00:00
LibWeb: Only wait for document to be ready for scripts if executing one
HTML fragments are parsed with a temporary HTML document that never has its flag set to say that it is ready to have scripts executed. For these fragments, in the HTMLParser, these scripts are prepared, but execute_script is never called on them. This results in the HTMLParser waiting forever on the document to be ready to have scripts executed. To fix this, only wait for the document to be ready if we are definitely going to execute a script. This fixes a hang processing the HTML in the attached test, as seen on: https://github.com/SerenityOS/serenity Fixes: #22735
This commit is contained in:
parent
48a3a02238
commit
4135c3885c
4 changed files with 16 additions and 7 deletions
|
@ -0,0 +1,9 @@
|
|||
<script src="../include.js"></script>
|
||||
<div id=container></div>
|
||||
<script type="text/javascript">
|
||||
test(() => {
|
||||
let container = document.getElementById("container");
|
||||
container.innerHTML = '<script><\/script>';
|
||||
println("PASS");
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue