HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
39347427[Gecko] [Internet Explorer] [Opera] [Webkit] textarea.maxLength and input.maxLength apparently return -1 when the attribute is missing.2009-09-21 23:12
@@ -4986,20 +4986,35 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
   integers">rules for parsing signed integers</span>, and if that is
   successful, and the value is in the range of the IDL attribute's
   type, the resulting value must be returned. If, on the other hand,
   it fails or returns an out of range value, or if the attribute is
   absent, then the default value must be returned instead, or 0 if
   there is no default value. On setting, the given value must be
   converted to the shortest possible string representing the number as
   a <span>valid integer</span> and then that string must be used as
   the new content attribute value.</p>
 
+  <p>If a reflecting IDL attribute is a signed integer type
+  (<code>long</code>) that is <dfn>limited to only positive
+  numbers</dfn> then, on getting, the content attribute must be parsed
+  according to the <span>rules for parsing non-negative
+  integers</span>, and if that is successful, and the value is in the
+  range of the IDL attribute's type, the resulting value must be
+  returned. If, on the other hand, it fails or returns an out of range
+  value, or if the attribute is absent, the default value must be
+  returned instead, or &#x2212;1 if there is no default value. On
+  setting, if the value is negative, the user agent must fire an
+  <code>INDEX_SIZE_ERR</code> exception. Otherwise, the given value
+  must be converted to the shortest possible string representing the
+  number as a <span>valid non-negative integer</span> and then that
+  string must be used as the new content attribute value.</p>
+
   <p>If a reflecting IDL attribute is an <em>unsigned</em> integer
   type (<code>unsigned long</code>) then, on getting, the content
   attribute must be parsed according to the <span>rules for parsing
   non-negative integers</span>, and if that is successful, and the
   value is in the range of the IDL attribute's type, the resulting
   value must be returned. If, on the other hand, it fails or returns
   an out of range value, or if the attribute is absent, the default
   value must be returned instead, or 0 if there is no default
   value. On setting, the given value must be converted to the shortest
   possible string representing the number as a <span>valid
@@ -34294,21 +34309,21 @@ interface <dfn>HTMLFormElement</dfn> : <span>HTMLElement</span> {
   readonly attribute <span>FileList</span> <span title="dom-input-files">files</span>;
            attribute DOMString <span title="dom-fs-formAction">formAction</span>;
            attribute DOMString <span title="dom-fs-formEnctype">formEnctype</span>;
            attribute DOMString <span title="dom-fs-formMethod">formMethod</span>;
            attribute boolean <span title="dom-fs-formNoValidate">formNoValidate</span>;
            attribute DOMString <span title="dom-fs-formTarget">formTarget</span>;
            attribute DOMString <span title="dom-dim-height">height</span>;
            attribute boolean <span title="dom-input-indeterminate">indeterminate</span>;
   readonly attribute <span>HTMLElement</span> <span title="dom-input-list">list</span>;
            attribute DOMString <span title="dom-input-max">max</span>;
-           attribute unsigned long <span title="dom-input-maxLength">maxLength</span>;
+           attribute long <span title="dom-input-maxLength">maxLength</span>;
            attribute DOMString <span title="dom-input-min">min</span>;
            attribute boolean <span title="dom-input-multiple">multiple</span>;
            attribute DOMString <span title="dom-fe-name">name</span>;
            attribute DOMString <span title="dom-input-pattern">pattern</span>;
            attribute DOMString <span title="dom-input-placeholder">placeholder</span>;
            attribute boolean <span title="dom-input-readOnly">readOnly</span>;
            attribute boolean <span title="dom-input-required">required</span>;
            attribute unsigned long <span title="dom-input-size">size</span>;
            attribute DOMString <span title="dom-input-src">src</span>;
            attribute DOMString <span title="dom-input-step">step</span>;
@@ -35644,23 +35659,24 @@ interface <dfn>HTMLFormElement</dfn> : <span>HTMLElement</span> {
   title="dom-input-placeholder"><code>placeholder</code></dfn>, <dfn
   title="dom-input-required"><code>required</code></dfn>, <dfn
   title="dom-input-size"><code>size</code></dfn>, <dfn
   title="dom-input-src"><code>src</code></dfn>, <dfn
   title="dom-input-step"><code>step</code></dfn>, and <dfn
   title="dom-input-type"><code>type</code></dfn> IDL attributes must
   <span>reflect</span> the respective content attributes of the same
   name. The <dfn
   title="dom-input-maxLength"><code>maxLength</code></dfn> IDL
   attribute must <span>reflect</span> the <code
-  title="attr-input-maxlength">maxlength</code> content attribute. The
-  <dfn title="dom-input-readOnly"><code>readOnly</code></dfn> IDL
-  attribute must <span>reflect</span> the <code
+  title="attr-input-maxlength">maxlength</code> content attribute,
+  <span>limited to only positive numbers</span>. The <dfn
+  title="dom-input-readOnly"><code>readOnly</code></dfn> IDL attribute
+  must <span>reflect</span> the <code
   title="attr-input-readonly">readonly</code> content attribute. The
   <dfn
   title="dom-input-defaultChecked"><code>defaultChecked</code></dfn>
   IDL attribute must <span>reflect</span> the <code
   title="attr-input-checked">checked</code> content attribute. The
   <dfn title="dom-input-defaultValue"><code>defaultValue</code></dfn>
   IDL attribute must <span>reflect</span> the <code
   title="attr-input-value">value</code> content attribute.</p>
 
   <p>The <code title="dom-cva-willValidate">willValidate</code>, <code
@@ -41018,21 +41034,21 @@ interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
    <dd><code title="attr-textarea-required">required</code></dd>
    <dd><code title="attr-textarea-rows">rows</code></dd>
    <dd><code title="attr-textarea-wrap">wrap</code></dd>
    <dt>DOM interface:</dt>
    <dd>
 <pre class="idl">interface <dfn>HTMLTextAreaElement</dfn> : <span>HTMLElement</span> {
            attribute boolean <span title="dom-fe-autofocus">autofocus</span>;
            attribute unsigned long <span title="dom-textarea-cols">cols</span>;
            attribute boolean <span title="dom-fe-disabled">disabled</span>;
   readonly attribute <span>HTMLFormElement</span> <span title="dom-fae-form">form</span>;
-           attribute unsigned long <span title="dom-textarea-maxLength">maxLength</span>;
+           attribute long <span title="dom-textarea-maxLength">maxLength</span>;
            attribute DOMString <span title="dom-fe-name">name</span>;
            attribute DOMString <span title="dom-textarea-placeholder">placeholder</span>;
            attribute boolean <span title="dom-textarea-readOnly">readOnly</span>;
            attribute boolean <span title="dom-textarea-required">required</span>;
            attribute unsigned long <span title="dom-textarea-rows">rows</span>;
            attribute DOMString <span title="dom-textarea-wrap">wrap</span>;
 
   readonly attribute DOMString <span title="dom-textarea-type">type</span>;
            attribute DOMString <span title="dom-textarea-defaultValue">defaultValue</span>;
            attribute DOMString <span title="dom-textarea-value">value</span>;
@@ -41312,23 +41328,24 @@ interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
   title="dom-textarea-placeholder"><code>placeholder</code></dfn>,
   <dfn title="dom-textarea-required"><code>required</code></dfn>, <dfn
   title="dom-textarea-rows"><code>rows</code></dfn>, and <dfn
   title="dom-textarea-wrap"><code>wrap</code></dfn> attributes must
   <span>reflect</span> the respective content attributes of the same
   name. The <code title="dom-textarea-cols">cols</code> and <code
   title="dom-textarea-rows">rows</code> attributes are <span>limited
   to only positive non-zero numbers</span>. The <dfn
   title="dom-textarea-maxLength"><code>maxLength</code></dfn> IDL
   attribute must <span>reflect</span> the <code
-  title="attr-textarea-maxlength">maxlength</code> content attribute.
-  The <dfn title="dom-textarea-readOnly"><code>readOnly</code></dfn>
-  IDL attribute must <span>reflect</span> the <code
+  title="attr-textarea-maxlength">maxlength</code> content attribute,
+  <span>limited to only positive numbers</span>. The <dfn
+  title="dom-textarea-readOnly"><code>readOnly</code></dfn> IDL
+  attribute must <span>reflect</span> the <code
   title="attr-textarea-readonly">readonly</code> content
   attribute.</p>
 
   <p>The <dfn title="dom-textarea-type"><code>type</code></dfn> IDL
   attribute must return the value "<code title="">textarea</code>".</p>
 
   <p>The <dfn
   title="dom-textarea-defaultValue"><code>defaultValue</code></dfn>
   IDL attribute must act like the element's <code>textContent</code>
   IDL attribute.</p>

|