⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 246141 in webkit


Ignore:
Timestamp:
Jun 5, 2019, 8:24:19 PM (7 years ago)
Author:
aestes@apple.com
Message:

[macOS] Stop calling -[NSDraggingItem setItem:]
https://bugs.webkit.org/show_bug.cgi?id=198588
<rdar://problem/48297453>

On macOS Catalina, use -[NSDraggingItem _initWithItem:] instead.

Reviewed by Wenson Hsieh.

  • DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Fixed up file paths in the

TestRunnerShared group.

  • DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm:

(-[DumpRenderTreeDraggingInfo enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock:]):
Changed to call -[NSDraggingItem _initWithItem:] when available.

  • TestRunnerShared/spi/AppKitTestSPI.h: Renamed from

Tools/DumpRenderTree/mac/AppKitTestSPI.h and moved NSDraggingItem internal interface
declarations here from DumpRenderTree.

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:

Added TestRunnerShared/spi/AppKitTestSPI.h.

  • TestWebKitAPI/mac/TestDraggingInfo.mm:

(-[TestDraggingInfo enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock:]):
Changed to call -[NSDraggingItem _initWithItem:] when available.

Location:
trunk/Tools
Files:
5 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r246136 r246141  
     12019-06-05  Andy Estes  <aestes@apple.com>
     2
     3        [macOS] Stop calling -[NSDraggingItem setItem:]
     4        https://bugs.webkit.org/show_bug.cgi?id=198588
     5        <rdar://problem/48297453>
     6
     7        On macOS Catalina, use -[NSDraggingItem _initWithItem:] instead.
     8
     9        Reviewed by Wenson Hsieh.
     10
     11        * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Fixed up file paths in the
     12        TestRunnerShared group.
     13
     14        * DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm:
     15        (-[DumpRenderTreeDraggingInfo enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock:]):
     16        Changed to call -[NSDraggingItem _initWithItem:] when available.
     17
     18        * TestRunnerShared/spi/AppKitTestSPI.h: Renamed from
     19        Tools/DumpRenderTree/mac/AppKitTestSPI.h and moved NSDraggingItem internal interface
     20        declarations here from DumpRenderTree.
     21
     22        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     23        Added TestRunnerShared/spi/AppKitTestSPI.h.
     24
     25        * TestWebKitAPI/mac/TestDraggingInfo.mm:
     26        (-[TestDraggingInfo enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock:]):
     27        Changed to call -[NSDraggingItem _initWithItem:] when available.
     28
    1292019-06-05  Jer Noble  <jer.noble@apple.com>
    230
  • trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj

    r242325 r246141  
    294294                2D403EA215087142005358D2 /* LayoutTestHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LayoutTestHelper.m; path = mac/LayoutTestHelper.m; sourceTree = "<group>"; };
    295295                2D403F19150871F9005358D2 /* LayoutTestHelper */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = LayoutTestHelper; sourceTree = BUILT_PRODUCTS_DIR; };
    296                 2EDE0DAA1F5131DE00D5F8DF /* AppKitTestSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AppKitTestSPI.h; path = mac/AppKitTestSPI.h; sourceTree = "<group>"; };
    297296                31117B3A15D9A56A00163BC8 /* MockWebNotificationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MockWebNotificationProvider.h; path = mac/MockWebNotificationProvider.h; sourceTree = "<group>"; };
    298297                31117B3B15D9A56A00163BC8 /* MockWebNotificationProvider.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MockWebNotificationProvider.mm; path = mac/MockWebNotificationProvider.mm; sourceTree = "<group>"; };
    299                 3148A0551E6F90F400D3B316 /* IOSLayoutTestCommunication.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IOSLayoutTestCommunication.cpp; path = ../TestRunnerShared/IOSLayoutTestCommunication.cpp; sourceTree = "<group>"; };
    300                 3148A0561E6F90F400D3B316 /* IOSLayoutTestCommunication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IOSLayoutTestCommunication.h; path = ../TestRunnerShared/IOSLayoutTestCommunication.h; sourceTree = "<group>"; };
     298                3148A0551E6F90F400D3B316 /* IOSLayoutTestCommunication.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IOSLayoutTestCommunication.cpp; sourceTree = "<group>"; };
     299                3148A0561E6F90F400D3B316 /* IOSLayoutTestCommunication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOSLayoutTestCommunication.h; sourceTree = "<group>"; };
    301300                32A70AAB03705E1F00C91783 /* DumpRenderTreePrefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DumpRenderTreePrefix.h; sourceTree = "<group>"; };
    302301                375F09710DAC3CB600C8B4E5 /* WebKitWeightWatcher100.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher100.ttf; path = fonts/WebKitWeightWatcher100.ttf; sourceTree = "<group>"; };
     
    342341                A134E5391890671C00901D06 /* DumpRenderTreeLibrary.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = DumpRenderTreeLibrary.xcconfig; path = mac/Configurations/DumpRenderTreeLibrary.xcconfig; sourceTree = "<group>"; };
    343342                A16CD20D18907A7D0092363E /* BaseTarget.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = BaseTarget.xcconfig; path = mac/Configurations/BaseTarget.xcconfig; sourceTree = "<group>"; };
     343                A17A5A2C22A881090065C5F0 /* PencilKitTestSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PencilKitTestSPI.h; sourceTree = "<group>"; };
     344                A17A5A2D22A881090065C5F0 /* AppKitTestSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppKitTestSPI.h; sourceTree = "<group>"; };
     345                A17A5A2E22A881090065C5F0 /* CoreGraphicsTestSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CoreGraphicsTestSPI.h; sourceTree = "<group>"; };
    344346                A19317FC1892855F001C52B1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = ios/Info.plist; sourceTree = "<group>"; };
    345347                A19317FD18928738001C52B1 /* DumpRenderTreeApp.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = DumpRenderTreeApp.xcconfig; path = mac/Configurations/DumpRenderTreeApp.xcconfig; sourceTree = "<group>"; };
     
    422424                E1B7808511AF1643007E1BC2 /* MockGeolocationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MockGeolocationProvider.h; path = mac/MockGeolocationProvider.h; sourceTree = "<group>"; };
    423425                E1B7808711AF1669007E1BC2 /* MockGeolocationProvider.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MockGeolocationProvider.mm; path = mac/MockGeolocationProvider.mm; sourceTree = "<group>"; };
    424                 F44A531921B89A4400DBB99C /* InstanceMethodSwizzler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InstanceMethodSwizzler.h; path = ../TestRunnerShared/cocoa/InstanceMethodSwizzler.h; sourceTree = "<group>"; };
    425                 F44A531A21B89A4400DBB99C /* ClassMethodSwizzler.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ClassMethodSwizzler.mm; path = ../TestRunnerShared/cocoa/ClassMethodSwizzler.mm; sourceTree = "<group>"; };
    426                 F44A531B21B89A4400DBB99C /* ClassMethodSwizzler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClassMethodSwizzler.h; path = ../TestRunnerShared/cocoa/ClassMethodSwizzler.h; sourceTree = "<group>"; };
    427                 F44A531C21B89A4500DBB99C /* InstanceMethodSwizzler.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = InstanceMethodSwizzler.mm; path = ../TestRunnerShared/cocoa/InstanceMethodSwizzler.mm; sourceTree = "<group>"; };
    428                 F4C3578820E8442700FA0748 /* LayoutTestSpellChecker.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = LayoutTestSpellChecker.mm; path = ../TestRunnerShared/cocoa/LayoutTestSpellChecker.mm; sourceTree = "<group>"; };
    429                 F4C3578920E8442700FA0748 /* LayoutTestSpellChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LayoutTestSpellChecker.h; path = ../TestRunnerShared/cocoa/LayoutTestSpellChecker.h; sourceTree = "<group>"; };
     426                F44A531921B89A4400DBB99C /* InstanceMethodSwizzler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InstanceMethodSwizzler.h; sourceTree = "<group>"; };
     427                F44A531A21B89A4400DBB99C /* ClassMethodSwizzler.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ClassMethodSwizzler.mm; sourceTree = "<group>"; };
     428                F44A531B21B89A4400DBB99C /* ClassMethodSwizzler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClassMethodSwizzler.h; sourceTree = "<group>"; };
     429                F44A531C21B89A4500DBB99C /* InstanceMethodSwizzler.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = InstanceMethodSwizzler.mm; sourceTree = "<group>"; };
     430                F4C3578820E8442700FA0748 /* LayoutTestSpellChecker.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LayoutTestSpellChecker.mm; sourceTree = "<group>"; };
     431                F4C3578920E8442700FA0748 /* LayoutTestSpellChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutTestSpellChecker.h; sourceTree = "<group>"; };
    430432                F4D4235F1DD5045300678290 /* TextInputControllerIOS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TextInputControllerIOS.m; path = ios/TextInputControllerIOS.m; sourceTree = "<group>"; };
    431433                F4D423601DD5046900678290 /* TextInputController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextInputController.h; sourceTree = "<group>"; };
     
    561563                        isa = PBXGroup;
    562564                        children = (
    563                                 2EDE0DAA1F5131DE00D5F8DF /* AppKitTestSPI.h */,
    564565                                0F18E70E1D6BACB60027E547 /* UIScriptControllerMac.mm */,
    565566                        );
     
    702703                        children = (
    703704                                F4B6C31820E84382008AC225 /* cocoa */,
     705                                A17A5A2B22A880D80065C5F0 /* spi */,
    704706                                3148A0551E6F90F400D3B316 /* IOSLayoutTestCommunication.cpp */,
    705707                                3148A0561E6F90F400D3B316 /* IOSLayoutTestCommunication.h */,
    706708                        );
    707709                        name = TestRunnerShared;
    708                         path = ../WebKitTestRunner;
     710                        path = ../TestRunnerShared;
    709711                        sourceTree = "<group>";
    710712                };
     
    760762                        sourceTree = "<group>";
    761763                };
     764                A17A5A2B22A880D80065C5F0 /* spi */ = {
     765                        isa = PBXGroup;
     766                        children = (
     767                                A17A5A2D22A881090065C5F0 /* AppKitTestSPI.h */,
     768                                A17A5A2E22A881090065C5F0 /* CoreGraphicsTestSPI.h */,
     769                                A17A5A2C22A881090065C5F0 /* PencilKitTestSPI.h */,
     770                        );
     771                        path = spi;
     772                        sourceTree = "<group>";
     773                };
    762774                A803FF6409CAACC1009B2A37 /* Frameworks */ = {
    763775                        isa = PBXGroup;
     
    841853                                F4C3578820E8442700FA0748 /* LayoutTestSpellChecker.mm */,
    842854                        );
    843                         name = cocoa;
     855                        path = cocoa;
    844856                        sourceTree = "<group>";
    845857                };
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm

    r240749 r246141  
    3232#if !PLATFORM(IOS_FAMILY)
    3333
     34#import "AppKitTestSPI.h"
    3435#import "DumpRenderTree.h"
    3536#import "DumpRenderTreeFileDraggingSource.h"
     
    3839#import <WebKit/WebKit.h>
    3940#import <wtf/RetainPtr.h>
    40 
    41 @interface NSDraggingItem ()
    42 - (void)setItem:(id)item;
    43 @end
    4441
    4542@interface DumpRenderTreeFilePromiseReceiver : NSFilePromiseReceiver {
     
    278275        [allFilePromiseReceivers() addObject:receiver.get()];
    279276
     277#if HAVE(NSDRAGGINGITEM_INITWITHITEM)
     278        auto item = adoptNS([[NSDraggingItem alloc] _initWithItem:receiver.get()]);
     279#else
    280280        auto item = adoptNS([[NSDraggingItem alloc] initWithPasteboardWriter:(id <NSPasteboardWriting>)receiver.get()]); // FIXME: <https://webkit.org/b/194060> Pass an object of the right type.
    281281        [item setItem:receiver.get()];
     282#endif
    282283
    283284        block(item.get(), 0, &stop);
  • trunk/Tools/TestRunnerShared/spi/AppKitTestSPI.h

    r246140 r246141  
    4040#endif
    4141
     42#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500
     43#define HAVE_NSDRAGGINGITEM_INITWITHITEM 1
     44#endif
     45
     46@interface NSDraggingItem ()
     47#if HAVE(NSDRAGGINGITEM_INITWITHITEM)
     48- (instancetype)_initWithItem:(id)item;
     49#else
     50- (void)setItem:(id)item;
     51#endif
     52@end
     53
    4254#endif // PLATFORM(MAC)
    4355
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r246136 r246141  
    20312031                A17991891E1CA24100A505ED /* SharedBufferTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedBufferTest.cpp; sourceTree = "<group>"; };
    20322032                A179918A1E1CA24100A505ED /* SharedBufferTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SharedBufferTest.h; sourceTree = "<group>"; };
     2033                A17A5A3422A887EC0065C5F0 /* AppKitTestSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppKitTestSPI.h; sourceTree = "<group>"; };
    20332034                A17EAC542083056E0084B41B /* find.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = find.pdf; path = Tests/WebKit/find.pdf; sourceTree = SOURCE_ROOT; };
    20342035                A180C0F91EE67DF000468F47 /* RunOpenPanel.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RunOpenPanel.mm; sourceTree = "<group>"; };
     
    24932494                                2E9660DC16C07D7B00371B42 /* ios */,
    24942495                                BCA61C3A11700B9400460D1E /* mac */,
     2496                                A17A5A3122A887610065C5F0 /* TestRunnerShared */,
    24952497                                BC131A9E1171317C00B69727 /* config.h */,
    24962498                                7C6BBD8B19CEA63000C1F5E0 /* Counters.cpp */,
     
    31633165                        );
    31643166                        name = Resources;
     3167                        sourceTree = "<group>";
     3168                };
     3169                A17A5A3122A887610065C5F0 /* TestRunnerShared */ = {
     3170                        isa = PBXGroup;
     3171                        children = (
     3172                                A17A5A3322A887CE0065C5F0 /* spi */,
     3173                        );
     3174                        name = TestRunnerShared;
     3175                        path = ../TestRunnerShared;
     3176                        sourceTree = "<group>";
     3177                };
     3178                A17A5A3322A887CE0065C5F0 /* spi */ = {
     3179                        isa = PBXGroup;
     3180                        children = (
     3181                                A17A5A3422A887EC0065C5F0 /* AppKitTestSPI.h */,
     3182                        );
     3183                        path = spi;
    31653184                        sourceTree = "<group>";
    31663185                };
  • trunk/Tools/TestWebKitAPI/mac/TestDraggingInfo.mm

    r242339 r246141  
    2929#if ENABLE(DRAG_SUPPORT) && PLATFORM(MAC)
    3030
     31#import "AppKitTestSPI.h"
    3132#import "DragAndDropSimulator.h"
    3233#import "TestFilePromiseReceiver.h"
    3334#import <wtf/WeakObjCPtr.h>
    34 
    35 @interface NSDraggingItem ()
    36 @property (nonatomic, strong) id item;
    37 @end
    3835
    3936@implementation TestDraggingInfo {
     
    8683- (void)enumerateDraggingItemsWithOptions:(NSDraggingItemEnumerationOptions)enumerationOptions forView:(NSView *)view classes:(NSArray<Class> *)classes searchOptions:(NSDictionary<NSString *, id> *)searchOptions usingBlock:(void (^)(NSDraggingItem *, NSInteger, BOOL *))block
    8784{
    88     // FIXME: Much of this can be shared with existing drag and drop testing code in DumpRenderTree.
     85    // FIXME: Much of this can be shared with existing drag and drop testing code in DumpRenderTree,
     86    // perhaps by putting it in Tools/TestRunnerShared.
    8987
    9088    if (enumerationOptions) {
     
    116114        [_filePromiseReceivers addObject:receiver.get()];
    117115
     116#if HAVE(NSDRAGGINGITEM_INITWITHITEM)
     117        auto item = adoptNS([[NSDraggingItem alloc] _initWithItem:receiver.get()]);
     118#else
    118119        auto item = adoptNS([[NSDraggingItem alloc] initWithPasteboardWriter:(id <NSPasteboardWriting>)receiver.get()]); // FIXME: <https://webkit.org/b/194060> Pass an object of the right type.
    119120        [item setItem:receiver.get()];
     121#endif
    120122
    121123        block(item.get(), 0, &stop);
Note: See TracChangeset for help on using the changeset viewer.