The default bug view has changed. See this FAQ.

Implement <input type=date> min attribute

RESOLVED FIXED in mozilla20

Status

()

Core
DOM: Core & HTML
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: raphc, Assigned: raphc)

Tracking

({doc-bug-filed})

Trunk
mozilla20
doc-bug-filed
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 3 obsolete attachments)

Comment hidden (empty)
(Assignee)

Updated

5 years ago
Depends on: 769385
(Assignee)

Comment 1

5 years ago
Created attachment 645694 [details] [diff] [review]
patch

This patch applies on top of the one in bug 769355.
Attachment #645694 - Flags: feedback?(mounir)
(Assignee)

Updated

5 years ago
Depends on: 769355
(Assignee)

Updated

5 years ago
Blocks: 769359
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

5 years ago
Created attachment 650141 [details] [diff] [review]
patch
Attachment #645694 - Attachment is obsolete: true
Attachment #650141 - Flags: review?(mounir)
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

5 years ago
Created attachment 650249 [details] [diff] [review]
patch
Attachment #650141 - Attachment is obsolete: true
Attachment #650249 - Flags: review+
(Assignee)

Comment 6

5 years ago
Created attachment 652509 [details] [diff] [review]
patch

Updated patch.
Attachment #650249 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/5705bb322879
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Keywords: dev-doc-needed
See bug 866440 for documentation.
Keywords: dev-doc-needed → doc-bug-filed
You need to log in before you can comment on or make changes to this bug.