[Webkit-unassigned] [Bug 242401] AX: Expose suggestion, insertion, deletion roles and attributes
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Jul 13 13:38:33 PDT 2022
https://bugs.webkit.org/show_bug.cgi?id=242401
--- Comment #17 from Joshua Hoffman <jhoffman23 at apple.com> ---
(In reply to Andres Gonzalez from comment #16)
> (In reply to Joshua Hoffman from comment #15)
> > Created attachment 460835 [details]
> > Patch
>
> --- a/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
> +++ a/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
>
> +- (BOOL)accessibilityIsFirstItemInSuggestion
> +{
> ...
> + auto children = suggestion->children();
> + auto parent = self.axBackingObject->parentObject();
> + BOOL isFirstChildOfParent = parent && parent->children().size() &&
> parent->children()[0] == self.axBackingObject;
> + return children.size() && (children[0] == self.axBackingObject ||
> (isFirstChildOfParent &&
> children[0]->isAncestorOfObject(self.axBackingObject)));
>
> I think this logic fails in the following case:
>
> <suggestion>
> <grandparent>
> <uncle>
> <child1>
> <parent>
> <child2>
>
> it will return true for child2.
I'd think a traversal up, where in each iteration we check both that a child is always the first element and check for a suggestion ancestor, could fix this? (not using FindAncestor to allow us to break early) Something like:
for (AXCoreObject* obj = self.axBackingObject->parentObject(); obj; obj = obj->parentObject())
{
if (auto parent = obj->parentObject()) {
if (parent->children().size() && parent->children()[0] != self.axBackingObject)
return NO;
if (parent->roleValue() == AccessibilityRole::Suggestion)
return YES;
}
}
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220713/bc95427e/attachment-0001.htm>
More information about the webkit-unassigned
mailing list