Skip to content
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

Buttons #2209

Closed
wants to merge 3 commits into from
Closed

Buttons #2209

wants to merge 3 commits into from

Conversation

mmcc
Copy link
Member

@mmcc mmcc commented May 29, 2015

This PR switches to using buttons instead of divs, as discussed in #1499. Just a note, this PR does not switch menu buttons over since that would require a substantial amount of refactoring from how things currently work. We plan on making that switch in a future minor release.

refactored buttonText and got tests passing

refactor buttonText to controlText
line-height: 1em;
line-height: 1.5em;
height: 1.5em;
width: 3em; // Firefox bug
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a more descriptive comment about the bug, please

@heff
Copy link
Member

heff commented May 29, 2015

Made some comments but otherwise lgtm.

removing unnecessary localization

fixed the menu button css

Simplified controlText() and removed unnecessary override in MenuButton
@heff
Copy link
Member

heff commented May 29, 2015

@OwenEdwards any thoughts on how "menu buttons" should be treated? e.g. the captions menu. Should they be switched to buttons too or another element?

@OwenEdwards
Copy link
Member

Let's start by renaming 'menu button' to 'menu widget'! Semantically, this thing is a control widget with much more functionality than a button (but see below). Then, see my comments on #2155.

I want to clarify a point here though about the menus, which is about usability as much as accessibility:

Currently, the 'menu button' code is designed to work as a toggle button, which displays or hides the menu when clicked or activated by the keyboard (Space, Enter and Escape are supported).

However, in the CSS/skin, the menu is displayed on hover, so clicking on the menu button only toggles focus (highlight) onto / off the top item in the menu, which (to me at least) is confusing, because it's not actually doing anything to the video player, but there's a visual change.

When using the keyboard to control the 'menu button' (Tab to the control), pressing Enter or Space not only displays the menu, but also activates the top item on the menu, so the keyboard access is broken.

We need to make a decision on what we want clicking on the menu button to do for mouse/touch users, and whether we want that behavior to be changeable with a skin. Note that it's okay to have 'display menu on hover' and still maintain keyboard accessibility (see http://oaa-accessibility.org/examplep/menubar1/). Then, we need to fix keyboard access to menus, per #2155.

@gkatsev
Copy link
Member

gkatsev commented May 30, 2015

The quick fix to making menu buttons accessible is making the menus show up on :focus and :active as well as on :hover. In addition, we'd need to make the next <tab> key go into menu items.

@OwenEdwards
Copy link
Member

:focus would be a quick fix to bring up the menu with keyboard navigation of the controls, but wouldn't resolve the issues of:

  1. What should clicking on or keyboard activating the main button of the menu do? If nothing, then let's get rid of that functionality, and the button can stay as a <div> (wrapping a <ul>). But, if there's only one CC track specified, do we want to support a simple toggle button without a menu, like the native HTML5 players do?
  2. Fixing how keyboard activating the main button of the menu also activates the top item in the menu. (This could be fixed by 1).
  3. Ideally menu items should not be in the <tab> order, otherwise a long list of possible caption/subtitle languages would take a very large number of <tab> presses to get through to the next control widget. (Think of keyboard access to a <select> .. <option> combo box.) <tab> should go from control widget to control widget, while <enter>, <space>, <escape>, and the arrow keys should interact with the widget. This is part of Keyboard accessibility of control bar menus (e.g. captions, subtitles, etc) #2155, so for now menu items can stay in the tab order; they can be <div>s with role=menuitem, and the 'main button', if it stays as a <div> should have role=menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants