Closed Bug 1730085 Opened 3 years ago Closed 3 years ago

TextLeafPoint: Implement BOUNDARY_WORD_END and BOUNDARY_LINE_END

Categories

(Core :: Disability Access APIs, task)

task

Tracking

()

RESOLVED FIXED
99 Branch
Tracking Status
firefox99 --- fixed

People

(Reporter: Jamie, Assigned: Jamie)

References

(Blocks 1 open bug)

Details

(Whiteboard: [ctw-m1])

Attachments

(4 files)

TextLeafPoint::FindBoundary currently only supports word and line start boundaries. ATK and Mac (and maybe Android) need word/line end as well.

For line end, we can probably just get line start and walk back a character to see if it's a line feed, and if so, return that. Word end will be more complicated.

Blocks: 1730095
No longer blocks: a11y-ctw
Whiteboard: [ctw-m1]
Blocks: 1747172

These bugs cause problems for the upcoming implementation of BOUNDARY_LINE_END.

  1. Don't always return no character at the caret. Only do that if the caret is at the end of the line. This was always the intent; this was just a silly mistake.
  2. When moving to the next character in an Accessible, don't move past the last character. This was a simple off-by-one error.
Assignee: nobody → jteh
Status: NEW → ASSIGNED

BOUNDARY_LINE_END is implemented using BOUNDARY_LINE_START and adjusting for line feed characters, which are line end boundaries where present.

BOUNDARY_WORD_END is implemented using BOUNDARY_WORD_START and adjusting for spaces, which are word end boundaries.
This is arguably less efficient than it could be, since we will walk over space and then reverse course to compensate.
However, the alternative would mean keeping two slightly different versions of the word boundary check code in sync, plus compensating for the fact that a word often ends before a line start while still supporting words split by line wrapping.
I felt the lower complexity here outweighed the potential slight loss in efficiency.
We can always revisit this if this turns out to be a real problem.

Pushed by jteh@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f08f12d82f7f part 1: Fix some bugs in TextLeafPoint::FindBoundary for BOUNDARY_CHAR. r=eeejay https://hg.mozilla.org/integration/autoland/rev/e15365af4131 part 2: Implement support for BOUNDARY_LINE_END in TextLeafPoint and HyperTextAccessibleBase. r=eeejay https://hg.mozilla.org/integration/autoland/rev/750f98502e6d part 3: Move GetWordBreakClass out of PrevWordBreakClassWalker, as it will be needed outside of that class soon. r=eeejay https://hg.mozilla.org/integration/autoland/rev/dd90514bc052 part 4: Implement support for BOUNDARY_WORD_END in TextLeafPoint and HyperTextAccessibleBase. r=eeejay
Flags: needinfo?(jteh)
Flags: needinfo?(jteh)
Pushed by jteh@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e0c116bd432b part 1: Fix some bugs in TextLeafPoint::FindBoundary for BOUNDARY_CHAR. r=eeejay https://hg.mozilla.org/integration/autoland/rev/6ae088ec6a5b part 2: Implement support for BOUNDARY_LINE_END in TextLeafPoint and HyperTextAccessibleBase. r=eeejay https://hg.mozilla.org/integration/autoland/rev/652f83237c7c part 3: Move GetWordBreakClass out of PrevWordBreakClassWalker, as it will be needed outside of that class soon. r=eeejay https://hg.mozilla.org/integration/autoland/rev/bf1bde768533 part 4: Implement support for BOUNDARY_WORD_END in TextLeafPoint and HyperTextAccessibleBase. r=eeejay
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: