mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
LibWeb: Add a flag to track when a browsing context has been discarded
This commit is contained in:
parent
f7c212a19d
commit
2d5381fd91
Notes:
sideshowbarker
2024-07-17 04:39:52 +09:00
Author: https://github.com/trflynn89
Commit: 2d5381fd91
Pull-request: https://github.com/SerenityOS/serenity/pull/15981
Reviewed-by: https://github.com/linusg ✅
2 changed files with 5 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -243,6 +243,7 @@ public:
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/window-object.html#a-browsing-context-is-discarded
|
||||
void discard();
|
||||
bool has_been_discarded() const { return m_has_been_discarded; }
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/window-object.html#close-a-browsing-context
|
||||
void close();
|
||||
|
@ -305,6 +306,8 @@ private:
|
|||
JS::GCPtr<BrowsingContext> m_last_child;
|
||||
JS::GCPtr<BrowsingContext> m_next_sibling;
|
||||
JS::GCPtr<BrowsingContext> m_previous_sibling;
|
||||
|
||||
bool m_has_been_discarded { false };
|
||||
};
|
||||
|
||||
HTML::Origin determine_the_origin(BrowsingContext const& browsing_context, Optional<AK::URL> url, SandboxingFlagSet sandbox_flags, Optional<HTML::Origin> invocation_origin);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue