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"
Created attachment 327606 [details] [diff] [review] Patch Prefer label or ARIA label over value, title and others on nsHTMLButtonAccessible::GetName.
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))|
Created attachment 327610 [details] [diff] [review] Patch2 Address Aaron's comments.
Marco, hope to see mochitest :)
(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
Verified fixed using Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1a1pre) Gecko/2008070603 Minefield/3.1a1pre.