Closed Bug 401545 Opened 17 years ago Closed 6 years ago

XUL:caption element cannot be referenced by aaa:labelledby attributes even when it has an id attribute.

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: MarcoZ, Assigned: ginnchen+exoracle)

References

(Blocks 1 open bug)

Details

(Keywords: access, Whiteboard: [bk1])

Attachments

(1 file, 1 obsolete file)

In trying to properly fix bug 344588, I noticed that the caption for a groupbox cannot be included in a aaa:labelledby attribute. Syntactically, there is no problem, it just is not included in the accessiblename for the control that is supposed to be labelled.
Imagine the following excerpt:

[...]
          <groupbox id="certificatesGroup">
            <caption id="CertGroupCaption" label="&certificates.label;"/>

            <description id="CertSelectionDesc" control="certSelection">&certselect.description;</description>
            <radiogroup id="certSelection" orient="horizontal" preftype="string" 
	                      preference="security.default_personal_cert" aaa:labelledby="CertGroupCaption CertSelectionDesc">
[...]
The result should be that the radio group's accessibleName is combined out of the groupboxe's caption and the description, so that screen readers can give proper contextual information once the focus lands on one of the radio buttons inside the radio group.

Actual result: Only the XUL:description's text is used, the XUL:caption's text is ignored.
Not sure how much it is going with XUL because caption should be description for groupbox only. Isn't it?
(In reply to comment #1)
> Not sure how much it is going with XUL because caption should be description
> for groupbox only. Isn't it?
> 

Maybe, but we could not use aaa:labelledby="certificatesGroup", either.
I think it may be inconvenient in some case.
(In reply to comment #2)
> Maybe, but we could not use aaa:labelledby="certificatesGroup", either.
> I think it may be inconvenient in some case.

Yes, I tried that.  This causes all accessible names of the groupbox and all of its children, grandchildren etc. to be combined, even those that we don't want.
Attached patch patch (obsolete) — Splinter Review
Attachment #286801 - Flags: review?(surkov.alexander)
I just built with this patch, and can confirm that the connection via aaa:labelledby now works. Good job, Ginn!
oops, I think I forgot to fix the LABEL_BY/FOR relation.
(In reply to comment #6)
> oops, I think I forgot to fix the LABEL_BY/FOR relation.

??? As the patch is now, I could reference the groupbox caption via aaa:labelledby just fine, as seen in the patch for bug 344588. This now gives the desired result.
Attached patch patch v2Splinter Review
Macro, I mean in last patch I only fixed name property, not getRelationSet API.

You can check it in accerciser "Interface Viewer" panel.

Note: it's still not working with the fix of bug 344588, because currently getRelationSet doesn't work if labelledby contains multiple ids.
But if you use aaa:labelledby="CertGroupCaption", it works fine.
Attachment #286801 - Attachment is obsolete: true
Attachment #286950 - Flags: review?(surkov.alexander)
Attachment #286801 - Flags: review?(surkov.alexander)
Ginn, I still don't understand why we need this because xul:caption is a caption for groupbox no more.
I think sometimes we may want to refer to the the caption.
Like the fix of bug 344588.
(In reply to comment #10)
> I think sometimes we may want to refer to the the caption.
> Like the fix of bug 344588.
> 

The mentioned bug wants to label radiogroup inside groupbox by caption of groupbox. It's strange. I think AT shouldn't provide more info than usual user can read. So, caption of groupbox labels only groupbox, how can it label children of groupbox?
(In reply to comment #11)
> (In reply to comment #10)
> The mentioned bug wants to label radiogroup inside groupbox by caption of
> groupbox. It's strange. I think AT shouldn't provide more info than usual user
> can read. So, caption of groupbox labels only groupbox, how can it label
> children of groupbox?

Because this is a case where you have the following structure:
- Groupbox
- - Description
- - Radio Group
- - - Radio Group items

ATs only look for the next up hierarchical grouping information when focus lands on a radio button. In this case, it would only look for the label for the radio group, which, in that example, is empty. ATs will not look further up the hierarchy for groupboxes because in Windows -- and that's primarily where this comes from I think -- groupboxes usually don't contain radio groups within them.
So, to give users the best contextual information, I want to include the caption for the groupbox in the accessible name for the radio group.
Once the user tabs out of the radio group, normal groupbox logic will find the groupbox information for the remaining grouped controls.
Ok, so xul:label should be much similar with xul:label, we should create accessible for it then. Right?
(In reply to comment #13)
> Ok, so xul:label should be much similar with xul:label, we should create
> accessible for it then. Right?

I am not certain. I realize that this is a very special case in which I wanted to use aaa:labelledby. All I asked was to be able to reference the groupbox's caption. I do not think a separate accessible is necessary. I would have chosen to reference the ID of the groupbox directly, but that results in the AccessibleNames of all children within the groupbox to be used, and that is definitely not desired. So I asked whether it's possible to give the caption an ID so that I can reference it from aaa:labelledby.
(In reply to comment #13)
> Ok, so xul:label should be much similar with xul:label, we should create
> accessible for it then. Right?
> 

We create accessible for xul:label inside the xul:caption.
So I think we don't need a separate accessible for xul:caption.
(In reply to comment #15)
> (In reply to comment #13)

> We create accessible for xul:label inside the xul:caption.
> So I think we don't need a separate accessible for xul:caption.
> 

xul:caption can contain anything therefore we need an accessible for it.
(In reply to comment #16)
> xul:caption can contain anything therefore we need an accessible for it.
> 

I thought it can only contain an icon and a label.

Typically, I think no one want to add more elements into a caption.
(In reply to comment #17)

> I thought it can only contain an icon and a label.
> 
> Typically, I think no one want to add more elements into a caption.
> 

Typically - probably. But they want to put there checkbox, for example, to enable/disable elements of groupbox or just complex styled label. It's better to have hypertext accessible for caption I guess.
Good point.

If we introduce caption accessible, the LABELLED_BY/LABEL_FOR relation will be more complex.
The accessible hierarchy will be like,
<groupbox "A">
    <caption "B">
        <label "C">

option 1: "C" is label for "A" and "B"
option 2: "C" is label for "B", "B" is label for "A"

What if the caption has another label child?

I think we don't need go too far.
(In reply to comment #19)
> Good point.
> 
> If we introduce caption accessible, the LABELLED_BY/LABEL_FOR relation will be
> more complex.

I didn't get why. Do you mean relations between groupbox and caption?

> 
> What if the caption has another label child?

No one child if it is anonymous content, all children if they are explicit I think.
Oh my God... All I wanted to achieve was to be able to include the caption of the groupbox in another control's accessible name. Ginn's original patch does that fine.
However, according to the documentation of XUL:caption at http://developer.mozilla.org/en/docs/XUL:caption, a caption can contain either a label attribute, or "or child elements for a more complex caption." Question: Has anyone ever done a more complex caption for a groupbox than using a text label?
Marco, there are really complex application based on XUL (sometimes they call it "XUL dark matter") that can juggle with XUL really :). We should try to keep them accessible too though 
in the meantime it's out of box. But since it's not going to be complex then I'd rather fix it here.
Comment on attachment 286950 [details] [diff] [review]
patch v2

canceling request until ginn's answer
Attachment #286950 - Flags: review?(surkov.alexander)
I think XUL:caption is really complex if it contains children.
I agree we should create an accessible for caption.

So, for
<groupbox>
  <caption label="My groupbox"/>
</groupbox>

we will create accessibles like this
panel (A)
    caption (B)
        label (C)

I still don't know how to deal with relations.
Perhaps, it should be (A) is LABELLED_BY (C), (C) is LABEL_FOR (A). (B) doesn't have any relation.
(In reply to comment #24)
> I think XUL:caption is really complex if it contains children.
> I agree we should create an accessible for caption.
> 
> So, for
> <groupbox>
>   <caption label="My groupbox"/>
> </groupbox>
> 
> we will create accessibles like this
> panel (A)
>     caption (B)
>         label (C)
> 

I did't get why do we need an accessible for label (C), why it isn't enough to have an accessible for caption (B) only which would be related with panel (A)?

caption is a container, it may have several children.

e.g.

We can write
#1
<caption label="My groupbox"/>

We can also write
#2
<caption>
  <label value="My groupbox" />
</caption>

or
#3
<caption>
  <checkbox label="Checkbox A"/>
  <checkbox label="Checkbox B"/>
  <label value="Label A" />
  <label value="Label B" />
</caption>

So, making label as a child of caption is a same solution for #1-#3.
Actually, with #1, the label is an anon child of caption, so it would be easier to implement and it is compatible with current behavior.
What is the status on this? Does the patch needs more work or does it just need a review?
Whiteboard: [bk1]
Dialogs no longer existent in this form, other changes have made this one obsolete. Closing as WONTFIX.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: