Browse files

[] (0) WF2: Collapse down some of the <input> algorithms for simplici…

…ty. Fill in a little more type=datetime detail (not much). Minor editorial fixes.

git-svn-id: http://svn.whatwg.org/webapps@2230 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
1 parent 5671774 commit 69d1705f1fdb0077a439cf303222d2a47acaf7df @Hixie Hixie committed Sep 24, 2008
Showing with 407 additions and 498 deletions.
  1. +340 −385 index
  2. +67 −113 source
View
725 index
340 additions, 385 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
180 source
@@ -1883,6 +1883,7 @@
Gregorian calendar. <a
href="#refsGREGORIAN">[GREGORIAN]</a></p>
+
<h5>Specific moments in time</h5>
<p>A string is a <dfn>valid datetime</dfn> if it has four digits
@@ -2560,7 +2561,19 @@
</ol>
- <h4>Time offsets</h4>
+ <h5>UTC dates and times</h5>
+
+ <p>A <dfn>UTC date and time</dfn> consists of a specific Gregorian
+ date expressed relative to the UTC timezone, consisting of a year, a
+ month, a day, an hour, a minute, a second, and a fraction of a
+ second. <a href="#refsGREGORIAN">[GREGORIAN]</a></p>
+
+ <p class="big-issue">... <dfn>valid UTC date and time</dfn></p>
+
+ <p class="big-issue">... rules to <dfn>parse a UTC date and time</dfn></p>
+
+
+ <h5>Time offsets</h5>
<p class="big-issue"><dfn>valid time offset</dfn>, <dfn>rules for
parsing time offsets</dfn>, <dfn>time offset serialization
@@ -26060,7 +26073,7 @@ function AddCloud(data, x, y) { ... }</pre>
title="attr-input-type">type</code> attribute changes state, and
when the element is first created, the element's rendering and
behaviour must change to the new state's accordingly and the
- <dfn>control initialization algorithm</dfn> defined for the <code
+ <dfn>value sanitization algorithm</dfn> defined for the <code
title="attr-input-type">type</code> attribute's new state must be
invoked.</p>
@@ -26112,17 +26125,18 @@ function AddCloud(data, x, y) { ... }</pre>
content attribute gives the default <span
title="concept-fe-value">value</span> of the <code>input</code>
element. When the <code title="attr-input-value">value</code>
- content attribute is added, set, or removed, and when the element is
- first created, after invoking the <span>control initialization
- algorithm</span>, the <dfn>default value change algorithm</dfn>
- defined for the <code title="attr-input-type">type</code>
- attribute's current state must be invoked.</p>
+ content attribute is added, set, or removed, if the control is not
+ <i title="concept-input-dirty">dirty</i>, the user agent must set
+ the <span title="concept-fe-value">value</span> of the element to
+ the value of the <code title="attr-input-value">value</code> content
+ attribute, if there is one, or the empty string otherwise, and run
+ the <span>value sanitization algorithm</span>.</p>
<p>The <span title="concept-form-reset-control">reset
algorithm</span> for <code>input</code> elements is to set the <span
title="concept-input-dirty-flag">dirty flag</span> back to false
(not <i title="concept-input-dirty">dirty</i>), and then invoke the
- <span>default value change algorithm</span> defined for the <code
+ <span>value sanitization algorithm</span> defined for the <code
title="attr-input-type">type</code> attribute's current state.</p>
<p>The <code title="attr-fae-form">form</code> attribute is used to
@@ -26197,23 +26211,8 @@ function AddCloud(data, x, y) { ... }</pre>
elements.</p>
<p><strong>The <span title="attr-input-type-text">Text</span>
- state's <span>control initialization algorithm</span> is as
- follows:</strong> <span>Strip line breaks from the
- value</span>.</p>
-
- <p><strong>The <span title="attr-input-type-text">Text</span>
- state's <span>default value change algorithm</span> is as
- follows:</strong> If the <code>input</code> element is not <i
- title="concept-input-dirty">dirty</i> then set the <span
- title="concept-fe-value">value</span> of the element to the value of
- the <code title="attr-input-value">value</code> content attribute
- and <span>strip line breaks from the value</span>.</p>
-
- <p><strong>The <span title="attr-input-type-text">Text</span>
- state's <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>
+ state's <span>value sanitization algorithm</span> is as
+ follows:</strong> <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
@@ -26284,25 +26283,9 @@ function AddCloud(data, x, y) { ... }</pre>
elements.</p>
<p><strong>The <span
- title="attr-input-type-password">Password</span> state's
- <span>control initialization algorithm</span> is as
- follows:</strong> <span>Strip line breaks from the value</span>.</p>
-
- <p><strong>The <span
- title="attr-input-type-password">Password</span> state's
- <span>default value change algorithm</span> is as follows:</strong>
- If the <code>input</code> element is not <i
- title="concept-input-dirty">dirty</i> then set the <span
- title="concept-fe-value">value</span> of the element to the value of
- the <code title="attr-input-value">value</code> content attribute
- and <span>strip line breaks from the value</span>.</p>
-
- <p><strong>The <span
- title="attr-input-type-password">Password</span> state's <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>
+ title="attr-input-type-password">Password</span> state's <span>value
+ sanitization algorithm</span> is as follows:</strong> <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
@@ -26375,23 +26358,8 @@ function AddCloud(data, x, y) { ... }</pre>
elements.</p>
<p><strong>The <span title="attr-input-type-email">E-mail</span>
- state's <span>control initialization algorithm</span> is as
- follows:</strong> <span>Strip line breaks from the
- value</span>.</p>
-
- <p><strong>The <span title="attr-input-type-email">E-mail</span>
- state's <span>default value change algorithm</span> is as
- follows:</strong> If the <code>input</code> element is not <i
- title="concept-input-dirty">dirty</i> then set the <span
- title="concept-fe-value">value</span> of the element to the value of
- the <code title="attr-input-value">value</code> content attribute
- and <span>strip line breaks from the value</span>.</p>
-
- <p><strong>The <span title="attr-input-type-email">E-mail</span>
- state's <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>
+ state's <span>value sanitization algorithm</span> is as
+ follows:</strong> <span>Strip line breaks from the value</span>.</p>
<p><strong>Constraint validation:</strong> While the <span
title="concept-fe-value">value</span> of the element does not match
@@ -26473,24 +26441,10 @@ function AddCloud(data, x, y) { ... }</pre>
elements.</p>
<p><strong>The <span title="attr-input-type-url">URL</span>
- state's <span>control initialization algorithm</span> is as
+ state's <span>value sanitization algorithm</span> is as
follows:</strong> <span>Strip line breaks from the
value</span>.</p>
- <p><strong>The <span title="attr-input-type-url">URL</span>
- state's <span>default value change algorithm</span> is as
- follows:</strong> If the <code>input</code> element is not <i
- title="concept-input-dirty">dirty</i> then set the <span
- title="concept-fe-value">value</span> of the element to the value of
- the <code title="attr-input-value">value</code> content attribute
- and <span>strip line breaks from the value</span>.</p>
-
- <p><strong>The <span title="attr-input-type-url">URL</span>
- state's <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><strong>Constraint validation:</strong> While the <span
title="concept-fe-value">value</span> of the element is not a
<span>valid URL</span>, the element is <span>suffering from a type
@@ -26552,44 +26506,41 @@ function AddCloud(data, x, y) { ... }</pre>
element represents a control for setting the element's <span
title="concept-fe-value">value</span> to a string representing a
specific <span>UTC date and time</span>. User agents may display the
- time in whatever timezone is appropriate for the user.</p>
+ date and time in whatever timezone is appropriate for the user.</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-datetime">Date and Time</span> state is <i
title="concept-input-mutable">mutable</i>, the user should allow the
user to change the date and time represented by its <span
- title="concept-fe-value">value</span>. User agents must not allow
- the user to set the <span title="concept-fe-value">value</span> to a
- string that is not a <span>valid UTC date and time</span>. If the
- user agent provides a user interface for selecting a date and time,
- then the <span title="concept-fe-value">value</span> must be set to
- a <span>valid UTC date and time</span> representing the user's
- selection. User agents should allow the user to set the <span
+ title="concept-fe-value">value</span>, as obtained by <span
+ title="parse a UTC date and time">parsing a UTC date and tiem</span>
+ from it. User agents must not allow the user to set the <span
+ title="concept-fe-value">value</span> to a string that is not a
+ <span>valid UTC date and time</span>. If the user agent provides a
+ user interface for selecting a date and time, then the <span
+ title="concept-fe-value">value</span> must be set to a <span>valid
+ UTC date and time</span> representing the user's selection. User
+ agents should allow the user to set the <span
title="concept-fe-value">value</span> to the empty string.</p>
<p><strong>The <span title="attr-input-type-datetime">Date and
- Time</span> state's <span>control initialization algorithm</span> is
- as follows:</strong> If the <span
- title="concept-fe-value">value</span> of the element is not a
- <span>valid UTC date and time</span>, then set it to the empty
- string instead.</p>
+ Time</span> state's <span>value sanitization algorithm</span> is as
+ follows:</strong> If the <span title="concept-fe-value">value</span>
+ of the element is not a <span>valid UTC date and time</span>, then
+ set it to the empty string instead.</p>
- <p><strong>The <span title="attr-input-type-datetime">Date and
- Time</span> state's <span>default value change algorithm</span> is
- as follows:</strong> If the <code>input</code> element is not <i
- title="concept-input-dirty">dirty</i> then set the <span
- title="concept-fe-value">value</span> of the element to the value of
- the <code title="attr-input-value">value</code> content attribute
- and run the <span>control initialization algorithm</span>.</p>
+ <p class="big-issue"><strong>The <span
+ title="attr-input-type-datetime">Date and Time</span> state's
+ <span><code title="dom-input-valueAsDate">valueAsDate</code> setter
+ algorithm</span> is as follows:</strong> ...</p>
- <p><strong>The <span title="attr-input-type-datetime">Date and
- Time</span> state's <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 run the <span>control initialization algorithm</span>.</p>
+ <p class="big-issue"><strong>The <span
+ title="attr-input-type-datetime">Date and Time</span> state's
+ <span><code title="dom-input-valueAsNumber">valueAsNumber</code>
+ setter algorithm</span> is as follows:</strong> ...</p>
- <!-- XXX min, max, step -->
+ <!-- XXX min, max, step; parsing for those -->
<p>When an <code>input</code> element's <code
title="attr-input-type">type</code> attribute is in the <span
@@ -26907,7 +26858,7 @@ rel="" on submit buttons?
<p>The autocompletion mechanism must be implemented by the user
agent acting as if the user had modified the element's <span
- title="concept-input-value">value</span>, and must be done at a time
+ title="concept-fe-value">value</span>, and must be done at a time
where the element is <i title="concept-input-mutable">mutable</i>
(e.g. just after the element has been inserted into the document, or
when the user agent <span>stops parsing</span>).</p>
@@ -26954,20 +26905,22 @@ rel="" on submit buttons?
<h6>Value manipulation</h6>
<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>
+ attribute allows scripts to manipulate the <span
+ title="concept-fe-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>
+ title="concept-fe-value">value</span> of the element. On setting,
+ it must set the element's <span
+ title="concept-fe-value">value</span> to the new value, and then
+ invoke the <span>value sanitization algorithm</span> defined for the
+ element's <code title="attr-input-type">type</code> attribute's
+ current state.</p>
<hr>
<p>The <dfn
title="dom-input-valueAsDate"><code>valueAsDate</code></dfn> DOM
attribute represents the <span
- title="concept-input-value">value</span> of the element, interpreted
+ title="concept-fe-value">value</span> of the element, interpreted
as a date.</p>
<p>On getting, if the <code
@@ -26991,7 +26944,7 @@ rel="" on submit buttons?
<p>The <dfn
title="dom-input-valueAsNumber"><code>valueAsNumber</code></dfn> DOM
attribute represents the <span
- title="concept-input-value">value</span> of the element, interpreted
+ title="concept-fe-value">value</span> of the element, interpreted
as a number.</p>
<p>On getting, if the <code
@@ -27001,7 +26954,7 @@ rel="" on submit buttons?
run the <dfn><code
title="dom-input-valueAsNumber">valueAsNumber</code> getter
algorithm</dfn> defined for that state. Otherwise, return the <span
- title="concept-input-value">value</span> of the element, cast to the
+ title="concept-fe-value">value</span> of the element, cast to the
type of the DOM attribute.</p>
<p>On setting, if the <code
@@ -27011,7 +26964,7 @@ rel="" on submit buttons?
run the <dfn><code
title="dom-input-valueAsNumber">valueAsNumber</code> setter
algorithm</dfn> defined for that state. Otherwise, the <span
- title="concept-input-value">value</span> must be set to the shortest
+ title="concept-fe-value">value</span> must be set to the shortest
possible representation of the given value that is a <span>valid
floating point number</span> in base ten.</p>
@@ -55074,6 +55027,7 @@ TODO (or delay):
mean something. (2046 doesn't define anything like that, and
2045's definition doesn't really help either, since it's part
of something else, and doesn't mention whitespace, etc.)
+ XXX * reference [UTC] in the various places that use it.
-->
</body>

0 comments on commit 69d1705

Please sign in to comment.