[nvda] Re: Gecko X(HTML) role strings

Hi Benjamin,

As far as I can tell, getRoleName already supports it, because it first checks to see if its an int, and if so it asks MSAA for that particular role's name (according to the operating system). If it isn't an int however, it simply returns the role as is (most likely its either a string, or its None).

comtypes handles the variant stuff in accRole, as far as appRole is concerned, the role will either be an int or a string or something like that. In fact accRole doesn't even check.

Gecko is sending some roles as string, yes, and in my experience with NVDA and gecko, navigating by object, it does eem to pick up the correct roles.
Mick


----- Original Message ----- From: "Benjamin Hawkes-Lewis" <bhawkeslewis@xxxxxxxxxxxxxx>
To: "nvda" <nvda@xxxxxxxxxxxxx>
Sent: Tuesday, December 12, 2006 10:49 AM
Subject: [nvda] Gecko X(HTML) role strings


Gecko exposes more detailed semantic information about web content to
MSAA than Internet Explorer:

BSTR roles are used for important roles that have not been defined by
Microsoft. When the role is retrieved in a VARIANT returned from
get_accRole, check to see if variant.vt == VT_BSTR. If it is, than
variant.bstrVal contains the role string.

The role string may be an HTML tag name followed by comma, space and
the namespace of the current element. In most current cases the
namespace can be ignored, but it may become important in the future.

http://www.mozilla.org/access/windows/at-apis#knowndif

For example, Gecko uses this to expose the Q and H1 to H6 elements to
MSAA. Which obviously rocks. But currently NVDA just reads these as
something like "editable text read only", which is less than
informative.

I've been trying to add support for these role strings to the
getRoleName method in MSAAHandler.py, without much success. I assumed
that accRole would return a VARIANT and that therefore
isinstance(role,VARIANT) would test true, but that appears not be the
case. I've wrestled with this for a couple of futile hours. Can anyone
more experienced in Python, Windows programming, or both, see how this
should work?

--
Benjamin Hawkes-Lewis

To post messages to the list send email to
nvda@xxxxxxxxxxxxx
To unsubscribe from the list send a blank message to:
nvda-request@xxxxxxxxxxxxx
with 'unsubscribe' in the Subject field.
Thank you for your continued support of Nonvisual Desktop Access, an open source free screen reader for Microsoft Windows:
http://www.kulgan.net/nvda/


To post messages to the list send email to
nvda@xxxxxxxxxxxxx
To unsubscribe from the list send a blank message to:
nvda-request@xxxxxxxxxxxxx
with 'unsubscribe' in the Subject field.
Thank you for your continued support of Nonvisual Desktop Access, an open 
source free screen reader for Microsoft Windows:
http://www.kulgan.net/nvda/

Other related posts: