Bug 5753 - Image ALT tags do not appear
Summary: Image ALT tags do not appear
Status: RESOLVED DUPLICATE of bug 5566
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Major
Assignee: Nobody
URL:
Keywords: HasReduction, InRadar
Depends on:
Blocks:
 
Reported: 2005-11-15 13:47 PST by Mark Thomas
Modified: 2006-12-17 14:34 PST (History)
2 users (show)

See Also:


Attachments
Simple Test case (27.84 KB, application/zip)
2005-11-16 02:29 PST, Mark Thomas
no flags Details
Minimal testcase (42 bytes, text/html)
2005-12-28 02:25 PST, Joost de Valk (AlthA)
no flags Details
patch (1.47 KB, patch)
2006-02-18 18:43 PST, Karl Schramm
darin: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Thomas 2005-11-15 13:47:33 PST
Hi,
  Sometime the alt tags don't get display with images when the Don't show images on load has been 
switched off. The reason why we have noticed this is that we have alt tags for a far amount of our 
images as our webkit application must be accessability friendly.

  Alt tag are there and must be valid as the Tiger screenreader when it doesn't crash will read out the alt 
tags even though not displayed. very strange.

  I thought I'd just add because sometimes these alt tag can be quite big it would be helpful if the alt 
when displayed actually wrapped being so being multi-lined would be very cool.

  This is also entered @ apple rdar://4330277 where there is a uploaded test case, as I couldn't work 
how to upload a test case here.

Thanks
Mark.
Comment 1 Mark Thomas 2005-11-15 13:50:22 PST
This is differen't from 

http://bugzilla.opendarwin.org/show_bug.cgi?id=5566

As the actual images aren't missing but just not loaded via the preferences.
Comment 2 Mark Thomas 2005-11-16 02:29:56 PST
Created attachment 4695 [details]
Simple Test case

This is simple test case showing the issue, if you open up 1.1.3.htm it will
show the problem. (You will need to have switched off displaying images first
though)

I think the issue is because there are multi-layers being used here maybe.
Comment 3 Joost de Valk (AlthA) 2005-11-22 14:23:36 PST
Confirmed, good testcase!
Comment 4 Eric Seidel (no email) 2005-12-27 16:07:40 PST
Thanks for the bug.

Further reduction is neccessary before we dare take a crack at this.  That's quite a large page you've 
attached.
Comment 5 Joost de Valk (AlthA) 2005-12-28 02:25:37 PST
Created attachment 5332 [details]
Minimal testcase

a one-liner showing brokenness.
Comment 6 Joost de Valk (AlthA) 2005-12-28 02:28:34 PST
Reduced this to a simple one-liner, this shows that alt-tags do not appear, adjusting subject, and making 
major.
Comment 7 Eric Seidel (no email) 2005-12-28 02:35:42 PST
If I remember correctly, this is because either CachedImage or RenderImage, when the image load fails, 
default to the "missing image" image.  That's probably treated specially in the "alt text" code path by 
mistake.
Comment 8 Mark Thomas 2006-01-03 09:56:22 PST
Sorry if this sounds dumb question but there has never been a problem when the URL cannot be resolved 
and this sounds like another problem which Joost de Valk is showing , as here the problem here was 
erratic behaviour of the showing of the alt tag's ?, when you have specifically switched of "display images", 
so no default missing logo should appear

or did I miss something here ? as I'm still very new to this reporting mechanism.

Thanks
Mark.
Comment 9 Karl Schramm 2006-02-18 18:43:03 PST
Created attachment 6595 [details]
patch

Eric Seidel was right. There needs to be a check in RenderImage::paint to see if the alt text exists before drawing the "missing image".
Comment 10 Darin Adler 2006-02-18 22:01:34 PST
Comment on attachment 6595 [details]
patch

There's code here to draw the alt text "above the error image".

So never drawing the error image, while it might make the alt text appear, is not quite doing what the existing code expects. In fact, if we're going to remove this feature of drawing both an error image and alt text, then we should probably change the function and remove the errorPictureDrawn code from the alt text code path.

I don't think should be landed until we understand why the "above the error image" code path isn't kicking in.
Comment 11 Karl Schramm 2006-02-18 23:44:35 PST
The patch I submitted draws the "error image" only when there is no alt text. However, if there is alt text, then that text is displayed in lieu of the "error image".
Comment 12 mitz 2006-12-17 14:06:16 PST
Note that alt text will show if the error image leaves room for it, for example:
<img src="#" alt="This text should show" height="60">

It would be nice to have a decision on how to render missing images with alt text
(a) when their dimensions are specified
(b) when their dimensions are not specified
In the former case, when the text and the error image won't fit together, what do you do? In the latter case, how do you determine what size to use for the image?
Comment 13 mitz 2006-12-17 14:34:02 PST

*** This bug has been marked as a duplicate of 5566 ***