- Revision
- 245882
- Author
- [email protected]
- Date
- 2019-05-29 19:41:10 -0700 (Wed, 29 May 2019)
Log Message
Remove some logic to suppress the text selection assistant during drop
https://bugs.webkit.org/show_bug.cgi?id=198354
Reviewed by Tim Horton.
Source/WebKit:
This logic was originally added to hide the ranged selection after performing a drop in editable content.
However, after r245803, we (1) no longer show the keyboard and/or text selection views when dropping, and (2)
the final selection is now a caret, so it's no longer necessary to suppress the selection assistant.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView dropInteraction:performDrop:]):
(-[WKContentView dropInteraction:concludeDrop:]):
Tools:
Adjust some API tests that currently check whether or not the selection assistant was suppressed during drop.
* TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/cocoa/DragAndDropSimulator.h:
* TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm:
(-[DragAndDropSimulator _resetSimulatedState]):
(-[DragAndDropSimulator _webView:dataInteractionOperationWasHandled:forSession:itemProviders:]):
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (245881 => 245882)
--- trunk/Source/WebKit/ChangeLog 2019-05-30 00:23:58 UTC (rev 245881)
+++ trunk/Source/WebKit/ChangeLog 2019-05-30 02:41:10 UTC (rev 245882)
@@ -1,3 +1,19 @@
+2019-05-29 Wenson Hsieh <[email protected]>
+
+ Remove some logic to suppress the text selection assistant during drop
+ https://bugs.webkit.org/show_bug.cgi?id=198354
+
+ Reviewed by Tim Horton.
+
+ This logic was originally added to hide the ranged selection after performing a drop in editable content.
+ However, after r245803, we (1) no longer show the keyboard and/or text selection views when dropping, and (2)
+ the final selection is now a caret, so it's no longer necessary to suppress the selection assistant.
+
+ * UIProcess/ios/WKContentViewInteraction.h:
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView dropInteraction:performDrop:]):
+ (-[WKContentView dropInteraction:concludeDrop:]):
+
2019-05-29 Sihui Liu <[email protected]>
WKWebsiteDataStore API fails to fetch web storage data for non-persistent data store
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (245881 => 245882)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2019-05-30 00:23:58 UTC (rev 245881)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2019-05-30 02:41:10 UTC (rev 245882)
@@ -165,8 +165,7 @@
enum SuppressSelectionAssistantReason : uint8_t {
EditableRootIsTransparentOrFullyClipped = 1 << 0,
FocusedElementIsTooSmall = 1 << 1,
- DropAnimationIsRunning = 1 << 2,
- InteractionIsHappening = 1 << 3
+ InteractionIsHappening = 1 << 2
};
struct WKSelectionDrawingInfo {
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (245881 => 245882)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2019-05-30 00:23:58 UTC (rev 245881)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2019-05-30 02:41:10 UTC (rev 245882)
@@ -6891,9 +6891,7 @@
WebKit::SandboxExtension::HandleArray sandboxExtensionForUpload;
retainedSelf->_page->createSandboxExtensionsIfNeeded(filenames, sandboxExtensionHandle, sandboxExtensionForUpload);
retainedSelf->_page->performDragOperation(capturedDragData, "data interaction pasteboard", WTFMove(sandboxExtensionHandle), WTFMove(sandboxExtensionForUpload));
-
retainedSelf->_visibleContentViewSnapshot = [retainedSelf snapshotViewAfterScreenUpdates:NO];
- [retainedSelf _startSuppressingSelectionAssistantForReason:WebKit::DropAnimationIsRunning];
[UIView performWithoutAnimation:[retainedSelf] {
[retainedSelf->_visibleContentViewSnapshot setFrame:[retainedSelf bounds]];
[retainedSelf addSubview:retainedSelf->_visibleContentViewSnapshot.get()];
@@ -6910,7 +6908,6 @@
- (void)dropInteraction:(UIDropInteraction *)interaction concludeDrop:(id <UIDropSession>)session
{
- [self _stopSuppressingSelectionAssistantForReason:WebKit::DropAnimationIsRunning];
[std::exchange(_visibleContentViewSnapshot, nil) removeFromSuperview];
[std::exchange(_unselectedContentSnapshot, nil) removeFromSuperview];
_dragDropInteractionState.clearAllDelayedItemPreviewProviders();
Modified: trunk/Tools/ChangeLog (245881 => 245882)
--- trunk/Tools/ChangeLog 2019-05-30 00:23:58 UTC (rev 245881)
+++ trunk/Tools/ChangeLog 2019-05-30 02:41:10 UTC (rev 245882)
@@ -1,3 +1,19 @@
+2019-05-29 Wenson Hsieh <[email protected]>
+
+ Remove some logic to suppress the text selection assistant during drop
+ https://bugs.webkit.org/show_bug.cgi?id=198354
+
+ Reviewed by Tim Horton.
+
+ Adjust some API tests that currently check whether or not the selection assistant was suppressed during drop.
+
+ * TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
+ (TestWebKitAPI::TEST):
+ * TestWebKitAPI/cocoa/DragAndDropSimulator.h:
+ * TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm:
+ (-[DragAndDropSimulator _resetSimulatedState]):
+ (-[DragAndDropSimulator _webView:dataInteractionOperationWasHandled:forSession:itemProviders:]):
+
2019-05-29 Sihui Liu <[email protected]>
WKWebsiteDataStore API fails to fetch web storage data for non-persistent data store
Modified: trunk/Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm (245881 => 245882)
--- trunk/Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm 2019-05-30 00:23:58 UTC (rev 245881)
+++ trunk/Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm 2019-05-30 02:41:10 UTC (rev 245882)
@@ -370,7 +370,6 @@
loadTestPageAndEnsureInputSession(simulator.get(), @"autofocus-contenteditable");
[simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
- EXPECT_TRUE([simulator suppressedSelectionCommandsDuringDrop]);
EXPECT_EQ([webView stringByEvaluatingJavaScript:@"source.textContent"].length, 0UL);
EXPECT_WK_STREQ("Hello world", [webView stringByEvaluatingJavaScript:@"editor.textContent"].UTF8String);
@@ -394,7 +393,6 @@
loadTestPageAndEnsureInputSession(simulator.get(), @"contenteditable-and-textarea");
[simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
- EXPECT_TRUE([simulator suppressedSelectionCommandsDuringDrop]);
EXPECT_EQ([webView stringByEvaluatingJavaScript:@"source.textContent"].length, 0UL);
EXPECT_WK_STREQ("Hello world", [webView editorValue].UTF8String);
@@ -455,7 +453,6 @@
NSUInteger firstParagraphOffset = [finalTextContent rangeOfString:@"This is the first paragraph"].location;
NSUInteger secondParagraphOffset = [finalTextContent rangeOfString:@"This is the second paragraph"].location;
- EXPECT_TRUE([simulator suppressedSelectionCommandsDuringDrop]);
EXPECT_FALSE(firstParagraphOffset == NSNotFound);
EXPECT_FALSE(secondParagraphOffset == NSNotFound);
EXPECT_GT(firstParagraphOffset, secondParagraphOffset);
@@ -482,7 +479,6 @@
loadTestPageAndEnsureInputSession(simulator.get(), @"textarea-to-input");
[simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
- EXPECT_TRUE([simulator suppressedSelectionCommandsDuringDrop]);
EXPECT_EQ([webView stringByEvaluatingJavaScript:@"source.value"].length, 0UL);
EXPECT_WK_STREQ("Hello world", [webView editorValue].UTF8String);
checkCGRectIsEqualToCGRectWithLogging(CGRectMake(1089, 241, 2, 232), [simulator finalSelectionStartRect]);
@@ -499,8 +495,6 @@
[webView stringByEvaluatingJavaScript:@"source.selectionEnd = source.value.length"];
[simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
- EXPECT_TRUE([simulator suppressedSelectionCommandsDuringDrop]);
-
NSItemProvider *itemProvider = [simulator sourceItemProviders].firstObject;
NSArray *registeredTypes = [itemProvider registeredTypeIdentifiers];
EXPECT_EQ(1UL, registeredTypes.count);
@@ -521,8 +515,6 @@
[webView stringByEvaluatingJavaScript:@"source.selectionEnd = source.value.length"];
[simulator runFrom:CGPointMake(100, 50) to:CGPointMake(100, 300)];
- EXPECT_TRUE([simulator suppressedSelectionCommandsDuringDrop]);
-
NSItemProvider *itemProvider = [simulator sourceItemProviders].firstObject;
NSArray *registeredTypes = [itemProvider registeredTypeIdentifiers];
EXPECT_EQ(2UL, registeredTypes.count);
Modified: trunk/Tools/TestWebKitAPI/cocoa/DragAndDropSimulator.h (245881 => 245882)
--- trunk/Tools/TestWebKitAPI/cocoa/DragAndDropSimulator.h 2019-05-30 00:23:58 UTC (rev 245881)
+++ trunk/Tools/TestWebKitAPI/cocoa/DragAndDropSimulator.h 2019-05-30 02:41:10 UTC (rev 245882)
@@ -113,7 +113,6 @@
@property (nonatomic, readonly) NSArray<UITargetedDragPreview *> *liftPreviews;
@property (nonatomic, readonly) NSArray *dropPreviews;
@property (nonatomic, readonly) NSArray *delayedDropPreviews;
-@property (nonatomic, readonly) BOOL suppressedSelectionCommandsDuringDrop;
#endif // PLATFORM(IOS_FAMILY)
Modified: trunk/Tools/TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm (245881 => 245882)
--- trunk/Tools/TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm 2019-05-30 00:23:58 UTC (rev 245881)
+++ trunk/Tools/TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm 2019-05-30 02:41:10 UTC (rev 245882)
@@ -323,7 +323,6 @@
bool _isDoneWaitingForDelayedDropPreviews;
DragAndDropPhase _phase;
- BOOL _suppressedSelectionCommandsDuringDrop;
RetainPtr<UIDropProposal> _lastKnownDropProposal;
BlockPtr<BOOL(_WKActivatedElementInfo *)> _showCustomActionSheetBlock;
@@ -373,7 +372,6 @@
- (void)_resetSimulatedState
{
- _suppressedSelectionCommandsDuringDrop = NO;
_phase = DragAndDropPhaseBeginning;
_currentProgress = 0;
_isDoneWithCurrentRun = false;
@@ -763,8 +761,6 @@
- (void)_webView:(WKWebView *)webView dataInteractionOperationWasHandled:(BOOL)handled forSession:(id)session itemProviders:(NSArray<NSItemProvider *> *)itemProviders
{
- _suppressedSelectionCommandsDuringDrop = [_webView textInputContentView]._shouldSuppressSelectionCommands;
-
if (self.dropCompletionBlock)
self.dropCompletionBlock(handled, itemProviders);