aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmltablesectionelement.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/htmltablesectionelement.rs')
-rw-r--r--components/script/dom/htmltablesectionelement.rs30
1 files changed, 8 insertions, 22 deletions
diff --git a/components/script/dom/htmltablesectionelement.rs b/components/script/dom/htmltablesectionelement.rs
index 5922ffd4b42..137d25541fa 100644
--- a/components/script/dom/htmltablesectionelement.rs
+++ b/components/script/dom/htmltablesectionelement.rs
@@ -7,7 +7,7 @@ use dom::bindings::codegen::Bindings::HTMLTableSectionElementBinding;
use dom::bindings::codegen::InheritTypes::{HTMLElementCast, HTMLTableSectionElementDerived};
use dom::bindings::js::Root;
use dom::document::Document;
-use dom::element::ElementTypeId;
+use dom::element::{AttributeMutation, ElementTypeId};
use dom::eventtarget::{EventTarget, EventTargetTypeId};
use dom::htmlelement::{HTMLElement, HTMLElementTypeId};
use dom::node::{Node, NodeTypeId};
@@ -61,29 +61,15 @@ impl VirtualMethods for HTMLTableSectionElement {
Some(htmlelement as &VirtualMethods)
}
- fn after_set_attr(&self, attr: &Attr) {
- if let Some(ref s) = self.super_type() {
- s.after_set_attr(attr);
- }
-
- match attr.local_name() {
- &atom!("bgcolor") => {
- self.background_color.set(str::parse_legacy_color(&attr.value()).ok());
- },
- _ => ()
- }
- }
-
- fn before_remove_attr(&self, attr: &Attr) {
- if let Some(ref s) = self.super_type() {
- s.before_remove_attr(attr);
- }
-
+ fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation) {
+ self.super_type().unwrap().attribute_mutated(attr, mutation);
match attr.local_name() {
- &atom!("bgcolor") => {
- self.background_color.set(None);
+ &atom!(bgcolor) => {
+ self.background_color.set(mutation.new_value(attr).and_then(|value| {
+ str::parse_legacy_color(&value).ok()
+ }));
},
- _ => ()
+ _ => {},
}
}
}