When pattern and multiple are specified, pattern should apply to all tokens

NEW
Unassigned

Status

()

defect
P3
normal
9 years ago
7 months ago

People

(Reporter: mounir, Unassigned)

Tracking

(Blocks 1 bug, {dev-doc-needed, html5})

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 2 obsolete attachments)

Reporter

Description

9 years ago
For example:
<input type='email' pattern='[^@]*@company.com' multiple>

Currently, this value is valid:
"foo@company.com"
but not this one:
"foo@company.com, bar@company.com"

Both should be valid.

This bug reflects a recent change in WHAT WG HTML5 specs (r5738).
I'm not really sure about using nsDependentSubstring instead of a string type that owns its buffer. Let me know if you think I should do more research on it. Thank you.
Attachment #8388197 - Flags: review?(mounir)
Reporter

Comment 3

5 years ago
Comment on attachment 8388197 [details] [diff] [review]
Apply pattern to every token for input type="email" multiple

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

What about having a ::GetValues() method that will return the "values" as described in the specification. Then, we could simply run the pattern check on all the different item. The advantage of that approach is that we could then expand it to all types of <input> that have @multiple applying to them.
Attachment #8388197 - Flags: review?(mounir)
Sounds good. Can I have this bug assigned while I'm working on it? Thanks
Assignee: nobody → agi.novanta
Let me know if you prefer not to change IsValidEmailAddress. Thank you.
Attachment #8388197 - Attachment is obsolete: true
Attachment #8391917 - Flags: review?(mounir)
Polished some whitespace change.
Attachment #8391917 - Attachment is obsolete: true
Attachment #8391917 - Flags: review?(mounir)
Attachment #8391919 - Flags: review?(mounir)
Comment on attachment 8391919 [details] [diff] [review]
multipleInput.patch

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

I'm sorry, I just noticed that doing this creates inconsistencies between multiple and non-multiple email checking, in the non-multiple case spaces are not trimmed before checking so " agi@mail.com" is not valid, while in the multiple case it is. Also it allows non-multiple input elements to have more than one email specified (I'll fix this soon). Maybe a partial fix for 805039 would help this?
Attachment #8391919 - Flags: review?(mounir)
Overholt: patch has been sitting here awhile, should probably have someone look at it.
Flags: needinfo?(overholt)
Priority: -- → P3
Agi, are you still working on this?
Flags: needinfo?(overholt) → needinfo?(mounir)
Oops, sorry, Mounir!
Flags: needinfo?(mounir) → needinfo?(agi.novanta)
No, sorry for keeping it assigned!
Flags: needinfo?(agi.novanta)
Assignee: agi.novanta → nobody

Updated

7 months ago
Blocks: html-forms
You need to log in before you can comment on or make changes to this bug.