Closed Bug 969553 Opened 10 years ago Closed 10 years ago

Update shared tabs styling and markup to be screen reader accessible.

Categories

(Firefox OS Graveyard :: Gaia, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(b2g-v2.0 fixed)

RESOLVED FIXED
2.0 S1 (9may)
Tracking Status
b2g-v2.0 --- fixed

People

(Reporter: yzen, Assigned: yzen)

References

Details

(Keywords: access)

Attachments

(1 file, 1 obsolete file)

Currently actual tab buttons are wrapped within the container [role="tab"] element which results in an additional stop when traversing the screen with the screen reader. This needs to change.
Need help with the markup, or do you know where you have to go with these? My blog has an Advanced ARIA Tip #1 on this subject, too.
Thanks Marco, pretty much what I'm doing but was missing aria-controls and aria-labelledby!
Attached file Github pull request. (obsolete) —
I removed role selectors ([role="tab"], [role="tablist"], [role="tabpanel"]) from css and replaced them with css classes (.bb-tabpanel, .bb-tablist). 

It is better to avoid styling based on roles in order to not break the semantics. For example: email app uses tablist/tab/tabpanel roles for all of its toolbars only for the styling purposes. The toolbars that the style is applied to are not actually tabs but collections of buttons that trigger dialogs, add flags to the email etc. This breaks the semantics for the screen reader user.

Also, I updated the elements that the role="tab" is attached to. Preferably it should be an actual focusable element that triggers the tab selection (e.g. <a>) and not its parent. 

I added role="presentation" to the parent <li> elements to make sure that the screen reader only focuses on the actual tab.

aria-selected is not handled by the shared AccessibilityHelper and is used across all apps that need to update it.
Attachment #8375796 - Flags: feedback?(pivanov)
(In reply to Yura Zenevich [:yzen] from comment #3)
> aria-selected is not handled by the shared AccessibilityHelper and is used
> across all apps that need to update it.
s/not/now
Comment on attachment 8375796 [details] [review]
Github pull request.

Flagging one peer per touched app just so they know this is coming and to spread the knowledge around good ARIA and CSS practices.

I don't think we should wait on everyone's feedback to land this though.
Attachment #8375796 - Flags: feedback?(timdream)
Attachment #8375796 - Flags: feedback?(salva)
Attachment #8375796 - Flags: feedback?(m)
Attachment #8375796 - Flags: feedback?(kgrandon)
Attachment #8375796 - Flags: feedback?(dkuo)
Attachment #8375796 - Flags: feedback?(bfrancis)
Attachment #8375796 - Flags: feedback?(anthony)
Marco: Could you actually link to your blog post? It will be helpful knowledge in a different form than a pull request :)
Flags: needinfo?(marco.zehe)
Attachment #8375796 - Flags: feedback?(m) → feedback+
(In reply to Anthony Ricaud (:rik) from comment #6)
> Marco: Could you actually link to your blog post? It will be helpful
> knowledge in a different form than a pull request :)

http://www.marcozehe.de/2013/02/02/advanced-aria-tip-1-tabs-in-web-apps/
Comment on attachment 8375796 [details] [review]
Github pull request.

I'm not sure if it's going to be easy to land this in a massive PR, but F+. Left one comment on github.
Attachment #8375796 - Flags: feedback?(kgrandon) → feedback+
Comment on attachment 8375796 [details] [review]
Github pull request.

In terms of engineering, it's great to have this kind of clean-up. (That's Tim the developer talking)

However judging by the experience of bug 914892, we need to be more careful on this kind of change; it pretty hard to identify if we have changed all instances in every app that use that CSS block.

There were some discussion around migrating building blocks (and shared script in general) with version. I wonder if we need to make that work before working on bug like this?

That said, since it's early in the release cycle, if you are confident of your fix, and you are available for resolving regression bugs daily-ish for the next 6 weeks, we can try to do it.

(... and that, is Tim the manager talking)
Attachment #8375796 - Flags: feedback?(timdream)
Eitan beat me to it. :) Thanks!
Flags: needinfo?(marco.zehe)
Comment on attachment 8375796 [details] [review]
Github pull request.

Hey nice one :) I like it :) I work on the refresh of [BB]Tabs and I tried to keep the markup like was before the refresh but I also realize that we have a lot of problems with the aria-roles at all.

I can help you make this changes (two hands more :) on the apps who use the [BB]Tabs I already unify the markup on them and I'm familiar with the [BB] so feel free to assign me some bugs or ask me for r+/f+
Attachment #8375796 - Flags: feedback?(pivanov) → feedback+
(In reply to Tim Guan-tin Chien [:timdream] (MoCo-TPE) (please ni?) from comment #9)
> Comment on attachment 8375796 [details] [review]
> Github pull request.
> 
> In terms of engineering, it's great to have this kind of clean-up. (That's
> Tim the developer talking)
> 
> However judging by the experience of bug 914892, we need to be more careful
> on this kind of change; it pretty hard to identify if we have changed all
> instances in every app that use that CSS block.
> 
> There were some discussion around migrating building blocks (and shared
> script in general) with version. I wonder if we need to make that work
> before working on bug like this?
> 
> That said, since it's early in the release cycle, if you are confident of
> your fix, and you are available for resolving regression bugs daily-ish for
> the next 6 weeks, we can try to do it.
> 
> (... and that, is Tim the manager talking)

Hi Tim, I'll be available for that :)!
Comment on attachment 8375796 [details] [review]
Github pull request.

We are loosing functionality. I think it is something related with the CSS. Moving to :mai for further details.
Attachment #8375796 - Flags: feedback?(salva) → feedback?(mri)
Comment on attachment 8375796 [details] [review]
Github pull request.

Please, review my comments on GitHub. Once addressed, ask for the feedback again.
Thank you
Attachment #8375796 - Flags: feedback?(mri)
Comment on attachment 8375796 [details] [review]
Github pull request.

I've left two comments in the PR for bad CSS selectors.

Also, I'm seeing a flash of "Select All" "Deselect All" buttons when opening the Dialer. I'm not sure why but this needs to be fix.
Attachment #8375796 - Flags: feedback?(anthony) → feedback-
Attachment #8375796 - Flags: feedback?(mri)
Attachment #8375796 - Flags: feedback?
Attachment #8375796 - Flags: feedback-
Attachment #8375796 - Flags: feedback? → feedback?(anthony)
Comment on attachment 8375796 [details] [review]
Github pull request.

Looks good to me. Thanks!
Attachment #8375796 - Flags: feedback?(mri) → feedback+
Comment on attachment 8375796 [details] [review]
Github pull request.

Anthony,

overall the patch looks good, but since highlighting the selected tab does not depend on the hash change, you should modify the related code, like: https://github.com/mozilla-b2g/gaia/blob/master/apps/music/js/music.js#L177 which forcing the hash to be the first page(mix) after music is reset by mount/unmount the storages as well, also in the manifest.webapp, the launch_path contains the hash because we want to highlight the tab, probably we can remove it if the approach of how we highlight the tabs is changed. And if you are going to land this and not confident of breaking nothing, please set the review(music part) to me and I will check for you, thanks.
Attachment #8375796 - Flags: feedback?(dkuo) → feedback+
All comments addressed in the PR and this bug. Anthony, Ben, would you have time for another f? or should I ask for r?
Flags: needinfo?(bfrancis)
Flags: needinfo?(anthony)
Attachment #8375796 - Flags: feedback?(bfrancis) → feedback+
Flags: needinfo?(bfrancis)
Comment on attachment 8375796 [details] [review]
Github pull request.

Looks good overall. A few nits and some concerns around unit tests.
Attachment #8375796 - Flags: feedback?(anthony) → feedback-
Flags: needinfo?(anthony)
Comment on attachment 8375796 [details] [review]
Github pull request.

Added unit tests for accessibility_helper. Using mock accessibility helper in other apps' unit tests. addressed the nits.
Attachment #8375796 - Flags: feedback- → feedback?(anthony)
Anthony, the PR should be ready for, hopefully, final round of feedback :).
Flags: needinfo?(anthony)
I'll try to take a look at this later this week but it's not high on my priority list.

In any case, even with a positive review, we should not land this on master anymore because it is a too risky change. Sorry :(
http://www.quickmeme.com/img/54/5433867a3c819788cd0651b4c35613c6be6072c3fb4cbd25d102d502452c1f02.jpg
Flags: needinfo?(anthony)
I updated the PR to the latest master. As in previous version of the PR tabs are made accessible across all apps that have them and the tests you requested are added. Hopefully the timing to get the f? is better this time around :)
Flags: needinfo?(anthony)
Comment on attachment 8375796 [details] [review]
Github pull request.

I'm still seeing the flash that I mentioned in comment 15.

I've left some comments on Github about the tests.
Attachment #8375796 - Flags: feedback?(anthony) → feedback-
Flags: needinfo?(anthony)
Attachment #8375796 - Flags: feedback- → feedback?
Comment on attachment 8375796 [details] [review]
Github pull request.

Fixed the issues with flickering buttons, all comments addressed.
Attachment #8375796 - Flags: feedback? → feedback?(anthony)
Attachment #8375796 - Flags: feedback?(anthony) → feedback+
Attachment #8375796 - Flags: review?(arnau)
Yura: If the fix from bug 986047 lands before you (very likely), can you rebase and make sure the fix still works? And that we don't have any extra CSS.
Comment on attachment 8375796 [details] [review]
Github pull request.

LGTM, but please rebase before merging as you have conflicts with dialer app.
Attachment #8375796 - Flags: review?(arnau) → review+
Master: https://github.com/mozilla-b2g/gaia/commit/e1c443d9ff62a21920d389be097d0e666f38e70b
Status: NEW → RESOLVED
Closed: 10 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 1.5 S1 (9may)
Yura: This failure is because unit tests are run in isolation on TBPL. I'm not sure we can easily do that locally but maybe https://developer.mozilla.org/en-US/Firefox_OS/TBPL#Running_TBPL_Try_jobs_against_Gaia_builds can help you.
Attached file Github pull request.
Updated the pull request to fix the test failure. Added mocks for AccessibilityHelper in the necessary clock tests. If all is good I will squash the 2 commits before marking for checkin.
Attachment #8375796 - Attachment is obsolete: true
Attachment #8397427 - Flags: review?(arnau)
Comment on attachment 8397427 [details] [review]
Github pull request.

LGTM, squash your commits and that's all ;)
Attachment #8397427 - Flags: review?(arnau) → review+
Master: https://github.com/mozilla-b2g/gaia/commit/6a3bdfc1ee9acb908ba54dcd0f631d11aeb0a0f1
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: