On Wed, 22 May 2024 06:40:02 GMT, Alexander Zuev <[email protected]> wrote:
>> src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/OutlineAccessibility.m
>> line 98:
>>
>>> 96: - (BOOL)isCacheValid
>>> 97: {
>>> 98: if (rowCacheValid && [[self parent]
>>> respondsToSelector:NSSelectorFromString(@"isCacheValid")]) {
>>
>> When `isCacheValid` is invoked for the first time then `rowCacheValid` is
>> _FALSE_ and we return _FALSE_ value from this method and then the
>> `accessibilityChildren` method from super class is invoked to get all
>> children and store them in an array(`rowCache`). Subsequently
>> `rowCacheValid` will be set to _TRUE_.
>>
>> As per my understanding `[[self parent]
>> respondsToSelector:NSSelectorFromString(@"isCacheValid")]` condition will be
>> checked only if `rowCacheValid` is true and once we have a valid array of
>> children then what is the point of checking `isCacheValid` method in parent ?
>
> In multilevel trees when someone in the parent's path is collapsed the
> treeCollapsed event will be delivered to that node. We can either invalidate
> all leaf nodes caches (which is costly) or mark that exact node's cache as
> invalid and when the expand will happen when a11y cursor will try to position
> inside one of the childrens it will check that parent was invalidated and
> will regenerate its own cache.
Ok.
Is it possible to add a test to verify this behavior?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19255#discussion_r1609770630