Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[] (0) WF2: Define input.value, especially for type=text; and related…
… tweaks to make things read better.

git-svn-id: http://svn.whatwg.org/webapps@2213 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 18, 2008
1 parent 9d3f1e2 commit bdf804c
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 34 deletions.
61 changes: 39 additions & 22 deletions index
Expand Up @@ -28606,7 +28606,7 @@ function AddCloud(data, x, y) { ... }</pre>
state must be invoked.

<p>Each <code><a href="#input0">input</a></code> element has a <a
href="#value11" title=concept-fe-value>value</a>, which is exposed by the
href="#value12" title=concept-fe-value>value</a>, which is exposed by the
<code title=dom-input-value><a href="#value9">value</a></code> DOM
attribute.

Expand All @@ -28617,7 +28617,11 @@ function AddCloud(data, x, y) { ... }</pre>
element is <dfn id=immutable
title=concept-input-immutable><i>immutable</i></dfn>. Unless otherwise
specified, an <code><a href="#input0">input</a></code> element is always
<i title=concept-input-mutable><a href="#mutable">mutable</a></i>.
<i title=concept-input-mutable><a href="#mutable">mutable</a></i>. When an
<code><a href="#input0">input</a></code> element is <i
title=concept-input-immutable><a href="#immutable">immutable</a></i>, the
user agent should not allow the user to modify the <a href="#value12"
title=concept-fe-value>value</a>.

<p>When an <code><a href="#input0">input</a></code> element is <a
href="#disabled4" title=concept-fe-disabled>disabled</a>, it is <i
Expand All @@ -28637,10 +28641,10 @@ function AddCloud(data, x, y) { ... }</pre>
href="#dirty0">dirty</a></i>) when the element is created, and must be set
to true (<i title=concept-input-dirty><a href="#dirty0">dirty</a></i>)
whenever the user interacts with the control in a way that changes the <a
href="#value11" title=concept-fe-value>value</a>.
href="#value12" title=concept-fe-value>value</a>.

<p>The <dfn id=value8 title=attr-input-value><code>value</code></dfn>
content attribute gives the default <a href="#value11"
content attribute gives the default <a href="#value12"
title=concept-fe-value>value</a> of the <code><a
href="#input0">input</a></code> element. When the <code
title=attr-input-value><a href="#value8">value</a></code> content
Expand Down Expand Up @@ -28726,7 +28730,18 @@ function AddCloud(data, x, y) { ... }</pre>
<p>When an <code><a href="#input0">input</a></code> element's <code
title=attr-input-type><a href="#type12">type</a></code> attribute is in
the <a href="#text2" title=attr-input-type-text>Text</a> state, the
element represents a text edit control for a single line of plain text.
element represents a one line plain text edit control for the element's <a
href="#value12" title=concept-fe-value>value</a>.

<p>If an <code><a href="#input0">input</a></code> element whose <code
title=attr-input-type><a href="#type12">type</a></code> attribute is in
the <a href="#text2" title=attr-input-type-text>Text</a> state is <i
title=concept-input-mutable><a href="#mutable">mutable</a></i>, its <a
href="#value12" title=concept-fe-value>value</a> should be editable by the
user. User agents must not allow users to insert U+000A LINE FEED (LF) or
U+000D CARRIAGE RETURN (CR) characters into the <a href="#value12"
title=concept-fe-value>value</a> of such <code><a
href="#input0">input</a></code> elements.

<p><strong>The <a href="#text2" title=attr-input-type-text>Text</a> state's
<a href="#control0">control initialization algorithm</a> is as
Expand All @@ -28737,20 +28752,15 @@ function AddCloud(data, x, y) { ... }</pre>
<a href="#default2">default value change algorithm</a> is as
follows:</strong> If the <code><a href="#input0">input</a></code> element
is not <i title=concept-input-dirty><a href="#dirty0">dirty</a></i> then
set the <a href="#value11" title=concept-fe-value>value</a> of the element
set the <a href="#value12" title=concept-fe-value>value</a> of the element
to the value of the <code title=attr-input-value><a
href="#value8">value</a></code> content attribute and <a
href="#strip">strip line breaks from the value</a>.

<p>If an <code><a href="#input0">input</a></code> element whose <code
title=attr-input-type><a href="#type12">type</a></code> attribute is in
the <a href="#text2" title=attr-input-type-text>Text</a> state is <i
title=concept-input-mutable><a href="#mutable">mutable</a></i>, its <a
href="#value11" title=concept-fe-value>value</a> should be editable by the
user. User agents must not allow users to insert U+000A LINE FEED (LF) or
U+000D CARRIAGE RETURN (CR) characters into the <a href="#value11"
title=concept-fe-value>value</a> of such <code><a
href="#input0">input</a></code> elements.
<p><strong>The <a href="#value10"><code title=dom-input-value>value</code>
setter algorithm</a> is as follows:</strong> Set the <a href="#value12"
title=concept-fe-value>value</a> of the element to the new value and <a
href="#strip">strip line breaks from the value</a>.

<p>When an <code><a href="#input0">input</a></code> element's <code
title=attr-input-type><a href="#type12">type</a></code> attribute is in
Expand Down Expand Up @@ -29013,7 +29023,7 @@ rel="" on submit buttons?

<p>When a user agent is to <dfn id=strip>strip line breaks from the
value</dfn>, the user agent must remove any U+000A LINE FEED (LF) and
U+000D CARRIAGE RETURN (CR) characters from <a href="#value11"
U+000D CARRIAGE RETURN (CR) characters from <a href="#value12"
title=concept-fe-value>value</a>.

<h5 id=common4><span class=secno>4.9.4.2. </span>Common <code><a
Expand Down Expand Up @@ -29093,8 +29103,15 @@ rel="" on submit buttons?

<h6 id=value><span class=secno>4.9.4.3.1. </span>Value manipulation</h6>

<p class=big-issue>... <dfn id=value9
title=dom-input-value><code>value</code></dfn>
<p>The <dfn id=value9 title=dom-input-value><code>value</code></dfn> DOM
attribute allows secripts to manipulate the <span
title=concept-input-value>value</span> of an <code><a
href="#input0">input</a></code> element. On getting, it must return the
current <span title=concept-input-value>value</span> of the element. On
setting, it must run the <dfn id=value10><code
title=dom-input-value>value</code> setter algorithm</dfn> defined for the
element's <code title=attr-input-type><a href="#type12">type</a></code>
attribute's current state.

<hr>

Expand Down Expand Up @@ -29475,7 +29492,7 @@ interface <dfn id=htmloptionelement>HTMLOptionElement</dfn> : <a href="#htmlelem
<p class=big-issue>... <dfn id=selected1
title=concept-option-selected>selected</dfn>

<p class=big-issue>... <dfn id=value10
<p class=big-issue>... <dfn id=value11
title=concept-option-value>value</dfn>

<p class=big-issue> <dfn id=option0
Expand Down Expand Up @@ -29784,7 +29801,7 @@ interface <dfn id=htmloptionelement>HTMLOptionElement</dfn> : <a href="#htmlelem
<p class=big-issue>... <dfn id=disabled6
title=dom-fe-disabled>disabled</dfn> DOM attribute

<p class=big-issue>... <dfn id=value11 title=concept-fe-value>value</dfn></p>
<p class=big-issue>... <dfn id=value12 title=concept-fe-value>value</dfn></p>
<!-- XXX autocomplete: define somewhere that the value may be set from a stored value -->

<h4 id=attributes2><span class=secno>4.9.14 </span><dfn
Expand Down Expand Up @@ -30131,7 +30148,7 @@ interface <dfn id=htmloptionelement>HTMLOptionElement</dfn> : <a href="#htmlelem
href="#select">select</a></code> element that is <a href="#selected1"
title=concept-option-selected>selected</a>, append an entry in the
<var title="">form data set</var> with the <var title="">name</var> as
the name and the <a href="#value10"
the name and the <a href="#value11"
title=concept-option-value>value</a> of the <code><a
href="#option">option</a></code> element as the value.

Expand All @@ -30149,7 +30166,7 @@ interface <dfn id=htmloptionelement>HTMLOptionElement</dfn> : <a href="#htmlelem

<li>
<p>Otherwise, append an entry in the <var title="">form data set</var>
with <var title="">name</var> as the name and the <a href="#value11"
with <var title="">name</var> as the name and the <a href="#value12"
title=concept-fe-value>value</a> of the <var title="">field</var>
element as the value.
</ol>
Expand Down
41 changes: 29 additions & 12 deletions source
Expand Up @@ -25129,7 +25129,11 @@ function AddCloud(data, x, y) { ... }</pre>
false the element is <dfn
title="concept-input-immutable"><i>immutable</i></dfn>. Unless
otherwise specified, an <code>input</code> element is always <i
title="concept-input-mutable">mutable</i>.</p>
title="concept-input-mutable">mutable</i>. When an
<code>input</code> element is <i
title="concept-input-immutable">immutable</i>, the user agent should
not allow the user to modify the <span
title="concept-fe-value">value</span>.</p>

<p>When an <code>input</code> element is <span
title="concept-fe-disabled">disabled</span>, it is <i
Expand Down Expand Up @@ -25229,7 +25233,18 @@ function AddCloud(data, x, y) { ... }</pre>
<p>When an <code>input</code> element's <code
title="attr-input-type">type</code> attribute is in the <span
title="attr-input-type-text">Text</span> state, the element
represents a text edit control for a single line of plain text.</p>
represents a one line plain text edit control for the element's
<span title="concept-fe-value">value</span>.</p>

<p>If an <code>input</code> element whose <code
title="attr-input-type">type</code> attribute is in the <span
title="attr-input-type-text">Text</span> state is <i
title="concept-input-mutable">mutable</i>, its <span
title="concept-fe-value">value</span> should be editable by the
user. User agents must not allow users to insert U+000A LINE FEED
(LF) or U+000D CARRIAGE RETURN (CR) characters into the <span
title="concept-fe-value">value</span> of such <code>input</code>
elements.</p>

<p><strong>The <span title="attr-input-type-text">Text</span>
state's <span>control initialization algorithm</span> is as
Expand All @@ -25246,15 +25261,10 @@ function AddCloud(data, x, y) { ... }</pre>
the <code title="attr-input-value">value</code> content attribute
and <span>strip line breaks from the value</span>.</p>

<p>If an <code>input</code> element whose <code
title="attr-input-type">type</code> attribute is in the <span
title="attr-input-type-text">Text</span> state is <i
title="concept-input-mutable">mutable</i>, its <span
title="concept-fe-value">value</span> should be editable by the
user. User agents must not allow users to insert U+000A LINE FEED
(LF) or U+000D CARRIAGE RETURN (CR) characters into the <span
title="concept-fe-value">value</span> of such <code>input</code>
elements.</p>
<p><strong>The <span><code title="dom-input-value">value</code>
setter algorithm</span> is as follows:</strong> Set the <span
title="concept-fe-value">value</span> of the element to the new
value and <span>strip line breaks from the value</span>.</p>

<p>When an <code>input</code> element's <code
title="attr-input-type">type</code> attribute is in the <span
Expand Down Expand Up @@ -25583,7 +25593,14 @@ rel="" on submit buttons?

<h6>Value manipulation</h6>

<p class="big-issue">... <dfn title="dom-input-value"><code>value</code></dfn></p>
<p>The <dfn title="dom-input-value"><code>value</code></dfn> DOM
attribute allows secripts to manipulate the <span
title="concept-input-value">value</span> of an <code>input</code>
element. On getting, it must return the current <span
title="concept-input-value">value</span> of the element. On setting,
it must run the <dfn><code title="dom-input-value">value</code>
setter algorithm</dfn> defined for the element's <code
title="attr-input-type">type</code> attribute's current state.</p>

<hr>

Expand Down

0 comments on commit bdf804c

Please sign in to comment.