mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 12:07:14 +02:00
LibWeb: Replace spin_until in apply_the_history_step with state machine
Replace the blocking spin_processing_tasks_with_source_until calls in apply_the_history_step_after_unload_check() with an event-driven ApplyHistoryStepState GC cell that tracks 5 phases, following the same pattern used by CheckUnloadingCanceledState. Key changes: - Introduce ApplyHistoryStepState with phases: WaitingForDocumentPopulation, ProcessingContinuations, WaitingForChangeJobCompletion, WaitingForNonChangingJobs and Completed - Add on_complete callbacks to apply_the_push_or_replace_history_step, finalize_a_same_document_navigation, finalize_a_cross_document_navigation, and update_for_navigable_creation_or_destruction - Remove spin_until from Document::open() - Use null-document tasks for non-changing navigable updates and document unload/destroy to avoid stuck tasks when documents become non-fully-active - Defer completely_finish_loading when document has no navigable yet, and re-trigger post-load steps in activate_history_entry for documents that completed loading before activation Co-Authored-By: Shannon Booth <shannon@serenityos.org>
This commit is contained in:
committed by
Alexander Kalenik
parent
b36f2361f1
commit
2a69fd4c52
Notes:
github-actions[bot]
2026-03-31 07:49:17 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/2a69fd4c528 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8687 Reviewed-by: https://github.com/shannonbooth
@@ -49,11 +49,10 @@ void HTMLFrameElement::inserted()
|
||||
return;
|
||||
|
||||
// 3. Create a new child navigable for insertedNode.
|
||||
MUST(create_new_child_navigable(GC::create_function(realm().heap(), [this] {
|
||||
// 4. Process the frame attributes for insertedNode, with initialInsertion set to true.
|
||||
process_the_frame_attributes(InitialInsertion::Yes);
|
||||
set_content_navigable_has_session_history_entry_and_ready_for_navigation();
|
||||
})));
|
||||
MUST(create_new_child_navigable());
|
||||
|
||||
// 4. Process the frame attributes for insertedNode, with initialInsertion set to true.
|
||||
process_the_frame_attributes(InitialInsertion::Yes);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/obsolete.html#frames:html-element-removing-steps
|
||||
|
||||
Reference in New Issue
Block a user