Last Comment Bug 754668 - When resetting a required input, it becomes invalid
: When resetting a required input, it becomes invalid
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla15
Assigned To: Mounir Lamouri (:mounir)
:
: Andrew Overholt [:overholt]
Mentors:
http://jsfiddle.net/UAQdK/4/
Depends on: 755322
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-13 06:23 PDT by Théo Chevalier [:tchevalier]
Modified: 2012-06-01 08:41 PDT (History)
5 users (show)
mounir: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1 (20.00 KB, patch)
2012-05-15 09:12 PDT, Mounir Lamouri (:mounir)
ehsan: review+
mounir: checkin+
Details | Diff | Splinter Review

Description Théo Chevalier [:tchevalier] 2012-05-13 06:23:06 PDT
See the jsfiddle attached.
STR: 
1) Fill in the fields with a name, an email address, a message
2) Click on "Reset"

A red border appears around the inputs, whereas the textarea behavior is good: no red border.

Expected: All the fields should be cleared, and no red border should appear.

Works on all the others browsers.
Comment 1 Boris Zbarsky [:bz] (still a bit busy) 2012-05-13 20:51:55 PDT
And clicking "Reset" again makes the red outline disappear.  That's kinda weird.
Comment 2 Mounir Lamouri (:mounir) 2012-05-15 09:12:34 PDT
Created attachment 624068 [details] [diff] [review]
Patch v1

nsTextEditorState was setting mValueChanged to true when resetting the value to the default value. I could have written a patch setting mValueChanged to false after resetting the value but I think that would have just hidden the issue given that there are other situations where we don't want to update mValueChanged.
Comment 3 :Ehsan Akhgari 2012-05-15 10:11:41 PDT
Comment on attachment 624068 [details] [diff] [review]
Patch v1

Review of attachment 624068 [details] [diff] [review]:
-----------------------------------------------------------------

r=me
Comment 4 Ed Morley [:emorley] 2012-06-01 08:41:31 PDT
https://hg.mozilla.org/mozilla-central/rev/32b0dd97f69b

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