Last Comment Bug 668817 - Changing the multiple attribute doesn't change the input element validity
: Changing the multiple attribute doesn't change the input element validity
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla8
Assigned To: Mounir Lamouri (:mounir)
:
Mentors:
Depends on:
Blocks: 668816
  Show dependency treegraph
 
Reported: 2011-07-01 08:04 PDT by Mounir Lamouri (:mounir)
Modified: 2011-07-06 06:02 PDT (History)
0 users
mounir: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
One-liner patch (1.10 KB, patch)
2011-07-01 08:11 PDT, Mounir Lamouri (:mounir)
jonas: review+
Details | Diff | Review

Description Mounir Lamouri (:mounir) 2011-07-01 08:04:13 PDT
Basically, if you do:
input.type = 'email';
input.multiple = true;
input.value = 'foo@bar.com, foo@bar.com';
// The input is valid.

But if you do:
input.type = 'email';
input.value = 'foo@bar.com, foo@bar.com';
input.multiple = true;
// The input is invalid.

Because when setting .value, the validity is computed but multiple is false, so the element is invalid. When setting multiple to true, the validity isn't updated so the element is still invalid.
Comment 1 Mounir Lamouri (:mounir) 2011-07-01 08:11:15 PDT
Created attachment 543439 [details] [diff] [review]
One-liner patch

This is going to be tested with bug 668816.
Comment 2 Jonas Sicking (:sicking) PTO Until July 5th 2011-07-05 13:16:04 PDT
Comment on attachment 543439 [details] [diff] [review]
One-liner patch

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

Looks good
Comment 3 Mounir Lamouri (:mounir) 2011-07-06 06:02:40 PDT
Pushed:
http://hg.mozilla.org/mozilla-central/rev/8da59b78d676

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