Merge pull request #18416 from LeonarddeR/IA2DebugLog
Summary of the issue:
Several properties on IAccessible objects call the _getIA2RelationFirstTarget method without checking whether we're really dealing with an IA2 object. This results in unnecessary and verbose debug warnings:
DEBUGWARNING - NVDAObjects.IAccessible.IAccessible._getIA2RelationFirstTarget (14:36:37.817) - MainThread (14260):
Unable to use _getIA2TargetsForRelationsOfType, fallback to _IA2Relations.
Description of user facing changes:
Less debug warnings.
Description of developer facing changes:
None
Description of development approach:
For every property that calls _getIA2RelationFirstTarget, check whether the object is IA2
Call super when not IA2. This changes behavior for the flowsFrom and flowsTo properties on MSAA objects. These will now raise a NotImplementedError, which is in line with what NVDAObject does by default. Therefore I don't think this can be considered API breaking, rather the behavior of the IAccessible implementation was inconsistent and misleading. Note that flowsFrom and flowsTo raise NotImplementedError for UIA objects, too.