longdesc target in the same document
If you want, you can cut the crap, and go straight to the demos, and click the first image.
To demonstrate how one can serve a long image description – a longdesc URI – while both keep the description inside the same page and make it accessible for as many as possible. The consept is a variant of what others have called accessibility footnotes. The reason why I call this page an Acid test, is because it is necessary to show How Longdesc Should Be Done™: What the UAs should live up to, and what authors can do, in order to get it used, get it supported etc..
Versions: third version of this document published on 2008-04-16 .
Fixes: 2008-04-28: Small fix in the JS code, so the single click works.
Added JavaScript so that browsers (Firefox, Opera 9.5 latest build and WebKit) can open the longdesc URI via doubleclick. An old stylesheet, only working properly in Firefox, is available as an alternative stylesheet.
The main part of this page is still kept as long descripton of the first image, and has not changed. In the next paragraph I add new info about longdesc support. I also added a header element to the footnote, as a signal, to AT users, that this is where the footnote begins. (The alternative would be to have separate footnote elemente, much like HTML 5 offers section elements and so on. Certainly, section could be used for the footnote.)
Those browsers that support the CSS :target selector. (Added the ie7 JavaScript library to try to support Internet Explorer.)
And, according to last test, Jaws used with Internet Explorer.
I have created a related page more directly related to HTML 5.
I want to thank Joshue O’Connor from Centre for Inclusive Technology for having tested version 2 of this page, verifying that it worked with JAWS through Internet Explorer, and for his comments on that occassions. (Now, in version 3, with JavaScript, that JAWS/IE compatibility may have changed. Feedback are welcome. Send it to "lhs" on "malform-dot-no".) Also thank you to Laura Carlson for encouraging feedback, and to the HTML4all.org gang in general!
What is longdesc support?
Since the first versions of this document, I have learned that Internet Explorer 8 is expanding support for the longdesc attribute. Reading the Microsoft documentation, I also learned that longdesc has been in the DOM since DOM 1. This inspired me to try this out. And it turns out that all the mayour web browsers support it ... Is this the best kept secret of the longdesc issue? At any rate, because of this, I decided to remove the additional <a href=> links.
Otherwise, this info regarding User Agents supporting longdesc without the use of JavaScript still counts:
Firefox with Lauke's longdesc extensions; WebKit based iCab 4 for Mac OS X (and older not Webkit based iCab versions). Of course also assistive readers, both screenreaders (Jaws etc) and not screenreaders. Lauke's Firefox extestion opens the URI in the same window. iCab currently only launches the link in a separate window. (Webkit has a bug with fragment URI-s when they are opened in new window, but this does not seem to affect this iCab in this page.) Both iCab and Firefox you use the contextual menu to select the longdesc URI.
I tested this page with the the Fangs screen reader simulator. The simulator does not support the longdesc attribute. (But perhaps I can trust what Fang's output of how display:none is handeled by screenreaders?)
And now to the tests. And the included article, for those who are interested. (You might consider reading another article also – or – insteand.)
The following image has a long description connected to itself. Inside the long description, you will find a long text regarding longdesc, cross-references, accessibility footnots and more.
All users: Doubleclick to activate the longdesc link. (Unless you are using Jaws etc.)
For Internet Explorer: You must doubleclick the image twice! After first doubleclick, watch the scrollbar grow. Thenafter, doubleclick one more time on the same image. (Try, and you shall see.) As I said above, for Explorer this is done via JavaScript. Tested this with IE6 where this worked quite fast. Also tried IE8, where it was rather slow. (My computer Windows PC is very slow as well.)
placeholder paragraph
placeholder paragraph
placeholder paragraph
All users: Here, the longdesc link is activated via single click (instead of doublclick, as above).
placeholder paragraph
placeholder paragraph
placeholder paragraph
placeholder paragraph
placeholder paragraph
placeholder paragraph
There (appears) to be nothing below this paragraph. But there is more … (follow the longdesc URIs above to get to the rest.)
NB! The TOC links (currently) causese this section to close.
The TOC links kind of works. But after you've used one of them, hovering outside the browser window can cause surprises.
NB!
longdesc
feature
longdesc
feature Two questions perhaps lays behind this text:
and other thoughts about how to get support for long descriptions of images in HTML 5.
longdescThe traditional longdesc solution is to keep the long description in another, external document. This has some advantages:
But, apart from the, till now, shortcomings of most UAs, authors are in lack of good descriptions about how to create good longdesc users experiences. Though, there have been some attemts. (I don't proclaim to know them all.)
One of the best ideas is the idea of keeping the long descriptions as «accessibility footnotes». I myself made a proposal that reminds about this idea to the HTML5 working group.
The accessibility footnote idea is at least 4 years old. (See Andy Clarke
at Stuff
and nonsense.) Andy Clarke, in his example
page, kept the footnote inside the same page (that is why it is called a
footnote), but hides it for sighted users via the the CSS style display:none;.footnotes{position:absolute; left:
-9999px;}, which moves the text outside the screen.
Andy Clarke's example is close – on the idea level – to what I want to achieve, namely: Somethingh which is hidden for normal users. But I still see 2-3 problems with his particular approach:
display:block or something, in the code. This is still an early attemt. In its current shape and form, it works the best in Firefox.
I have not discussed which kind of CSS I have used in this text. But my first approach was to fiddle with overflow:hidden and overflow:scroll for the HTML and the BODY elements. Clarke, however and as told, set the longdesc footnote to have .footnote{display:absolute;left:-99999px;}. Now have also implemented his method, with the difference that activating the longdesc URI now moves the footnote inside the window, in front of the rest of the page. Perhaps this method is in fact simpler to master. In both implmentations, the CSS :target selector plays a key role.
cite attribute
implementationHTML4 requires that longdesc is
available with another method than reguler links. This because images
often are used as links. And then you need a way to both access the link,
and the long description. (Frankly, I wonder if that particular
situation, is an edge case – which therefore only creates "hick-ups"
(did I hear "hixie-ups"?) in certain brains which are allergic to
unrealistic use cases (or sometihng).)
For that reason, but mostly because of other reasons, I don't think we
should focus soe much on that edge case. We could instead take a look at
how Opera Anne van Kesteren has implmented support
for the cite attribute of the blockquote
element. For instance, take a look at this reader
comment in Anne van Kesteren's blog, which quotes another comment.
Notice that right-pointing arrow there? I am not certain how Anne does
it. Is it Javascript? Apparently. At any rate, this a visible sign that
tells that there is source for this text. How about a ! (an exlamation
mark) or an i (info-sign) as a link that users can click ot get a long
description? (Incidently, the Internet Explorer 8 implementation, which
is said to display the longdesc URI as a tool tip, could
very good provided it became possible to click that
tooltip)
A longdesc is a footnote, isn't it? Doesn't all users
need footnotes? Sighted or not? It is a reason that footnotes and
endnotes are not mangled with the text, right? Yes, of course, sometimes
footnotes tells you the source of a quote. But other times, footnotes
gives extra information. Explain things that normal users can jump over
and so on. So how about advocating longdesc as a kind a
general "hidden footnote" feature? Perhaps it even could expanded to more
elements?
The dfn element enables automatic
cross-references. … [for] any span, abbr,
code, var, samp, or
i … [whose] title
attribute … equals the term of a dfn element in the same
document, … [it] should be presented in such a way that the user can
jump … to the first dfn element giving the defining
instance of that term.
My reply:
should be presented in
such a way that the user can jump … such a
way is supposed to differ – in some way – from regular links?
longdesc works Hence, why not specify the longdesc
feature as part of this cross-referencing feature? In
other words, simply let the longdesc feature be understood like this:
img element is included amongst the elements
(span, abbr, code,
var, samp and i) that can
enable automatic cross-referencing. img, this can be achieved both with and without
the longdesc attribute. longdesc is required when the user wants
to link to an external document - as, otherwise, the HTML 5
cross-referening feature only includes links inside the same
document. Thus, inside the document, this is not needed. longdesc
attribute to be used on all the cross-ferencing
element, when those elements needs to reference a source outside the
same document. dfn element. longdesc, then the UA should not try to hide the
long description. img inside a span element, or
even a a element. However,
a element from
being wrapped around span, i,
attr var and samp either,
and img that it can can have for these other elements.
video, audio.longdesc URI/issue/feature in the framework
of the cross-referencing feature is not only logical, it could also (but
hopefully not) serve to tell use whether certain opponenst simply are
against longdesc by default – not matter the implementation, or if the
are able to see how it compares to cross-referencing. For sighted users, they should lead to something above the image, but not necessarily to the very image. (In other words, is my current design in fact focused on sighted users, as the backlink leads to the neares header/logical place above the images?) But non-sighted users might not find that so handy - they might want to go straight back to the image, or after the images. What do a Jaws user need?
longdesc attribute somehow could
fucntion as a «backlink ID»?
It would at least be good if the backlinking could happen automatically and safely, and always only lead back to the image.
But fact, including the longdesc feature into the automatic cross-referencing feature ought to ensure that, see above.
Regarding the last two points, it should be evident from my post to the
HTML5 working group that, that I was inspired by the Acid2 test, especially that part which tests
the CSS overflow
property, which can entirely hide the scroll bar. But this also shows that in
order to get thigns going, we need to get the vendors aboard. We must define
sometihng that is useable and userful, and get them aboard to support it.
Some other links, to see where you land:
This is just fake content, to proof that it is possible with more than one long descriptino per page.
Line 1 of 44 of the 2nd longdesc description
Line 2 of 44 of the 2nd longdesc description
Line 3 of 44 of the 2nd longdesc description
Line 4 of 44 of the 2nd longdesc description
Line 5 of 44 of the 2nd longdesc description
Line 6 of 44 of the 2nd longdesc description
Line 7 of 44 of the 2nd longdesc description
Line 8 of 44 of the 2nd longdesc description
Line 9 of 44 of the 2nd longdesc description
Line 10 of 44 of the 2nd longdesc description
Line 11 of 44 of the 2nd longdesc description
Line 12 of 44 of the 2nd longdesc description
Line 13 of 44 of the 2nd longdesc description
Line 14 of 44 of the 2nd longdesc description
Line 15 of 44 of the 2nd longdesc description
Line 16 of 44 of the 2nd longdesc description
Line 17 of 44 of the 2nd longdesc description
Line 18 of 44 of the 2nd longdesc description
Line 19 of 44 of the 2nd longdesc description
Line 20 of 44 of the 2nd longdesc description
Line 21 of 44 of the 2nd longdesc description
Line 22 of 44 of the 2nd longdesc description
Line 23 of 44 of the 2nd longdesc description
Line 24 of 44 of the 2nd longdesc description
Line 25 of 44 of the 2nd longdesc description
Line 26 of 44 of the 2nd longdesc description
Line 27 of 44 of the 2nd longdesc description
Line 28 of 44 of the 2nd longdesc description
Line 29 of 44 of the 2nd longdesc description
Line 30 of 44 of the 2nd longdesc description
Line 31 of 44 of the 2nd longdesc description
Line 32 of 44 of the 2nd longdesc description
Line 33 of 44 of the 2nd longdesc description
Line 34 of 44 of the 2nd longdesc description
Line 35 of 44 of the 2nd longdesc description
Line 36 of 44 of the 2nd longdesc description
Line 37 of 44 of the 2nd longdesc description
Line 38 of 44 of the 2nd longdesc description
Line 39 of 44 of the 2nd longdesc description
Line 40 of 44 of the 2nd longdesc description
Line 41 of 44 of the 2nd longdesc description
Line 42 of 44 of the 2nd longdesc description
Line 43 of 44 of the 2nd longdesc description
Line 44 of 44 of the 2nd longdesc description