Closed Bug 968111 Opened 10 years ago Closed 10 years ago

Fix various XUL files' accessibility markup throughout Toolkit

Categories

(Toolkit :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: MarcoZ, Assigned: MarcoZ)

Details

(Keywords: access)

Attachments

(1 file, 1 obsolete file)

Attached patch ImproveXulMarkup.diff (obsolete) — Splinter Review
These fix errors that crept in overtime, mainly:

1. Replace "for" with "control" in XUL label usage. In XUL, as opposed to HTML, the attribute name to associate alabel with a control is "control", not "for".
2. Add explicit dialog descriptions so screen readers won't have to crawl through the static text elements and maybe pick up extraneous stuff. Improves the initial reading experience when these windows/dialogs open.
3. Add missing associations of labels and controls in some places.
Attachment #8370641 - Flags: review?(dao)
Comment on attachment 8370641 [details] [diff] [review]
ImproveXulMarkup.diff

>--- a/toolkit/components/viewconfig/content/config.xul
>+++ b/toolkit/components/viewconfig/content/config.xul

> <window id="config"
>         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 
>         title="&window.title;"
>         windowtype="Preferences:ConfigManager"
>         role="application"
>+        aria-describedby="warningTitle warningText"
>         width="750"
>         height="500"
>         disablefastfind="true"
>         onunload="onConfigUnload();"
>         onload="onConfigLoad();">

about:config allows the user to disable the warning such that it won't show again when opening about:config. How will aria-describedby="warningTitle warningText" be handled in that case?

>--- a/toolkit/mozapps/handling/content/dialog.xul
>+++ b/toolkit/mozapps/handling/content/dialog.xul

>-  <checkbox id="remember" oncommand="dialog.onCheck();"/>
>+  <checkbox id="remember" aria-labelledby="remember-text" oncommand="dialog.onCheck();"/>
>   <description id="remember-text"/>

toolkit/mozapps/handling/content/dialog.js sets a label attribute on the checkbox. How will this be handled when there's also the aria-labelledby attribute?
(In reply to Dão Gottwald [:dao] from comment #1)
> about:config allows the user to disable the warning such that it won't show
> again when opening about:config. How will aria-describedby="warningTitle
> warningText" be handled in that case?

It'll just produce an empty string. And this would then be expected. So it won't crash or anything.

> toolkit/mozapps/handling/content/dialog.js sets a label attribute on the
> checkbox. How will this be handled when there's also the aria-labelledby
> attribute?

ARIA usually wins over native markup when present, especially in the label case. Would aria-describedby, e. g. turning this into an optional description and leaving the label alone, be appropriate? That way, the text in the description element will be spoken if no label is there, and it will be spoken in addition to the label set by JS.
> > toolkit/mozapps/handling/content/dialog.js sets a label attribute on the
> > checkbox. How will this be handled when there's also the aria-labelledby
> > attribute?
> 
> ARIA usually wins over native markup when present, especially in the label
> case. Would aria-describedby, e. g. turning this into an optional
> description and leaving the label alone, be appropriate? That way, the text
> in the description element will be spoken if no label is there, and it will
> be spoken in addition to the label set by JS.

That sounds better.
(In reply to Dão Gottwald [:dao] from comment #3)
> That sounds better.

Fixed locally.
Addressed comment.
Attachment #8370641 - Attachment is obsolete: true
Attachment #8370641 - Flags: review?(dao)
Attachment #8370782 - Flags: review?(dao)
Attachment #8370782 - Flags: review?(dao) → review+
https://hg.mozilla.org/mozilla-central/rev/074f7372e03b
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: