Skip to content

Commit

Permalink
No longer fail to report content of unfocused text fields in Firefox (#…
Browse files Browse the repository at this point in the history
…12319)

Fixes #12114

PR #12025 started catching only very specific exceptions when getting selection of edit fields. However in Firefox attempting to get caret for non focused edit fields results in RuntimeError which made it impossible to speak these controls.

Description of how this pull request fixes the issue:
When getting content of edit fields in speech, we're now catching RuntimeError as well and treating this situation like no selection.
  • Loading branch information
lukaszgo1 authored Apr 21, 2021
1 parent 330961c commit a94f5fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/speech/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ def getObjectSpeech( # noqa: C901
if shouldReportTextContent:
try:
info = obj.makeTextInfo(textInfos.POSITION_SELECTION)
except NotImplementedError:
except (NotImplementedError, RuntimeError):
info = None
if info and not info.isCollapsed:
# if there is selected text, then there is a value and we do not report placeholder
Expand Down

0 comments on commit a94f5fe

Please sign in to comment.