Closed Bug 394689 Opened 15 years ago Closed 15 years ago

cannot use setCaretOffset() to position caret at end of HTML entry

Categories

(Core :: Disability Access APIs, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jdiggs, Assigned: aaronlev)

References

(Blocks 1 open bug, )

Details

(Keywords: access)

Attachments

(1 file, 1 obsolete file)

Steps to reproduce:

1. Launch Accerciser and browse to any page with an HTML entry (e.g. google.com)

2. Place focus in that entry and type some text (e.g. test)

3. Select the entry in Accerciser.  Then in the iPython Console type:

    text.setCaretOffset(x)

where x is the number of characters in the text you typed in the entry.  Also try:

    text.setCaretOffset(-1)

Expected results:  In both instances, the caret would be moved just past the final character (as it would if the End key had been pressed).

Actual results:  The caret doesn't move and False is returned.
Does it work if you have an accessible text on a page with no whitespace at all in the source?
If so, then it's most likely just a dupe of bug 394688.
Attached patch WIP -- not read (obsolete) — Splinter Review
1) Build change -1 to characterCount in GetPosAndText()
2) Make GetPosAndText() return correct start and end accessible even if offset is on last char
3) For the SetSelectionBounds() case where the start or end frame is returned as null, it indicates we're at the end. In that case we can just use SetStartAfter(node) or SetEndAfter(node). We can get the node from the start/end accessible.
Attachment #279763 - Attachment is obsolete: true
Attachment #279769 - Flags: review?(surkov.alexander)
Attachment #279769 - Flags: review?(surkov.alexander) → review?(david.bolter)
Comment on attachment 279769 [details] [diff] [review]
Patch described in comment

Looks good.
Attachment #279769 - Flags: review?(david.bolter) → review+
Attachment #279769 - Flags: approval1.9?
Blocks: 395809
(In reply to comment #4)
> 3) For the SetSelectionBounds() case where the start or end frame is returned
> as null, it indicates we're at the end. In that case we can just use
> SetStartAfter(node) or SetEndAfter(node). We can get the node from the
> start/end accessible.
> 

Why do we need that indication? Where is it used? Why we can't return non-null frame in this case?
Surkov, we can change it to do that in your dependency bug on scrollToSubstring(), but right now we use if (GetPosAndText()) in quite a few places.
Attachment #279769 - Flags: approval1.9? → approval1.9+
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.