Closed Bug 406069 Opened 17 years ago Closed 17 years ago

nsIAccessibleText::GetTextAtOffset() not practical for getting the line at the caret

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: aaronlev, Assigned: aaronlev)

References

(Blocks 1 open bug, )

Details

(Keywords: access)

Attachments

(1 file, 3 obsolete files)

For a line that ends in text that wraps to a new line, a caret position at the end of that line has the same character offset as when the caret is at the start of the next line.

This causes a problem when a screen reader wants to speak the line a user has moved to, or the current line. If the caret is at the end of the line, the screen reader ends up getting the offset for the next line and speaking the next line instead of the correct one.

However, Mozilla knows internally which line the caret is on.

The proposed solution for IA2 and ATK/AT-SPI is to allow a new magic value for char offsets.
Currently -1 can be passed to indicate end of text
Now, -2 would mean current caret position

This would allow AT's to save on calls as well, because they usually are interested in what's at the caret position.
Assignee: nobody → aaronleventhal
Component: Build Config → Disability Access APIs
Product: Firefox → Core
QA Contact: build.config → accessibility-apis
If anyone knows what the Gecko test for caret @ end of line would be, let me know, otherwise I'll experiment.
Attachment #290743 - Attachment is obsolete: true
Am I correct that this would mean that if we query for the characterExtents of -2 and compare that with the characterExtents of two characters adjacent to the the caretOffset to decide which line is current?

If this is the right understanding, aren't there boundary cases where this will fail, such as drop caps where there isn't text on the rest of the line of the drop cap? 
You won't have to do that.

If you just ask for the line at the caret using get_textAtOffset(-2,...) we'll give you the actual line the caret is on, instead of using the caret's offset into the hypertext.
Attached patch Support new caret offset (obsolete) — Splinter Review
Attachment #290744 - Attachment is obsolete: true
Attachment #291468 - Flags: review?(surkov.alexander)
Aaron, you missed nsIAccessibleText.idl in your patch.
Okay, that part is the same as from the previous obsolete patch. Do you need me to post a new one?
Attached patch With IDLSplinter Review
Attachment #291468 - Attachment is obsolete: true
Attachment #291603 - Flags: review?(ginn.chen)
Attachment #291468 - Flags: review?(surkov.alexander)
Attachment #291603 - Flags: review?(ginn.chen)
Attachment #291603 - Flags: review+
Attachment #291603 - Flags: approval1.9?
Attachment #291603 - Flags: approval1.9? → approval1.9+
patch checked in.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: