Bug 274671 - REGRESSION(276827@main): A large animated image will flicker if it's displayed multiple times with different sizes
Summary: REGRESSION(276827@main): A large animated image will flicker if it's displaye...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2024-05-24 11:44 PDT by Said Abou-Hallawa
Modified: 2024-05-29 17:59 PDT (History)
2 users (show)

See Also:


Attachments
large animated image (5.38 KB, image/gif)
2024-05-24 11:44 PDT, Said Abou-Hallawa
no flags Details
test case (205 bytes, text/html)
2024-05-24 11:45 PDT, Said Abou-Hallawa
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2024-05-24 11:44:37 PDT
Created attachment 471504 [details]
large animated image

Open the attached test case.

Result: The image will flicker for a few times after the page is loaded. The same flicker will happen if the page is reloaded.

NOTE: This only happens if the image is displayed with multiple sizes: small size followed by a larger size. The smaller size is decoded first, so it is not displayed for the larger size and it is requested for decoding. This is the cause of the flicker.

Before 276827@main, BitmapImage::draw() had this logic for animated images:

if (frameIsCompatible)
    image = nativeImageAtIndex(m_currentFrame);
else if (frameIsBeingDecoded) {
    // Draw a yellow rectangle if layer border is enabled
    ...
    return ImageDrawResult::DidRequestDecoding;
} else {
    // Decode the image frame synchronously. 
    image = nativeImageAtIndexCacheIfNeeded(m_currentFrame, m_currentSubsamplingLevel,
}

In 276827@main, the last block was deleted. We need to restore this behavior back.
Comment 1 Said Abou-Hallawa 2024-05-24 11:45:47 PDT
Created attachment 471505 [details]
test case
Comment 2 Said Abou-Hallawa 2024-05-24 11:46:21 PDT
rdar://128557319
Comment 3 Said Abou-Hallawa 2024-05-24 11:59:05 PDT
Pull request: https://github.com/WebKit/WebKit/pull/29074
Comment 4 EWS 2024-05-29 17:59:42 PDT
Committed 279483@main (bd4296e26d45): <https://commits.webkit.org/279483@main>

Reviewed commits have been landed. Closing PR #29074 and removing active labels.