Skip to content

Contenteditable table headers#15977

Merged
SaschaCowley merged 16 commits into
nvaccess:masterfrom
SaschaCowley:conteditable_table_headers
Feb 7, 2024
Merged

Contenteditable table headers#15977
SaschaCowley merged 16 commits into
nvaccess:masterfrom
SaschaCowley:conteditable_table_headers

Conversation

@SaschaCowley

@SaschaCowley SaschaCowley commented Dec 28, 2023

Copy link
Copy Markdown
Member

Link to issue number:

Fixes #14113

Summary of the issue:

When navigating tables in contenteditable HTML elements in focus mode, table row and column headers are not reported.

Description of user facing changes

Table row and column headers are now reported when navigating tables in contenteditable HTML elements in focus mode.

Description of development approach

Added appropriate fields to the TextInfos.ControlField returned by CompoundTextInfo._getControlFieldForObject. Also added special case handling for Chromium, which erroneously reports heder cells as being their own headers.

Testing strategy:

Ran unit tests. Manually tested with a basic contenteditable table with row and column headers in Firefox and Edge.

Known issues with pull request:

None.

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation -- unnecessary
    • Developer / Technical Documentation -- unnecessary
    • Context sensitive help for GUI changes -- unnecessary
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken. -- None should be needed

@Adriani90

Adriani90 commented Dec 28, 2023

Copy link
Copy Markdown
Collaborator

@SaschaCowley welcome to the NVDA project, and thank you very much for the contribution so far.
ctrl+alt+arrow keys navigates html tables in browse mode, not in focus mode. I guess the description in the referenced issue is talking about browse mode. Or am I wrong?

This should be tested in the Wordweb as well, so using an MS Office 365 account with Word Online should report table headers both in focus and in browse mode ideally.
Word Online is build based on content editable HTML elements, so it is a quite good use case to test content editable HTML elements support in NVDA.

@Adriani90

Copy link
Copy Markdown
Collaborator

In Edge, row and column headers are reported even when on the row header or column header cell, meaning the cell's contents are spoken twice.

Is this also happening when using UIA for Edge and Chrome in NVDA advanced settings?

@SaschaCowley

Copy link
Copy Markdown
Member Author

ctrl+alt+arrow keys navigates html tables in browse mode, not in focus mode. I guess the description in the referenced issue is talking about browse mode. Or am I wrong?

Ctrl+Alt+arrow keys navigates focused tables in focus mode, at least in contenteditable tables. See for example the demo provided by Mick in the original issue

This should be tested in the Wordweb as well, so using an MS Office 365 account with Word Online should report table headers both in focus and in browse mode ideally.

Great, I'll give this a try and report back.

In Edge, row and column headers are reported even when on the row header or column header cell, meaning the cell's contents are spoken twice.

Is this also happening when using UIA for Edge and Chrome in NVDA advanced settings?

When forcing the use of UIA in Edge, the double speaking of row and column headers does not occur. However, navigation by Alt+Ctrl+arrow keys stops working. I suspect this is a case of those scripts not being bound in that context. I can't seem to find an issue about this, does one exist already that we know of, or should I go ahead and creat one?

@michaelDCurran

michaelDCurran commented Dec 30, 2023

Copy link
Copy Markdown
Member

I don't think this PR needs to worry about Edge with UIA -- there are multiple issues there, which should be handled separately. Specifically:

  • NVDA does not provide table navigation commands on editable text or contenteditable nodes in Chromium when using UIA. This could in theory be solved by having NVDAObjects.UIA.chromium.ChromiumUIA also inherit from documentBase.DocumentWithTableNavigation.
  • A quick test also shows that the _getTableCellAt method which DocumentWithTableNavigation expects, may not yet be implemented for UIA.
  • The same code that was made in this PR (exposing row header and column header text) would also need to be made in NVDAObjects.UIA.UIATextInfo._getControlFieldForUIAObject.
    So don't worry about Edge with UIA for this PR.

However, the issue with multiple reporting of row and column headers on header elements in Edge / chrome (without using UIA) probably should be handled in this PR (or another that blocks this one), as it becomes more noticeable.
Technically I think the bug is with Chromium for inappropriately exposing the same IAccessible2 object as its own column or row header.
But we could work around this perhaps in NVDAObjects.IAccessible.IAccessible._tableHeaderTextHelper by filtering out headers that have the same IAccessible2::uniqueID as the object whose headers we are fetching.

@SaschaCowley

Copy link
Copy Markdown
Member Author

However, the issue with multiple reporting of row and column headers on header elements in Edge / chrome (without using UIA) probably should be handled in this PR (or another that blocks this one), as it becomes more noticeable. Technically I think the bug is with Chromium for inappropriately exposing the same IAccessible2 object as its own column or row header. But we could work around this perhaps in NVDAObjects.IAccessible.IAccessible._tableHeaderTextHelper by filtering out headers that have the same IAccessible2::uniqueID as the object whose headers we are fetching.

I have implemented this, and all seems to be working properly (based on manual and unit testing).

@michaelDCurran michaelDCurran 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.

Looking good. But a few review comments.

Comment thread source/NVDAObjects/IAccessible/__init__.py Outdated
Comment thread source/NVDAObjects/IAccessible/__init__.py Outdated
Comment thread source/NVDAObjects/IAccessible/__init__.py Outdated
Comment thread source/NVDAObjects/IAccessible/__init__.py Outdated
@seanbudd seanbudd added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Jan 8, 2024
@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit e45c984413

@SaschaCowley

Copy link
Copy Markdown
Member Author

This should be tested in the Wordweb as well, so using an MS Office 365 account with Word Online should report table headers both in focus and in browse mode ideally. Word Online is build based on content editable HTML elements, so it is a quite good use case to test content editable HTML elements support in NVDA.
I am getting errors unrelated to this PR (Identical when running from source or 2023.3) when attempting to navigate tables in focus mode in Word Web in Edge, so I suggest this not be a major point of testing for now. The PR seems to be working otherwise.

Comment thread source/NVDAObjects/IAccessible/__init__.py Outdated
@michaelDCurran

michaelDCurran commented Jan 15, 2024 via email

Copy link
Copy Markdown
Member

Comment thread source/NVDAObjects/IAccessible/__init__.py Outdated
Comment thread source/compoundDocuments.py Outdated
Sascha Cowley and others added 3 commits January 31, 2024 13:12
@SaschaCowley SaschaCowley marked this pull request as ready for review January 31, 2024 02:27
@SaschaCowley SaschaCowley requested a review from a team as a code owner January 31, 2024 02:27
@gerald-hartig

Copy link
Copy Markdown
Contributor

Although I've approved it, please make sure you get @seanbudd to sign off on it too!

@michaelDCurran michaelDCurran 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.

Looks like some extra blank lines were added to changes.t2t?

Comment thread user_docs/en/changes.t2t Outdated
Comment thread user_docs/en/changes.t2t Outdated
@seanbudd

Copy link
Copy Markdown
Member

Please add "Fixes" before the issue number so GitHub automatically links the PR and issue.
Also please mark the final code review checklist items as checked, I assume you have manually tested the latest code changes?

Co-authored-by: Michael Curran <mick@nvaccess.org>
@seanbudd

seanbudd commented Jan 31, 2024

Copy link
Copy Markdown
Member

This PR can be merged when you are ready, the build passes and the description is up to date.
When merging PRs we generally perform a "squash merge" and copy paste the PR description into the commit message.
We use the following sections in the commit message:

  • Link to issue number
  • Summary of the issue
  • Description of user facing changes
  • Description of development approach
  • And if there are known issues, Known issues with pull request

So usually this is just copying the first 4 items, and sometimes the known issues.
You can check the master commit history for examples

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 367e7a517b

@SaschaCowley

Copy link
Copy Markdown
Member Author

Please add "Fixes" before the issue number so GitHub automatically links the PR and issue.
Where do you mean?

@seanbudd

Copy link
Copy Markdown
Member

No problem:

For example:

### Link to issue number:
Fixes #14113

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 367e7a517b

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 367e7a517b

@SaschaCowley SaschaCowley merged commit 65ddfb6 into nvaccess:master Feb 7, 2024
@nvaccessAuto nvaccessAuto added this to the 2024.2 milestone Feb 7, 2024
@josephsl

josephsl commented Feb 7, 2024

Copy link
Copy Markdown
Contributor

Hi,

Wait, how was the merge possible (was Sascha approved to merge this PR)? Isn't it usually NV Access folks who can merge PR's? Just curious.
Thanks.

@seanbudd

seanbudd commented Feb 7, 2024

Copy link
Copy Markdown
Member

@SaschaCowley is our newest member of NV Access - I think further introductions will come in future

@josephsl

josephsl commented Feb 7, 2024 via email

Copy link
Copy Markdown
Contributor

@cary-rowen

Copy link
Copy Markdown
Contributor

wow, welcome @SaschaCowley

@SaschaCowley

Copy link
Copy Markdown
Member Author

Thanks, @josephsl and @cary-rowen, I'm excited to be here.

@XLTechie

XLTechie commented Feb 7, 2024 via email

Copy link
Copy Markdown
Collaborator

Nael-Sayegh pushed a commit to Nael-Sayegh/nvda that referenced this pull request Feb 15, 2024
Fixes nvaccess#14113 

Summary of the issue:
When navigating tables in contenteditable HTML elements in focus mode, table row and column headers are not reported.

Description of user facing changes
Table row and column headers are now reported when navigating tables in contenteditable HTML elements in focus mode.

Description of development approach
Added appropriate fields to the `TextInfos.ControlField` returned by `CompoundTextInfo._getControlFieldForObject`. Also added special case handling for Chromium, which erroneously reports heder cells as being their own headers.
Adriani90 pushed a commit to Adriani90/nvda that referenced this pull request Mar 13, 2024
Fixes nvaccess#14113 

Summary of the issue:
When navigating tables in contenteditable HTML elements in focus mode, table row and column headers are not reported.

Description of user facing changes
Table row and column headers are now reported when navigating tables in contenteditable HTML elements in focus mode.

Description of development approach
Added appropriate fields to the `TextInfos.ControlField` returned by `CompoundTextInfo._getControlFieldForObject`. Also added special case handling for Chromium, which erroneously reports heder cells as being their own headers.
@SaschaCowley SaschaCowley deleted the conteditable_table_headers branch August 22, 2024 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for reporting row and column headers in contenteditable HTML elements.

10 participants