Text alignment reporting and enhancements for MS Excel cells and MS Word text#15205
Merged
Conversation
…ord text. Excel noUIA: OK Excel UIA: not supported; nothing changed. Word with UIA: OK (left/right/center/justify). Note: Distributed not supported in UIA. Word no UIA: OK: Fixed "justified" -> "justify" and added "distribute" Not all the alignments are used; missing: wdAlignParagraphJustifyHi, wdAlignParagraphJustifyLow, wdAlignParagraphJustifyMed, wdAlignParagraphThaiJustify. (see https://docs.microsoft.com/en-us/office/vba/api/word.wdparagraphalignment) Test Firefox: - OK for left/right/center/justify. - See other values: justify-all, start, end, match - Test case: data:text/html,<p align="left">left</p><p align="right">right</p><p align="center">center</p><p align="justify">justify</p><p align="justify-all">justify-all</p><p align="start">start</p><p align="end">end</p><p align="match-parent">match-parent</p> - Code needs to be reworked (remove val and mozilla dic in general file).
Contributor
|
Hi Cyrille,
The last alignment is locale specific, see description on the provided page:
Justified according to Thai formatting layout.
So, to conclude: it is locale specific.
|
See test results for failed build of commit a6b775bafa |
Contributor
|
Alignment is not currently implemented in the Firefox accessibility cache. This is something we'll need to address. |
seanbudd
reviewed
Aug 18, 2023
Member
|
Thanks @CyrilleB79 - this is almost ready |
See test results for failed build of commit eadfe84bf7 |
Contributor
Author
|
@seanbudd all the review comments have been implemented; this PR is ready again. |
seanbudd
approved these changes
Aug 29, 2023
seanbudd
left a comment
Member
There was a problem hiding this comment.
Thanks, I'll get this merged soon
CyrilleB79
added a commit
to CyrilleB79/nvda
that referenced
this pull request
Aug 29, 2023
6 tasks
seanbudd
pushed a commit
that referenced
this pull request
Aug 30, 2023
Fix-up of #15205 Summary of the issue: While addressing #15205 review, deprecation code has been added. However, I have forgotten to update the initial description's change log paragraph to mention it. Description of user facing changes Updated change log with deprecation information. Note: a message will have to be sent to the API mailing list. While at it: Added formatting to the previous item of the change log. Fixed a missing end of list causing "Deprecation" paragraph title not being rendered correctly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Closes #15206
Closes #15220
Summary of the issue:
Various issues for alignment reporting:
Description of user facing changes
Reporting text alignment in Word and Excel is now handled better in various situations. "Default" is not reported anymore since it does not give any clear indication of the position of the text.
Description of development approach
Standardized alignments returned by
getFormatField*functions around a string enum as done in #11897. Thus, all the interfaces are impacted.Testing strategy:
Test plan based on #11897, adapted to this PR.
For the following APIs/files, the following test are made:
API/files tested:
* Test with Chrome:
data:text/html,<p align="left">left</p><p align="right">right</p><p align="center">center</p><p align="justify">justify</p>OK for left, right, center, justify and match-parent; NOK for experimental justify-all, start, end without or with this PR
* Edge (legacy)
OK for left, right, center, justify; NOK for experimental justify-all, start, end without or with this PR
ui.browseableMessage:* Test case:
ui.browseableMessage('''<p align="left">left</p><p align="right">right</p><p align="center">center</p><p align="justify">justify</p><p align="justify-all">justify-all</p><p align="start">start</p><p align="end">end</p><div align="center"><p align="match-parent">match-parent center</p></div>''', "Test", isHtml=True)* Result: no change with respect to NVDA 2023.2beta1, i.e. OK for left, right, center, justify; NOK for start, end and justify-all which are all reported as left.
Tests done with:
Special case of Firefox
A part of the work of this PR was done some time ago and was working with Firefox. Today the situation is the following:
I imagine that there may be an issue with latest Firefox versions regarding text alignment reporting. @jcsteh any information or confirmation of this?
Known issues with pull request:
With Word no UIA:
Not all the available alignments have been implemented. The following are missing: wdAlignParagraphJustifyHi, wdAlignParagraphJustifyLow, wdAlignParagraphJustifyMed, wdAlignParagraphThaiJustify. They were not supported before by NVDA and do not know how to use them; maybe with some specific locale?
(see https://docs.microsoft.com/en-us/office/vba/api/word.wdparagraphalignment)
If there is a need to implement them in the future, it should be quite easy.
Word with UIA: "distribute" is reported as "justify", since "distribute" does not seem to be a supported alignment in UIA.
In Excel with UIA, text alignment is not supported at all today (in NVDA 2023.2beta1). This PR does not add the support for text alignment in Excel with UIA.
Text alignment reporting is not supported by NVDA in:
This PR does not improve it.
text-align="justify-all"is not supported by any browser. NVDA reports it as "left" before and after this PR.Change log entries:
Bug fixes
In Word and Excel, text alignment will be correctly reported in more situations. (#15206, #15220)Code Review Checklist: