<AWT Dev> RFR: 8256108: Create implementation for NSAccessibilityElement protocol peer [v2]

Sergey Bylokhov serb at openjdk.java.net
Thu Nov 19 00:26:09 UTC 2020


On Wed, 18 Nov 2020 19:03:17 GMT, Alexander Zuev <kizune at openjdk.org> wrote:

>> 8256108: Create implementation for NSAccessibilityElement protocol peer
>
> Alexander Zuev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fixed the year in file header.
>   
>   Added comments on a reason for the common component layer existance.

src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.m line 140:

> 138: // Please see https://developer.apple.com/documentation/appkit/nsaccessibilityprotocol
> 139: // for more details.
> 140: @interface CommonComponentAccessibility : JavaComponentAccessibility <NSAccessibilityElement> {

I remember we had a plan to implement this step by step, replacing the parts of the old API with some new parts.

If the plan still in place then why we do not implement `NSAccessibilityElement` in the `JavaComponentAccessibility ` class, so the usage of current (old) methods like `accessibilityPositionAttribute/accessibilitySizeAttribute/accessibilityFocusedAttribute` could be replaced by the new methods from the NSAccessibilityElement protocol like accessibilityParent/accessibilityFrame/isAccessibilityFocused.

If we plan to implement it from scratch then why the CommonComponentAccessibility extends JavaComponentAccessibility?

It is not obvious from the change since the `accessibilityFrame()` is implemented from scratch mostly duplicate `accessibilityPositionAttribute+accessibilitySizeAttribute`, but the `accessibilityParent()` uses the code from the `JavaComponentAccessibility `

-------------

PR: https://git.openjdk.java.net/jdk/pull/1290


More information about the awt-dev mailing list