[Webkit-unassigned] [Bug 5566] ALT attribute value not displayed when image is missing

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 23 16:05:56 PDT 2011


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


Joe Wild <joseph.wild at nokia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |joseph.wild at nokia.com




--- Comment #45 from Joe Wild <joseph.wild at nokia.com>  2011-05-23 16:05:54 PST ---
I'll take a look at this one.

I noticed a couple of things so far.

The code makes an attempt under some situations (src="") to size to show the
alt text.  If I change the code to include the text margins, then it displays.

bool RenderImage::setImageSizeForAltText(CachedImage* newImage /* = 0 */)
{
...
#if 1
        // Add text size to padding.
        imageSize.expand(textSize.width(), textSize.height());
#else
        imageSize = imageSize.expandedTo(textSize);
#endif


Use of title attribute when alt is missing seems wrong.

String HTMLImageElement::altText() const
{
    // lets figure out the alt text.. magic stuff
    // http://www.w3.org/TR/1998/REC-html40-19980424/appendix/notes.html#altgen
    // also heavily discussed by Hixie on bugzilla
    String alt = getAttribute(altAttr);
    // fall back to title attribute
    if (alt.isNull())
        alt = getAttribute(titleAttr);
    return alt;
}

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list