Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script: A couple mutation observer fixes. #21236

Merged
merged 3 commits into from Jul 23, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -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();
}
@@ -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)

This file was deleted.

This file was deleted.

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.