nvaccess / nvda

NVDA, the free and open source Screen Reader for Microsoft Windows
Other
2.06k stars 625 forks source link

textInfo.expand(paragraph) works incorrectly in Chrome. #16530

Open mltony opened 3 months ago

mltony commented 3 months ago

Steps to reproduce:

  1. Open any github issue in Chrome and navigate to comment edit box. (The issue seems to reproduce with any multiline edit box, github issue is just an example)
  2. Paste some long sentence that spans multiple lines, for example:

    In the best of times, it is the worst of times; in the worst of times, it is the best of times. It was the age of wisdom, it was the age of foolishness; it was the epoch of belief, it was the epoch of incredulity; it was the season of Light, it was the season of Darkness; it was the spring of hope, it was the winter of despair. We had everything before us, we had nothing before us; we were all going direct to Heaven, we were all going direct the other way – in short, the period was so far like the present period, that some of its noisiest authorities insisted on its being received, for good or for evil, in the superlative degree of comparison only.

  3. Open NVDA python console and type:
    >>> t=focus.makeTextInfo('caret')
    >>> t.expand('paragraph')
    >>> t.collapse(True)
    >>> t.expand('paragraph')
    >>> t.text
    'only.'

Actual behavior:

It selects only the last line - even though we requested to expand to paragraph.

Expected behavior:

textInfo.expand(paragraph) should expand to a paragraph, not line.

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:

Google Chrome: appModule.productVersion: '124.0.6367.158'

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

seanbudd commented 3 months ago

This is most likely a bug in Chromium. Has this been reported to chromium?

seanbudd commented 3 months ago

What TextInfo is this? Can you provide a sample to test with and/or a log

mltony commented 2 months ago

@seanbudd, somehow missed your comment.

I thought this must be a Chromium bug as well, I'd need to figure out a test example with plain IAccessible2 commands in order to file a bug with them.

Textinfo class is NVDAObjects.IAccessible.ia2TextMozilla.MozillaCompoundTextInfo.

Can you provide a sample to test with

Sorry, what kind of sample do you mean? I explained steps to repro in OP. Also There are no lines written in the log - or do you mean debug log?

seanbudd commented 2 months ago

A debug log would be helpful, and a minimal HTML sample as a codepen to test with, but this information is a good start

mltony commented 2 months ago

Attaching debug log. Not sure what you mean by HTML sample - this issue appears to reproduce in any multiline edit box in Chrome, but as an example I used github issue comment edit box.

mltony commented 2 months ago

debug_log.txt