script: do not update Document rendering when waiting on asynchronous canvas image updates (#39022)

This is fixup for #37776. We forget to skip documents with
waiting_on_canvas_image_updates flag.

Testing: Existing WPT tests and manual testing
Fixes: #39021

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
Sam 2025-08-29 17:09:19 +02:00 committed by GitHub
parent 00d0783471
commit b44b461a76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View file

@ -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 <https://drafts.csswg.org/css-font-loading/#fontfaceset-pending-on-the-environment>:
///
/// > A FontFaceSet is pending on the environment if any of the following are true:

View file

@ -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.