-
-
Notifications
You must be signed in to change notification settings - Fork 642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix up of: Fix up of: Don't announce 'selected' when the focus moves in Google sheets if the focused cell is the only cell selected (#8898) #10080
Conversation
…in Google sheets if the focused cell is the only cell selected (nvaccess#8898)
HTMLNode=self.HTMLNode | ||
while HTMLNode: | ||
nodeName=HTMLNode.nodeName | ||
if nodeName: | ||
nodeName=nodeName.upper() | ||
if nodeName=="TABLE": return MSHTML(HTMLNode=HTMLNode) | ||
HTMLNode=HTMLNode.parentNode | ||
raise NotImplementedError | ||
return None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder whether this should be logged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, it shouldn't: This None
is not an error, but rather a piece of information.
If the object is not part of a table, the other IAccessible implementations in NVDA simply return None
without a notice.
@@ -954,15 +954,15 @@ def setFocus(self): | |||
|
|||
def _get_table(self): | |||
if self.role not in (controlTypes.ROLE_TABLECELL,controlTypes.ROLE_TABLEROW) or not self.HTMLNode: | |||
raise NotImplementedError | |||
return None | |||
HTMLNode=self.HTMLNode | |||
while HTMLNode: | |||
nodeName=HTMLNode.nodeName | |||
if nodeName: | |||
nodeName=nodeName.upper() | |||
if nodeName=="TABLE": return MSHTML(HTMLNode=HTMLNode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not support aria based tables (e.g. role grid). I don't think that's a problem, though it might deserve a change or a comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not much aware of the aria based tables support, but please feel free to propose any useful comment to insert here.
As long as this PR does not change a thing in that scope - that is, no client code is expecting a NotImplementedError
- I would suppose that further refining the process is out of the scope of this PR, don't you think?
@JulienCochuyt I assume in the changelog you meant "table header" not "tab header"? Just checking before I merge and add that message to the changes file. |
No, I indeed really meant "tab" header, aka. tab control, the control which allows to select a tab panel. |
Ah, okay :) thanks for confirming.
|
Link to issue number:
Fixes #9520
Fixes #7292 (comment) (only the error log in the comment, not the whole issue).
Faulty behavior introduced as of b02ed2d (#8898)
Summary of the issue:
MSHTML._get_table
historically raises aNotImplementedError
when there is no surrounding table.IAccessible._get_table
, on the other hand, returnsNone
in the same situation.IAccessible._get_selectionContainer
, introduced by b02ed2d, callsself.table
which can lead to the following error log:Description of how this pull request fixes the issue:
Return
None
instead of raisingNotImplementedError
inMSHTML._get_table
, in coherence with its base class.Testing performed:
Browsed with IE11 under Windows 10 to http://www.w3.org/TR/wai-aria-practices/examples/tabs/tabs-1/tabs.html (which is the test case of #9520 and report focus on the example tab header.
Known issues with pull request:
This approach can theoretically break existing assumption of the method raising the exception, but other IAccessible implementation have been recently much more tested and return
None
in the same case.So, I guess it is safer to apply the proposed change than to track every single call to
_get_table
and enclose in atry...except
block, with the risk of missing a few of them in the process.Change log entry:
Section: Bug fixes
NVDA is no longer silent when focusing an HTML tab header in Internet Explorer.