[html5] r3750 - [] (0) Make <time> have just a .valueAsDate attribute instead of .date/.time/.ti [...]

whatwg at whatwg.org whatwg at whatwg.org
Fri Sep 4 00:47:39 PDT 2009


Author: ianh
Date: 2009-09-04 00:47:38 -0700 (Fri, 04 Sep 2009)
New Revision: 3750

Modified:
   index
   source
Log:
[] (0) Make <time> have just a .valueAsDate attribute instead of .date/.time/.timezone, since people prefer just one attribute.

Modified: index
===================================================================
--- index	2009-09-04 07:31:28 UTC (rev 3749)
+++ index	2009-09-04 07:47:38 UTC (rev 3750)
@@ -15468,9 +15468,7 @@
 <pre class=idl>interface <dfn id=htmltimeelement>HTMLTimeElement</dfn> : <a href=#htmlelement>HTMLElement</a> {
            attribute DOMString <a href=#dom-time-datetime title=dom-time-datetime>dateTime</a>;
            attribute boolean <a href=#dom-time-pubdate title=dom-time-pubDate>pubDate</a>;
-  readonly attribute <span>Date</span> <a href=#dom-time-date title=dom-time-date>date</a>;
-  readonly attribute <span>Date</span> <a href=#dom-time-time title=dom-time-time>time</a>;
-  readonly attribute <span>Date</span> <a href=#dom-time-timezone title=dom-time-timezone>timezone</a>;
+  readonly attribute <span>Date</span> <a href=#dom-time-valueasdate title=dom-time-valueAsDate>valueAsDate</a>;
 };</pre>
    </dd>
   </dl><p>The <code><a href=#the-time-element>time</a></code> element <a href=#represents>represents</a> either a
@@ -15623,62 +15621,47 @@
 
   </ol></div>
 
-  <dl class=domintro><dt><var title="">time</var> . <code title=dom-time-date><a href=#dom-time-date>date</a></code></dt>
+  <dl class=domintro><dt><var title="">time</var> . <code title=dom-time-valueAsDate><a href=#dom-time-valueasdate>valueAsDate</a></code></dt>
 
    <dd>
 
-    <p>Returns a <code>Date</code> object representing the date
-    component of the element's value, at midnight in the UTC
-    time zone.</p>
+    <p>Returns a <code>Date</code> object representing the specified date and time.</p>
 
-    <p>Returns null if there is no date.</p>
-
    </dd>
 
-   <dt><var title="">time</var> . <code title=dom-time-time><a href=#dom-time-time>time</a></code></dt>
+  </dl><div>
 
-   <dd>
+  <p>The <dfn id=dom-time-valueasdate title=dom-time-valueAsDate><code>valueAsDate</code></dfn> IDL
+  attribute must return either null or a <code>Date</code> object
+  initialised to the relevant value as defined by the following
+  list:</p>
 
-    <p>Returns a <code>Date</code> object representing the time
-    component of the element's value, on 1970-01-01 in the UTC
-    time zone.</p>
+  <dl><dt>If the <a href=#concept-time-date title=concept-time-date>date</a> is known but
+   the <a href=#concept-time-time title=concept-time-time>time</a> is not</dt>
 
-    <p>Returns null if there is no time.</p>
+   <dd>The time corresponding to midnight UTC (i.e. the first second)
+   of the given <a href=#concept-time-date title=concept-time-date>date</a>.</dd>
 
-   </dd>
+   <dt>If the <a href=#concept-time-time title=concept-time-time>time</a> is known but
+   the <a href=#concept-time-date title=concept-time-date>date</a> is not</dt>
 
-   <dt><var title="">time</var> . <code title=dom-time-timezone><a href=#dom-time-timezone>timezone</a></code></dt>
+   <dd>The time corresponding to the given <a href=#concept-time-time title=concept-time-time>time</a> of 1970-01-01, with the time
+   zone UTC.</dd>
 
-   <dd>
+   <dt>If both the <a href=#concept-time-date title=concept-time-date>date</a> and the
+   <a href=#concept-time-time title=concept-time-time>time</a> are known</dt>
 
-    <p>Returns a <code>Date</code> object representing the time
-    corresponding to 1970-01-01 00:00 UTC in the time zone given by the
-    element's value.</p>
+   <dd>The time corresponding to the <a href=#concept-time-date title=concept-time-date>date</a> and <a href=#concept-time-time title=concept-time-time>time</a>, with the given <a href=#concept-time-timezone title=concept-time-timezone>time-zone offset</a>.
 
-    <p>Returns null if there is no time zone.</p>
+   <dt>If neither the <a href=#concept-time-date title=concept-time-date>date</a> nor
+   the <a href=#concept-time-time title=concept-time-time>time</a> are known</dt>
 
-   </dd>
+   <dd>The null value.</dd>
 
-  </dl><div>
+  </dl><p>The same <code>Date</code> object must be returned until the
+  <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> attribute is
+  removed or changed.</p>
 
-  <p>The <dfn id=dom-time-date title=dom-time-date><code>date</code></dfn> IDL
-  attribute must return null if the <a href=#concept-time-date title=concept-time-date>date</a> is unknown, and otherwise must
-  return the time corresponding to midnight UTC (i.e. the first
-  second) of the given <a href=#concept-time-date title=concept-time-date>date</a>.</p>
-
-  <p>The <dfn id=dom-time-time title=dom-time-time><code>time</code></dfn> IDL attribute
-  must return null if the <a href=#concept-time-time title=concept-time-time>time</a> is
-  unknown, and otherwise must return the time corresponding to the
-  given <a href=#concept-time-time title=concept-time-time>time</a> of 1970-01-01, with
-  the time zone UTC.</p>
-
-  <p>The <dfn id=dom-time-timezone title=dom-time-timezone><code>timezone</code></dfn>
-  IDL attribute must return null if the <a href=#concept-time-timezone title=concept-time-timezone>time-zone offset</a> is unknown,
-  and otherwise must return the time corresponding to 1970-01-01 00:00
-  UTC in the given <a href=#concept-time-timezone title=concept-time-timezone>time-zone
-  offset</a>, with the time zone set to UTC (i.e. the time
-  corresponding to 1970-01-01 at 00:00 UTC plus the offset).</p>
-
   </div>
 
   <div class=example>
@@ -15687,32 +15670,21 @@
 
    <pre><p>Our first date was <time datetime="2006-09-23">a Saturday</time>.</p></pre>
 
-   <p>...the <code><a href=#the-time-element>time</a></code> element's <code title=dom-time-date><a href=#dom-time-date>date</a></code> attribute would have the value
-   1,158,969,600,000ms, and the <code title=dom-time-time><a href=#dom-time-time>time</a></code>
-   and <code title=dom-time-timezone><a href=#dom-time-timezone>timezone</a></code> attributes would
-   return null.</p>
+   <p>...the <code><a href=#the-time-element>time</a></code> element's <code title=dom-time-valueAsDate><a href=#dom-time-valueasdate>valueAsDate</a></code> attribute would
+   have the value 1,158,969,600,000ms.</p>
 
+  </div>
 
-   <p>In the following snippet:</p>
+  <!-- <pre><p>We stopped talking at <time datetime="2006-09-24T05:00-07:00">5am the next morning</time>.</p></pre> -->
 
-   <pre><p>We stopped talking at <time datetime="2006-09-24T05:00-07:00">5am the next morning</time>.</p></pre>
+  <div class=example>
 
-   <p>...the <code><a href=#the-time-element>time</a></code> element's <code title=dom-time-date><a href=#dom-time-date>date</a></code> attribute would have the value
-   1,159,056,000,000ms, the <code title=dom-time-time><a href=#dom-time-time>time</a></code>
-   attribute would have the value 18,000,000ms, and the <code title=dom-time-timezone><a href=#dom-time-timezone>timezone</a></code> attribute would return
-   −25,200,000ms. To obtain the actual time, the three attributes can
-   be added together, obtaining 1,159,048,800,000, which is the
-   specified date and time in UTC.</p>
+   <p>In the following snippet:</p>
 
-
-   <p>Finally, in the following snippet:</p>
-
    <pre><p>Many people get up at <time>08:00</time>.</p></pre>
 
-   <p>...the <code><a href=#the-time-element>time</a></code> element's <code title=dom-time-date><a href=#dom-time-date>date</a></code> attribute would have the value null,
-   the <code title=dom-time-time><a href=#dom-time-time>time</a></code> attribute would have the
-   value 28,800,000ms, and the <code title=dom-time-timezone><a href=#dom-time-timezone>timezone</a></code> attribute would return
-   null.</p>
+   <p>...the <code><a href=#the-time-element>time</a></code> element's <code title=dom-time-valueAsDate><a href=#dom-time-valueasdate>valueAsDate</a></code> attribute would
+   have the value 28,800,000ms.</p>
 
   </div>
 

Modified: source
===================================================================
--- source	2009-09-04 07:31:28 UTC (rev 3749)
+++ source	2009-09-04 07:47:38 UTC (rev 3750)
@@ -16566,9 +16566,7 @@
 <pre class="idl">interface <dfn>HTMLTimeElement</dfn> : <span>HTMLElement</span> {
            attribute DOMString <span title="dom-time-datetime">dateTime</span>;
            attribute boolean <span title="dom-time-pubDate">pubDate</span>;
-  readonly attribute <span>Date</span> <span title="dom-time-date">date</span>;
-  readonly attribute <span>Date</span> <span title="dom-time-time">time</span>;
-  readonly attribute <span>Date</span> <span title="dom-time-timezone">timezone</span>;
+  readonly attribute <span>Date</span> <span title="dom-time-valueAsDate">valueAsDate</span>;
 };</pre>
    </dd>
   </dl>
@@ -16746,67 +16744,58 @@
 
   <dl class="domintro">
 
-   <dt><var title="">time</var> . <code title="dom-time-date">date</code></dt>
+   <dt><var title="">time</var> . <code title="dom-time-valueAsDate">valueAsDate</code></dt>
 
    <dd>
 
-    <p>Returns a <code>Date</code> object representing the date
-    component of the element's value, at midnight in the UTC
-    time zone.</p>
+    <p>Returns a <code>Date</code> object representing the specified date and time.</p>
 
-    <p>Returns null if there is no date.</p>
-
    </dd>
 
-   <dt><var title="">time</var> . <code title="dom-time-time">time</code></dt>
+  </dl>
 
-   <dd>
+  <div>
 
-    <p>Returns a <code>Date</code> object representing the time
-    component of the element's value, on 1970-01-01 in the UTC
-    time zone.</p>
+  <p>The <dfn
+  title="dom-time-valueAsDate"><code>valueAsDate</code></dfn> IDL
+  attribute must return either null or a <code>Date</code> object
+  initialised to the relevant value as defined by the following
+  list:</p>
 
-    <p>Returns null if there is no time.</p>
+  <dl>
 
-   </dd>
+   <dt>If the <span title="concept-time-date">date</span> is known but
+   the <span title="concept-time-time">time</span> is not</dt>
 
-   <dt><var title="">time</var> . <code title="dom-time-timezone">timezone</code></dt>
+   <dd>The time corresponding to midnight UTC (i.e. the first second)
+   of the given <span title="concept-time-date">date</span>.</dd>
 
-   <dd>
+   <dt>If the <span title="concept-time-time">time</span> is known but
+   the <span title="concept-time-date">date</span> is not</dt>
 
-    <p>Returns a <code>Date</code> object representing the time
-    corresponding to 1970-01-01 00:00 UTC in the time zone given by the
-    element's value.</p>
+   <dd>The time corresponding to the given <span
+   title="concept-time-time">time</span> of 1970-01-01, with the time
+   zone UTC.</dd>
 
-    <p>Returns null if there is no time zone.</p>
+   <dt>If both the <span title="concept-time-date">date</span> and the
+   <span title="concept-time-time">time</span> are known</dt>
 
-   </dd>
+   <dd>The time corresponding to the <span
+   title="concept-time-date">date</span> and <span
+   title="concept-time-time">time</span>, with the given <span
+   title="concept-time-timezone">time-zone offset</span>.</p>
 
-  </dl>
+   <dt>If neither the <span title="concept-time-date">date</span> nor
+   the <span title="concept-time-time">time</span> are known</dt>
 
-  <div>
+   <dd>The null value.</dd>
 
-  <p>The <dfn title="dom-time-date"><code>date</code></dfn> IDL
-  attribute must return null if the <span
-  title="concept-time-date">date</span> is unknown, and otherwise must
-  return the time corresponding to midnight UTC (i.e. the first
-  second) of the given <span
-  title="concept-time-date">date</span>.</p>
+  </dl>
 
-  <p>The <dfn title="dom-time-time"><code>time</code></dfn> IDL attribute
-  must return null if the <span title="concept-time-time">time</span> is
-  unknown, and otherwise must return the time corresponding to the
-  given <span title="concept-time-time">time</span> of 1970-01-01, with
-  the time zone UTC.</p>
+  <p>The same <code>Date</code> object must be returned until the
+  <code title="attr-time-datetime">datetime</code> attribute is
+  removed or changed.</p>
 
-  <p>The <dfn title="dom-time-timezone"><code>timezone</code></dfn>
-  IDL attribute must return null if the <span
-  title="concept-time-timezone">time-zone offset</span> is unknown,
-  and otherwise must return the time corresponding to 1970-01-01 00:00
-  UTC in the given <span title="concept-time-timezone">time-zone
-  offset</span>, with the time zone set to UTC (i.e. the time
-  corresponding to 1970-01-01 at 00:00 UTC plus the offset).</p>
-
   </div>
 
   <div class="example">
@@ -16816,36 +16805,22 @@
    <pre><p>Our first date was <time datetime="2006-09-23">a Saturday</time>.</p></pre>
 
    <p>...the <code>time</code> element's <code
-   title="dom-time-date">date</code> attribute would have the value
-   1,158,969,600,000ms, and the <code title="dom-time-time">time</code>
-   and <code title="dom-time-timezone">timezone</code> attributes would
-   return null.</p>
+   title="dom-time-valueAsDate">valueAsDate</code> attribute would
+   have the value 1,158,969,600,000ms.</p>
 
+  </div>
 
-   <p>In the following snippet:</p>
+  <!-- <pre><p>We stopped talking at <time datetime="2006-09-24T05:00-07:00">5am the next morning</time>.</p></pre> -->
 
-   <pre><p>We stopped talking at <time datetime="2006-09-24T05:00-07:00">5am the next morning</time>.</p></pre>
+  <div class="example">
 
-   <p>...the <code>time</code> element's <code
-   title="dom-time-date">date</code> attribute would have the value
-   1,159,056,000,000ms, the <code title="dom-time-time">time</code>
-   attribute would have the value 18,000,000ms, and the <code
-   title="dom-time-timezone">timezone</code> attribute would return
-   &#x2212;25,200,000ms. To obtain the actual time, the three attributes can
-   be added together, obtaining 1,159,048,800,000, which is the
-   specified date and time in UTC.</p>
+   <p>In the following snippet:</p>
 
-
-   <p>Finally, in the following snippet:</p>
-
    <pre><p>Many people get up at <time>08:00</time>.</p></pre>
 
    <p>...the <code>time</code> element's <code
-   title="dom-time-date">date</code> attribute would have the value null,
-   the <code title="dom-time-time">time</code> attribute would have the
-   value 28,800,000ms, and the <code
-   title="dom-time-timezone">timezone</code> attribute would return
-   null.</p>
+   title="dom-time-valueAsDate">valueAsDate</code> attribute would
+   have the value 28,800,000ms.</p>
 
   </div>
 




More information about the Commit-Watchers mailing list