[GTK][EFL] Implement MIMETypeRegistry::getPreferredExtensionForMIMEType
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 11 Feb 2017 14:29:52 +0000 (14:29 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 11 Feb 2017 14:29:52 +0000 (14:29 +0000)
commitf898ff63c7e9ba4611cead2a7b8be032f0b27232
treeeaaea23197c4211ebf535266fd3305f994292f32
parent48cf36428255a12a757cc946cb500d251af63123
[GTK][EFL] Implement MIMETypeRegistry::getPreferredExtensionForMIMEType
https://bugs.webkit.org/show_bug.cgi?id=168163

Reviewed by Michael Catanzaro.

It's missing causing several HTML anchor download tests to fail because the suggested filename missed the
extension. This patch moves MIMETypeRegistry::appendFileExtensionIfNecessary() from the cocoa specific file to the
common file because it's not actually platform specific. MIMETypeRegistry::getPreferredExtensionForMIMEType() is
what platforms should implement.

Fixes: fast/dom/HTMLAnchorElement/anchor-download-user-triggered-synthetic-click.html
       fast/dom/HTMLAnchorElement/anchor-download.html
       fast/dom/HTMLAnchorElement/anchor-file-blob-download-no-extension.html
       fast/dom/HTMLAnchorElement/anchor-nodownload-set.html

* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary):
* platform/cocoa/MIMETypeRegistryCocoa.mm:
(WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary): Deleted.
* platform/efl/MIMETypeRegistryEfl.cpp:
(WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
* platform/gtk/MIMETypeRegistryGtk.cpp:
(WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212192 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/MIMETypeRegistry.cpp
Source/WebCore/platform/cocoa/MIMETypeRegistryCocoa.mm
Source/WebCore/platform/efl/MIMETypeRegistryEfl.cpp
Source/WebCore/platform/gtk/MIMETypeRegistryGtk.cpp