Skip to content

Commit

Permalink
<t> becomes <time>
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.whatwg.org/webapps@359 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Nov 23, 2006
1 parent 6b4f9a6 commit fdfe654
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 116 deletions.
141 changes: 72 additions & 69 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,8 @@
<li><a href="#the-x"><span class=secno>3.10.10. </span>The <dfn
id=x><code>x</code></dfn> element</a>

<li><a href="#the-t"><span class=secno>3.10.11. </span>The <dfn
id=t><code>t</code></dfn> element</a>
<li><a href="#the-time"><span class=secno>3.10.11. </span>The <dfn
id=time><code>time</code></dfn> element</a>

<li><a href="#the-meter"><span class=secno>3.10.12. </span>The <dfn
id=meter><code>meter</code></dfn> element</a>
Expand Down Expand Up @@ -8447,8 +8447,8 @@ for any reference to a publication, including those that aren't really
citations ("my favourite book is <cite>...</cite>").
-->

<h4 id=the-t><span class=secno>3.10.11. </span>The <dfn
id=t0><code>t</code></dfn> element</h4>
<h4 id=the-time><span class=secno>3.10.11. </span>The <dfn
id=time0><code>time</code></dfn> element</h4>

<p><a href="#strictly">Strictly inline-level content</a>.

Expand All @@ -8464,47 +8464,49 @@ citations ("my favourite book is <cite>...</cite>").

<dt>Element-specific attributes:

<dd><code title=attr-t-datetime><a href="#datetime">datetime</a></code>
<dd><code title=attr-time-datetime><a href="#datetime">datetime</a></code>

<dt>DOM interface:

<dd>
<pre
class=idl>interface <dfn id=htmltelement>HTMLTElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
attribute DOMString <a href="#datetime0" title=dom-t-datetime>datetime</a>;
readonly attribute DOMTimeStamp <a href="#date0" title=dom-t-date>date</a>;
readonly attribute DOMTimeStamp <a href="#time0" title=dom-t-time>time</a>;
readonly attribute DOMTimeStamp <a href="#timezone0" title=dom-t-timezone>timezone</a>;
class=idl>interface <dfn id=htmltimeelement>HTMLTimeElement</dfn> : <a href="#htmlelement">HTMLElement</a> {
attribute DOMString <a href="#datetime0" title=dom-time-datetime>datetime</a>;
readonly attribute DOMTimeStamp <a href="#date0" title=dom-time-date>date</a>;
readonly attribute DOMTimeStamp <a href="#time2" title=dom-time-time>time</a>;
readonly attribute DOMTimeStamp <a href="#timezone0" title=dom-time-timezone>timezone</a>;
};</pre>
</dl>

<p>The <code><a href="#t0">t</a></code> element represents a date and/or a
time.
<p>The <code><a href="#time0">time</a></code> element represents a date
and/or a time.

<p>The <dfn id=datetime title=attr-t-datetime><code>datetime</code></dfn>
attribute, if present, must contain a <a href="#date-or">date or time
string</a> that identifies the date or time being specified.
<p>The <dfn id=datetime
title=attr-time-datetime><code>datetime</code></dfn> attribute, if
present, must contain a <a href="#date-or">date or time string</a> that
identifies the date or time being specified.

<p>If the <code title=attr-t-datetime><a
<p>If the <code title=attr-time-datetime><a
href="#datetime">datetime</a></code> attribute is not present, then the
date or time must be specified in the content of the element, such that
parsing the element's <code><a href="#textcontent">textContent</a></code>
according to the rules for parsing <a href="#date-or0" title="date or time
string in content">date or time strings in content</a> successfully
extracts a date or time.

<p>The <dfn id=datetime0 title=dom-t-datetime><code>datetime</code></dfn>
DOM attribute must <a href="#reflect">reflect</a> the <code
title=attr-t-datetime><a href="#datetime">datetime</a></code> content
attribute.
<p>The <dfn id=datetime0
title=dom-time-datetime><code>datetime</code></dfn> DOM attribute must <a
href="#reflect">reflect</a> the <code title=attr-time-datetime><a
href="#datetime">datetime</a></code> content attribute.

<p>User agents, to obtain the <dfn id=date title=concept-t-date>date</dfn>,
<dfn id=time title=concept-t-time>time</dfn>, and <dfn id=timezone
title=concept-t-timezone>timezone</dfn> represented by a <code><a
href="#t0">t</a></code> element, must follow the following steps:
<p>User agents, to obtain the <dfn id=date
title=concept-time-date>date</dfn>, <dfn id=time1
title=concept-time-time>time</dfn>, and <dfn id=timezone
title=concept-time-timezone>timezone</dfn> represented by a <code><a
href="#time0">time</a></code> element, must follow the following steps:

<ol>
<li>If the <code title=attr-t-datetime><a
<li>If the <code title=attr-time-datetime><a
href="#datetime">datetime</a></code> attribute is present, then parse it
according to the rules for parsing <a href="#date-or1" title="date or
time string in attributes">date or time strings in content</a>, and let
Expand All @@ -8517,73 +8519,74 @@ citations ("my favourite book is <cite>...</cite>").
<var title="">result</var>.

<li>If <var title="">result</var> is empty (because the parsing failed),
then the <a href="#date" title=concept-t-date>date</a> is unknown, the <a
href="#time" title=concept-t-time>time</a> is unknown, and the <a
href="#timezone" title=concept-t-timezone>timezone</a> is unknown.
then the <a href="#date" title=concept-time-date>date</a> is unknown, the
<a href="#time1" title=concept-time-time>time</a> is unknown, and the <a
href="#timezone" title=concept-time-timezone>timezone</a> is unknown.

<li>Otherwise: if <var title="">result</var> contains a date, then that is
the <a href="#date" title=concept-t-date>date</a>; if <var
title="">result</var> contains a time, then that is the <a href="#time"
title=concept-t-time>time</a>; and if <var title="">result</var> contains
a timezone, then the timezone is the element's <a href="#timezone"
title=concept-t-timezone>timezone</a>. (A timezone can only be present if
both a date and a time are also present.)
the <a href="#date" title=concept-time-date>date</a>; if <var
title="">result</var> contains a time, then that is the <a href="#time1"
title=concept-time-time>time</a>; and if <var title="">result</var>
contains a timezone, then the timezone is the element's <a
href="#timezone" title=concept-time-timezone>timezone</a>. (A timezone
can only be present if both a date and a time are also present.)
</ol>

<p>The <dfn id=date0 title=dom-t-date><code>date</code></dfn> DOM attribute
must return null if the <a href="#date" title=concept-t-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="#date"
title=concept-t-date>date</a>.

<p>The <dfn id=time0 title=dom-t-time><code>time</code></dfn> DOM attribute
must return null if the <a href="#time" title=concept-t-time>time</a> is
unknown, and otherwise must return the time corresponding to the given <a
href="#time" title=concept-t-time>time</a> of 1970-01-01, with the
timezone UTC.

<p>The <dfn id=timezone0 title=dom-t-timezone><code>timezone</code></dfn>
DOM attribute must return null if the <a href="#timezone"
title=concept-t-timezone>timezone</a> is unknown, and otherwise must
<p>The <dfn id=date0 title=dom-time-date><code>date</code></dfn> DOM
attribute must return null if the <a href="#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="#date" title=concept-time-date>date</a>.

<p>The <dfn id=time2 title=dom-time-time><code>time</code></dfn> DOM
attribute must return null if the <a href="#time1"
title=concept-time-time>time</a> is unknown, and otherwise must return the
time corresponding to the given <a href="#time1"
title=concept-time-time>time</a> of 1970-01-01, with the timezone UTC.

<p>The <dfn id=timezone0
title=dom-time-timezone><code>timezone</code></dfn> DOM attribute must
return null if the <a href="#timezone"
title=concept-time-timezone>timezone</a> is unknown, and otherwise must
return the time corresponding to 1970-01-01 00:00 UTC in the given <a
href="#timezone" title=concept-t-timezone>timezone</a>, with the timezone
set to UTC (i.e. the time corresponding to 1970-01-01 at 00:00 UTC plus
the offset corresponding to the timezone).
href="#timezone" title=concept-time-timezone>timezone</a>, with the
timezone set to UTC (i.e. the time corresponding to 1970-01-01 at 00:00
UTC plus the offset corresponding to the timezone).

<div class=example>
<p>In the following snippet:</p>

<pre>&lt;p>Our first date was &lt;t datetime="2006-09-23">a saturday&lt;/t>.&lt;/p></pre>
<pre>&lt;p>Our first date was &lt;time datetime="2006-09-23">a saturday&lt;/time>.&lt;/p></pre>

<p>...the <code><a href="#t0">t</a></code> element's <code
title=dom-t-date><a href="#date0">date</a></code> attribute would have
the value 1,158,969,600,000ms, and the <code title=dom-t-time><a
href="#time0">time</a></code> and <code title=dom-t-timezone><a
<p>...the <code><a href="#time0">time</a></code> element's <code
title=dom-time-date><a href="#date0">date</a></code> attribute would have
the value 1,158,969,600,000ms, and the <code title=dom-time-time><a
href="#time2">time</a></code> and <code title=dom-time-timezone><a
href="#timezone0">timezone</a></code> attributes would return null.</p>

<p>In the following snippet:</p>

<pre>&lt;p>We stopped talking at &lt;t datetime="2006-09-24 05:00 -7">5am the next morning&lt;/t>.&lt;/p></pre>
<pre>&lt;p>We stopped talking at &lt;time datetime="2006-09-24 05:00 -7">5am the next morning&lt;/time>.&lt;/p></pre>

<p>...the <code><a href="#t0">t</a></code> element's <code
title=dom-t-date><a href="#date0">date</a></code> attribute would have
the value 1,159,056,000,000ms, the <code title=dom-t-time><a
href="#time0">time</a></code> attribute would have the value
18,000,000ms, and the <code title=dom-t-timezone><a
<p>...the <code><a href="#time0">time</a></code> element's <code
title=dom-time-date><a href="#date0">date</a></code> attribute would have
the value 1,159,056,000,000ms, the <code title=dom-time-time><a
href="#time2">time</a></code> attribute would have the value
18,000,000ms, and the <code title=dom-time-timezone><a
href="#timezone0">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>Finally, in the following snippet:</p>

<pre>&lt;p>Many people get up at &lt;t>08:00&lt;/t>.&lt;/p></pre>
<pre>&lt;p>Many people get up at &lt;time>08:00&lt;/time>.&lt;/p></pre>

<p>...the <code><a href="#t0">t</a></code> element's <code
title=dom-t-date><a href="#date0">date</a></code> attribute would have
the value null, the <code title=dom-t-time><a
href="#time0">time</a></code> attribute would have the value
28,800,000ms, and the <code title=dom-t-timezone><a
<p>...the <code><a href="#time0">time</a></code> element's <code
title=dom-time-date><a href="#date0">date</a></code> attribute would have
the value null, the <code title=dom-time-time><a
href="#time2">time</a></code> attribute would have the value
28,800,000ms, and the <code title=dom-time-timezone><a
href="#timezone0">timezone</a></code> attribute would return null.</p>
</div>

Expand Down
Loading

0 comments on commit fdfe654

Please sign in to comment.