mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Mutation Observer API
This commit is contained in:
parent
fa251ec96b
commit
3ca89204ff
15 changed files with 432 additions and 180 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue