On Wed, 18 Mar 2026 04:37:07 GMT, Jay Bhaskar <[email protected]> wrote:

> **Issue:** Animated GIF images displayed in a WebView show only the first 
> frame and do not animate. This occurs regardless of how the GIF is loaded:
> <img> tag with file:/// URL via WebEngine.loadContent()
> <img> tag with file:/// URL via WebEngine.load() loading an HTML file
> 
> Solution : Animation was not working because the decoder never reported 
> Complete, so WebKit never started the animation engine. Make the status 
> complete once the full frame is received.

modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/java/ImageDecoderJava.cpp
 line 246:

> 244:         m_encodedDataStatus = EncodedDataStatus::Complete;
> 245: 
> 246:     else if (isSizeAvailable())

I would highly recommend enclosing all the statements within `if` in the curly 
braces, and get rid of the newline between `if` and `else`, especially in the 
native code:


    if (m_encodedDataStatus == EncodedDataStatus::Complete)
    {
        return m_encodedDataStatus;
    }

    if (m_isAllDataReceived)
    {
        m_encodedDataStatus = EncodedDataStatus::Complete;
    }
    else if (isSizeAvailable())
    {

tests/manual/web/giftest/giftest.html line 5:

> 3: <img src="test_animation.gif" width="200" height="200">
> 4: </body>
> 5: </html>

missing newline

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/2111#discussion_r2954182299
PR Review Comment: https://git.openjdk.org/jfx/pull/2111#discussion_r2954147031

Reply via email to