Closed Bug 725581 Opened 9 years ago Closed 9 years ago

caretOffset for textarea should be -1 when textarea doesn't have a focus

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: surkov, Assigned: surkov)

References

(Blocks 1 open bug)

Details

(Keywords: access)

Attachments

(1 file)

when document is focused but textarea is not then caretOffset on textarea returns the focus position of selection.
Attached patch patchSplinter Review
new portions of ifs unfortunately
Assignee: nobody → surkov.alexander
Status: NEW → ASSIGNED
Attachment #595669 - Flags: review?(trev.saunders)
note, the patch enables tests disabled in bug 510128
(In reply to alexander :surkov from comment #2)
> note, the patch enables tests disabled in bug 510128

and I think this bug is a fix for bug 510128
Comment on attachment 595669 [details] [diff] [review]
patch

Nice to get rid of that todo!
some details:
Since elements like input or textarea has own selection controller then selection we get is different from documents one. Since selection is turned into caret position then we can get result different from -1 for these controls if document is focused (see eContainedByFocus check in nsHyperTextAccessible::GetCaretOffset).
Comment on attachment 595669 [details] [diff] [review]
patch

its kind of weird but I think this makes sense.  We should look at ways to make the check if we're focusable faster.
Attachment #595669 - Flags: review?(trev.saunders) → review+
https://hg.mozilla.org/mozilla-central/rev/c646a6e4dd2e
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.