On Mon, 10 Apr 2023 18:54:44 GMT, Alexander Zuev <[email protected]> wrote:
>> modules/javafx.graphics/src/main/java/com/sun/glass/ui/mac/MacAccessible.java
>> line 807:
>>
>>> 805: if (this.peer == 0L) {
>>> 806: AccessibleRole role = (AccessibleRole) getAttribute(ROLE);
>>> 807: if (role == null) role = AccessibleRole.NODE;
>>
>> When would `role` be null? And if it is, is defaulting to `NODE` going to do
>> the right thing once you implement the new a11y protocol for Node?
>
> It can be when customer creates a custom component that does not provide
> accessible attributes. With the new API that will be covered by the default
> implementation that will report some generic role.
OK. It looks like a `null` here can only happen for an accessible object that
_isn't_ a `Node`, since `Node.getAccessibleRole` already ensures that a null
value is converted to `AccessibleRole.NODE`. As long as the default
implementation (of `AccessibleRole.NODE`) does the right thing for an object
that doesn't report a specific role and isn't a `Node`, what you have seems
fine.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1084#discussion_r1162062701