1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:58:13 +00:00

LibWeb: Update focus_chain() to use navigables

This commit is contained in:
Aliaksandr Kalenik 2023-09-07 01:19:24 +02:00 committed by Andreas Kling
parent 38034237c5
commit 6411fea552

View file

@ -142,12 +142,12 @@ static Vector<JS::Handle<DOM::Node>> focus_chain(DOM::Node* subject)
// 3. If currentObject is a focusable area, then set currentObject to currentObject's DOM anchor's node document.
current_object = &current_object->document();
} else if (is<DOM::Document>(*current_object)
&& static_cast<DOM::Document&>(*current_object).browsing_context()
&& !static_cast<DOM::Document&>(*current_object).browsing_context()->is_top_level()) {
// Otherwise, if currentObject is a Document whose browsing context is a child browsing context,
// then set currentObject to currentObject's browsing context's container.
current_object = static_cast<DOM::Document&>(*current_object).browsing_context()->container();
&& current_object->navigable()
&& current_object->navigable()->parent()) {
// Otherwise, if currentObject is a Document whose node navigable's parent is non-null, then set currentObject to currentObject's node navigable's parent.
current_object = current_object->navigable()->container();
} else {
// Otherwise, break.
break;
}
}