From 3ebfc836a96773d934d39400930209be551a32ac Mon Sep 17 00:00:00 2001 From: Alexander Zuev Date: Tue, 29 Aug 2023 03:08:04 -0700 Subject: [PATCH 1/7] 8313556: Create implementation of NSAccessibilitySlider protocol Create implementation for Slider and Stepper accessibility protocols. Fix mapping. Fix performAction parameter type in declaration. --- .../native-glass/mac/a11y/AccessibleBase.h | 5 +- .../native-glass/mac/a11y/AccessibleBase.m | 4 +- .../mac/a11y/JFXSliderAccessibility.h | 37 ++++++++++++ .../mac/a11y/JFXSliderAccessibility.m | 59 +++++++++++++++++++ .../mac/a11y/JFXStepperAccessibility.h | 37 ++++++++++++ .../mac/a11y/JFXStepperAccessibility.m | 59 +++++++++++++++++++ 6 files changed, 199 insertions(+), 2 deletions(-) create mode 100644 modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXSliderAccessibility.h create mode 100644 modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXSliderAccessibility.m create mode 100644 modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXStepperAccessibility.h create mode 100644 modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXStepperAccessibility.m diff --git a/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.h b/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.h index 0ca9f23241d..62aafea8f2d 100644 --- a/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.h +++ b/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.h @@ -26,6 +26,9 @@ #import #import +#define INCREMENT @"AXIncrement" +#define DECREMENT @"AXDecrement" + @interface AccessibleBase : NSAccessibilityElement { @private jobject jAccessible; @@ -36,7 +39,7 @@ id parent; - (NSRect)accessibilityFrame; - (id)accessibilityParent; - (BOOL)isAccessibilityElement; -- (BOOL)performAccessibleAction:(jlong)actionId; +- (BOOL)performAccessibleAction:(NSString *)actionId; + (void) initializeRolesMap; @end diff --git a/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.m b/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.m index 987a8266423..1495a0364bb 100644 --- a/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.m +++ b/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.m @@ -38,7 +38,7 @@ + (void) initializeRolesMap { /* * Here we should keep all the mapping between the accessibility roles and implementing classes */ - rolesMap = [[NSMutableDictionary alloc] initWithCapacity:8]; + rolesMap = [[NSMutableDictionary alloc] initWithCapacity:10]; [rolesMap setObject:@"JFXButtonAccessibility" forKey:@"BUTTON"]; [rolesMap setObject:@"JFXButtonAccessibility" forKey:@"DECREMENT_BUTTON"]; @@ -50,6 +50,8 @@ + (void) initializeRolesMap { [rolesMap setObject:@"JFXRadiobuttonAccessibility" forKey:@"PAGE_ITEM"]; [rolesMap setObject:@"JFXCheckboxAccessibility" forKey:@"CHECK_BOX"]; [rolesMap setObject:@"JFXCheckboxAccessibility" forKey:@"TOGGLE_BUTTON"]; + [rolesMap setObject:@"JFXStepperAccessibility" forKey:@"SPINNER"]; + [rolesMap setObject:@"JFXSliderAccessibility" forKey:@"SLIDER"]; } diff --git a/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXSliderAccessibility.h b/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXSliderAccessibility.h new file mode 100644 index 00000000000..53d68171e85 --- /dev/null +++ b/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXSliderAccessibility.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#import "AccessibleBase.h" +#import + +@interface JFXSliderAccessibility : AccessibleBase { + +}; +- (NSAccessibilityRole)accessibilityRole; +- (NSString *)accessibilityLabel; +- (id)accessibilityValue; +- (BOOL)accessibilityPerformDecrement; +- (BOOL)accessibilityPerformIncrement; +@end diff --git a/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXSliderAccessibility.m b/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXSliderAccessibility.m new file mode 100644 index 00000000000..92699946c29 --- /dev/null +++ b/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXSliderAccessibility.m @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#import "JFXSliderAccessibility.h" + +/* + * Implementation of the accessibility peer for the slider role + */ + +@implementation JFXSliderAccessibility +- (NSAccessibilityRole)accessibilityRole +{ + return NSAccessibilitySliderRole; +} + +- (NSString *)accessibilityLabel +{ + return [super accessibilityLabel]; +} + +- (id)accessibilityValue +{ + return [super accessibilityValue]; +} + +- (BOOL)accessibilityPerformIncrement +{ + return [self performAccessibleAction:INCREMENT]; +} + +- (BOOL)accessibilityPerformDecrement +{ + return [self performAccessibleAction:DECREMENT]; +} + +@end + diff --git a/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXStepperAccessibility.h b/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXStepperAccessibility.h new file mode 100644 index 00000000000..3da121a05de --- /dev/null +++ b/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXStepperAccessibility.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#import "AccessibleBase.h" +#import + +@interface JFXStepperAccessibility : AccessibleBase { + +}; +- (NSAccessibilityRole)accessibilityRole; +- (NSString *)accessibilityLabel; +- (id)accessibilityValue; +- (BOOL)accessibilityPerformDecrement; +- (BOOL)accessibilityPerformIncrement; +@end diff --git a/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXStepperAccessibility.m b/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXStepperAccessibility.m new file mode 100644 index 00000000000..de5ce7db2bc --- /dev/null +++ b/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXStepperAccessibility.m @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#import "JFXStepperAccessibility.h" + +/* + * Implementation of the accessibility peer for the stepper role + */ + +@implementation JFXStepperAccessibility +- (NSAccessibilityRole)accessibilityRole +{ + return NSAccessibilityIncrementorRole; +} + +- (NSString *)accessibilityLabel +{ + return [super accessibilityLabel]; +} + +- (id)accessibilityValue +{ + return [super accessibilityValue]; +} + +- (BOOL)accessibilityPerformIncrement +{ + return [self performAccessibleAction:INCREMENT]; +} + +- (BOOL)accessibilityPerformDecrement +{ + return [self performAccessibleAction:DECREMENT]; +} + +@end + From ceb83cd6b429a4a46bb922d9f67552e014eceab7 Mon Sep 17 00:00:00 2001 From: Alexander Zuev Date: Tue, 29 Aug 2023 13:09:27 -0700 Subject: [PATCH 2/7] Add commented out debug statements. --- .../src/main/native-glass/mac/a11y/JFXSliderAccessibility.m | 3 ++- .../src/main/native-glass/mac/a11y/JFXStepperAccessibility.m | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXSliderAccessibility.m b/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXSliderAccessibility.m index 92699946c29..96a68f0340c 100644 --- a/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXSliderAccessibility.m +++ b/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXSliderAccessibility.m @@ -47,13 +47,14 @@ - (id)accessibilityValue - (BOOL)accessibilityPerformIncrement { +// NSLog(@"Slider increment action invoked"); return [self performAccessibleAction:INCREMENT]; } - (BOOL)accessibilityPerformDecrement { +// NSLog(@"Slider decrement action invoked"); return [self performAccessibleAction:DECREMENT]; } @end - diff --git a/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXStepperAccessibility.m b/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXStepperAccessibility.m index de5ce7db2bc..c78875d8ec8 100644 --- a/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXStepperAccessibility.m +++ b/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXStepperAccessibility.m @@ -47,13 +47,14 @@ - (id)accessibilityValue - (BOOL)accessibilityPerformIncrement { +// NSLog(@"Stepper increment action invoked"); return [self performAccessibleAction:INCREMENT]; } - (BOOL)accessibilityPerformDecrement { +// NSLog(@"Stepper decrement action invoked"); return [self performAccessibleAction:DECREMENT]; } @end - From 591351716d8ea32783a232cfa6358942c11b8deb Mon Sep 17 00:00:00 2001 From: Alexander Zuev Date: Wed, 30 Aug 2023 10:44:58 -0700 Subject: [PATCH 3/7] Fixing warnings during build --- .../src/main/native-glass/mac/a11y/AccessibleBase.m | 2 +- .../native-glass/mac/a11y/JFXSliderAccessibility.m | 10 ++++++++++ .../native-glass/mac/a11y/JFXStepperAccessibility.m | 10 ++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.m b/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.m index 1495a0364bb..56e7482bf07 100644 --- a/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.m +++ b/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.m @@ -244,6 +244,6 @@ - (void)setAccessibilityFocused:(BOOL)value { NSObject* accessible = (NSObject*)jlong_to_ptr(macAccessible); if ([accessible respondsToSelector:@selector(clearParent)]) { - [accessible clearParent]; + [accessible performSelector:@selector(clearParent)]; } } diff --git a/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXSliderAccessibility.m b/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXSliderAccessibility.m index 96a68f0340c..0e24082657d 100644 --- a/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXSliderAccessibility.m +++ b/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXSliderAccessibility.m @@ -57,4 +57,14 @@ - (BOOL)accessibilityPerformDecrement return [self performAccessibleAction:DECREMENT]; } +- (NSRect)accessibilityFrame +{ + return [super accessibilityFrame]; +} + +- (id)accessibilityParent +{ + return [super accessibilityParent]; +} + @end diff --git a/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXStepperAccessibility.m b/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXStepperAccessibility.m index c78875d8ec8..ef9f9a63719 100644 --- a/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXStepperAccessibility.m +++ b/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXStepperAccessibility.m @@ -57,4 +57,14 @@ - (BOOL)accessibilityPerformDecrement return [self performAccessibleAction:DECREMENT]; } +- (NSRect)accessibilityFrame +{ + return [super accessibilityFrame]; +} + +- (id)accessibilityParent +{ + return [super accessibilityParent]; +} + @end From d890b2cb35e89c0fa9144fa649b0e72ac7a5ce71 Mon Sep 17 00:00:00 2001 From: Alexander Zuev Date: Wed, 15 Nov 2023 12:50:05 -0800 Subject: [PATCH 4/7] - Added accessibilityTitle method - Removed some debug output generation --- .../src/main/native-glass/mac/a11y/AccessibleBase.m | 12 ++++++++++++ .../native-glass/mac/a11y/JFXSliderAccessibility.m | 7 +++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.m b/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.m index 56e7482bf07..8636647af56 100644 --- a/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.m +++ b/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.m @@ -128,6 +128,18 @@ - (id)accessibilityParent return parent; } +- (id)accessibilityTitle +{ + jobject jresult = NULL; + GET_MAIN_JENV; + if (env == NULL) return NULL; + jresult = (jobject)(*env)->CallLongMethod(env, self->jAccessible, + jAccessibilityAttributeValue, (jlong)@"AXTitle"); + GLASS_CHECK_EXCEPTION(env); + return variantToID(env, jresult); +} + + // Actions support - (BOOL)performAccessibleAction:(NSString *)action { diff --git a/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXSliderAccessibility.m b/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXSliderAccessibility.m index 0e24082657d..68af642bd5f 100644 --- a/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXSliderAccessibility.m +++ b/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXSliderAccessibility.m @@ -45,15 +45,18 @@ - (id)accessibilityValue return [super accessibilityValue]; } +- (id)accessibilityTitle +{ + return [super accessibilityTitle]; +} + - (BOOL)accessibilityPerformIncrement { -// NSLog(@"Slider increment action invoked"); return [self performAccessibleAction:INCREMENT]; } - (BOOL)accessibilityPerformDecrement { -// NSLog(@"Slider decrement action invoked"); return [self performAccessibleAction:DECREMENT]; } From 140efce55da9fb18f6797a5e9c2b7d55656a337d Mon Sep 17 00:00:00 2001 From: Alexander Zuev Date: Wed, 15 Nov 2023 13:57:00 -0800 Subject: [PATCH 5/7] Adding accessibilityMinValue and accessibilityMaxValue --- .../native-glass/mac/a11y/AccessibleBase.m | 22 +++++++++++++++++++ .../mac/a11y/JFXStepperAccessibility.m | 12 ++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.m b/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.m index 8636647af56..9f400a35df3 100644 --- a/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.m +++ b/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.m @@ -104,6 +104,28 @@ - (id)accessibilityValue return variantToID(env, jresult); } +- (id)accessibilityMinValue +{ + jobject jresult = NULL; + GET_MAIN_JENV; + if (env == NULL) return NULL; + jresult = (jobject)(*env)->CallLongMethod(env, self->jAccessible, + jAccessibilityAttributeValue, (jlong)@"AXMinValue"); + GLASS_CHECK_EXCEPTION(env); + return variantToID(env, jresult); +} + +- (id)accessibilityMaxValue +{ + jobject jresult = NULL; + GET_MAIN_JENV; + if (env == NULL) return NULL; + jresult = (jobject)(*env)->CallLongMethod(env, self->jAccessible, + jAccessibilityAttributeValue, (jlong)@"AXMaxValue"); + GLASS_CHECK_EXCEPTION(env); + return variantToID(env, jresult); +} + - (NSString *)accessibilityLabel { jobject jresult = NULL; diff --git a/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXStepperAccessibility.m b/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXStepperAccessibility.m index ef9f9a63719..fc1a79f5487 100644 --- a/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXStepperAccessibility.m +++ b/modules/javafx.graphics/src/main/native-glass/mac/a11y/JFXStepperAccessibility.m @@ -45,15 +45,23 @@ - (id)accessibilityValue return [super accessibilityValue]; } +- (id)accessibilityMinValue +{ + return [super accessibilityMinValue]; +} + +- (id)accessibilityMaxValue +{ + return [super accessibilityMaxValue]; +} + - (BOOL)accessibilityPerformIncrement { -// NSLog(@"Stepper increment action invoked"); return [self performAccessibleAction:INCREMENT]; } - (BOOL)accessibilityPerformDecrement { -// NSLog(@"Stepper decrement action invoked"); return [self performAccessibleAction:DECREMENT]; } From 09f680990fab991b59e626338272fc50c73c09f6 Mon Sep 17 00:00:00 2001 From: Alexander Zuev Date: Wed, 26 Feb 2025 03:24:18 -0800 Subject: [PATCH 6/7] Add accessibilityTitleUIElement function to the base class. --- .../src/main/native-glass/mac/a11y/AccessibleBase.m | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.m b/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.m index cc95cb026ba..d49b2450191 100644 --- a/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.m +++ b/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.m @@ -164,6 +164,18 @@ - (id)accessibilityTitle return variantToID(env, jresult); } +- (id)accessibilityTitleUIElement +{ + jobject jresult = NULL; + GET_MAIN_JENV; + if (env == NULL) return NULL; + jresult = (jobject)(*env)->CallLongMethod(env, self->jAccessible, jAccessibilityAttributeValue, + (jlong)@"AXTitleUIElement"); + GLASS_CHECK_EXCEPTION(env); + return variantToID(env, jresult); +} + + // Actions support - (BOOL)performAccessibleAction:(NSString *)action From 1ae393acced9cd1625cff4234292762ac7911024 Mon Sep 17 00:00:00 2001 From: Alexander Zuev Date: Wed, 5 Mar 2025 09:07:03 -0800 Subject: [PATCH 7/7] Remove duplicate code make accessibilityLabel explicitly call accessibilityTitle and add coment explaining why. --- .../src/main/native-glass/mac/a11y/AccessibleBase.m | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.m b/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.m index d49b2450191..36b709f9f3f 100644 --- a/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.m +++ b/modules/javafx.graphics/src/main/native-glass/mac/a11y/AccessibleBase.m @@ -131,12 +131,9 @@ - (id)accessibilityMaxValue - (NSString *)accessibilityLabel { - jobject jresult = NULL; - GET_MAIN_JENV; - if (env == NULL) return NULL; - jresult = (jobject)(*env)->CallLongMethod(env, self->jAccessible, jAccessibilityAttributeValue, (jlong)@"AXTitle"); - GLASS_CHECK_EXCEPTION(env); - return variantToID(env, jresult); + // Use the same value that is set for accessibilityTitle - some component + // do not have titles and request it as a label + return [self accessibilityTitle]; } - (id)accessibilityParent