Bug 202785 - image/apng not recognized in source tag
Summary: image/apng not recognized in source tag
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Carlos Alberto Lopez Perez
URL:
Keywords: InRadar
Depends on: 202783
Blocks:
  Show dependency treegraph
 
Reported: 2019-10-10 02:42 PDT by Carlos Alberto Lopez Perez
Modified: 2019-10-16 02:02 PDT (History)
2 users (show)

See Also:


Attachments
Patch (1.82 KB, patch)
2019-10-10 02:49 PDT, Carlos Alberto Lopez Perez
no flags Details | Formatted Diff | Diff
Patch (3.33 KB, patch)
2019-10-15 15:42 PDT, Carlos Alberto Lopez Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Alberto Lopez Perez 2019-10-10 02:42:10 PDT
The test imported/w3c/web-platform-tests/apng/supported-in-source-type.html fails on all platform.

WPT test: https://w3c-test.org/apng/supported-in-source-type.html

The failure is caused because the mime-type image/apng is not recognized for the <source> attribute, even when apng files are supported.
Comment 1 Carlos Alberto Lopez Perez 2019-10-10 02:49:56 PDT
Created attachment 380618 [details]
Patch

Patch fixing imported/w3c/web-platform-tests/apng/supported-in-source-type.html which needs to be imported first on bug 202783
Comment 2 Dean Jackson 2019-10-14 14:19:08 PDT
Comment on attachment 380618 [details]
Patch

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

> Source/WebCore/platform/MIMETypeRegistry.cpp:78
> +        "image/apng"_s,

This is a duplicate of the one below. Why both? And why is one guarded?
Comment 3 Dean Jackson 2019-10-14 14:22:07 PDT
Comment on attachment 380618 [details]
Patch

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

> Source/WebCore/platform/MIMETypeRegistry.cpp:141
> +#if ENABLE(APNG)
> +        "image/apng"_s,
> +#endif

Just leave this one and it's an r+.
Comment 4 Dean Jackson 2019-10-14 15:06:12 PDT
Comment on attachment 380618 [details]
Patch

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

>> Source/WebCore/platform/MIMETypeRegistry.cpp:78
>> +        "image/apng"_s,
> 
> This is a duplicate of the one below. Why both? And why is one guarded?

Unless I'm mistaken, this is inside USE(CG) and the one below is in PLATFORM(IOS_FAMILY). But the USE(CG) isn't closed, so it becomes a duplicate. I now think this is the one we should keep, but add the APNG guard.
Comment 5 Dean Jackson 2019-10-14 15:18:27 PDT
Comment on attachment 380618 [details]
Patch

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

>> Source/WebCore/platform/MIMETypeRegistry.cpp:141
>> +#endif
> 
> Just leave this one and it's an r+.

Oh gosh. Ignore me. This is outside USE(CG) - I just didn't read the patch properly.
Comment 6 Carlos Alberto Lopez Perez 2019-10-14 15:38:24 PDT
Comment on attachment 380618 [details]
Patch

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

>>> Source/WebCore/platform/MIMETypeRegistry.cpp:141
>>> +#endif
>> 
>> Just leave this one and it's an r+.
> 
> Oh gosh. Ignore me. This is outside USE(CG) - I just didn't read the patch properly.

Right. There are two main code-paths: USE(CG) that affects Mac/iOS and everything else.
ENABLE(APNG) Only makes sense for everything else, because AFAIK on Mac/iOS the support for it depends on CoreGraphics (which I believe it supports it).
It happens more or less like with the suport for JPEG2000. For GTK/WPE we have a build-time guard USE(OPENJPEG), but for Mac/iOS that guard isn't used.

BTW, if you can review also bug 202783 that would be very nice, that way I can land this after first landing the test that this is supposed to fix.
Thanks!
Comment 7 Carlos Alberto Lopez Perez 2019-10-15 15:42:28 PDT
Created attachment 381033 [details]
Patch

Patch for landing: Test EWS first
Comment 8 Carlos Alberto Lopez Perez 2019-10-16 02:01:03 PDT
Committed r251182: <https://trac.webkit.org/changeset/251182>
Comment 9 Radar WebKit Bug Importer 2019-10-16 02:02:19 PDT
<rdar://problem/56324500>