Skip to content

Commit

Permalink
[giow] (2) textarea.maxLength and input.maxLength apparently return -…
Browse files Browse the repository at this point in the history
…1 when the attribute is missing.

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=7427

git-svn-id: http://svn.whatwg.org/webapps@3934 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 21, 2009
1 parent 6e1cf34 commit 3cf7d29
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 16 deletions.
31 changes: 23 additions & 8 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -5314,6 +5314,21 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
a <a href=#valid-integer>valid integer</a> 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 id=limited-to-only-positive-numbers>limited to only positive
numbers</dfn> then, on getting, the content attribute must be parsed
according to the <a href=#rules-for-parsing-non-negative-integers>rules for parsing non-negative
integers</a>, 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 &minus;1 if there is no default value. On
setting, if the value is negative, the user agent must fire an
<code><a href=#index_size_err>INDEX_SIZE_ERR</a></code> exception. Otherwise, the given value
must be converted to the shortest possible string representing the
number as a <a href=#valid-non-negative-integer>valid non-negative integer</a> 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 <a href=#rules-for-parsing-non-negative-integers>rules for parsing
Expand Down Expand Up @@ -30904,7 +30919,7 @@ interface <dfn id=htmlformelement>HTMLFormElement</dfn> : <a href=#htmlelement>H
attribute boolean <a href=#dom-input-indeterminate title=dom-input-indeterminate>indeterminate</a>;
readonly attribute <a href=#htmlelement>HTMLElement</a> <a href=#dom-input-list title=dom-input-list>list</a>;
attribute DOMString <a href=#dom-input-max title=dom-input-max>max</a>;
attribute unsigned long <a href=#dom-input-maxlength title=dom-input-maxLength>maxLength</a>;
attribute long <a href=#dom-input-maxlength title=dom-input-maxLength>maxLength</a>;
attribute DOMString <a href=#dom-input-min title=dom-input-min>min</a>;
attribute boolean <a href=#dom-input-multiple title=dom-input-multiple>multiple</a>;
attribute DOMString <a href=#dom-fe-name title=dom-fe-name>name</a>;
Expand Down Expand Up @@ -32091,9 +32106,9 @@ interface <dfn id=htmlformelement>HTMLFormElement</dfn> : <a href=#htmlelement>H
<p>The <dfn id=dom-input-accept title=dom-input-accept><code>accept</code></dfn>, <dfn id=dom-input-alt title=dom-input-alt><code>alt</code></dfn>, <dfn id=dom-input-autocomplete title=dom-input-autocomplete><code>autocomplete</code></dfn>, <dfn id=dom-input-max title=dom-input-max><code>max</code></dfn>, <dfn id=dom-input-min title=dom-input-min><code>min</code></dfn>, <dfn id=dom-input-multiple title=dom-input-multiple><code>multiple</code></dfn>, <dfn id=dom-input-pattern title=dom-input-pattern><code>pattern</code></dfn>, <dfn id=dom-input-placeholder title=dom-input-placeholder><code>placeholder</code></dfn>, <dfn id=dom-input-required title=dom-input-required><code>required</code></dfn>, <dfn id=dom-input-size title=dom-input-size><code>size</code></dfn>, <dfn id=dom-input-src title=dom-input-src><code>src</code></dfn>, <dfn id=dom-input-step title=dom-input-step><code>step</code></dfn>, and <dfn id=dom-input-type title=dom-input-type><code>type</code></dfn> IDL attributes must
<a href=#reflect>reflect</a> the respective content attributes of the same
name. The <dfn id=dom-input-maxlength title=dom-input-maxLength><code>maxLength</code></dfn> IDL
attribute must <a href=#reflect>reflect</a> the <code title=attr-input-maxlength><a href=#attr-input-maxlength>maxlength</a></code> content attribute. The
<dfn id=dom-input-readonly title=dom-input-readOnly><code>readOnly</code></dfn> IDL
attribute must <a href=#reflect>reflect</a> the <code title=attr-input-readonly><a href=#attr-input-readonly>readonly</a></code> content attribute. The
attribute must <a href=#reflect>reflect</a> the <code title=attr-input-maxlength><a href=#attr-input-maxlength>maxlength</a></code> content attribute,
<a href=#limited-to-only-positive-numbers>limited to only positive numbers</a>. The <dfn id=dom-input-readonly title=dom-input-readOnly><code>readOnly</code></dfn> IDL attribute
must <a href=#reflect>reflect</a> the <code title=attr-input-readonly><a href=#attr-input-readonly>readonly</a></code> content attribute. The
<dfn id=dom-input-defaultchecked title=dom-input-defaultChecked><code>defaultChecked</code></dfn>
IDL attribute must <a href=#reflect>reflect</a> the <code title=attr-input-checked><a href=#attr-input-checked>checked</a></code> content attribute. The
<dfn id=dom-input-defaultvalue title=dom-input-defaultValue><code>defaultValue</code></dfn>
Expand Down Expand Up @@ -36729,7 +36744,7 @@ interface <dfn id=htmloptionelement>HTMLOptionElement</dfn> : <a href=#htmleleme
attribute unsigned long <a href=#dom-textarea-cols title=dom-textarea-cols>cols</a>;
attribute boolean <a href=#dom-fe-disabled title=dom-fe-disabled>disabled</a>;
readonly attribute <a href=#htmlformelement>HTMLFormElement</a> <a href=#dom-fae-form title=dom-fae-form>form</a>;
attribute unsigned long <a href=#dom-textarea-maxlength title=dom-textarea-maxLength>maxLength</a>;
attribute long <a href=#dom-textarea-maxlength title=dom-textarea-maxLength>maxLength</a>;
attribute DOMString <a href=#dom-fe-name title=dom-fe-name>name</a>;
attribute DOMString <a href=#dom-textarea-placeholder title=dom-textarea-placeholder>placeholder</a>;
attribute boolean <a href=#dom-textarea-readonly title=dom-textarea-readOnly>readOnly</a>;
Expand Down Expand Up @@ -36974,9 +36989,9 @@ interface <dfn id=htmloptionelement>HTMLOptionElement</dfn> : <a href=#htmleleme
<a href=#reflect>reflect</a> the respective content attributes of the same
name. The <code title=dom-textarea-cols><a href=#dom-textarea-cols>cols</a></code> and <code title=dom-textarea-rows><a href=#dom-textarea-rows>rows</a></code> attributes are <a href=#limited-to-only-positive-non-zero-numbers>limited
to only positive non-zero numbers</a>. The <dfn id=dom-textarea-maxlength title=dom-textarea-maxLength><code>maxLength</code></dfn> IDL
attribute must <a href=#reflect>reflect</a> the <code title=attr-textarea-maxlength><a href=#attr-textarea-maxlength>maxlength</a></code> content attribute.
The <dfn id=dom-textarea-readonly title=dom-textarea-readOnly><code>readOnly</code></dfn>
IDL attribute must <a href=#reflect>reflect</a> the <code title=attr-textarea-readonly><a href=#attr-textarea-readonly>readonly</a></code> content
attribute must <a href=#reflect>reflect</a> the <code title=attr-textarea-maxlength><a href=#attr-textarea-maxlength>maxlength</a></code> content attribute,
<a href=#limited-to-only-positive-numbers>limited to only positive numbers</a>. The <dfn id=dom-textarea-readonly title=dom-textarea-readOnly><code>readOnly</code></dfn> IDL
attribute must <a href=#reflect>reflect</a> the <code title=attr-textarea-readonly><a href=#attr-textarea-readonly>readonly</a></code> content
attribute.</p>

<p>The <dfn id=dom-textarea-type title=dom-textarea-type><code>type</code></dfn> IDL
Expand Down
33 changes: 25 additions & 8 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -4993,6 +4993,21 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
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
Expand Down Expand Up @@ -34301,7 +34316,7 @@ interface <dfn>HTMLFormElement</dfn> : <span>HTMLElement</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>;
Expand Down Expand Up @@ -35651,9 +35666,10 @@ interface <dfn>HTMLFormElement</dfn> : <span>HTMLElement</span> {
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>
Expand Down Expand Up @@ -41025,7 +41041,7 @@ interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</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>;
Expand Down Expand Up @@ -41319,9 +41335,10 @@ interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
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>

Expand Down

0 comments on commit 3cf7d29

Please sign in to comment.