Data interaction fails in Safari splitscreen mode when dropping into a contenteditable
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Feb 2017 06:23:50 +0000 (06:23 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Feb 2017 06:23:50 +0000 (06:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=167862
<rdar://problem/30368405>

Reviewed by Tim Horton.

Adds a counter to WebItemProviderPasteboard that can incremented, decremented, and queried by clients.

* platform/ios/WebItemProviderPasteboard.h:
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard init]):
(-[WebItemProviderPasteboard hasPendingOperation]):
(-[WebItemProviderPasteboard incrementPendingOperationCount]):
(-[WebItemProviderPasteboard decrementPendingOperationCount]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211716 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/ios/WebItemProviderPasteboard.h
Source/WebCore/platform/ios/WebItemProviderPasteboard.mm

index 5cfc1a0..af90148 100644 (file)
@@ -1,3 +1,20 @@
+2017-02-05  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Data interaction fails in Safari splitscreen mode when dropping into a contenteditable
+        https://bugs.webkit.org/show_bug.cgi?id=167862
+        <rdar://problem/30368405>
+
+        Reviewed by Tim Horton.
+
+        Adds a counter to WebItemProviderPasteboard that can incremented, decremented, and queried by clients.
+
+        * platform/ios/WebItemProviderPasteboard.h:
+        * platform/ios/WebItemProviderPasteboard.mm:
+        (-[WebItemProviderPasteboard init]):
+        (-[WebItemProviderPasteboard hasPendingOperation]):
+        (-[WebItemProviderPasteboard incrementPendingOperationCount]):
+        (-[WebItemProviderPasteboard decrementPendingOperationCount]):
+
 2017-02-05  Simon Fraser  <simon.fraser@apple.com>
 
         Remove unparentsOffscreenTiles logic in TileController
index 3a7fadf..63b357a 100644 (file)
@@ -41,6 +41,10 @@ WEBCORE_EXPORT @interface WebItemProviderPasteboard : NSObject<AbstractPasteboar
 @property (readonly, nonatomic) NSInteger numberOfItems;
 @property (readonly, nonatomic) NSInteger changeCount;
 
+@property (readonly, nonatomic) BOOL hasPendingOperation;
+- (void)incrementPendingOperationCount;
+- (void)decrementPendingOperationCount;
+
 @end
 
 NS_ASSUME_NONNULL_END
index 4563aea..8160120 100644 (file)
@@ -72,6 +72,7 @@ static BOOL isImageType(NSString *type)
 
 @property (nonatomic) NSInteger numberOfItems;
 @property (nonatomic) NSInteger changeCount;
+@property (nonatomic) NSInteger pendingOperationCount;
 
 @end
 
@@ -92,6 +93,7 @@ static BOOL isImageType(NSString *type)
     if (self = [super init]) {
         _itemProviders = [[NSArray alloc] init];
         _changeCount = 0;
+        _pendingOperationCount = 0;
     }
     return self;
 }
@@ -211,6 +213,21 @@ static BOOL isImageType(NSString *type)
     return 0 <= index && index < (NSInteger)_itemProviders.count ? _itemProviders[index] : nil;
 }
 
+- (BOOL)hasPendingOperation
+{
+    return _pendingOperationCount;
+}
+
+- (void)incrementPendingOperationCount
+{
+    _pendingOperationCount++;
+}
+
+- (void)decrementPendingOperationCount
+{
+    _pendingOperationCount--;
+}
+
 @end
 
 #endif // ENABLE(DATA_INTERACTION)