Skip to content
Permalink
Browse files

[] (0) WF2: Begin defining value='' for <input type=text>

git-svn-id: http://svn.whatwg.org/webapps@2204 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Sep 17, 2008
1 parent 0d90b02 commit 68104332b59bb5b14d354fe348d359c5a22e901d
Showing with 155 additions and 44 deletions.
  1. +97 −40 index
  2. +58 −4 source
137 index

<dd><code title=attr-input-type><a href="#type12">type</a></code>

<dd><code title=attr-input-value>value</code>
<dd><code title=attr-input-value><a href="#value7">value</a></code>

<dt>DOM interface:

attribute DOMString <a href="#target4" title=dom-fs-target>target</a>;
attribute DOMString <a href="#type13" title=dom-input-type>type</a>;
attribute DOMString <a href="#defaultvalue" title=dom-input-defaultValue>defaultValue</a>;
attribute DOMString <a href="#value7" title=dom-input-value>value</a>;
attribute DOMString <a href="#value8" title=dom-input-value>value</a>;
attribute DOMTimeStamp <a href="#valueasdate" title=dom-input-valueAsDate>valueAsDate</a>;
attribute float <a href="#valueasnumber" title=dom-input-valueAsNumber>valueAsNumber</a>;
readonly attribute <a href="#htmloptionelement">HTMLOptionElement</a> <a href="#selectedoption" title=dom-input-selectedOption>selectedOption</a>;
title=attr-input-readonly>readonly</code>, <code
title=attr-input-required>required</code>, <code
title=attr-input-size>size</code>, <code title=attr-input-src>src</code>,
<code title=attr-input-step>step</code>, <code title=attr-fs-target><a
href="#target3">target</a></code>, and <code
title=attr-input-value>value</code> attributes apply to an <code><a
<code title=attr-input-step>step</code>, and <code title=attr-fs-target><a
href="#target3">target</a></code> attributes apply to an <code><a
href="#input0">input</a></code> element depends on the state of its <code
title=attr-input-type><a href="#type12">type</a></code> attribute.
Similarly, the <code title=dom-input-checked><a
href="#checked1">checked</a></code>, <code title=dom-input-value><a
href="#value7">value</a></code>, <code title=dom-input-valueAsDate><a
href="#value8">value</a></code>, <code title=dom-input-valueAsDate><a
href="#valueasdate">valueAsDate</a></code>, <code
title=dom-input-valueAsNumber><a
href="#valueasnumber">valueAsNumber</a></code>, <code
<code title=dom-input-stepDown><a href="#stepdown">stepDown()</a></code>
methods, are specific to certain states.

<hr>
<p>When an <code><a href="#input0">input</a></code> element's <code
title=attr-input-type><a href="#type12">type</a></code> attribute changes
state, and when the element is first created, the <dfn id=control0>control
initialization</dfn> algorithm defined for the <code
title=attr-input-type><a href="#type12">type</a></code> attribute's state
at the time must be invoked and the element's rendering and behaviour must
change accordingly.

<p>Each <code><a href="#input0">input</a></code> element has a <a
href="#value10" title=concept-fe-value>value</a>.

<p>Each <code><a href="#input0">input</a></code> element has a boolean <dfn
id=dirty>dirty flag</dfn>, which must be initially set to false when the
element is created, and which must be set to true whenever the user
interacts with the control in a way that changes the <a href="#value10"
title=concept-fe-value>value</a>.

<p>The <dfn id=value7 title=attr-input-value><code>value</code></dfn>
content attribute gives the default <a href="#value10"
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="#value7">value</a></code> content
attribute is added, set, or removed, and when the element is first
created, after invoking the <a href="#control0">control initialization</a>
algorithm, the <dfn id=default2>default value change</dfn> algorithm
defined for the <code title=attr-input-type><a
href="#type12">type</a></code> attribute's state at the time must be
invoked.

<p>The <code title=attr-fae-form><a href="#form0">form</a></code> attribute
is used to explicitly associate the <code><a
title=attr-input-checked>checked</code> content attribute. The <dfn
id=defaultvalue
title=dom-input-defaultValue><code>defaultValue</code></dfn> DOM attribute
must <a href="#reflect">reflect</a> the <code
title=attr-input-value>value</code> content attribute.
must <a href="#reflect">reflect</a> the <code title=attr-input-value><a
href="#value7">value</a></code> content attribute.

<p>The <code title=dom-cva-willValidate><a
href="#willvalidate">willValidate</a></code>, <code
href="#text1">text</a></code>, or has an invalid value, it is in the <a
href="#text2" title=attr-input-type-text>Text</a> state.

<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, it
represents a text edit control for a single line of plain text.

<p><strong>The <a href="#text2" title=attr-input-type-text>Text</a> state's
<a href="#control0">control initialization</a> algorithm is as
follows:</strong> Run the <a href="#line-feed">line feed stripper</a>
algorithm.

<p><strong>The <a href="#text2" title=attr-input-type-text>Text</a> state's
<a href="#default2">default value change</a> algorithm is as
follows:</strong> If the <code><a href="#input0">input</a></code> element
is not <span>dirty</span> then set the <a href="#value10"
title=concept-fe-value>value</a> of the element to the value of the <code
title=attr-input-value><a href="#value7">value</a></code> content
attribute and run the <a href="#line-feed">line feed stripper</a>
algorithm.

<p>The <dfn id=line-feed>line feed stripper</dfn> algorithm consists of
removing any U+000A LINE FEED (LF) characters from <a href="#value10"
title=concept-fe-value>value</a>.

<p>User agents must not allow users to insert U+000A LINE FEED (LF)
characters into the <a href="#value10" title=concept-fe-value>value</a> of
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.</p>
<!-- XXX allow users to edit, when not disabled or readonly -->

<p class=big-issue>...

<p>When an <code><a href="#input0">input</a></code> element's <code
title=attr-input-pattern>pattern</code>, <code
title=attr-input-readonly>readonly</code>, <code
title=attr-input-required>required</code>, <code
title=attr-input-size>size</code>, and <code
title=attr-input-value>value</code>.
title=attr-input-size>size</code>, and <code title=attr-input-value><a
href="#value7">value</a></code>.

<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
<p class=big-issue>... <dfn id=checked1
title=dom-input-checked><code>checked</code></dfn>

<p class=big-issue>... <dfn id=value7
<p class=big-issue>... <dfn id=value8
title=dom-input-value><code>value</code></dfn>

<p class=big-issue>... <dfn id=valueasdate
attribute DOMString <span title=dom-option-label>label</span>;
attribute boolean <span title=dom-option-defaultSelected>defaultSelected</span>;
attribute boolean <span title=dom-option-selected>selected</span>;
attribute DOMString <a href="#value7" title=dom-input-value>value</a>;
attribute DOMString <a href="#value8" title=dom-input-value>value</a>;

readonly attribute DOMString <span title=dom-option-text>text</span>;
readonly attribute long <span title=dom-option-index>index</span>;
<p class=big-issue>... <dfn id=selected1
title=concept-option-selected>selected</dfn>

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

<p class=big-issue> <dfn id=option0
<p class=big-issue>... <dfn id=disabled6
title=dom-fe-disabled>disabled</dfn> DOM attribute

<p class=big-issue>... <dfn id=value9 title=concept-fe-value>value</dfn></p>
<p class=big-issue>... <dfn id=value10 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
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="#value8"
the name and the <a href="#value9"
title=concept-option-value>value</a> of the <code><a
href="#option">option</a></code> element as the value.


<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="#value9"
with <var title="">name</var> as the name and the <a href="#value10"
title=concept-fe-value>value</a> of the <var title="">field</var>
element as the value.
</ol>

<p>The <code title=dom-provider-getCellData><a
href="#getcelldata">getCellData()</a></code> method must return the
<code title=dom-input-value><a href="#value7">value</a></code> of the
<code title=dom-input-value><a href="#value8">value</a></code> of the
<code><a href="#input0">input</a></code> element.</p>

<p>The <code title=dom-provider-getCellClasses><a
<p>The <code title=dom-provider-editCell><a
href="#editcell">editCell()</a></code> method must set the <code><a
href="#input0">input</a></code> element's <code title=dom-input-value><a
href="#value7">value</a></code> DOM attribute to the value of the third
href="#value8">value</a></code> DOM attribute to the value of the third
argument to the method.</p>

<p>The <code title=dom-provider-setCellCheckedState><a
href="#radiogroup">radiogroup</a></code>

<dd><code title=attr-command-default><a
href="#default2">default</a></code>
href="#default3">default</a></code>

<dd>Also, the <code title=attr-command-title><a
href="#title6">title</a></code> attribute has special semantics on this
attribute boolean <a href="#disabled10" title=dom-command-disabled>disabled</a>;
attribute boolean <a href="#checked4" title=dom-command-checked>checked</a>;
attribute DOMString <a href="#radiogroup0" title=dom-command-radiogroup>radiogroup</a>;
attribute boolean <a href="#default3" title=dom-command-default>default</a>;
attribute boolean <a href="#default4" title=dom-command-default>default</a>;
void <a href="#click" title=dom-command-click>click</a>(); // shadows <code><a href="#htmlelement">HTMLElement</a></code>.<code title=dom-click><a href="#click1">click()</a></code>
};</pre>


<p>If the <code><a href="#command0">command</a></code> element is used when
<span title="menu generation">generating</span> a <span>context
menu</span>, then the <dfn id=default2
menu</span>, then the <dfn id=default3
title=attr-command-default><code>default</code></dfn> attribute indicates,
if present, that the command is the one that would have been invoked if
the user had directly activated the menu's subject instead of using its
context menu. The <code title=attr-command-default><a
href="#default2">default</a></code> attribute is a <a
href="#default3">default</a></code> attribute is a <a
href="#boolean0">boolean attribute</a>.

<div class=example>
title=dom-command-disabled><code>disabled</code></dfn>, <dfn id=checked4
title=dom-command-checked><code>checked</code></dfn>, <dfn id=radiogroup0
title=dom-command-radiogroup><code>radiogroup</code></dfn>, and <dfn
id=default3 title=dom-command-default><code>default</code></dfn> DOM
id=default4 title=dom-command-default><code>default</code></dfn> DOM
attributes must <a href="#reflect">reflect</a> the content attributes of
the same name.

this means for each facet -->.
If the element is a <code><a href="#command0">command</a></code> element
with a <code title=attr-command-default><a
href="#default2">default</a></code> attribute, mark the command as being
href="#default3">default</a></code> attribute, mark the command as being
a default command.</dd>
<!-- XXX if there's an
Icon URL for the command, it should be <span
depends on the Type of the command:

<p>If the <a href="#type22" title=command-facet-Type>Type</a> is "command",
then it is the string given by the <code
title=attr-input-value>value</code> attribute, if any, and a
then it is the string given by the <code title=attr-input-value><a
href="#value7">value</a></code> attribute, if any, and a
<span>UA-dependent value</span><!-- XXX xref--> that the UA uses to label
the button itself if the attribute is absent.

question is the <a href="#label4" title=command-facet-Label>Label</a> (in
DOM terms, this the string given by <code><var
title="">element</var>.labels[0].textContent</code>). Otherwise, the value
of the <code title=attr-input-value>value</code> attribute, if present, is
the <a href="#label4" title=command-facet-Label>Label</a>. Otherwise, the
<a href="#label4" title=command-facet-Label>Label</a> is the empty string.
of the <code title=attr-input-value><a href="#value7">value</a></code>
attribute, if present, is the <a href="#label4"
title=command-facet-Label>Label</a>. Otherwise, the <a href="#label4"
title=command-facet-Label>Label</a> is the empty string.

<p>The <a href="#hint" title=command-facet-Hint>Hint</a> of the command is
the value of the <code title=attr-title><a href="#title">title</a></code>
data mining tools are likely to never instantiate browsing contexts.

<p>The main <a href="#view">view</a> through which a user primarily
interacts with a user agent is the <dfn id=default4>default view</dfn>.
interacts with a user agent is the <dfn id=default5>default view</dfn>.

<p class=note>The <a href="#default4">default view</a> of a
<p class=note>The <a href="#default5">default view</a> of a
<code>Document</code> is given by the <code title="">defaultView</code>
attribute on the <code>Document</code> object's <code>DocumentView</code>
interface. <a href="#refsDOM3VIEWS">[DOM3VIEWS]</a>

<h3 id=the-default0><span class=secno>5.2 </span>The default view</h3>

<p>The <code>AbstractView</code> object of <a href="#default4"
<p>The <code>AbstractView</code> object of <a href="#default5"
title="default view">default views</a> must also implement the <code><a
href="#window">Window</a></code> and <code>EventTarget</code> interfaces.

href="#browsing1">browsing context</a> has an associated <dfn
id=list-of2>list of added properties</dfn> that, when a document is <a
href="#active" title="active document">active</a>, are available on the
<code>Document</code>'s <a href="#default4">default view</a>'s <code><a
<code>Document</code>'s <a href="#default5">default view</a>'s <code><a
href="#window">Window</a></code> object. A <code>Document</code> object's
<a href="#list-of2">list of added properties</a> must be empty when the
<code>Document</code> object is created.
default value. For <code><a href="#input0">input</a></code> elements
this means updating the <code title=dom-input-defaultValue><a
href="#defaultvalue">defaultValue</a></code> DOM attribute as well as
the <code title=dom-input-value><a href="#value7">value</a></code> DOM
the <code title=dom-input-value><a href="#value8">value</a></code> DOM
attribute; for <code><a href="#select">select</a></code> elements it
means updating the <code><a href="#option">option</a></code> elements'
<code title=dom-option-defaultSelected>defaultSelected</code> DOM
the <code title=dom-MessageEvent-source><a
href="#source3">source</a></code> attribute must be set to the <code><a
href="#window">Window</a></code> object of the <a
href="#default4">default view</a> of the <a href="#browsing1">browsing
href="#default5">default view</a> of the <a href="#browsing1">browsing
context</a> for which the <code>Document</code> object with which the
script is associated is the <a href="#active">active
document</a><!--, if there is one, or null
the <code title=dom-MessageEvent-source><a
href="#source3">source</a></code> attribute must be set to the <code><a
href="#window">Window</a></code> object of the <a
href="#default4">default view</a> of the <a href="#browsing1">browsing
href="#default5">default view</a> of the <a href="#browsing1">browsing
context</a> for which the <code>Document</code> object with which the
script is associated is the <a href="#active">active
document</a><!--, if there is one, or null
(<code>&gt;</code>) characters, and must not be the empty string.</p>

<div class=example>
<p>In the following example, the <code
title=attr-input-value>value</code> attribute is given with the
unquoted attribute value syntax:</p>
<p>In the following example, the <code title=attr-input-value><a
href="#value7">value</a></code> attribute is given with the unquoted
attribute value syntax:</p>

<pre>&lt;input <em>value=yes</em>&gt;</pre>
</div>

0 comments on commit 6810433

Please sign in to comment.
You can’t perform that action at this time.