aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/document.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2024-12-09 12:33:58 +0100
committerGitHub <noreply@github.com>2024-12-09 11:33:58 +0000
commita0743f60b36e376884456c3ab7c7e25ce2d2a57f (patch)
tree31d56d37b7b8418acdc5f81ef15260557bfd25d0 /components/script/dom/document.rs
parent38927bbeb6da8e9c764bae35ddbadaa0a06ba629 (diff)
downloadservo-a0743f60b36e376884456c3ab7c7e25ce2d2a57f.tar.gz
servo-a0743f60b36e376884456c3ab7c7e25ce2d2a57f.zip
script: Update the rendering when receiving IPC messages instead of just reflowing (#34486)
This changes fixes two issues: 1. A reflow of all `Document`s currently done unconditionally after receving IPC messages in the `ScriptThread`. Reflowing without first updating the animation timeline can lead to transitions finshing as soon as they start (because it looks like time advancement is measaured between calls to `update-the-rendering`). 2. Fix an issue where not all `Pipeline`s were updated during *update the rendering*. The previous code only took into account top level frames and their children. It's not guaranteed that a particular `ScriptThread` is managing any top level frames, depending on the origens of those frames. We should update the rendering of those non-top-level iframes regardless. The new code attempts to order the frames according to the specification as much as possible without knowing the entire frame tree, without skipping any documents managed by the `ScriptThread` in question. In addition, `Documents` is pulled out the `script_thread.rs` and renamed to `DocumentCollection`. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r--components/script/dom/document.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index 99bbedf9bb1..d216b1364fa 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -2107,6 +2107,7 @@ impl Document {
/// <https://html.spec.whatwg.org/multipage/#run-the-animation-frame-callbacks>
pub(crate) fn run_the_animation_frame_callbacks(&self, can_gc: CanGc) {
+ let _realm = enter_realm(self);
rooted_vec!(let mut animation_frame_list);
mem::swap(
&mut *animation_frame_list,