W3C home > Mailing lists > Public > public-html-diffs@w3.org > September 2009

hixie: Make <time> have just a .valueAsDate attribute instead of .date/.time/.timezone, since people prefer just one attribute. (whatwg r3750)

From: poot <cvsmail@w3.org>
Date: Fri, 4 Sep 2009 16:44:47 +0900 (JST)
To: public-html-diffs@w3.org
Message-Id: <20090904074448.17CDE2BBFC@toro.w3.mag.keio.ac.jp>
hixie: Make <time> have just a .valueAsDate attribute instead of
.date/.time/.timezone, since people prefer just one attribute. (whatwg
r3750)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.2920&r2=1.2921&f=h
http://html5.org/tools/web-apps-tracker?from=3749&to=3750

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.2920
retrieving revision 1.2921
diff -u -d -r1.2920 -r1.2921
--- Overview.html	4 Sep 2009 07:28:14 -0000	1.2920
+++ Overview.html	4 Sep 2009 07:44:24 -0000	1.2921
@@ -13543,9 +13543,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
@@ -13668,61 +13666,46 @@
    offset can only be present if both a date and a time are also
    present.)</li>
 
-  </ol></div><dl class="domintro"><dt><var title="">time</var> . <code title="dom-time-date"><a href="#dom-time-date">date</a></code></dt>
+  </ol></div><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 null if there is no date.</p>
+    <p>Returns a <code>Date</code> object representing the specified date and time.</p>
 
    </dd>
 
-   <dt><var title="">time</var> . <code title="dom-time-time"><a href="#dom-time-time">time</a></code></dt>
-
-   <dd>
-
-    <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>Returns null if there is no time.</p>
+  </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>
 
-   <dt><var title="">time</var> . <code title="dom-time-timezone"><a href="#dom-time-timezone">timezone</a></code></dt>
+  <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>
 
-   <dd>
+   <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>
 
-    <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>
+   <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>
 
-    <p>Returns null if there is no time zone.</p>
+   <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>
 
-  </dl><div>
+   <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>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>
+   <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>
 
-  <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>
+   <dd>The null value.</dd>
 
-  <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>
+  </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>
 
   </div><div class="example">
 
@@ -13730,32 +13713,17 @@
 
    <pre>&lt;p&gt;Our first date was &lt;time datetime="2006-09-23"&gt;a Saturday&lt;/time&gt;.&lt;/p&gt;</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><!-- <pre>&lt;p>We stopped talking at &lt;time datetime="2006-09-24T05:00-07:00">5am the next morning&lt;/time>.&lt;/p></pre> --><div class="example">
 
    <p>In the following snippet:</p>
 
-   <pre>&lt;p&gt;We stopped talking at &lt;time datetime="2006-09-24T05:00-07:00"&gt;5am the next morning&lt;/time&gt;.&lt;/p&gt;</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,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
-   &minus;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>Finally, in the following snippet:</p>
-
    <pre>&lt;p&gt;Many people get up at &lt;time&gt;08:00&lt;/time&gt;.&lt;/p&gt;</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><div class="example">
Received on Friday, 4 September 2009 07:45:25 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:09:00 UTC