improve spec compliance of update the image data

This commit is contained in:
Gregory Terzian 2017-03-31 17:43:45 +08:00
parent f05491166f
commit 71b0c10164
6 changed files with 401 additions and 118 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::htmlimageelement::ImageElementMicrotask;
use dom::htmlmediaelement::MediaElementMicrotask;
use dom::mutationobserver::MutationObserver;
use msg::constellation_msg::PipelineId;
@ -31,6 +32,7 @@ pub struct MicrotaskQueue {
pub enum Microtask {
Promise(EnqueuedPromiseCallback),
MediaElement(MediaElementMicrotask),
ImageElement(ImageElementMicrotask),
NotifyMutationObservers,
}
@ -81,7 +83,10 @@ impl MicrotaskQueue {
},
Microtask::MediaElement(ref task) => {
task.handler();
}
},
Microtask::ImageElement(ref task) => {
task.handler();
},
Microtask::NotifyMutationObservers => {
MutationObserver::notify_mutation_observers();
}