OSDN Git Service

webKit vbuf backend: Never render the name for editable text fields and combo boxes...
authorJames Teh <jamie@jantrid.net>
Tue, 6 Dec 2011 11:00:34 +0000 (21:00 +1000)
committerJames Teh <jamie@jantrid.net>
Tue, 6 Dec 2011 11:00:34 +0000 (21:00 +1000)
nvdaHelper/vbufBackends/webKit/webKit.cpp

index f891c72..d8812eb 100644 (file)
@@ -170,17 +170,19 @@ VBufStorage_fieldNode_t* WebKitVBufBackend_t::fillVBuf(int docHandle, IAccessibl
                free(varChildren);\r
        } else {\r
 \r
-               // No children, so this is a text leaf node.\r
+               // No children, so fetch content from this leaf node.\r
                BSTR tempBstr = NULL;\r
                wstring content;\r
 \r
-               if (pacc->get_accName(varChild, &tempBstr) == S_OK) {\r
+               if ((role != ROLE_SYSTEM_TEXT || !(states & STATE_SYSTEM_FOCUSABLE)) && role != ROLE_SYSTEM_COMBOBOX\r
+                               && pacc->get_accName(varChild, &tempBstr) == S_OK && tempBstr) {\r
                        content = tempBstr;\r
                        SysFreeString(tempBstr);\r
-               } else if (pacc->get_accValue(varChild, &tempBstr) == S_OK) {\r
+               } else if (pacc->get_accValue(varChild, &tempBstr) == S_OK && tempBstr) {\r
                        content = tempBstr;\r
                        SysFreeString(tempBstr);\r
-               } else if (states & STATE_SYSTEM_FOCUSABLE) {\r
+               }\r
+               if (content.empty() && states & STATE_SYSTEM_FOCUSABLE) {\r
                        // This node is focusable, but contains no text.\r
                        // Therefore, add it with a space so that the user can get to it.\r
                        content = L" ";\r