LibWeb: Fix hanging location.reload() when SHE is populated by fetching

Adds a hack to address spec bug https://github.com/whatwg/html/issues/9869
This commit is contained in:
Aliaksandr Kalenik 2024-03-27 14:54:46 +01:00 committed by Andreas Kling
parent 609a72f7c7
commit 966b042db6
Notes: sideshowbarker 2024-07-16 23:44:30 +09:00
10 changed files with 158 additions and 8 deletions

View file

@ -27,4 +27,22 @@ void DocumentState::visit_edges(Cell::Visitor& visitor)
}
}
JS::NonnullGCPtr<DocumentState> DocumentState::clone() const
{
JS::NonnullGCPtr<DocumentState> cloned = *heap().allocate_without_realm<DocumentState>();
cloned->m_document = m_document;
cloned->m_history_policy_container = m_history_policy_container;
cloned->m_request_referrer = m_request_referrer;
cloned->m_request_referrer_policy = m_request_referrer_policy;
cloned->m_initiator_origin = m_initiator_origin;
cloned->m_origin = m_origin;
cloned->m_about_base_url = m_about_base_url;
cloned->m_nested_histories = m_nested_histories;
cloned->m_resource = m_resource;
cloned->m_reload_pending = m_reload_pending;
cloned->m_ever_populated = m_ever_populated;
cloned->m_navigable_target_name = m_navigable_target_name;
return cloned;
}
}