Closed Bug 442659 Opened 16 years ago Closed 16 years ago

Alt value overrides aria-labelledby text for image based controls

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.9.1a1

People

(Reporter: hans.hillen, Assigned: MarcoZ)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

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: aria, 191a11y
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
Attached patch Patch (obsolete) — Splinter Review
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 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))|
Attachment #327606 - Flags: review?(aaronleventhal) → review-
Attached patch Patch2Splinter Review
Address Aaron's comments.
Attachment #327606 - Attachment is obsolete: true
Attachment #327610 - Flags: review?(aaronleventhal)
Attachment #327610 - Flags: review?(aaronleventhal) → review+
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
Closed: 16 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.

Attachment

General

Created:
Updated:
Size: