vcl/osx/a11yrolehelper.mm |    6 ++++--
 vcl/osx/a11ywrapper.mm    |    9 ++++++++-
 2 files changed, 12 insertions(+), 3 deletions(-)

New commits:
commit 66aaa3850f3a3141f19c398a2efc85fde7969092
Author:     Patrick Luby <guibmac...@gmail.com>
AuthorDate: Thu Jul 11 20:44:55 2024 -0400
Commit:     Patrick Luby <guibomac...@gmail.com>
CommitDate: Fri Jul 12 15:19:57 2024 +0200

    tdf#67943 tabs must have radio button role and tab button subrole
    
    Also, reimplement -[AquaA11yWrapper tabsAttribute] to return children
    for tab bars. This will cause VoiceOver to announce that the currently
    selected tab is "X of Y" tabs in the tab bar.
    
    Change-Id: I2c3b890fd445c22842b90d60170a71e4e8aa91ff
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170389
    Reviewed-by: Patrick Luby <guibomac...@gmail.com>
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    (cherry picked from commit c2061f21b1a88c9692a4e081280ed2c52e0b9141)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170357

diff --git a/vcl/osx/a11yrolehelper.mm b/vcl/osx/a11yrolehelper.mm
index 5b621a74e23a..7a8ef5adcbf6 100644
--- a/vcl/osx/a11yrolehelper.mm
+++ b/vcl/osx/a11yrolehelper.mm
@@ -83,7 +83,8 @@ using namespace ::com::sun::star::uno;
         MAP( AccessibleRole::MENU_BAR, NSAccessibilityMenuBarRole );
         MAP( AccessibleRole::MENU_ITEM, NSAccessibilityMenuItemRole );
         MAP( AccessibleRole::OPTION_PANE, NSAccessibilityUnknownRole ); // 
FIXME
-        MAP( AccessibleRole::PAGE_TAB, NSAccessibilityButtonRole );
+        // tdf#67943 tabs must have radio button role and tab button subrole
+        MAP( AccessibleRole::PAGE_TAB, NSAccessibilityRadioButtonRole );
         MAP( AccessibleRole::PAGE_TAB_LIST, NSAccessibilityTabGroupRole );
         MAP( AccessibleRole::PANEL, NSAccessibilityGroupRole );
         MAP( AccessibleRole::PARAGRAPH, NSAccessibilityTextAreaRole );
@@ -220,7 +221,8 @@ using namespace ::com::sun::star::uno;
         MAP( AccessibleRole::MENU_BAR, @"" );
         MAP( AccessibleRole::MENU_ITEM, @"" );
         MAP( AccessibleRole::OPTION_PANE, @"" );
-        MAP( AccessibleRole::PAGE_TAB, @"" );
+        // tdf#67943 tabs must have radio button role and tab button subrole
+        MAP( AccessibleRole::PAGE_TAB, NSAccessibilityTabButtonSubrole );
         MAP( AccessibleRole::PAGE_TAB_LIST, @"" );
         MAP( AccessibleRole::PANEL, @"" );
         MAP( AccessibleRole::PARAGRAPH, @"" );
diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm
index c35f02cdae53..365aa99ca816 100644
--- a/vcl/osx/a11ywrapper.mm
+++ b/vcl/osx/a11ywrapper.mm
@@ -559,7 +559,14 @@ static std::ostream &operator<<(std::ostream &s, NSObject 
*obj) {
 }
 
 -(id)tabsAttribute {
-    return self; // TODO ???
+    // Related tdf#67943: return children if this is a tab bar
+    // This will cause VoiceOver to announce that the currently selected tab
+    // is "X of Y" tabs in the tab bar.
+    if ( [ self accessibleContext ] -> getAccessibleRole() == 
AccessibleRole::PAGE_TAB_LIST ) {
+        return [ self childrenAttribute ];
+    } else {
+        return nil;
+    }
 }
 
 -(id)sharedTextUIElementsAttribute {

Reply via email to