mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
LibWeb: Don't rely on SHTQ::process() in process_the_iframe_attributes
`HTMLIFrameElement::inserted()` does following: 1. Init a new navigable. This step appends a task on session history traversal queue (SHTQ) that creates a new nested history. 2. Process iframe's attributes Processing of iframe's attributes might result in synchronous navigation that fails to get active SHE if SHTQ task that creates new nested history is not yet completed. Before this change, a workaround involved forcing the processing of SHTQ, which was terrible hack because it could occur in the middle of another SHTQ task. This change removes the need for "force SHTQ processing" by ensuring that the processing of iframe's attributes is always executed after the iframe's navigable nested history has been created.
This commit is contained in:
committed by
Alexander Kalenik
parent
8cc2ee34db
commit
11011cf250
Notes:
sideshowbarker
2024-07-17 07:35:03 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/11011cf250 Pull-request: https://github.com/SerenityOS/serenity/pull/23853
@@ -60,12 +60,13 @@ void HTMLIFrameElement::inserted()
|
||||
// When an iframe element element is inserted into a document whose browsing context is non-null, the user agent must run these steps:
|
||||
if (in_a_document_tree() && document().browsing_context()) {
|
||||
// 1. Create a new child navigable for element.
|
||||
MUST(create_new_child_navigable());
|
||||
MUST(create_new_child_navigable([this] {
|
||||
// 3. Process the iframe attributes for element, with initialInsertion set to true.
|
||||
process_the_iframe_attributes(true);
|
||||
set_content_navigable_initialized();
|
||||
}));
|
||||
|
||||
// FIXME: 2. If element has a sandbox attribute, then parse the sandboxing directive given the attribute's value and element's iframe sandboxing flag set.
|
||||
|
||||
// 3. Process the iframe attributes for element, with initialInsertion set to true.
|
||||
process_the_iframe_attributes(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user