nvda
533ee864 - speech.getControlFieldSpeech: avoid exception which stops a line from being read. (#18130)

Commit
346 days ago
speech.getControlFieldSpeech: avoid exception which stops a line from being read. (#18130) Summary of the issue: When trying to read some lines in Chomium, such as a list item with a checkbox at the start, the following traceback is produced and the line is not read: ``` ERROR - scriptHandler.executeScript (07:47:48.801) - MainThread (22912): error executing script: <bound method EditableText.script_caret_moveByLine of <NVDAObjects.Dynamic_EditorEditableTextWithAutoSelectDetectionEditorIa2WebIAccessible object at 0x05DBB2F0>> with gesture 'down arrow' Traceback (most recent call last): File "scriptHandler.pyc", line 300, in executeScript File "editableText.pyc", line 268, in script_caret_moveByLine File "editableText.pyc", line 192, in _caretMovementScriptHelper File "NVDAObjects\behaviors.pyc", line 254, in _caretScriptPostMovedHelper File "editableText.pyc", line 178, in _caretScriptPostMovedHelper File "speech\speech.pyc", line 1483, in speakTextInfo File "speech\types.pyc", line 47, in __iter__ File "speech\speech.pyc", line 1678, in getTextInfoSpeech AttributeError: 'FieldCommand' object has no attribute 'isspace' ``` The code assumes the next field in the list is a string, but in this case it is a controlEnd (from a checkbox with no content inside). Description of user facing changes NVDA no longer refuses to read a line in Google Chrome / Edge where a list item starts with a checkbox, such as within a check list in Microsoft Loop. Description of development approach Ensure the field is an str before calling isspace or strip. Testing strategy: In Google Chrome, read the line produced by: ``` <div contenteditable="true"> <p>Start</p> <ul style="list-style-type: none"> <li><input contenteditable="false" type="checkbox" /> Item 1</li> </ul> <p>end</p> </div> ``` Known issues with pull request: In this case, the specific code here that is meant to speak the string as a single character will not run. But this is a very rare case, and it is arguable that the browser content and or control fields may be wrong here anyway. At least we will still speak the line and not cause an exception.
Parents
Loading