[Webkit-unassigned] [Bug 231914] AX: Any addition of children should funnel through AccessibilityObject::addChild

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 19 07:56:18 PDT 2021


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

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

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

-        ASSERT(child->parentObject() == this);
+#ifndef NDEBUG
+        // Autofill buttons are dynamically created elements by WebKit, and aren't assigned as a child
+        // to their proper DOM parent (see TextFieldInputType::createAutoFillButton), so exclude them from this ASSERT.
+        // Table component child-parent relationships also often doesn't line up properly, hence the need for methods
+        // like parentTable() and parentRow(). Exclude them from this ASSERT too.
+        if (!isAutofillButton(*this) && !isTableComponent(*child) && !isTableComponent(*this))
+            ASSERT(child->parentObject() == this);
+#endif

I'm not convinced we should special case this sanity check. The child-parent relationship of the corresponding DOM elements may not match the AX hierarchy, but the AX hierarchy should be consistent with itself in all cases. I.e., if we expose child as a child of parent, then child->parentObject() should be parent.

-- 
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/20211019/c6598d50/attachment.htm>


More information about the webkit-unassigned mailing list