haikuwebkit/LayoutTests/accessibility/img-alt-attribute-unassigne...

17 lines
422 B
Plaintext
Raw Permalink Normal View History

Empty alt attribute does not ignore the image for accessibility clients in Safari. https://bugs.webkit.org/show_bug.cgi?id=212432 Source/WebCore: Reviewed by Chris Fleizach. Test: accessibility/img-alt-attribute-unassigned-empty.html - AccessibilityRenderObject::computeAccessibilityIsIgnored was handling the case of images too late, after checking for ariaRoleAttribute(). So if an image had a role attribute, it was exposed regardless whether its alt attribute was an empty string. This change moves the handling of images above the check for ariaroleAttribute and hence honors the empty alt attribute rule. - Also images that have an aria-label attribute are now exposed. - Added logging of AccessibilityObjectInclusion. - Changed signature of log(RefPtr<AXCoreObject>) as pointed out by Darin Adler in a separate review. * accessibility/AXLogger.cpp: (WebCore::AXLogger::log): (WebCore::operator<<): * accessibility/AXLogger.h: * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::determineAccessibilityRole): (WebCore::AccessibilityNodeObject::isImage const): Moved to base class. * accessibility/AccessibilityNodeObject.h: * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: (WebCore::AXCoreObject::isImage const): * accessibility/AccessibilityRenderObject.cpp: (WebCore::objectInclusionFromAltText): (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const): (WebCore::AccessibilityRenderObject::determineAccessibilityRole): (WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation): * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): * accessibility/isolatedtree/AXIsolatedObject.h: LayoutTests: <rdar://problem/60597768> Reviewed by Chris Fleizach. * accessibility/img-alt-attribute-unassigned-empty-expected.txt: Renamed from LayoutTests/accessibility/img-alt-attribute-unassigned-value-expected.txt. * accessibility/img-alt-attribute-unassigned-empty.html: Renamed from LayoutTests/accessibility/img-alt-attribute-unassigned-value.html. Added the test case for alt="" in addition to unassigned alt. * accessibility/self-referencing-aria-labelledby.html: Removed unnecessary alt="" since now that causes the image element not to be exposed. Canonical link: https://commits.webkit.org/225283@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262224 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-27 23:41:22 +00:00
This tests that img elements with an alt attribute and no assigned value, or an empty alt value, are ignored.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS imagesGroup.childrenCount is 2
PASS platformValueForW3CName(imagesGroup.childAtIndex(0)) is "cake0"
PASS platformValueForW3CName(imagesGroup.childAtIndex(1)) is "cake2"
PASS successfullyParsed is true
TEST COMPLETE