Opened 11 years ago
Closed 11 years ago
#10384 closed defect (fixed)
[patch] [ccla] TabContainer: Screen reader does not speak title of image only tabs
Reported by: | Becky Gibson | Owned by: | Becky Gibson |
---|---|---|---|
Priority: | high | Milestone: | 1.5 |
Component: | Accessibility | Version: | 1.4.0b |
Keywords: | Cc: | Shane O'Sullivan | |
Blocked By: | Blocking: |
Description (last modified by )
- Load a Screen reader (tested with JAWS 11)
- Load the dijit/tests/layout/test_TabContainer.html test page.
- Put the screen reader in virtual PC buffer off mode (instert+z in JAWS) or the mode to interact with widgets.
- Press the tab key to put focus on the 3rd tab container example that has only images on the tab
- Note that JAWS only speaks, "tab" but not the title that is associated with the image.
The problem is that the title attribute is set on the outer div that is marked as presentation. The title attribute should be set on the div that gets focus and has the role="tab" and tabindex="0". Currently that div has title="" which is why JAWS is not speaking it.
Attachments (1)
Change History (11)
comment:1 Changed 11 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 11 years ago by
Milestone: | 1.4 → 1.5 |
---|
comment:3 Changed 11 years ago by
This is not a regression since it wasn't supported in 1.3. It is a new feature that wasn't implemented properly for accessibility.
comment:4 Changed 11 years ago by
This really should be fixed for 1.5 - but don't believe it is my responsibility to "own" this issue.
Changed 11 years ago by
Attachment: | 10384.patch added |
---|
comment:5 Changed 11 years ago by
fix is to add an alt attribute to the iconNode of tab buttons with showTitle=false. Also had to remove waiRole=presentation from template so that alt attribute will be recognized. If showTitle=true the alt value will remain as alt="" so accessibility is still maintained (you can set images to role=presentation or use alt="" when they should be ignored by assistive technology). I maintained the current Implementation that the tooltip parameter takes precedence over the label and modified the test file to check that.
comment:6 Changed 11 years ago by
Summary: | TabContainer: Screen reader does not speak title of image only tabs → [patch] [ccla] TabContainer: Screen reader does not speak title of image only tabs |
---|
comment:8 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:9 Changed 11 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
This was broken in [21829] when waiRole="presentation" was added back into the _TabButton template on the iconNode attachpoint. Removing that will fix the problem.
comment:10 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
There's some strange stuff going on here: there are two separate code paths for setting a title (a.k.a. tooltip) on a _TabButton.
The children of a TabContainer widget (typically ContentPane's) have two attributes: title and tooltip. The title becomes the label of the _TabButton, and the tooltip (if specified) becomes the title on the _TabButton's focusNode, thanks to _TabButton's attributeMap (title --> focusNode) entry.
_TabButton can also get a title applied to it's dojoAttachPoint="titleNode", thanks to Button's _setLabelAttr():
First, it looks to me like the _TabButton template should set titleNode and focusNode to point to the same node. It's almost always the case that we want focusNode and titleNode to point to the same node. The exceptions are ComboButton (which has two tab stops) and Select (the tooltip is on the down arrow not the selected value, not sure if that's intentional or a mistake... that's something else to confirm).
Second, the attributeMap for _TabButton should probably map title to the titleNode, not to the focusNode, although it's a philosophical distinction if they point to the same node.
Third, there's a minor bug that happens when a button's title parameter is cleared via attr("title", ...), and consequently, when the TabContainer's child's tooltip parameter is cleared. The code in _setLabelAttr() won't get run which means that the _TabButton will have no title, even in showLabel==false mode. I think we need a _setTooltipAttr() method in Button rather than putting tooltip in attributeMap.
Fourth, we need unit tests for this.
_ScrollingTabControllerButton also has a dojoAttachPoint="titleNode" on the label, which is odd since the label isn't displayed except in high-contrast mode. Is that a bug or by design.
Having said all that, this isn't a regression so I don't see a reason to squeeze it into the 1.4 release.