Changeset 198179 in webkit


Ignore:
Timestamp:
Mar 14, 2016, 5:47:11 PM (9 years ago)
Author:
enrica@apple.com
Message:

iOS: RTFD format is not available in the pasteboard after copy/cut.
https://bugs.webkit.org/show_bug.cgi?id=155477
rdar://problem/23500600

Reviewed by Tim Horton.

WebKit is using UTTypeRTFD instead of UTTypeFlatRTFD that is the
proper RTFD format for pastedboard. I also discovered that, when
we create the NSTextAttachment in the NSAttributedString we produce
from the DOM range, we are not generating a file name with the
appropriate extension for the MIME type. The iOS specific implementation
of the MIMETypeRegistry functions were empty.
There is no need to have a differentiation between OS X and iOS, so
we now have only one file called MIMETypeRegistryCocoa.mm.

  • WebCore.xcodeproj/project.pbxproj:
  • platform/cocoa/MIMETypeRegistryCocoa.mm: Added.

(WebCore::MIMETypeRegistry::getMIMETypeForExtension):
(WebCore::MIMETypeRegistry::getExtensionsForMIMEType):
(WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
(WebCore::MIMETypeRegistry::isApplicationPluginMIMEType):

  • platform/ios/MIMETypeRegistryIOS.mm: Removed.
  • platform/ios/PasteboardIOS.mm:

(WebCore::Pasteboard::read):
(WebCore::Pasteboard::supportedPasteboardTypes):
(WebCore::Pasteboard::hasData):

  • platform/ios/PlatformPasteboardIOS.mm:

(WebCore::PlatformPasteboard::write):

  • platform/mac/MIMETypeRegistryMac.mm: Removed.
Location:
trunk/Source/WebCore
Files:
1 added
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r198178 r198179  
     12016-03-14  Enrica Casucci  <enrica@apple.com>
     2
     3        iOS: RTFD format is not available in the pasteboard after copy/cut.
     4        https://bugs.webkit.org/show_bug.cgi?id=155477
     5        rdar://problem/23500600
     6
     7        Reviewed by Tim Horton.
     8
     9        WebKit is using UTTypeRTFD instead of UTTypeFlatRTFD that is the
     10        proper RTFD format for pastedboard. I also discovered that, when
     11        we create the NSTextAttachment in the NSAttributedString we produce
     12        from the DOM range, we are not generating a file name with the
     13        appropriate extension for the MIME type. The iOS specific implementation
     14        of the MIMETypeRegistry functions were empty.
     15        There is no need to have a differentiation between OS X and iOS, so
     16        we now have only one file called MIMETypeRegistryCocoa.mm.
     17
     18        * WebCore.xcodeproj/project.pbxproj:
     19        * platform/cocoa/MIMETypeRegistryCocoa.mm: Added.
     20        (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
     21        (WebCore::MIMETypeRegistry::getExtensionsForMIMEType):
     22        (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
     23        (WebCore::MIMETypeRegistry::isApplicationPluginMIMEType):
     24        * platform/ios/MIMETypeRegistryIOS.mm: Removed.
     25        * platform/ios/PasteboardIOS.mm:
     26        (WebCore::Pasteboard::read):
     27        (WebCore::Pasteboard::supportedPasteboardTypes):
     28        (WebCore::Pasteboard::hasData):
     29        * platform/ios/PlatformPasteboardIOS.mm:
     30        (WebCore::PlatformPasteboard::write):
     31        * platform/mac/MIMETypeRegistryMac.mm: Removed.
     32
    1332016-03-14  Daniel Bates  <dabates@apple.com>
    234
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r198133 r198179  
    56305630                BC772C4E0C4EB3040083285F /* MIMETypeRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC772C4C0C4EB3040083285F /* MIMETypeRegistry.cpp */; };
    56315631                BC772C4F0C4EB3040083285F /* MIMETypeRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = BC772C4D0C4EB3040083285F /* MIMETypeRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; };
    5632                 BC772C5E0C4EB3440083285F /* MIMETypeRegistryMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC772C5D0C4EB3440083285F /* MIMETypeRegistryMac.mm */; };
    56335632                BC772E131331620C001EC9CE /* CSSLineBoxContainValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC772E121331620C001EC9CE /* CSSLineBoxContainValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
    56345633                BC772E16133162C2001EC9CE /* CSSLineBoxContainValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC772E15133162C2001EC9CE /* CSSLineBoxContainValue.cpp */; };
     
    59445943                C5227DF21C3C6DF900F5ED54 /* DataDetection.mm in Sources */ = {isa = PBXBuildFile; fileRef = C5227DF01C3C6DD700F5ED54 /* DataDetection.mm */; };
    59455944                C5278B0C17F212EA003A2998 /* PlatformPasteboardIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = C5278B0B17F212EA003A2998 /* PlatformPasteboardIOS.mm */; };
     5945                C53D39341C978A45007F3AE9 /* MIMETypeRegistryCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = C53D39331C97892D007F3AE9 /* MIMETypeRegistryCocoa.mm */; };
    59465946                C544274B11A57E7A0063A749 /* DOMStringList.h in Headers */ = {isa = PBXBuildFile; fileRef = C544274911A57E7A0063A749 /* DOMStringList.h */; settings = {ATTRIBUTES = (Private, ); }; };
    59475947                C55610F111A704EB00B82D27 /* DOMStringList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C55610F011A704EB00B82D27 /* DOMStringList.cpp */; };
     
    66216621                E45322AB140CE267005A0F92 /* SelectorQuery.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E45322A9140CE267005A0F92 /* SelectorQuery.cpp */; };
    66226622                E45322AC140CE267005A0F92 /* SelectorQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = E45322AA140CE267005A0F92 /* SelectorQuery.h */; };
    6623                 E453901D0EAFCACA003695C8 /* MIMETypeRegistryIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = E45390180EAFCACA003695C8 /* MIMETypeRegistryIOS.mm */; };
    66246623                E453901E0EAFCACA003695C8 /* PasteboardIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = E45390190EAFCACA003695C8 /* PasteboardIOS.mm */; };
    66256624                E45390430EAFD637003695C8 /* PlatformScreenIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = E45390320EAFD637003695C8 /* PlatformScreenIOS.mm */; };
     
    1354713546                BC772C4C0C4EB3040083285F /* MIMETypeRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MIMETypeRegistry.cpp; sourceTree = "<group>"; };
    1354813547                BC772C4D0C4EB3040083285F /* MIMETypeRegistry.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MIMETypeRegistry.h; sourceTree = "<group>"; };
    13549                 BC772C5D0C4EB3440083285F /* MIMETypeRegistryMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = MIMETypeRegistryMac.mm; sourceTree = "<group>"; };
    1355013548                BC772E121331620C001EC9CE /* CSSLineBoxContainValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSLineBoxContainValue.h; sourceTree = "<group>"; };
    1355113549                BC772E15133162C2001EC9CE /* CSSLineBoxContainValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSLineBoxContainValue.cpp; sourceTree = "<group>"; };
     
    1389913897                C5227DF01C3C6DD700F5ED54 /* DataDetection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DataDetection.mm; sourceTree = "<group>"; };
    1390013898                C5278B0B17F212EA003A2998 /* PlatformPasteboardIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformPasteboardIOS.mm; sourceTree = "<group>"; };
     13899                C53D39331C97892D007F3AE9 /* MIMETypeRegistryCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MIMETypeRegistryCocoa.mm; sourceTree = "<group>"; };
    1390113900                C544274911A57E7A0063A749 /* DOMStringList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMStringList.h; sourceTree = "<group>"; };
    1390213901                C544274A11A57E7A0063A749 /* DOMStringList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMStringList.idl; sourceTree = "<group>"; };
     
    1466314662                E45322A9140CE267005A0F92 /* SelectorQuery.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SelectorQuery.cpp; sourceTree = "<group>"; };
    1466414663                E45322AA140CE267005A0F92 /* SelectorQuery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectorQuery.h; sourceTree = "<group>"; };
    14665                 E45390180EAFCACA003695C8 /* MIMETypeRegistryIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MIMETypeRegistryIOS.mm; sourceTree = "<group>"; };
    1466614664                E45390190EAFCACA003695C8 /* PasteboardIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PasteboardIOS.mm; sourceTree = "<group>"; };
    1466714665                E45390320EAFD637003695C8 /* PlatformScreenIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformScreenIOS.mm; sourceTree = "<group>"; };
     
    1786617864                                06E81EEB0AB5DA9700C87837 /* LocalCurrentGraphicsContext.mm */,
    1786717865                                1402645D0AFDC19B005919E2 /* LoggingMac.mm */,
    17868                                 BC772C5D0C4EB3440083285F /* MIMETypeRegistryMac.mm */,
    1786917866                                93500F3113FDE3BE0099EC24 /* NSScrollerImpDetails.h */,
    1787017867                                52F52E1014A0134F00ACC397 /* NSScrollerImpDetails.mm */,
     
    1997819975                                E4E39AFA1330EFA8003AB274 /* LegacyTileLayerPool.h */,
    1997919976                                E4E39AFC1330EFC5003AB274 /* LegacyTileLayerPool.mm */,
    19980                                 E45390180EAFCACA003695C8 /* MIMETypeRegistryIOS.mm */,
    1998119977                                E45390190EAFCACA003695C8 /* PasteboardIOS.mm */,
    1998219978                                26601EBD14B3B9AD0012C0FE /* PlatformEventFactoryIOS.h */,
     
    2003620032                                1A0409DB1A4360B5009E47F3 /* MachSendRight.h */,
    2003720033                                ADB6B29718FB90240081963E /* MemoryPressureHandlerCocoa.mm */,
     20034                                C53D39331C97892D007F3AE9 /* MIMETypeRegistryCocoa.mm */,
    2003820035                                A19D93491AA11B1E00B46C24 /* NetworkExtensionContentFilter.h */,
    2003920036                                A19D93481AA11B1E00B46C24 /* NetworkExtensionContentFilter.mm */,
     
    2996729964                                9BC6C21C13CCC97B008E0337 /* HTMLTextFormControlElement.cpp in Sources */,
    2996829965                                830519951BB0F11000F3772E /* HTMLTimeElement.cpp in Sources */,
     29966                                C53D39341C978A45007F3AE9 /* MIMETypeRegistryCocoa.mm in Sources */,
    2996929967                                A871DC290A15205700B12A68 /* HTMLTitleElement.cpp in Sources */,
    2997029968                                977B3877122883E900B81FF8 /* HTMLTokenizer.cpp in Sources */,
     
    3100331001                                37DDCD9413844FD50008B793 /* MIMEHeader.cpp in Sources */,
    3100431002                                BC772C4E0C4EB3040083285F /* MIMETypeRegistry.cpp in Sources */,
    31005                                 E453901D0EAFCACA003695C8 /* MIMETypeRegistryIOS.mm in Sources */,
    31006                                 BC772C5E0C4EB3440083285F /* MIMETypeRegistryMac.mm in Sources */,
    3100731003                                52F10865162B6DA4009AC81E /* MixedContentChecker.cpp in Sources */,
    3100831004                                CDF2B0101820540600F2B424 /* MockBox.cpp in Sources */,
  • trunk/Source/WebCore/platform/ios/PasteboardIOS.mm

    r198177 r198179  
    7979SOFT_LINK_CONSTANT(MobileCoreServices, kUTTagClassFilenameExtension, CFStringRef)
    8080SOFT_LINK_CONSTANT(MobileCoreServices, kUTTypeHTML, CFStringRef)
    81 SOFT_LINK_CONSTANT(MobileCoreServices, kUTTypeRTFD, CFStringRef)
     81SOFT_LINK_CONSTANT(MobileCoreServices, kUTTypeFlatRTFD, CFStringRef)
    8282SOFT_LINK_CONSTANT(MobileCoreServices, kUTTypeRTF, CFStringRef)
    8383
     
    9191#define kUTTagClassFilenameExtension getkUTTagClassFilenameExtension()
    9292#define kUTTypeHTML getkUTTypeHTML()
    93 #define kUTTypeRTFD getkUTTypeRTFD()
     93#define kUTTypeFlatRTFD getkUTTypeFlatRTFD()
    9494#define kUTTypeRTF getkUTTypeRTF()
    9595
     
    208208            }
    209209
    210              if ([type isEqualToString:(NSString *)kUTTypeRTFD]) {
    211                 if (RefPtr<SharedBuffer> buffer = strategy.readBufferFromPasteboard(i, kUTTypeRTFD)) {
     210            if ([type isEqualToString:(NSString *)kUTTypeFlatRTFD]) {
     211                if (RefPtr<SharedBuffer> buffer = strategy.readBufferFromPasteboard(i, kUTTypeFlatRTFD)) {
    212212                    if (reader.readRTFD(*buffer))
    213213                        break;
     
    247247NSArray* Pasteboard::supportedPasteboardTypes()
    248248{
    249     return @[(id)WebArchivePboardType, (id)kUTTypeRTFD, (id)kUTTypeRTF, (id)kUTTypeHTML, (id)kUTTypePNG, (id)kUTTypeTIFF, (id)kUTTypeJPEG, (id)kUTTypeGIF, (id)kUTTypeURL, (id)kUTTypeText];
     249    return @[(id)WebArchivePboardType, (id)kUTTypeFlatRTFD, (id)kUTTypeRTF, (id)kUTTypeHTML, (id)kUTTypePNG, (id)kUTTypeTIFF, (id)kUTTypeJPEG, (id)kUTTypeGIF, (id)kUTTypeURL, (id)kUTTypeText];
    250250}
    251251
  • trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm

    r198177 r198179  
    5757SOFT_LINK_CONSTANT(MobileCoreServices, kUTTagClassMIMEType, CFStringRef)
    5858SOFT_LINK_CONSTANT(MobileCoreServices, kUTTagClassFilenameExtension, CFStringRef)
    59 SOFT_LINK_CONSTANT(MobileCoreServices, kUTTypeRTFD, CFStringRef)
     59SOFT_LINK_CONSTANT(MobileCoreServices, kUTTypeFlatRTFD, CFStringRef)
    6060SOFT_LINK_CONSTANT(MobileCoreServices, kUTTypeRTF, CFStringRef)
    6161
     
    6868#define kUTTagClassMIMEType getkUTTagClassMIMEType()
    6969#define kUTTagClassFilenameExtension getkUTTagClassFilenameExtension()
    70 #define kUTTypeRTFD getkUTTypeRTFD()
     70#define kUTTypeFlatRTFD getkUTTypeFlatRTFD()
    7171#define kUTTypeRTF getkUTTypeRTF()
    7272
     
    163163
    164164    if (content.dataInRTFDFormat)
    165         [representations setValue:content.dataInRTFDFormat->createNSData().get() forKey:(NSString *)kUTTypeRTFD];
     165        [representations setValue:content.dataInRTFDFormat->createNSData().get() forKey:(NSString *)kUTTypeFlatRTFD];
    166166    if (content.dataInRTFFormat)
    167167        [representations setValue:content.dataInRTFFormat->createNSData().get() forKey:(NSString *)kUTTypeRTF];
Note: See TracChangeset for help on using the changeset viewer.