Bug 197251 - REGRESSION(r244372): [GTK][WPE] fast/images/icon-decoding.html and others are failing
Summary: REGRESSION(r244372): [GTK][WPE] fast/images/icon-decoding.html and others are...
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Miguel Gomez
: 197501 (view as bug list)
Depends on:
Reported: 2019-04-24 15:28 PDT by Alicia Boya García
Modified: 2019-10-22 08:17 PDT (History)
7 users (show)

See Also:

Patch (7.86 KB, patch)
2019-10-22 06:41 PDT, Miguel Gomez
no flags Details | Formatted Diff | Diff
Patch (7.88 KB, patch)
2019-10-22 07:19 PDT, Miguel Gomez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alicia Boya García 2019-04-24 15:28:53 PDT
The following tests are failing on GTK since r244372:r244375


Image failures:

Comment 1 Michael Catanzaro 2019-04-24 16:31:50 PDT
That's going to be "ScalableImageDecoder: don't forcefully decode image data when querying frame completeness, duration" again
Comment 2 Miguel Gomez 2019-10-10 03:24:41 PDT
Several tests are failing on the WPE bot as well, and as Michael comments, the culprit seems to be r244372 "ScalableImageDecoder: don't forcefully decode image data when querying frame completeness, duration"

fast/images/icon-decoding.html [ Failure ]
fast/images/reset-image-animation.html [ Failure ]
fast/images/slower-animation-than-decoding-image.html [ Failure ]
fast/images/slower-decoding-than-animation-image.html [ Failure ]
fast/images/animated-image-loop-count.html [ ImageOnlyFailure ]
fast/images/animated-webp.html [ ImageOnlyFailure ]
Comment 3 Miguel Gomez 2019-10-16 05:27:41 PDT
I've been giving a look to this. There are 3 different issues.

First: fast/images/icon-decoding.html just needs new baseline

Second: https://github.com/WebKit/webkit/blob/1240cfe9a01ee4469fdaaacdf3056c4401b01b24/Source/WebCore/platform/image-decoders/ScalableImageDecoder.cpp#L205

is causing that even non complete frames have a duration of 100ms. We should return 0_s if !frame.isComplete(), and avoid the 11ms change. This fixes these tests:



are a bit trickier. They are testing that when using shape-outside on an animated image, the shape must be generated from the first frame of the animation. I've been debugging the code and I can see how the shape is being generated for each frame of the animation (both before and after the regression), and I think that these were passing before just by chance.
The thing is that just decoding the first frame would be enough for the shape image, but nothing indicates that and the complete animation is decoded. With each decoded frame, RenderBox::imageChanged() ends up being invoked and that causes the shape to be marked as dirty, so the next time we want to use it we'll generate it again from the new frame. I think we should somehow indicate that we don't want to decode the full animation when drawing the first frame (BitmapImage::draw()), but I need to check how the Apple ports deal with this, as it's not failing there.
Comment 4 Miguel Gomez 2019-10-22 01:42:37 PDT
I'm going to split this bug into 2, cause there are 2 issues here, one in ScalableDecoder and another one that seems to be in the multiplatform code handling the shape-outside property.

I leave this bug for the ScalableImageDecoder problem and I've created https://bugs.webkit.org/show_bug.cgi?id=203240 to handle the (possible) multiplatform issue.
Comment 5 Miguel Gomez 2019-10-22 01:50:48 PDT
*** Bug 197501 has been marked as a duplicate of this bug. ***
Comment 6 Miguel Gomez 2019-10-22 06:41:44 PDT
Created attachment 381541 [details]
Comment 7 Adrian Perez 2019-10-22 06:55:06 PDT
Comment on attachment 381541 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=381541&action=review

There is a small typo in the ChangeLog; please fix it before landing.

> Source/WebCore/ChangeLog:10
> +        Covered by existent tests.

Comment 8 Miguel Gomez 2019-10-22 07:19:29 PDT
Created attachment 381543 [details]
Comment 9 WebKit Commit Bot 2019-10-22 08:17:52 PDT
Comment on attachment 381543 [details]

Clearing flags on attachment: 381543

Committed r251431: <https://trac.webkit.org/changeset/251431>
Comment 10 WebKit Commit Bot 2019-10-22 08:17:54 PDT
All reviewed patches have been landed.  Closing bug.