Skip to content

Fix-up #14070: No more error at edge of table with MSHtml#14298

Merged
seanbudd merged 2 commits into
nvaccess:betafrom
CyrilleB79:msHtmlTableNav
Oct 26, 2022
Merged

Fix-up #14070: No more error at edge of table with MSHtml#14298
seanbudd merged 2 commits into
nvaccess:betafrom
CyrilleB79:msHtmlTableNav

Conversation

@CyrilleB79

Copy link
Copy Markdown
Contributor

Opened against beta branch since it fixes a non-released code.

Link to issue number:

None

Summary of the issue:

In MSHtml container, e.g. NVDA's browseable message, the table edge is not reported. The following error is found instead:

ERROR - scriptHandler.executeScript (23:32:09.385) - MainThread (6444):
error executing script: <bound method DocumentWithTableNavigation.script_nextColumn of <virtualBuffers.MSHTML.MSHTML object at 0x0953F690>> with gesture 'alt+contrôle+flèche droite'
Traceback (most recent call last):
  File "scriptHandler.pyc", line 289, in executeScript
  File "documentBase.pyc", line 480, in script_nextColumn
  File "documentBase.pyc", line 417, in _tableMovementScriptHelper
  File "documentBase.pyc", line 362, in _tableFindNewCell
  File "virtualBuffers\__init__.pyc", line 674, in _getNearestTableCell
TypeError: cannot unpack non-iterable _TableCell object

Description of user facing changes

No more error reported at edge and the edge is reported.

Description of development approach

The dataclass documentBase._TableCell was added in #14070. More specifically, DocumentWithTableNavigation._getTableCellCoords now returns _TableCell. But some usages of the return of this function have been forgotten.
This PR fixes this.

Testing strategy:

Manual testing:
In the console, paste the following script:

import ui
s = "<table><thead><tr><th>A</th><th>B</th></tr></thead><tbody><tr><td>C</td><td>D</td></tr></tbody></table>"
ui.browseableMessage(s, isHtml=True)

Then navigate in the table with all possible gestures:

  • control+alt+arrows
  • control+alt+pgUp/pgDown/Home/End
  • NVDA+control+alt+arrows

Known issues with pull request:

None

Change log entries:

Not needed, unreleased bug.

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • Security precautions taken.

@CyrilleB79 CyrilleB79 marked this pull request as ready for review October 25, 2022 22:14
@CyrilleB79 CyrilleB79 requested a review from a team as a code owner October 25, 2022 22:14
@CyrilleB79 CyrilleB79 requested a review from seanbudd October 25, 2022 22:14
@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit b5601d78ba

@seanbudd seanbudd changed the base branch from master to beta October 25, 2022 23:35
@seanbudd seanbudd added this to the 2022.4 milestone Oct 25, 2022
seanbudd
seanbudd previously approved these changes Oct 25, 2022
Comment thread source/virtualBuffers/__init__.py Outdated
Comment thread source/virtualBuffers/__init__.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants