LibWeb: Skip creating a navigable for <object> not connected to document

Navigation should not run for <object> element until it is inserted into
a document. Spec deoes not seem to explicitely say that, but that
matches other browsers behavior.

Fixes hanging after reloading in Acid3 test.
This commit is contained in:
Aliaksandr Kalenik 2024-04-17 12:26:25 +02:00 committed by Alexander Kalenik
parent 68440ed02d
commit d876f32e5d
Notes: sideshowbarker 2024-07-17 11:30:54 +09:00
3 changed files with 21 additions and 1 deletions

View file

@ -258,7 +258,7 @@ 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 (mime_type.has_value() && can_load_document_with_type(*mime_type) && (mime_type->is_xml() || !mime_type->is_image())) {
// 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 && in_a_document_tree()) {
MUST(create_new_child_navigable());
set_content_navigable_initialized();
}