Closed
Bug 769355
Opened 12 years ago
Closed 12 years ago
Implement <input type=date> max 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, 4 obsolete files)
(deleted),
patch
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•12 years ago
|
||
This patch uses functions from the patch in bug 769370. As long as this one as not been r+ this one might change so a review might not be useful yet. Feedback would still be appreciated though.
Attachment #645693 -
Flags: feedback?(mounir)
Comment 2•12 years ago
|
||
Comment on attachment 645693 [details] [diff] [review]
patch
Review of attachment 645693 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/html/content/src/nsHTMLInputElement.cpp
@@ +1267,5 @@
> nsAutoString maxStr;
> GetAttr(kNameSpaceID_None, nsGkAtoms::max, maxStr);
>
> + double max;
> + bool result = GetDoubleFromString(maxStr, max);
I know understand why you created that method in a previous patch. It will be indeed needed here. Though, I don't quite like the name.
What about: ConvertStringToNumber(), so it will match the specification's naming?
Attachment #645693 -
Flags: feedback?(mounir) → feedback+
Comment 3•12 years ago
|
||
Comment on attachment 645693 [details] [diff] [review]
patch
Review of attachment 645693 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/html/content/src/nsHTMLInputElement.cpp
@@ +4577,5 @@
> + double max = GetMaxAsDouble();
> + MOZ_ASSERT(!MOZ_DOUBLE_IS_NaN(max));
> +
> + maxStr.AppendFloat(max);
> + } else {
else if (mType == NS_FORM_INPUT_DATE)
and:
} else {
MOZ_NOTREACHED();
}
Assignee | ||
Comment 4•12 years ago
|
||
Attachment #645693 -
Attachment is obsolete: true
Attachment #650131 -
Flags: review?(mounir)
Comment 5•12 years ago
|
||
Comment on attachment 650131 [details] [diff] [review]
patch
Review of attachment 650131 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/html/content/src/nsHTMLInputElement.cpp
@@ +1275,5 @@
> GetAttr(kNameSpaceID_None, nsGkAtoms::max, maxStr);
>
> + double max;
> + bool result = ConvertStringToNumber(maxStr, max);
> + return result ? max : MOZ_DOUBLE_NaN();
You can do:
return ConvertStringToNumber(maxStr, max) ? max : MOZ_DOUBLE_NaN();
Attachment #650131 -
Flags: review?(mounir) → review+
Comment 6•12 years ago
|
||
Comment on attachment 650131 [details] [diff] [review]
patch
Review of attachment 650131 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/html/content/src/nsHTMLInputElement.cpp
@@ +4603,5 @@
> + maxStr.AppendFloat(max);
> + } else if (mType == NS_FORM_INPUT_DATE) {
> + GetAttr(kNameSpaceID_None, nsGkAtoms::max, maxStr);
> + } else {
> + NS_NOTREACHED("Invalid input type");
nit: please change that to "Unexpected input type".
Assignee | ||
Comment 7•12 years ago
|
||
Attachment #650131 -
Attachment is obsolete: true
Attachment #650247 -
Flags: review+
Assignee | ||
Comment 8•12 years ago
|
||
Attachment #650247 -
Attachment is obsolete: true
Attachment #650248 -
Flags: review+
Comment 10•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
•