[Webkit-unassigned] [Bug 169924] AX: WebKit should not expose redundant AXGroups with missing role when the label is the same as the contents

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 14 08:31:32 PDT 2021


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

--- Comment #6 from Andres Gonzalez <andresg_22 at apple.com> ---
(In reply to Tyler Wilcock from comment #5)
> Created attachment 441217 [details]
> Patch

--- a/Source/WebCore/ChangeLog
+++ a/Source/WebCore/ChangeLog

+        Instead of asserting when we try to get the text of an element in a
+        document that needs a style update, return an empty `String()` instead.

Two insteads.

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

+                if (nodeDocument->childNeedsStyleRecalc())
+                    return String();

return { };

--- a/Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm
+++ a/Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm

+static bool isIgnorableGroup(const AccessibilityObject& axObject)

isIgnorableGroup -> shouldIgnoreGroup

+    // Never ignore a <div> with event listeners attached to it (e.g. onclick).
+    if (axObject.node() && axObject.node()->hasEventListeners())
+        return false;

Isn't this check done for any object already in the isIgnored method? Wondering why we need to do this specifically for groups.

+    auto* first = axObject.firstChild();
+    if (first && first == axObject.lastChild() && first->roleValue() == AccessibilityRole::StaticText) {

Wouldn't this be more efficient?

+    auto& children = axObject.children();
+    if (children.size() == 1 && children[0]->roleValue() == AccessibilityRole::StaticText) {

or the problem is that this is used in children()?

+        Vector<AccessibilityText> text;
...
+        auto axText = text.size() ? text[0].text : String();

Aren't these names inverted?  i.e., shouldn't the String be text and the vector axText?

What if the vector has more than one element? Perhaps we should return false in that case.

-- 
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/20211014/5a5aaadf/attachment.htm>


More information about the webkit-unassigned mailing list