Bug 1895208 - Refactor IsFocusable checks to take flags rather than bool arguments. r=smaug

This doesn't change behavior on its own, but it's likely we want to make
the tab focusability more complicated in bug 1895184, and this will make
changes to this area less painful.

Differential Revision: https://phabricator.services.mozilla.com/D209525
This commit is contained in:
Emilio Cobos Álvarez
2024-05-06 21:54:37 +00:00
parent ea2879b384
commit bf22d33f87
49 changed files with 170 additions and 143 deletions

View File

@@ -12,6 +12,7 @@
#include "DocAccessible-inl.h"
#include "DocAccessibleChild.h"
#include "FocusManager.h"
#include "mozilla/FocusModel.h"
#include "HTMLCanvasAccessible.h"
#include "HTMLElementAccessibles.h"
#include "HTMLImageMapAccessible.h"
@@ -188,8 +189,7 @@ static bool MustBeAccessible(nsIContent* aContent, DocAccessible* aDocument) {
// not create Accessibles for some focusable elements; e.g. a span with only
// a tabindex. Elements that are invisible within this document are excluded
// earlier in CreateAccessible.
if (frame->IsFocusable(/* aWithMouse */ false,
/* aCheckVisibility */ false)) {
if (frame->IsFocusable(IsFocusableFlags::IgnoreVisibility)) {
return true;
}
}