Open Bug 623153 Opened 14 years ago Updated 2 years ago

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

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

People

(Reporter: mounir, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-needed, html5)

Attachments

(2 files, 2 obsolete files)

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)
Attached file Test case
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
Blocks: html-forms

Tests for this have been added to WPT in https://github.com/web-platform-tests/wpt/pull/21060.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: