diff options
Diffstat (limited to 'components/script/dom/htmlbuttonelement.rs')
-rw-r--r-- | components/script/dom/htmlbuttonelement.rs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/components/script/dom/htmlbuttonelement.rs b/components/script/dom/htmlbuttonelement.rs index 5146c7e4888..7d73a2ad64f 100644 --- a/components/script/dom/htmlbuttonelement.rs +++ b/components/script/dom/htmlbuttonelement.rs @@ -81,15 +81,7 @@ impl HTMLButtonElementMethods for HTMLButtonElement { } // https://html.spec.whatwg.org/multipage/#dom-button-type - fn Type(&self) -> DOMString { - let mut ty = self.upcast::<Element>().get_string_attribute(&atom!("type")); - ty.make_ascii_lowercase(); - // https://html.spec.whatwg.org/multipage/#attr-button-type - match &*ty { - "reset" | "button" | "menu" => ty, - _ => "submit".to_owned() - } - } + make_enumerated_getter!(Type, "submit", ("reset") | ("button") | ("menu")); // https://html.spec.whatwg.org/multipage/#dom-button-type make_setter!(SetType, "type"); |