forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibWeb: Wait for initial navigation to complete before modifying iframe
If initial src of an iframe is "about:blank", it does synchronous navigation that is not supposed to be interleaved by other navigation or usage of Document.open(). Fixes crashing in navigation on https://twinings.co.uk/
- Loading branch information
1 parent
de6507e
commit a2dd749
Showing
5 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
Tests/LibWeb/Text/expected/navigation/populate-iframe-using-document-write.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PASS (didn't crash) |
22 changes: 22 additions & 0 deletions
22
Tests/LibWeb/Text/input/navigation/populate-iframe-using-document-write.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<script src="../include.js"></script> | ||
<body></body> | ||
<script> | ||
const iframe = document.createElement("iframe"); | ||
document.body.appendChild(iframe); | ||
|
||
const iframeDocument = iframe.contentDocument; | ||
|
||
iframeDocument.open(); | ||
iframeDocument.write( | ||
"<!DOCTYPE html><html><head><title>Iframe Content</title></head><body>" | ||
); | ||
iframeDocument.write("<h1>Hello</h1>"); | ||
iframeDocument.write("<p>from iframe</p>"); | ||
iframeDocument.write("</body></html>"); | ||
iframeDocument.close(); | ||
|
||
test(() => { | ||
println("PASS (didn't crash)"); | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters