haikuwebkit/LayoutTests/accessibility/aria-modal-in-aria-hidden-e...

15 lines
512 B
Plaintext
Raw Permalink Normal View History

AX: aria-modal nodes wrapped in aria-hidden are not honored https://bugs.webkit.org/show_bug.cgi?id=212849 <rdar://problem/64047019> Reviewed by Zalan Bujtas. Source/WebCore: Test: accessibility/aria-modal-in-aria-hidden.html If aria-modal was wrapped inside aria-hidden, we were still processing that as the modal node. Fixing that uncovered a host of very finicky issues related to aria-modal. 1. We were processing modal status immediately instead of after a delay, so visibility requirements were not correct. 2. In handleModalChange: We were processing multiple modal nodes perhaps incorrectly (the spec doesn't account for multiple modal nodes). - had to update a test to turn off modal status before adding a new modal node 3. Changed the modal node to a WeakPtr 4. In isNodeAriaVisible: We stopped processing for visibile with aria-hidden as soon as we hit a renderable block, but that means it won't account for nodes higher in the tree with aria-hidden. 5. In handleAttributeChange: if aria-hidden changes, we should update modal status if needed. 6. In focusModalNodeTimerFired: we need to verify the element is still live, otherwise it can lead to a crash. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::AXObjectCache): (WebCore::AXObjectCache::findModalNodes): (WebCore::AXObjectCache::currentModalNode): (WebCore::AXObjectCache::modalNode): (WebCore::AXObjectCache::remove): (WebCore::AXObjectCache::deferModalChange): (WebCore::AXObjectCache::focusModalNodeTimerFired): (WebCore::AXObjectCache::handleAttributeChange): (WebCore::AXObjectCache::handleModalChange): (WebCore::AXObjectCache::prepareForDocumentDestruction): (WebCore::AXObjectCache::performDeferredCacheUpdate): (WebCore::isNodeAriaVisible): * accessibility/AXObjectCache.h: (WebCore::AXObjectCache::handleModalChange): (WebCore::AXObjectCache::deferModalChange): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::firstChild const): (WebCore::AccessibilityRenderObject::lastChild const): LayoutTests: * accessibility/aria-hidden-negates-no-visibility-expected.txt: * accessibility/aria-hidden-negates-no-visibility.html: * accessibility/aria-modal-in-aria-hidden-expected.txt: Added. * accessibility/aria-modal-in-aria-hidden.html: Added. * accessibility/aria-modal.html: * accessibility/mac/aria-modal-auto-focus.html: Canonical link: https://commits.webkit.org/226538@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263673 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-29 18:54:16 +00:00
This tests that when something is aria-modal inside an aria-hidden it is ignored.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS accessibilityController.accessibleElementById('bgContent').isIgnored is false
PASS !backgroundContent || backgroundContent.isIgnored is true
AX: aria-modal nodes wrapped in aria-hidden are not honored https://bugs.webkit.org/show_bug.cgi?id=212849 <rdar://problem/64047019> Reviewed by Zalan Bujtas. Source/WebCore: Test: accessibility/aria-modal-in-aria-hidden.html If aria-modal was wrapped inside aria-hidden, we were still processing that as the modal node. Fixing that uncovered a host of very finicky issues related to aria-modal. 1. We were processing modal status immediately instead of after a delay, so visibility requirements were not correct. 2. In handleModalChange: We were processing multiple modal nodes perhaps incorrectly (the spec doesn't account for multiple modal nodes). - had to update a test to turn off modal status before adding a new modal node 3. Changed the modal node to a WeakPtr 4. In isNodeAriaVisible: We stopped processing for visibile with aria-hidden as soon as we hit a renderable block, but that means it won't account for nodes higher in the tree with aria-hidden. 5. In handleAttributeChange: if aria-hidden changes, we should update modal status if needed. 6. In focusModalNodeTimerFired: we need to verify the element is still live, otherwise it can lead to a crash. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::AXObjectCache): (WebCore::AXObjectCache::findModalNodes): (WebCore::AXObjectCache::currentModalNode): (WebCore::AXObjectCache::modalNode): (WebCore::AXObjectCache::remove): (WebCore::AXObjectCache::deferModalChange): (WebCore::AXObjectCache::focusModalNodeTimerFired): (WebCore::AXObjectCache::handleAttributeChange): (WebCore::AXObjectCache::handleModalChange): (WebCore::AXObjectCache::prepareForDocumentDestruction): (WebCore::AXObjectCache::performDeferredCacheUpdate): (WebCore::isNodeAriaVisible): * accessibility/AXObjectCache.h: (WebCore::AXObjectCache::handleModalChange): (WebCore::AXObjectCache::deferModalChange): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::firstChild const): (WebCore::AccessibilityRenderObject::lastChild const): LayoutTests: * accessibility/aria-hidden-negates-no-visibility-expected.txt: * accessibility/aria-hidden-negates-no-visibility.html: * accessibility/aria-modal-in-aria-hidden-expected.txt: Added. * accessibility/aria-modal-in-aria-hidden.html: Added. * accessibility/aria-modal.html: * accessibility/mac/aria-modal-auto-focus.html: Canonical link: https://commits.webkit.org/226538@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263673 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-29 18:54:16 +00:00
PASS accessibilityController.accessibleElementById('bgContent').isIgnored is false
PASS successfullyParsed is true
TEST COMPLETE
Other page content with a dummy focusable element
Just an example.