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

@ -28,6 +28,23 @@ SessionHistoryEntry::SessionHistoryEntry()
{
}
JS::NonnullGCPtr<SessionHistoryEntry> SessionHistoryEntry::clone() const
{
JS::NonnullGCPtr<SessionHistoryEntry> entry = *heap().allocate_without_realm<SessionHistoryEntry>();
entry->m_step = m_step;
entry->m_url = m_url;
entry->m_document_state = m_document_state->clone();
entry->m_classic_history_api_state = m_classic_history_api_state;
entry->m_navigation_api_state = m_navigation_api_state;
entry->m_navigation_api_key = m_navigation_api_key;
entry->m_navigation_api_id = m_navigation_api_id;
entry->m_scroll_restoration_mode = m_scroll_restoration_mode;
entry->m_policy_container = m_policy_container;
entry->m_browsing_context_name = m_browsing_context_name;
entry->m_original_source_browsing_context = m_original_source_browsing_context;
return entry;
}
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#she-document
JS::GCPtr<DOM::Document> SessionHistoryEntry::document() const
{