Changeset 239369 in webkit


Ignore:
Timestamp:
Dec 18, 2018 10:10:28 PM (5 years ago)
Author:
Wenson Hsieh
Message:

[iOS] A copied text selection is pasted as a web archive attachment in the entry view in Messages
https://bugs.webkit.org/show_bug.cgi?id=192842
<rdar://problem/46823586>

Reviewed by Tim Horton.

Source/WebCore:

Temporarily revert a behavior change introduced by r238661, where we now add "com.apple.webarchive" as a
registered UTI when dragging or copying a text selection. This broke the Messages app on iOS, which currently
inserts a copied or dragged text selection from WebKit-based views as a web archive file attachment. A fix for
this is internally tracked in <rdar://problem/46830277>.

  • platform/ios/PlatformPasteboardIOS.mm:

(WebCore::PlatformPasteboard::write):

Tools:

Adjusts an existing API test to verify that "com.apple.webarchive" is not one of the types registered to the
item provider when dragging a rich text selection.

  • TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r239368 r239369  
     12018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [iOS] A copied text selection is pasted as a web archive attachment in the entry view in Messages
     4        https://bugs.webkit.org/show_bug.cgi?id=192842
     5        <rdar://problem/46823586>
     6
     7        Reviewed by Tim Horton.
     8
     9        Temporarily revert a behavior change introduced by r238661, where we now add "com.apple.webarchive" as a
     10        registered UTI when dragging or copying a text selection. This broke the Messages app on iOS, which currently
     11        inserts a copied or dragged text selection from WebKit-based views as a web archive file attachment. A fix for
     12        this is internally tracked in <rdar://problem/46830277>.
     13
     14        * platform/ios/PlatformPasteboardIOS.mm:
     15        (WebCore::PlatformPasteboard::write):
     16
    1172018-12-18  Michael Catanzaro  <mcatanzaro@igalia.com>
    218
  • trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm

    r239086 r239369  
    370370    if (content.dataInWebArchiveFormat) {
    371371        auto webArchiveData = content.dataInWebArchiveFormat->createNSData();
    372 #if !PLATFORM(IOSMAC)
    373         [representationsToRegister addData:webArchiveData.get() forType:WebArchivePboardType];
    374 #endif
    375         [representationsToRegister addData:webArchiveData.get() forType:(__bridge NSString *)kUTTypeWebArchive];
     372#if PLATFORM(IOSMAC)
     373        NSString *webArchiveType = (__bridge NSString *)kUTTypeWebArchive;
     374#else
     375        // FIXME: We should additionally register "com.apple.webarchive" once <rdar://problem/46830277> is fixed.
     376        NSString *webArchiveType = WebArchivePboardType;
     377#endif
     378        [representationsToRegister addData:webArchiveData.get() forType:webArchiveType];
    376379    }
    377380
  • trunk/Tools/ChangeLog

    r239359 r239369  
     12018-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [iOS] A copied text selection is pasted as a web archive attachment in the entry view in Messages
     4        https://bugs.webkit.org/show_bug.cgi?id=192842
     5        <rdar://problem/46823586>
     6
     7        Reviewed by Tim Horton.
     8
     9        Adjusts an existing API test to verify that "com.apple.webarchive" is not one of the types registered to the
     10        item provider when dragging a rich text selection.
     11
     12        * TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
     13
    1142018-12-18  David Quesada  <david_quesada@apple.com>
    215
  • trunk/Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm

    r239184 r239369  
    373373    checkRichTextTypePrecedesPlainTextType(simulator.get());
    374374    EXPECT_TRUE([simulator lastKnownDropProposal].precise);
     375
     376    // FIXME: Once <rdar://problem/46830277> is fixed, we should add "com.apple.webarchive" as a registered pasteboard type and rebaseline this expectation.
     377    EXPECT_FALSE([[[simulator sourceItemProviders].firstObject registeredTypeIdentifiers] containsObject:(__bridge NSString *)kUTTypeWebArchive]);
    375378}
    376379
Note: See TracChangeset for help on using the changeset viewer.