HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
2251WF2: Restructure the way dates and times are specified.2008-09-30 09:47
@@ -1934,20 +1934,27 @@
   <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 class="big-issue">This syntax is going to be tightened up and
+  made almost exactly the same as the <span>valid UTC date and time
+  string</span> syntax, with the exception of allowing time zones. In
+  fact what we might do is allow time zones in general, use the same
+  parser, etc, but require that UAs always use the UTC time zone when
+  synthesizing datetimes for form submission.</p>
+
   <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
   digits (for the fractional part of the seconds)), optionally some
   spaces, and finally either a literal Z (indicating the time zone is
@@ -2611,36 +2618,101 @@
    <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>
 
 
   <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>A <dfn title="concept-datetime">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 string</dfn></p>
+
+  <p class="big-issue">... rules to <dfn>parse a UTC date and time
+  string</dfn></p>
+
+
+  <h5>Local dates and times</h5>
+
+  <p>A <dfn title="concept-datetime-local">local date and time</dfn>
+  consists of a specific Gregorian date with no timezone information,
+  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 local date and time string</dfn></p>
+
+  <p class="big-issue">... rules to <dfn>parse a local date and time
+  string</dfn></p>
+
+
+  <h5>Dates</h5>
+
+  <p>A <dfn title="concept-date">date</dfn> consists of a specific
+  Gregorian date with no timezone information, consisting of a year, a
+  month, and a day. <a href="#refsGREGORIAN">[GREGORIAN]</a></p>
+
+  <p class="big-issue">... <dfn>valid date string</dfn></p>
+
+  <p class="big-issue">... rules to <dfn>parse a date string</dfn></p>
+
+
+  <h5>Months</h5>
+
+  <p>A <dfn title="concept-month">month</dfn> consists of a specific
+  Gregorian date with no timezone information and no date information
+  beyond a year and a month. <a
+  href="#refsGREGORIAN">[GREGORIAN]</a></p>
+
+  <p class="big-issue">... <dfn>valid month string</dfn></p>
+
+  <p class="big-issue">... rules to <dfn>parse a month string</dfn></p>
+
 
-  <p class="big-issue">... <dfn>valid UTC date and time</dfn></p>
+  <h5>Weeks</h5>
 
-  <p class="big-issue">... rules to <dfn>parse a UTC date and time</dfn></p>
+  <p>A <dfn title="concept-week">week</dfn> consists of a specific
+  Gregorian date with no timezone information and no date information
+  beyond a year and a week. <a
+  href="#refsGREGORIAN">[GREGORIAN]</a></p>
+
+  <!-- XXX ISO week information -->
+
+  <p class="big-issue">... <dfn>valid week string</dfn></p>
+
+  <p class="big-issue">... rules to <dfn>parse a week string</dfn></p>
+
+
+  <h5>Times</h5>
+
+  <p>A <dfn title="concept-time">time</dfn> consists of a specific
+  time with no timezone information, consisting of an hour, a minute,
+  a second, and a fraction of a second.</p>
+
+  <p class="big-issue">... <dfn>valid time string</dfn></p>
+
+  <p class="big-issue">... rules to <dfn>parse a time string</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>
+  rules</dfn>; probably in the format "5d4h3m2.1s" or similar, with
+  all components being optional, and the last component's unit suffix
+  being optional if it's in seconds.</p>
 
 
 
   <h4>Space-separated tokens</h4>
 
   <p>A <dfn>set of space-separated tokens</dfn> is a set of zero or
   more words separated by one or more <span title="space
   character">space characters</span>, where words consist of any
   string of one or more characters, none of which are <span
   title="space character">space characters</span>.</p>
@@ -9627,23 +9699,23 @@ people expect to have work and what is necessary.
 
 
   <div class="example">
 
    <p>In this example, two <code>script</code> elements are used. One
    embeds an external script, and the other includes some data.</p>
 
    <pre>&lt;script src="game-engine.js">&lt;/script>
 &lt;script type="text/x-game-map">
 ........U.........e
-o............x....e
-.....x.....xxx....e
-.x..xxx...xxxxx...e
+o............A....e
+.....A.....AAA....e
+.A..AAA...AAAAA...e
 &lt;/script></pre>
 
    <p>The data in this case might be used by the script to generate
    the map of a video game. The data doesn't have to be used that way,
    though; maybe the map data is actually embedded in other parts of
    the page's markup, and the data block here is just used by the
    site's search engine to help users who are looking for particular
    features in their game maps.</p>
 
   </div>
@@ -14159,21 +14231,21 @@ brighter. A &lt;b>rat&lt;/b> scurries past the corner wall.&lt;/p></pre>
   &lt;p> I like fruit. &lt;/p>
  &lt;/ins>
  &lt;ins datetime="2005-03-16T00:00Z">
   Apples are &lt;em>tasty&lt;/em>.
  &lt;/ins>
  &lt;ins datetime="2007-12-19T00:00Z">
   So are pears.
  &lt;/ins>
 &lt;/aside></pre>
 
-   <!-- Those date's aren't random. They're the start and end of
+   <!-- Those dates aren't random. They're the start and end of
    something. Can you guess what? -->
 
   </div>
 
 
   <h4>The <dfn><code>del</code></dfn> element</h4>
 
   <dl class="element">
    <dt>Categories</dt>
    <dd>When the element only contains <span>phrasing content</span>: <span>phrasing content</span>.</dd>
@@ -26257,20 +26329,25 @@ function AddCloud(data, x, y) { ... }</pre>
   title="dom-cva-checkValidatity">checkValidity()</code> and
   <code
   title="dom-cva-setCustomValidity">setCustomValidity()</code>
   methods, are part of the <span>constraint validation API</span>.</p>
 
 
 
 
   <h5>States of the <code title="attr-input-type">type</code> attribute</h5>
 
+  <!-- XXX for things that say "express it as a valid foo", make sure
+  that valid foo is unambiguous, and if not, define a canonical
+  serialisation. e.g. should it be 2008-01-01T00:00 or
+  2008-01-01t00:00? should it be 1e2 or 100? -->
+
   <h6><dfn title="attr-input-type-text">Text</dfn> state</h6>
 
   <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 rules in this
   section apply.</p>
 
   <p>The <code>input</code> element represents a one line plain text
   edit control for the element's <span
   title="concept-fe-value">value</span>.</p>
@@ -26515,97 +26592,103 @@ function AddCloud(data, x, y) { ... }</pre>
 
   <h6><dfn title="attr-input-type-datetime">Date and Time</dfn> state</h6>
 
   <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
   rules in this section apply.</p>
 
   <p>The <code>input</code> 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 date and time in whatever timezone is
-  appropriate for the user.</p>
+  string representing a specific <span title="concept-datetime">UTC
+  date and time</span>. User agents may display the date and time in
+  whatever timezone is appropriate for the user.</p>
 
   <p>If the element 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>, as
-  obtained by <span title="parse a UTC date and time">parsing a UTC
-  date and time</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
+  the user should allow the user to change the <span
+  title="concept-datetime">UTC date and time</span> represented by its
+  <span title="concept-fe-value">value</span>, as obtained by <span
+  title="parse a UTC date and time string">parsing a UTC date and
+  time</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 string</span>. If the user agent
+  provides a user interface for selecting a <span
+  title="concept-datetime">UTC date and time</span>, then the <span
+  title="concept-fe-value">value</span> must be set to a <span>valid
+  UTC date and time string</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>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>
+  of the element is not a <span>valid UTC date and time string</span>,
+  then set it to the empty string instead.</p>
 
   <p>The <code title="attr-input-min">min</code> attribute, if
-  specified, must have a value that is a <span>valid UTC date and
-  time</span>. The <code title="attr-input-max">max</code> attribute,
-  if specified, must have a value that is a <span>valid UTC date and
-  time</span>.</p>
+  specified, must have a value that is a <span>valid UTC date and time
+  string</span>. The <code title="attr-input-max">max</code>
+  attribute, if specified, must have a value that is a <span>valid UTC
+  date and time string</span>.</p>
 
   <p>The <code title="attr-input-step">step</code> attribute is
   expressed in seconds. The <span
   title="concept-input-step-scale">step scale factor</span> is 1000
   (which converts the seconds to milliseconds, as used in the other
   algorithms). The <span title="concept-input-step-default">default
   step</span> is 60 seconds.</p>
 
   <p>When the element is <span>suffering from a step mismatch</span>,
   the user agent may round the element's <span
-  title="concept-input-value">value</span> to the nearest date and
-  time for which the element would not <span title="suffering from a
-  step mismatch">suffer from a step mismatch</span>.</p>
+  title="concept-input-value">value</span> to the nearest <span
+  title="concept-datetime">UTC date and time</span> for which the
+  element would not <span title="suffering from a step
+  mismatch">suffer from a step mismatch</span>.</p>
 
   <p><strong>The <span
   title="concept-input-value-string-number">algorithm to convert a
   string to a number</span>, given a string <var title="">input</var>,
-  is as follows:</strong> If <span title="parse a UTC date and
-  time">parsing a UTC date and time</span> from <var
+  is as follows:</strong> If <span title="parse a UTC date and time
+  string">parsing a UTC date and time</span> from <var
   title="">input</var> results in an error, then return an error;
   otherwise, return the number of milliseconds elapsed from midnight
   UTC on the morning of 1970-01-01 (the time represented by the value
-  "<code title="">1970-01-01T00:00:00.0Z</code>") to the parsed date
-  and time, ignoring leap seconds.</p>
+  "<code title="">1970-01-01T00:00:00.0Z</code>") to the parsed <span
+  title="concept-datetime">UTC date and time</span>, ignoring leap
+  seconds.</p>
 
   <p><strong>The <span
   title="concept-input-value-number-string">algorithm to convert a
   number to a string</span>, given a number <var title="">input</var>,
-  is as follows:</strong> Return a <span>valid UTC date and
-  time</span> that represents the date and time in UTC that is <var
+  is as follows:</strong> Return a <span>valid UTC date and time
+  string</span> that represents the <span
+  title="concept-datetime">date and time in UTC</span> that is <var
   title="">input</var> milliseconds after midnight UTC on the morning
   of 1970-01-01 (the time represented by the value "<code
   title="">1970-01-01T00:00:00.0Z</code>").</p>
 
   <p><strong>The <span
   title="concept-input-value-string-date">algorithm to convert a
   string to a <code>Date</code> object</span>, given a string <var
   title="">input</var>, is as follows:</strong> If <span title="parse
-  a UTC date and time">parsing a UTC date and time</span> from <var
-  title="">input</var> results in an error, then return an error;
+  a UTC date and time string">parsing a UTC date and time</span> from
+  <var title="">input</var> results in an error, then return an error;
   otherwise, return a <code>Date</code> object representing the parsed
-  date and time.</p>
+  <span title="concept-datetime">UTC date and time</span>.</p>
 
   <p><strong>The <span
   title="concept-input-value-date-string">algorithm to convert a
   <code>Date</code> object to a string</span>, given a
   <code>Date</code> object <var title="">input</var>, is as
-  follows:</strong> Return a <span>valid UTC date and time</span> that
-  represents the date and time in UTC that is represented by <var
-  title="">input</var>.</p>
+  follows:</strong> Return a <span>valid UTC date and time
+  string</span> that represents the <span
+  title="concept-datetime">date and time in UTC</span> that is
+  represented by <var title="">input</var>.</p>
 
   <p>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>,
   <code title="attr-input-readonly">readonly</code>,
   <code title="attr-input-required">required</code>, and
   <code title="attr-input-step">step</code> content attributes;
@@ -26682,78 +26765,82 @@ function AddCloud(data, x, y) { ... }</pre>
 
   <h6><dfn title="attr-input-type-datetime-local">Local Date and Time</dfn> state</h6>
 
   <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-local">Local Date and Time</span>
   state, the rules in this section apply.</p>
 
   <p>The <code>input</code> element represents a control for setting
   the element's <span title="concept-fe-value">value</span> to a
-  string representing a <span>date and time</span>, with no time zone
-  information.</p>
+  string representing a <span title="concept-datetime-local">local
+  date and time</span>, with no time zone information.</p>
 
   <p>If the element 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>, as
-  obtained by <span title="parse a date and time">parsing a date and
+  the user should allow the user to change the <span
+  title="concept-datetime-local">date and time</span> represented by
+  its <span title="concept-fe-value">value</span>, as obtained by
+  <span title="parse a local date and time string">parsing a date and
   time</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 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
-  date and time</span> representing the user's selection. User agents
-  should allow the user to set the <span
+  a <span>valid local date and time string</span>. If the user agent
+  provides a user interface for selecting a <span
+  title="concept-datetime-local">local date and time</span>, then the
+  <span title="concept-fe-value">value</span> must be set to a
+  <span>valid local date and time string</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>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 date and time</span>, then set
-  it to the empty string instead.</p>
+  of the element is not a <span>valid local date and time
+  string</span>, then set it to the empty string instead.</p>
 
   <p>The <code title="attr-input-min">min</code> attribute, if
-  specified, must have a value that is a <span>valid date and
-  time</span>. The <code title="attr-input-max">max</code> attribute,
-  if specified, must have a value that is a <span>valid date and
-  time</span>.</p>
+  specified, must have a value that is a <span>valid local date and
+  time string</span>. The <code title="attr-input-max">max</code>
+  attribute, if specified, must have a value that is a <span>valid
+  local date and time string</span>.</p>
 
   <p>The <code title="attr-input-step">step</code> attribute is
   expressed in seconds. The <span
   title="concept-input-step-scale">step scale factor</span> is 1000
   (which converts the seconds to milliseconds, as used in the other
   algorithms). The <span title="concept-input-step-default">default
   step</span> is 60 seconds.</p>
 
   <p>When the element is <span>suffering from a step mismatch</span>,
   the user agent may round the element's <span
-  title="concept-input-value">value</span> to the nearest date and
-  time for which the element would not <span title="suffering from a
-  step mismatch">suffer from a step mismatch</span>.</p>
+  title="concept-input-value">value</span> to the nearest <span
+  title="concept-datetime-local">local date and time</span> for which
+  the element would not <span title="suffering from a step
+  mismatch">suffer from a step mismatch</span>.</p>
 
   <p><strong>The <span
   title="concept-input-value-string-number">algorithm to convert a
   string to a number</span>, given a string <var title="">input</var>,
-  is as follows:</strong> If <span title="parse a date and
-  time">parsing a date and time</span> from <var title="">input</var>
-  results in an error, then return an error; otherwise, return the
-  number of milliseconds elapsed from midnight on the morning of
-  1970-01-01 (the time represented by the value "<code
-  title="">1970-01-01T00:00:00.0</code>") to the parsed date and time,
-  ignoring leap seconds.</p>
+  is as follows:</strong> If <span title="parse a local date and time
+  string">parsing a date and time</span> from <var
+  title="">input</var> results in an error, then return an error;
+  otherwise, return the number of milliseconds elapsed from midnight
+  on the morning of 1970-01-01 (the time represented by the value
+  "<code title="">1970-01-01T00:00:00.0</code>") to the parsed <span
+  title="concept-datetime-local">local date and time</span>, ignoring
+  leap seconds.</p>
 
   <p><strong>The <span
   title="concept-input-value-number-string">algorithm to convert a
   number to a string</span>, given a number <var title="">input</var>,
-  is as follows:</strong> Return a <span>valid date and time</span>
-  that represents the date and time that is <var title="">input</var>
-  milliseconds after midnight on the morning of 1970-01-01 (the time
-  represented by the value "<code
+  is as follows:</strong> Return a <span>valid local date and time
+  string</span> that represents the date and time that is <var
+  title="">input</var> milliseconds after midnight on the morning of
+  1970-01-01 (the time represented by the value "<code
   title="">1970-01-01T00:00:00.0</code>").</p>
 
   <p>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>,
   <code title="attr-input-readonly">readonly</code>,
   <code title="attr-input-required">required</code>, and

|