Skip to content

Ensure not to maintain AccessibleTable2 when fetching child nodes when the underlying table has neither rows nor columns#12360

Merged
seanbudd merged 9 commits into
nvaccess:masterfrom
LeonarddeR:tableFix
May 12, 2021
Merged

Ensure not to maintain AccessibleTable2 when fetching child nodes when the underlying table has neither rows nor columns#12360
seanbudd merged 9 commits into
nvaccess:masterfrom
LeonarddeR:tableFix

Conversation

@LeonarddeR

@LeonarddeR LeonarddeR commented May 3, 2021

Copy link
Copy Markdown
Collaborator

Link to issue number:

Fixes #12359

Summary of the issue:

When creating a virtual buffer and NVDA encounters a table, it wil render the children of that table. It keeps a reference to the IAccessibleTable2 interface of the table until it has found a cell in that table. However, when a table contains no cells (i.e. when it has neither rows nor columns) and it encounters an inner table in that table, that inner table is ignored and table navigation does not work.

Description of how this pull request fixes the issue:

This pr ensures that when row and column count are 0, the IAccessibleTable2 reference isn't used when rendering children. Therefore, for every child, the logic that checks for IAccessibleTable2 will apply and issue #12359 no longer occurs.
As a bonus, I removed support for IAccessibleTable2 support. This support was left in the VBuf code to support older versions of Seamonkey. I verified that Seamonkey now uses a version of Gecko that also uses IAccessibleTable2.

Testing strategy:

Exampel attached to #12359 as wel as a private environment where this issue was prevalent.

Known issues with pull request:

None

Change log entries:

Bug fixes

Code Review Checklist:

  • Pull Request description is up to date.
  • Unit tests.
  • System (end to end) tests.
  • Manual tests.
  • User Documentation.
  • Change log entry.
  • Context sensitive help for GUI changes.

@LeonarddeR LeonarddeR requested a review from a team as a code owner May 3, 2021 11:40
@LeonarddeR LeonarddeR requested a review from seanbudd May 3, 2021 11:40
@lukaszgo1

Copy link
Copy Markdown
Contributor

As a bonus, I removed support for IAccessibleTable2 support. This support was left in the VBuf code to support older versions of Seamonkey. I verified that Seamonkey now uses a version of Gecko that also uses IAccessibleTable2.

What about Basilisk - it is quite popular in certain circles due to its compatibility with older style add-ons for Firefox and as far as I can see is still in active development?

@LeonarddeR

LeonarddeR commented May 3, 2021 via email

Copy link
Copy Markdown
Collaborator Author

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit da1193ed69

@Brian1Gaff

Brian1Gaff commented May 4, 2021 via email

Copy link
Copy Markdown

@LeonarddeR

LeonarddeR commented May 4, 2021 via email

Copy link
Copy Markdown
Collaborator Author

@LeonarddeR

Copy link
Copy Markdown
Collaborator Author

A similar case that can be used to reproduce, is by embedding a table in a div with a role of grid. I know that this is bad authoring practice, but currently NVDA gets pretty frustrated by these cases, whereas this pr properly announces the inner table. This is also reproducible in Firefox.

@MarcoZehe

Copy link
Copy Markdown
Contributor

Note that current WaterFox is built on Gecko 78, but is not supported by NVDA's virtual buffers because its main window class is "WaterFoxWindowClass", not "MozillaWindowClass", which NVDA checks for. So if you try WaterFox with this build or any NVDA build really, you won't get virtual buffers, but that has nothing to do with this PR.

Comment on lines +760 to +777
// Fetch row and column counts and add them as attributes on the vbuf node.
long rowCount = 0;
if (curNodePaccTable2->get_nRows(&rowCount) == S_OK) {
s << rowCount;
parentNode->addAttribute(L"table-rowcount", s.str());
s.str(L"");
}
long colCount = 0;
if (curNodePaccTable2->get_nColumns(&colCount) == S_OK) {
s << colCount;
parentNode->addAttribute(L"table-columncount", s.str());
s.str(L"");
}
if (rowCount > 0 || colCount > 0) {
// This table has rows and columns.
// Maintain curNodePaccTable2 for child rendering until any table cells are found.
paccTable2 = curNodePaccTable2;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this still be done in a helper function? It would be good to continue to split fillVBuf up.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be done in a helper function theoretically, but I'm afraid it will make the code less readable that way. Note that I removed this from a helper function because when it was a helper, it only fetched the row and column count to write it to the vbuf xml. Now the row and column count are used later on as well.

Comment thread nvdaHelper/vbufBackends/gecko_ia2/gecko_ia2.cpp Outdated
Co-authored-by: Sean Budd <seanbudd123@gmail.com>

@seanbudd seanbudd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @LeonarddeR

@seanbudd seanbudd merged commit 11b9950 into nvaccess:master May 12, 2021
@nvaccessAuto nvaccessAuto added this to the 2021.1 milestone May 12, 2021
@LeonarddeR LeonarddeR deleted the tableFix branch August 23, 2025 06:28
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.

Incorrect assumptions in Gecko VBuf break table navigation in some tables in Chromium

7 participants