diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 18426b42ab1..eaf68a380de 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -931,6 +931,10 @@ impl<'a> DocumentHelpers<'a> for &'a Document { for (_, callback) in animation_frame_list { callback(*performance.Now()); } + + window.reflow(ReflowGoal::ForDisplay, + ReflowQueryType::NoQuery, + ReflowReason::RequestAnimationFrame); } fn prepare_async_load(self, load: LoadType) -> PendingAsyncLoad { diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index da23196b434..8256051d9a0 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -92,6 +92,7 @@ pub enum ReflowReason { DOMContentLoaded, DocumentLoaded, ImageLoaded, + RequestAnimationFrame, } #[dom_struct] @@ -1068,6 +1069,7 @@ fn debug_reflow_events(goal: &ReflowGoal, query_type: &ReflowQueryType, reason: ReflowReason::DOMContentLoaded => "\tDOMContentLoaded", ReflowReason::DocumentLoaded => "\tDocumentLoaded", ReflowReason::ImageLoaded => "\tImageLoaded", + ReflowReason::RequestAnimationFrame => "\tRequestAnimationFrame", }); println!("{}", debug_msg);