mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-05 16:41:52 +00:00
LibWeb: Clear the document's page's focused navigable upon destruction
We set the page's focused navigable upon mouse-down events from the UI. However, we neglected to ever clear that focused navigable upon events such as subsequent page navigations. This left the page with a stale reference to a no-longer-active navigable. The effect was that any key events from the UI would not be sent to the new page until either the reference was collected by GC, or another mouse-down event occurred. In the test added here, without this fix, the text sent to the input element would not be received, and the change event would not fire.
This commit is contained in:
parent
cf523137ad
commit
b11ba4cc90
Notes:
github-actions[bot]
2025-03-02 22:28:18 +00:00
Author: https://github.com/trflynn89
Commit: b11ba4cc90
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3760
5 changed files with 43 additions and 1 deletions
|
@ -3971,9 +3971,14 @@ void Document::destroy()
|
|||
}
|
||||
|
||||
// 9. Set document's node navigable's active session history entry's document state's document to null.
|
||||
if (auto navigable = this->navigable())
|
||||
if (auto navigable = this->navigable()) {
|
||||
navigable->active_session_history_entry()->document_state()->set_document(nullptr);
|
||||
|
||||
// AD-HOC: We set the page's focused navigable during mouse-down events. If that navigable is this document's
|
||||
// navigable, we must be sure to reset the page's focused navigable.
|
||||
page().navigable_document_destroyed({}, *navigable);
|
||||
}
|
||||
|
||||
// FIXME: 10. Remove document from the owner set of each WorkerGlobalScope object whose set contains document.
|
||||
// FIXME: 11. For each workletGlobalScope in document's worklet global scopes, terminate workletGlobalScope.
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue