Last Comment Bug 661293 - test for tabmodalprompt dialog's prompt label getting the text properly associated for accessibility
: test for tabmodalprompt dialog's prompt label getting the text properly assoc...
Status: RESOLVED FIXED
: access
Product: Core
Classification: Components
Component: Disability Access APIs (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla14
Assigned To: alexander :surkov
:
: alexander :surkov
Mentors:
: 671201 (view as bug list)
Depends on: 421242 736905
Blocks: 671201
  Show dependency treegraph
 
Reported: 2011-06-01 10:43 PDT by Marco Zehe (:MarcoZ)
Modified: 2012-09-28 11:59 PDT (History)
5 users (show)
bugzillamozillaorg_serge_20140323: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
mochitest (3.38 KB, patch)
2012-02-20 07:34 PST, alexander :surkov
mzehe: review+
Details | Diff | Splinter Review

Description Marco Zehe (:MarcoZ) 2011-06-01 10:43:09 PDT
By accessibility technology vendor report, i noticed that the label that is supposed to provide the description for the tabModalPrompt dialog accessible provides an empty description. The reason is that the label pointed to (anon ID is info.body) does not have an accessible name. Instead, it has a text leaf below it that has the actual text.

The hierarchy, starting from the dialog looks like this:

- dialog accessible with an empty accessible name and an empty accessible description
- - label with an empty accessible name
- - - text leaf accessible that contains the actual alert text
- - button that has an accessible name of "OK", corresponding to the visible label.

Question: Why is the text not associated with the xul:description element with anonid of info.body directly? How is that child element being created, and is there a way to explicitly link its contents via aria-labelledby to the xul:description info.body element so we get the description to the dialog accessible?
Comment 1 Justin Dolske [:Dolske] 2011-06-01 17:11:35 PDT
(In reply to comment #0)

> Question: Why is the text not associated with the xul:description element
> with anonid of info.body directly?

There are two ways to use a xul:description...

  <description value="foo"/>

  <description>bar</description>

The main reason for using the latter is that when "bar" is a long string, it will line-wrap. When the text is specified as the |value| attribute, it won't wrap (ie, all on one line). We very much want this text to wrap when it's long, since it's supplied by the web page.

I'm happy to tweak things here , but I'd suggest since this is a widespread pattern you might want a more general solution. I'm not sure if that needs handled on on XUL side or A11Y.

> How is that child element being created

See CommonDialog.jsm's onLoad()...

  // display the main text
  // Bug 317334 - crop string length as a workaround.
  let croppedMessage = this.args.text.substr(0, 10000);
  let infoBody = this.ui.infoBody;
  infoBody.appendChild(infoBody.ownerDocument.createTextNode(croppedMessage));

> and is there a way to explicitly link its contents via aria-labelledby to
> the xul:description info.body element so we get the description to the
> dialog accessible?

You tell me. :)

Also, is this a regression from Firefox 3.6? This code is shared between the tab-modal and window-modal prompts, and for this stuff I think is functionally unchanged from previous versions.
Comment 2 alexander :surkov 2012-02-19 21:56:20 PST
(In reply to Justin Dolske [:Dolske] from comment #1)
> (In reply to comment #0)
> > and is there a way to explicitly link its contents via aria-labelledby to
> > the xul:description info.body element so we get the description to the
> > dialog accessible?
> 
> You tell me. :)

bug 421242
Comment 3 alexander :surkov 2012-02-20 07:34:40 PST
Created attachment 598872 [details] [diff] [review]
mochitest
Comment 4 alexander :surkov 2012-02-20 07:35:47 PST
*** Bug 671201 has been marked as a duplicate of this bug. ***
Comment 5 Marco Zehe (:MarcoZ) 2012-02-20 09:40:09 PST
Comment on attachment 598872 [details] [diff] [review]
mochitest

r=me
Comment 7 Ed Morley [:emorley] 2012-03-14 14:40:14 PDT
https://hg.mozilla.org/mozilla-central/rev/faa1752c22fd

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