AX: <svg> elements with labels and no accessible contents are exposed as empty AXGroups
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Apr 2019 18:09:33 +0000 (18:09 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Apr 2019 18:09:33 +0000 (18:09 +0000)
commit8969a02e9934c81c09c522c32240fbe9bcf8101a
tree0b044ee8a8da273e2ab5064aa7ca39110502b3e8
parent78c2758f7bcbea6ccf288bbabb999d2a162a6a5c
AX: <svg> elements with labels and no accessible contents are exposed as empty AXGroups
https://bugs.webkit.org/show_bug.cgi?id=156774

Patch by Eric Liang <ericliang@apple.com> on 2019-04-08
Reviewed by Chris Fleizach.

Source/WebCore:

Labelled SVGs without accessible descendants are exposed as AXImage rather than groups.

Unlabelled equivalents are not exposed. Otherwise, SVGs with accessible descendants are exposed as AXGroup.
Also added back functionalities from last patch of determining whether a SVG element should be ignored.

Test: accessibility/svg-shape-labelled.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation):
* accessibility/AccessibilitySVGElement.cpp:
(WebCore::AccessibilitySVGElement::computeAccessibilityIsIgnored const):

LayoutTests:

Added tests that verify svgs shapes that are labelled are exposed as images.
* accessibility/resources/apple-logo.svg: Added.
* accessibility/svg-shape-labelled-expected.txt: Added.
* accessibility/svg-shape-labelled.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244029 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/accessibility/resources/apple-logo.svg [new file with mode: 0644]
LayoutTests/accessibility/svg-shape-labelled-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/svg-shape-labelled.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/AccessibilitySVGElement.cpp