LibWeb: Process navigations after initial about:blank navigation is done

Otherwise finalization step of initial `about:blank` navigation might
cancel user-initiated navigations by changing ongoing navigation id.

This is implemented by marking navigable as ready to start processing
navigation in SHTQ task, because we know for sure this task cannot be
processed until finalization step of initial `about:blank` navigation
is done.
This commit is contained in:
Aliaksandr Kalenik 2025-02-27 21:36:33 +01:00 committed by Alexander Kalenik
parent 3fd1538191
commit 3f71907255
Notes: github-actions[bot] 2025-02-27 22:33:56 +00:00
3 changed files with 33 additions and 1 deletions

View file

@ -16,6 +16,7 @@
#include <LibWeb/HTML/HTMLIFrameElement.h>
#include <LibWeb/HTML/Navigable.h>
#include <LibWeb/HTML/Parser/HTMLParser.h>
#include <LibWeb/HTML/TraversableNavigable.h>
#include <LibWeb/Layout/NavigableContainerViewport.h>
namespace Web::HTML {
@ -93,7 +94,12 @@ void HTMLIFrameElement::post_connection()
// 3. Process the iframe attributes for insertedNode, with initialInsertion set to true.
process_the_iframe_attributes(true);
set_content_navigable_has_session_history_entry_and_ready_for_navigation();
if (auto navigable = content_navigable()) {
auto traversable = navigable->traversable_navigable();
traversable->append_session_history_traversal_steps(GC::create_function(heap(), [this] {
set_content_navigable_has_session_history_entry_and_ready_for_navigation();
}));
}
})));
}