Remove support for <input type=datetime>

It has been removed from the spec: https://github.com/whatwg/html/issues/336

See also https://github.com/servo/servo/pull/19471#pullrequestreview-80711878
This commit is contained in:
Jon Leighton 2017-12-07 12:56:23 +01:00
parent e646471888
commit 5ff4dc078a
3 changed files with 12 additions and 19 deletions

View file

@ -15,7 +15,6 @@ color
controllerchange controllerchange
cursive cursive
date date
datetime
datetime-local datetime-local
dir dir
email email

View file

@ -68,7 +68,6 @@ pub enum InputType {
Checkbox, Checkbox,
Color, Color,
Date, Date,
Datetime,
DatetimeLocal, DatetimeLocal,
Email, Email,
File, File,
@ -95,11 +94,11 @@ impl InputType {
// than the underlying value. // than the underlying value.
fn is_textual(&self) -> bool { fn is_textual(&self) -> bool {
match *self { match *self {
InputType::Color | InputType::Date | InputType::Datetime InputType::Color | InputType::Date | InputType::DatetimeLocal
| InputType::DatetimeLocal | InputType::Email | InputType::Hidden | InputType::Email | InputType::Hidden | InputType::Month
| InputType::Month | InputType::Number | InputType::Range | InputType::Number | InputType::Range | InputType::Search
| InputType::Search | InputType::Tel | InputType::Text | InputType::Tel | InputType::Text | InputType::Time
| InputType::Time | InputType::Url | InputType::Week => { | InputType::Url | InputType::Week => {
true true
} }
@ -117,7 +116,6 @@ impl InputType {
InputType::Checkbox => "checkbox", InputType::Checkbox => "checkbox",
InputType::Color => "color", InputType::Color => "color",
InputType::Date => "date", InputType::Date => "date",
InputType::Datetime => "datetime",
InputType::DatetimeLocal => "datetime-local", InputType::DatetimeLocal => "datetime-local",
InputType::Email => "email", InputType::Email => "email",
InputType::File => "file", InputType::File => "file",
@ -147,7 +145,6 @@ impl<'a> From<&'a Atom> for InputType {
atom!("checkbox") => InputType::Checkbox, atom!("checkbox") => InputType::Checkbox,
atom!("color") => InputType::Color, atom!("color") => InputType::Color,
atom!("date") => InputType::Date, atom!("date") => InputType::Date,
atom!("datetime") => InputType::Datetime,
atom!("datetime-local") => InputType::DatetimeLocal, atom!("datetime-local") => InputType::DatetimeLocal,
atom!("email") => InputType::Email, atom!("email") => InputType::Email,
atom!("file") => InputType::File, atom!("file") => InputType::File,
@ -286,11 +283,11 @@ impl HTMLInputElement {
ValueMode::DefaultOn ValueMode::DefaultOn
}, },
InputType::Color | InputType::Date | InputType::Datetime InputType::Color | InputType::Date | InputType::DatetimeLocal
| InputType::DatetimeLocal | InputType::Email | InputType::Month | InputType::Email | InputType::Month | InputType::Number
| InputType::Number | InputType::Password | InputType::Range | InputType::Password | InputType::Range | InputType::Search
| InputType::Search | InputType::Tel | InputType::Text | InputType::Tel | InputType::Text | InputType::Time
| InputType::Time | InputType::Url | InputType::Week => { | InputType::Url | InputType::Week => {
ValueMode::Value ValueMode::Value
} }
@ -1532,8 +1529,8 @@ impl Activatable for HTMLInputElement {
.filter(|input| { .filter(|input| {
input.form_owner() == owner && match input.input_type() { input.form_owner() == owner && match input.input_type() {
InputType::Text | InputType::Search | InputType::Url | InputType::Tel InputType::Text | InputType::Search | InputType::Url | InputType::Tel
| InputType::Email | InputType::Password | InputType::Datetime | InputType::Email | InputType::Password | InputType::Date
| InputType::Date | InputType::Month | InputType::Week | InputType::Time | InputType::Month | InputType::Week | InputType::Time
| InputType::DatetimeLocal | InputType::Number | InputType::DatetimeLocal | InputType::Number
=> true, => true,
_ => false _ => false

View file

@ -1,8 +1,5 @@
[historical.html] [historical.html]
type: testharness type: testharness
[<input type=datetime> should not be supported]
expected: FAIL
[<input name=isindex> should not be supported] [<input name=isindex> should not be supported]
expected: FAIL expected: FAIL