mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
LibWeb: Fire iframe load event on document close
This matches the behavior of other browsers. (cherry picked from commit e1eeb93cc6095a47371d23db0bbf55eb30215cee)
This commit is contained in:
parent
8725bb12f2
commit
f9158f4210
3 changed files with 19 additions and 0 deletions
|
@ -0,0 +1 @@
|
|||
Onload event fired
|
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
asyncTest(done => {
|
||||
const iframe = document.createElement('iframe');
|
||||
document.body.appendChild(iframe);
|
||||
iframe.contentDocument.open();
|
||||
iframe.onload = () => {
|
||||
println("Onload event fired");
|
||||
iframe.remove();
|
||||
done();
|
||||
};
|
||||
iframe.contentDocument.close();
|
||||
});
|
||||
</script>
|
|
@ -697,6 +697,9 @@ WebIDL::ExceptionOr<void> Document::close()
|
|||
// FIXME: 6. Run the tokenizer, processing resulting tokens as they are emitted, and stopping when the tokenizer reaches the explicit "EOF" character or spins the event loop.
|
||||
m_parser->run();
|
||||
|
||||
// AD-HOC: This ensures that a load event is fired if the node navigable's container is an iframe.
|
||||
completely_finish_loading();
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue