Bug 216018 - [CG] REGRESSION (Big Sur): A GIF image with a finite loopCount loops an extra cycle
Summary: [CG] REGRESSION (Big Sur): A GIF image with a finite loopCount loops an extra...
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: 2020-08-31 16:41 PDT by Said Abou-Hallawa
Modified: 2020-09-10 08:58 PDT (History)
7 users (show)

See Also:


Attachments
Patch (6.73 KB, patch)
2020-08-31 16:56 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (6.80 KB, patch)
2020-08-31 16:58 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (6.64 KB, patch)
2020-09-01 16:04 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (8.16 KB, patch)
2020-09-10 01:09 PDT, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2020-08-31 16:41:44 PDT
If the loopCount key/value is present in the GIF Netscape Looping Application Extension, this means loopCount = value + 1. WebKit has been doing this math for long time. Recently the underlying frameworks in macOS and iOS took care of this extra one. All we need is to adopt the new behavior but also to be backward compatible with old versions of macOS and iOS.
Comment 1 Said Abou-Hallawa 2020-08-31 16:56:57 PDT
Created attachment 407637 [details]
Patch
Comment 2 Said Abou-Hallawa 2020-08-31 16:58:45 PDT
Created attachment 407638 [details]
Patch
Comment 3 Said Abou-Hallawa 2020-08-31 16:59:21 PDT
<rdar://problem/66660579>
Comment 4 Alexey Proskuryakov 2020-08-31 18:40:35 PDT
Comment on attachment 407638 [details]
Patch

Can this behavior be tested?
Comment 5 Said Abou-Hallawa 2020-08-31 18:47:14 PDT
It is tested by fast/images/animated-gif-loop-count.html.

Having the EWS passed this test, means the backward-compatible code path is tested on macOS Catalina.

I ran this test manually on macOS Big Sur, and it passed as well.
Comment 6 Said Abou-Hallawa 2020-09-01 16:04:38 PDT
Created attachment 407717 [details]
Patch
Comment 7 EWS 2020-09-01 20:13:33 PDT
Committed r266449: <https://trac.webkit.org/changeset/266449>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 407717 [details].
Comment 8 Said Abou-Hallawa 2020-09-02 01:04:58 PDT
Reverted r266449 for reason:

Underlying frameworks do not work correctly for loopCount >= 1.

Committed r266452: <https://trac.webkit.org/changeset/266452>
Comment 9 Said Abou-Hallawa 2020-09-03 15:10:59 PDT
<rdar://problem/68304035>
Comment 10 Said Abou-Hallawa 2020-09-10 01:09:44 PDT
Created attachment 408420 [details]
Patch
Comment 11 EWS 2020-09-10 08:57:58 PDT
Committed r266827: <https://trac.webkit.org/changeset/266827>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 408420 [details].