As a security precaution, we have turned on the setting "Require API key authentication for API requests" for everyone. If this has broken something, please contact
Last Comment Bug 725581 - caretOffset for textarea should be -1 when textarea doesn't have a focus
: caretOffset for textarea should be -1 when textarea doesn't have a focus
: access
Product: Core
Classification: Components
Component: Disability Access APIs (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla13
Assigned To: alexander :surkov
: alexander :surkov
Depends on:
Blocks: texta11y
  Show dependency treegraph
Reported: 2012-02-08 23:32 PST by alexander :surkov
Modified: 2012-02-13 09:10 PST (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch (5.18 KB, patch)
2012-02-08 23:34 PST, alexander :surkov
tbsaunde+mozbugs: review+
Details | Diff | Splinter Review

Description User image alexander :surkov 2012-02-08 23:32:21 PST
when document is focused but textarea is not then caretOffset on textarea returns the focus position of selection.
Comment 1 User image alexander :surkov 2012-02-08 23:34:47 PST
Created attachment 595669 [details] [diff] [review]

new portions of ifs unfortunately
Comment 2 User image alexander :surkov 2012-02-08 23:35:33 PST
note, the patch enables tests disabled in bug 510128
Comment 3 User image alexander :surkov 2012-02-08 23:36:34 PST
(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 4 User image Marco Zehe (:MarcoZ) 2012-02-08 23:51:02 PST
Comment on attachment 595669 [details] [diff] [review]

Nice to get rid of that todo!
Comment 5 User image alexander :surkov 2012-02-09 23:19:38 PST
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 6 User image Trevor Saunders (:tbsaunde) 2012-02-10 00:43:25 PST
Comment on attachment 595669 [details] [diff] [review]

its kind of weird but I think this makes sense.  We should look at ways to make the check if we're focusable faster.
Comment 7 User image Marco Bonardo [::mak] 2012-02-13 09:10:26 PST

Note You need to log in before you can comment on or make changes to this bug.