-
-
Notifications
You must be signed in to change notification settings - Fork 716
Text alignment reporting and enhancements for MS Excel cells and MS Word text #15205
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
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).
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 |
Alignment is not currently implemented in the Firefox accessibility cache. This is something we'll need to address. |
Thanks @CyrilleB79 - this is almost ready |
See test results for failed build of commit eadfe84bf7 |
@seanbudd all the review comments have been implemented; this PR is ready again. |
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.
Thanks, I'll get this merged soon
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
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: