aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2014-10-07 21:15:11 +0530
committerManish Goregaokar <manishsmail@gmail.com>2014-10-07 21:22:03 +0530
commit65e9ab8ece830a34ddcac519c61f242a429430c7 (patch)
treea275bcc8d4d8c5dac24076973d3c1823adf456e1 /components
parent332c94b730e9bdfc2f625828bcf5f97a2f67fbae (diff)
downloadservo-65e9ab8ece830a34ddcac519c61f242a429430c7.tar.gz
servo-65e9ab8ece830a34ddcac519c61f242a429430c7.zip
Use macro setters for <input>
Diffstat (limited to 'components')
-rw-r--r--components/script/dom/htmlinputelement.rs25
1 files changed, 5 insertions, 20 deletions
diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs
index bb8ef6dec27..ee3c15fd85b 100644
--- a/components/script/dom/htmlinputelement.rs
+++ b/components/script/dom/htmlinputelement.rs
@@ -117,46 +117,31 @@ impl<'a> HTMLInputElementMethods for JSRef<'a, HTMLInputElement> {
make_bool_getter!(Disabled)
// http://www.whatwg.org/html/#dom-fe-disabled
- fn SetDisabled(self, disabled: bool) {
- let elem: JSRef<Element> = ElementCast::from_ref(self);
- elem.set_bool_attribute("disabled", disabled)
- }
+ make_bool_setter!(SetDisabled, "disabled")
// https://html.spec.whatwg.org/multipage/forms.html#dom-input-checked
make_bool_getter!(Checked)
// https://html.spec.whatwg.org/multipage/forms.html#dom-input-checked
- fn SetChecked(self, checked: bool) {
- let elem: JSRef<Element> = ElementCast::from_ref(self);
- elem.set_bool_attribute("checked", checked)
- }
+ make_bool_setter!(SetChecked, "checked")
// https://html.spec.whatwg.org/multipage/forms.html#dom-input-size
make_uint_getter!(Size)
// https://html.spec.whatwg.org/multipage/forms.html#dom-input-size
- fn SetSize(self, size: u32) {
- let elem: JSRef<Element> = ElementCast::from_ref(self);
- elem.set_uint_attribute("size", size)
- }
+ make_uint_setter!(SetSize, "size")
// https://html.spec.whatwg.org/multipage/forms.html#dom-input-value
make_getter!(Value)
// https://html.spec.whatwg.org/multipage/forms.html#dom-input-value
- fn SetValue(self, value: DOMString) {
- let elem: JSRef<Element> = ElementCast::from_ref(self);
- elem.set_string_attribute("value", value)
- }
+ make_setter!(SetValue, "value")
// https://html.spec.whatwg.org/multipage/forms.html#attr-fe-name
make_getter!(Name)
// https://html.spec.whatwg.org/multipage/forms.html#attr-fe-name
- fn SetName(self, name: DOMString) {
- let elem: JSRef<Element> = ElementCast::from_ref(self);
- elem.set_string_attribute("name", name)
- }
+ make_setter!(SetName, "name")
}
trait HTMLInputElementHelpers {