From 452689aea043f4e8f037890e144c36295b35e5a4 Mon Sep 17 00:00:00 2001 From: Artem Semenov <36081106+savoptik@users.noreply.github.com> Date: Tue, 14 Feb 2023 00:08:17 +0400 Subject: [PATCH] JBR-5289 If the label has the role of a hyperlink, VO still pronounces it as plain text (#215) (cherry picked from commit 675ca2f02eef63ee9e36a0daf04ede2db1826dbf) --- .../native/libawt_lwawt/awt/JavaAccessibilityUtilities.m | 2 +- .../native/libawt_lwawt/awt/a11y/StaticTextAccessibility.m | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaAccessibilityUtilities.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaAccessibilityUtilities.m index 9745798fd93f..8094f7faa633 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaAccessibilityUtilities.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/JavaAccessibilityUtilities.m @@ -481,7 +481,7 @@ void initializeRoles() [sRoles setObject:JavaAccessibilityIgnore forKey:@"frame"]; [sRoles setObject:JavaAccessibilityIgnore forKey:@"glasspane"]; [sRoles setObject:NSAccessibilityGroupRole forKey:@"groupbox"]; - [sRoles setObject:NSAccessibilityStaticTextRole forKey:@"hyperlink"]; //maybe a group? + [sRoles setObject:NSAccessibilityLinkRole forKey:@"hyperlink"]; [sRoles setObject:NSAccessibilityImageRole forKey:@"icon"]; [sRoles setObject:NSAccessibilityGroupRole forKey:@"internalframe"]; [sRoles setObject:NSAccessibilityStaticTextRole forKey:@"label"]; diff --git a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/StaticTextAccessibility.m b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/StaticTextAccessibility.m index b54a32be5eba..007744f5ecdd 100644 --- a/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/StaticTextAccessibility.m +++ b/src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/StaticTextAccessibility.m @@ -29,6 +29,9 @@ @implementation StaticTextAccessibility - (NSAccessibilityRole _Nonnull)accessibilityRole { + if ([fJavaRole isEqualToString:@"hyperlink"]) { + return NSAccessibilityLinkRole; + } return NSAccessibilityStaticTextRole; }