OSDN Git Service

gecko vbuf: Map text leaf nodes to ROLE_STATICTEXT, accounting for the fact that...
authorJames Teh <jamie@jantrid.net>
Thu, 7 Feb 2013 02:11:45 +0000 (12:11 +1000)
committerJames Teh <jamie@jantrid.net>
Thu, 7 Feb 2013 02:11:45 +0000 (12:11 +1000)
Fixes incorrect treatment as editable text in some rare cases.

source/virtualBuffers/gecko_ia2.py

index a250715..89b81c6 100755 (executable)
@@ -30,6 +30,10 @@ class Gecko_ia2_TextInfo(VirtualBufferTextInfo):
                        role=controlTypes.ROLE_BLOCKQUOTE\r
                states=set(IAccessibleHandler.IAccessibleStatesToNVDAStates[x] for x in [1<<y for y in xrange(32)] if int(attrs.get('IAccessible::state_%s'%x,0)) and x in IAccessibleHandler.IAccessibleStatesToNVDAStates)\r
                states|=set(IAccessibleHandler.IAccessible2StatesToNVDAStates[x] for x in [1<<y for y in xrange(32)] if int(attrs.get('IAccessible2::state_%s'%x,0)) and x in IAccessibleHandler.IAccessible2StatesToNVDAStates)\r
+               if role == controlTypes.ROLE_EDITABLETEXT and not (controlTypes.STATE_FOCUSABLE in states or controlTypes.STATE_UNAVAILABLE in states or controlTypes.STATE_EDITABLE in states):\r
+                       # This is a text leaf.\r
+                       # See NVDAObjects.Iaccessible.mozilla.findOverlayClasses for an explanation of these checks.\r
+                       role = controlTypes.ROLE_STATICTEXT\r
                if attrs.get("IAccessibleAction_showlongdesc") is not None:\r
                        states.add(controlTypes.STATE_HASLONGDESC)\r
                if "IAccessibleAction_click" in attrs:\r