Alt value overrides aria-labelledby text for image based controls

VERIFIED FIXED in mozilla1.9.1a1

Status

()

Core
Disability Access APIs
VERIFIED FIXED
10 years ago
10 years ago

People

(Reporter: Hans Hillen, Assigned: MarcoZ)

Tracking

(Blocks: 1 bug)

Trunk
mozilla1.9.1a1
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0

When using an element that requires an alt attribute to create an ARIA widget that has an aria-labelledby property, the alt text will be exposed rather than the label text. 

Reproducible: Always

Steps to Reproduce:
1.Use an image based element to create an ARIA widget. Give it an alt value, as well as an aria-labelledby value that points to a different element labelling the widget. Make sure the label text is different than the alt text. 
2.example code: 

<span id="sliderLabel">Volume</span>
<input type="image" src="thumb.png" alt="volume, current value = 10%" role="slider" aria-valuemin="0" aria-valuemax="100" aria-valuenow="10" aria-labelledby="sliderLabel" />
Actual Results:  
When focused, the alt text is exposed as the widget's accessible name

In the example code that would be: "volume, current value = 10%"

Expected Results:  
When focused, the text in the element referenced by the 'aria-labelledby' ID should be exposed.

In the example code that would be: "Volume"
Blocks: 343213, 391535
Component: Disability Access → Disability Access APIs
Product: Firefox → Core
QA Contact: disability.access → accessibility-apis
Target Milestone: --- → mozilla1.9.1
Version: unspecified → Trunk
Status: UNCONFIRMED → NEW
Ever confirmed: true
Created attachment 327606 [details] [diff] [review]
Patch

Prefer label or ARIA label over value, title and others on nsHTMLButtonAccessible::GetName.
Assignee: nobody → marco.zehe
Status: NEW → ASSIGNED
Attachment #327606 - Flags: review?(aaronleventhal)

Comment 2

10 years ago
Comment on attachment 327606 [details] [diff] [review]
Patch

These days aria-labelledby can be used without a role. So you should change the |if (mRoleMapEntry)| to |if (content->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_labelledby))|

Updated

10 years ago
Attachment #327606 - Flags: review?(aaronleventhal) → review-
Created attachment 327610 [details] [diff] [review]
Patch2

Address Aaron's comments.
Attachment #327606 - Attachment is obsolete: true
Attachment #327610 - Flags: review?(aaronleventhal)

Updated

10 years ago
Attachment #327610 - Flags: review?(aaronleventhal) → review+

Comment 4

10 years ago
Marco, hope to see mochitest :)
Flags: in-testsuite?
(In reply to comment #4)
> Marco, hope to see mochitest :)

Yes, will fold a test for this into an over-all testing for aria-labelledby I'm currently preparing. Thanks!
Pushed to mozilla-central in changeset:
http://hg.mozilla.org/mozilla-central/index.cgi/rev/4d1a5e9f9e75
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Verified fixed using Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1a1pre) Gecko/2008070603 Minefield/3.1a1pre.
Status: RESOLVED → VERIFIED
Target Milestone: mozilla1.9.1 → mozilla1.9.1a1
You need to log in before you can comment on or make changes to this bug.