diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index eac3429cc33..5eecfdb03c0 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -2743,6 +2743,10 @@ impl Document { self.waiting_on_canvas_image_updates.set(false); } + pub(crate) fn waiting_on_canvas_image_updates(&self) -> bool { + self.waiting_on_canvas_image_updates.get() + } + /// From : /// /// > A FontFaceSet is pending on the environment if any of the following are true: diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 2ab84a8d621..6972163bc5e 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -1158,6 +1158,10 @@ impl ScriptThread { continue; } + if document.waiting_on_canvas_image_updates() { + continue; + } + // TODO(#31581): The steps in the "Revealing the document" section need to be implemented // `process_pending_input_events` handles the focusing steps as well as other events // from the compositor.