mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #8245 - eefriedman:misc-attribute-fixes, r=nox
Use attribute getter/setter macros for misc DOM attributes. This fixes a few minor bugs. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8245) <!-- Reviewable:end -->
This commit is contained in:
commit
50d51bab7f
8 changed files with 213 additions and 67 deletions
|
@ -83,15 +83,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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue