mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:57:35 +00:00
LibWeb: Update focus_chain()
to use navigables
This commit is contained in:
parent
38034237c5
commit
6411fea552
1 changed files with 5 additions and 5 deletions
|
@ -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.
|
// 3. If currentObject is a focusable area, then set currentObject to currentObject's DOM anchor's node document.
|
||||||
current_object = ¤t_object->document();
|
current_object = ¤t_object->document();
|
||||||
} else if (is<DOM::Document>(*current_object)
|
} else if (is<DOM::Document>(*current_object)
|
||||||
&& static_cast<DOM::Document&>(*current_object).browsing_context()
|
&& current_object->navigable()
|
||||||
&& !static_cast<DOM::Document&>(*current_object).browsing_context()->is_top_level()) {
|
&& current_object->navigable()->parent()) {
|
||||||
// Otherwise, if currentObject is a Document whose browsing context is a child browsing context,
|
// Otherwise, if currentObject is a Document whose node navigable's parent is non-null, then set currentObject to currentObject's node navigable's parent.
|
||||||
// then set currentObject to currentObject's browsing context's container.
|
current_object = current_object->navigable()->container();
|
||||||
current_object = static_cast<DOM::Document&>(*current_object).browsing_context()->container();
|
|
||||||
} else {
|
} else {
|
||||||
|
// Otherwise, break.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue