Skip to content
This repository has been archived by the owner on Jul 30, 2019. It is now read-only.

Commit

Permalink
Remove datetime type of input (#530)
Browse files Browse the repository at this point in the history
* part 1

* at-risk datetime type removed from CR doc
  • Loading branch information
travisleithead authored and stevefaulkner committed Jul 19, 2016
1 parent d969932 commit c94a30a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 236 deletions.
4 changes: 0 additions & 4 deletions sections/rendering.include
Original file line number Diff line number Diff line change
Expand Up @@ -1523,10 +1523,6 @@ path: includes/cldr.include

<h4 id="the-input-element-as-domain-specific-widgets">The <{input}> element as domain-specific widgets</h4>

When the <i>input-datetime</i> binding applies to an <{input}> element whose
<code>type</code> attribute is in the <a element-state for="input">Date and Time</a> state, the element is expected to render as
an ''inline-block'' box depicting a Date and Time control.

When the <i>input-date</i> binding applies to an <{input}> element whose
<code>type</code> attribute is in the <a element-state for="input">Date</a> state, the element is expected to render as an
''inline-block'' box depicting a Date control.
Expand Down
240 changes: 9 additions & 231 deletions sections/semantics-forms.include
Original file line number Diff line number Diff line change
Expand Up @@ -1536,11 +1536,6 @@ part of the form.</p>
</td><td> <a element-state for="input">Password</a>
</td><td> Text with no line breaks (sensitive information)
</td><td> A text field that obscures data entry
</td></tr><tr>
<td> <dfn attr-value for="input/type"><code>datetime</code></dfn>
</td><td> <a element-state for="input">Date and Time</a>
</td><td> A date and time (year, month, day, hour, minute, second, fraction of a second) with the time zone set to UTC
</td><td> A date and time control
</td></tr><tr>
<td> <dfn attr-value for="input/type"><code>date</code></dfn>
</td><td> <a element-state for="input">Date</a>
Expand All @@ -1561,6 +1556,11 @@ part of the form.</p>
</td><td> <a element-state for="input">Time</a>
</td><td> A time (hour, minute, seconds, fractional seconds) with no time zone
</td><td> A time control
</td></tr><tr>
<td> <dfn attr-value for="input/type"><code>datetime-local</code></dfn>
</td><td> <a element-state for="input">Local Date and Time</a>
</td><td> A local date and time (year, month, day, hour, minute, second, fractional seconds) with no time-zone offset information
</td><td> A local date and time control
</td></tr><tr>
<td> <dfn attr-value for="input/type"><code>number</code></dfn>
</td><td> <a element-state for="input">Number</a>
Expand Down Expand Up @@ -1680,12 +1680,12 @@ part of the form.</p>
<a element-state for="input">Telephone</a>
</th><th> <a element-state for="input">E-mail</a>
</th><th> <a element-state for="input">Password</a>
</th><th> <a element-state for="input">Date and Time</a>,
</th><th>
<a element-state for="input">Date</a>,
<a element-state for="input">Month</a>,
<a element-state for="input">Week</a>,
<a element-state for="input">Time</a>

<a element-state for="input">Time</a>,
<a element-state for="input">Local Date and Time</a>
</th><th> <a element-state for="input">Number</a>
</th><th> <a element-state for="input">Range</a>
</th><th> <a element-state for="input">Color</a>
Expand Down Expand Up @@ -3555,209 +3555,6 @@ ldh-str = &lt; as defined in <a>RFC 1034 section 3.5</a> &gt;

</div>

<h6 id="date-and-time-state-typedatetime"><dfn element-state for="input">Date and Time</dfn> state (<code>type=datetime</code>)</h6>

<div class="note">
<dl>
<dt>Allowed <a href="#aria-role-attribute">ARIA role attribute</a> values:</dt>
<dd>None</dd>
<dt>Allowed <a href="#state-and-property-attributes">ARIA state and property attributes</a>:</dt>
<dd><a>Global aria-* attributes</a></dd>
</dl>
</div>

<div class="impl">

When an <{input}> element's <{input/type}> attribute is in
the <a element-state for="input">Date and Time</a> state, the rules in this section
apply.

</div>

The <{input}> element <a>represents</a> a control for setting the element's
<a for="forms">value</a> to a string representing a specific <a>global date and time</a>. <span class="impl">User agents may display
the date and time in whatever time zone is appropriate for the user.</span>

<div class="impl">

If the element is <i>mutable</i>, the user agent should allow the
user to change the <a>global date and time</a> represented by its
<a for="forms">value</a>, as obtained by <a>parsing a floating date and time</a> from it. User agents must not allow the user to
set the <a for="forms">value</a> to a non-empty string that is not a
<a>valid normalized global date and time string</a>, though user agents may allow
the user to set and view the time in another time zone and silently translate the time to and from
the UTC time zone in the <a for="forms">value</a>. If the user agent provides a
user interface for selecting a <a>global date and time</a>, then
the <a for="forms">value</a> must be set to a <a>valid normalized global date and time string</a> representing the user's selection. User agents should allow the
user to set the <a for="forms">value</a> to the empty string.

<strong>Constraint validation</strong>: While the user interface describes input that the user
agent cannot convert to a <a>valid normalized global date and time string</a>,
the control is <a>suffering from bad input</a>.

</div>

<p class="note">
See [[#date-time-and-number-formats]] for a discussion of
the difference between the input format and submission format for date, time, and number form
controls<span class="impl">, and the <a>implementation notes</a>
regarding localization of form controls</span>.
</p>

The <code>value</code> attribute, if specified and not empty, must
have a value that is a <a>valid global date and time string</a>.

<div class="impl">

<strong>The <a>value sanitization algorithm</a> is as follows</strong>: If the <a for="forms">value</a> of the element is a <a>valid global date and time
string</a>, then adjust the time so that the <a for="forms">value</a>
represents the same point in time but expressed in the UTC time zone as a <a>valid normalized global date and time string</a>, otherwise, set it to the empty string instead.

</div>

The <{input/min}> attribute, if specified, must have a value that is
a <a>valid global date and time string</a>. The <{input/max}>
attribute, if specified, must have a value that is a <a>valid global date and time
string</a>.

The <{input/step}> attribute is expressed in seconds. The <a>step scale factor</a> is 1000 (which
converts the seconds to milliseconds, which is the base unit of comparison for the conversion
algorithms below). The <a>default step</a> is 60 seconds.

<div class="impl">

When the element is <a>suffering from a step mismatch</a>, the user agent may round the
element's <a for="forms">value</a> to the nearest <a>global date and time</a> for which the element would not <a>suffer from a step mismatch</a>.

<strong>The <a>algorithm to convert a string to a
number</a>, given a string <var>input</var>, is as follows</strong>: If <a>parsing a floating date and time</a> from <var>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>1970-01-01T00:00:00.0Z</code>") to the parsed <a>global date and time</a>, ignoring leap seconds.

<strong>The <a>algorithm to convert a number to a
string</a>, given a number <var>input</var>, is as follows</strong>: Return a
<a>valid normalized global date and time string</a> that represents the <a>global date and time</a> that is <var>input</var>
milliseconds after midnight UTC on the morning of 1970-01-01 (the time represented by the value
"<code>1970-01-01T00:00:00.0Z</code>").

<strong>The <a>algorithm to convert a string to a
<code>Date</code> object</a>, given a string <var>input</var>, is as follows</strong>:
If <a>parsing a floating date and time</a> from
<var>input</var> results in an error, then return an error; otherwise, return <a>a new <code>Date</code> object</a> representing the parsed <a>global date and time</a>, expressed in UTC.

<strong>The <a>algorithm to convert a
<code>Date</code> object to a string</a>, given a {{Date}} object <var>input</var>, is as follows</strong>: Return a <a>valid normalized global date and time string</a> that represents the <a>global date and
time</a> that is represented by <var>input</var>.

</div>

<div class="note" id="only-contemporary-times">

The <a element-state for="input">Date and Time</a> state (and other date- and
time-related states described in subsequent sections) is not intended for the entry of values for
which a precise date and time relative to the contemporary calendar cannot be established. For
example, it would be inappropriate for the entry of times like "one millisecond after the big
bang", "the early part of the Jurassic period", or "a winter around 250 BCE".

For the input of dates before the introduction of the Gregorian calendar, authors are
encouraged to not use the <a element-state for="input">Date and Time</a> state (and
the other date- and time-related states described in subsequent sections), as user agents are not
required to support converting dates and times from earlier periods to the Gregorian calendar,
and asking users to do so manually puts an undue burden on users. (This is complicated by the
manner in which the Gregorian calendar was phased in, which occurred at different times in
different countries, ranging from partway through the 16th century all the way to early in the
20th.) Instead, authors are encouraged to provide fine-grained input controls using the
<{select}> element and <{input}> elements with the <a element-state for="input">Number</a> state.

</div>

<div class="bookkeeping">

The following common <{input}> element content
attributes, IDL attributes, and methods <a>apply</a> to the element:
<{input/autocomplete}>,
<{input/list}>,
<{input/max}>,
<{input/min}>,
<{input/readonly}>,
<{input/required}>, and
<{input/step}> content attributes;
{{HTMLInputElement/list}},
{{HTMLInputElement/value}},
{{HTMLInputElement/valueAsDate}}, and
{{HTMLInputElement/valueAsNumber}} IDL attributes;
{{HTMLInputElement/select()}},
{{HTMLInputElement/stepDown()}}, and
{{HTMLInputElement/stepUp()}} methods.

The {{HTMLInputElement/value}} IDL attribute is
in mode <a for="forms">value</a>.

The <code>input</code> and <code>change</code> events <a>apply</a>.

The following content attributes must not be specified and <a>do not
apply</a> to the element:
<{input/accept}>,
<{input/alt}>,
<{input/checked}>,
<{input/dirname}>,
<{input/formaction}>,
<{input/formenctype}>,
<{input/formmethod}>,
<{input/formnovalidate}>,
<{input/formtarget}>,
<{input/height}>,
<{input/inputmode}>,
<{input/maxlength}>,
<{input/minlength}>,
<{input/multiple}>,
<{input/pattern}>,
<{input/placeholder}>,
<{input/size}>,
<{input/src}>, and
<{input/width}>.

The following IDL attributes and methods <a>do not apply</a> to the
element:
{{HTMLInputElement/checked}},
{{HTMLInputElement/files}},
{{HTMLInputElement/selectionStart}},
{{HTMLInputElement/selectionEnd}}, and
{{HTMLInputElement/selectionDirection}} IDL attributes;
{{HTMLInputElement/setRangeText()}}, and
{{HTMLInputElement/setSelectionRange()}} methods.

</div>

<div class="example">
The following fragment shows part of a calendar application. A user can specify a date and
time for a meeting (in the local time zone, probably, though the user agent can allow the user to
change that), and since the submitted data includes the time-zone offset, the application can
ensure that the meeting is shown at the correct time regardless of the time zones used by all the
participants.

<pre highlight="html">
&lt;fieldset&gt;
&lt;legend&gt;Add Meeting&lt;/legend&gt;
&lt;p&gt;&lt;label&gt;Meeting name: &lt;input type=text name="meeting.label"&gt;&lt;/label&gt;
&lt;p&gt;&lt;label&gt;Meeting time: &lt;input type=datetime name="meeting.start"&gt;&lt;/label&gt;
&lt;/fieldset&gt;
</pre>

Had the application used the <code>date</code> and/or
<code>time</code> types instead, the calendar application would
have also had to explicitly determine which time zone the user intended.

For events where the precise time is to vary as the user travels (e.g., "celebrate the new
year!"), and for recurring events that are to stay at the same time for a specific geographic
location even though that location may go in and out of daylight savings time (e.g., "bring the
kid to school"), the <code>date</code> and/or
<code>time</code> types combined with a <{select}> element
(or other similar control) to pick the specific geographic location to which to anchor the time
would be more appropriate.

</div>

<h6 id="date-state-typedate"><dfn element-state for="input">Date</dfn> state (<code>type=date</code>)</h6>

<div class="note">
Expand Down Expand Up @@ -3855,11 +3652,6 @@ ldh-str = &lt; as defined in <a>RFC 1034 section 3.5</a> &gt;

</div>

<p class="note">
See <a href="#only-contemporary-times">the note on historical dates</a> in the
<a element-state for="input">Date and Time</a> state section.
</p>

<div class="bookkeeping">

The following common <{input}> element content
Expand Down Expand Up @@ -4375,10 +4167,7 @@ ldh-str = &lt; as defined in <a>RFC 1034 section 3.5</a> &gt;

<div class="impl">

If the element is <i>mutable</i>, the user agent should allow the
user to change the <a element-state for="input">date and time</a> represented by its
<a for="forms">value</a>, as obtained by <a>parsing a date and time</a> from it. User agents must not allow the user to set
the <a for="forms">value</a> to a non-empty string that is not a <a>valid normalized global date and time string</a>. If the user agent provides a user interface for
If the element is <i>mutable</i> and the user agent provides a user interface for
selecting a <a element-state for="input">local date and time</a>, then the <a for="forms">value</a> must be set to a <a>valid normalized global date and time string</a> representing the user's selection. User agents should allow the user to set the
<a for="forms">value</a> to the empty string.

Expand Down Expand Up @@ -4431,11 +4220,6 @@ ldh-str = &lt; as defined in <a>RFC 1034 section 3.5</a> &gt;

</div>

<p class="note">
See <a href="#only-contemporary-times">the note on historical dates</a> in the
<a element-state for="input">Date and Time</a> state section.
</p>

<div class="bookkeeping">

The following common <{input}> element content
Expand Down Expand Up @@ -4515,10 +4299,6 @@ ldh-str = &lt; as defined in <a>RFC 1034 section 3.5</a> &gt;
&lt;/datalist&gt;
</pre>

If the application instead used the <code>datetime</code>
type, then the user would have to work out the time-zone conversions themself, which is clearly
not a good user experience!

</div>

<h6 id="number-state-typenumber"><dfn element-state for="input">Number</dfn> state (<code>type=number</code>)</h6>
Expand Down Expand Up @@ -6617,7 +6397,6 @@ You cannot submit this form when the field is incorrect.</samp></pre>
zero, then the <a>allowed value step</a> is the <a>default step</a> multiplied by the
<a>step scale factor</a>.
5. If the element's <{input/type}> attribute is in the
<a element-state for="input">Date and Time</a>,
<a element-state for="input">Date</a>,
<a element-state for="input">Month</a>,
<a element-state for="input">Week</a>, or
Expand Down Expand Up @@ -13337,7 +13116,6 @@ fur
<a element-state for="input">Telephone</a>,
<a element-state for="input">E-mail</a>,
<a element-state for="input">Password</a>,
<a element-state for="input">Date and Time</a>,
<a element-state for="input">Date</a>,
<a element-state for="input">Month</a>,
<a element-state for="input">Week</a>,
Expand Down
1 change: 0 additions & 1 deletion single-page.bs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Abstract: This specification defines the 5th major version, first minor revision
agents in an effort to improve interoperability.
At Risk: The use of text tracks exposing in-band metadata
At Risk: <{label}> as a reassociatable element
At Risk: <code>datetime</code> value of the <{input/type}> attribute
At Risk: <{input/inputmode}> attribute
At Risk: autofill mechanism
At Risk: <{menu}> element, and each enumerated value of the <{menu/type}> attribute
Expand Down

0 comments on commit c94a30a

Please sign in to comment.