Skip to content

Commit

Permalink
[] (0) Define how to handle out-of-range content attribute values in …
Browse files Browse the repository at this point in the history
…the DOM.

git-svn-id: http://svn.whatwg.org/webapps@2664 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jan 14, 2009
1 parent e7dd0d2 commit 06115ad
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 62 deletions.
68 changes: 37 additions & 31 deletions index
Expand Up @@ -5190,52 +5190,58 @@
(<code>long</code>) then, on getting, the content attribute must be
parsed according to the <a href=#rules-for-parsing-integers title="rules for parsing
integers">rules for parsing signed integers</a>, and if that is
successful, the resulting value must be returned. If, on the other
hand, it fails, 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 <a href=#valid-integer>valid
integer</a> in base ten and then that string must be used as the
new content attribute value.</p>
successful, and the value is in the range of the DOM 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 <a href=#valid-integer>valid integer</a> in base ten and then that string must
be used as the new content attribute value.</p>

<p>If a reflecting DOM 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
non-negative integers</a>, and if that is successful, the
resulting value must be returned. If, on the other hand, it fails,
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 <a href=#valid-non-negative-integer>valid non-negative integer</a> in base ten
and then that string must be used as the new content attribute
value.</p>
non-negative integers</a>, and if that is successful, and the
value is in the range of the DOM 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 <a href=#valid-non-negative-integer>valid
non-negative integer</a> in base ten and then that string must be
used as the new content attribute value.</p>

<p>If a reflecting DOM attribute is an unsigned integer type
(<code>unsigned long</code>) that is <dfn id=limited-to-only-positive-non-zero-numbers>limited to only positive
non-zero numbers</dfn>, then the behavior is similar to the previous
case, but zero is not allowed. On getting, the content attribute
must first 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, the
resulting value must be returned. If, on the other hand, it fails,
or if the attribute is absent, the default value must be returned
instead, or 1 if there is no default value. On setting, if the value
is zero, 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> in base ten and then that string must be
used as the new content attribute value.</p>
non-negative integers</a>, and if that is successful, and the
value is in the range of the DOM 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 1 if there is no default
value. On setting, if the value is zero, 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> in base ten and
then that string must be used as the new content attribute
value.</p>

<p>If a reflecting DOM attribute is a floating point number type
(<code>float</code>) and it doesn't fall into one of the earlier
categories, then, on getting, the content attribute must be parsed
according to the <a href=#rules-for-parsing-floating-point-number-values>rules for parsing floating point number
values</a>, and if that is successful, the resulting value must
be returned. If, on the other hand, it fails, or if the attribute is
absent, the default value must be returned instead, or 0.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
<a href=#valid-floating-point-number>valid floating point number</a> in base ten and then that
string must be used as the new content attribute value.</p>
values</a>, and if that is successful, and the value is in the
range of the DOM 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.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 <a href=#valid-floating-point-number>valid floating point
number</a> in base ten and then that string must be used as the
new content attribute value.</p>

<p>If a reflecting DOM attribute is of the type
<code><a href=#domtokenlist-0>DOMTokenList</a></code>, then on getting it must return a
Expand Down
68 changes: 37 additions & 31 deletions source
Expand Up @@ -5014,52 +5014,58 @@
(<code>long</code>) then, on getting, the content attribute must be
parsed according to the <span title="rules for parsing
integers">rules for parsing signed integers</span>, and if that is
successful, the resulting value must be returned. If, on the other
hand, it fails, 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> in base ten and then that string must be used as the
new content attribute value.</p>
successful, and the value is in the range of the DOM 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> in base ten and then that string must
be used as the new content attribute value.</p>

<p>If a reflecting DOM 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, the
resulting value must be returned. If, on the other hand, it fails,
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 non-negative integer</span> in base ten
and then that string must be used as the new content attribute
value.</p>
non-negative integers</span>, and if that is successful, and the
value is in the range of the DOM 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
non-negative integer</span> in base ten and then that string must be
used as the new content attribute value.</p>

<p>If a reflecting DOM attribute is an unsigned integer type
(<code>unsigned long</code>) that is <dfn>limited to only positive
non-zero numbers</dfn>, then the behavior is similar to the previous
case, but zero is not allowed. On getting, the content attribute
must first be parsed according to the <span>rules for parsing
non-negative integers</span>, and if that is successful, the
resulting value must be returned. If, on the other hand, it fails,
or if the attribute is absent, the default value must be returned
instead, or 1 if there is no default value. On setting, if the value
is zero, 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> in base ten and then that string must be
used as the new content attribute value.</p>
non-negative integers</span>, and if that is successful, and the
value is in the range of the DOM 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 1 if there is no default
value. On setting, if the value is zero, 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> in base ten and
then that string must be used as the new content attribute
value.</p>

<p>If a reflecting DOM attribute is a floating point number type
(<code>float</code>) and it doesn't fall into one of the earlier
categories, then, on getting, the content attribute must be parsed
according to the <span>rules for parsing floating point number
values</span>, and if that is successful, the resulting value must
be returned. If, on the other hand, it fails, or if the attribute is
absent, the default value must be returned instead, or 0.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 floating point number</span> in base ten and then that
string must be used as the new content attribute value.</p>
values</span>, and if that is successful, and the value is in the
range of the DOM 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.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 floating point
number</span> in base ten and then that string must be used as the
new content attribute value.</p>

<p>If a reflecting DOM attribute is of the type
<code>DOMTokenList</code>, then on getting it must return a
Expand Down

0 comments on commit 06115ad

Please sign in to comment.