Bug 635553 (1/2) - Add the min attribute to HTMLInputElement. r=sicking
authorMounir Lamouri <mounir.lamouri@gmail.com>
Thu, 05 Jul 2012 12:11:53 +0200
changeset 98376 e5fd860299aa
parent 98375 9d82cf442db1
child 98377 3cc6b0905611
push id23053
push usermlamouri@mozilla.com
push dateThu, 05 Jul 2012 14:52:19 +0000
treeherdermozilla-central@ee2c5f2928b6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs635553
milestone16.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 635553 (1/2) - Add the min attribute to HTMLInputElement. r=sicking
content/html/content/src/nsHTMLInputElement.cpp
content/html/content/test/forms/test_input_attributes_reflection.html
dom/interfaces/html/nsIDOMHTMLInputElement.idl
--- a/content/html/content/src/nsHTMLInputElement.cpp
+++ b/content/html/content/src/nsHTMLInputElement.cpp
@@ -838,16 +838,17 @@ NS_IMPL_STRING_ATTR(nsHTMLInputElement, 
 NS_IMPL_STRING_ATTR(nsHTMLInputElement, Align, align)
 NS_IMPL_STRING_ATTR(nsHTMLInputElement, Alt, alt)
 NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(nsHTMLInputElement, Autocomplete, autocomplete,
                                 kInputDefaultAutocomplete->tag)
 NS_IMPL_BOOL_ATTR(nsHTMLInputElement, Autofocus, autofocus)
 //NS_IMPL_BOOL_ATTR(nsHTMLInputElement, Checked, checked)
 NS_IMPL_BOOL_ATTR(nsHTMLInputElement, Disabled, disabled)
 NS_IMPL_STRING_ATTR(nsHTMLInputElement, Max, max)
+NS_IMPL_STRING_ATTR(nsHTMLInputElement, Min, min)
 NS_IMPL_ACTION_ATTR(nsHTMLInputElement, FormAction, formaction)
 NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(nsHTMLInputElement, FormEnctype, formenctype,
                                 kFormDefaultEnctype->tag)
 NS_IMPL_ENUM_ATTR_DEFAULT_VALUE(nsHTMLInputElement, FormMethod, formmethod,
                                 kFormDefaultMethod->tag)
 NS_IMPL_BOOL_ATTR(nsHTMLInputElement, FormNoValidate, formnovalidate)
 NS_IMPL_STRING_ATTR(nsHTMLInputElement, FormTarget, formtarget)
 NS_IMPL_BOOL_ATTR(nsHTMLInputElement, Multiple, multiple)
--- a/content/html/content/test/forms/test_input_attributes_reflection.html
+++ b/content/html/content/test/forms/test_input_attributes_reflection.html
@@ -119,17 +119,20 @@ reflectString({
 // .maxLength
 reflectInt({
   element: document.createElement("input"),
   attribute: "maxLength",
   nonNegative: true,
 });
 
 // .min
-todo("min" in document.createElement("input"), "min isn't implemented yet");
+reflectString({
+  element: document.createElement('input'),
+  attribute: 'min',
+});
 
 // .multiple
 reflectBoolean({
   element: document.createElement("input"),
   attribute: "multiple",
 });
 
 // .name
--- a/dom/interfaces/html/nsIDOMHTMLInputElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLInputElement.idl
@@ -15,17 +15,17 @@ interface nsIDOMValidityState;
   *
   * This interface is trying to follow the DOM Level 2 HTML specification:
   * http://www.w3.org/TR/DOM-Level-2-HTML/
   *
   * with changes from the work-in-progress WHATWG HTML specification:
   * http://www.whatwg.org/specs/web-apps/current-work/
   */
 
-[scriptable, uuid(23d5399b-004e-469b-a735-d89009ffe9a6)]
+[scriptable, uuid(261b0fa1-dfcc-445d-8ac8-6b3817ec63cb)]
 interface nsIDOMHTMLInputElement : nsIDOMHTMLElement
 {
            attribute DOMString             accept;
            attribute DOMString             alt;
 
            attribute DOMString             autocomplete;
            attribute boolean               autofocus;
            attribute boolean               defaultChecked;
@@ -41,16 +41,17 @@ interface nsIDOMHTMLInputElement : nsIDO
   readonly attribute nsIDOMFileList        files;
 
            attribute unsigned long height;
            attribute boolean               indeterminate;
 
   readonly attribute nsIDOMHTMLElement     list;
            attribute DOMString             max;
            attribute long                  maxLength;
+           attribute DOMString             min;
 
            attribute boolean               multiple;
            attribute DOMString             name;
 
            attribute DOMString             pattern;
            attribute DOMString             placeholder;
            attribute boolean               readOnly;
            attribute boolean               required;