Changeset 230847 in webkit


Ignore:
Timestamp:
Apr 20, 2018 12:39:52 PM (6 years ago)
Author:
dbates@webkit.org
Message:

Unreviewed, rolling out r230117.

Broke find-in-page for PDFs

Reverted changeset:

"ASSERTION FAILED: ASSERT(!containsImage

MIMETypeRegistry::isSupportedImageResourceMIMEType([resource
MIMEType])) in -[NSPasteboard(WebExtras)
_web_writePromisedRTFDFromArchive:containsImage:]"
https://bugs.webkit.org/show_bug.cgi?id=184161
https://trac.webkit.org/changeset/230117

Location:
trunk
Files:
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r230837 r230847  
     12018-04-20  Daniel Bates  <dabates@apple.com>
     2
     3        Unreviewed, rolling out r230117.
     4
     5        Broke find-in-page for PDFs
     6
     7        Reverted changeset:
     8
     9        "ASSERTION FAILED: ASSERT(!containsImage ||
     10        MIMETypeRegistry::isSupportedImageResourceMIMEType([resource
     11        MIMEType])) in -[NSPasteboard(WebExtras)
     12        _web_writePromisedRTFDFromArchive:containsImage:]"
     13        https://bugs.webkit.org/show_bug.cgi?id=184161
     14        https://trac.webkit.org/changeset/230117
     15
    1162018-04-20  Carlos Garcia Campos  <cgarcia@igalia.com>
    217
  • trunk/Source/WebCore/ChangeLog

    r230846 r230847  
     12018-04-20  Daniel Bates  <dabates@apple.com>
     2
     3        Unreviewed, rolling out r230117.
     4
     5        Broke find-in-page for PDFs
     6
     7        Reverted changeset:
     8
     9        "ASSERTION FAILED: ASSERT(!containsImage ||
     10        MIMETypeRegistry::isSupportedImageResourceMIMEType([resource
     11        MIMEType])) in -[NSPasteboard(WebExtras)
     12        _web_writePromisedRTFDFromArchive:containsImage:]"
     13        https://bugs.webkit.org/show_bug.cgi?id=184161
     14        https://trac.webkit.org/changeset/230117
     15
    1162018-04-20  Eric Carlson  <eric.carlson@apple.com>
    217
  • trunk/Source/WebCore/dom/DOMImplementation.cpp

    r230211 r230847  
    150150
    151151    // If we want to useImageDocumentForSubframePDF, we'll let that override plugin support.
    152     if (frame && !frame->isMainFrame() && MIMETypeRegistry::isPDFMIMEType(type) && frame->settings().useImageDocumentForSubframePDF()) {
    153         ASSERT(Image::supportsType(type));
     152    if (frame && !frame->isMainFrame() && MIMETypeRegistry::isPDFMIMEType(type) && frame->settings().useImageDocumentForSubframePDF())
    154153        return ImageDocument::create(*frame, url);
    155     }
    156154
    157155    PluginData* pluginData = nullptr;
  • trunk/Source/WebCore/platform/MIMETypeRegistry.cpp

    r230117 r230847  
    5656namespace WebCore {
    5757
     58static HashSet<String, ASCIICaseInsensitiveHash>* supportedImageResourceMIMETypes;
    5859static HashSet<String, ASCIICaseInsensitiveHash>* supportedImageMIMETypes;
    5960static HashSet<String, ASCIICaseInsensitiveHash>* supportedImageMIMETypesForEncoding;
     
    6667static void initializeSupportedImageMIMETypes()
    6768{
     69    supportedImageResourceMIMETypes = new HashSet<String, ASCIICaseInsensitiveHash>;
    6870    supportedImageMIMETypes = new HashSet<String, ASCIICaseInsensitiveHash>;
    6971
     
    7173    // This represents the subset of allowed image UTIs for which CoreServices has a corresponding MIME type. Keep this in sync with allowedImageUTIs().
    7274    static const char* const allowedImageMIMETypes[] = { "image/tiff", "image/gif", "image/jpeg", "image/vnd.microsoft.icon", "image/jp2", "image/png", "image/bmp" };
    73     for (auto& mimeType : allowedImageMIMETypes)
     75    for (auto& mimeType : allowedImageMIMETypes) {
    7476        supportedImageMIMETypes->add(ASCIILiteral { mimeType });
     77        supportedImageResourceMIMETypes->add(ASCIILiteral { mimeType });
     78    }
    7579
    7680#ifndef NDEBUG
    7781    for (auto& uti : allowedImageUTIs()) {
    7882        auto mimeType = MIMETypeForImageSourceType(uti);
    79         if (!mimeType.isEmpty())
     83        if (!mimeType.isEmpty()) {
    8084            ASSERT(supportedImageMIMETypes->contains(mimeType));
     85            ASSERT(supportedImageResourceMIMETypes->contains(mimeType));
     86        }
    8187    }
    8288
     
    8995    // Favicons don't have a MIME type in the registry either.
    9096    supportedImageMIMETypes->add("image/x-icon");
     97    supportedImageResourceMIMETypes->add("image/x-icon");
    9198
    9299    //  We only get one MIME type per UTI, hence our need to add these manually
    93100    supportedImageMIMETypes->add("image/pjpeg");
     101    supportedImageResourceMIMETypes->add("image/pjpeg");
    94102
    95103#if PLATFORM(IOS)
     
    115123        "application/bmp", "application/x-bmp", "application/x-win-bitmap",
    116124    };
    117     for (auto& type : malformedMIMETypes)
     125    for (auto& type : malformedMIMETypes) {
    118126        supportedImageMIMETypes->add(type);
     127        supportedImageResourceMIMETypes->add(type);
     128    }
    119129#endif
    120130
     
    131141        "image/x-xbitmap"  // xbm
    132142    };
    133     for (auto& type : types)
     143    for (auto& type : types) {
    134144        supportedImageMIMETypes->add(type);
     145        supportedImageResourceMIMETypes->add(type);
     146    }
    135147
    136148#if USE(WEBP)
    137149    supportedImageMIMETypes->add("image/webp");
     150    supportedImageResourceMIMETypes->add("image/webp");
    138151#endif
    139152
     
    451464bool MIMETypeRegistry::isSupportedImageResourceMIMEType(const String& mimeType)
    452465{
    453     return isSupportedImageMIMEType(mimeType) || isPDFOrPostScriptMIMEType(mimeType);
     466    if (mimeType.isEmpty())
     467        return false;
     468    if (!supportedImageResourceMIMETypes)
     469        initializeSupportedImageMIMETypes();
     470    return supportedImageResourceMIMETypes->contains(getNormalizedMIMEType(mimeType));
    454471}
    455472
     
    640657        initializeSupportedImageMIMETypes();
    641658    return *supportedImageMIMETypes;
     659}
     660
     661const HashSet<String, ASCIICaseInsensitiveHash>& MIMETypeRegistry::getSupportedImageResourceMIMETypes()
     662{
     663    if (!supportedImageResourceMIMETypes)
     664        initializeSupportedImageMIMETypes();
     665    return *supportedImageResourceMIMETypes;
    642666}
    643667
  • trunk/Source/WebCore/platform/MIMETypeRegistry.h

    r230117 r230847  
    110110
    111111    WEBCORE_EXPORT const static HashSet<String, ASCIICaseInsensitiveHash>& getSupportedImageMIMETypes();
     112    const static HashSet<String, ASCIICaseInsensitiveHash>& getSupportedImageResourceMIMETypes();
    112113    WEBCORE_EXPORT const static HashSet<String, ASCIICaseInsensitiveHash>& getSupportedMediaMIMETypes();
    113114    WEBCORE_EXPORT const static HashSet<String, ASCIICaseInsensitiveHash>& getPDFMIMETypes();
Note: See TracChangeset for help on using the changeset viewer.