-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider using <button> element #1499
Comments
I think anchor tags vs button tags for this use case is a bit pedantic (much like most of the things they're touting as features, but that's almost certainly just my curmudgeon opinion), but what additional "accessibility goodness" do they provide out of the box? If there are clear benefits beyond "semantic" then we should absolutely continue the conversation. |
curmudge away! :) First where are the anchor tags? As far as I can see it’s So VJS is all divs. But the WAI-ARIA spec advises against the current VJS pattern of heaping ARIA roles onto divs:
General advice. Okay. The main reason seems to be that screen readers announce the name of an element when it gains focus. Hearing “Div” is distinctly unhelpful. Also, VJS hasn’t given the buttons a “name”, which makes voice commands hard. For a serious rant on this topic, see: http://www.karlgroves.com/2013/05/14/links-are-not-buttons-neither-are-divs-and-spans/ And MDN’s article "Using the Button Role" hammers it home:
and (to my mind) the clincher:
See also: http://css-tricks.com/use-button-element/ So at a certain point, patch on top of patch, you’re dressing up a dog as a cat. Why don’t you just go to the pound, trade in your dog, and get a cat? :) Have you guys ever tested VJS with screen readers? I agree that pedantry about semantics can be tedious, but it seems significant that everyone involved in this area feels strongly about semantic markup, and that consistent, usable patterns and behaviors are currently emerging. |
You're totally right, brain fart on the anchor tags. I don't disagree with any of these points, but I really want to because this isn't a trivial change. :) That being said, I'm not opposed to making the switch, but let's table this conversation until @heff gets back from vacation. I vaguely remember having a conversation with him along these lines and there were other complications involved. Nothing insurmountable, but given the scope of transitioning from cat to dog (who would transition the other way, anyway), it'd be nice to make sure we weren't missing any relevant details. |
Done! Kind of, but aside from Menu buttons, vanilla buttons are now buttons. |
One of the bragging points of Paypal’s new html5 player is semantic markup. I think they have a point there. Best practice is to mark up a button as a
<button>
, and we’re currently not doing that. Given that we have proper ARIA roles, this is less of a concern. But<button>
s get authors lots of accessibility goodness right out of the box, and I think they help to cover some edge cases, especially with screen readers. This would require a bit of an overhaul. Right now the menus are inside the button<div>
s, and in the default skin they get hidden and shown with descendant selectors:The idea would be to switch to markup like:
and switch to adjacent selectors in the CSS:
Thoughts?
The text was updated successfully, but these errors were encountered: