Re: Moving longdesc forward

On Tue, May 3, 2011 at 5:05 PM, Leif Halvard Silli
<xn--mlform-iua@xn--mlform-iua.no> wrote:
> NOTE 1: Should the spect text say 'URL' rather than 'link'? 'link' brings the
> thought to HTML5's definition of 'interactive elements', which @longdesc has
> nothing to do with.

I don't think so.

"longdesc" is a type of link.

HTML5 does not define the word "link" to imply an interactive element:

http://dev.w3.org/html5/spec/links.html#links

Saying "link" is consistent with the language defining the very similar
attribute @cite:

http://dev.w3.org/html5/spec/grouping-content.html#attr-blockquote-cite

> NOTE 2: The suggested spec text only says this, about fragment URLs:
>
>  ]]  The link must point to either a different document from the image or a
> fragment of the same document that does not contain the image.  [[
>
> I would suggest to add that when the description is located in a document
> which contains more than the description itself (NOTE: this is includes if
> the fragment is on the same page!), then the longdesc MUST point to the
> #fragment which encapsulates the entire description or which at least
> identifies the start of the description.

Not all media types that could be used for long text alternatives support
fragment identifiers.  For example, text/plain does not. So I do not think this
is a safe constraint.

> It should also always be simple to know, via the right choice of markup e.g.
> a heading or article or aside element etc, when the description begins and
> ends.

Not all media types that could be used for long text alternatives use markup.
For example, text/plain does not. So I do not think this is a safe constraint.

> So, after the sentence (or after the paragraph) mentioned above, how about
> adding this:
>
>  ]]  A description SHOULD have a clear beginning and a clear end. When the
> URL points to a page that contains more than the particular description
> (NOTE: this includes cases where the description is located in the same
> document as the image), the URL MUST identify the fragment where the
> description begins (this fragment SHOULD be the container for entire
> description).  [[

How about:

    A longdesc attribute may be present. This attribute specifies a link to a
    long text alternative to the image. If present, it must contain a valid URL
    potentially surrounded by spaces.

    <span class="impl">To obtain the corresponding long text alternative link,
    the value of the attribute must be resolved relative to the element.</span>
    When interleaved with other content, long text alternatives must be
    identified as precisely as possible, for example by including a fragment in
    the URL identifying the start of the long text alternative. If the link
    resolves to the same document as the image, it must identify a fragment
    that does not contain the image.

    For example, the following snippet defines an image of a chart with a short
    text alternative and a long text alternative elsewhere in the same
    document. The short text alternative is placed in the alt attribute, while
    the long text alternative is precisely linked using a longdesc URL
    including a fragment identifier:

        <img src=october-sales-chart.png
             alt="October sales chart"
             longdesc=#chart-description>
        <details>
            <summary>Description</summary>
            <p id=chart-description>Bar Chart showing sales for October.
            There are 6 salespersons. Maria is highest with 349 units. Frances
            is next with 301. Then comes Juan with 256, Sue with 250, Li with
            200 and Max with 195. The primary use of the chart is to show
            leaders, so the description is in sales order.</p>
        </details>

    User agents should allow users to access long text alternatives.

Note I've stolen the text of the example text alternatives wholesale
from:

http://www.w3.org/TR/2010/NOTE-WCAG20-TECHS-20101014/G92

It could probably be improved.

--
Benjamin Hawkes-Lewis

Received on Wednesday, 4 May 2011 00:22:47 UTC