Trigger reflow after rAF callbacks.

This commit is contained in:
Glenn Watson 2015-06-25 05:40:23 +10:00
parent 3e90a60170
commit 4b3962e6c7
2 changed files with 6 additions and 0 deletions

View file

@ -931,6 +931,10 @@ impl<'a> DocumentHelpers<'a> for &'a Document {
for (_, callback) in animation_frame_list { for (_, callback) in animation_frame_list {
callback(*performance.Now()); callback(*performance.Now());
} }
window.reflow(ReflowGoal::ForDisplay,
ReflowQueryType::NoQuery,
ReflowReason::RequestAnimationFrame);
} }
fn prepare_async_load(self, load: LoadType) -> PendingAsyncLoad { fn prepare_async_load(self, load: LoadType) -> PendingAsyncLoad {

View file

@ -92,6 +92,7 @@ pub enum ReflowReason {
DOMContentLoaded, DOMContentLoaded,
DocumentLoaded, DocumentLoaded,
ImageLoaded, ImageLoaded,
RequestAnimationFrame,
} }
#[dom_struct] #[dom_struct]
@ -1068,6 +1069,7 @@ fn debug_reflow_events(goal: &ReflowGoal, query_type: &ReflowQueryType, reason:
ReflowReason::DOMContentLoaded => "\tDOMContentLoaded", ReflowReason::DOMContentLoaded => "\tDOMContentLoaded",
ReflowReason::DocumentLoaded => "\tDocumentLoaded", ReflowReason::DocumentLoaded => "\tDocumentLoaded",
ReflowReason::ImageLoaded => "\tImageLoaded", ReflowReason::ImageLoaded => "\tImageLoaded",
ReflowReason::RequestAnimationFrame => "\tRequestAnimationFrame",
}); });
println!("{}", debug_msg); println!("{}", debug_msg);