Closed
Bug 829101
Opened 12 years ago
Closed 12 years ago
Update tests for <input type='{email,number}'> value sanitization tests
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla21
People
(Reporter: mounir, Assigned: mounir)
References
Details
Attachments
(1 file)
|
2.10 KB,
patch
|
Ms2ger
:
review+
|
Details | Diff | Splinter Review |
No description provided.
| Assignee | ||
Updated•12 years ago
|
Summary: Update tests (and maybe code) for <input type='{email,number}'> value sanitization tests → Update tests for <input type='{email,number}'> value sanitization tests
Comment 2•12 years ago
|
||
Comment on attachment 700528 [details] [diff] [review]
Patch
Review of attachment 700528 [details] [diff] [review]:
-----------------------------------------------------------------
r=me, thanks.
::: content/html/content/test/forms/test_input_sanitization.html
@@ +51,5 @@
> case "tel":
> return aValue.replace(/[\n\r]/g, "");
> case "url":
> case "email":
> + return aValue.replace(/[\n\r]/g, "").replace(/^[\u0020\u0009\t\u000a\u000c\u000d]+|[\u0020\u0009\t\u000a\u000c\u000d]+$/g, "");
\t === \u0009, no?
@@ +56,3 @@
> case "number":
> + var number = Number(aValue);
> + return number === number ? aValue : "";
!isNaN(Number(aValue)), maybe?
Attachment #700528 -
Flags: review?(Ms2ger) → review+
| Assignee | ||
Comment 3•12 years ago
|
||
(In reply to :Ms2ger from comment #2)
> ::: content/html/content/test/forms/test_input_sanitization.html
> @@ +51,5 @@
> > case "tel":
> > return aValue.replace(/[\n\r]/g, "");
> > case "url":
> > case "email":
> > + return aValue.replace(/[\n\r]/g, "").replace(/^[\u0020\u0009\t\u000a\u000c\u000d]+|[\u0020\u0009\t\u000a\u000c\u000d]+$/g, "");
>
> \t === \u0009, no?
Yes. And \u0020 is " ". Just want to keep the unicode values for all the characters.
> @@ +56,3 @@
> > case "number":
> > + var number = Number(aValue);
> > + return number === number ? aValue : "";
>
> !isNaN(Number(aValue)), maybe?
Maybe, indeed.
| Assignee | ||
Comment 4•12 years ago
|
||
Flags: in-testsuite+
Target Milestone: --- → mozilla21
Comment 5•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•