On 05/25/2010 10:26 AM, Denis Gervalle wrote:
On Mon, May 24, 2010 at 15:51, Sergiu
Dumitriu<sergiu(a)xwiki.com> wrote:
On 05/18/2010 07:29 PM, Denis Gervalle wrote:
Hi devs,
Even if ajax based stuff will never fully comply with accessibility
requirements, I would like to improve a little bit the livetable
pagination
markup so it gets closer to these requirements.
Currently, the pagination
feature use<span> for numbers, and also use empty<span> with a
background
image for previous/next page buttons. Both of
these practice produce very
poor interface once the css is disabled.
I attach a patch that improve the situation by using<a> in place
of<span>,
so that links are properly identified when css is
not used or with a
screen
readers. Using CSS, the behavior and the design
is unchanged.
Here is my +1 to apply this ASAP on trunk.
+1, with one remark: why do you use href="#", and not just not use href
at all?
<a> without href is not considered as a link by most browsers. An<a>
without attribute is just like a span ! Even the a:hover style is not
applied on some of them (at least webkit based do not).
a:hover should be applied no matter if there's a href or not. What does
not get applied is a:link:hover, which is normal, since it's not a link.
If it doesn't point anywhere, then it isn't a link. Making it pretend
that it is a real link is not much better than using a generic span.
Since my goal is to provide real links so the
navigator or the assistive
reader report them as links properly without css, it is require to put an
href, else my changes are just useless.
Why not use ARIA roles?
http://www.w3.org/TR/wai-aria/roles#link
Using ARIA is even better, since it allows to specify other properties
as well: aria-controls, aria-disabled, aria-busy, aria-label, aria-live.
Note that the HTML specification says that you may
create<a> without href
(and without id/name), but only to setup them later through scripts. Be
aware that some browser dislike that and never change the<a> to a link when
the script add the attribute.
But we're not changing the href at all. Another option would be to also
change the href to point to the proper fragment when serialization is
enabled.
So, my advice and now good habits is to always put an
href="#" on any links
that are resolve programmatically. Also note that if the event is processed
(not stopped as we do here), these links could create entries in the history
of the browser.
Denis
--
Sergiu Dumitriu
http://purl.org/net/sergiu/