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
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: Trunk
: All All
-- normal (vote)
: mozilla8
Assigned To: Mounir Lamouri (:mounir)
: Andrew Overholt [:overholt]
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:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

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

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

But if you do:
input.type = 'email';
input.value = ',';
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 User image 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 User image Jonas Sicking (:sicking) No longer reading bugmail consistently 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 User image Mounir Lamouri (:mounir) 2011-07-06 06:02:40 PDT

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