diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index d568a21d985..029b8b8aa27 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -2403,9 +2403,10 @@ impl Document { // Update the counter of spurious animation frames. let spurious_frames = self.spurious_animation_frames.get(); - if callbacks_did_not_trigger_reflow && spurious_frames < SPURIOUS_ANIMATION_FRAME_THRESHOLD - { - self.spurious_animation_frames.set(spurious_frames + 1); + if callbacks_did_not_trigger_reflow { + if spurious_frames < SPURIOUS_ANIMATION_FRAME_THRESHOLD { + self.spurious_animation_frames.set(spurious_frames + 1); + } } else { self.spurious_animation_frames.set(0); } diff --git a/tests/wpt/meta/MANIFEST.json b/tests/wpt/meta/MANIFEST.json index bc23e2e5dad..466711e22c8 100644 --- a/tests/wpt/meta/MANIFEST.json +++ b/tests/wpt/meta/MANIFEST.json @@ -729603,7 +729603,7 @@ ] ], "spurious-frame-callbacks-optimization.html": [ - "b4c582cd5edce8f92a2da0b44131a8dbdff60f11", + "82fbe12db546dd52e2e17d55fd5286b55ca2e7fe", [ null, {} diff --git a/tests/wpt/tests/html/webappapis/animation-frames/spurious-frame-callbacks-optimization.html b/tests/wpt/tests/html/webappapis/animation-frames/spurious-frame-callbacks-optimization.html index b4c582cd5ed..82fbe12db54 100644 --- a/tests/wpt/tests/html/webappapis/animation-frames/spurious-frame-callbacks-optimization.html +++ b/tests/wpt/tests/html/webappapis/animation-frames/spurious-frame-callbacks-optimization.html @@ -10,30 +10,30 @@