nvaccess / nvda

NVDA, the free and open source Screen Reader for Microsoft Windows
https://www.nvaccess.org/
Other
2.09k stars 632 forks source link

In Outlook emails, textInfos report inconsistent text in some cases #16448

Open mltony opened 5 months ago

mltony commented 5 months ago

Steps to reproduce:

  1. In NVDA Advanced preferences disable UIA for MS Word.
  2. Open an Outlook email, see email attached, just remove the .zip characters at the end to open the email. 3.Go to the second paragraph by pressing control+home then downArrow. That's actually an empty paragraph.
  3. In NVDA python console:
    >>> p=focus.treeInterceptor.makeTextInfo('caret')
    >>> p.expand('paragraph')
    >>> p.getTextWithFields()
    [FieldCommand controlStart with {}, FieldCommand formatChange with {'text-position': <TextPosition.BASELINE: 'baseline'>}, '\n', FieldCommand controlEnd with {}]
    >>> p.getTextWithFields()[2]
    '\n'
    >>> p.text
    '\r\x07'

    Actual behavior:

    p.getTextWithFields()[2] returns a different string from p.text.

Expected behavior:

Text returned by p.text and string elements of p.getTextWithFields() - namely p.getTextWithFields()[2] in this case - should be identical.

NVDA logs, crash dumps and other attachments:

N/A

System configuration

NVDA installed/portable/running from source:

Running from source.

NVDA version:

master

Windows version:

Windows 11

Name and version of other software in use when reproducing the issue:

N/A

Other information about your system:

Other questions

Does the issue still occur after restarting your computer?

Yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

N/A

If NVDA add-ons are disabled, is your problem still occurring?

Yes

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

N/A

Webinar.des.Monats.Forderung.durch.die.offentliche.Hand.msg.zip

Adriani90 commented 5 months ago

@mltony just for completeness, in the email test case attached here unfortunately they use table cels for presentational / design purposes, but these empty cells are not having role="presentation", so NVDA interprets them as empty lines / paragraphs. So maybe there are some specific internals in textInfo on how NVDA threats paragrpahs / characters in table cells which might have to be changed or redesigned.

mltony commented 5 months ago

This issue also affects style navigation in MSWord without UIA - for more info see #16459. I observe exactly the same discrepancy between textInfo.text and textInfo.getTextWithFields(). However the issue with MSWord doesn't reproduce reliably on my computer - whereas the one with Outlook appears to be reliable.