mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Implement support for 'enabled' property in HTMLAnchorElement
This commit is contained in:
parent
09583d94b8
commit
ad9220c932
1 changed files with 26 additions and 0 deletions
|
@ -72,6 +72,32 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLAnchorElement> {
|
|||
Some(htmlelement as &VirtualMethods)
|
||||
}
|
||||
|
||||
fn after_set_attr(&self, name: DOMString, value: DOMString) {
|
||||
match self.super_type() {
|
||||
Some(ref s) => s.after_set_attr(name.clone(), value.clone()),
|
||||
_ => (),
|
||||
}
|
||||
|
||||
let node: &JSRef<Node> = NodeCast::from_ref(self);
|
||||
match name.as_slice() {
|
||||
"href" => node.set_enabled_state(true),
|
||||
_ => ()
|
||||
}
|
||||
}
|
||||
|
||||
fn before_remove_attr(&self, name: DOMString, value: DOMString) {
|
||||
match self.super_type() {
|
||||
Some(ref s) => s.before_remove_attr(name.clone(), value.clone()),
|
||||
_ => (),
|
||||
}
|
||||
|
||||
let node: &JSRef<Node> = NodeCast::from_ref(self);
|
||||
match name.as_slice() {
|
||||
"href" => node.set_enabled_state(false),
|
||||
_ => ()
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_event(&self, event: &JSRef<Event>) {
|
||||
match self.super_type() {
|
||||
Some(s) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue