Hi Gaia,
I am doing work to make Gaia more accessible to screen readers and I
have a proposed change to our shared
pack-switch/pack-checkbox/pack-radio classes. Basically, I want to use
the empty <span> as an actual text label as well as the styled state it
is now. My changes seem to be backward compatible with the current usage
throughout gaia, at least in ltr languages. You can see the changes here[1].
First of all the problem: In the settings app, we use these classes a
lot for different option toggles. Often, the label describing the
checkbox is separate from the actual checkbox, and is often an anchor
tag. Here is an example:
<li>
<label class="pack-switch">
<input name="ril.radio.disabled" class="uninit" type="checkbox">
<span></span>
</label>
<a class="menu-item" data-l10n-id="airplaneMode">Airplane Mode</a>
</li>
To clean this up for screen reader use, we need to use a lot of aria[2]
acrobatics. Both for changing roles, preserving checked/unchecked states
and associating the localized label with the control.
With the changes I propose, the same visual/functional outcome could be
done with this markup:
<li>
<label class="pack-switch">
<input name="ril.radio.disabled" class="uninit" type="checkbox">
<span class="menu-item" data-l10n-id="airplaneMode">Airplane Mode</span>
</label>
</li>
>From a pure line count perspective, this is not a huge deal. But from a
screen reader perspective it is, since the entire composite widget is
contained by the label.
This seems to be an inter-app change, so I thought I would post here
first to see what folks thought.
1.
https://github.com/eeejay/gaia/compare/switch-do-over
2.
http://www.w3.org/TR/wai-aria/