[Webkit-unassigned] [Bug 231528] AX: Return AXEmptyGroup subrole for groups with no accessible content

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 12 07:54:20 PDT 2021


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

--- Comment #3 from Andres Gonzalez <andresg_22 at apple.com> ---
(In reply to Tyler Wilcock from comment #2)
> Created attachment 440830 [details]
> WIP

--- a/Source/WebCore/accessibility/AccessibilityObjectInterface.h
+++ a/Source/WebCore/accessibility/AccessibilityObjectInterface.h

+    virtual bool hasAccessibleContent() const = 0;

I would call this hasContent. Everything here is already called "accessibility" or "accessible".

--- a/Source/WebCore/accessibility/AccessibilityObject.cpp
+++ a/Source/WebCore/accessibility/AccessibilityObject.cpp

+bool AccessibilityObject::hasAccessibleContent() const
+{
+    auto* first = firstChild();
+    if (first && first->accessibilityIsIgnored())
+        first = first->nextSiblingUnignored(30);

where is the 30 coming from?

If first is null, we shouldn't need to calculate last and we can return early.

+    auto* last = lastChild();
+    if (last && last->accessibilityIsIgnored())
+        last = last->previousSiblingUnignored(30);

30?

+    if (first == last && first->roleValue() == AccessibilityRole::StaticText) {
+        Vector<AccessibilityText> text;
+        accessibilityText(text);
+        // Consider this object empty if its only child has the same static text as its accessibility text.
+        if (text.size())
+            return text[0].text != first->stringValue();
+    }

We don't need to calculate first and last to determine that the object has just 1 child.

I would think that if we have a group with just one static text child, we should expose the static text object and not the group. So this doesn't make much sense to me.

-- 
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/20211012/39e7c8d1/attachment-0001.htm>


More information about the webkit-unassigned mailing list