Changeset 256501 in webkit


Ignore:
Timestamp:
Feb 12, 2020 9:53:32 PM (4 years ago)
Author:
commit-queue@webkit.org
Message:

WebP image format is not supported
https://bugs.webkit.org/show_bug.cgi?id=192672

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2020-02-12
Reviewed by Youenn Fablet.

Source/WebCore:

Add the mime type and the UTI of the WebP to the list of the allowed image
formats. WebP should be enabled only on macOS and iOS post Catalina.

Tests: fast/images/animated-webp-as-image.html

fast/images/webp-as-image.html

  • platform/MIMETypeRegistry.cpp:

(WebCore::MIMETypeRegistry::supportedImageMIMETypes):

  • platform/graphics/cg/ImageDecoderCG.cpp:

(WebCore::animationPropertiesFromProperties):

  • platform/graphics/cg/UTIRegistry.cpp:

(WebCore::defaultSupportedImageTypes):

Source/WTF:

Introduce HAVE(WEBP) for macOS and iOS.

  • wtf/PlatformHave.h:

LayoutTests:

Disable the tests for all ports and enable it only for [ Catalina+ ].

  • TestExpectations:
  • fast/images/animated-webp-as-image-expected.html: Added.
  • fast/images/animated-webp-as-image.html: Added.
  • fast/images/resources/animated-red-green-blue-repeat-infinite.webp: Added.
  • fast/images/resources/green-400x400.webp: Added.
  • fast/images/webp-as-image-expected.html: Added.
  • fast/images/webp-as-image.html: Added.
  • platform/mac/TestExpectations:
Location:
trunk
Files:
6 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r256497 r256501  
     12020-02-12  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        WebP image format is not supported
     4        https://bugs.webkit.org/show_bug.cgi?id=192672
     5
     6        Reviewed by Youenn Fablet.
     7
     8        Disable the tests for all ports and enable it only for [ Catalina+ ].
     9
     10        * TestExpectations:
     11        * fast/images/animated-webp-as-image-expected.html: Added.
     12        * fast/images/animated-webp-as-image.html: Added.
     13        * fast/images/resources/animated-red-green-blue-repeat-infinite.webp: Added.
     14        * fast/images/resources/green-400x400.webp: Added.
     15        * fast/images/webp-as-image-expected.html: Added.
     16        * fast/images/webp-as-image.html: Added.
     17        * platform/mac/TestExpectations:
     18
    1192020-02-12  Pavel Feldman  <pavel.feldman@gmail.com>
    220
  • trunk/LayoutTests/TestExpectations

    r256493 r256501  
    17931793fast/images/animated-heics-draw.html [ Skip ]
    17941794fast/images/animated-heics-verify.html [ Skip ]
     1795
     1796# WebP images are only supported on macOS and iOS post Catalina
     1797fast/images/webp-as-image.html [ Skip ]
     1798fast/images/animated-webp-as-image.html [ Skip ]
     1799fast/images/animated-webp.html [ Skip ]
    17951800
    17961801webkit.org/b/146182 editing/selection/leak-document-with-selection-inside.html [ Pass Failure ]
  • trunk/LayoutTests/platform/mac/TestExpectations

    r256493 r256501  
    17911791[ Catalina+ ] fast/images/animated-heics-verify.html [ Pass ]
    17921792
     1793# <rdar://problem/8509491>
     1794[ Catalina+ ] fast/images/webp-as-image.html [ Pass ]
     1795[ Catalina+ ] fast/images/animated-webp-as-image.html [ Pass ]
     1796
     1797# <rdar://problem/59015708>
     1798[ Catalina+ ] fast/images/animated-webp.html [ ImageOnlyFailure ]
     1799
    17931800# <rdar://problem/40172428>
    17941801[ Catalina+ ] fast/text/font-collection.html [ ImageOnlyFailure ]
  • trunk/Source/WTF/ChangeLog

    r256498 r256501  
     12020-02-12  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        WebP image format is not supported
     4        https://bugs.webkit.org/show_bug.cgi?id=192672
     5
     6        Reviewed by Youenn Fablet.
     7
     8        Introduce HAVE(WEBP) for macOS and iOS.
     9
     10        * wtf/PlatformHave.h:
     11
    1122020-02-12  Yusuke Suzuki  <ysuzuki@apple.com>
    213
  • trunk/Source/WTF/wtf/PlatformHave.h

    r256493 r256501  
    589589#define HAVE_GCEXTENDEDGAMEPAD_BUTTONS_THUMBSTICK 1
    590590#endif
     591
     592#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101600) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000)
     593#define HAVE_WEBP 1
     594#endif
  • trunk/Source/WebCore/ChangeLog

    r256499 r256501  
     12020-02-12  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        WebP image format is not supported
     4        https://bugs.webkit.org/show_bug.cgi?id=192672
     5
     6        Reviewed by Youenn Fablet.
     7
     8        Add the mime type and the UTI of the WebP to the list of the allowed image
     9        formats. WebP should be enabled only on macOS and iOS post Catalina.
     10
     11        Tests: fast/images/animated-webp-as-image.html
     12               fast/images/webp-as-image.html
     13
     14        * platform/MIMETypeRegistry.cpp:
     15        (WebCore::MIMETypeRegistry::supportedImageMIMETypes):
     16        * platform/graphics/cg/ImageDecoderCG.cpp:
     17        (WebCore::animationPropertiesFromProperties):
     18        * platform/graphics/cg/UTIRegistry.cpp:
     19        (WebCore::defaultSupportedImageTypes):
     20
    1212020-02-12  Zalan Bujtas  <zalan@apple.com>
    222
  • trunk/Source/WebCore/platform/MIMETypeRegistry.cpp

    r255119 r256501  
    8383        "image/x-icon"_s, // Favicons don't have a MIME type in the registry either.
    8484        "image/pjpeg"_s, //  We only get one MIME type per UTI, hence our need to add these manually
    85 
     85#if HAVE(WEBP)
     86        "image/webp"_s,
     87#endif
    8688#if PLATFORM(IOS_FAMILY)
    8789        // Add malformed image mimetype for compatibility with Mail and to handle malformed mimetypes from the net
  • trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp

    r248657 r256501  
    121121    if (auto animationProperties = (CFDictionaryRef)CFDictionaryGetValue(properties, kCGImagePropertyGIFDictionary))
    122122        return animationProperties;
    123 
     123#if HAVE(WEBP)
     124    if (auto animationProperties = (CFDictionaryRef)CFDictionaryGetValue(properties, kCGImagePropertyWebPDictionary))
     125        return animationProperties;
     126#endif
    124127    if (auto animationProperties = (CFDictionaryRef)CFDictionaryGetValue(properties, kCGImagePropertyPNGDictionary))
    125128        return animationProperties;
  • trunk/Source/WebCore/platform/graphics/cg/UTIRegistry.cpp

    r249938 r256501  
    3636#include <ImageIO/ImageIO.h>
    3737
    38 #if ENABLE(WEB_ARCHIVE) || ENABLE(MHTML)
    39 #include "ArchiveFactory.h"
    40 #endif
    41 
    4238namespace WebCore {
    4339
     
    4642    // CG at least supports the following standard image types:
    4743    static NeverDestroyed<HashSet<String>> defaultSupportedImageTypes = std::initializer_list<String> {
    48         "com.compuserve.gif",
    49         "com.microsoft.bmp",
    50         "com.microsoft.cur",
    51         "com.microsoft.ico",
    52         "public.jpeg",
    53         "public.png",
    54         "public.tiff",
     44        "com.compuserve.gif"_s,
     45        "com.microsoft.bmp"_s,
     46        "com.microsoft.cur"_s,
     47        "com.microsoft.ico"_s,
     48        "public.jpeg"_s,
     49        "public.png"_s,
     50        "public.tiff"_s,
    5551#if !PLATFORM(WIN)
    56         "public.jpeg-2000",
    57         "public.mpo-image",
     52        "public.jpeg-2000"_s,
     53        "public.mpo-image"_s,
     54#endif
     55#if HAVE(WEBP)
     56        "public.webp"_s,
    5857#endif
    5958    };
Note: See TracChangeset for help on using the changeset viewer.