Closed
Bug 585922
Opened 14 years ago
Closed 14 years ago
Text cursor doesn't follow character input for passwords (encrypted phrases)
Categories
(Core :: Layout, defect)
Tracking
()
RESOLVED
WORKSFORME
mozilla2.0b5
People
(Reporter: vladmaniac, Assigned: ehsan.akhgari)
References
Details
(Keywords: regression, testcase)
Attachments
(2 files, 3 obsolete files)
(deleted),
text/html
|
Details | |
(deleted),
patch
|
Details | Diff | Splinter Review |
Steps:
1. Login to yahoo/google/facebook etc
2. Be sure to manually enter password
========================================
Actual:
text cursor doesn't follow input. It returns back one
position after current character is in text field.
Comment 1•14 years ago
|
||
This sounds a little like a repaint problem.
Reporter | ||
Comment 2•14 years ago
|
||
I'm confident that it would cause no trouble fixing
Comment 3•14 years ago
|
||
flagging for 2.0 triage. bad perception issue, even though its actually working fine.
tracking-fennec: --- → ?
Updated•14 years ago
|
tracking-fennec: ? → 2.0b1+
Comment 4•14 years ago
|
||
Looks like a regression from Bug 581585
The problem is mLastFrameOffset is updated independently from mLastContentOffset, so it is possible for them to lose sync when mLastFrameOffset is changed without mLastContentOffset being updated.
Assignee | ||
Comment 5•14 years ago
|
||
(In reply to comment #4)
> Looks like a regression from Bug 581585
>
> The problem is mLastFrameOffset is updated independently from
> mLastContentOffset, so it is possible for them to lose sync when
> mLastFrameOffset is changed without mLastContentOffset being updated.
Would you care to elaborate, please? What is exactly happening to cause them get out of sync?
Can someone who knows how Fennec creates its password input fields help create a test case please?
Keywords: testcase-wanted
Comment 6•14 years ago
|
||
(In reply to comment #5)
> (In reply to comment #4)
> > Looks like a regression from Bug 581585
> >
> > The problem is mLastFrameOffset is updated independently from
> > mLastContentOffset, so it is possible for them to lose sync when
> > mLastFrameOffset is changed without mLastContentOffset being updated.
>
> Would you care to elaborate, please? What is exactly happening to cause them
> get out of sync?
>
> Can someone who knows how Fennec creates its password input fields help create
> a test case please?
After some more debugging, seems like it's a combination of problems that causes this bug. I made a test case that reproduces the bug in newer nightlies (tested on Windows and Linux). It simulates what happens in Fennec (in a Fennec password field, letters turn to asterisks after a short delay). It should be run locally and "Remember this decision" should be checked when allowing XPConnect.
After pressing Go and waiting two seconds (sometimes you might have to try again to see the bug), the cursor will stay at index 0 even though the real selection is at index 1. You cannot move the cursor to the end by clicking or pressing the right arrow key. If you type in a letter the new letter will appear at the end instead of at the caret position.
This bug would be fixed by resolving (or bypassing) any of the following:
1) nsCaret depends on nsISelectionListener for selection change notification, but not all selection changes are notified. For one, if a selected text range is changed through nsIDOMCharacterData, the selection range will adjust automatically but selection listeners are not notified. This causes a discrepancy between the selection and the caret.
2) nsCaret::UpdateCaretPosition would correct any discrepancies between the selection and the caret, but only when the caret is currently drawn. This is why the test case involves a timeout. The bug only appears when the caret is not on screen when the callback code is executed.
3) nsCaret::GetGeometry updates mLastFrame / mLastFrameOffset (through GetCaretFrameForNodeOffset) using the given selection but does not update mLastContent / mLastContentOffset. So if the current offset is different from mLastContentOffset, mLastFrameOffset would become out of sync with mLastContentOffset. On subsequent calls to GetCaretFrameForNodeOffset, if the offset is the same as the old mLastContent, the new (and wrong) frame offset is returned.
Seems like the most sensible fix is to update mLastContent in nsCaret::GetGeometry.
Updated•14 years ago
|
Attachment #468182 -
Attachment is patch: false
Attachment #468182 -
Attachment mime type: text/plain → text/html
Comment 7•14 years ago
|
||
FWIW, here's a simple patch that fixes the bug for Fennec. It probably has the least impact among possible solutions.
Assignee | ||
Comment 8•14 years ago
|
||
This is a trial patch to only update mLastFrame(Offset) iff we're updating mLastContent(Offset) as well. I'm still testing the patch to make sure that it doesn't break anything else, but I'm attaching it here for Jim to test it on Fennec.
Assignee | ||
Comment 9•14 years ago
|
||
The patch seems to be fine. I also added a test case for it (which was kind of tricky, but I'm satisfied with the final test).
Attachment #468395 -
Attachment is obsolete: true
Attachment #468452 -
Flags: review?(roc)
Assignee | ||
Updated•14 years ago
|
Keywords: testcase-wanted → testcase
Attachment #468452 -
Flags: review?(roc) → review+
Assignee | ||
Comment 10•14 years ago
|
||
Attachment #468452 -
Attachment is obsolete: true
Assignee | ||
Updated•14 years ago
|
Keywords: checkin-needed
Comment 11•14 years ago
|
||
Comment on attachment 468505 [details] [diff] [review]
For check-in
http://hg.mozilla.org/mozilla-central/rev/8514be744066
Updated•14 years ago
|
Assignee | ||
Updated•14 years ago
|
Component: General → Layout
Flags: in-testsuite+
Product: Fennec → Core
QA Contact: general → layout
Target Milestone: --- → mozilla2.0b5
Assignee | ||
Updated•14 years ago
|
blocking2.0: --- → ?
blocking2.0: ? → beta6+
Assignee | ||
Comment 12•14 years ago
|
||
It should be noted that the code parts of this bug was backed out as part of bug 593211, which implemented a better optimization.
Resolution: FIXED → WONTFIX
Assignee | ||
Updated•14 years ago
|
Resolution: WONTFIX → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•