Ignore hidden text in richEdit controls accessed with ITextDocument#13618
Conversation
…, no matter whether the fetch formatting after cursor setting in NVDA is on or not. This used to be very slow in Windows XP, but these days seems to be less problematic.. Plus, it is needed to correctly identify the existance of links. If users report a major reduction in performance in Wordpad / other Richedit controls with many formatting changes, we may instead: * Move all this code in-process like Microsoft Word. Though this would be a great deal of work for little gain. * Only ignore this setting if the richEdit control is hosted in the NVDA process itself (part of NVDA's UI). As 1. being in the same process there will be no cross-process performance hit, and 2. We technically only cared about links in RichEdit currently for NvDA's own UI.
… text. RichEdit places a string of hidden text at the beginning of inserted hyperlinks.
| formatConfig=config.conf["documentFormatting"] | ||
| textRange=self._rangeObj.duplicate | ||
| textRange.collapse(True) | ||
| if not formatConfig["detectFormatAfterCursor"]: |
There was a problem hiding this comment.
Is this exposed in the GUI? Can it be removed if no longer observed?
There was a problem hiding this comment.
From another conversation with @michaelDCurran, if this is the only usage, we can remove it from the settings dialog.
There was a problem hiding this comment.
There is another usage at: source/textInfos/offsets.py:570
Snippet:
def getTextWithFields(self, formatConfig: Optional[Dict] = None) -> textInfos.TextInfo.TextWithFieldsT:
if not formatConfig:
formatConfig=config.conf["documentFormatting"]
if self.detectFormattingAfterCursorMaybeSlow and not formatConfig['detectFormatAfterCursor']:
field,(boundStart,boundEnd)=self._getFormatFieldAndOffsets(self._startOffset,formatConfig,calculateOffsets=False)
text=self.text
return [textInfos.FieldCommand('formatChange',field),text]
commandList=[]
offset=self._startOffset
while offset<self._endOffset:|
Based on this finding, I would keep this setting available. It looks like at very least Java Access Bridge, old winConsoles, displayModel, and RichEdit without ITextDocument could all be affected. In other words, pretty much anything that inherits from |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
After this PR:
Observed: NVDA says "out of link, blank". |
|
@codeofdusk Is the email address exposed as a link? It probably is, please report to Microsoft. By the way, adding a comment to a closed PR is very likely to get ignored. Please open a new issue so it can be triaged. |
…cument (PR #13618)" (#13858) This reverts commit c591309. Link to issue number: Fixes #13826, reverts #13618 Summary of the issue: #13618 causes a regression - #13826. The PR needs to be reverted for 2022.2, and a new attempt at #13618 can be taken for 2022.3. Description of user facing changes #13618 is reverted: Hidden text will now be announced again in Wordpad and other richEdit controls. Description of development approach Note: another translation freeze may need to be announced. The only translation changes is remove a line from changes.t2t.
|
I quite like the ability to hear the link in that way. Very handy for hacked
web sites. grin.
|
Link to issue number:
None.
Summary of the issue:
Currently if NVDA accesses a RichEdit control with the
ITextDocument objectinterface, it does not ignore hidden text. I.e. hidden text is both read, and can be navigated through with the review cursor.An example of this is the hidden text included at the start of hyperlinks in RichEdit controls. Usually looking something like:
So therefore for a link for NV access the user would here:
Where as they should really just hear:
Description of how this pull request fixes the issue:
formatFieldor text for that run. In other words, skip over the hidden text within the text range.Testing strategy:
NV Accesscontrol+kto insert a hyperlink. Give a URL ofhttps://www.nvaccess.org/.NV Accessand not any of the initial hidden text (I.e. HYPERLINK).Known issues with pull request:
There may be a performance hit in ignoring the fetch formatting after the cursor option on some systems.
If users report such a performance hit, then some alternatives are:
Change log entries:
Bug fixes
Code Review Checklist: