Do not report "baseline" on formatting information request#11897
Conversation
…ed anymore since it is considered as the default text position. It is still reported on cursor movement if report superscript and subscript option is activated in document formatting options.
feerrenrut
left a comment
There was a problem hiding this comment.
Generally this looks good, thanks @CyrilleB79. Add in that comment and I think this is good to go.
|
Regarding IA2TextTextInfo, the function What I can suggest for this PR is at least:
Optionally I may also normalize the text-position attribute of IA2TextTextInfo to 'sub' or 'super' only, depending to your comments on this topic. At last, in future PRs, I may fix some other issues encountered thanks to the warning I will have added in this PR. |
|
To clarify, Internet Explorer does not use IAccessible2. Rather we get the value for text-position directly from the CSS vertical-align property: see https://developer.mozilla.org/en-US/docs/Web/CSS/vertical-align for a list of all possible vertical-align values. |
…ing for other values. No 'text-info' attribute at all is expected for baseline (being default value).
…IATextInfo , SymphonyTextInfo).
…er than 'sub' or 'super'.
|
I have addressed the majority of the comments. Two points / questions are still pending:
|
|
Hello @CyrilleB79 I was pretty excited when I saw this fix since #11078 is pretty annoying for me however it seems this PR is not progressing. Is it just a matter of finding time to work on this for you or have you encountered any technical difficulties. Is there anything I can help with to progress this work? |
|
Hello Sorry for the delay. And thanks to ping me. |
|
Re-testing after the upmerges and fixes pushed on 22nd September 2021: Work in progress:
|
|
Hello I have done the rework to generate standard text-position values at each API level and have tried to test all possible cases. @feerrenrut you may review it again since you had asked to use the Enum. Note that @seanbudd was automatically requested as a reviewer when I have switched back this PR from draft to ready state. @lukaszgo1 if you want to add your review comments or additional test coverage, you are welcome. At last, sorry for the delay to address this PR review comments. I hope to have it finalized soon now! |
It would be pretty tough to find a example for this - the only known JAB object which exposed formatting info was editor in Open Office before they switched to IA2.
You can always modify |
Do you have the version number, and even a portable version to download?
Thanks for the trick. I have been able to test this part of code successfully and have updated the initial description accordingly. |
It looks like version 3.3.0 still required JAB these builds can be downloaded from http://archive.apache.org/dist/incubator/ooo/stable/3.3.0/. It looks like portable versions weren't officially available. |
|
Many thanks Lukasz for your help. After thinking again to it, Open Office v3.3 is already ten year old. And I do not know any other application using this interface and featuring text with superscript / subscript. |
|
It turns out that while OO 3.3 indeed requires JAB to be accessible the version of Java it bundles is too old to work with the version of Access Bridge which is bundled in NVDA. It should probably be possible to work around this somehow, perhaps by forcing Open Office to use never JDK, but given age of this version I don't think trying to force it to work with NVDA is good use of anyone's time. |
And overall it would not correspond to any real life use case. Thanks @lukaszgo1 for this investigation. Let's just review the code and test it if one day we find another more modern application using this part of the code. |
|
@feerrenrut, given your recent work in #12969, you may be interested to review this one. It may be interesting to test it a while in alpha given the modifications in all the interfaces (even if minor). Moreover if you do not plan to review it soon, could you add a milestone to keep it tracked? Thanks. |
|
@feerrenrut is this PR still on your radar? Having this review finalized would also allow me to submit another work regarding formatting review, using the same strategy. |
|
@feerrenrut now that 2021.3.1 is released, is there a chance to have this PR reviewed for 2022.1? |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
I haven't reviewed the code, I have just noticed that a file had a chmod operation, |
|
Thanks for this remark @seanbudd . The following commits have changed the permissions on this file: b95743d and 57f2791. They do not belong to this PR, but come from a merge of master branch. Anyway, it should be fixed now. Regarding the targetted release, do you have any information? |
This comment was marked as outdated.
This comment was marked as outdated.
|
I have hidden my previous comment (#11897 (comment)) regarding compatibility and have tagged it as off-topic. Indeed, it was irrelevant since there is actually no compatibility issue in this PR. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
…ord text (#15205) Closes #15206 Closes #15220 Summary of the issue: Various issues for alignment reporting: In MS Excel horizontal or vertical text alignment is not always correctly reported. In MS Word (legacy), text alignment is not correctly reported for "justify" and for "distrubute". 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. In MS Excel (no UIA) the alignment is reported as per Excel's options: for horizontal text alignment in cell: "General", "Centered across columns", "Repeat" and "Distribute" is now reported instead of "Default" or nothing for vertical alignment: "bottom" is reported instead of "default" In MS Word (no UIA): "justify" is now reported instead of "Default" "distribute" is now reported instead of nothing Description of development approach Standardized alignments returned by getFormatField* functions around a string enum as done in #11897. Thus, all the interfaces are impacted.
Link to issue number:
Fixes #11815
Fixes #11078.
Summary of the issue:
When fetching formatting information with NVDA+F (once or twice) in a Firefox page, "baseline" is reported.
Only subscript or superscript should be reported, not "baseline" since "baseline" should be considered the default text position.
Also, when "Report superscript and subscript" option is checked, navigating in a Firefox page cause spurious reporting of 'baseline'. This is due to transitions between elements having no formatting information such as button or graphics and baseline text.
Description of how this pull request fixes the issue:
Updated design after review comments in this PR:
Alternative solution
The old design, initially implemented in this issue before review comments, was the following:
getFormatFieldSpeechinspeech\__init__.py, when getting 'text-position' attribute, replace any attribute that do not match 'sub' or 'super' with None.Testing performed:
For the folling APIs/files, the following test were made:
API/files tested:
NVDAObjects/IAccessible/__init__.py: tested with ChromeNVDAObjects/UIA/__init__.py: tested with Word (UIA)NVDAObjects/window/edit.py, classITextDocumentTextInfo: Tested with Wordpad.NVDAObjects/window/edit.py, classEditTextInfo: I do not know where I can test it natively, but I have used the suggestion made in Do not report "baseline" on formatting information request #11897 (comment) to test (successfully) in WordPad.NVDAObjects/window/excel.py: tested with Excel, cell navigation.Note: When editing the cell's content, no formatting can be reported (neither before this PR nor with this PR).
NVDAObjects/window/winword.py: tested with Word '16.0.5188.1000' (UIA not checked)appModules/powerpnt.py: tested with PowerPoint slide writing mode (formatting not reported in slideshow mode, neither before this PR nor after).appModules/soffice.py: tested with Libre Office Writer 7.1virtualBuffers/MSHTML.py: Tested with IE, with CSSvertical-alignproperty.Note:
<sub>/<super>tags do not work, neither with this PR nor before.API/files not (yet) tested:
NVDAObjects/JAB/__init__.pyIn which control/program could I test?
Other tests:
Known issues with pull request:
Two APIs have not been tested (cf Test section).
Reviewers: please help me complete the test coverage.
Also reviewer, please check that I haven't forgotten any API.
Change log entry:
Changes
`'Baseline' is not reported anymore upon text formatting request (NVDA+F). (#11815)``
Bug fixes
'Baseline' is not frequently spuriously reported anymore whild reading some webpages when report superscript and subscript option is active. (#11078)