Closed Bug 1163706 Opened 11 years ago Closed 2 years ago

Not possible to select text from different objects into a single selection using IAccessible2

Categories

(Core :: Disability Access APIs, defect)

37 Branch
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: chris, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Steps to reproduce: With a document as follows: <!DOCTYPE html> <html> <body> <div contenteditable="true">Test <a href="#">selection</a></div> </body> </html> I obtain the two IAccessibleText objects as: iaText1 (which has the text "Test \uFFFC"), and iaText2 (which has the text "selection") I want to create a selection from an offset in iaText1 to an offset in iaText2: iaText1.setSelection(0, 2, IA2_TEXT_OFFSET_LENGTH); iaText2.setSelection(0, 0, 3); Actual results: I end up with only "sel" in the selection. Expected results: I want "st sel" in the selection. Some discussion here: https://groups.google.com/forum/?hl=en#!topic/mozilla.dev.accessibility/_6-iZrNtQrg
Blocks: caretsela11y
Status: UNCONFIRMED → NEW
Ever confirmed: true
You can do this with: iaText1.addSelection(2, IA2_TEXT_OFFSET_LENGTH); iaText2.addSelection(0, 3);
invalid per comment #1
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
Calling addSelection twice creates a multi-selection. I guess I forgot to specify that I needed to be able to create a single selection, this is because many editors (i.e. Gmail's compose) don't expect multiple selections and don't handle them well enough. More discussion: https://groups.google.com/forum/?hl=en#!topic/mozilla.dev.accessibility/_6-iZrNtQrg http://stackoverflow.com/questions/30159146/setting-a-single-selection-between-different-objects-in-firefox-using-iaccessibl
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
When you say multi-selection, are you saying it's represented as if it's non-contiguous? I think Firefox should really merge the two selections when addSelection is called the second time, since as far as IA2 is concerned, the range is contiguous.
(In reply to James Teh [:Jamie] from comment #4) > When you say multi-selection, are you saying it's represented as if it's > non-contiguous? I think Firefox should really merge the two selections when > addSelection is called the second time, since as far as IA2 is concerned, > the range is contiguous. I think this is doable. Btw, is it a big concern from AT perspective?
Thanks James, I think that's a sensible solution. Yes, for voice to text it's important to be able to say "select xyz", and have that selection contiguous so that it can then be edited by voice, or via keyboard.
Severity: normal → S3

This, along with several other problems, has been solved in a much better way using the (relatively recent) IAccessibleTextSelectionContainer interface. I implemented support for that in bug 1846660.

Status: REOPENED → RESOLVED
Closed: 10 years ago2 years ago
Depends on: 1846660
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.