Closed Bug 259385 Opened 20 years ago Closed 20 years ago

MSAA: Expose nodes for h1-h6, q, blockquote

Categories

(Core :: Disability Access APIs, defect, P1)

x86
Windows XP
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: aaronlev, Assigned: aaronlev)

Details

(Keywords: access)

Attachments

(1 file, 1 obsolete file)

Screen readers need to have access to nodes that have structural importance in
an HTML document, such as headings and quotes. This allows navigation commands
such as "move by heading" and "move to next quotation". Windows screen readers
have a completely separate document navigation mode where they basically
implement their own browser and they control everything, so it is not possible
to do this navigation for the screen reader. We need to expose the nodes with
those structural items.

There are 2 difficulties:
1. There are no roles for headings or quotes in MSAA
2. We don't want to add any more #ifdef'd code for each platform

One possibility that I discussed with a screen reader vendor is to expose
headings and quotes as ROLE_UNKNOWN. When an accessibility object with
ROLE_UNKNOWN is discovered, the screen reader can check the DOM using
ISimpleDOMNode for the missing information, such as the tag name.
I would like some feedback about this patch from Sun Microsystems. I'll test to
see if extra ROLE_UNKNOWN objects get added. If it does, is that a problem?
Priority: -- → P1
I plan to finish up the role (and state) work in bug 249998. For now, it was
just convenient to get it started here. That will be the next bug I work on.
Attachment #158922 - Attachment is obsolete: true
Attachment #171674 - Flags: review?(pkwarren)
Comment on attachment 171674 [details] [diff] [review]
Create nsGenericAccessible when the appropriate tag comes up, or role attribute is used. Map to enumerated role if possible. If not, expose ROLE_NOTHING or string-based role.

Johnny, W3C is putting the role attribute in the XHTML 2 namespace, but it can
be used from other kinds of XML (including XHTML 1.x).
Attachment #171674 - Flags: superreview?(jst)
Comment on attachment 171674 [details] [diff] [review]
Create nsGenericAccessible when the appropriate tag comes up, or role attribute is used. Map to enumerated role if possible. If not, expose ROLE_NOTHING or string-based role.

>Index: accessible/src/base/nsAccessibilityService.cpp
>===================================================================
>RCS file: /cvsroot/mozilla/accessible/src/base/nsAccessibilityService.cpp,v
>retrieving revision 1.120
>diff -p -u -5 -r1.120 nsAccessibilityService.cpp
>--- accessible/src/base/nsAccessibilityService.cpp	8 Nov 2004 21:07:50 -0000	1.120
>+++ accessible/src/base/nsAccessibilityService.cpp	18 Jan 2005 21:54:05 -0000
>@@ -446,19 +446,31 @@ nsAccessibilityService::CreateHTMLAccess
...
>   else {
>-    return NS_ERROR_FAILURE;
>+    nsAutoString role;
>+    if (content->GetAttr(kNameSpaceID_XHTML2, nsAccessibilityAtoms::role, role) == NS_CONTENT_ATTR_HAS_VALUE) {
>+      *aAccessible = new nsGenericAccessible(node, weakShell);
>+    }
>   }
>-
>-  NS_ENSURE_TRUE(aAccessible, NS_ERROR_OUT_OF_MEMORY);
>-  NS_ADDREF(*aAccessible);
>+  NS_IF_ADDREF(*aAccessible);
>   return NS_OK;
> }

Did you mean to change from returning NS_ERROR_FAILURE or
NS_ERROR_OUT_OF_MEMORY to always returning NS_OK?

Everything else looks ok, but I have not looked at the XHTML2 draft.
Attachment #171674 - Flags: review?(pkwarren) → review+
Comment on attachment 171674 [details] [diff] [review]
Create nsGenericAccessible when the appropriate tag comes up, or role attribute is used. Map to enumerated role if possible. If not, expose ROLE_NOTHING or string-based role.

+    if (content->GetAttr(kNameSpaceID_XHTML2, nsAccessibilityAtoms::role,
role) == NS_CONTENT_ATTR_HAS_VALUE) {

The role attribute really is in the XHTML2 namespace? Seems *really* odd to me.
Where's the spec for that?
Attachment #171674 - Flags: superreview?(jst)
It's described here:
http://www.w3.org/WAI/PF/Group/roadmap/#rolemetadata

For some reason I don't see role mentioned in the latest xhtml2 spec:
http://www.w3.org/TR/xhtml2/Overview.html
I'll find out why.

I understand that it seems fishy, but W3C doesn't want to put role in a separate
namespace. They want it to be a natural part of xhtml2 which is going to also
have allowances for providing a data model element for any custom element. The
data model element is where the defined states will live in xhtml2.

Comment on attachment 171674 [details] [diff] [review]
Create nsGenericAccessible when the appropriate tag comes up, or role attribute is used. Map to enumerated role if possible. If not, expose ROLE_NOTHING or string-based role.

I just sent a private mail to Johnny with the current spec. I believe it's
currently W3C confidential.
Attachment #171674 - Flags: superreview?(jst)
Comment on attachment 171674 [details] [diff] [review]
Create nsGenericAccessible when the appropriate tag comes up, or role attribute is used. Map to enumerated role if possible. If not, expose ROLE_NOTHING or string-based role.

Ok, fair enough. But I don't like us exposing and suggesting that people use a
namespace that's likely to change. That'll get us into trouble, we'll most
likely end up carrying the current, then invalid namespace forever to avoid
break early adopters etc. And we shouldn't call the namespace "XHTML2", since
there is no official namespace for that yet. So...

- In nsINameSpaceManager.h

+#define kNameSpaceID_XHTML2   12

Since there is no official XHTML2 namespace yet, and the one we know if is
likely to change, we should call this something else for now. Maybe
kNameSpaceID_Unofficial_XHTML2, or something.

- In content/base/src/nsNameSpaceManager.cpp:

+#define kXHTML2NameSpaceURI "http://www.w3.org/TR/xhtml2" // Will eventually
change

Same here, don't make it look like this is "the" XHTML2 namespace.

With that, sr=jst
Attachment #171674 - Flags: superreview?(jst) → superreview+
Checking in accessible/public/nsIAccessible.idl;
/cvsroot/mozilla/accessible/public/nsIAccessible.idl,v  <--  nsIAccessible.idl
new revision: 1.30; previous revision: 1.29
done
Checking in accessible/src/base/nsAccessibilityAtomList.h;
/cvsroot/mozilla/accessible/src/base/nsAccessibilityAtomList.h,v  <-- 
nsAccessibilityAtomList.h
new revision: 1.8; previous revision: 1.7
done
Checking in accessible/src/base/nsAccessibilityService.cpp;
/cvsroot/mozilla/accessible/src/base/nsAccessibilityService.cpp,v  <-- 
nsAccessibilityService.cpp
new revision: 1.122; previous revision: 1.121
done
Checking in accessible/src/base/nsBaseWidgetAccessible.cpp;
/cvsroot/mozilla/accessible/src/base/nsBaseWidgetAccessible.cpp,v  <-- 
nsBaseWidgetAccessible.cpp
new revision: 1.30; previous revision: 1.29
done
Checking in accessible/src/msaa/nsAccessibleWrap.cpp;
/cvsroot/mozilla/accessible/src/msaa/nsAccessibleWrap.cpp,v  <-- 
nsAccessibleWrap.cpp
new revision: 1.14; previous revision: 1.13
done
Checking in content/base/public/nsINameSpaceManager.h;
/cvsroot/mozilla/content/base/public/nsINameSpaceManager.h,v  <-- 
nsINameSpaceManager.h
new revision: 3.25; previous revision: 3.24
done
Checking in content/base/src/nsNameSpaceManager.cpp;
/cvsroot/mozilla/content/base/src/nsNameSpaceManager.cpp,v  <-- 
nsNameSpaceManager.cpp
new revision: 3.52; previous revision: 3.51
done

(pkw, I'm not worried about the return value of that one right now, since we
don't do anything with it).
Status: NEW → RESOLVED
Closed: 20 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: