Open Bug 1502660 Opened 7 years ago Updated 4 months ago

<img> display `alt` values when loading

Categories

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

65 Branch
defect

Tracking

()

People

(Reporter: 709922234, Unassigned)

References

()

Details

Attachments

(3 files)

Attached video alt-text.mov
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:65.0) Gecko/20100101 Firefox/65.0 Steps to reproduce: open `https://axinga.xyz/` html source code: ```html <img src="icons/icon.svg" alt="MT Music Player"> ``` Actual results: The alt value of icon is displayed when splash is displayed. Expected results: Do not display alt text unless the icon fails to load
Component: Untriaged → Image Blocking
Product: Firefox → Core
Summary: <img> do not display `alt` values when loading → <img> display `alt` values when loading
I can reproduce this. This is an SVG image, so presumably one of these conditions passed and we decided to briefly display the alt text: https://searchfox.org/mozilla-central/rev/5b3b6b8fd9f90087f618c20382e631451136ed2b/layout/generic/nsImageFrame.cpp#1983 This doesn't happen on Chrome for me.
Status: UNCONFIRMED → NEW
Component: Image Blocking → ImageLib
Ever confirmed: true
OS: Unspecified → All
Hardware: Unspecified → All
Flags: needinfo?(aosmond)
Priority: -- → P3
Flags: needinfo?(aosmond)

When the image is loading, it is displayed that the ALT text is a bad user experience. Is it possible to fix this problem?

v103.0a1 Can't reproduce on dribbble.

But it can still be reproduce on https://music.xianqiao.wang

(In reply to 709922234 from comment #3)

v103.0a1 Can't reproduce on dribbble.

But it can still be reproduce on https://music.xianqiao.wang

Wrong, nothing changed

Component: ImageLib → Layout: Images, Video, and HTML Frames
Severity: normal → S3

Dribbble has updated their code. The image uploaded by the user no longer include alt text, but can still see alt text when the avatar is loaded.

Here is a simple example: https://cotton-speckled-henley.glitch.me/

See Also: → 1884109

As a user, I kind of prefer current behavior of Firefox.

Regardless, what does the W3C specification say regarding this?

https://justmarkup.com/notes/2016-01-20-showing-the-alternative-text-while-images-are-loading/

I guess there are users who prefer the Firefox behavior and want other browsers to follow.

And current behavior matches MDN description:

The HTMLImageElement property alt provides fallback (alternate) text to display when the image specified by the <img> element is not loaded.
This may be the case because of an error, because the user has disabled the loading of images, or because the image hasn't finished loading yet.

Source: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt

Problem is that spec defines:

alt - Replacement text for use when images are not available

Source: https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-alt
This means it's not clear if not yet loaded and failed to load are different things. They both mean 'not available'.

This problem seems to be for W3C to discuss and solve.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: