LibWeb: Correct some faulty logic in 'apply the history step'

We were checking if the parent was _not_ null, and not checking for an
auxiliary browsing context at all.
This commit is contained in:
Shannon Booth 2024-10-15 00:03:34 +13:00 committed by Tim Ledbetter
commit cde3545a51
Notes: github-actions[bot] 2024-10-14 12:46:34 +00:00

View file

@ -584,8 +584,8 @@ TraversableNavigable::HistoryStepResult TraversableNavigable::apply_the_history_
// - targetEntry's document's browsing context is not an auxiliary browsing context whose opener browsing context is non-null; and
// - targetEntry's document's origin is not oldOrigin,
// then set targetEntry's document state's navigable target name to the empty string.
if (navigable->parent() != nullptr
&& target_entry->document()->browsing_context()->opener_browsing_context() == nullptr
if (navigable->parent() == nullptr
&& !(target_entry->document()->browsing_context()->is_auxiliary() && target_entry->document()->browsing_context()->opener_browsing_context() != nullptr)
&& target_entry->document_state()->origin() != old_origin) {
target_entry->document_state()->set_navigable_target_name(String {});
}