diff --git a/components/script/dom/characterdata.rs b/components/script/dom/characterdata.rs index ade189739c3..2d6bfbb706f 100644 --- a/components/script/dom/characterdata.rs +++ b/components/script/dom/characterdata.rs @@ -64,6 +64,7 @@ impl CharacterData { #[inline] pub fn append_data(&self, data: &str) { + self.queue_mutation_record(); self.data.borrow_mut().push_str(data); self.content_changed(); } diff --git a/components/script/dom/mutationobserver.rs b/components/script/dom/mutationobserver.rs index d0dc201f12e..65f8081c900 100644 --- a/components/script/dom/mutationobserver.rs +++ b/components/script/dom/mutationobserver.rs @@ -132,8 +132,8 @@ impl MutationObserver { if *namespace != ns!() { continue; } - if registered.options.attribute_filter.iter() - .find(|s| &**s == &**name).is_some() { + if !registered.options.attribute_filter.iter() + .any(|s| &**s == &**name) { continue; } } @@ -184,7 +184,7 @@ impl MutationObserver { } // Step 4 - for &(ref observer, ref paired_string) in &interested_observers { + for (observer, paired_string) in interested_observers { // Steps 4.1-4.7 let record = match attr_type { Mutation::Attribute { ref name, ref namespace, .. } => { @@ -193,10 +193,10 @@ impl MutationObserver { } else { None }; - MutationRecord::attribute_mutated(target, name, namespace, paired_string.clone()) + MutationRecord::attribute_mutated(target, name, namespace, paired_string) }, Mutation::CharacterData { .. } => { - MutationRecord::character_data_mutated(target, paired_string.clone()) + MutationRecord::character_data_mutated(target, paired_string) } Mutation::ChildList { ref added, ref removed, ref next, ref prev } => { MutationRecord::child_list_mutated(target, *added, *removed, *next, *prev) diff --git a/tests/wpt/metadata/dom/nodes/MutationObserver-attributes.html.ini b/tests/wpt/metadata/dom/nodes/MutationObserver-attributes.html.ini deleted file mode 100644 index 3adb1f43ffa..00000000000 --- a/tests/wpt/metadata/dom/nodes/MutationObserver-attributes.html.ini +++ /dev/null @@ -1,11 +0,0 @@ -[MutationObserver-attributes.html] - type: testharness - [attributes/attributeFilter Element.id/Element.className: update mutation] - expected: FAIL - - [attributes/attributeFilter Element.id/Element.className: multiple filter update mutation] - expected: FAIL - - [attributeFilter alone Element.id/Element.className: multiple filter update mutation] - expected: FAIL - diff --git a/tests/wpt/metadata/dom/nodes/MutationObserver-characterData.html.ini b/tests/wpt/metadata/dom/nodes/MutationObserver-characterData.html.ini deleted file mode 100644 index 9a4b39b2421..00000000000 --- a/tests/wpt/metadata/dom/nodes/MutationObserver-characterData.html.ini +++ /dev/null @@ -1,12 +0,0 @@ -[MutationObserver-characterData.html] - type: testharness - expected: TIMEOUT - [characterData Text.appendData: simple mutation] - expected: TIMEOUT - - [characterData Text.appendData: empty string mutation] - expected: TIMEOUT - - [characterData Text.appendData: null string mutation] - expected: TIMEOUT -