Changeset 196028 in webkit


Ignore:
Timestamp:
Feb 2, 2016 1:31:36 PM (8 years ago)
Author:
timothy_horton@apple.com
Message:

<attachment> icon should be a folder for the custom MIME type multipart/x-folder
https://bugs.webkit.org/show_bug.cgi?id=153795
<rdar://problem/24416632>

Reviewed by Anders Carlsson.

Source/WebCore:

Test: fast/attachment/attachment-folder-icon.html

  • rendering/RenderThemeMac.mm:

(WebCore::iconForAttachment):
(WebCore::paintAttachmentIcon):
Mail uses this special MIME type to indicate that something is a folder, which there
isn't a normal non-deprecated MIME type for.

LayoutTests:

  • fast/attachment/attachment-folder-icon-expected.html: Added.
  • fast/attachment/attachment-folder-icon.html: Added.

Make sure that the rendering of an attachment with multipart/x-folder
matches that of a file reference pointing at a folder.

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r196027 r196028  
     12016-02-02  Tim Horton  <timothy_horton@apple.com>
     2
     3        <attachment> icon should be a folder for the custom MIME type multipart/x-folder
     4        https://bugs.webkit.org/show_bug.cgi?id=153795
     5        <rdar://problem/24416632>
     6
     7        Reviewed by Anders Carlsson.
     8
     9        * fast/attachment/attachment-folder-icon-expected.html: Added.
     10        * fast/attachment/attachment-folder-icon.html: Added.
     11        Make sure that the rendering of an attachment with multipart/x-folder
     12        matches that of a file reference pointing at a folder.
     13
    1142016-02-02  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
    215
  • trunk/Source/WebCore/ChangeLog

    r196025 r196028  
     12016-02-02  Tim Horton  <timothy_horton@apple.com>
     2
     3        <attachment> icon should be a folder for the custom MIME type multipart/x-folder
     4        https://bugs.webkit.org/show_bug.cgi?id=153795
     5        <rdar://problem/24416632>
     6
     7        Reviewed by Anders Carlsson.
     8
     9        Test: fast/attachment/attachment-folder-icon.html
     10
     11        * rendering/RenderThemeMac.mm:
     12        (WebCore::iconForAttachment):
     13        (WebCore::paintAttachmentIcon):
     14        Mail uses this special MIME type to indicate that something is a folder, which there
     15        isn't a normal non-deprecated MIME type for.
     16
    1172016-02-02  Brady Eidson  <beidson@apple.com>
    218
  • trunk/Source/WebCore/rendering/RenderThemeMac.mm

    r195678 r196028  
    23382338}
    23392339
     2340static RefPtr<Icon> iconForAttachment(const RenderAttachment& attachment)
     2341{
     2342    String MIMEType = attachment.attachmentElement().attachmentType();
     2343    if (!MIMEType.isEmpty()) {
     2344        if (equalIgnoringASCIICase(MIMEType, "multipart/x-folder")) {
     2345            if (auto icon = Icon::createIconForUTI("public.directory"))
     2346                return icon;
     2347        } else if (auto icon = Icon::createIconForMIMEType(MIMEType))
     2348            return icon;
     2349    }
     2350
     2351    if (File* file = attachment.attachmentElement().file()) {
     2352        if (auto icon = Icon::createIconForFiles({ file->path() }))
     2353            return icon;
     2354    }
     2355
     2356    return Icon::createIconForUTI("public.data");
     2357}
     2358
    23402359static void paintAttachmentIcon(const RenderAttachment& attachment, GraphicsContext& context, AttachmentLayout& layout)
    23412360{
    2342     RefPtr<Icon> icon;
    2343     String type = attachment.attachmentElement().attachmentType();
    2344     if (!type.isEmpty())
    2345         icon = Icon::createIconForMIMEType(type);
    2346     else {
    2347         Vector<String> filenames;
    2348         if (File* file = attachment.attachmentElement().file())
    2349             filenames.append(file->path());
    2350         icon = Icon::createIconForFiles(filenames);
    2351     }
    2352 
    2353     if (!icon)
    2354         icon = Icon::createIconForUTI("public.data");
    2355 
     2361    auto icon = iconForAttachment(attachment);
    23562362    if (!icon)
    23572363        return;
Note: See TracChangeset for help on using the changeset viewer.