Closed
Bug 829606
Opened 12 years ago
Closed 12 years ago
input text form element "resets" view when value is changed
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla22
People
(Reporter: libreman.bugzilla, Assigned: mounir)
References
Details
Attachments
(2 files)
131 bytes,
text/html
|
Details | |
4.74 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:19.0) Gecko/20130107 Firefox/19.0
Build ID: 20130107082244
Steps to reproduce:
I change the value of an INPUT text element to remove diacritics.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:19.0) Gecko/20130107 Firefox/19.0
Actual results:
When the text is longer than the size of the input element, the view of the element gets reset to the start every time the value is changed through JS so the user can not see what he's typing (the caret position is ok but the view is not following it)
Expected results:
The view should follow the caret so when the user is typing and the text is longer than the size of the element, he should see the end of the text as he's typing it ... not the start. This works as expected in Chromium - see for reference (it gets reset only after it loses focus).
It seems the same problem was reported 9 years ago but there is nobody watching that one it seems (Bug 230474). A very basic syntax to test this is attached.
Updated•12 years ago
|
Attachment #701103 -
Attachment mime type: text/plain → text/html
Comment 1•12 years ago
|
||
I was able to reproduce this issue on the latest Nightly.
User Agent: Mozilla/5.0 (X11; Linux i686; rv:21.0) Gecko/20130114 Firefox/21.0
Build ID: 20130114031033
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•12 years ago
|
Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
Updated•12 years ago
|
Component: DOM: Core & HTML → Editor
Whiteboard: DUPEME
Assignee | ||
Updated•12 years ago
|
OS: Linux → All
Hardware: x86_64 → All
Comment 2•12 years ago
|
||
Is this a regression?
Comment 4•12 years ago
|
||
(In reply to :Ehsan Akhgari from comment #2)
> Is this a regression?
I get the same faulty behaviour on Firefox 4, so it's not a regression.
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0
Build ID: 20110318052756
Assignee | ||
Comment 5•12 years ago
|
||
What about Firefox 3.6? IIRC, there was a huge refactoring regarding the editor ownership that landed for Firefox 4.0. Maybe this is a regression from that?
Reporter | ||
Comment 6•12 years ago
|
||
It seems this goes way back to 1.0 according to Bug 230474
Comment 7•12 years ago
|
||
(In reply to Mounir Lamouri (:mounir) from comment #5)
> What about Firefox 3.6? IIRC, there was a huge refactoring regarding the
> editor ownership that landed for Firefox 4.0. Maybe this is a regression
> from that?
It's also reproducible on Firefox 3.6.
Assignee | ||
Updated•12 years ago
|
Version: 17 Branch → 1.0 Branch
Hi, is anything going to happen with this bug? Is there any chance somebody might work on it? Thanks.
Assignee | ||
Comment 9•12 years ago
|
||
Comment 10•12 years ago
|
||
Thanks! It's super awesome that you responded so fast, I hope the patch will be accepted ;)
Comment 11•12 years ago
|
||
Mounir, have you checked why that code was there? Why is it ok to just remove it completely?
Assignee | ||
Comment 12•12 years ago
|
||
(In reply to Boris Zbarsky (:bz) from comment #11)
> Mounir, have you checked why that code was there? Why is it ok to just
> remove it completely?
The blame goes back to hg@. Bonsai gives a refactor work back from 2002 (bug 129909). I don't know how to use bonsai to look at the file that was refactored to nsTextControlFrame.cpp to know if there is any information about this code there and I doubt there will be any information...
My feeling is that that code was there to have a better UX when a text field was changed from a long value to another long value (using .value) so the updated value is shown from the beginning. However, this might be true in that specific case but makes things not very good in most cases (like if append something to a long string).
Comment 13•12 years ago
|
||
> I don't know how to use bonsai to look at the file that was refactored to
> nsTextControlFrame.cpp
You look in the Attic. Specifically, http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla%2Flayout%2Fhtml%2Fforms%2Fsrc%2FAttic%2FnsGfxTextControlFrame2.cpp
Specifically, that was fixing bug 49339, where there are steps to reproduce for single-line textfields and whatnot. And the code it was changing was added to fix bug 36130. That was dealing with a similar problem: the content shrinking from a long value to a short value and suddenly nothing being visible at all in the text input. _That_ is what we should make sure to not reintroduce.
Assignee | ||
Comment 14•12 years ago
|
||
(In reply to Boris Zbarsky (:bz) from comment #13)
> > I don't know how to use bonsai to look at the file that was refactored to
> > nsTextControlFrame.cpp
>
> You look in the Attic. Specifically,
> http://bonsai.mozilla.org/cvsblame.
> cgi?file=mozilla%2Flayout%2Fhtml%2Fforms%2Fsrc%2FAttic%2FnsGfxTextControlFram
> e2.cpp
>
> Specifically, that was fixing bug 49339, where there are steps to reproduce
> for single-line textfields and whatnot. And the code it was changing was
> added to fix bug 36130. That was dealing with a similar problem: the
> content shrinking from a long value to a short value and suddenly nothing
> being visible at all in the text input. _That_ is what we should make sure
> to not reintroduce.
I actually tested that case when I wrote the patch and it was working great.
Using the previous test cases, this one
https://bugzilla.mozilla.org/attachment.cgi?id=7677
behaves the same with and without the patch.
And this one
https://bugzilla.mozilla.org/attachment.cgi?id=10216
no longer scrolls to the top which I believe is a okay behaviour.
I should probably write an automated test for that I guess.
Comment 15•12 years ago
|
||
Comment on attachment 714984 [details] [diff] [review]
Patch
Thanks for checking that.
r=me
Attachment #714984 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 16•12 years ago
|
||
(In reply to Mounir Lamouri (:mounir) from comment #14)
> (In reply to Boris Zbarsky (:bz) from comment #13)
> > > I don't know how to use bonsai to look at the file that was refactored to
> > > nsTextControlFrame.cpp
> >
> > You look in the Attic. Specifically,
> > http://bonsai.mozilla.org/cvsblame.
> > cgi?file=mozilla%2Flayout%2Fhtml%2Fforms%2Fsrc%2FAttic%2FnsGfxTextControlFram
> > e2.cpp
> >
> > Specifically, that was fixing bug 49339, where there are steps to reproduce
> > for single-line textfields and whatnot. And the code it was changing was
> > added to fix bug 36130. That was dealing with a similar problem: the
> > content shrinking from a long value to a short value and suddenly nothing
> > being visible at all in the text input. _That_ is what we should make sure
> > to not reintroduce.
>
> I actually tested that case when I wrote the patch and it was working great.
>
> Using the previous test cases, this one
> https://bugzilla.mozilla.org/attachment.cgi?id=7677
> behaves the same with and without the patch.
I have added a test for this.
Assignee | ||
Updated•12 years ago
|
Whiteboard: DUPEME
Assignee | ||
Comment 17•12 years ago
|
||
Target Milestone: --- → mozilla22
Assignee | ||
Updated•12 years ago
|
Component: Editor → DOM: Core & HTML
Assignee | ||
Comment 18•12 years ago
|
||
This has been merged to m-c 5 days ago. For same reason, the merge tool failed to mark the bug as fixed.
https://hg.mozilla.org/mozilla-central/rev/ebbcf3fc9240
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment 19•12 years ago
|
||
(In reply to Mounir Lamouri (:mounir) from comment #18)
> This has been merged to m-c 5 days ago. For same reason, the merge tool
> failed to mark the bug as fixed.
> https://hg.mozilla.org/mozilla-central/rev/ebbcf3fc9240
Because it uses the first bug number in the commit message, which was bug 230474.
As for why bug 230474 itself only had the comment added, and not resolved fixed - I can only think that RyanVM overrode the "please mark this as resolved" checkbox.
Ryan, was this the case?
Comment 20•12 years ago
|
||
Can't say I remember at this point. Probably something silly like that.
You need to log in
before you can comment on or make changes to this bug.
Description
•