OSDN Git Service

MSHTML VBufBackend: look at IHTMLCurrentStyle::listStyleType to choose whether...
authorMichael Curran <mick@kulgan.net>
Tue, 26 Jul 2011 03:59:13 +0000 (13:59 +1000)
committerMichael Curran <mick@kulgan.net>
Tue, 26 Jul 2011 03:59:13 +0000 (13:59 +1000)
nvdaHelper/vbufBackends/mshtml/mshtml.cpp
user_docs/en/changes.t2t

index 6caab86..fe8a39e 100755 (executable)
@@ -357,7 +357,7 @@ inline wstring getTextFromHTMLDOMNode(IHTMLDOMNode* pHTMLDOMNode, bool allowPref
        }\\r
 }\r
 \r
-inline void getCurrentStyleInfoFromHTMLDOMNode(IHTMLDOMNode* pHTMLDOMNode, bool& invisible, bool& isBlock) {\r
+inline void getCurrentStyleInfoFromHTMLDOMNode(IHTMLDOMNode* pHTMLDOMNode, bool& invisible, bool& isBlock, wstring& listStyle) {\r
        BSTR tempBSTR=NULL;\r
        IHTMLElement2* pHTMLElement2=NULL;\r
        int res=pHTMLDOMNode->QueryInterface(IID_IHTMLElement2,(void**)&pHTMLElement2);\r
@@ -393,6 +393,12 @@ inline void getCurrentStyleInfoFromHTMLDOMNode(IHTMLDOMNode* pHTMLDOMNode, bool&
        } else {\r
                LOG_DEBUG(L"Failed to get display");\r
        }\r
+       BSTR _listStyle;\r
+       pHTMLCurrentStyle->get_listStyleType(&_listStyle);\r
+       if(_listStyle) {\r
+               listStyle.append(_listStyle);\r
+               SysFreeString(_listStyle);\r
+       }\r
        if (pHTMLCurrentStyle) pHTMLCurrentStyle->Release();\r
 }\r
 \r
@@ -668,8 +674,8 @@ VBufStorage_fieldNode_t* MshtmlVBufBackend_t::fillVBuf(VBufStorage_buffer_t* buf
        //Find out block and visibility style\r
        bool invisible=false;\r
        bool isBlock=true;\r
-       getCurrentStyleInfoFromHTMLDOMNode(pHTMLDOMNode, invisible, isBlock);\r
-\r
+       wstring listStyle;\r
+       getCurrentStyleInfoFromHTMLDOMNode(pHTMLDOMNode, invisible, isBlock,listStyle);\r
        LOG_DEBUG(L"Trying to get IHTMLDOMNode::nodeName");\r
        if(pHTMLDOMNode->get_nodeName(&tempBSTR)!=S_OK||!tempBSTR) {\r
                LOG_DEBUG(L"Failed to get IHTMLDOMNode::nodeName");\r
@@ -784,11 +790,11 @@ VBufStorage_fieldNode_t* MshtmlVBufBackend_t::fillVBuf(VBufStorage_buffer_t* buf
        bool isInteractive=isEditable||(IAStates&STATE_SYSTEM_FOCUSABLE)||(IAStates&STATE_SYSTEM_LINKED)||(attribsMap.find(L"HTMLAttrib::onclick")!=attribsMap.end())||(attribsMap.find(L"HTMLAttrib::onmouseup")!=attribsMap.end())||(attribsMap.find(L"HTMLAttrib::onmousedown")!=attribsMap.end());\r
        //Set up numbering for lists\r
        int LIIndex=0;\r
-       if(nodeName.compare(L"OL")==0) {\r
+       if(nodeName.compare(L"OL")==0||nodeName.compare(L"UL")==0) {\r
                //Ordered lists should number their list items\r
                LIIndex=1;\r
                LIIndexPtr=&LIIndex;\r
-       } else if((nodeName.compare(L"UL")==0||nodeName.compare(L"DL")==0)) {\r
+       } else if(nodeName.compare(L"DL")==0) {\r
                //Unordered lists should not be numbered\r
                LIIndexPtr=NULL;\r
        }\r
@@ -810,15 +816,15 @@ VBufStorage_fieldNode_t* MshtmlVBufBackend_t::fillVBuf(VBufStorage_buffer_t* buf
                contentString=L" ";\r
        } else if(nodeName.compare(L"LI")==0) {\r
                renderChildren=true;\r
-               if(LIIndexPtr!=NULL) {\r
+               if(listStyle.compare(L"disc")==0||listStyle.compare(L"circle")==0||listStyle.compare(L"square")==0) {\r
                        tempStringStream.str(L"");\r
-                       tempStringStream<<*LIIndexPtr<<L". ";\r
+                       tempStringStream<<L"\x2022 "; //Bullet\r
                        contentString=tempStringStream.str();\r
-                       ++(*LIIndexPtr);\r
-               } else {\r
+               } else if(LIIndexPtr!=NULL&&!listStyle.empty()&&listStyle.compare(L"none")!=0) {\r
                        tempStringStream.str(L"");\r
-                       tempStringStream<<L"\x2022 "; //Bullet\r
+                       tempStringStream<<*LIIndexPtr<<L". ";\r
                        contentString=tempStringStream.str();\r
+                       ++(*LIIndexPtr);\r
                }\r
        } else if(nodeName.compare(L"TABLE")==0) {\r
                renderChildren=true;\r
index af767fd..b76180c 100644 (file)
@@ -9,6 +9,10 @@
 - In Mozilla Gecko (e.g. Firefox) Heading levels are now announced  in object navigation.\r
 \r
 \r
+== Bug Fixes ==\r
+- NVDA  no longer shows bullets or numbering for lists in Internet Explorer and other MSHTML controls when the list style is "none". \r
+\r
+\r
 = 2011.2 =\r
 Highlights of this release include major improvements concerning punctuation and symbols, including configurable levels, custom labelling and character descriptions; no pauses at the end of lines during say all; improved support for ARIA in Internet Explorer; better support for XFA/LiveCycle PDF documents in Adobe Reader; access to text written to the screen in more applications; and access to formatting and color information for text written to the screen.\r
 \r