aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmltextareaelement.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/htmltextareaelement.rs')
-rw-r--r--components/script/dom/htmltextareaelement.rs26
1 files changed, 14 insertions, 12 deletions
diff --git a/components/script/dom/htmltextareaelement.rs b/components/script/dom/htmltextareaelement.rs
index 274c2b08ee1..80aad8c136c 100644
--- a/components/script/dom/htmltextareaelement.rs
+++ b/components/script/dom/htmltextareaelement.rs
@@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+use dom::attr::Attr;
+use dom::attr::AttrHelpers;
use dom::bindings::codegen::Bindings::HTMLTextAreaElementBinding;
use dom::bindings::codegen::Bindings::HTMLTextAreaElementBinding::HTMLTextAreaElementMethods;
use dom::bindings::codegen::InheritTypes::{HTMLElementCast, NodeCast};
@@ -62,15 +64,15 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLTextAreaElement> {
Some(htmlelement as &VirtualMethods)
}
- fn after_set_attr(&self, name: &Atom, value: DOMString) {
+ fn after_set_attr(&self, attr: JSRef<Attr>) {
match self.super_type() {
- Some(ref s) => s.after_set_attr(name, value.clone()),
- _ => (),
+ Some(ref s) => s.after_set_attr(attr),
+ _ => ()
}
- let node: JSRef<Node> = NodeCast::from_ref(*self);
- match name.as_slice() {
- "disabled" => {
+ match attr.local_name() {
+ &atom!("disabled") => {
+ let node: JSRef<Node> = NodeCast::from_ref(*self);
node.set_disabled_state(true);
node.set_enabled_state(false);
},
@@ -78,15 +80,15 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLTextAreaElement> {
}
}
- fn before_remove_attr(&self, name: &Atom, value: DOMString) {
+ fn before_remove_attr(&self, attr: JSRef<Attr>) {
match self.super_type() {
- Some(ref s) => s.before_remove_attr(name, value),
- _ => (),
+ Some(ref s) => s.before_remove_attr(attr),
+ _ => ()
}
- let node: JSRef<Node> = NodeCast::from_ref(*self);
- match name.as_slice() {
- "disabled" => {
+ match attr.local_name() {
+ &atom!("disabled") => {
+ let node: JSRef<Node> = NodeCast::from_ref(*self);
node.set_disabled_state(false);
node.set_enabled_state(true);
node.check_ancestors_disabled_state_for_form_control();