Last Comment Bug 366723 - Mozilla exposes incomplete MSAA Name when multiple HTML labels are associated with a form control
: Mozilla exposes incomplete MSAA Name when multiple HTML labels are associated...
Status: RESOLVED FIXED
: access
Product: Core
Classification: Components
Component: Disability Access APIs (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla2.0
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
Depends on:
Blocks: namea11y 559750
  Show dependency treegraph
 
Reported: 2007-01-11 13:02 PST by Tom Brunet
Modified: 2011-09-19 05:36 PDT (History)
3 users (show)
surkov.alexander: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Tom Brunet 2007-01-11 13:02:24 PST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 (CK-IBM) Firefox/2.0.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 (CK-IBM) Firefox/2.0.0.1

From http://www.w3.org/TR/html4/interact/forms.html#h-17.9:
"More than one LABEL may be associated with the same control by creating multiple references via the for attribute."

Firefox is only exposing the first label found to MSAA.  

Reproducible: Always

Steps to Reproduce:
1.Create a page with the following HTML:
<LABEL for="foo">Label one</LABEL> <LABEL for="foo">Label two</LABEL><INPUT id="foo">
2.Use Inspect32 to investigate the MSAA name exposed for the input control
Actual Results:  
"Label one" is returned.  In general, it appears to find the first label and ignore the rest.

Expected Results:  
MSAA:Name = "Label one Label two"
Comment 1 Aaron Leventhal 2007-01-12 08:25:45 PST
Workaround: note that aaa:labelledby accepts a list of ID's separated by a space, and can be used by HTML or XUL to have multiple label targets.

Not a very good workaround for HTML since it's not supported bye other browsers right now, and we should just get <label> correct.

Implemenation-wise, we won't want to walk the entire tree of objects. This means that whenever a label element is created, we should cache what it points to in a hash table so we can retrieve the relationship in reverse with an O(1) algorithm. However, we'll have to be careful to keep the cache updated as elements get removed and attributes change. That's a lot of work to do for this. I'm surprised IE 7 gets that right -- pretty impressive.
Comment 2 Tom Brunet 2007-01-12 13:06:28 PST
Sorry, I had Pete check that by phone since I didn't have an IE7 install, and I think he looked at the wrong field.  I've since installed Vista to verify and it only displays the content of the second label - unless there's a difference between IE7 on XP and Vista.

Therefore, support for this is broken in at least IE6, IE7 and Firefox 2.  The only browser I'm aware of that supports this is Home Page Reader.  I haven't tested Opera.
Comment 3 Aaron Leventhal 2007-01-12 13:16:02 PST
It's the kind of thing that's really hard to implement in a way that doesn't affect performance. It isn't common enough for anyone to care enough to do it the right way. There are so many other bigger issues. Ideally I'd like to see it fixed. In the mean time I'd use aaa:labelledby.
Comment 4 David Bolter [:davidb] 2009-06-16 11:46:37 PDT
Mass un-assigning bugs assigned to Aaron.
Comment 5 alexander :surkov 2011-09-19 05:36:04 PDT
fixed by bug 381599 (firefox 4 timeframe), tests in name/test_general.html ("btn_label_multi").

Note You need to log in before you can comment on or make changes to this bug.