On Mon, 22 Aug 2005, Nick Kew wrote:
Lars Eighner wrote: I'm using the HTML 4.01 strict DTD.
I have a few questions about the longdesc attribute when used
with the IMG element.
I understand that longdesc takes a uri for a value.
1) What kind of resource is appropriate for the uri to point to?
A plain text file? An HTML document?
Yes and yes.
Excuse me for using this response partially for administrivia, but I've
seen a number of symptoms which suggest that my usual news server is
broken today: I posted a response to Lars earlier today, but I don't see
it on this server nor on Google Gropes, so I suspect that it hasn't
escaped from the server. Whether it ever will, I don't know.
Please humour me if I repeat myself a bit. I agreed with the above (but
the HTML page shouldn't contain images!), but I added this:
I think it's fair to say that the designers of HTML4 intended the old, and
inadequately specified, <img> to be obsoleted by their <object> markup,
where the possibilities for fallback would have been much better
specified. As such, they put only a limited amount of effort into
thinking-through all the accessibility features of <img>. But the
<object> then got so confused with proprietary crud and plugins, and with
muddled implementations in browsers, that document authors weren't
prepared to trust it, and preferred to stay with the more conservative
<img> - for all its inadequacies.
1) b. If several document types are possible, is there a way to
indicate the content type(s) of longdescs used in a page.
No.
Not so far as I can see. In principle, a client agent could negotiate
the content type which it's willing to "Accept:" in response to a
longdesc, but I've never noticed any kind of user option in a browser
to tailor such an Accept: to the user's wishes.
Rather obviously, you could point your longdesc to some kind of "shim"
page which presented a menu of alternatives (plain text, HTML,
whatever), but that's a rather clumsy idea - I doubt that it would be
particularly welcomed by a user who needed a longdesc.
2) If the uri is relative, is it relative to the image or to the
page on which IMG occurs? I guess the latter, but want to be
sure.
Indeed. The client is parsing the page, not the image.
HTML4 section 6.4 says that relative URIs are resolved relative to a base
URI, and refers to 12.4. 12.4.1 sets out the rules for determining the
base URI. I see nothing there which could indicate that the image itself
might serve as base URI! In the absence of a <base> in the <head> (first
list item), nor any HTTP protocol specification of a base URI (second list
item, though don't ask me what that would look like exactly in practice,
see RFC2616), then the third list item indicates that the HTML document
itself is the base URI for resolving relative URIs, doesn't it? So I
think that's the answer to the question.
4) Should longdesc be omitted or be empty for purely decorative
images or images adequately described with alt?
Yes.
Omitted: yes. Empty: I don't think so (?). If an empty URI meant
anything, it would be a relative link back to the current page, which
isn't in the least helpful. (Although in different circumstances, a
longdesc="#anchor" could be entirely acceptable and useful).
But even if longdesc was widely and usefully implemented, I feel that it
has distinct shortcomings.
best