[Webkit-unassigned] [Bug 242401] AX: Expose suggestion, insertion, deletion roles and attributes

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 12 06:06:47 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=242401

--- Comment #12 from Andres Gonzalez <andresg_22 at apple.com> ---
(In reply to Joshua Hoffman from comment #11)
> Created attachment 460802 [details]
> Patch

--- a/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
+++ a/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm

+- (BOOL)accessibilityIsFirstItemInSuggestion
+{
+    if (![self _prepareAccessibilityCall])
+        return NO;
+
+    auto *suggestion = Accessibility::findAncestor(*self.axBackingObject, false, [] (const auto& object) {

* in the wrong side, should be auto* suggestion since it is a C++ object.

+    auto children = suggestion->children();

suggestion may be nullptr, so you need to check.

+    return children.size() > 0 && (children[0]->isAncestorOfObject(self.axBackingObject) || children[0] == self.axBackingObject);

Don't need > 0, just return children.size() && ...

I would swap the operands of || since children[0] == self.axBackingObject is cheaper and more likely.

Same comments for 

+- (BOOL)accessibilityIsLastItemInSuggestion

--- a/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
+++ a/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
@@ -4025,6 +4036,11 @@ ALLOW_DEPRECATED_IMPLEMENTATIONS_END
         }
     }

+    if (backingObject->isTextControl() || backingObject->isStaticText()) {
+        if ([attribute isEqualToString:(NSString *)kAXAttributedStringForRangeParameterizedAttribute])

Do we need to cast kAXAttributedStringForRangeParameterizedAttribute?

+            return [self doAXAttributedStringForRange:range];

Why we don't need to check for rangeSet as before?

--- a/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
+++ a/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
@@ -1038,3 +1038,4 @@ void AccessibilityUIElement::rowHeaders(Vector<AccessibilityUIElement>&) const
 {
     // FIXME: implement
 }
+

Seems that the only change in this file is the addition of a blank line, could you undo that?

--- a/Tools/WebKitTestRunner/InjectedBundle/atspi/AccessibilityUIElementAtspi.cpp
+++ a/Tools/WebKitTestRunner/InjectedBundle/atspi/AccessibilityUIElementAtspi.cpp

+}
+
+
+bool AccessibilityUIElement::isFirstItemInSuggestion() const

Extra blank line before this function and the next one.

--- a/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm
+++ a/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm

Why we return NO in all the new methods on the Mac? If we don't need this on the Mac perhaps we should say notImplemented()?

-- 
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/20220712/bdf082de/attachment.htm>


More information about the webkit-unassigned mailing list