- From: poot <cvsmail@w3.org>
- Date: Tue, 25 Nov 2008 19:43:31 +0900 (JST)
- To: public-html-diffs@w3.org
<time>: Revamp the 'vaguer moments in time' concept. (whatwg r2434) dateTime http://people.w3.org/mike/diffs/html5/spec/Overview.1.1606.html#dom-time-datetime 2.4.4.7 Vaguer moments in time http://people.w3.org/mike/diffs/html5/spec/Overview.1.1606.html#vaguer-moments-in-time HTMLTimeElement http://people.w3.org/mike/diffs/html5/spec/Overview.1.1606.html#htmltimeelement date http://people.w3.org/mike/diffs/html5/spec/Overview.1.1606.html#concept-time-date time http://people.w3.org/mike/diffs/html5/spec/Overview.1.1606.html#dom-time-time 2.4.4.8 Time offsets http://people.w3.org/mike/diffs/html5/spec/Overview.1.1606.html#time-offsets parse a week string http://people.w3.org/mike/diffs/html5/spec/Overview.1.1606.html#parse-a-week-string parse a timezone component http://people.w3.org/mike/diffs/html5/spec/Overview.1.1606.html#parse-a-timezone-component parse a global date and time string http://people.w3.org/mike/diffs/html5/spec/Overview.1.1606.html#parse-a-global-date-and-time-string datetime http://people.w3.org/mike/diffs/html5/spec/Overview.1.1606.html#attr-time-datetime parse a date or time string http://people.w3.org/mike/diffs/html5/spec/Overview.1.1606.html#parse-a-date-or-time-string 2.4.4.6 Weeks http://people.w3.org/mike/diffs/html5/spec/Overview.1.1606.html#weeks time offset serialization rules http://people.w3.org/mike/diffs/html5/spec/Overview.1.1606.html#time-offset-serialization-rules date http://people.w3.org/mike/diffs/html5/spec/Overview.1.1606.html#dom-time-date valid date or time string in content http://people.w3.org/mike/diffs/html5/spec/Overview.1.1606.html#valid-date-or-time-string-in-content http://people.w3.org/mike/diffs/html5/spec/Overview.diff.html http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.1605&r2=1.1606&f=h http://html5.org/tools/web-apps-tracker?from=2433&to=2434 =================================================================== RCS file: /sources/public/html5/spec/Overview.html,v retrieving revision 1.1605 retrieving revision 1.1606 diff -u -d -r1.1605 -r1.1606 --- Overview.html 25 Nov 2008 09:53:02 -0000 1.1605 +++ Overview.html 25 Nov 2008 10:40:24 -0000 1.1606 @@ -2640,7 +2640,29 @@ <li><p>If <var title="">position</var> is beyond the end of <var title="">input</var>, then fail.</li> - <li> + <li><p><a href=#parse-a-timezone-component>Parse a timezone component</a> to obtain <var title="">timezone<sub title="">hours</sub></var> and <var title="">timezone<sub title="">minutes</sub></var>. If this returns + nothing, then fail.</p> + + <li><p>If <var title="">position</var> is <em>not</em> beyond the + end of <var title="">input</var>, then fail.</li> + + <li><p>Let <var title="">time</var> be the moment in time at year + <var title="">year</var>, month <var title="">month</var>, day <var title="">day</var>, hours <var title="">hour</var>, minute <var title="">minute</var>, second <var title="">second</var>, + subtracting <var title="">timezone<sub title="">hours</sub></var> + hours and <var title="">timezone<sub title="">minutes</sub></var> + minutes. That moment in time is a moment in the UTC + timezone.</li> + + <li><p>Let <var title="">timezone</var> be <var title="">timezone<sub title="">hours</sub></var> hours and <var title="">timezone<sub title="">minutes</sub></var> minutes from + UTC.</li> + + <li><p>Return <var title="">time</var> and <var title="">timezone</var>.</li> + + </ol><p>The rules to <dfn id=parse-a-timezone-component>parse a timezone component</dfn>, given an <var title="">input</var> string and a <var title="">position</var>, are + as follows. This will either return timezone hours and timezone + minutes, or nothing. If at any point the algorithm says that it + "fails", this means that it is aborted at that point and returns + nothing.<ol><li> <p>If the character at <var title="">position</var> is a U+005A LATIN CAPITAL LETTER Z, then:</p> @@ -2692,20 +2714,8 @@ </ol></li> - <li><p>If <var title="">position</var> is <em>not</em> beyond the - end of <var title="">input</var>, then fail.</li> - - <li><p>Let <var title="">time</var> be the moment in time at year - <var title="">year</var>, month <var title="">month</var>, day <var title="">day</var>, hours <var title="">hour</var>, minute <var title="">minute</var>, second <var title="">second</var>, - subtracting <var title="">timezone<sub title="">hours</sub></var> - hours and <var title="">timezone<sub title="">minutes</sub></var> - minutes. That moment in time is a moment in the UTC - timezone.</li> - - <li><p>Let <var title="">timezone</var> be <var title="">timezone<sub title="">hours</sub></var> hours and <var title="">timezone<sub title="">minutes</sub></var> minutes from - UTC.</li> - - <li><p>Return <var title="">time</var> and <var title="">timezone</var>.</li> + <li><p>Return <var title="">timezone<sub title="">hours</sub></var> + and <var title="">timezone<sub title="">minutes</sub></var>.</li> </ol><h5 id=weeks><span class=secno>2.4.4.6 </span>Weeks</h5><p>A <dfn id=concept-week title=concept-week>week</dfn> consists of a week-year number and a week number representing a seven day period. Each @@ -2782,289 +2792,91 @@ <li><p>Return the week-year number <var title="">year</var> and the week number <var title="">week</var>.</li> - </ol><h5 id=vaguer-moments-in-time><span class=secno>2.4.4.7 </span>Vaguer moments in time</h5><p>This section defines <dfn id=date-or-time-string title="date or time string">date or - time strings</dfn>. There are two kinds, <dfn id=date-or-time-string-in-content title="date or time - string in content">date or time strings in content</dfn>, and <dfn id=date-or-time-string-in-attributes title="date or time string in attributes">date or time strings in - attributes</dfn>. The only difference is in the handling of - whitespace characters.<p>To parse a <a href=#date-or-time-string>date or time string</a>, user agents must use - the following algorithm. A <a href=#date-or-time-string>date or time string</a> is a - <em>valid</em> date or time string if the following algorithm, when - run on the string, doesn't say the string is invalid.</p><!-- XXX should define that without reference to the algorithm --><p>The algorithm may return nothing (in which case the string will - be invalid), or it may return a date, a time, a date and a time, or - a date and a time and a timezone. Even if the algorithm returns - one or more values, the string can still be invalid.<ol><!-- INIT --><li><p>Let <var title="">input</var> be the string being - parsed.</li> - - <li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the - string.</li> - - <li><p>Let <var title="">results</var> be the collection of results - that are to be returned (one or more of a date, a time, and a - timezone), initially empty. If the algorithm aborts at any point, - then whatever is currently in <var title="">results</var> must be - returned as the result of the algorithm.</li> - - <!-- LEADING WHITESPACE --> - <li><p>For the "in content" variant: <a href=#skip-white_space-characters>skip White_Space - characters</a>; for the "in attributes" variant: <a href=#skip-whitespace>skip - whitespace</a>.</li><!-- XXX skip whitespace in attribute? - really? --> - - <!-- YEAR or HOUR --> - <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range - U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected - sequence is empty, then the string is invalid; abort these - steps.</li> - - <li><p>Let the sequence of characters collected in the last step be - <var title="">s</var>.</li> - - <li><p>If <var title="">position</var> is past the end of <var title="">input</var>, the string is invalid; abort these - steps.</li> - - <li><p>If the character at <var title="">position</var> is - <em>not</em> a U+003A COLON character, then:</p> - - <!-- DATE --> - <ol><li><p>If the character at <var title="">position</var> is not a - U+002D HYPHEN-MINUS ("-") character either, then the string is - invalid, abort these steps.</li> - - <!-- YEAR --> - <li><p>If the sequence <var title="">s</var> is not exactly four - digits long, then the string is invalid. (This does not stop the - algorithm, however.)</li> - - <li><p>Interpret the sequence of characters collected in step 5 as - a base-ten integer, and let that number be <var title="">year</var>.</li> - - <li><p>Advance <var title="">position</var> past the U+002D - HYPHEN-MINUS ("-") character.</li> - - <!-- MONTH --> - <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range - U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected - sequence is empty, then the string is invalid; abort these - steps.</li> - - <li><p>If the sequence collected in the last step is not exactly - two digits long, then the string is invalid.</li> - - <li><p>Interpret the sequence of characters collected two steps ago - as a base-ten integer, and let that number be <var title="">month</var>.</li> - - <li>If <var title="">month</var> is not a number in the range - 1 ≤ <var title="">month</var> ≤ 12, then - the string is invalid, abort these steps.</li> - - <li><p>Let <var title="">maxday</var> be the <a href=#number-of-days-in-month-month-of-year-year>number of days - in month <var title="">month</var> of year <var title="">year</var></a>.</li> - - <li><p>If <var title="">position</var> is past the end of <var title="">input</var>, or if the character at <var title="">position</var> is <em>not</em> a U+002D HYPHEN-MINUS ("-") - character, then the string is invalid, abort these - steps. Otherwise, advance <var title="">position</var> to the next - character.</li> - - <!-- DAY --> - <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range - U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected - sequence is empty, then the string is invalid; abort these - steps.</li> - - <li><p>If the sequence collected in the last step is not exactly - two digits long, then the string is invalid.</li> - - <li><p>Interpret the sequence of characters collected two steps - ago as a base-ten integer, and let that number be <var title="">day</var>.</li> - - <li><p>If <var title="">day</var> is not a number in the range - 1 ≤ <var title="">day</var> ≤ <var title="">maxday</var>, then the string is invalid, abort these - steps.</li> - - <li><p>Add the date represented by <var title="">year</var>, <var title="">month</var>, and <var title="">day</var> to the <var title="">results</var>.</li> - - <!-- XXX we should allow the algorithm to abort here without - error, with just a date. --> - - <!-- WHITESPACE --> - <li><p>For the "in content" variant: <a href=#skip-white_space-characters>skip White_Space - characters</a>; for the "in attributes" variant: <a href=#skip-whitespace>skip - whitespace</a>.</li> - - <li><p>If the character at <var title="">position</var> is a U+0054 - LATIN CAPITAL LETTER T, then move <var title="">position</var> - forwards one character.</li> - - <li><p>For the "in content" variant: <a href=#skip-white_space-characters>skip White_Space - characters</a>; for the "in attributes" variant: <a href=#skip-whitespace>skip - whitespace</a>.</li> - - <!-- at this point, if <var title="">position</var> points to a - number, we know that we passed at least one space or a T, because - otherwise the number would have been slurped up in the last - "collect" step. --> - - <!-- HOUR --> - <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range - U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected - sequence is empty, then the string is invalid; abort these - steps.</li> - - <li><p>Let <var title="">s</var> be the sequence of characters - collected in the last step.</li> - - </ol></li> - - <!-- TIME --> - - <li><p>If <var title="">s</var> is not exactly two digits long, - then the string is invalid.</li> - - <li><p>Interpret the sequence of characters collected two steps - ago as a base-ten integer, and let that number be <var title="">hour</var>.</li> - - <li><p>If <var title="">hour</var> is not a number in the range - 0 ≤ <var title="">hour</var> ≤ 23, then - the string is invalid, abort these steps.</li> - - <li><p>If <var title="">position</var> is past the end of <var title="">input</var>, or if the character at <var title="">position</var> is <em>not</em> a U+003A COLON character, - then the string is invalid, abort these steps. Otherwise, advance - <var title="">position</var> to the next character.</li> - - <!-- MINUTE --> - <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range - U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected - sequence is empty, then the string is invalid; abort these - steps.</li> - - <li><p>If the sequence collected in the last step is not exactly - two digits long, then the string is invalid.</li> - - <li><p>Interpret the sequence of characters collected two steps - ago as a base-ten integer, and let that number be <var title="">minute</var>.</li> - - <li><p>If <var title="">minute</var> is not a number in the range - 0 ≤ <var title="">minute</var> ≤ 59, then - the string is invalid, abort these steps.</li> - - <!-- SECOND --> - <li><p>Let <var title="">second</var> be 0. It might be changed to - another value in the next step.</li> - - <li><p>If <var title="">position</var> is not past the end of <var title="">input</var> and the character at <var title="">position</var> is a U+003A COLON character, then:</p> - - <ol><li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> that are - either characters in the range U+0030 DIGIT ZERO (0) to U+0039 - DIGIT NINE (9) or are U+002E FULL STOP. If the collected sequence - is empty, or contains more than one U+002E FULL STOP character, - then the string is invalid; abort these steps.</li> - - <li><p>If the first character in the sequence collected in the - last step is not in the range U+0030 DIGIT ZERO (0) to U+0039 - DIGIT NINE (9), then the string is invalid.</li> - - <li><p>Interpret the sequence of characters collected two steps - ago as a base-ten number (possibly with a fractional part), and - let that number be <var title="">second</var>.</li> - - <li><p>If <var title="">second</var> is not a number in the range - 0 ≤ <var title="">minute</var> < 60, - then the string is invalid, abort these steps.</li> - - </ol></li> - - <li><p>Add the time represented by <var title="">hour</var>, <var title="">minute</var>, and <var title="">second</var> to the <var title="">results</var>.</li> - - <!-- TIME ZONE --> - - <li><p>If <var title="">results</var> has both a date and a time, - then:</p> - - <ol><li><p>For the "in content" variant: <a href=#skip-white_space-characters>skip White_Space - characters</a>; for the "in attributes" variant: <a href=#skip-whitespace>skip - whitespace</a>.</li> - - <li><p>If <var title="">position</var> is past the end of <var title="">input</var>, then skip to the next step in the overall - set of steps.</p> + </ol><h5 id=vaguer-moments-in-time><span class=secno>2.4.4.7 </span>Vaguer moments in time</h5><p>A <dfn id=date-or-time-string>date or time string</dfn> consists of either a <a href=#concept-date title=concept-date>date</a>, a <a href=#concept-time title=concept-time>time</a>, or a <a href=#concept-datetime title=concept-datetime>global date and time</a>.<p>A string is a <dfn id=valid-date-or-time-string>valid date or time string</dfn> if it is also + one of the following:<ul><li>A <a href=#valid-date-string>valid date string</a>.</li> - <!-- UTC --> - <li><p>Otherwise, if the character at <var title="">position</var> is a U+005A LATIN CAPITAL LETTER Z, - then:</p> + <li>A <a href=#valid-time-string>valid time string</a>.</li> - <ol><li><p>Add the timezone corresponding to UTC (zero offset) to - the <var title="">results</var>.</li> + <li>A <a href=#valid-global-date-and-time-string>valid global date and time string</a>.</li> - <li><p>Advance <var title="">position</var> to the next character - in <var title="">input</var>.</li> + </ul><p>A string is a <dfn id=valid-date-or-time-string-in-content>valid date or time string in content</dfn> if + it consists of zero or more <a href=#white_space>White_Space</a> characters, + followed by a <a href=#valid-date-or-time-string>valid date or time string</a>, followed by + zero or more further <a href=#white_space>White_Space</a> characters.<p>The rules to <dfn id=parse-a-date-or-time-string>parse a date or time string</dfn> are as + follows. The algorithm is invoked with a flag indicating if the + <i>in attribute</i> variant or the <i>in content</i> variant is to + be used. The algorithm will either return a <a href=#concept-date title=concept-date>date</a>, a <a href=#concept-time title=concept-time>time</a>, a <a href=#concept-datetime title=concept-datetime>global date and time</a>, or nothing. If + at any point the algorithm says that it "fails", this means that it + is aborted at that point and returns nothing.<ol><li><p>Let <var title="">input</var> be the string being + parsed.</li> - <li><p>Skip to the next step in the overall set of - steps.</li> + <li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the + string.</li> - </ol></li> + <li><p>For the <i>in content</i> variant: <a href=#skip-white_space-characters>skip White_Space + characters</a>.</li> - <!-- EXPLICIT TIMEZONE OFFSET --> - <li><p>Otherwise, if the character at <var title="">position</var> is either a U+002B PLUS SIGN ("+") or a - U+002D HYPHEN-MINUS ("-"), then:</p> + <li><p>Set <var title="">start position</var> to the same position + as <var title="">position</var>.</li> - <ol><!-- SIGN --><li><p>If the character at <var title="">position</var> is a - U+002B PLUS SIGN ("+"), let <var title="">sign</var> be - "positive". Otherwise, it's a U+002D HYPHEN-MINUS ("-"); let - <var title="">sign</var> be "negative".</li> + <li><p>Set the <var title="">date present</var> and <var title="">time present</var> flags to true.</li> - <!-- HOURS --> - <li><p>Advance <var title="">position</var> to the next - character in <var title="">input</var>.</li> + <li><p><a href=#parse-a-date-component>Parse a date component</a> to obtain <var title="">year</var>, <var title="">month</var>, and <var title="">day</var>. If this fails, then set the <var title="">date + present</var> flag to false.</p> - <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the - range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the - collected sequence is not exactly two characters long, then - the string is invalid.</li> + <li> - <li><p>Interpret the sequence collected in the last step as a - base-ten number, and let that number be <var title="">timezone<sub title="">hours</sub></var>.</li> + <p>If <var title="">date present</var> is true, and <var title="">position</var> is not beyond the end of <var title="">input</var>, and the character at <var title="">position</var> is a U+0054 LATIN CAPITAL LETTER T + character, then advance <var title="">position</var> to the next + character in <var title="">input</var>.</p> - <li>If <var title="">timezone<sub title="">hours</sub></var> is not a - number in the range 0 ≤ <var title="">timezone<sub title="">hours</sub></var> ≤ 23, then - the string is invalid; abort these steps.</li> + <p>Otherwise, if <var title="">date present</var> is true, and + either <var title="">position</var> is beyond the end of <var title="">input</var> or the character at <var title="">position</var> is not a U+0054 LATIN CAPITAL LETTER T + character, then set <var title="">time present</var> to false.</p> - <li>If <var title="">sign</var> is "negative", then negate <var title="">timezone<sub title="">hours</sub></var>.</li> + <p>Otherwise, if <var title="">date present</var> is false, set + <var title="">position</var> back to the same position as <var title="">start position</var>.</p> - <li><p>If <var title="">position</var> is beyond the end of - <var title="">input</var> or if the character at <var title="">position</var> is not a U+003A COLON character, then - the string is invalid; abort these steps. Otherwise, move <var title="">position</var> forwards one character.</li> + </li> - <!-- MINUTES --> - <li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range - U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected - sequence is not exactly two characters long, then the string is invalid.</li> + <li><p>If the <var title="">time present</var> flag is true, then + <a href=#parse-a-time-component>parse a time component</a> to obtain <var title="">hour</var>, <var title="">minute</var>, and <var title="">second</var>. If this returns nothing, then set the <var title="">time present</var> flag to false.</p> - <li><p>Interpret the sequence collected in the last step as a - base-ten number, and let that number be <var title="">timezone<sub title="">minutes</sub></var>.</li> + <li><p>If both the <var title="">date present</var> and <var title="">time present</var> flags are false, then fail.</li> - <li>If <var title="">timezone<sub title="">minutes</sub></var> is not a - number in the range 0 ≤ <var title="">timezone<sub title="">minutes</sub></var> ≤ 59, - then the string is invalid; abort these steps.</li> + <li><p>If the <var title="">time present</var> flag is true, but + <var title="">position</var> is beyond the end of <var title="">input</var>, then fail.</li> - <li><p>Add the timezone corresponding to an offset of <var title="">timezone<sub title="">hours</sub></var> hours and <var title="">timezone<sub title="">minutes</sub></var> minutes to the <var title="">results</var>.</li> + <li><p>If the <var title="">date present</var> and <var title="">time present</var> flags are both true, <a href=#parse-a-timezone-component>parse a + timezone component</a> to obtain <var title="">timezone<sub title="">hours</sub></var> and <var title="">timezone<sub title="">minutes</sub></var>. If this returns nothing, then + fail.</p> - <li><p>Skip to the next step in the overall set of - steps.</li> + <li><p>For the <i>in content</i> variant: <a href=#skip-white_space-characters>skip White_Space + characters</a>.</li> - </ol></li> + <li><p>If <var title="">position</var> is <em>not</em> beyond the + end of <var title="">input</var>, then fail.</li> - <li><p>Otherwise, the string is invalid; abort these - steps.</li> + <li> - </ol></li> + <p>If the <var title="">date present</var> flag is true and the + <var title="">time present</var> flag is false, then let <var title="">date</var> be the date with year <var title="">year</var>, month <var title="">month</var>, and day <var title="">day</var>, and return <var title="">date</var>.</p> - <li><p>For the "in content" variant: <a href=#skip-white_space-characters>skip White_Space - characters</a>; for the "in attributes" variant: <a href=#skip-whitespace>skip - whitespace</a>.</li> + <p>Otherwise, if the <var title="">time present</var> flag is true + and the <var title="">date present</var> flag is false, then let + <var title="">time</var> be the time with hour <var title="">hour</var>, minute <var title="">minute</var>, and second + <var title="">second</var>, and return <var title="">time</var>.</p> - <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> + <p>Otherwise, let <var title="">time</var> be the moment in time + at year <var title="">year</var>, month <var title="">month</var>, + day <var title="">day</var>, hours <var title="">hour</var>, + minute <var title="">minute</var>, second <var title="">second</var>, subtracting <var title="">timezone<sub title="">hours</sub></var> hours and <var title="">timezone<sub title="">minutes</sub></var> minutes, that moment in time being a + moment in the UTC timezone; let <var title="">timezone</var> be + <var title="">timezone<sub title="">hours</sub></var> hours and + <var title="">timezone<sub title="">minutes</sub></var> minutes + from UTC; and return <var title="">time</var> and <var title="">timezone</var>.</p> - <li><p>Abort these steps (the string is parsed).</li> + </li> </ol><h5 id=time-offsets><span class=secno>2.4.4.8 </span>Time offsets</h5><p class=XXX><dfn id=valid-time-offset>valid time offset</dfn>, <dfn id=rules-for-parsing-time-offsets>rules for parsing time offsets</dfn>, <dfn id=time-offset-serialization-rules>time offset serialization @@ -10262,22 +10074,21 @@ };</pre> </dd> </dl><p>The <code><a href=#the-time-element>time</a></code> element represents a date and/or a time.<p>The <dfn id=attr-time-datetime title=attr-time-datetime><code>datetime</code></dfn> - attribute, if present, must contain a <a href=#date-or-time-string>date or time - string</a> that identifies the date or time being specified.<p>If the <code title=attr-time-datetime><a href=#attr-time-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-or-time-string-in-content title="date or time string in content">date or time strings in - content</a> successfully extracts a date or time.<p>The <dfn id=dom-time-datetime title=dom-time-datetime><code>dateTime</code></dfn> DOM + attribute, if present, must contain a <a href=#valid-date-or-time-string>valid date or time + string</a> that identifies the date or time being specified.<p>If the <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> attribute + is not present, then the date or time must be specified in the + content of the element, such that the element's + <code><a href=#textcontent>textContent</a></code> is a <a href=#valid-date-or-time-string-in-content>valid date or time string in + content</a>.<p>The <dfn id=dom-time-datetime title=dom-time-datetime><code>dateTime</code></dfn> DOM attribute must <a href=#reflect>reflect</a> the <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> content attribute.<p>User agents, to obtain the <dfn id=concept-time-date title=concept-time-date>date</dfn>, <dfn id=concept-time-time title=concept-time-time>time</dfn>, and <dfn id=concept-time-timezone title=concept-time-timezone>timezone</dfn> represented by a <code><a href=#the-time-element>time</a></code> element, must follow these steps:<ol><li>If the <code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> - attribute is present, then parse it according to the rules for - parsing <a href=#date-or-time-string-in-attributes title="date or time string in attributes">date or - time strings in attributes</a>, and let the result be <var title="">result</var>.</li> + attribute is present, then use the rules to <a href=#parse-a-date-or-time-string>parse a date or + time string</a> with the flag <i>in attribute</i> from the value + of that attribute, and let the result be <var title="">result</var>.</li> - <li>Otherwise, parse the element's <code><a href=#textcontent>textContent</a></code> - according to the rules for parsing <a href=#date-or-time-string-in-attributes title="date or time string - in attributes">date or time strings in content</a>, and let the - result be <var title="">result</var>.</li> + <li>Otherwise, use the rules to <a href=#parse-a-date-or-time-string>parse a date or time + string</a> with the flag <i>in content</i> from the element's + <code><a href=#textcontent>textContent</a></code>, and let the result be <var title="">result</var>.</li> <li>If <var title="">result</var> is empty (because the parsing failed), then the <a href=#concept-time-date title=concept-time-date>date</a> is @@ -10291,10 +10102,10 @@ timezone can only be present if both a date and a time are also present.)</li> - </ol><p>The <dfn id=dom-time-date title=dom-time-date><code>date</code></dfn> DOM 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>The <dfn id=dom-time-time title=dom-time-time><code>time</code></dfn> DOM attribute + </ol><p>The <dfn id=dom-time-date title=dom-time-date><code>date</code></dfn> DOM + 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>The <dfn id=dom-time-time title=dom-time-time><code>time</code></dfn> DOM 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
Received on Tuesday, 25 November 2008 10:44:11 UTC