[Webkit-unassigned] [Bug 194754] Web Inspector: AXI: Audit: image label test is throwing spurious errors on elements with existing alt attr, but no value: <img alt>

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 10 09:53:50 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=194754

--- Comment #7 from gr3g at apple.com ---
Comment on attachment 371006
  --> https://bugs.webkit.org/attachment.cgi?id=371006
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=371006&action=review

>> Source/WebCore/accessibility/AccessibilityObject.cpp:2527
>> +            if (alt.isEmpty())
> 
> in this case the element is ignored completely and shouldn't even be in the hierarchy
> 
> here's the code that does this
> 
> bool isRenderImage = is<RenderImage>(renderer());
>         if (isRenderImage)
>             altTextInclusion = objectInclusionFromAltText(downcast<RenderImage>(*m_renderer).altText());
>         else
>             altTextInclusion = objectInclusionFromAltText(getAttribute(altAttr).string());
> 
>         if (altTextInclusion == AccessibilityObjectInclusion::IgnoreObject)
>             return true;
>         if (altTextInclusion == AccessibilityObjectInclusion::IncludeObject)
>             return false;

the accessibility audit isn't using the ignore/include logic you've referenced (from `AccessibilityRenderObject::defaultObjectInclusion`) for its roles, and instead it uses its own function to determine the role (`AccessibilityObject::computedRoleString`). 

my change fixes the computed role for these scenarios:
- `<img alt src="...">` (unassigned alt -> role is presentational)
- `<img src="...">` (missing alt -> role is image)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190610/cd311ab3/attachment.html>


More information about the webkit-unassigned mailing list