[webkit-changes] [WebKit/WebKit] 3d8642: AX: iframe within inert, hidden element is exposed...
Joshua Hoffman
noreply at github.com
Tue Sep 10 09:08:08 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3d864212d2b1150cee5712c950dceac2b52b6b83
https://github.com/WebKit/WebKit/commit/3d864212d2b1150cee5712c950dceac2b52b6b83
Author: Joshua Hoffman <jhoffman23 at apple.com>
Date: 2024-09-10 (Tue, 10 Sep 2024)
Changed paths:
A LayoutTests/accessibility/iframe-content-inert-expected.txt
A LayoutTests/accessibility/iframe-content-inert.html
A LayoutTests/accessibility/iframe-content-visibility-expected.txt
A LayoutTests/accessibility/iframe-content-visibility.html
A LayoutTests/accessibility/resources/iframe-button.html
M Source/WebCore/accessibility/AXObjectCache.cpp
M Source/WebCore/accessibility/AccessibilityObject.cpp
M Source/WebCore/accessibility/AccessibilityObject.h
M Source/WebCore/accessibility/AccessibilityRenderObject.h
M Source/WebCore/accessibility/AccessibilityScrollView.cpp
M Source/WebCore/accessibility/AccessibilityScrollView.h
M Source/WebCore/rendering/RenderElement.cpp
Log Message:
-----------
AX: iframe within inert, hidden element is exposed to ATs
https://bugs.webkit.org/show_bug.cgi?id=278370
rdar://134318347
Reviewed by Tyler Wilcock.
This patch fixes an issue where iFrames with a style of `visibility: hidden` or the inert attribute,
both of which should hide the element and its children to ATs, fails to hide the iFrame's children.
To fix this, isIgnored() needs to iterate up the web areas and their iFrame renderers, to check whether
they are non-visible or if they are effectively inert. These properties/styles don't get passed from
the iFrame's parent document to the iFrame's document, so this iteration is necessary.
For the isolated tree to update properly, the children of the iframe need to dirty its subtree. However,
when AXObjectCache::handleChildrenChanged tries to handle a ScrollView (which happens when attributes on
the iFrame element are changed), we bail before dirtying the subtree because scroll views don't have
nodes nor renderers. To resolve this, this patch adds logic in handleChildrenChanged to propogate
setNeedsToUpdateSubtree and setNeedsToUpdateChildren down to the iFrame's WebArea.
* LayoutTests/accessibility/iframe-content-inert-expected.txt: Added.
* LayoutTests/accessibility/iframe-content-inert.html: Added.
* LayoutTests/accessibility/iframe-content-visibility-expected.txt: Added.
* LayoutTests/accessibility/iframe-content-visibility.html: Added.
* LayoutTests/accessibility/resources/iframe-button.html: Added.
New tests to test `visibility: hidden`, `inert` style/attribute on iFrames.
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::handleChildrenChanged):
* Source/WebCore/accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::defaultObjectInclusion const):
(WebCore::AccessibilityObject::webArea const):
* Source/WebCore/accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::shouldWebAreaExposeChildren const):
* Source/WebCore/accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::shouldWebAreaExposeChildren const):
* Source/WebCore/accessibility/AccessibilityRenderObject.h:
* Source/WebCore/accessibility/AccessibilityScrollView.cpp:
(WebCore::AccessibilityScrollView::updateScrollbars):
(WebCore::AccessibilityScrollView::removeChildScrollbar):
* Source/WebCore/accessibility/AccessibilityScrollView.h:
* Source/WebCore/rendering/RenderWidget.cpp:
(WebCore::RenderWidget::styleDidChange):
Canonical link: https://commits.webkit.org/283416@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list