Changing the multiple attribute doesn't change the input element validity

RESOLVED FIXED in mozilla8

Status

()

Core
DOM: Core & HTML
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: mounir, Assigned: mounir)

Tracking

Trunk
mozilla8
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
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.
(Assignee)

Comment 1

6 years ago
Created attachment 543439 [details] [diff] [review]
One-liner patch

This is going to be tested with bug 668816.
Assignee: nobody → mounir
Attachment #543439 - Flags: review?(jonas)
(Assignee)

Updated

6 years ago
Whiteboard: [needs review]
Comment on attachment 543439 [details] [diff] [review]
One-liner patch

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

Looks good
Attachment #543439 - Flags: review?(jonas) → review+
(Assignee)

Updated

6 years ago
Flags: in-testsuite+
Whiteboard: [needs review] → [inbound]
(Assignee)

Comment 3

6 years ago
Pushed:
http://hg.mozilla.org/mozilla-central/rev/8da59b78d676
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla8
You need to log in before you can comment on or make changes to this bug.