Use macro getters for input elements

This commit is contained in:
Manish Goregaokar 2014-08-28 14:06:56 +05:30
parent 2ce5b46bba
commit 8f47259d6e
7 changed files with 7 additions and 28 deletions

View file

@ -50,10 +50,7 @@ impl<'a> HTMLButtonElementMethods for JSRef<'a, HTMLButtonElement> {
} }
// http://www.whatwg.org/html/#dom-fe-disabled // http://www.whatwg.org/html/#dom-fe-disabled
fn Disabled(&self) -> bool { make_bool_getter!(Disabled)
let elem: &JSRef<Element> = ElementCast::from_ref(self);
elem.has_attribute("disabled")
}
// http://www.whatwg.org/html/#dom-fe-disabled // http://www.whatwg.org/html/#dom-fe-disabled
fn SetDisabled(&self, disabled: bool) { fn SetDisabled(&self, disabled: bool) {

View file

@ -69,10 +69,7 @@ impl<'a> HTMLFieldSetElementMethods for JSRef<'a, HTMLFieldSetElement> {
} }
// http://www.whatwg.org/html/#dom-fieldset-disabled // http://www.whatwg.org/html/#dom-fieldset-disabled
fn Disabled(&self) -> bool { make_bool_getter!(Disabled)
let elem: &JSRef<Element> = ElementCast::from_ref(self);
elem.has_attribute("disabled")
}
// http://www.whatwg.org/html/#dom-fieldset-disabled // http://www.whatwg.org/html/#dom-fieldset-disabled
fn SetDisabled(&self, disabled: bool) { fn SetDisabled(&self, disabled: bool) {

View file

@ -44,10 +44,7 @@ impl HTMLInputElement {
impl<'a> HTMLInputElementMethods for JSRef<'a, HTMLInputElement> { impl<'a> HTMLInputElementMethods for JSRef<'a, HTMLInputElement> {
// http://www.whatwg.org/html/#dom-fe-disabled // http://www.whatwg.org/html/#dom-fe-disabled
fn Disabled(&self) -> bool { make_bool_getter!(Disabled)
let elem: &JSRef<Element> = ElementCast::from_ref(self);
elem.has_attribute("disabled")
}
// http://www.whatwg.org/html/#dom-fe-disabled // http://www.whatwg.org/html/#dom-fe-disabled
fn SetDisabled(&self, disabled: bool) { fn SetDisabled(&self, disabled: bool) {

View file

@ -44,10 +44,7 @@ impl HTMLOptGroupElement {
impl<'a> HTMLOptGroupElementMethods for JSRef<'a, HTMLOptGroupElement> { impl<'a> HTMLOptGroupElementMethods for JSRef<'a, HTMLOptGroupElement> {
// http://www.whatwg.org/html#dom-optgroup-disabled // http://www.whatwg.org/html#dom-optgroup-disabled
fn Disabled(&self) -> bool { make_bool_getter!(Disabled)
let elem: &JSRef<Element> = ElementCast::from_ref(self);
elem.has_attribute("disabled")
}
// http://www.whatwg.org/html#dom-optgroup-disabled // http://www.whatwg.org/html#dom-optgroup-disabled
fn SetDisabled(&self, disabled: bool) { fn SetDisabled(&self, disabled: bool) {

View file

@ -44,10 +44,7 @@ impl HTMLOptionElement {
impl<'a> HTMLOptionElementMethods for JSRef<'a, HTMLOptionElement> { impl<'a> HTMLOptionElementMethods for JSRef<'a, HTMLOptionElement> {
// http://www.whatwg.org/html/#dom-option-disabled // http://www.whatwg.org/html/#dom-option-disabled
fn Disabled(&self) -> bool { make_bool_getter!(Disabled)
let elem: &JSRef<Element> = ElementCast::from_ref(self);
elem.has_attribute("disabled")
}
// http://www.whatwg.org/html/#dom-option-disabled // http://www.whatwg.org/html/#dom-option-disabled
fn SetDisabled(&self, disabled: bool) { fn SetDisabled(&self, disabled: bool) {

View file

@ -56,10 +56,7 @@ impl<'a> HTMLSelectElementMethods for JSRef<'a, HTMLSelectElement> {
} }
// http://www.whatwg.org/html/#dom-fe-disabled // http://www.whatwg.org/html/#dom-fe-disabled
fn Disabled(&self) -> bool { make_bool_getter!(Disabled)
let elem: &JSRef<Element> = ElementCast::from_ref(self);
elem.has_attribute("disabled")
}
// http://www.whatwg.org/html/#dom-fe-disabled // http://www.whatwg.org/html/#dom-fe-disabled
fn SetDisabled(&self, disabled: bool) { fn SetDisabled(&self, disabled: bool) {

View file

@ -44,10 +44,7 @@ impl HTMLTextAreaElement {
impl<'a> HTMLTextAreaElementMethods for JSRef<'a, HTMLTextAreaElement> { impl<'a> HTMLTextAreaElementMethods for JSRef<'a, HTMLTextAreaElement> {
// http://www.whatwg.org/html/#dom-fe-disabled // http://www.whatwg.org/html/#dom-fe-disabled
fn Disabled(&self) -> bool { make_bool_getter!(Disabled)
let elem: &JSRef<Element> = ElementCast::from_ref(self);
elem.has_attribute("disabled")
}
// http://www.whatwg.org/html/#dom-fe-disabled // http://www.whatwg.org/html/#dom-fe-disabled
fn SetDisabled(&self, disabled: bool) { fn SetDisabled(&self, disabled: bool) {