layout: Convert animated image delays < 10ms into 100 ms delays (#39189)

Some animated images in the wild have delays <10ms and browsers usually
change them into 100ms as such small timings are unusual.

Relevant code in FF:
https://searchfox.org/firefox-main/source/image/FrameTimeout.h#35

Testing: Manually tested
Fixes: #39187

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
Sam 2025-09-08 16:16:21 +02:00 committed by GitHub
parent 30d3706a2b
commit 228b240635
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 3 deletions

View file

@ -661,7 +661,7 @@ impl ImageAnimationState {
.frames
.get(self.active_frame)
.unwrap()
.delay
.delay()
.unwrap()
.as_secs_f64();
let mut next_active_frame_id = self.active_frame;
@ -671,7 +671,7 @@ impl ImageAnimationState {
.frames
.get(next_active_frame_id)
.unwrap()
.delay
.delay()
.unwrap()
.as_secs_f64();
}