From 2ddfab7e6977c5acbb9c58f716c34aeb5e757a0c Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Sun, 16 Dec 2012 17:44:45 -0800 Subject: [PATCH] Accessibility: Make vote arrows into buttons. This adds three attributes to vote arrows: * role="button" is part of ARIA and tells user agents that even though the vote arrow is a div, it's actually meant to be a button. * aria-label, another part of ARIA, this tells user agents what to call the newly buttonized. * tabindex, this makes the buttons able to receive keyboard focus so you tab through the document. --- r2/r2/templates/printable.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/r2/r2/templates/printable.html b/r2/r2/templates/printable.html index e1c43c582..6e7e32caf 100644 --- a/r2/r2/templates/printable.html +++ b/r2/r2/templates/printable.html @@ -148,6 +148,13 @@ ${self.RenderPrintable()} %else: onclick="$(this).show_unvotable_message()" %endif + role="button" + % if dir > 0: + aria-label="${_("upvote")}" + % else: + aria-label="${_("downvote")}" + % endif + tabindex="0" >