Closed Bug 373364 Opened 17 years ago Closed 17 years ago

impelment IA2::role

Categories

(Core :: Disability Access APIs, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: surkov, Assigned: surkov)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 1 obsolete file)

Attached patch patchSplinter Review
I have questions about role mapping from gecko to IA2.

1) nsIAccessible::ROLE_CLIENT
ATK: ATK_ROLE_PANEL (A generic container that is often used to group objects).
MSAA - USE_ROLE_STRING.
IA2 - ?

2) nsIAccessible::ROLE_ACCEL_LABEL
ATK: ATK_ROLE_ACCEL_LABEL (A label which represents an accelerator)
MSAA: ROLE_SYSTEM_STATICTEXT
IA2: ROLE_SYSTEM_STATICTEXT or IA2_ROLE_LABEL (An object used to present an icon or short string in an interface) ?

3) nsIAccessible::ROLE_CANVAS
ATK: ATK_ROLE_CANVAS (An object that can be drawn into and is used to trap events)
MSAA: USE_ROLE_STRING
IA2: ?

Aaron suggested:
<aaronlev> 1) add IA2_ROLE_CANVAS to IA2 idl and comment similar to what ATK says for it
<aaronlev> 2) Remove old incompatible comments about canvas role from ia2 idl
<aaronlev> 3) Support nsIAccessible::ROLE_CANVAS for <canvas>, and map that to ROLE_SYSTEM_GRAPHIC for MSAA

4) nsIAccessible::ROLE_HTML_CONTAINER
ATK: ATK_ROLE_HTML_CONTAINER (A document container for HTML, whose children represent the document content)
MSAA: USE_ROLE_STRING
IA2: ?

5) nsIAccessible::ROLE_PASSWORD_TEXT
ATK: ATK_ROLE_PASSWORD_TEXT (A text object uses for passwords, or other places where the text content is not shown visibly to the user)
MSAA: ROLE_SYSTEM_TEXT
IA2: ?

6) nsIAccessible::ROLE_TERMINAL
ATK: ATK_ROLE_TERMINAL (An object that represents an accessible terminal)
MSAA: USE_ROLE_STRING
IA2: ?

7) nsIAccessible::ROLE_TEXT_CONTAINER
ATK: ATK_ROLE_TEXT (An object that presents text to the user)
MSAA: USE_ROLE_STRING
IA2: IA2_ROLE_TEXT_FRAME (Collection of objects that constitute a logical text entity.) ?

8) nsIAccessible::ROLE_ENTRY
ATK: ATK_ROLE_ENTRY (The object is a component whose textual content may be entered or modified by the user, provided ATK_STATE_EDITABLE is present.)
MSAA: ROLE_SYSTEM_TEXT
IA2: ROLE_SYSTEM_TEXT ?

9) nsIAccessible::ROLE_PARENT_MENUITEM
ATK: ATK_ROLE_MENU (An object usually found inside a menu bar that contains a list of actions the user can choose from)
MSAA: ROLE_SYSTEM_MENUITEM
IA2: ROLE_SYSTEM_MENUITEM ?

10) nsIAccessible::ROLE_TEAR_OFF_MENU_ITEM
ATK: ATK_ROLE_TEAR_OFF_MENU_ITEM (A menu item used to tear off and reattach its menu)
MSAA: ROLE_SYSTEM_MENUITEM
IA2: ROLE_SYSTEM_MENUITEM ?

Also I found that some IA2 roles are not mapped to gecko roles. These are:
/// Embeded (OLE) object.
IA2_ROLE_EMBEDDED_OBJECT

/// Text that is used as an endnote (footnote at the end of a chapter or section).
IA2_ROLE_ENDNOTE

/// Text that is used as a footnote.  Also refer to ::IA2_ROLE_ENDNOTE.
IA2_ROLE_FOOTNOTE

/** An image map object.  Usually a graphic with multiple hotspots, where 
   each hotspot can be activated resulting in the loading of another document
   or section of a document.
  */
IA2_ROLE_IMAGE_MAP

/** An internal frame. A frame-like object that is clipped by a desktop pane.  
   The desktop pane, internal frame, and desktop icon objects are often used to 
   create multiple document interfaces within an application.
   Also refer to ::IA2_ROLE_DESKTOP_ICON, ::IA2_ROLE_DESKTOP_PANE, and ::IA2_ROLE_FRAME
  */
IA2_ROLE_INTERNAL_FRAME,

/// An embedded note which is not visible until activated.
IA2_ROLE_NOTE

/// Object with graphical representation used to represent content on draw pages.
IA2_ROLE_SHAPE

Do we support them in gecko?
Attachment #258004 - Flags: review?(aaronleventhal)
Alexander, can you send these questions to the IA2 mailing list? We need Pete Brunet to answer the,.
Comment on attachment 258004 [details] [diff] [review]
patch

You can check this in and we can do a follow up patch once Pete Brunet answers your questions.
Attachment #258004 - Flags: review?(aaronleventhal) → review+
checked in. leaving open for questions and possible following up patch
Comments prefixed with ptb:

I have questions about role mapping from gecko to IA2.

ptb: When a role is an MSAA role pass it through both get_accRole and  IA2::role.  When a role is an IA2 role pass the closest MSAA role through get_accRole or role CLIENT when there is no meaningful mapping.  From MSDN regading role CLIENT:  "Active Accessibility uses this role as a default if there is a question about the role of a UI element."  Typical behavior for an AT is to ignore objects with role CLIENT.

1) nsIAccessible::ROLE_CLIENT
ATK: ATK_ROLE_PANEL (A generic container that is often used to group objects).
MSAA - USE_ROLE_STRING.
IA2 - ?

ptb: Map to MSAA's ROLE_SYSTEM_CLIENT.

2) nsIAccessible::ROLE_ACCEL_LABEL
ATK: ATK_ROLE_ACCEL_LABEL (A label which represents an accelerator)
MSAA: ROLE_SYSTEM_STATICTEXT
IA2: ROLE_SYSTEM_STATICTEXT or IA2_ROLE_LABEL (An object used to present an
icon or short string in an interface) ?

ptb: Map it to IA2_ROLE_LABEL.

3) nsIAccessible::ROLE_CANVAS
ATK: ATK_ROLE_CANVAS (An object that can be drawn into and is used to trap
events)
MSAA: USE_ROLE_STRING
IA2: ?

ptb: We are missing an IA2 role for CANVAS.  I will add it.

Aaron suggested:
<aaronlev> 1) add IA2_ROLE_CANVAS to IA2 idl and comment similar to what ATK
says for it
<aaronlev> 2) Remove old incompatible comments about canvas role from ia2 idl
<aaronlev> 3) Support nsIAccessible::ROLE_CANVAS for <canvas>, and map that to
ROLE_SYSTEM_GRAPHIC for MSAA

4) nsIAccessible::ROLE_HTML_CONTAINER
ATK: ATK_ROLE_HTML_CONTAINER (A document container for HTML, whose children
represent the document content)
MSAA: USE_ROLE_STRING
IA2: ?

ptb: Our thinking on this a year ago was to use IA2_ROLE_TEXT_FRAME.  Does that make sense?

5) nsIAccessible::ROLE_PASSWORD_TEXT
ATK: ATK_ROLE_PASSWORD_TEXT (A text object uses for passwords, or other places
where the text content is not shown visibly to the user)
MSAA: ROLE_SYSTEM_TEXT
IA2: ?

ptb:  This is correct.

6) nsIAccessible::ROLE_TERMINAL
ATK: ATK_ROLE_TERMINAL (An object that represents an accessible terminal)
MSAA: USE_ROLE_STRING
IA2: ?

ptb:  We need to add IA2_ROLE_TERMINAL to IA2.

7) nsIAccessible::ROLE_TEXT_CONTAINER
ATK: ATK_ROLE_TEXT (An object that presents text to the user)
MSAA: USE_ROLE_STRING
IA2: IA2_ROLE_TEXT_FRAME (Collection of objects that constitute a logical text
entity.) ?

ptb: This is consistent with our thoughts on ROLE_HTML_CONTAINER.

8) nsIAccessible::ROLE_ENTRY
ATK: ATK_ROLE_ENTRY (The object is a component whose textual content may be
entered or modified by the user, provided ATK_STATE_EDITABLE is present.)
MSAA: ROLE_SYSTEM_TEXT
IA2: ROLE_SYSTEM_TEXT ?

ptb:  This is correct.

9) nsIAccessible::ROLE_PARENT_MENUITEM
ATK: ATK_ROLE_MENU (An object usually found inside a menu bar that contains a
list of actions the user can choose from)
MSAA: ROLE_SYSTEM_MENUITEM
IA2: ROLE_SYSTEM_MENUITEM ?

ptb:  This is correct.

10) nsIAccessible::ROLE_TEAR_OFF_MENU_ITEM
ATK: ATK_ROLE_TEAR_OFF_MENU_ITEM (A menu item used to tear off and reattach its
menu)
MSAA: ROLE_SYSTEM_MENUITEM
IA2: ROLE_SYSTEM_MENUITEM ?

ptb: Our thinking a year ago was to map this to MSAA's ROLE_SYSTEM_MENUPOPUP.  Should I add a new IA2 role for this?

Also I found that some IA2 roles are not mapped to gecko roles. These are:
/// Embeded (OLE) object.
IA2_ROLE_EMBEDDED_OBJECT

/// Text that is used as an endnote (footnote at the end of a chapter or
section).
IA2_ROLE_ENDNOTE

/// Text that is used as a footnote.  Also refer to ::IA2_ROLE_ENDNOTE.
IA2_ROLE_FOOTNOTE

/** An image map object.  Usually a graphic with multiple hotspots, where 
   each hotspot can be activated resulting in the loading of another document
   or section of a document.
  */
IA2_ROLE_IMAGE_MAP

/** An internal frame. A frame-like object that is clipped by a desktop pane.  
   The desktop pane, internal frame, and desktop icon objects are often used to 
   create multiple document interfaces within an application.
   Also refer to ::IA2_ROLE_DESKTOP_ICON, ::IA2_ROLE_DESKTOP_PANE, and
::IA2_ROLE_FRAME
  */
IA2_ROLE_INTERNAL_FRAME,

/// An embedded note which is not visible until activated.
IA2_ROLE_NOTE

/// Object with graphical representation used to represent content on draw
pages.
IA2_ROLE_SHAPE

Do we support them in gecko?
Attached patch role fix patch (obsolete) — Splinter Review
Changes per Peter comments and per not published yet MSAA-IA2 mapping document (that was sended by Pete to us). I removed USE_ROLE_STRING per Pete suggestion and removed accRole code that expose tagname instead of role. I guess AT can use our special interfaces (like nsISimpleDOMNode) to get this information.
Attachment #258184 - Flags: review?(aaronleventhal)
Comment on attachment 258184 [details] [diff] [review]
role fix patch

Don't remove the USE_ROLE_STRING code for get_accRole(). We'll need that for a while, because currently JAWS and Window-Eyes use that. We don't want to force everyone to upgrade their screen readers.
Attachment #258184 - Flags: review?(aaronleventhal) → review-
Attached patch role fix patch2Splinter Review
Attachment #258184 - Attachment is obsolete: true
Attachment #258294 - Flags: review?(aaronleventhal)
Comment on attachment 258294 [details] [diff] [review]
role fix patch2

Basically whatever we used to do in IAccessible::get_accRole() should stay exactly as it is. Because it's not currently broken and works with the screen readers. So don't change those. We have more freedom to think about the right thing with the IA2::role method.

>-  { ROLE_SYSTEM_DOCUMENT, ROLE_SYSTEM_DOCUMENT },
>+  { ROLE_SYSTEM_DOCUMENT, IA2_ROLE_TEXT_FRAME },
Please remove this change. We need the DOCUMENT role which tells the screen reader to go into document review mode after the page loads.

>   // nsIAccessible::ROLE_CANVAS
>+  // XXX: Later IA2 will represent IA2_ROLE_CANVAS (see bug 373364 comment4)
>   { USE_ROLE_STRING, IA2_ROLE_UNKNOWN },
I sent Pete an email to get the idl with this. If he sends it in time, then just check in with the correct role.

>   // nsIAccessible::ROLE_HTML_CONTAINER
>-  { USE_ROLE_STRING, IA2_ROLE_UNKNOWN },
>+  { USE_ROLE_STRING, IA2_ROLE_TEXT_FRAME },
I'm not really sure about this one, but anyway I don't think we'll ever use it.

>   // nsIAccessible::ROLE_TEAR_OFF_MENU_ITEM
>-  { ROLE_SYSTEM_MENUITEM, ROLE_SYSTEM_MENUITEM },
>+  { ROLE_SYSTEM_MENUPOPUP, ROLE_SYSTEM_MENUPOPUP },
That's odd. I don't think it's right. What's a tearoff menu item?

>   // nsIAccessible::ROLE_TERMINAL
>+  // XXX: Later IA2 will represent IA2_ROLE_TERMINAL (see bug 373364 comment4)
>   { USE_ROLE_STRING, IA2_ROLE_UNKNOWN },
Hopefully we get the new IDL right away.

>   // nsIAccessible::ROLE_TEXT_CONTAINER
>   { USE_ROLE_STRING, IA2_ROLE_TEXT_FRAME },
> 
>   // nsIAccessible::ROLE_TOGGLE_BUTTON
>-  { USE_ROLE_STRING, IA2_ROLE_TOGGLE_BUTTON },
>+  { ROLE_SYSTEM_CHECKBUTTON, IA2_ROLE_TOGGLE_BUTTON },
No, this should be ROLE_SYSTEM_BUTTON. Whatever Pete sent you was wrong. A CHECKBUTTON is a checkbox, and that's not what this is.

>   // nsIAccessible::ROLE_HEADER
>-  { USE_ROLE_STRING, IA2_ROLE_HEADER },
>+  { ROLE_SYSTEM_TEXT, IA2_ROLE_HEADER },
This is wrong. We should only be using ROLE_SYSTEM_TEXT for text leaf DOM nodes, not for elements that contain text.

>   // nsIAccessible::ROLE_FOOTER
>-  { USE_ROLE_STRING, IA2_ROLE_FOOTER },
>+  { ROLE_SYSTEM_TEXT, IA2_ROLE_FOOTER },
Same comment here.

>   // nsIAccessible::ROLE_PARAGRAPH
>-  { USE_ROLE_STRING, IA2_ROLE_PARAGRAPH },
>+  { ROLE_SYSTEM_TEXT, IA2_ROLE_PARAGRAPH },
Same comment here.

>   // nsIAccessible::ROLE_CAPTION
>-  { USE_ROLE_STRING, IA2_ROLE_CAPTION },
>+  { ROLE_SYSTEM_TEXT, IA2_ROLE_CAPTION },

>   // nsIAccessible::ROLE_DOCUMENT_FRAME
>-  { USE_ROLE_STRING, IA2_ROLE_UNKNOWN },
>+  { ROLE_SYSTEM_DOCUMENT, IA2_ROLE_TEXT_FRAME },
This role is redundant with ROLE_DOCUMENT, and should be removed from IA2. We should tell Pete that.

>   // nsIAccessible::ROLE_HEADING
>-  { USE_ROLE_STRING, IA2_ROLE_HEADING },
>+  { ROLE_SYSTEM_TEXT, IA2_ROLE_HEADING },
Keep USE_ROLE_STRING.

>   // nsIAccessible::ROLE_SECTION
>-  { USE_ROLE_STRING, IA2_ROLE_SECTION },
>+  { ROLE_SYSTEM_GROUPING, IA2_ROLE_SECTION },
Keep USE_ROLE_STRING, otherwise it looks like a group box.
Attachment #258294 - Flags: review?(aaronleventhal) → review-
In the original checkin for the first patch, I did not check the role table carefully. Please tell me, did the results of IAccessible::get_accRole() change from that patch?
No, I didn't change table roles mapping. I think we can wait for Pete and then I'll refile new patch.
Updated patch was checked in 2007-03-09 19:00.

(In reply to comment #10)
> I think we can wait for Pete and then
> I'll refile new patch.
> 

Fixed in bug 376753.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: