<attachment> should attempt to guess the icon from the file extension if all else...
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Feb 2016 00:08:33 +0000 (00:08 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Feb 2016 00:08:33 +0000 (00:08 +0000)
commit3e2a59d50f3869af0573a74b45da095f21068d16
tree41e4ee6edd211a0bb9f0d6f20f1b76e4f0431fdd
parent5d087246fe672d24232f6bc7d4f9cf3d5c7451f5
<attachment> should attempt to guess the icon from the file extension if all else fails
https://bugs.webkit.org/show_bug.cgi?id=153804
<rdar://problem/24448146>

Reviewed by Anders Carlsson.

Source/WebCore:

Test: fast/attachment/attachment-icon-from-file-extension.html

* platform/graphics/Icon.h:
* platform/graphics/mac/IconMac.mm:
(WebCore::Icon::createIconForFileExtension):
* rendering/RenderThemeMac.mm:
(WebCore::iconForAttachment):
If we can't find an icon any other way, try assuming that the title is a filename,
grab its extension, and have NSWorkspace try to work out an icon for it.

LayoutTests:

* fast/attachment/attachment-icon-from-file-extension-expected.html: Added.
* fast/attachment/attachment-icon-from-file-extension.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/attachment/attachment-icon-from-file-extension-expected.html [new file with mode: 0644]
LayoutTests/fast/attachment/attachment-icon-from-file-extension.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/Icon.h
Source/WebCore/platform/graphics/mac/IconMac.mm
Source/WebCore/rendering/RenderThemeMac.mm