Closed
Bug 769357
Opened 12 years ago
Closed 12 years ago
Implement <input type=date> min attribute
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla20
People
(Reporter: raphc, Assigned: raphc)
References
Details
(Keywords: doc-bug-filed)
Attachments
(1 file, 3 obsolete files)
5.65 KB,
patch
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•12 years ago
|
||
This patch applies on top of the one in bug 769355.
Attachment #645694 -
Flags: feedback?(mounir)
Comment 2•12 years ago
|
||
Comment on attachment 645694 [details] [diff] [review]
patch
Review of attachment 645694 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/html/content/src/nsHTMLInputElement.cpp
@@ +4597,5 @@
> + double min = GetMinAsDouble();
> + MOZ_ASSERT(!MOZ_DOUBLE_IS_NaN(min));
> +
> + minStr.AppendFloat(min);
> + } else {
else if (mType == NS_FORM_INPUT_DATE)
and:
} else {
MOZ_NOTREACHED();
}
::: content/html/content/test/forms/test_min_attribute.html
@@ +151,5 @@
> +
> + input.min = '0050-01-01';
> + checkValidity(input, true, apply, apply);
> +
> + input.val = '0049-01-01';
input.value
Attachment #645694 -
Flags: feedback?(mounir) → feedback+
Assignee | ||
Comment 3•12 years ago
|
||
Attachment #645694 -
Attachment is obsolete: true
Attachment #650141 -
Flags: review?(mounir)
Comment 4•12 years ago
|
||
Comment on attachment 650141 [details] [diff] [review]
patch
Review of attachment 650141 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/html/content/src/nsHTMLInputElement.cpp
@@ +1257,5 @@
> GetAttr(kNameSpaceID_None, nsGkAtoms::min, minStr);
>
> + double min;
> + bool result = ConvertStringToNumber(minStr, min);
> + return result ? min : MOZ_DOUBLE_NaN();
Could be:
return ConvertStringToNumber(minStr, min) ? min : MOZ_DOUBLE_NaN();
@@ +4625,5 @@
> + minStr.AppendFloat(min);
> + } else if (mType == NS_FORM_INPUT_DATE) {
> + GetAttr(kNameSpaceID_None, nsGkAtoms::min, minStr);
> + } else {
> + NS_NOTREACHED("Invalid input type");
nit: change the error message to "Unexpected input type".
Attachment #650141 -
Flags: review?(mounir) → review+
Assignee | ||
Comment 5•12 years ago
|
||
Attachment #650141 -
Attachment is obsolete: true
Attachment #650249 -
Flags: review+
Comment 7•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Updated•12 years ago
|
Keywords: dev-doc-needed
You need to log in
before you can comment on or make changes to this bug.
Description
•