Mutation Observer API

This commit is contained in:
Sumit 2017-05-14 01:44:14 -04:00 committed by Josh Matthews
parent fa251ec96b
commit 3ca89204ff
15 changed files with 432 additions and 180 deletions

View file

@ -11,6 +11,7 @@ use dom::bindings::cell::DOMRefCell;
use dom::bindings::codegen::Bindings::PromiseBinding::PromiseJobCallback;
use dom::bindings::js::Root;
use dom::globalscope::GlobalScope;
use dom::mutationobserver::MutationObserver;
use msg::constellation_msg::PipelineId;
use std::cell::Cell;
use std::mem;
@ -28,6 +29,7 @@ pub struct MicrotaskQueue {
#[derive(JSTraceable, HeapSizeOf)]
pub enum Microtask {
Promise(EnqueuedPromiseCallback),
NotifyMutationObservers,
}
/// A promise callback scheduled to run during the next microtask checkpoint (#4283).
@ -71,6 +73,9 @@ impl MicrotaskQueue {
let _ = job.callback.Call_(&*target, ExceptionHandling::Report);
}
}
Microtask::NotifyMutationObservers => {
MutationObserver::notify_mutation_observers();
}
}
}
}