New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore <option> element while building accessibility tree when <select> is hidden #4630
Ignore <option> element while building accessibility tree when <select> is hidden #4630
Conversation
EWS run on previous version of this PR (hash e044941) |
Please, mention the commit message what this is fixing. I think it's an assert in a particular test, right? Does it happen in any platform? because the change is in cross-platform code. |
e044941
to
5404306
Compare
EWS run on previous version of this PR (hash 5404306) |
I've updated the commit message. How do I update the PR description? |
5404306
to
88e86ac
Compare
EWS run on previous version of this PR (hash 88e86ac) |
I found out that there is a platform-specific hook for this purpose in AccessibilityObject. Made this PR AT-SPI specific and reused the solution from mac. |
88e86ac
to
0ae0c1e
Compare
EWS run on previous version of this PR (hash 0ae0c1e) |
0ae0c1e
to
624bac7
Compare
EWS run on current version of this PR (hash 624bac7) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me.
β¦t> is hidden https://bugs.webkit.org/show_bug.cgi?id=245578 Reviewed by Carlos Garcia Campos. When we insert `AccessibilityObject`'s child, we check that its `parentObject` is the `AccessiblityObject` we're inserting it into. In normal circumstances `AccessibilityObject`'s subclass representing `HTMLSelectElement` is `AccessibilityMenuList`. It creates `AccessiblityMenuListPopup` as its only accessibility child. All `HTMLSelectElement`'s node children accessibility objects are inserted into the popup. For non-multiple `HTMLSelectElement` the only possible node child class that participates in accessibility tree is `HTMLOptionElement` with its accessibility counterpart `AccessibilityMenuListOption`. `AccessibilityMenuListOption`'s `parentObject` is set explicitly to `AccessiblityMenuListPopup` when it's being inserted into one. Situation changes when `HTMLSelectElement` is hidden but `aria-hidden` attribute set to `false` (like in `accessibility/aria-visible-element-roles.html` layout test). In this case, we don't have a renderer object associated with `HTMLSelectElement` and simply create a regular `AccessiblityNodeObject` for it. Then we insert `AccessibilityMenuListOption` as `AccessiblityNodeObject`'s child without setting its `parentObject`. Thus, `child->parentObject() == this` assertion fails. Since we can't present a menu without `HTMLSelectElement`'s renderer anyway (and this is what Chromium does), it's safe to skip `HTMLSelectElement` while building the accessibility tree in such cases. * Source/WebCore/accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::getOrCreate): Canonical link: https://commits.webkit.org/254970@main
624bac7
to
a9c99d1
Compare
Committed 254970@main (a9c99d1): https://commits.webkit.org/254970@main Reviewed commits have been landed. Closing PR #4630 and removing active labels. |
a9c99d1
624bac7