This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25493 - <img> Are alts not being respected in document outline for things like <h1><img alt="Title" src="path/to/i [...]
Summary: <img> Are alts not being respected in document outline for things like <h1><i...
Status: RESOLVED WORKSFORME
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other All
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard: picture
Keywords:
Depends on: picture
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-28 16:04 UTC by contributor
Modified: 2019-03-29 20:53 UTC (History)
4 users (show)

See Also:


Attachments

Description contributor 2014-04-28 16:04:34 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html
Multipage: http://www.whatwg.org/C#phrasing-content-0
Complete: http://www.whatwg.org/c#phrasing-content-0
Referrer: 

Comment:
Are alts not being respected in document outline for things like <h1><img
alt="Title" src="path/to/image.jpg"></h1>? When a heading contains <img
alt="Title">, what do browsers do with the <img> presently? What (if any)
document tells them to use the alt attribute?

Posted from: 206.211.150.84
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36
Comment 1 Ian 'Hixie' Hickson 2014-04-28 16:58:42 UTC
The spec says what the "img" element represents (the image or its alternative text). If there are browsers or other UAs that don't implement this correctly, I recommend filing bugs on them.
Comment 2 Michael[tm] Smith 2014-05-13 09:09:02 UTC
(In reply to Ian 'Hixie' Hickson from comment #1)
> The spec says what the "img" element represents (the image or its
> alternative text).

As far as I can see the spec doesn't actually yet say that.

Currently it literally just says, "An img element represents an image."
Comment 3 Ian 'Hixie' Hickson 2014-05-13 18:04:22 UTC
Search for "What an img element represents depends on the src attribute and the alt attribute". The sentence you quote is just the intro to the section. The wording could probably be improved, e.g. to replace "represents" with "allows the author to reference", or some such. zcorpan, do you want to make that change?
Comment 4 Michael[tm] Smith 2014-05-14 07:51:43 UTC
(In reply to Ian 'Hixie' Hickson from comment #3)
> Search for "What an img element represents depends on the src attribute and
> the alt attribute".

Ah OK, sorry for missing that. So yeah reading that now I agree that wording is clear and unambiguous.

> The sentence you quote is just the intro to the section.

Right. So maybe a link to the "What an img element represents depends on the src attribute and the alt attribute." section could be hoisted up to the intro.

That is, replace the current "An img element represents an image." text with a text that reads, "What an img element represents _depends on the element's src and alt attributes_." (hyperlinked part underlined). Or however you want to word it, or whatever part you'd want to make the text of the hyperlink/

> The wording could probably be improved, e.g. to replace "represents" with
> "allows the author to reference", or some such. zcorpan, do you want to make
> that change?

IMHO I'm not sure replacing the "represents" there with "allows the author to reference" would be an improvement. Myself, I like "represents" just fine.
Comment 5 Ian 'Hixie' Hickson 2014-05-14 21:20:55 UTC
The word "represents" is a term of art. Having two parts of the spec contradict themselves about what the element represents is technically an error.

The thinking behind the current text was that we want to say "img is for images" up front, since saying "img is for text or images" (which is what the spec used to say, actually) is eyebrow-raising. But we need the precise text that says img represents text too, for correctness. So the latter is somewhat buried currently.
Comment 6 Domenic Denicola 2019-03-29 20:53:25 UTC
It seems like this came to a good conclusion.