mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 10:48:41 +00: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
@@ -255,8 +255,10 @@ void HTMLObjectElement::run_object_representation_handler_steps(Optional<ByteStr
|
||||
// * If the resource type is an XML MIME type, or if the resource type does not start with "image/"
|
||||
if (resource_type.has_value() && (is_xml_mime_type(*resource_type) || !resource_type->starts_with("image/"sv))) {
|
||||
// If the object element's content navigable is null, then create a new child navigable for the element.
|
||||
if (!m_content_navigable)
|
||||
if (!m_content_navigable) {
|
||||
MUST(create_new_child_navigable());
|
||||
set_content_navigable_initialized();
|
||||
}
|
||||
|
||||
// NOTE: Creating a new nested browsing context can fail if the document is not attached to a browsing context
|
||||
if (!m_content_navigable)
|
||||
|
||||
Reference in New Issue
Block a user