RESOLVED FIXED 238184
AccessibilityRenderObject::nextSibling should allow parent differences in the presence of display: contents
https://bugs.webkit.org/show_bug.cgi?id=238184
Summary AccessibilityRenderObject::nextSibling should allow parent differences in the...
Tyler Wilcock
Reported 2022-03-21 21:15:56 PDT
AccessibilityRenderObject::nextSibling currently has this logic to return nullptr if the computed sibling has a parent different from `this`: // Make sure next sibling has the same parent. auto* nextObject = objectCache->getOrCreate(nextSibling); if (nextObject && nextObject->parentObject() != this->parentObject()) return nullptr; This is problematic in the presence of display: contents since we expect parent object differences due to the way this property affects the render tree. Concretely, this breaks the firstChild(), nextSibling() iteration we do throughout WebKit, as when we get to an element with display: contents we get a parent mismatch and iteration stops unnecessarily.
Attachments
Patch (14.13 KB, patch)
2022-03-21 21:23 PDT, Tyler Wilcock
no flags
Radar WebKit Bug Importer
Comment 1 2022-03-21 21:16:05 PDT
Tyler Wilcock
Comment 2 2022-03-21 21:23:30 PDT
Andres Gonzalez
Comment 3 2022-03-22 05:37:42 PDT
(In reply to Tyler Wilcock from comment #2) > Created attachment 455328 [details] > Patch We need to maintain a consistent parent-child hierarchy in the AX tree. That includes that an object and its siblings have the same parent. display: contents should affect the way AX Objects are added to the AX tree, but not mess up the parent-child relationship. Instead, we may need to add a new kind of AX object for display: contents that encapsulates the appropriate parent-child relationships for these objects.
EWS
Comment 4 2022-03-23 10:01:48 PDT
Committed r291747 (248779@main): <https://commits.webkit.org/248779@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 455328 [details].
Note You need to log in before you can comment on or make changes to this bug.