- Revision
- 230117
- Author
- [email protected]
- Date
- 2018-03-30 14:01:35 -0700 (Fri, 30 Mar 2018)
Log Message
ASSERTION FAILED: ASSERT(!containsImage || MIMETypeRegistry::isSupportedImageResourceMIMEType([resource MIMEType])) in -[NSPasteboard(WebExtras) _web_writePromisedRTFDFromArchive:containsImage:]
https://bugs.webkit.org/show_bug.cgi?id=184161
Reviewed by Per Arne Vollan.
.:
* ManualTests/DragInlinePDFImageDocument.html: Added.
* ManualTests/resources/simple.pdf: Added.
Source/WebCore:
Fixes an assertion failure when quiting an app that uses a Legacy WebKit web view
after dragging-and-dropping a PDF embedded using an HTML image element into the
same web view.
When performing a drag-and-drop of a PDF document image (WebCore::PDFDocumentImage) we create a WebArchive
from the main frame's WebHTMLView and promise AppKit that will provide a Rich Text Format (RTF) document
from this archive if needed. For some reason, on app termination AppKit requests that the WebHTMLView
fullfill its RTF document promise for the WebArchive created at the start of the drag operation. WebKit
expects that the created WebArchive is either for an inline image (e.g. <img>) or an image document that
has a supported image resource MIME type (by querying MIMETypeRegistry::isSupportedImageResourceMIMEType())
and checks for these cases in this order. PDF/PostScript are not listed in the set of supported image
resource MIME types. So, the first check fails and WebKit assumes that the WebArchive was created from
an image document of a supported image resource MIME type. However, the WebArchive was created from a
WebHTMLView and has MIME type text/html. Therefore the assertion fails. We need to add PDF and PostScript
to the set of supported image resource MIME types so that WebKit does not fall back to the WebHTMLView
code path. Historically, PDF and PostScript were in the set supported image resource MIME types. Over time
the set of MIME types for image resouces (images loaded as a document) became identical to the set of MIME
types for images loaded inline (e.g. <img>) and this set omitted the MIME types for PDF and PostScript.
Additionally it is sufficient to implement MIMETypeRegistry::isSupportedImageResourceMIMEType() in terms
of MIMETypeRegistry::isSupportedImageMIMEType() and MIMETypeRegistry::isPDFOrPostScriptMIMEType() instead
of allocating a dedicated HashSet for the supported image resource MIME types (as we currently do).
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument): Assert that PDF is a supported image MIME type before
instantiating an ImageDocument.
* platform/MIMETypeRegistry.cpp:
(WebCore::initializeSupportedImageMIMETypes): Remove unnecessary allocation of a HashSet for the support
image resource MIME types.
(WebCore::MIMETypeRegistry::isSupportedImageResourceMIMEType): Write in terms of MIMETypeRegistry::isSupportedImageMIMEType()
and MIMETypeRegistry::isPDFOrPostScriptMIMEType().
(WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes): Deleted.
* platform/MIMETypeRegistry.h:
Modified Paths
Added Paths
Diff
Modified: trunk/ChangeLog (230116 => 230117)
--- trunk/ChangeLog 2018-03-30 20:46:58 UTC (rev 230116)
+++ trunk/ChangeLog 2018-03-30 21:01:35 UTC (rev 230117)
@@ -1,3 +1,13 @@
+2018-03-30 Daniel Bates <[email protected]>
+
+ ASSERTION FAILED: ASSERT(!containsImage || MIMETypeRegistry::isSupportedImageResourceMIMEType([resource MIMEType])) in -[NSPasteboard(WebExtras) _web_writePromisedRTFDFromArchive:containsImage:]
+ https://bugs.webkit.org/show_bug.cgi?id=184161
+
+ Reviewed by Per Arne Vollan.
+
+ * ManualTests/DragInlinePDFImageDocument.html: Added.
+ * ManualTests/resources/simple.pdf: Added.
+
2018-03-28 Tim Horton <[email protected]>
Make it possible to disable building the tools with Make
Added: trunk/ManualTests/DragInlinePDFImageDocument.html (0 => 230117)
--- trunk/ManualTests/DragInlinePDFImageDocument.html (rev 0)
+++ trunk/ManualTests/DragInlinePDFImageDocument.html 2018-03-30 21:01:35 UTC (rev 230117)
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This is a test for <a href="" 184161</a>. Perform the following using a debug build of Legacy WebKit:</p>
+<ol>
+ <li>Drag and drop the PDF (the content demarcated with a black border on the page below) within the web view.</li>
+ <li>Quit this app.</li>
+</ol>
+<p>This test PASSED if this app does not crash with an assertion failure.</p>
+<img src="" style="border:1px solid black">
+</body>
+</html>
Added: trunk/ManualTests/resources/simple.pdf (0 => 230117)
--- trunk/ManualTests/resources/simple.pdf (rev 0)
+++ trunk/ManualTests/resources/simple.pdf 2018-03-30 21:01:35 UTC (rev 230117)
@@ -0,0 +1,171 @@
+%PDF-1.3
+%\xC4\xE5\xF2\xE5\xEB\xA7\xF3\xA0\xD0\xC4\xC6
+4 0 obj
+<< /Length 5 0 R /Filter /FlateDecode >>
+stream
+xm\x90\xCD\x820\x84\xEF}\x8A9\xC2A\xD8-<k\xD4\xC4I\xC6)\xFE$\x95`9\xF0\xF8.
+\x89$\xA4\x87\xA63_fgۢD\x8BB#3뜐\xE5o\x873^H\x8F\x81qHwrW\x8CP-\xA05H%\xB4\xE8V8\x92\xB3\xE2\x81-4\xA1\xF2\xD8Z\xB0e+fX\x8F\xF4\xC0 nk\u1(\xC9\xDD!V\x940"\x8C\x8Ab\xFD ӻ\xF1\xA3\xE1&t
+q\xFD\xE8t\xB1\xBA\xB0\xB7\xDFM\x97\xBBQB\xC4\xD8j\xDER\x9ByK\x85\xC6;\xF8F>\xA8s\xBD̲\xCF_p\xF9
+H8
+endstream
+endobj
+5 0 obj
+186
+endobj
+2 0 obj
+<< /Type /Page /Parent 3 0 R /Resources 6 0 R /Contents 4 0 R /MediaBox [0 0 612 792]
+>>
+endobj
+6 0 obj
+<< /ProcSet [ /PDF /Text ] /ColorSpace << /Cs1 7 0 R >> /ExtGState << /Gs2
+9 0 R /Gs1 10 0 R >> /Font << /F1.0 8 0 R >> >>
+endobj
+9 0 obj
+<< /Type /ExtGState /AAPL:AA true >>
+endobj
+10 0 obj
+<< /Type /ExtGState /AAPL:AA false >>
+endobj
+11 0 obj
+<< /Length 12 0 R /N 1 /Alternate /DeviceGray /Filter /FlateDecode >>
+stream
+x\x85ROHQ\xFE\xCD6\x84\x88A\x85x\x88w
+ \x95)\xAC\xAC\xA0\xDAvuY\x95m[\x95Ңgߺ\xA3\xB33ӛ\xD95œ]\xA2<u\xA2ct\xECС\x9B\x97\xA2\xC0\xACK\xD7 \xA9 <u\xE8\xFB\xCD\xEC\xEA(\x84oy;\xDF\xFB\xFD\xFD~\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\xD8"zm\xF9MW\xB2\xEB\x86\xFE\xFA\xF6z\xFB\xDA\xF2mʨ)(ͳDf\x94\xB1[\xA3\xE4\xDDx\xDB\xFDf\x91\x9F8:\xBE罊Z\xC9\xFEIE?\x859Z*\xF2U\xF4VP\xD6\xC4og~\xB6~\?\xA5\xE7\xF5A\xFD< =\xAD\x9Fѯ\xE8\xA3\xBEtI\xCF\xC2sQ\xA3I\xF0\xB0i!\xE2\xA0\x8A\x833\xD4NTc\x8D\xE2)\xF1\xF2\xB4[d\x91\xFD@\xFDf
+endstream
+endobj
+12 0 obj
+704
+endobj
+7 0 obj
+[ /ICCBased 11 0 R ]
+endobj
+3 0 obj
+<< /Type /Pages /MediaBox [0 0 612 792] /Count 1 /Kids [ 2 0 R ] >>
+endobj
+13 0 obj
+<< /Type /Catalog /Pages 3 0 R >>
+endobj
+14 0 obj
+<< /Length 15 0 R /Length1 7488 /Filter /FlateDecode >>
+stream
+x\xCDY{xU\x96?\xB7]\xD5\xDDI\xA7;I\xA7I\xA7\xBB\xA9tw\xDEO \x89\xA4\xDDI $\x82\x90F\xA2\xE9@B\xC2C#\x84\x8Cq6\xB20J@\xD1\xE8\xE7\xF8\xC8 E\x92\xC5(\xF9PtwfęE\xDD\xF15\x9F\xF9؝UWҽ\xA7\xAA\x93H\xF8F?\xFE\xF0\xF3۪>\xF7\x9Es\xCF}\x9C\xFB\xBB\xA7έ\xBAݹaSDC\xD0P\xB7<\xD0\xD1
+ʕԄ\xD9+\xD7:"r\xEC\x98\xFF\xDBʮNGDfS\xE8u\xAD\xAB\xD7Gd\xFEa��\x8Dm\xF5\xBA\xEE\xF1\xF6qgx\xB1\xAD%\xB0*\xA2\x87\xAB\x98\xB6aAD&\xD31Oi[\xDFyWD\x8E\xC2<s\xDD+\xC7\xF5q\xBFAټ>p\xD7\xF8\xF8\xF0>ʎ\xDB\xEB["\xF5\x93J1O\xE9\xB8cc\xE7\xB8\xCC`^Ա\xA1e\xBC>i@\xFB\xDE��\x82\xA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S\xF82\xA5f\x97㓳\xF8_\xA2\xB35#:$e\xA2\x8BI(6\xD1*\x9D\xC6`Ő\x80\xA7\x83i`\xD4ch;M\xD1W,\xEBU\xE7\xEA\xCD\xE3\xBBNc\xF1Yes\x89\x84\x829\x8C\x95\x8E\xEA\xC7.)\x91
+\xE3\x94'\x82\xF3\x9CiԡO\xB9g\x84\x87N\xF4\xF7\xBB\x8Dy\xD1\xC9\xF1\xF6\xB9\x9E-\xCB\xF7\xECa\x97\x87\xDE\xDA;\xE6+\x8A\xD3j\xB7\x9A\xBFg5\xF5\xCA^%\xA6\xE1;\xFD!\x93\x83\xEF.3\xE4\x9Dφ孛FR\xC9[x\x8E\xBCS\xE3\xAE\xE7I|k\x98\xE0\xF8q.7/\xAE \x91\x98\xD4D\xC0I\xFE\xFC\xEBo\xDF=J\xBA? }
+]"\xDDLN\xE8^\xD2͎]{\x8F<\xBA\x9DrEb\xB4\x9CB\xB8\xCF[\xFF\xD1%\xBFE\xE1ޯ\x9C\xCA\xD6)\xE7\xB2Ka\x9E\xA8ʻO,\x92|\xA9\xF0\xBF5\x98_Q1\xAFڗQղ\xAE\xAB\xA5\xB3}e@\xA9\xA1\xA81\x91\xFF\xF3\x91ꐚ\x90:\x90z\x90DzIBA:\xBF\x90\x87I\x9E\xE0=UVl\xBDF\xDFv\x9D\xBE\xFD:Y\xF9\xAF\xF2\x9A\xFAw\\xA7\xDFp\x9D\xBC\xF1:Y\xF9\xAF\xF1\x9A\xF6w\xC9\xFA\xFFĠ\x9Dm
+endstream
+endobj
+15 0 obj
+4523
+endobj
+16 0 obj
+<< /Type /FontDescriptor /Ascent 770 /CapHeight 717 /Descent -230 /Flags 32
+/FontBBox [-951 -481 1445 1122] /FontName /JFFIKE+Helvetica /ItalicAngle 0
+/StemV 0 /AvgWidth -441 /MaxWidth 1500 /XHeight 523 /FontFile2 14 0 R >>
+endobj
+17 0 obj
+[ 278 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 556 0
+0 556 222 0 0 0 833 0 556 0 0 333 500 278 0 0 0 500 ]
+endobj
+8 0 obj
+<< /Type /Font /Subtype /TrueType /BaseFont /JFFIKE+Helvetica /FontDescriptor
+16 0 R /Widths 17 0 R /FirstChar 32 /LastChar 120 /Encoding /MacRomanEncoding
+>>
+endobj
+18 0 obj
+()
+endobj
+19 0 obj
+(Mac OS X 10.6.4 Quartz PDFContext)
+endobj
+20 0 obj
+()
+endobj
+21 0 obj
+()
+endobj
+22 0 obj
+(TextEdit)
+endobj
+23 0 obj
+(D:20100823213557Z00'00')
+endobj
+24 0 obj
+()
+endobj
+25 0 obj
+[ () ]
+endobj
+1 0 obj
+<< /Title 18 0 R /Author 20 0 R /Subject 21 0 R /Producer 19 0 R /Creator
+22 0 R /CreationDate 23 0 R /ModDate 23 0 R /Keywords 24 0 R /AAPL:Keywords
+25 0 R >>
+endobj
+xref
+0 26
+0000000000 65535 f
+0000007132 00000 n
+0000000301 00000 n
+0000001513 00000 n
+0000000022 00000 n
+0000000282 00000 n
+0000000405 00000 n
+0000001477 00000 n
+0000006738 00000 n
+0000000543 00000 n
+0000000595 00000 n
+0000000649 00000 n
+0000001457 00000 n
+0000001596 00000 n
+0000001646 00000 n
+0000006259 00000 n
+0000006280 00000 n
+0000006520 00000 n
+0000006912 00000 n
+0000006931 00000 n
+0000006983 00000 n
+0000007002 00000 n
+0000007021 00000 n
+0000007048 00000 n
+0000007090 00000 n
+0000007109 00000 n
+trailer
+<< /Size 26 /Root 13 0 R /Info 1 0 R /ID [ <c0b58182d026198a50ab002c69c10d0a>
+<c0b58182d026198a50ab002c69c10d0a> ] >>
+startxref
+7307
+%%EOF
Modified: trunk/Source/WebCore/ChangeLog (230116 => 230117)
--- trunk/Source/WebCore/ChangeLog 2018-03-30 20:46:58 UTC (rev 230116)
+++ trunk/Source/WebCore/ChangeLog 2018-03-30 21:01:35 UTC (rev 230117)
@@ -1,3 +1,44 @@
+2018-03-30 Daniel Bates <[email protected]>
+
+ ASSERTION FAILED: ASSERT(!containsImage || MIMETypeRegistry::isSupportedImageResourceMIMEType([resource MIMEType])) in -[NSPasteboard(WebExtras) _web_writePromisedRTFDFromArchive:containsImage:]
+ https://bugs.webkit.org/show_bug.cgi?id=184161
+
+ Reviewed by Per Arne Vollan.
+
+ Fixes an assertion failure when quiting an app that uses a Legacy WebKit web view
+ after dragging-and-dropping a PDF embedded using an HTML image element into the
+ same web view.
+
+ When performing a drag-and-drop of a PDF document image (WebCore::PDFDocumentImage) we create a WebArchive
+ from the main frame's WebHTMLView and promise AppKit that will provide a Rich Text Format (RTF) document
+ from this archive if needed. For some reason, on app termination AppKit requests that the WebHTMLView
+ fullfill its RTF document promise for the WebArchive created at the start of the drag operation. WebKit
+ expects that the created WebArchive is either for an inline image (e.g. <img>) or an image document that
+ has a supported image resource MIME type (by querying MIMETypeRegistry::isSupportedImageResourceMIMEType())
+ and checks for these cases in this order. PDF/PostScript are not listed in the set of supported image
+ resource MIME types. So, the first check fails and WebKit assumes that the WebArchive was created from
+ an image document of a supported image resource MIME type. However, the WebArchive was created from a
+ WebHTMLView and has MIME type text/html. Therefore the assertion fails. We need to add PDF and PostScript
+ to the set of supported image resource MIME types so that WebKit does not fall back to the WebHTMLView
+ code path. Historically, PDF and PostScript were in the set supported image resource MIME types. Over time
+ the set of MIME types for image resouces (images loaded as a document) became identical to the set of MIME
+ types for images loaded inline (e.g. <img>) and this set omitted the MIME types for PDF and PostScript.
+
+ Additionally it is sufficient to implement MIMETypeRegistry::isSupportedImageResourceMIMEType() in terms
+ of MIMETypeRegistry::isSupportedImageMIMEType() and MIMETypeRegistry::isPDFOrPostScriptMIMEType() instead
+ of allocating a dedicated HashSet for the supported image resource MIME types (as we currently do).
+
+ * dom/DOMImplementation.cpp:
+ (WebCore::DOMImplementation::createDocument): Assert that PDF is a supported image MIME type before
+ instantiating an ImageDocument.
+ * platform/MIMETypeRegistry.cpp:
+ (WebCore::initializeSupportedImageMIMETypes): Remove unnecessary allocation of a HashSet for the support
+ image resource MIME types.
+ (WebCore::MIMETypeRegistry::isSupportedImageResourceMIMEType): Write in terms of MIMETypeRegistry::isSupportedImageMIMEType()
+ and MIMETypeRegistry::isPDFOrPostScriptMIMEType().
+ (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes): Deleted.
+ * platform/MIMETypeRegistry.h:
+
2018-03-29 Antoine Quint <[email protected]>
[Web Animations] CSSTransition objects should have fill: backwards to allow seeking prior to start time
Modified: trunk/Source/WebCore/dom/DOMImplementation.cpp (230116 => 230117)
--- trunk/Source/WebCore/dom/DOMImplementation.cpp 2018-03-30 20:46:58 UTC (rev 230116)
+++ trunk/Source/WebCore/dom/DOMImplementation.cpp 2018-03-30 21:01:35 UTC (rev 230117)
@@ -150,8 +150,10 @@
#endif
// If we want to useImageDocumentForSubframePDF, we'll let that override plugin support.
- if (frame && !frame->isMainFrame() && MIMETypeRegistry::isPDFMIMEType(type) && frame->settings().useImageDocumentForSubframePDF())
+ if (frame && !frame->isMainFrame() && MIMETypeRegistry::isPDFMIMEType(type) && frame->settings().useImageDocumentForSubframePDF()) {
+ ASSERT(Image::supportsType(type));
return ImageDocument::create(*frame, url);
+ }
PluginData* pluginData = nullptr;
auto allowedPluginTypes = PluginData::OnlyApplicationPlugins;
Modified: trunk/Source/WebCore/platform/MIMETypeRegistry.cpp (230116 => 230117)
--- trunk/Source/WebCore/platform/MIMETypeRegistry.cpp 2018-03-30 20:46:58 UTC (rev 230116)
+++ trunk/Source/WebCore/platform/MIMETypeRegistry.cpp 2018-03-30 21:01:35 UTC (rev 230117)
@@ -55,7 +55,6 @@
namespace WebCore {
-static HashSet<String, ASCIICaseInsensitiveHash>* supportedImageResourceMIMETypes;
static HashSet<String, ASCIICaseInsensitiveHash>* supportedImageMIMETypes;
static HashSet<String, ASCIICaseInsensitiveHash>* supportedImageMIMETypesForEncoding;
static HashSet<String, ASCIICaseInsensitiveHash>* supportedJavaScriptMIMETypes;
@@ -66,24 +65,19 @@
static void initializeSupportedImageMIMETypes()
{
- supportedImageResourceMIMETypes = new HashSet<String, ASCIICaseInsensitiveHash>;
supportedImageMIMETypes = new HashSet<String, ASCIICaseInsensitiveHash>;
#if USE(CG)
// This represents the subset of allowed image UTIs for which CoreServices has a corresponding MIME type. Keep this in sync with allowedImageUTIs().
static const char* const allowedImageMIMETypes[] = { "image/tiff", "image/gif", "image/jpeg", "image/vnd.microsoft.icon", "image/jp2", "image/png", "image/bmp" };
- for (auto& mimeType : allowedImageMIMETypes) {
+ for (auto& mimeType : allowedImageMIMETypes)
supportedImageMIMETypes->add(ASCIILiteral { mimeType });
- supportedImageResourceMIMETypes->add(ASCIILiteral { mimeType });
- }
#ifndef NDEBUG
for (auto& uti : allowedImageUTIs()) {
auto mimeType = MIMETypeForImageSourceType(uti);
- if (!mimeType.isEmpty()) {
+ if (!mimeType.isEmpty())
ASSERT(supportedImageMIMETypes->contains(mimeType));
- ASSERT(supportedImageResourceMIMETypes->contains(mimeType));
- }
}
#if PLATFORM(COCOA)
@@ -94,11 +88,9 @@
// Favicons don't have a MIME type in the registry either.
supportedImageMIMETypes->add("image/x-icon");
- supportedImageResourceMIMETypes->add("image/x-icon");
// We only get one MIME type per UTI, hence our need to add these manually
supportedImageMIMETypes->add("image/pjpeg");
- supportedImageResourceMIMETypes->add("image/pjpeg");
#if PLATFORM(IOS)
// Add malformed image mimetype for compatibility with Mail and to handle malformed mimetypes from the net
@@ -122,10 +114,8 @@
"image/x-bmp", "image/x-win-bitmap", "image/x-windows-bmp", "image/ms-bmp", "image/x-ms-bmp",
"application/bmp", "application/x-bmp", "application/x-win-bitmap",
};
- for (auto& type : malformedMIMETypes) {
+ for (auto& type : malformedMIMETypes)
supportedImageMIMETypes->add(type);
- supportedImageResourceMIMETypes->add(type);
- }
#endif
#else
@@ -140,14 +130,11 @@
"image/x-icon", // ico
"image/x-xbitmap" // xbm
};
- for (auto& type : types) {
+ for (auto& type : types)
supportedImageMIMETypes->add(type);
- supportedImageResourceMIMETypes->add(type);
- }
#if USE(WEBP)
supportedImageMIMETypes->add("image/webp");
- supportedImageResourceMIMETypes->add("image/webp");
#endif
#endif // USE(CG)
@@ -463,11 +450,7 @@
bool MIMETypeRegistry::isSupportedImageResourceMIMEType(const String& mimeType)
{
- if (mimeType.isEmpty())
- return false;
- if (!supportedImageResourceMIMETypes)
- initializeSupportedImageMIMETypes();
- return supportedImageResourceMIMETypes->contains(getNormalizedMIMEType(mimeType));
+ return isSupportedImageMIMEType(mimeType) || isPDFOrPostScriptMIMEType(mimeType);
}
bool MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(const String& mimeType)
@@ -658,13 +641,6 @@
return *supportedImageMIMETypes;
}
-const HashSet<String, ASCIICaseInsensitiveHash>& MIMETypeRegistry::getSupportedImageResourceMIMETypes()
-{
- if (!supportedImageResourceMIMETypes)
- initializeSupportedImageMIMETypes();
- return *supportedImageResourceMIMETypes;
-}
-
HashSet<String, ASCIICaseInsensitiveHash>& MIMETypeRegistry::getSupportedNonImageMIMETypes()
{
if (!supportedNonImageMIMETypes)
Modified: trunk/Source/WebCore/platform/MIMETypeRegistry.h (230116 => 230117)
--- trunk/Source/WebCore/platform/MIMETypeRegistry.h 2018-03-30 20:46:58 UTC (rev 230116)
+++ trunk/Source/WebCore/platform/MIMETypeRegistry.h 2018-03-30 21:01:35 UTC (rev 230117)
@@ -109,7 +109,6 @@
WEBCORE_EXPORT static HashSet<String, ASCIICaseInsensitiveHash>& getSupportedNonImageMIMETypes();
WEBCORE_EXPORT const static HashSet<String, ASCIICaseInsensitiveHash>& getSupportedImageMIMETypes();
- const static HashSet<String, ASCIICaseInsensitiveHash>& getSupportedImageResourceMIMETypes();
WEBCORE_EXPORT const static HashSet<String, ASCIICaseInsensitiveHash>& getSupportedMediaMIMETypes();
WEBCORE_EXPORT const static HashSet<String, ASCIICaseInsensitiveHash>& getPDFMIMETypes();
WEBCORE_EXPORT const static HashSet<String, ASCIICaseInsensitiveHash>& getUnsupportedTextMIMETypes();