Closed Bug 1848282 Opened 1 year ago Closed 1 year ago

A11y word breaks out of sync with keyboard navigation

Categories

(Core :: Disability Access APIs, defect)

defect

Tracking

()

RESOLVED FIXED
120 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox-esr115 --- unaffected
firefox116 --- unaffected
firefox117 --- unaffected
firefox118 + disabled
firefox119 --- disabled
firefox120 --- fixed

People

(Reporter: Jamie, Assigned: m_kato)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(4 files)

STR (with the NVDA screen reader):

  1. Open this test case:
    data:text/html,<input type="text" value="ab'cd">
  2. Focus the text input.
  3. Press home to move to the start of the text.
  4. Press control+rightArrow.
    • Expected: NVDA says "cd"
    • Actual: NVDA says "ab'cd"

Impact: Screen reader users can't work out where word boundaries are in the presence of punctuation. They will be confused by double speaking and won't know where the caret has actually moved.

Even though the caret lands on "c" (so keyboard navigation treats "ab'" as one word and "cd" as another word), accessibility treats the word as "ab'cd". Accessibility and keyboard navigation must be in sync at all times with respect to how word boundaries are calculated.

Setting intl.icu4x.segmenter.enabled to false fixes this.

As I understand it, intl.icu4x.segmenter.enabled is supposed to change everything to use the new segmenter. Why then does keyboard navigation (I guess PeekOffset, etc.) seem to be using different segmentation?

Do we need to fix keyboard navigation here? Or is the correct fix to disable the icu4x segmenter for accessibility word breaking? Or something else?

Flags: needinfo?(m_kato)
Assignee: nobody → m_kato
Flags: needinfo?(m_kato)

Hmm, I think that WordBreaker::FindWord returns different result...

This new segmenter is Nightly only. so we won't turn on release 118 until all regressions are fixed.

Note that layout has some code (in ClusterIterator, IsSelectionInlineWhitespace, IsSelectionNewline, etc.) to handle punctuation and white space. A11y needs to emulate layout word breaks, so it has similar code... but we can't reuse the same code because the layout code is entangled with layout frames. This will probably make unifying this behaviour a little tricky.

Set release status flags based on info from the regressing bug 1719535

Hmm, Although I setup with NDVA 2023.1jp, NVDA says "ab'cd" on Firefox 117. How to reproduce this?

I guess that sample is invalid. I am looking for valid sample.

The test case is valid. The tricky part here is that with intl.icu4x.segmenter.enabled set to true, the caret movement behaviour with control+rightArrow doesn't change, but what is returned by a11y does change when it shouldn't.

[Removed incorrect comment.]

I can reproduce this by the following step. Original step doesn't move caret by Ctrl+Arrow.

  1. Open data:text/html,<input type="text" value="ab'cd">.
  2. Focus textbox
  3. Blur textbox
  4. Focus textbox again.
  5. Input any text in textbox then remove it
  6. Move caret to head
  7. Ctrl+Arrow

Ah, that's because tabbing to the text box selects all text. Sorry, i was focusing with NVDA browse mode rather than tab, which does not select all.

An easier way to work around this is to tab to the text box, press left arrow, and then press control+right arrow.

Ah, that's because tabbing to the text box selects all text. Sorry, i was focusing with NVDA browse mode rather than tab, which does not select all.

I see.

Hmm, "ab'cd" should be 1 word by UAX#29 spec. But nsFrameSelection (or nsTextFrame?) doesn't recognize this is 1 word. We should fix on layout side.

I just edited comment 8 and comment 9 a lot to correct them, since they were completely bogus. Sorry about that.

The layout.word_select.stop_at_punctuation and layout.word_select.stop_at_underscore prefs are probably relevant here. Should those even be relevant with icu4x?

(In reply to James Teh [:Jamie] from comment #14)

The layout.word_select.stop_at_punctuation and layout.word_select.stop_at_underscore prefs are probably relevant here. Should those even be relevant with icu4x?

Yes. we guess that we should reference this even if using ICU4X.

This fix adds stop at punctuation mode for FindWord for a11y.

Also, IS_ASCII is conflict with nsUnicharUtils.h's, so it is renamed.

Depends on D188784

Attachment #9354248 - Attachment description: WIP: Bug 1848282 - Part 2. FindWord has an option whether segment is punctuation. → WIP: Bug 1848282 - Part 2. FindWord adds an option whether segment is punctuation.
Attachment #9354247 - Attachment description: WIP: Bug 1848282 - Part 1. Move IsPunctuation to nsUnicharUtils. → Bug 1848282 - Part 1. Move IsPunctuation to nsUnicharUtils. r=TYLin
Attachment #9354248 - Attachment description: WIP: Bug 1848282 - Part 2. FindWord adds an option whether segment is punctuation. → Bug 1848282 - Part 2. FindWord adds an option whether segment is punctuation. r=TYLin
Attachment #9354249 - Attachment description: WIP: Bug 1848282 - Part 3. a11y's word segmenter should reference layout.word_select.* preferences. → Bug 1848282 - Part 3. a11y's word segmenter should reference layout.word_select preferences. r=morgan
Pushed by m_kato@ga2.so-net.ne.jp: https://hg.mozilla.org/integration/autoland/rev/c800ae9f7943 Part 1. Move IsPunctuation to nsUnicharUtils. r=TYLin https://hg.mozilla.org/integration/autoland/rev/3446c1367bfd Part 2. FindWord adds an option whether segment is punctuation. r=TYLin https://hg.mozilla.org/integration/autoland/rev/d1fc71cc3817 Part 3. a11y's word segmenter should reference layout.word_select preferences. r=morgan

GeckoView runs a11y code in UI thread, not Gecko main thread. So I would like
to change layout.word_select.stop_at_punctuation to atomic.

Depends on D188786

Pushed by m_kato@ga2.so-net.ne.jp: https://hg.mozilla.org/integration/autoland/rev/cbf382972a0c Part 1. Move IsPunctuation to nsUnicharUtils. r=TYLin https://hg.mozilla.org/integration/autoland/rev/e1f0c76f6fa7 Part 2. FindWord adds an option whether segment is punctuation. r=TYLin https://hg.mozilla.org/integration/autoland/rev/0320eac255f1 Part 3. a11y's word segmenter should reference layout.word_select preferences. r=morgan https://hg.mozilla.org/integration/autoland/rev/ac94b9a48562 Part 4. Make layout.word_select.stop_at_punctuation atomic. r=TYLin
Flags: needinfo?(m_kato)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: