Trailing space in ARIA attribute ID reference list causes validation error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Trailing space in ARIA attribute ID reference list causes validation error

jason@accessibleculture.org
A trailing space in a space-separated list of IDREFs in @aria-controls
or @aria-labelled causes validation errors. An example of the error
message is "The aria-controls attribute must point to an element in
the same document." Removing the trailing space clears the error.

Consider the following HTML:

--- html begins ---

<button type=button class=accordion-expand
aria-controls="accordion-content-195 accordion-content-196
accordion-content-197 accordion-content-198 ">Trailing space</button>

<a href="#" aria-labelledby="accordion-content-195
accordion-content-196 accordion-content-197 accordion-content-198
">Foo - trailing space</a>

<button type=button class=accordion-expand
aria-controls="accordion-content-195 accordion-content-196
accordion-content-197 accordion-content-198">No trailing
space</button>

<a href="#" aria-labelledby="accordion-content-195
accordion-content-196 accordion-content-197 accordion-content-198">Bar
- no trailing space</a>

<div id="accordion-content-195">block 1</div>
<div id="accordion-content-196">block 2</div>
<div id="accordion-content-197">block 3</div>
<div id="accordion-content-198">block 4</div>

--- html ends ---

The first button and link pair have aria attributes with
space-separated ID references with a trailing space, while the second
pair don't. The errors are raised only for the first button and link.

The algorithm for parsing space separated tokens [1] suggests this is a bug.

Jason


[1] http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#set-of-space-separated-tokens

Reply | Threaded
Open this post in threaded view
|

Re: Trailing space in ARIA attribute ID reference list causes validation error

Michael[tm] Smith
Hi Jason,

Jason Kiss <[hidden email]>, 2015-05-20 13:38 +1200:
> Archived-At: <http://www.w3.org/mid/CACFCJLTc94HJmtg+hLy5q2eA7m64Y_VqtEpAeMLJkXR8HkiSYg@...>
>
> A trailing space in a space-separated list of IDREFs in @aria-controls
> or @aria-labelled causes validation errors. An example of the error
> message is "The aria-controls attribute must point to an element in
> the same document." Removing the trailing space clears the error.
...
> The first button and link pair have aria attributes with
> space-separated ID references with a trailing space, while the second
> pair don't. The errors are raised only for the first button and link.

Yeah, I’ll fix this in the validator regardless of whether or not the
relevant specs actually makes it clear (and I think the relevant spec in
this case may actually just be the ARIA spec, not the HTML spec).

> The algorithm for parsing space separated tokens [1] suggests this is a bug.

I think it actually is a bug—I’m just not sure if it’s a bug in the
validator or a bug (for failing to follow spec requirements) or a bug in
the relevant spec (for failing to make it clear that trailing whitespace is
allowed in aria-* values).

As far as what the relevant spec is here, I’m not sure (haven’t looked back
at the specs yet) but I think the datatype microsyntax of aria-* attributes
is defined in the ARIA spec and not in the HTML spec, and that the
conformance rules in the HTML spec for space separated tokens don’t apply
to the parsing of the values of aria-* attributes.

I’d happy to be wrong about that though.

But as I said, I’ll fix this in the validator, regardless.

  —Mike

> [1] http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#set-of-space-separated-tokens

--
Michael[tm] Smith https://people.w3.org/mike

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Trailing space in ARIA attribute ID reference list causes validation error

jason@accessibleculture.org
Hi Mike,

On Wed, May 20, 2015 at 2:09 PM, Michael[tm] Smith <[hidden email]> wrote:

<snip>

> As far as what the relevant spec is here, I’m not sure (haven’t looked back
> at the specs yet) but I think the datatype microsyntax of aria-* attributes
> is defined in the ARIA spec and not in the HTML spec, and that the
> conformance rules in the HTML spec for space separated tokens don’t apply
> to the parsing of the values of aria-* attributes.
>
> I’d happy to be wrong about that though.

It wasn't clear to me either, but that's how I decided to interpret
the first paragraph at
http://www.w3.org/TR/wai-aria-1.1/#state_property_processing

> But as I said, I’ll fix this in the validator, regardless.

Great! Thanks.

Jason


>
>   —Mike
>
>> [1] http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#set-of-space-separated-tokens
>
> --
> Michael[tm] Smith https://people.w3.org/mike

Reply | Threaded
Open this post in threaded view
|

Re: Trailing space in ARIA attribute ID reference list causes validation error

Michael[tm] Smith
In reply to this post by Michael[tm] Smith
"Michael[tm] Smith" <[hidden email]>, 2015-05-20 11:09 +0900:
> Jason Kiss <[hidden email]>, 2015-05-20 13:38 +1200:
> > Archived-At: <http://www.w3.org/mid/CACFCJLTc94HJmtg+hLy5q2eA7m64Y_VqtEpAeMLJkXR8HkiSYg@...>
> >
> > A trailing space in a space-separated list of IDREFs in @aria-controls
> > or @aria-labelled causes validation errors. An example of the error
> > message is "The aria-controls attribute must point to an element in
> > the same document." Removing the trailing space clears the error.

I just now fixed this and pushed the change to https://validator.w3.org/nu/

This cause was a bug that’s been in the code for a long long time (maybe
even 10 years) and that affected checking of other attributes as well, so
thanks for catching it and reporting it.

  —Mike

--
Michael[tm] Smith https://people.w3.org/mike

signature.asc (836 bytes) Download Attachment