HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
2230WF2: Collapse down some of the <input> algorithms for simplicity. Fill in a little more type=datetime detail (not much). Minor editorial fixes.2008-09-24 11:25
@@ -1876,20 +1876,21 @@
   title="">month</var> of year <var title="">year</var></dfn> is:
   <em>31</em> if <var title="">month</var> is 1, 3, 5, 7, 8, 10, or
   12; <em>30</em> if <var title="">month</var> is 4, 6, 9, or 11;
   <em>29</em> if <var title="">month</var> is 2 and <var
   title="">year</var> is a number divisible by 400, or if <var
   title="">year</var> is a number divisible by 4 but not by 100; and
   <em>28</em> otherwise. This takes into account leap years in the
   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
   (representing the year), a literal hyphen, two digits (representing
   the month), a literal hyphen, two digits (representing the day),
   optionally some spaces, either a literal T or a space, optionally
   some more spaces, two digits (for the hour), a colon, two digits
   (the minutes), optionally the seconds (which, if included, must
   consist of another colon, two digits (the integer part of the
   seconds), and optionally a decimal point followed by one or more
@@ -2553,21 +2554,33 @@
    whitespace</span>.</p></li>
 
    <li><p>If <var title="">position</var> is <em>not</em> past the end
    of <var title="">input</var>, then the string is invalid.</p>
 
    <li><p>Abort these steps (the string is parsed).</p></li>
 
   </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
   rules</dfn>; in the format "5d4h3m2s1ms" or "3m 9.2s" or "00:00:00.00"
   or similar.</p>
 
 
 
   <h4>Space-separated tokens</h4>
 
@@ -26053,21 +26066,21 @@ function AddCloud(data, x, y) { ... }</pre>
      <td class="no"> &middot; <!-- Image Button -->
      <td class="no"> &middot; <!-- Reset Button -->
      <td class="no"> &middot; <!-- Button -->
 
   </table>
 
   <p>When an <code>input</code> element's <code
   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>
 
   <p>Each <code>input</code> element has a <span
   title="concept-fe-value">value</span>, which is exposed by the <code
   title="dom-input-value">value</code> DOM attribute.</p>
 
   <p>Each <code>input</code> element has a boolean <dfn
   title="concept-input-mutability">mutability flag</dfn>. When it is
   true, the element is said to be <dfn
@@ -26105,31 +26118,32 @@ function AddCloud(data, x, y) { ... }</pre>
   be initially set to false (not <i
   title="concept-input-dirty">dirty</i>) when the element is created,
   and must be set to true (<i title="concept-input-dirty">dirty</i>)
   whenever the user interacts with the control in a way that changes
   the <span title="concept-fe-value">value</span>.</p>
 
   <p>The <dfn title="attr-input-value"><code>value</code></dfn>
   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
   explicitly associate the <code>input</code> element with its
   <span>form owner</span>. The <code title="attr-fe-name">name</code>
   attribute represents the element's name. The <code
   title="attr-fe-disabled">disabled</code> attribute is used to make
   the control non-interactive and to prevent its value from being
   submitted.</p>
 
@@ -26190,37 +26204,22 @@ function AddCloud(data, x, y) { ... }</pre>
   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
-  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
   title="attr-input-type-text">Text</span> state, the following common
   <code>input</code> element content attributes, DOM attributes, and
   methods apply to the element:
   <code title="attr-input-autocomplete">autocomplete</code>,
   <code title="attr-input-list">list</code>,
   <code title="attr-input-maxlength">maxlength</code>,
   <code title="attr-input-pattern">pattern</code>,
@@ -26277,39 +26276,23 @@ function AddCloud(data, x, y) { ... }</pre>
   title="attr-input-type">type</code> attribute is in the <span
   title="attr-input-type-password">Password</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-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
   title="attr-input-type-password">Password</span> state, the
   following common <code>input</code> element content attributes apply
   to the element:
   <code title="attr-input-autocomplete">autocomplete</code>,
   <code title="attr-input-maxlength">maxlength</code>,
   <code title="attr-input-pattern">pattern</code>,
   <code title="attr-input-readonly">readonly</code>,
@@ -26368,37 +26351,22 @@ function AddCloud(data, x, y) { ... }</pre>
   title="concept-fe-value">value</span>. User agents may allow the
   user to set the <span title="concept-fe-value">value</span> to a
   string that is not an e-mail address. User agents should allow the
   user to set the <span title="concept-fe-value">value</span> to the
   empty string. 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-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
   the <code>addr-spec</code> token defined in RFC 2822 section 3.4.1,
   excluding the <code>CFWS</code> subtoken everywhere, and excluding
   the <code>FWS</code> subtoken everywhere except in the
   <code>quoted-string</code> subtoken, the element is <span>suffering
   from a type mismatch</span>. <a
   href="#refsRFC2822">[RFC2822]</a></p>
 
@@ -26466,38 +26434,24 @@ function AddCloud(data, x, y) { ... }</pre>
   title="concept-fe-value">value</span>. User agents may allow the
   user to set the <span title="concept-fe-value">value</span> to a
   string that is not a URL. User agents should allow the user to set
   the <span title="concept-fe-value">value</span> to the empty
   string. 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-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
   mismatch</span>.</p>
 
   <p>When an <code>input</code> element's <code
   title="attr-input-type">type</code> attribute is in the <span
   title="attr-input-type-url">URL</span> state, the following common
   <code>input</code> element content attributes, DOM attributes, and
   methods apply to the element:
@@ -26545,58 +26499,55 @@ function AddCloud(data, x, y) { ... }</pre>
   <p>When an <code>input</code> element's <code title="attr-input-type">type</code>
   attribute has the value <code title="attr-input-type-datetime-keyword">datetime</code>,
   it is in the <span title="attr-input-type-datetime">Date and Time</span> state.</p>
 
   <p>When an <code>input</code> element's <code
   title="attr-input-type">type</code> attribute is in the <span
   title="attr-input-type-datetime">Date and Time</span> state, the
   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
   title="attr-input-type-datetime">Date and Time</span> state, the
   following common <code>input</code> element content attributes, DOM
   attributes, and methods apply to the element:
   <code title="attr-input-autocomplete">autocomplete</code>,
   <code title="attr-input-list">list</code>,
   <code title="attr-input-max">max</code>,
   <code title="attr-input-min">min</code>,
@@ -26900,21 +26851,21 @@ rel="" on submit buttons?
   the user agent may store the value entered by the user so that if
   the user returns to the page, the UA can prefill the form. When an
   <code>input</code> element's <code
   title="attr-input-autocomplete">autocomplete</code> attribute is in
   the <span title="attr-input-autocomplete-off-state">off</span>
   state, the user agent should not remember the control's value.</p>
   <!-- XXX xref value? -->
 
   <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>
 
   <div class="example">
 
    <p>Banks frequently do not want UAs to prefill login
    information:</p>
 
    <pre>&lt;p>Account: &lt;input type="text" name="ac" autocomplete="off">&lt;/p>
@@ -26947,34 +26898,36 @@ rel="" on submit buttons?
   on an <code>input</code> element, the element is <span>barred from
   constraint validation</span>.</p>
 
 
 
   <h5>Common <code>input</code> element APIs</h5>
 
   <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
   title="dom-input-valueAsDate">valueAsDate</code> attribute applies,
   as defined for the <code>input</code> element's <code
   title="attr-input-type">type</code> attribute's current state, then
   run the <dfn><code title="dom-input-valueAsDate">valueAsDate</code>
   getter algorithm</dfn> defined for that state. Otherwise, return a
   Not-a-Number (NaN) value.</p>
 
@@ -26984,41 +26937,41 @@ rel="" on submit buttons?
   title="attr-input-type">type</code> attribute's current state, then
   run the <dfn><code title="dom-input-valueAsDate">valueAsDate</code>
   setter algorithm</dfn> defined for that state. Otherwise, do
   nothing.</p>
 
   <hr>
 
   <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
   title="dom-input-valueAsNumber">valueAsNumber</code> attribute
   applies, as defined for the <code>input</code> element's <code
   title="attr-input-type">type</code> attribute's current state, then
   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
   title="dom-input-valueAsNumber">valueAsNumber</code> attribute
   applies, as defined for the <code>input</code> element's <code
   title="attr-input-type">type</code> attribute's current state, then
   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>
 
 
 
   <h6>Others...</h6>
 
   <p class="big-issue">... <dfn title="dom-input-checked"><code>checked</code></dfn></p>
   <p class="big-issue">... <dfn title="dom-input-list"><code>list</code></dfn></p>
   <p class="big-issue">... <dfn title="dom-input-selectedOption"><code>selectedOption</code></dfn></p>
@@ -55067,14 +55020,15 @@ TODO (or delay):
        see https://bugzilla.mozilla.org/show_bug.cgi?id=297761
  XXX * rephrase things so that an enumerated attribute puts the _element_ into
        various states, instead of the attribute
  XXX * make the text consistent about whether it is ":<em>" and
        ":<strong>" or "</em>:" and "</strong>:". Same for other
        punctuation.
  XXX * take references to "valid mime type" / RFC2046 and make them
        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>
 </html>

|