Bug 74189 - WebKit should ignore images with @alt matching only whitespace
Summary: WebKit should ignore images with @alt matching only whitespace
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: chris fleizach
Keywords: InRadar
Depends on:
Reported: 2011-12-09 10:57 PST by chris fleizach
Modified: 2011-12-09 13:26 PST (History)
1 user (show)

See Also:

patch (4.05 KB, patch)
2011-12-09 11:01 PST, chris fleizach
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description chris fleizach 2011-12-09 10:57:25 PST
WebKit should ignore images with @alt matching only whitespace

These are caused by <img alt=" "> (whitespace string); I think those should be treated the same way as alt="" (empty string). Ignore them completely.
Comment 1 chris fleizach 2011-12-09 10:57:53 PST
Comment 2 chris fleizach 2011-12-09 11:01:42 PST
Created attachment 118595 [details]
Comment 3 Darin Adler 2011-12-09 11:41:14 PST
Comment on attachment 118595 [details]

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

> Source/WebCore/accessibility/AccessibilityRenderObject.cpp:1900
> +            if (!alt.string().stripWhiteSpace().isEmpty())

A better way to write this is:

    if (!alt.string().containsOnlyWhitespace())

One subtle issue is that the containsOnlyWhitespace function uses the isASCIISpace definition of whitespace, not the HTML space definition, and there are some almost certainly irrelevant subtle differences between the two.
Comment 4 chris fleizach 2011-12-09 13:26:02 PST