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

LibWeb: Add a flag to track when a browsing context has been discarded

This commit is contained in:
Timothy Flynn 2022-11-08 12:56:40 -05:00 committed by Tim Flynn
parent f7c212a19d
commit 2d5381fd91
2 changed files with 5 additions and 0 deletions

View file

@ -1329,6 +1329,8 @@ void BrowsingContext::set_system_visibility_state(VisibilityState visibility_sta
// https://html.spec.whatwg.org/multipage/window-object.html#a-browsing-context-is-discarded
void BrowsingContext::discard()
{
m_has_been_discarded = true;
// 1. Discard all Document objects for all the entries in browsingContext's session history.
for (auto& entry : m_session_history) {
if (entry.document)