img broken shown even with alt=""
Categories
(Core :: Layout: Images, Video, and HTML Frames, defect, P3)
Tracking
()
People
(Reporter: benjamin.leseur, Assigned: emilio)
References
(Regression)
Details
(Keywords: parity-chrome, regression)
Attachments
(3 files)
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0
Steps to reproduce:
A web page with a non-important image like :
<img src="non-existing.jpg" alt="">
The broken image icon is shown even with the alt attribute set to "".
Actual results:
Firefox shows the broken image icon.
Expected results:
The broken image icon should be hidden.
Reading the doc : https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img I found this in alt paragraph :
Setting this attribute to an empty string (alt="") indicates that this image is not a key part of the content (it’s decoration or a tracking pixel), and that non-visual browsers may omit it from rendering.
Visual browsers will also hide the broken image icon if the alt is empty and the image failed to display.
Chromium hide the broken image icon with alt=""
Updated•6 years ago
|
Assignee | ||
Comment 1•6 years ago
|
||
I don't see any broken image icon with data:text/html,<!doctype html><img src="non-existing.jpg" width=50 height=50 alt="">
or the same without the standards mode or the width
/ height
attributes or what not.
Can you attach a test-case that reproduces the issue?
Comment 2•6 years ago
|
||
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0
20200219095352
(In reply to Emilio Cobos Álvarez (:emilio) from comment #1)
Can you attach a test-case that reproduces the issue?
I don't see a broken image with your example either, but I do with this one:
data:text/html,<!doctype html><img src="https://nosuchdomain.exists/logo.jpg" alt="">
Reporter | ||
Comment 3•6 years ago
|
||
Reporter | ||
Comment 4•6 years ago
|
||
I still show the broken image icon in all these situations : https://jsfiddle.net/xtrLo8j1/
Assignee | ||
Comment 5•6 years ago
|
||
Relevant spec is here https://html.spec.whatwg.org/#images-3 and https://html.spec.whatwg.org/#the-img-element. I agree that per spec based on that we should be treating alt=""
differently from no alt attribute.
That is a bit odd, is that intentional Anne? WebKit behaves like us, for what is worth.
I'd be a bit wary of changing our behavior here given how bizarre the Blink behavior is:
https://bugs.chromium.org/p/chromium/issues/detail?id=958250
https://bugs.chromium.org/p/chromium/issues/detail?id=753868
https://bugs.chromium.org/p/chromium/issues/detail?id=671871
Though they do get this particular case right, in fairness.
Comment 6•6 years ago
|
||
Yeah, that's intentional. alt=""
signifies the image has no meaning. Lack of alt
signifies that the meaning is unknown. Copying bz as he used to work on this a bunch (and might still?).
Assignee | ||
Comment 7•6 years ago
|
||
I guess WebKit fixed this like two days ago... https://bugs.webkit.org/show_bug.cgi?id=207740
![]() |
||
Comment 8•6 years ago
|
||
Yes, alt="" should suppress broken image stuff, generally... I thought we used to do that, but maybe some of the missing-alt changes changed the behavior?
Reporter | ||
Comment 9•6 years ago
|
||
From memory, it had this behavior in a not so old past
Assignee | ||
Updated•6 years ago
|
Comment 10•6 years ago
|
||
regression-window |
mozregression-gui can't narrow the range further because this regression is so old. Bug 1196668 looks like the likely culprit.
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 11•6 years ago
|
||
The spec seems to want us to treat it like an inline, but that's not what other
browsers do (I added tests for this in bug 1196668, and they still pass in all
engines).
This is an oddly specific condition to put in
nsImageFrame::ShouldShowBrokenImageIcon(), but oh well, we're past all sanity
here I think...
Comment 12•6 years ago
|
||
![]() |
||
Comment 15•6 years ago
|
||
bugherder |
Updated•6 years ago
|
Description
•