⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 245280 in webkit


Ignore:
Timestamp:
May 14, 2019, 8:13:50 AM (7 years ago)
Author:
commit-queue@webkit.org
Message:

[CG] Adding support for HEIF-sequence ('public.heics') images
https://bugs.webkit.org/show_bug.cgi?id=197384

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-05-14
Reviewed by Simon Fraser.

Source/WebCore:

-- Get the image repetitionCount and the frame duration.
-- Add a new function setAdditionalSupportedImageTypesForTesting() which

takes a delimited String.

-- Add internal APIs to retrive the image frame count and the frame

duration.

Tests: fast/images/animated-heics-draw.html

fast/images/animated-heics-verify.html

  • platform/graphics/ImageSource.h:
  • platform/graphics/cg/ImageDecoderCG.cpp:

(WebCore::animationPropertiesFromProperties):
(WebCore::animationHEICSPropertiesFromProperties):
(WebCore::ImageDecoderCG::repetitionCount const):
(WebCore::ImageDecoderCG::frameDurationAtIndex const):

  • platform/graphics/cg/UTIRegistry.cpp:

(WebCore::setAdditionalSupportedImageTypesForTesting):

  • platform/graphics/cg/UTIRegistry.h:
  • testing/Internals.cpp:

(WebCore::Internals::imageFrameCount):
(WebCore::Internals::imageFrameDurationAtIndex):

  • testing/Internals.h:
  • testing/Internals.idl:
  • testing/js/WebCoreTestSupport.cpp:

(WebCoreTestSupport::setAdditionalSupportedImageTypesForTesting):

  • testing/js/WebCoreTestSupport.h:

Tools:

  • DumpRenderTree/TestOptions.cpp:

(TestOptions::TestOptions):

  • DumpRenderTree/TestOptions.h:
  • DumpRenderTree/mac/DumpRenderTree.mm:

(resetWebViewToConsistentStateBeforeTesting):
Parse the new webkit-test-runner paramter: additionalSupportedImageTypes.
Make DRT call setAdditionalSupportedImageTypesForTesting() before starting
the test.

  • WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:

(WTR::InjectedBundle::stringForKey):
(WTR::InjectedBundle::beginTesting):

  • WebKitTestRunner/InjectedBundle/InjectedBundle.h:
  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::resetStateToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):

  • WebKitTestRunner/TestInvocation.cpp:

(WTR::TestInvocation::createTestSettingsDictionary):

  • WebKitTestRunner/TestOptions.h:

(WTR::TestOptions::hasSameInitializationOptions const):
Parse the new webkit-test-runner paramter: additionalSupportedImageTypes.
Make WTR call setAdditionalSupportedImageTypesForTesting() before starting
the test.

LayoutTests:

Disable the tests for all ports and enable it only for [ Mojave+ WK2]
because of <rdar://problem/42625657>.

  • TestExpectations:
  • fast/images/animated-heics-draw-expected.txt: Added.
  • fast/images/animated-heics-draw.html: Added.
  • fast/images/animated-heics-verify-expected.txt: Added.
  • fast/images/animated-heics-verify.html: Added.
  • fast/images/resources/sea_animation.heics: Added.
  • fast/images/resources/sticker.heics: Added.
  • platform/mac-wk2/TestExpectations:
Location:
trunk
Files:
6 added
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r245277 r245280  
     12019-05-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        [CG] Adding support for HEIF-sequence ('public.heics') images
     4        https://bugs.webkit.org/show_bug.cgi?id=197384
     5
     6        Reviewed by Simon Fraser.
     7
     8        Disable the tests for all ports and enable it only for [ Mojave+ WK2]
     9        because of <rdar://problem/42625657>.
     10
     11        * TestExpectations:
     12        * fast/images/animated-heics-draw-expected.txt: Added.
     13        * fast/images/animated-heics-draw.html: Added.
     14        * fast/images/animated-heics-verify-expected.txt: Added.
     15        * fast/images/animated-heics-verify.html: Added.
     16        * fast/images/resources/sea_animation.heics: Added.
     17        * fast/images/resources/sticker.heics: Added.
     18        * platform/mac-wk2/TestExpectations:
     19
    1202019-05-14  Per Arne Vollan  <pvollan@apple.com>
    221
  • trunk/LayoutTests/TestExpectations

    r245275 r245280  
    13351335fast/images/animated-gif-no-layout.html [ ImageOnlyFailure ]
    13361336fast/images/gif-loop-count.html [ ImageOnlyFailure ]
     1337
     1338# HEIF images are only supported on macOS and iOS post Mojave
     1339fast/images/animated-heics-draw.html [ Skip ]
     1340fast/images/animated-heics-verify.html [ Skip ]
    13371341
    13381342webkit.org/b/146182 editing/selection/leak-document-with-selection-inside.html [ Pass Failure ]
  • trunk/LayoutTests/platform/mac-wk2/TestExpectations

    r245257 r245280  
    8383
    8484fast/animation/request-animation-frame-in-two-pages.html [ Pass ]
     85
     86[ Mojave+ ] fast/images/animated-heics-draw.html [ Pass ]
     87[ Mojave+ ] fast/images/animated-heics-verify.html [ Pass ]
    8588
    8689#//////////////////////////////////////////////////////////////////////////////////////////
  • trunk/Source/WebCore/ChangeLog

    r245279 r245280  
     12019-05-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        [CG] Adding support for HEIF-sequence ('public.heics') images
     4        https://bugs.webkit.org/show_bug.cgi?id=197384
     5
     6        Reviewed by Simon Fraser.
     7
     8        -- Get the image repetitionCount and the frame duration.
     9        -- Add a new function setAdditionalSupportedImageTypesForTesting() which
     10           takes a delimited String.
     11        -- Add internal APIs to retrive the image frame count and the frame
     12           duration.
     13
     14        Tests: fast/images/animated-heics-draw.html
     15               fast/images/animated-heics-verify.html
     16
     17        * platform/graphics/ImageSource.h:
     18        * platform/graphics/cg/ImageDecoderCG.cpp:
     19        (WebCore::animationPropertiesFromProperties):
     20        (WebCore::animationHEICSPropertiesFromProperties):
     21        (WebCore::ImageDecoderCG::repetitionCount const):
     22        (WebCore::ImageDecoderCG::frameDurationAtIndex const):
     23        * platform/graphics/cg/UTIRegistry.cpp:
     24        (WebCore::setAdditionalSupportedImageTypesForTesting):
     25        * platform/graphics/cg/UTIRegistry.h:
     26        * testing/Internals.cpp:
     27        (WebCore::Internals::imageFrameCount):
     28        (WebCore::Internals::imageFrameDurationAtIndex):
     29        * testing/Internals.h:
     30        * testing/Internals.idl:
     31        * testing/js/WebCoreTestSupport.cpp:
     32        (WebCoreTestSupport::setAdditionalSupportedImageTypesForTesting):
     33        * testing/js/WebCoreTestSupport.h:
     34
    1352019-05-14  Manuel Rego Casasnovas  <rego@igalia.com>
    236
  • trunk/Source/WebCore/platform/graphics/ImageSource.h

    r239636 r245280  
    8989    EncodedDataStatus encodedDataStatus();
    9090    bool isSizeAvailable() { return encodedDataStatus() >= EncodedDataStatus::SizeAvailable; }
    91     size_t frameCount();
     91    WEBCORE_EXPORT size_t frameCount();
    9292    RepetitionCount repetitionCount();
    9393    String uti();
     
    113113    IntSize frameSizeAtIndex(size_t, SubsamplingLevel = SubsamplingLevel::Default);
    114114    unsigned frameBytesAtIndex(size_t, SubsamplingLevel = SubsamplingLevel::Default);
    115     Seconds frameDurationAtIndex(size_t);
     115    WEBCORE_EXPORT Seconds frameDurationAtIndex(size_t);
    116116    ImageOrientation frameOrientationAtIndex(size_t);
    117117
  • trunk/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp

    r239427 r245280  
    4343namespace WebCore {
    4444
    45 const CFStringRef WebCoreCGImagePropertyAPNGUnclampedDelayTime = CFSTR("UnclampedDelayTime");
    46 const CFStringRef WebCoreCGImagePropertyAPNGDelayTime = CFSTR("DelayTime");
    47 const CFStringRef WebCoreCGImagePropertyAPNGLoopCount = CFSTR("LoopCount");
    48 
     45const CFStringRef WebCoreCGImagePropertyHEICSDictionary = CFSTR("{HEICS}");
     46const CFStringRef WebCoreCGImagePropertyHEICSFrameInfoArray = CFSTR("FrameInfo");
     47
     48const CFStringRef WebCoreCGImagePropertyUnclampedDelayTime = CFSTR("UnclampedDelayTime");
     49const CFStringRef WebCoreCGImagePropertyDelayTime = CFSTR("DelayTime");
     50const CFStringRef WebCoreCGImagePropertyLoopCount = CFSTR("LoopCount");
     51   
    4952#if PLATFORM(WIN)
    5053const CFStringRef kCGImageSourceShouldPreferRGB32 = CFSTR("kCGImageSourceShouldPreferRGB32");
     
    110113    return appendImageSourceOptions(adoptCF(CFDictionaryCreateMutableCopy(nullptr, 0, options)), subsamplingLevel, sizeForDrawing);
    111114}
    112    
     115
     116static CFDictionaryRef animationPropertiesFromProperties(CFDictionaryRef properties)
     117{
     118    if (!properties)
     119        return nullptr;
     120
     121    if (auto animationProperties = (CFDictionaryRef)CFDictionaryGetValue(properties, kCGImagePropertyGIFDictionary))
     122        return animationProperties;
     123
     124    if (auto animationProperties = (CFDictionaryRef)CFDictionaryGetValue(properties, kCGImagePropertyPNGDictionary))
     125        return animationProperties;
     126
     127    return (CFDictionaryRef)CFDictionaryGetValue(properties, WebCoreCGImagePropertyHEICSDictionary);
     128}
     129
     130static CFDictionaryRef animationHEICSPropertiesFromProperties(CFDictionaryRef properties, size_t index)
     131{
     132    if (!properties)
     133        return nullptr;
     134
     135    // For HEICS images, ImageIO does not create a properties dictionary for each HEICS frame. Instead it maintains
     136    // all frames' information in the image properties dictionary. Here is how ImageIO structures the properties
     137    // dictionary for HEICS image:
     138    //  "{HEICS}" =  {
     139    //      FrameInfo = ( { DelayTime = "0.1"; }, { DelayTime = "0.1"; }, ... );
     140    //      LoopCount = 0;
     141    //      ...
     142    //  };
     143    CFDictionaryRef heicsProperties = (CFDictionaryRef)CFDictionaryGetValue(properties, WebCoreCGImagePropertyHEICSDictionary);
     144    if (!heicsProperties)
     145        return nullptr;
     146
     147    CFArrayRef frameInfoArray = (CFArrayRef)CFDictionaryGetValue(heicsProperties, WebCoreCGImagePropertyHEICSFrameInfoArray);
     148    if (!frameInfoArray)
     149        return nullptr;
     150
     151    return (CFDictionaryRef)CFArrayGetValueAtIndex(frameInfoArray, index);
     152}
     153
    113154static ImageOrientation orientationFromProperties(CFDictionaryRef imageProperties)
    114155{
     
    232273{
    233274    RetainPtr<CFDictionaryRef> properties = adoptCF(CGImageSourceCopyProperties(m_nativeDecoder.get(), imageSourceOptions().get()));
    234     if (!properties)
     275    CFDictionaryRef animationProperties = animationPropertiesFromProperties(properties.get());
     276
     277    // Turns out we're not an animated image after all, so we don't animate.
     278    if (!animationProperties)
     279        return RepetitionCountNone;
     280
     281    CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(animationProperties, WebCoreCGImagePropertyLoopCount);
     282
     283    // No property means loop once.
     284    if (!num)
    235285        return RepetitionCountOnce;
    236    
    237     CFDictionaryRef gifProperties = (CFDictionaryRef)CFDictionaryGetValue(properties.get(), kCGImagePropertyGIFDictionary);
    238     if (gifProperties) {
    239         CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(gifProperties, kCGImagePropertyGIFLoopCount);
    240        
    241         // No property means loop once.
    242         if (!num)
    243             return RepetitionCountOnce;
    244        
    245         RepetitionCount loopCount;
    246         CFNumberGetValue(num, kCFNumberIntType, &loopCount);
    247        
    248         // A property with value 0 means loop forever.
    249         // For loopCount > 0, the specs is not clear about it. But it looks the meaning
    250         // is: play once + loop loopCount which is equivalent to play loopCount + 1.
    251         return loopCount ? loopCount + 1 : RepetitionCountInfinite;
    252     }
    253    
    254     CFDictionaryRef pngProperties = (CFDictionaryRef)CFDictionaryGetValue(properties.get(), kCGImagePropertyPNGDictionary);
    255     if (pngProperties) {
    256         CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(pngProperties, WebCoreCGImagePropertyAPNGLoopCount);
    257         if (!num)
    258             return RepetitionCountOnce;
    259        
    260         RepetitionCount loopCount;
    261         CFNumberGetValue(num, kCFNumberIntType, &loopCount);
    262         return loopCount ? loopCount : RepetitionCountInfinite;
    263     }
    264    
    265     // Turns out we're not an animated image after all, so we don't animate.
    266     return RepetitionCountNone;
     286
     287    RepetitionCount loopCount;
     288    CFNumberGetValue(num, kCFNumberIntType, &loopCount);
     289
     290    // A property with value 0 means loop forever.
     291    // For loopCount > 0, the specs is not clear about it. But it looks the meaning
     292    // is: play once + loop loopCount which is equivalent to play loopCount + 1.
     293    return loopCount ? loopCount + 1 : RepetitionCountInfinite;
    267294}
    268295
     
    331358Seconds ImageDecoderCG::frameDurationAtIndex(size_t index) const
    332359{
     360    RetainPtr<CFDictionaryRef> properties = nullptr;
     361    RetainPtr<CFDictionaryRef> frameProperties = adoptCF(CGImageSourceCopyPropertiesAtIndex(m_nativeDecoder.get(), index, imageSourceOptions().get()));
     362    CFDictionaryRef animationProperties = animationPropertiesFromProperties(frameProperties.get());
     363
     364    if (frameProperties && !animationProperties) {
     365        properties = adoptCF(CGImageSourceCopyProperties(m_nativeDecoder.get(), imageSourceOptions().get()));
     366        animationProperties = animationHEICSPropertiesFromProperties(properties.get(), index);
     367    }
     368
     369    // Use the unclamped frame delay if it exists. Otherwise use the clamped frame delay.
    333370    float value = 0;
    334     RetainPtr<CFDictionaryRef> properties = adoptCF(CGImageSourceCopyPropertiesAtIndex(m_nativeDecoder.get(), index, imageSourceOptions().get()));
    335     if (properties) {
    336         CFDictionaryRef gifProperties = (CFDictionaryRef)CFDictionaryGetValue(properties.get(), kCGImagePropertyGIFDictionary);
    337         if (gifProperties) {
    338             if (CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(gifProperties, kCGImagePropertyGIFUnclampedDelayTime)) {
    339                 // Use the unclamped frame delay if it exists.
    340                 CFNumberGetValue(num, kCFNumberFloatType, &value);
    341             } else if (CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(gifProperties, kCGImagePropertyGIFDelayTime)) {
    342                 // Fall back to the clamped frame delay if the unclamped frame delay does not exist.
    343                 CFNumberGetValue(num, kCFNumberFloatType, &value);
    344             }
    345         }
    346        
    347         CFDictionaryRef pngProperties = (CFDictionaryRef)CFDictionaryGetValue(properties.get(), kCGImagePropertyPNGDictionary);
    348         if (pngProperties) {
    349             if (CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(pngProperties, WebCoreCGImagePropertyAPNGUnclampedDelayTime))
    350                 CFNumberGetValue(num, kCFNumberFloatType, &value);
    351             else if (CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(pngProperties, WebCoreCGImagePropertyAPNGDelayTime))
    352                 CFNumberGetValue(num, kCFNumberFloatType, &value);
    353         }
     371    if (animationProperties) {
     372        if (CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(animationProperties, WebCoreCGImagePropertyUnclampedDelayTime))
     373            CFNumberGetValue(num, kCFNumberFloatType, &value);
     374        else if (CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(animationProperties, WebCoreCGImagePropertyDelayTime))
     375            CFNumberGetValue(num, kCFNumberFloatType, &value);
    354376    }
    355377
  • trunk/Source/WebCore/platform/graphics/cg/UTIRegistry.cpp

    r238015 r245280  
    9090}
    9191
     92void setAdditionalSupportedImageTypesForTesting(const String& imageTypes)
     93{
     94    setAdditionalSupportedImageTypes(imageTypes.split(';'));
     95}
     96
    9297bool isSupportedImageType(const String& imageType)
    9398{
  • trunk/Source/WebCore/platform/graphics/cg/UTIRegistry.h

    r238015 r245280  
    3434HashSet<String>& additionalSupportedImageTypes();
    3535WEBCORE_EXPORT void setAdditionalSupportedImageTypes(const Vector<String>&);
     36WEBCORE_EXPORT void setAdditionalSupportedImageTypesForTesting(const String&);
    3637bool isSupportedImageType(const String&);
    3738
  • trunk/Source/WebCore/testing/Internals.cpp

    r245039 r245280  
    836836}
    837837
     838unsigned Internals::imageFrameCount(HTMLImageElement& element)
     839{
     840    auto* bitmapImage = bitmapImageFromImageElement(element);
     841    return bitmapImage ? bitmapImage->frameCount() : 0;
     842}
     843
     844float Internals::imageFrameDurationAtIndex(HTMLImageElement& element, unsigned index)
     845{
     846    auto* bitmapImage = bitmapImageFromImageElement(element);
     847    return bitmapImage ? bitmapImage->frameDurationAtIndex(index).value() : 0;
     848}
     849   
    838850void Internals::setImageFrameDecodingDuration(HTMLImageElement& element, float duration)
    839851{
  • trunk/Source/WebCore/testing/Internals.h

    r245039 r245280  
    147147
    148148    unsigned imageFrameIndex(HTMLImageElement&);
     149    unsigned imageFrameCount(HTMLImageElement&);
     150    float imageFrameDurationAtIndex(HTMLImageElement&, unsigned index);
    149151    void setImageFrameDecodingDuration(HTMLImageElement&, float duration);
    150152    void resetImageAnimation(HTMLImageElement&);
  • trunk/Source/WebCore/testing/Internals.idl

    r245039 r245280  
    347347
    348348    unsigned long imageFrameIndex(HTMLImageElement element);
     349    unsigned long imageFrameCount(HTMLImageElement element);
     350    float imageFrameDurationAtIndex(HTMLImageElement element, unsigned long index);
    349351    void setImageFrameDecodingDuration(HTMLImageElement element, unrestricted float duration);
    350352    void resetImageAnimation(HTMLImageElement element);
  • trunk/Source/WebCore/testing/js/WebCoreTestSupport.cpp

    r238771 r245280  
    4747#include <wtf/URLParser.h>
    4848
     49#if PLATFORM(COCOA)
     50#include "UTIRegistry.h"
     51#endif
     52
    4953namespace WebCoreTestSupport {
    5054using namespace JSC;
     
    206210}
    207211
    208 }
     212#if PLATFORM(COCOA)
     213void setAdditionalSupportedImageTypesForTesting(const WTF::String& imageTypes)
     214{
     215    WebCore::setAdditionalSupportedImageTypesForTesting(imageTypes);
     216}
     217#endif
     218
     219}
  • trunk/Source/WebCore/testing/js/WebCoreTestSupport.h

    r230097 r245280  
    6363
    6464void setupNewlyCreatedServiceWorker(uint64_t serviceWorkerIdentifier) TEST_SUPPORT_EXPORT;
     65   
     66void setAdditionalSupportedImageTypesForTesting(const WTF::String&) TEST_SUPPORT_EXPORT;
    6567
    6668} // namespace WebCoreTestSupport
  • trunk/Tools/ChangeLog

    r245214 r245280  
     12019-05-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        [CG] Adding support for HEIF-sequence ('public.heics') images
     4        https://bugs.webkit.org/show_bug.cgi?id=197384
     5
     6        Reviewed by Simon Fraser.
     7
     8        * DumpRenderTree/TestOptions.cpp:
     9        (TestOptions::TestOptions):
     10        * DumpRenderTree/TestOptions.h:
     11        * DumpRenderTree/mac/DumpRenderTree.mm:
     12        (resetWebViewToConsistentStateBeforeTesting):
     13        Parse the new webkit-test-runner paramter: additionalSupportedImageTypes.
     14        Make DRT call setAdditionalSupportedImageTypesForTesting() before starting
     15        the test.
     16
     17        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
     18        (WTR::InjectedBundle::stringForKey):
     19        (WTR::InjectedBundle::beginTesting):
     20        * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
     21        * WebKitTestRunner/TestController.cpp:
     22        (WTR::TestController::resetStateToConsistentValues):
     23        (WTR::updateTestOptionsFromTestHeader):
     24        * WebKitTestRunner/TestInvocation.cpp:
     25        (WTR::TestInvocation::createTestSettingsDictionary):
     26        * WebKitTestRunner/TestOptions.h:
     27        (WTR::TestOptions::hasSameInitializationOptions const):
     28        Parse the new webkit-test-runner paramter: additionalSupportedImageTypes.
     29        Make WTR call setAdditionalSupportedImageTypesForTesting() before starting
     30        the test.
     31
    1322019-05-12  Yusuke Suzuki  <ysuzuki@apple.com>
    233
  • trunk/Tools/DumpRenderTree/TestOptions.cpp

    r244869 r245280  
    106106        else if (key == "jscOptions")
    107107            jscOptions = value;
     108        else if (key == "additionalSupportedImageTypes")
     109            additionalSupportedImageTypes = value;
    108110        else if (key == "experimental:WebGPUEnabled")
    109111            enableWebGPU = parseBooleanTestHeaderValue(value);
  • trunk/Tools/DumpRenderTree/TestOptions.h

    r244869 r245280  
    5050    bool enableCoreMathML { false };
    5151    std::string jscOptions;
     52    std::string additionalSupportedImageTypes;
    5253
    5354    TestOptions(const std::string& pathOrURL, const std::string& absolutePath);
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm

    r244955 r245280  
    19191919    setJSCOptions(options);
    19201920
     1921    WebCoreTestSupport::setAdditionalSupportedImageTypesForTesting(options.additionalSupportedImageTypes.c_str());
     1922
    19211923    [mainFrame _clearOpener];
    19221924
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp

    r244723 r245280  
    465465}
    466466
     467String InjectedBundle::stringForKey(WKDictionaryRef dictionary, const char* key)
     468{
     469    WKRetainPtr<WKStringRef> wkKey = adoptWK(WKStringCreateWithUTF8CString(key));
     470    WKStringRef value = static_cast<WKStringRef>(WKDictionaryGetItemForKey(dictionary, wkKey.get()));
     471    if (!value) {
     472        outputText(makeString("String value for key", key, " not found in dictionary\n"));
     473        return emptyString();
     474    }
     475    return toWTFString(value);
     476}
     477
    467478void InjectedBundle::beginTesting(WKDictionaryRef settings, BegingTestingMode testingMode)
    468479{
     
    497508#endif
    498509
     510#if PLATFORM(COCOA)
     511    WebCoreTestSupport::setAdditionalSupportedImageTypesForTesting(stringForKey(settings, "additionalSupportedImageTypes"));
     512#endif
     513
    499514    m_testRunner->setPluginsEnabled(true);
    500515
  • trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h

    r244723 r245280  
    171171
    172172    bool booleanForKey(WKDictionaryRef, const char* key);
     173    String stringForKey(WKDictionaryRef, const char* key);
    173174
    174175    WKBundleRef m_bundle { nullptr };
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r244898 r245280  
    924924    }
    925925
     926#if PLATFORM(COCOA)
     927    WebCoreTestSupport::setAdditionalSupportedImageTypesForTesting(options.additionalSupportedImageTypes.c_str());
     928#endif
     929
    926930    WKPagePostMessageToInjectedBundle(TestController::singleton().mainWebView()->page(), messageName.get(), resetMessageBody.get());
    927931
     
    13701374        else if (key == "jscOptions")
    13711375            testOptions.jscOptions = value;
     1376        else if (key == "additionalSupportedImageTypes")
     1377            testOptions.additionalSupportedImageTypes = value;
    13721378        else if (key == "runSingly")
    13731379            testOptions.runSingly = parseBooleanTestHeaderValue(value);
  • trunk/Tools/WebKitTestRunner/TestInvocation.cpp

    r244898 r245280  
    147147    WKRetainPtr<WKBooleanRef> dumpJSConsoleLogInStdErrValue = adoptWK(WKBooleanCreate(m_dumpJSConsoleLogInStdErr));
    148148    WKDictionarySetItem(beginTestMessageBody.get(), dumpJSConsoleLogInStdErrKey.get(), dumpJSConsoleLogInStdErrValue.get());
    149    
     149
     150    WKRetainPtr<WKStringRef> additionalSupportedImageTypesKey = adoptWK(WKStringCreateWithUTF8CString("additionalSupportedImageTypes"));
     151    WKRetainPtr<WKStringRef> additionalSupportedImageTypesValue = adoptWK(WKStringCreateWithUTF8CString(options().additionalSupportedImageTypes.c_str()));
     152    WKDictionarySetItem(beginTestMessageBody.get(), additionalSupportedImageTypesKey.get(), additionalSupportedImageTypesValue.get());
     153
    150154    return beginTestMessageBody;
    151155}
  • trunk/Tools/WebKitTestRunner/TestOptions.h

    r244134 r245280  
    9999    std::string applicationManifest;
    100100    std::string jscOptions;
     101    std::string additionalSupportedImageTypes;
    101102    HashMap<String, bool> experimentalFeatures;
    102103    HashMap<String, bool> internalDebugFeatures;
     
    133134            || punchOutWhiteBackgroundsInDarkMode != options.punchOutWhiteBackgroundsInDarkMode
    134135            || jscOptions != options.jscOptions
     136            || additionalSupportedImageTypes != options.additionalSupportedImageTypes
    135137            || runSingly != options.runSingly
    136138            || checkForWorldLeaks != options.checkForWorldLeaks
Note: See TracChangeset for help on using the changeset viewer.