mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
LibWeb: Do not unload during same-document history step application
See https://github.com/whatwg/html/pull/9904
This commit is contained in:
parent
67566e5017
commit
38531ce7cf
Notes:
sideshowbarker
2024-07-17 18:23:22 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/38531ce7cf Pull-request: https://github.com/SerenityOS/serenity/pull/21740
@ -424,15 +424,18 @@ void TraversableNavigable::apply_the_history_step(int step, Optional<SourceSnaps
|
||||
|
||||
// 1. If changingNavigableContinuation's update-only is false, then:
|
||||
if (!update_only) {
|
||||
// 1. Unload displayedDocument given targetEntry's document.
|
||||
displayed_document->unload(target_entry->document_state->document());
|
||||
// 1. If targetEntry's document does not equal displayedDocument, then:
|
||||
if (target_entry->document_state->document().ptr() != displayed_document.ptr()) {
|
||||
// 1. Unload displayedDocument given targetEntry's document.
|
||||
displayed_document->unload(target_entry->document_state->document());
|
||||
|
||||
// 2. For each childNavigable of displayedDocument's descendant navigables, queue a global task on the navigation and traversal task source given
|
||||
// childNavigable's active window to unload childNavigable's active document.
|
||||
for (auto child_navigable : displayed_document->descendant_navigables()) {
|
||||
queue_global_task(Task::Source::NavigationAndTraversal, *navigable->active_window(), [child_navigable] {
|
||||
child_navigable->active_document()->unload();
|
||||
});
|
||||
// 2. For each childNavigable of displayedDocument's descendant navigables, queue a global task on the navigation and traversal task source given
|
||||
// childNavigable's active window to unload childNavigable's active document.
|
||||
for (auto child_navigable : displayed_document->descendant_navigables()) {
|
||||
queue_global_task(Task::Source::NavigationAndTraversal, *navigable->active_window(), [child_navigable] {
|
||||
child_navigable->active_document()->unload();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Activate history entry targetEntry for navigable.
|
||||
|
Loading…
Reference in New Issue
Block a user