haikuwebkit/LayoutTests/accessibility/img-with-svg-source-expecte...

29 lines
989 B
Plaintext
Raw Permalink Normal View History

AX: @alt and bounds ignored when using img[src] points to an inaccessible SVG https://bugs.webkit.org/show_bug.cgi?id=160705 <rdar://problem/27771579> Reviewed by Chris Fleizach and Darin Adler. Source/WebCore: Tests: accessibility/img-with-svg-source.html accessibility/ios-simulator/img-with-svg-source.html The problem was caused by AccessibilityRenderObject::determineAccessibilityRole that was returning AccessibilityRole::SVGRoot for all images with a remote SVG source, regardless whether the SVG hierarchy contained some accessibility data or not. This resulted in VoiceOver reading the image like an empty group on Mac, or completely ignoring the image on iOS. The solution in this patch is to only return AccessibilityRole::SVGRoot if the SVG has some accessibility conveyable data. Added the method AccessibilitySVGRoot::hasAccessibleContent for this purpose. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::determineAccessibilityRole): (WebCore::AccessibilityRenderObject::remoteSVGRootElement const): Comment was missplaced, moved it to the right place. (WebCore::AccessibilityRenderObject::addRemoteSVGChildren): * accessibility/AccessibilitySVGRoot.cpp: (WebCore::AccessibilitySVGRoot::hasAccessibleContent const): * accessibility/AccessibilitySVGRoot.h: LayoutTests: * accessibility/img-with-svg-source-expected.txt: Added. * accessibility/img-with-svg-source.html: Added. * accessibility/ios-simulator/img-with-svg-source-expected.txt: Added. * accessibility/ios-simulator/img-with-svg-source.html: Added. * accessibility/svg-shape-labelled-expected.txt: * accessibility/svg-shape-labelled.html: Removed the <img> test cases since they are covered correctly in the new test img-with-svg-source.html. Canonical link: https://commits.webkit.org/233302@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271796 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-25 16:52:52 +00:00
This tests that images with SVG source are indeed exposed as images and not as SVG groups, if the SVG source is not accessible.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS successfullyParsed is true
TEST COMPLETE
PASS image.role is 'AXRole: AXImage'
AXDescription:
PASS image.role is 'AXRole: AXImage'
AXDescription: 2. svg image with alt text
PASS image.role is 'AXRole: AXImage'
AXDescription: 3. svg image with role img
PASS image.role is 'AXRole: AXImage'
AXDescription: 4. svg image in an anchor
PASS image.role is 'AXRole: AXImage'
AXDescription: 5. svg image with role img in an anchor
PASS image.role is 'AXRole: AXImage'
AXDescription: 6. svg image with aria label
PASS image.role is 'AXRole: AXImage'
AXDescription: 7. svg image with role img and aria label
PASS image.role is 'AXRole: AXImage'
AXDescription: 8. svg image with size set
PASS image.role is 'AXRole: AXImage'
AXDescription: 9. svg image with role img and size set