Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not throw for zero colgroup/col.span and textarea.rows/cols #1693

Merged
merged 1 commit into from Aug 19, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
61 changes: 41 additions & 20 deletions source
Expand Up @@ -7459,6 +7459,19 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<span>valid non-negative integer</span> and that string must be used as the new content attribute
value.</p> <!-- see previous paragraph for note about the weird range -->

<p>If a reflecting IDL attribute has an unsigned integer type (<code
data-x="idl-unsigned-long">unsigned long</code>) that is <dfn>limited to only non-negative numbers
greater than zero with fallback</dfn>, then the behaviour is similar to the previous case, but
disallowed values are converted to the default value. 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, and the value is in the range 1 to 2147483647 inclusive, 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. On setting, first, if the new value is in the
range 1 to 2147483647, then let <var>n</var> be the new value, otherwise let <var>n</var> be the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should mention inclusive here too (style I used elsewhere was "the range x to y, inclusive," btw)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm I guess the current style is to not do that, although if you search for "the range" it seems HTML has all kinds of styles

default value; then, <var>n</var> must be converted to the shortest possible string representing
the number as a <span>valid non-negative integer</span> and that string must be used as the new
content attribute value.</p> <!-- see previous paragraph for note about the weird range -->

<p>If a reflecting IDL attribute has a floating-point number type (<code
data-x="idl-double">double</code> or <code data-x="idl-unrestricted-double">unrestricted
double</code>), then, on getting, the content attribute must be parsed according to the
Expand Down Expand Up @@ -38783,7 +38796,7 @@ interface <dfn>HTMLTableColElement</dfn> : <span>HTMLElement</span> {

<p>The <dfn><code data-x="dom-colgroup-span">span</code></dfn> IDL attribute must
<span>reflect</span> the content attribute of the same name. The value must be <span>limited to
only non-negative numbers greater than zero</span>.</p>
only non-negative numbers greater than zero with fallback</span>, with a default value of 1.</p>

</div>

Expand Down Expand Up @@ -38825,7 +38838,7 @@ interface <dfn>HTMLTableColElement</dfn> : <span>HTMLElement</span> {

<p>The <dfn><code data-x="dom-col-span">span</code></dfn> IDL attribute must <span>reflect</span>
the content attribute of the same name. The value must be <span>limited to only non-negative
numbers greater than zero</span>.</p>
numbers greater than zero with fallback</span>, with a default value of 1.</p>

</div>

Expand Down Expand Up @@ -49750,33 +49763,41 @@ interface <dfn>HTMLTextAreaElement</dfn> : <span>HTMLElement</span> {

<div w-nodev>

<p>The <dfn><code data-x="dom-textarea-cols">cols</code></dfn>, <dfn><code data-x="dom-textarea-placeholder">placeholder</code></dfn>, <dfn><code data-x="dom-textarea-required">required</code></dfn>, <dfn><code data-x="dom-textarea-rows">rows</code></dfn>, and <dfn><code data-x="dom-textarea-wrap">wrap</code></dfn> attributes must <span>reflect</span> the
<p>The <dfn><code data-x="dom-textarea-cols">cols</code></dfn>, <dfn><code
data-x="dom-textarea-placeholder">placeholder</code></dfn>, <dfn><code
data-x="dom-textarea-required">required</code></dfn>, <dfn><code
data-x="dom-textarea-rows">rows</code></dfn>, and <dfn><code
data-x="dom-textarea-wrap">wrap</code></dfn> IDL attributes must <span>reflect</span> the
respective content attributes of the same name. The <code data-x="dom-textarea-cols">cols</code>
and <code data-x="dom-textarea-rows">rows</code> attributes are <span>limited to only non-negative
numbers greater than zero</span>. The <code data-x="dom-textarea-cols">cols</code> attribute's
default value is 20. The <code data-x="dom-textarea-rows">rows</code> attribute's default value is
2. The <dfn><code data-x="dom-textarea-dirName">dirName</code></dfn> IDL attribute must
<span>reflect</span> the <code data-x="attr-fe-dirname">dirname</code> content attribute. The <dfn><code data-x="dom-textarea-inputMode">inputMode</code></dfn> IDL attribute must
<span>reflect</span> the <code data-x="attr-fe-inputmode">inputmode</code> content attribute,
<span>limited to only known values</span>. The <dfn><code data-x="dom-textarea-maxLength">maxLength</code></dfn> IDL attribute must
<span>reflect</span> the <code data-x="attr-textarea-maxlength">maxlength</code> content attribute,
<span>limited to only non-negative numbers</span>. The <dfn><code data-x="dom-textarea-minLength">minLength</code></dfn> IDL attribute must
<span>reflect</span> the <code data-x="attr-textarea-minlength">minlength</code> content attribute,
<span>limited to only non-negative numbers</span>. The <dfn><code data-x="dom-textarea-readOnly">readOnly</code></dfn> IDL attribute must <span>reflect</span>
the <code data-x="attr-textarea-readonly">readonly</code> content attribute.</p>
numbers greater than zero with fallback</span>. The <code data-x="dom-textarea-cols">cols</code>
IDL attribute's default value is 20. The <code data-x="dom-textarea-rows">rows</code> IDL
attribute's default value is 2. The <dfn><code data-x="dom-textarea-dirName">dirName</code></dfn>
IDL attribute must <span>reflect</span> the <code data-x="attr-fe-dirname">dirname</code> content
attribute. The <dfn><code data-x="dom-textarea-inputMode">inputMode</code></dfn> IDL attribute
must <span>reflect</span> the <code data-x="attr-fe-inputmode">inputmode</code> content attribute,
<span>limited to only known values</span>. The <dfn><code
data-x="dom-textarea-maxLength">maxLength</code></dfn> IDL attribute must <span>reflect</span> the
<code data-x="attr-textarea-maxlength">maxlength</code> content attribute, <span>limited to only
non-negative numbers</span>. The <dfn><code data-x="dom-textarea-minLength">minLength</code></dfn>
IDL attribute must <span>reflect</span> the <code
data-x="attr-textarea-minlength">minlength</code> content attribute, <span>limited to only
non-negative numbers</span>. The <dfn><code data-x="dom-textarea-readOnly">readOnly</code></dfn>
IDL attribute must <span>reflect</span> the <code data-x="attr-textarea-readonly">readonly</code>
content attribute.</p>

<p>The <dfn><code data-x="dom-textarea-type">type</code></dfn> IDL attribute must return the value
"<code data-x="">textarea</code>".</p>

<p>The <dfn><code data-x="dom-textarea-defaultValue">defaultValue</code></dfn> IDL attribute must
act like the element's <code>textContent</code> IDL attribute.</p>

<p>The <dfn><code data-x="dom-textarea-value">value</code></dfn> attribute must, on getting, return
the element's <span data-x="concept-textarea-api-value">API value</span>; on setting, it must set
the element's <span data-x="concept-textarea-raw-value">raw value</span> to the new value, set the
element's <span data-x="concept-textarea-dirty">dirty value flag</span> to true, and should then
move the text entry cursor position to the end of the text control, unselecting any selected text
and resetting the selection direction to <i>none</i>.</p>
<p>The <dfn><code data-x="dom-textarea-value">value</code></dfn> IDL attribute must, on getting,
return the element's <span data-x="concept-textarea-api-value">API value</span>; on setting, it
must set the element's <span data-x="concept-textarea-raw-value">raw value</span> to the new
value, set the element's <span data-x="concept-textarea-dirty">dirty value flag</span> to true,
and should then move the text entry cursor position to the end of the text control, unselecting
any selected text and resetting the selection direction to <i>none</i>.</p>

<p>The <dfn><code data-x="dom-textarea-textLength">textLength</code></dfn> IDL attribute must
return the <span>code-unit length</span> of the element's <span
Expand Down