Backed out changeset 977bf4319b43 (bug 1891934) for causing wpt failures in nsFocusManager.cpp. CLOSED TREE

This commit is contained in:
Tamas Szentpeteri
2024-04-24 16:40:18 +03:00
parent a175fc6573
commit a9d1e792f2

View File

@@ -4303,9 +4303,7 @@ nsresult nsFocusManager::GetNextTabbableContent(
// Stepping out popover scope.
// For forward, search for the next tabbable content after invoker.
// For backward, we should get back to the invoker if the invoker is
// focusable. Otherwise search for the next tabbable content after
// invoker.
// For backward, we should get back to the invoker.
if (oldTopLevelScopeOwner &&
IsOpenPopoverWithInvoker(oldTopLevelScopeOwner) &&
currentTopLevelScopeOwner != oldTopLevelScopeOwner) {
@@ -4329,21 +4327,12 @@ nsresult nsFocusManager::GetNextTabbableContent(
return rv;
}
}
} else if (invokerContent) {
nsIFrame* frame = invokerContent->GetPrimaryFrame();
if (frame && frame->IsFocusable()) {
invokerContent.forget(aResultContent);
return NS_OK;
}
nsIContent* contentToFocus = GetNextTabbableContentInScope(
currentTopLevelScopeOwner, invokerContent,
aOriginalStartContent, aForward, 0, aIgnoreTabIndex,
aForDocumentNavigation, aNavigateByKey, false /* aSkipOwner */,
aReachedToEndForDocumentNavigation);
if (contentToFocus) {
NS_ADDREF(*aResultContent = contentToFocus);
return NS_OK;
}
} else if (invokerContent &&
invokerContent->IsFocusableWithoutStyle()) {
// FIXME(emilio): The check above should probably use
// nsIFrame::IsFocusable, not IsFocusableWithoutStyle.
invokerContent.forget(aResultContent);
return NS_OK;
}
}
}