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...
: 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
: alexander :surkov
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:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


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

"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 User image 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 User image 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 User image 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 User image David Bolter [:davidb] 2009-06-16 11:46:37 PDT
Mass un-assigning bugs assigned to Aaron.
Comment 5 User image 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.