Rename before_remove_attr and after_set_attr to allow reusing those names in the next commit.

This commit is contained in:
Ms2ger 2014-04-09 23:55:45 +02:00
parent d7f450dbd7
commit ea2560ef20

View file

@ -202,9 +202,9 @@ pub trait AttributeHandlers {
fn SetAttributeNS(&mut self, namespace_url: Option<DOMString>, fn SetAttributeNS(&mut self, namespace_url: Option<DOMString>,
name: DOMString, value: DOMString) -> ErrorResult; name: DOMString, value: DOMString) -> ErrorResult;
fn after_set_attr(&mut self, local_name: DOMString, value: DOMString); fn after_set_attr_(&mut self, local_name: DOMString, value: DOMString);
fn remove_attribute(&mut self, namespace: Namespace, name: DOMString) -> ErrorResult; fn remove_attribute(&mut self, namespace: Namespace, name: DOMString) -> ErrorResult;
fn before_remove_attr(&mut self, local_name: DOMString, old_value: DOMString); fn before_remove_attr_(&mut self, local_name: DOMString, old_value: DOMString);
fn notify_attribute_changed(&self, local_name: DOMString); fn notify_attribute_changed(&self, local_name: DOMString);
fn has_class(&self, name: &str) -> bool; fn has_class(&self, name: &str) -> bool;
@ -278,7 +278,7 @@ impl AttributeHandlers for JS<Element> {
Some(idx) => { Some(idx) => {
if namespace == namespace::Null { if namespace == namespace::Null {
let old_value = self.get().attrs[idx].get().Value(); let old_value = self.get().attrs[idx].get().Value();
self.before_remove_attr(local_name.clone(), old_value); self.before_remove_attr_(local_name.clone(), old_value);
} }
self.get_mut().attrs[idx].get_mut().set_value(value.clone()); self.get_mut().attrs[idx].get_mut().set_value(value.clone());
} }
@ -293,7 +293,7 @@ impl AttributeHandlers for JS<Element> {
} }
if namespace == namespace::Null { if namespace == namespace::Null {
self.after_set_attr(local_name, value); self.after_set_attr_(local_name, value);
} }
} }
@ -379,7 +379,7 @@ impl AttributeHandlers for JS<Element> {
Ok(()) Ok(())
} }
fn after_set_attr(&mut self, local_name: DOMString, value: DOMString) { fn after_set_attr_(&mut self, local_name: DOMString, value: DOMString) {
let node: JS<Node> = NodeCast::from(self); let node: JS<Node> = NodeCast::from(self);
match local_name.as_slice() { match local_name.as_slice() {
"style" => { "style" => {
@ -433,7 +433,7 @@ impl AttributeHandlers for JS<Element> {
Some(idx) => { Some(idx) => {
if namespace == namespace::Null { if namespace == namespace::Null {
let removed_raw_value = self.get().attrs[idx].get().Value(); let removed_raw_value = self.get().attrs[idx].get().Value();
self.before_remove_attr(local_name, removed_raw_value); self.before_remove_attr_(local_name, removed_raw_value);
} }
self.get_mut().attrs.remove(idx); self.get_mut().attrs.remove(idx);
@ -443,7 +443,7 @@ impl AttributeHandlers for JS<Element> {
Ok(()) Ok(())
} }
fn before_remove_attr(&mut self, local_name: DOMString, old_value: DOMString) { fn before_remove_attr_(&mut self, local_name: DOMString, old_value: DOMString) {
let node: JS<Node> = NodeCast::from(self); let node: JS<Node> = NodeCast::from(self);
match local_name.as_slice() { match local_name.as_slice() {
"style" => { "style" => {