aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/element.rs
diff options
context:
space:
mode:
authorFabrice Desré <fabrice@desre.org>2018-04-24 20:39:28 -0700
committerFabrice Desré <fabrice@desre.org>2018-05-02 09:58:37 -0700
commit75434e6fce749c1a5c91517c828ac0e2a0019500 (patch)
tree5d02131675af94cb46d38fef624f291383a0ee21 /components/script/dom/element.rs
parentc5f7c9ccf33fac4bf2c1750e7040b76216fc912c (diff)
downloadservo-75434e6fce749c1a5c91517c828ac0e2a0019500.tar.gz
servo-75434e6fce749c1a5c91517c828ac0e2a0019500.zip
MutationObserver api: Implement takeRecords() and characterData mutations
Diffstat (limited to 'components/script/dom/element.rs')
-rw-r--r--components/script/dom/element.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs
index 11b9168eb41..00a2fee7513 100644
--- a/components/script/dom/element.rs
+++ b/components/script/dom/element.rs
@@ -1163,16 +1163,16 @@ impl Element {
pub fn push_attribute(&self, attr: &Attr) {
let name = attr.local_name().clone();
let namespace = attr.namespace().clone();
- let value = DOMString::from(&**attr.value());
let mutation = Mutation::Attribute {
name: name.clone(),
namespace: namespace.clone(),
- old_value: value.clone(),
+ old_value: None,
};
MutationObserver::queue_a_mutation_record(&self.node, mutation);
if self.get_custom_element_definition().is_some() {
+ let value = DOMString::from(&**attr.value());
let reaction = CallbackReaction::AttributeChanged(name, None, Some(value), namespace);
ScriptThread::enqueue_callback_reaction(self, reaction, None);
}
@@ -1311,7 +1311,7 @@ impl Element {
let mutation = Mutation::Attribute {
name: name.clone(),
namespace: namespace.clone(),
- old_value: old_value.clone(),
+ old_value: Some(old_value.clone()),
};
MutationObserver::queue_a_mutation_record(&self.node, mutation);