diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /accessible/basetypes/Accessible.cpp | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'accessible/basetypes/Accessible.cpp')
-rw-r--r-- | accessible/basetypes/Accessible.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/accessible/basetypes/Accessible.cpp b/accessible/basetypes/Accessible.cpp index 05c8270483..de9740dd18 100644 --- a/accessible/basetypes/Accessible.cpp +++ b/accessible/basetypes/Accessible.cpp @@ -468,7 +468,7 @@ void Accessible::DebugPrint(const char* aPrefix, } else { desc.AssignLiteral("[null]"); } -# if defined(ANDROID) +# if defined(ANDROID) || defined(MOZ_WIDGET_UIKIT) printf_stderr("%s %s\n", aPrefix, desc.get()); # else printf("%s %s\n", aPrefix, desc.get()); @@ -539,17 +539,13 @@ nsStaticAtom* Accessible::LandmarkRole() const { } if (tagName == nsGkAtoms::section) { - nsAutoString name; - Name(name); - if (!name.IsEmpty()) { + if (!NameIsEmpty()) { return nsGkAtoms::region; } } if (tagName == nsGkAtoms::form) { - nsAutoString name; - Name(name); - if (!name.IsEmpty()) { + if (!NameIsEmpty()) { return nsGkAtoms::form; } } @@ -567,8 +563,10 @@ nsStaticAtom* Accessible::LandmarkRole() const { nsStaticAtom* Accessible::ComputedARIARole() const { const nsRoleMapEntry* roleMap = ARIARoleMap(); if (roleMap && roleMap->roleAtom != nsGkAtoms::_empty && - // region has its own Gecko role and it needs to be handled specially. + // region and form have their own Gecko roles and need to be handled + // specially. roleMap->roleAtom != nsGkAtoms::region && + roleMap->roleAtom != nsGkAtoms::form && (roleMap->roleRule == kUseNativeRole || roleMap->IsOfType(eLandmark) || roleMap->roleAtom == nsGkAtoms::alertdialog || roleMap->roleAtom == nsGkAtoms::feed || @@ -596,7 +594,7 @@ nsStaticAtom* Accessible::ComputedARIARole() const { } // Role from native markup or layout. #define ROLE(_geckoRole, stringRole, ariaRole, atkRole, macRole, macSubrole, \ - msaaRole, ia2Role, androidClass, nameRule) \ + msaaRole, ia2Role, androidClass, iosIsElement, nameRule) \ case roles::_geckoRole: \ return ariaRole; switch (geckoRole) { @@ -651,6 +649,12 @@ void Accessible::ApplyImplicitState(uint64_t& aState) const { } } +bool Accessible::NameIsEmpty() const { + nsAutoString name; + Name(name); + return name.IsEmpty(); +} + //////////////////////////////////////////////////////////////////////////////// // KeyBinding class |