Repository: nvaccess/nvda

Issue:
Unable to implement fake table navigation in a list

### Steps to reproduce:

In my Outlook Extended add-on V1.4, I have implemented fake table navigation in the address book results list by creating a custom class inheriting from RowWithoutCellObjects and RowWithFakeNavigation from behaviors.py.
This class implements the required method _getColumnContent as well as the optional method _getColumnHeader.
This was working with NVDA 2019.2 as well as with early Py3 alpha versions. However, this feature was broken in NVDA 2019.3.
Although documented as optional, I have had to implement _getColumnLocation to fix the issue (fixed in V1.5).

### Actual behavior:

RowWithoutCellObjects._getColumnLocation is documented as optional in behaviors.py

### Expected behavior:

RowWithoutCellObjects._getColumnLocation implementation in subclasses should be documented as mandatory.

An other alternative would be not to add INVISIBLE state to a _FakeTableCell if _FakeTableCell._get_location does not return a location (i.e. returns None). I do not know however how the navigator object highlight would behave in this case.

### Technical background

This doc mismatch was introduced with the following commit:
```commit dbb1cf1e5e5f3f6b7895a12b037cc16b5f107f37
Author: Leonard de Ruijter <leonardder@users.noreply.github.com>
Date:   Tue Sep 17 09:11:21 2019 +0200
    Hide invisible columns in syslistview32 lists (#9873)
```



### System configuration
#### NVDA installed/portable/running from source:
installed

#### NVDA version:
2019.3.1
#### Windows version:
10
#### Name and version of other software in use when reproducing the issue:
N/A
#### Other information about your system:
N/A
### Other questions
#### Does the issue still occur after restarting your computer?
yes
#### Have you tried any other versions of NVDA? If so, please report their behaviors.
Yes. NVDA2019.2.1 is OK.
#### If addons are disabled, is your problem still occuring?
N/A
#### Did you try to run the COM registry fixing tool in NVDA menu / tools?
N/A



Discussion:
I did not yet provide a PR to fix this because I would like to agree on what should be implemented: change RowWithoutCellObjects._getColumnLocation  documentation to so that its implementation should be mandatory or change _FakeTableCell._get_state implementation.

@leonardder, since you have implemented the commit, could you provide feedback on the alternative you would prefer? You could also comment on the nav object highlight question.
Thanks
CC @LeonardDer

 

From: CyrilleB79 <notifications@github.com> 
Sent: Tuesday, March 10, 2020 2:36 AM
To: nvaccess/nvda <nvda@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: [nvaccess/nvda] Unable to implement fake table navigation in a list (#10864)

 


Steps to reproduce:


In my Outlook Extended add-on V1.4, I have implemented fake table navigation in the address book results list by creating a custom class inheriting from RowWithoutCellObjects and RowWithFakeNavigation from behaviors.py.
This class implements the required method _getColumnContent as well as the optional method _getColumnHeader.
This was working with NVDA 2019.2 as well as with early Py3 alpha versions. However, this feature was broken in NVDA 2019.3.
Although documented as optional, I have had to implement _getColumnLocation to fix the issue (fixed in V1.5).


Actual behavior:


RowWithoutCellObjects._getColumnLocation is documented as optional in behaviors.py


Expected behavior:


RowWithoutCellObjects._getColumnLocation implementation in subclasses should be documented as mandatory.

An other alternative would be not to add INVISIBLE state to a _FakeTableCell if _FakeTableCell._get_location does not return a location (i.e. returns None). I do not know however how the navigator object highlight would behave in this case.


Technical background


This doc mismatch was introduced with the following commit:

Author: Leonard de Ruijter <leonardder@users.noreply.github.com>
Date:   Tue Sep 17 09:11:21 2019 +0200
    Hide invisible columns in syslistview32 lists (#9873)

System configuration


NVDA installed/portable/running from source:


installed


NVDA version:


2019.3.1


Windows version:


10


Name and version of other software in use when reproducing the issue:


N/A


Other information about your system:


N/A


Other questions


Does the issue still occur after restarting your computer?


yes


Have you tried any other versions of NVDA? If so, please report their behaviors.


Yes. NVDA2019.2.1 is OK.


If addons are disabled, is your problem still occuring?


N/A


Did you try to run the COM registry fixing tool in NVDA menu / tools?


N/A

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <https://github.com/nvaccess/nvda/issues/10864?email_source=notifications&email_token=AB4AXEFQY66JNRDG5TUN62TRGYCY7A5CNFSM4LE2VXRKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IT2NQBQ> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AB4AXEAOZYLPGCAWH6Q5CSTRGYCY7ANCNFSM4LE2VXRA> .


Ugh, this side effect was unintended. I think a solution should be among the lines of:uggest

* Change the _get_states impl as you suggested. If location is None, hasIrrelevantLocation is true and the highlighter should ignore it.
* I actually think that the default of beTransparentToMouse should be hasIrrelevantLocation, since the mouse could never be on those objects.

Resolving patch:
diff --git a/source/NVDAObjects/behaviors.py b/source/NVDAObjects/behaviors.py
--- a/source/NVDAObjects/behaviors.py
+++ b/source/NVDAObjects/behaviors.py
@@ -583,7 +583,7 @@ def script_moveToNextColumn(self, gesture):
 			return
 		else:
 			new = cur.next
-		while new and new.hasIrrelevantLocation:
+		while new and new.location and new.location.width == 0:
 			new = new.next
 		self._moveToColumn(new)
 	script_moveToNextColumn.canPropagate = True
@@ -598,7 +598,7 @@ def script_moveToPreviousColumn(self, gesture):
 			new = self
 		else:
 			new = cur.previous
-			while new and new.hasIrrelevantLocation:
+			while new and new.location and new.location.width == 0:
 				new = new.previous
 		self._moveToColumn(new)
 	script_moveToPreviousColumn.canPropagate = True
@@ -642,7 +642,8 @@ def script_moveToPreviousRow(self, gesture):
 class RowWithoutCellObjects(NVDAObject):
 	"""An abstract class which creates cell objects for table rows which don't natively expose them.
 	Subclasses must override L{_getColumnContent} and can optionally override L{_getColumnHeader}
-	to retrieve information about individual columns.
+	to retrieve information about individual columns and L{_getColumnLocation} to support mouse or
+	magnification tracking or highlighting.
 	The parent (table) must support the L{columnCount} property.
 	"""
 
@@ -735,7 +736,7 @@ def _get_tableID(self):
 
 	def _get_states(self):
 		states = self.parent.states.copy()
-		if not self.location or self.location.width == 0:
+		if self.location and self.location.width == 0:
 			states.add(controlTypes.STATE_INVISIBLE)
 		return states
 


Test patch: