Closed Bug 726919 Opened 13 years ago Closed 13 years ago

Treat broken images according to HTML5 spec

Categories

(Core :: Layout: Images, Video, and HTML Frames, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jidanni, Assigned: emk)

References

()

Details

Attachments

(4 files)

User Agent: Mozilla/5.0 (X11; Linux i686; rv:12.0a2) Gecko/20120210 Firefox/12.0a2 Iceweasel/12.0a2
Build ID: 20120210042013

Steps to reproduce:

The default behavior of Firefox with unavailable images is just
outrageous.

The user thinks:

"Every page looks great any you'll never encounter any image problems
when one uses Firefox.

Yup, Firefox works great. That **** Google Chrome often has image
problems. All those stupid cracked picture logos, etc.

It can't even find some of the images I put one my own web pages. Ha!"

Until one day he realizes which browser is his real friend, and which
browser just says we have money in the bank when we really don't.

Save this into file.html and browse it in both Firefox (-safe-mode of
course) and Chrome to see the difference.

 <h2>7公里內視野 7 km
 viewshed</h2>

 <p><img width="446" height="396" alt=
 "Many points are visible within 7 km." src=
 "images/gone.png"></p>

 <p><img alt="Others aren't." src="images/also_gone.png"></p>

 <p>
 這裡(x)所能見的(白),鄉鎮界(黑)Points
 visible from here (x) marked in white. Grid=230,235km W; 2670,2675</P>

Of course for the second image Chrome can't deal with the alt= whereas
Firefox indeed does... Maybe someone should tell them.

Anyway with the default FF settings there will be a whole next generation of users who come to school
wondering why the other students were aware of the problems in the homework page and got the hardcopy from the teaching assistant, whereas they remained blissfully unaware the entire weekend, etc.
OK I told them about the second image's ALT string.
http://code.google.com/p/chromium/issues/detail?id=114145
Attached file Example of danger
Please limit your comments to technical details.
i see a placeholder for the broken image with the testcase and the alt text is displayed as it should be.

Mozilla/5.0 (Windows NT 6.1; rv:13.0a1) Gecko/20120213 Firefox/13.0a1 SeaMonkey/2.10a1
oh, my testcase is incomplete as your bug description.
You want to see a broken image icon if you have an image without dimensions and without alt text. showing nothing is however intended if i read bug41924

I guess that this is a wontfix
Component: Untriaged → Layout: Images
Product: Firefox → Core
QA Contact: untriaged → layout.images
Well one browser is right and one browser is wrong, right?
No, it's a design decision which can be different if the behavior isn't specified in a standard.
You want a broken image icon (as google) and I don't want it (as Mozilla). 
A standard icon with a standard size can destroy the page layout if the original image (that is now broken) is smaller than the standard icon.
HTML5 now encourages for User-Agents to display something if the image is broken and alt attribute is absent.
http://dev.w3.org/html5/spec/Overview.html#img-good
Is the decision still appropriate?
> A standard icon with a standard size can destroy the page layout if the original image (that is now broken) is smaller than the standard icon.
The page layout will be broken anyway if nothing is displayed.
Nothing displayed even if the dimension is present. It will break the page layout.
Confirming to reconsider the bug 41924 decision in HTML5 era.
Blocks: alttext
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: With Google Chrome you will finally know about the images you were missing all these years → Display placeholders for borken images without alt per HTML5 spec encouragement
OS: Linux → All
Hardware: x86 → All
Version: 12 Branch → unspecified
Attached patch patchSplinter Review
Assignee: nobody → VYV03354
Status: NEW → ASSIGNED
Attachment #596980 - Flags: review?(roc)
The spec says

   If the src attribute is set and the alt attribute is set to a value that isn't empty ... 
   If the image is available ... 
    Otherwise, the element represents the text given by the alt attribute. User agents may
    provide the user with a notification that an image is present but has been omitted from
    the rendering.

So it says MAY... so are you fellows going to give inconsistent behavior just because there is something in alt="..."?
Summary: Display placeholders for borken images without alt per HTML5 spec encouragement → Display placeholders for broken images without alt per HTML5 spec encouragement
Comment on attachment 596980 [details] [diff] [review]
patch

Hm, this patch "regressed" bug 468263. However, the image should not be hidden for images with empty src attribute per spec.
Attachment #596980 - Flags: review?(roc)
Blocks: 468263
Hold.  Back up.

There's a difference between "show an icon" and "show a sized box".  This patch is conflating the two.

I'd like to see a clear description of which behavior you're after and why before you start messing with any of this code, because I don't think we should change it more than once, if at all.

Note that there are existing (open) bugs on showing a placeholder icon next to the alt text when images fall back, by the way.
The spec says "the user agent should display some sort of indicator that there is an image that is not being rendered", but it doesn't define what "some sort of indicator" is.
> Note that there are existing (open) bugs on showing a placeholder icon next to the alt text when images fall back, by the way.
If alt text is present, it is a different bug. Spec says "the element represents the text given by the alt attribute." when non-empty alt attribute is present.
Yes, I know what the spec says.  What I'm asking is what behavior you're actually trying to produce and why.  Specifically in this testcase:

  <img src="bogus" width="100" height="100">

what rendering do you want?  Depending on the desired rendering, simply showing an icon next to the (possibly empty, as in this case) alt text may do what you want.

In particular, how do you want the rendering of the above to compare to:

  <img src="bogus" width="100" height="100" alt="">

?
I have no strong opinion what should be rendered for images without unless it disappears completely.
However, I'm not sure it is right to render an icon if alt is not empty.
> for images without
 for images without alt
OK.  That's fine.  We can do any mix of behaviors here, but we need to decide what behavior we actually want.
Simple: if (both height and width) dimensions present, always draw a box.
(Else one messes up the "structure of the page", right?)
If the image is available, put it in the (now invisible) box.
Else if there is an ALT, put that in the (top) of the box, even if 0
characters long.

There, full disclosure achieved. (Let users turn bits of it off by
about:config if they prefer.)

Isn't that what Google Chrome does?
Summary: Display placeholders for broken images without alt per HTML5 spec encouragement → Treat broken images according to HTML5 spec
> Simple: if (both height and width) dimensions present, always draw a box.

That makes the alt text unreadable, which is broken.

> (Else one messes up the "structure of the page", right?)

Not for a properly coded page.

> Isn't that what Google Chrome does?

Yes, and its rendering of this testcase:

  <img src="bogus" height="100" width="100" alt="This is an image of a flower">

is completely broken: it doesn't show the alt text.

Since you insist on changing the summary to something other than what this bug is about, marking worksforme; our behavior is completely spec compliant.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
Matashosi-san, please move any work you actually want to do to a bug that won't get spammed, ok?
Ok.
Product: Core → Core Graveyard
Product: Core Graveyard → Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: