OSDN Git Service

gecko vbuf backend: Never treat non-editable documents and iframes as interactive...
authorJames Teh <jamie@jantrid.net>
Fri, 30 Nov 2012 02:18:05 +0000 (12:18 +1000)
committerJames Teh <jamie@jantrid.net>
Fri, 30 Nov 2012 02:18:05 +0000 (12:18 +1000)
nvdaHelper/vbufBackends/gecko_ia2/gecko_ia2.cpp

index 8ff3cc1..64badde 100755 (executable)
@@ -441,7 +441,9 @@ VBufStorage_fieldNode_t* GeckoVBufBackend_t::fillVBuf(IAccessible2* pacc,
        // Whether this node is a link or inside a link.\r
        int inLink = states & STATE_SYSTEM_LINKED;\r
        // Whether this node is interactive.\r
-       bool isInteractive = isEditable || inLink || (states & STATE_SYSTEM_FOCUSABLE && role != ROLE_SYSTEM_DOCUMENT && role != IA2_ROLE_INTERNAL_FRAME) || states & STATE_SYSTEM_UNAVAILABLE || role == ROLE_SYSTEM_APPLICATION || role == ROLE_SYSTEM_DIALOG || role == IA2_ROLE_EMBEDDED_OBJECT;\r
+       // Certain objects are never interactive, even if other checks are true.\r
+       bool isNeverInteractive = !isEditable && (role == ROLE_SYSTEM_DOCUMENT || role == IA2_ROLE_INTERNAL_FRAME);\r
+       bool isInteractive = !isNeverInteractive && (isEditable || inLink || states & STATE_SYSTEM_FOCUSABLE || states & STATE_SYSTEM_UNAVAILABLE || role == ROLE_SYSTEM_APPLICATION || role == ROLE_SYSTEM_DIALOG || role == IA2_ROLE_EMBEDDED_OBJECT);\r
        // We aren't finished calculating isInteractive yet; actions are handled below.\r
        // Whether the name is the content of this node.\r
        bool nameIsContent = role == ROLE_SYSTEM_LINK || role == ROLE_SYSTEM_PUSHBUTTON || role == IA2_ROLE_TOGGLE_BUTTON || role == ROLE_SYSTEM_MENUITEM || role == ROLE_SYSTEM_GRAPHIC || (role == ROLE_SYSTEM_TEXT && !isEditable) || role == IA2_ROLE_SECTION || role == IA2_ROLE_TEXT_FRAME || role == IA2_ROLE_HEADING || role == ROLE_SYSTEM_PAGETAB || role == ROLE_SYSTEM_BUTTONMENU;\r
@@ -510,7 +512,7 @@ VBufStorage_fieldNode_t* GeckoVBufBackend_t::fillVBuf(IAccessible2* pacc,
                                s<<i;\r
                                parentNode->addAttribute(attribName,s.str());\r
                                s.str(L"");\r
-                               if(wcscmp(actionName, L"click")==0||wcscmp(actionName, L"showlongdesc")==0) {\r
+                               if(!isNeverInteractive&&(wcscmp(actionName, L"click")==0||wcscmp(actionName, L"showlongdesc")==0)) {\r
                                        isInteractive=true;\r
                                }\r
                                SysFreeString(actionName);\r