First Character Being Eaten during Type Change on Input Field
Categories
(Core :: DOM: Forms, defect, P3)
Tracking
()
People
(Reporter: agaripian, Unassigned)
References
()
Details
(5 keywords)
Attachments
(2 files, 1 obsolete file)
323 bytes,
text/html
|
Details | |
3.78 KB,
patch
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36 Steps to reproduce: Use the url below to type in a username, use the tab key to switch to the input field and type in a password. http://jsbin.com/uVAzenE/5/edit?html,js,output Actual results: The first character in the password field was eaten. It never made it to the input field. Expected results: The first character should have appeared in the input field. This used to work fine in older versions of FireFox such as version 17.0.1
The regression range is Last good nightly: 2013-02-13 First bad nightly: 2013-02-14 Pushlog: http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=161a347bda5b&tochange=aceeea086ccb Google Chrome (v30) seems to do the same thing, so this might not be a valid bug.
Google Chrome V30+ only has this issue. The issue did not exist in v29 and below. Why did it change? It was working in the past.
The first bad revision is: changeset: 121726:25ae6325380b user: Mounir Lamouri date: Tue Feb 12 20:16:58 2013 +0000 summary: Bug 665655 - Make mInputData.mValue really used and usable. r=bz
Comment 5•10 years ago
|
||
From what I understand, the problem is in HTMLInputElement::HandleTypeChange if (IsSingleLineTextControl()) { mInputData.mState = new nsTextEditorState(this); } this code is resetting the Editor's state every time, not just when needed as it was before. This (probably) causes the onkeypress event to not complete and never adding the character. Reverting this part of the changes fixes this bug, from the discussion it doesn't seem there is a reason to do this every time (not just when needed). Let me know if actually there is. Side note, I couldn't reproduce the simple testcase on the nightly build, but the link in the first comment is still showing the bug.
Comment 6•10 years ago
|
||
Comment on attachment 8388217 [details] [diff] [review] Handle input type change correctly Review of attachment 8388217 [details] [diff] [review]: ----------------------------------------------------------------- jwatt, could you have a look at that?
Comment 7•10 years ago
|
||
Comment on attachment 8388217 [details] [diff] [review] Handle input type change correctly Feel free to add me later as a reviewer.
Comment 8•10 years ago
|
||
Mounir, do you have time to look at my patch now? It looks like jwatt is away. I'll post a mochitest later this week. Thanks!
Comment 9•10 years ago
|
||
Comment on attachment 8388217 [details] [diff] [review] Handle input type change correctly Review of attachment 8388217 [details] [diff] [review]: ----------------------------------------------------------------- It looks okay but could you write a test for that please? ::: content/html/content/src/HTMLInputElement.cpp @@ +4418,5 @@ > if (aOldValueMode == VALUE_MODE_VALUE) { > GetValue(aOldValue); > } > > + // Only single line text inputs have a text editor state. Hmm, what about this: // Only single line text inputs have a text editor state but we want to make sure we have it correctly cleaned or set-up when needed. @@ +4420,5 @@ > } > > + // Only single line text inputs have a text editor state. > + bool isNewTypeSingleLine = IsSingleLineTextControl(PR_FALSE, aNewType); > + bool isCurrentTypeSingleLine = IsSingleLineTextControl(PR_FALSE, mType); s/PR_FALSE/false/ @@ +4427,5 @@ > + FreeData(); > + mInputData.mState = new nsTextEditorState(this); > + } else if (isCurrentTypeSingleLine && !isNewTypeSingleLine) { > + FreeData(); > + } I think this is pretty hard to read. What about this: if (IsSingleTextControl(false, aNewType) != IsSingleTextControl()) { FreeData(); if (IsSingleTextControl(false, aNewType)) { mInputData.mState = new nsTextEditorState(this); } } @@ +4428,5 @@ > + mInputData.mState = new nsTextEditorState(this); > + } else if (isCurrentTypeSingleLine && !isNewTypeSingleLine) { > + FreeData(); > + } > + nit: trailing whitespace.
Updated•10 years ago
|
Comment 10•10 years ago
|
||
Thanks for taking the time Mounir. I added a mochitest and pushed to Try servers here: https://tbpl.mozilla.org/?tree=Try&rev=cc743a1a9cbe It looks like only e10s is failing the test. I'm guessing is a dependency from another bug, but I haven't really investigated it. Mounir, do you think we can push it to m-c disabling the test on e10s? Or else I can look more into it. Thanks!
Comment 11•8 years ago
|
||
Dropping needinfo? request because it was two years ago. If you still want to hear from me, please add the flag back.
Updated•8 years ago
|
Updated•6 years ago
|
Updated•3 years ago
|
Updated•2 years ago
|
Comment 12•2 years ago
|
||
If this issue is available I'd take it, if anyone sees this could you please assign me so I can find this bug more easily again later
Updated•2 years ago
|
Comment 13•1 year ago
|
||
This good-first-bug hasn't had any activity for 2 months, it is automatically unassigned.
For more information, please visit auto_nag documentation.
Comment 14•1 year ago
|
||
If this issue if available I'd take it.. if anyone sees this could you please assign me if no one else is working on this. I am very interested in this
Comment 15•11 months ago
|
||
Can I take this issue and try to work on it?
This is my first time trying to contribute to firefox nightly
Comment 16•7 months ago
|
||
Hi Jai Sai Chand Tumu and Richard Cheng,
I am sorry that I didn't notice your comments earlier. The issue is still open, and we welcome and appreciate your contribution.
If you are still available and interested in taking this bug, please feel free to assign this to yourself, or Request information (needinfo) from me that I can assign to you.
If you are looking for other good-first-bugs, we hope this page could be useful to you.
Comment 17•7 months ago
|
||
(In reply to Hsin-Yi Tsai (she/her) [:hsinyi] from comment #16)
Hi Jai Sai Chand Tumu and Richard Cheng,
I am sorry that I didn't notice your comments earlier. The issue is still open, and we welcome and appreciate your contribution.If you are still available and interested in taking this bug, please feel free to assign this to yourself, or Request information (needinfo) from me that I can assign to you.
If you are looking for other good-first-bugs, we hope this page could be useful to you.
I wanna work on this.. I might reach out to you on mail if I need help as I have never fixed any bugs in firefox and this is my first bug
Comment 18•7 months ago
|
||
(In reply to Jai Sai Chand Tumu from comment #17)
(In reply to Hsin-Yi Tsai (she/her) [:hsinyi] from comment #16)
Hi Jai Sai Chand Tumu and Richard Cheng,
I am sorry that I didn't notice your comments earlier. The issue is still open, and we welcome and appreciate your contribution.If you are still available and interested in taking this bug, please feel free to assign this to yourself, or Request information (needinfo) from me that I can assign to you.
If you are looking for other good-first-bugs, we hope this page could be useful to you.I wanna work on this.. I might reach out to you on mail if I need help as I have never fixed any bugs in firefox and this is my first bug
Hi! Thank you for the interest. I've assigned this bug to you. :)
Please feel free to reach out to me if you have any questions; or find our team at Matrix
Comment 19•7 months ago
|
||
To recap the next steps for resolving this issue per the chat with :edgar -
generally comment 5 is still the right summary for this issue. This WIP patch points to the right direction. Who plans to fix this may want to start with looking into the code of HTMLInputElement::HandleTypeChange and update the code of calling IsSingleLineTextControl() in that class as what the WIP patch did.
Comment 20•5 months ago
|
||
This good-first-bug hasn't had any activity for 2 months, it is automatically unassigned.
For more information, please visit BugBot documentation.
Comment 21•4 months ago
|
||
Clear a needinfo that is pending on an inactive user.
Inactive users most likely will not respond; if the missing information is essential and cannot be collected another way, the bug maybe should be closed as INCOMPLETE
.
For more information, please visit BugBot documentation.
Description
•