<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[212973] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/212973">212973</a></dd>
<dt>Author</dt> <dd>wenson_hsieh@apple.com</dd>
<dt>Date</dt> <dd>2017-02-24 16:05:39 -0800 (Fri, 24 Feb 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove the data interaction gesture recognizer
https://bugs.webkit.org/show_bug.cgi?id=168600
&lt;rdar://problem/30313681&gt;

Reviewed by Anders Carlsson.

Source/WebKit2:

The data interaction gesture recognizer will no longer be needed moving forward.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _simulateDataInteractionGestureRecognized]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView _dataInteractionGestureRecognizer]): Deleted.

Tools:

Adjust TestWebKitAPI for changes in WebKit2.

* TestWebKitAPI/ios/DataInteractionSimulator.h:
* TestWebKitAPI/ios/DataInteractionSimulator.mm:
(-[DataInteractionSimulator initWithWebView:]):
(-[DataInteractionSimulator runFrom:to:]):
(-[DataInteractionSimulator _advanceProgress]):
(-[DataInteractionSimulator _finishDataInteraction]):
(-[MockLongPressGestureRecognizer initWithWindow:]): Deleted.
(-[MockLongPressGestureRecognizer locationInView:]): Deleted.
(-[MockLongPressGestureRecognizer state]): Deleted.
(-[MockLongPressGestureRecognizer numberOfTouches]): Deleted.
(-[DataInteractionSimulator _recognizeGestureAtLocation:withState:]): Deleted.
(-[DataInteractionSimulator dataInteractionGestureRecognizer]): Deleted.
(-[DataInteractionSimulator webView:beginDataInteractionWithSourceIndex:gestureRecognizer:]): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewPrivateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKContentViewInteractionh">trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKContentViewInteractionmm">trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPIiosDataInteractionSimulatorh">trunk/Tools/TestWebKitAPI/ios/DataInteractionSimulator.h</a></li>
<li><a href="#trunkToolsTestWebKitAPIiosDataInteractionSimulatormm">trunk/Tools/TestWebKitAPI/ios/DataInteractionSimulator.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (212972 => 212973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2017-02-25 00:02:24 UTC (rev 212972)
+++ trunk/Source/WebKit2/ChangeLog        2017-02-25 00:05:39 UTC (rev 212973)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2017-02-20  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
+
+        Remove the data interaction gesture recognizer
+        https://bugs.webkit.org/show_bug.cgi?id=168600
+        &lt;rdar://problem/30313681&gt;
+
+        Reviewed by Anders Carlsson.
+
+        The data interaction gesture recognizer will no longer be needed moving forward.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _simulateDataInteractionGestureRecognized]): Deleted.
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView setupInteraction]):
+        (-[WKContentView cleanupInteraction]):
+        (-[WKContentView _removeDefaultGestureRecognizers]):
+        (-[WKContentView _addDefaultGestureRecognizers]):
+        (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
+        (-[WKContentView gestureRecognizerShouldBegin:]):
+        (-[WKContentView _dataInteractionGestureRecognizer]): Deleted.
+
</ins><span class="cx"> 2017-02-24  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS][WK2] Disable network cache speculative revalidation / loading in low power mode
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (212972 => 212973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2017-02-25 00:02:24 UTC (rev 212972)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2017-02-25 00:05:39 UTC (rev 212973)
</span><span class="lines">@@ -5233,11 +5233,6 @@
</span><span class="cx">     WebKit::ViewSnapshotStore::singleton().setDisableSnapshotVolatilityForTesting(true);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-
-- (void)_simulateDataInteractionGestureRecognized
-{
-}
-
</del><span class="cx"> - (void)_simulateDataInteractionEntered:(id)info
</span><span class="cx"> {
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h (212972 => 212973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h        2017-02-25 00:02:24 UTC (rev 212972)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h        2017-02-25 00:05:39 UTC (rev 212973)
</span><span class="lines">@@ -306,7 +306,6 @@
</span><span class="cx"> 
</span><span class="cx"> @property (nonatomic, readonly) NSNumber *_stableStateOverride WK_API_AVAILABLE(ios(WK_IOS_TBA));
</span><span class="cx"> 
</span><del>-- (void)_simulateDataInteractionGestureRecognized WK_API_AVAILABLE(ios(WK_IOS_TBA));
</del><span class="cx"> - (void)_simulateDataInteractionEntered:(id)info WK_API_AVAILABLE(ios(WK_IOS_TBA));
</span><span class="cx"> - (void)_simulateDataInteractionUpdated:(id)info WK_API_AVAILABLE(ios(WK_IOS_TBA));
</span><span class="cx"> - (void)_simulateDataInteractionPerformOperation:(id)info WK_API_AVAILABLE(ios(WK_IOS_TBA));
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewInteractionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h (212972 => 212973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h        2017-02-25 00:02:24 UTC (rev 212972)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h        2017-02-25 00:05:39 UTC (rev 212973)
</span><span class="lines">@@ -118,9 +118,6 @@
</span><span class="cx">     RetainPtr&lt;UITapGestureRecognizer&gt; _twoFingerDoubleTapGestureRecognizer;
</span><span class="cx">     RetainPtr&lt;UITapGestureRecognizer&gt; _twoFingerSingleTapGestureRecognizer;
</span><span class="cx">     RetainPtr&lt;WKInspectorNodeSearchGestureRecognizer&gt; _inspectorNodeSearchGestureRecognizer;
</span><del>-#if ENABLE(DATA_INTERACTION)
-    RetainPtr&lt;UILongPressGestureRecognizer&gt; _dataInteractionGestureRecognizer;
-#endif
</del><span class="cx"> 
</span><span class="cx">     RetainPtr&lt;UIWKTextInteractionAssistant&gt; _textSelectionAssistant;
</span><span class="cx">     RetainPtr&lt;UIWKSelectionAssistant&gt; _webSelectionAssistant;
</span><span class="lines">@@ -272,7 +269,6 @@
</span><span class="cx"> - (void)_didPerformDataInteractionControllerOperation;
</span><span class="cx"> - (void)_didHandleStartDataInteractionRequest:(BOOL)started;
</span><span class="cx"> - (void)_startDataInteractionWithImage:(RetainPtr&lt;CGImageRef&gt;)image withIndicatorData:(std::optional&lt;WebCore::TextIndicatorData&gt;)indicatorData atClientPosition:(CGPoint)clientPosition anchorPoint:(CGPoint)anchorPoint action:(uint64_t)action;
</span><del>-- (void)_simulateDataInteractionGestureRecognized:(UILongPressGestureRecognizer *)gestureRecognizer WK_API_AVAILABLE(ios(WK_IOS_TBA));
</del><span class="cx"> - (void)_simulateDataInteractionEntered:(id)info WK_API_AVAILABLE(ios(WK_IOS_TBA));
</span><span class="cx"> - (void)_simulateDataInteractionUpdated:(id)info WK_API_AVAILABLE(ios(WK_IOS_TBA));
</span><span class="cx"> - (void)_simulateDataInteractionPerformOperation:(id)info WK_API_AVAILABLE(ios(WK_IOS_TBA));
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewInteractionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (212972 => 212973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2017-02-25 00:02:24 UTC (rev 212972)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2017-02-25 00:05:39 UTC (rev 212973)
</span><span class="lines">@@ -558,11 +558,6 @@
</span><span class="cx">     [self _createAndConfigureLongPressGestureRecognizer];
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(DATA_INTERACTION)
</span><del>-    _dataInteractionGestureRecognizer = adoptNS([[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(_dataInteractionGestureRecognized:)]);
-    [_dataInteractionGestureRecognizer setDelay:0.5];
-    [_dataInteractionGestureRecognizer setDelegate:self];
-    [_dataInteractionGestureRecognizer _setRequiresQuietImpulse:YES];
-    [self addGestureRecognizer:_dataInteractionGestureRecognizer.get()];
</del><span class="cx">     [self setupDataInteractionDelegates];
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -642,8 +637,6 @@
</span><span class="cx">     [self removeGestureRecognizer:_twoFingerSingleTapGestureRecognizer.get()];
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(DATA_INTERACTION)
</span><del>-    [_dataInteractionGestureRecognizer setDelegate:nil];
-    [self removeGestureRecognizer:_dataInteractionGestureRecognizer.get()];
</del><span class="cx">     [self teardownDataInteractionDelegates];
</span><span class="cx">     _isPerformingDataInteractionOperation = NO;
</span><span class="cx"> #endif
</span><span class="lines">@@ -675,9 +668,6 @@
</span><span class="cx">     [self removeGestureRecognizer:_nonBlockingDoubleTapGestureRecognizer.get()];
</span><span class="cx">     [self removeGestureRecognizer:_twoFingerDoubleTapGestureRecognizer.get()];
</span><span class="cx">     [self removeGestureRecognizer:_twoFingerSingleTapGestureRecognizer.get()];
</span><del>-#if ENABLE(DATA_INTERACTION)
-    [self removeGestureRecognizer:_dataInteractionGestureRecognizer.get()];
-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_addDefaultGestureRecognizers
</span><span class="lines">@@ -689,9 +679,6 @@
</span><span class="cx">     [self addGestureRecognizer:_nonBlockingDoubleTapGestureRecognizer.get()];
</span><span class="cx">     [self addGestureRecognizer:_twoFingerDoubleTapGestureRecognizer.get()];
</span><span class="cx">     [self addGestureRecognizer:_twoFingerSingleTapGestureRecognizer.get()];
</span><del>-#if ENABLE(DATA_INTERACTION)
-    [self addGestureRecognizer:_dataInteractionGestureRecognizer.get()];
-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (UIView*)unscaledView
</span><span class="lines">@@ -1227,14 +1214,6 @@
</span><span class="cx">     if (isSamePair(gestureRecognizer, otherGestureRecognizer, _highlightLongPressGestureRecognizer.get(), _previewGestureRecognizer.get()))
</span><span class="cx">         return YES;
</span><span class="cx"> 
</span><del>-#if ENABLE(DATA_INTERACTION)
-    if (isSamePair(gestureRecognizer, otherGestureRecognizer, _highlightLongPressGestureRecognizer.get(), _dataInteractionGestureRecognizer.get()))
-        return YES;
-
-    if (isSamePair(gestureRecognizer, otherGestureRecognizer, _longPressGestureRecognizer.get(), _dataInteractionGestureRecognizer.get()))
-        return YES;
-#endif
-
</del><span class="cx">     return NO;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1405,11 +1384,6 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-#if ENABLE(DATA_INTERACTION)
-    if (gestureRecognizer == _dataInteractionGestureRecognizer)
-        return [self pointIsInDataInteractionContent:point];
-#endif
-
</del><span class="cx">     return YES;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1465,11 +1439,6 @@
</span><span class="cx">     return _positionInformation.hasSelectionAtPosition;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (UILongPressGestureRecognizer *)_dataInteractionGestureRecognizer
-{
-    return _dataInteractionGestureRecognizer.get();
-}
-
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)pointIsNearMarkedText:(CGPoint)point
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (212972 => 212973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2017-02-25 00:02:24 UTC (rev 212972)
+++ trunk/Tools/ChangeLog        2017-02-25 00:05:39 UTC (rev 212973)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2017-02-20  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
+
+        Remove the data interaction gesture recognizer
+        https://bugs.webkit.org/show_bug.cgi?id=168600
+        &lt;rdar://problem/30313681&gt;
+
+        Reviewed by Anders Carlsson.
+
+        Adjust TestWebKitAPI for changes in WebKit2.
+
+        * TestWebKitAPI/ios/DataInteractionSimulator.h:
+        * TestWebKitAPI/ios/DataInteractionSimulator.mm:
+        (-[DataInteractionSimulator initWithWebView:]):
+        (-[DataInteractionSimulator runFrom:to:]):
+        (-[DataInteractionSimulator _advanceProgress]):
+        (-[DataInteractionSimulator _finishDataInteraction]):
+        (-[MockLongPressGestureRecognizer initWithWindow:]): Deleted.
+        (-[MockLongPressGestureRecognizer locationInView:]): Deleted.
+        (-[MockLongPressGestureRecognizer state]): Deleted.
+        (-[MockLongPressGestureRecognizer numberOfTouches]): Deleted.
+        (-[DataInteractionSimulator _recognizeGestureAtLocation:withState:]): Deleted.
+        (-[DataInteractionSimulator dataInteractionGestureRecognizer]): Deleted.
+        (-[DataInteractionSimulator webView:beginDataInteractionWithSourceIndex:gestureRecognizer:]): Deleted.
+
</ins><span class="cx"> 2017-02-24  John Wilander  &lt;wilander@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Resource Load Statistics: Add alternate classification method
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIiosDataInteractionSimulatorh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/ios/DataInteractionSimulator.h (212972 => 212973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/ios/DataInteractionSimulator.h        2017-02-25 00:02:24 UTC (rev 212972)
+++ trunk/Tools/TestWebKitAPI/ios/DataInteractionSimulator.h        2017-02-25 00:05:39 UTC (rev 212973)
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx"> #import &lt;WebKit/_WKTestingDelegate.h&gt;
</span><span class="cx"> #import &lt;wtf/BlockPtr.h&gt;
</span><span class="cx"> 
</span><del>-@class MockLongPressGestureRecognizer;
</del><span class="cx"> @class MockDataInteractionInfo;
</span><span class="cx"> 
</span><span class="cx"> extern NSString * const DataInteractionEnterEventName;
</span><span class="lines">@@ -49,7 +48,6 @@
</span><span class="cx"> 
</span><span class="cx"> @interface DataInteractionSimulator : NSObject&lt;_WKTestingDelegate&gt; {
</span><span class="cx">     RetainPtr&lt;TestWKWebView&gt; _webView;
</span><del>-    RetainPtr&lt;MockLongPressGestureRecognizer&gt; _gestureRecognizer;
</del><span class="cx">     RetainPtr&lt;MockDataInteractionInfo&gt; _dataInteractionInfo;
</span><span class="cx">     RetainPtr&lt;NSMutableArray&gt; _observedEventNames;
</span><span class="cx">     RetainPtr&lt;UIItemProvider&gt; _externalItemProvider;
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIiosDataInteractionSimulatormm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/ios/DataInteractionSimulator.mm (212972 => 212973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/ios/DataInteractionSimulator.mm        2017-02-25 00:02:24 UTC (rev 212972)
+++ trunk/Tools/TestWebKitAPI/ios/DataInteractionSimulator.mm        2017-02-25 00:05:39 UTC (rev 212973)
</span><span class="lines">@@ -39,46 +39,6 @@
</span><span class="cx"> #include &lt;WebKitAdditions/DataInteractionSimulatorAdditions.mm&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-@interface MockLongPressGestureRecognizer : UILongPressGestureRecognizer {
-    RetainPtr&lt;UIWindow&gt; _window;
-}
-
-@property (nonatomic) CGPoint mockLocationInWindow;
-@property (nonatomic) UIGestureRecognizerState mockState;
-@property (nonatomic) NSInteger mockNumberOfTouches;
-
-@end
-
-@implementation MockLongPressGestureRecognizer
-
-- (instancetype)initWithWindow:(UIWindow *)window
-{
-    if (self = [super init]) {
-        _window = window;
-        _mockState = UIGestureRecognizerStatePossible;
-        _mockNumberOfTouches = 0;
-        _mockLocationInWindow = CGPointZero;
-    }
-    return self;
-}
-
-- (CGPoint)locationInView:(UIView *)view
-{
-    return [view convertPoint:_mockLocationInWindow fromView:_window.get()];
-}
-
-- (UIGestureRecognizerState)state
-{
-    return _mockState;
-}
-
-- (NSUInteger)numberOfTouches
-{
-    return _mockNumberOfTouches;
-}
-
-@end
-
</del><span class="cx"> static double progressIncrementStep = 0.033;
</span><span class="cx"> static double progressTimeStep = 0.016;
</span><span class="cx"> 
</span><span class="lines">@@ -98,9 +58,6 @@
</span><span class="cx"> {
</span><span class="cx">     if (self = [super init]) {
</span><span class="cx">         _webView = webView;
</span><del>-        _gestureRecognizer = adoptNS([[MockLongPressGestureRecognizer alloc] initWithWindow:webView.window]);
-
-        [_gestureRecognizer setMockNumberOfTouches:0];
</del><span class="cx">         [_webView _setTestingDelegate:self];
</span><span class="cx">     }
</span><span class="cx">     return self;
</span><span class="lines">@@ -143,18 +100,15 @@
</span><span class="cx"> 
</span><span class="cx">     _startLocation = startLocation;
</span><span class="cx">     _endLocation = endLocation;
</span><del>-    [_gestureRecognizer setMockNumberOfTouches:1];
</del><span class="cx"> 
</span><span class="cx">     if (self.externalItemProvider) {
</span><span class="cx">         _phase = DataInteractionBegan;
</span><span class="cx">         _dataInteractionInfo = adoptNS([[MockDataInteractionInfo alloc] initWithProvider:self.externalItemProvider location:startLocation window:[_webView window]]);
</span><del>-    } else
-        [self _recognizeGestureAtLocation:_startLocation withState:UIGestureRecognizerStateBegan];
</del><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     [self _scheduleAdvanceProgress];
</span><span class="cx"> 
</span><span class="cx">     Util::run(&amp;_isDoneWithCurrentRun);
</span><del>-    [_gestureRecognizer setMockNumberOfTouches:0];
</del><span class="cx">     [_webView clearMessageHandlers:dataInteractionEventNames()];
</span><span class="cx">     _finalSelectionRects = [_webView selectionRectsAfterPresentationUpdate];
</span><span class="cx"> }
</span><span class="lines">@@ -175,7 +129,6 @@
</span><span class="cx"> 
</span><span class="cx">     switch (_phase) {
</span><span class="cx">     case DataInteractionUnrecognized:
</span><del>-        [self _recognizeGestureAtLocation:self._currentLocation withState:UIGestureRecognizerStateChanged];
</del><span class="cx">         [self _scheduleAdvanceProgress];
</span><span class="cx">         break;
</span><span class="cx">     case DataInteractionBegan:
</span><span class="lines">@@ -195,7 +148,6 @@
</span><span class="cx"> - (void)_finishDataInteraction
</span><span class="cx"> {
</span><span class="cx">     if (_phase == DataInteractionUnrecognized) {
</span><del>-        [self _recognizeGestureAtLocation:self._currentLocation withState:UIGestureRecognizerStateEnded];
</del><span class="cx">         _isDoneWithCurrentRun = true;
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -219,13 +171,6 @@
</span><span class="cx">     [self performSelector:@selector(_advanceProgress) withObject:nil afterDelay:progressTimeStep];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_recognizeGestureAtLocation:(CGPoint)locationInWindow withState:(UIGestureRecognizerState)state
-{
-    [_gestureRecognizer setMockState:state];
-    [_gestureRecognizer setMockLocationInWindow:locationInWindow];
-    [_webView _simulateDataInteractionGestureRecognized];
-}
-
</del><span class="cx"> - (UIItemProvider *)externalItemProvider
</span><span class="cx"> {
</span><span class="cx">     return _externalItemProvider.get();
</span><span class="lines">@@ -238,37 +183,11 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma mark - _WKTestingDelegate
</span><span class="cx"> 
</span><del>-- (UILongPressGestureRecognizer *)dataInteractionGestureRecognizer
-{
-    return _gestureRecognizer.get();
-}
-
</del><span class="cx"> - (void)webViewDidPerformDataInteractionControllerOperation:(WKWebView *)webView
</span><span class="cx"> {
</span><span class="cx">     _isDoneWithCurrentRun = true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)webView:(WKWebView *)webView beginDataInteractionWithSourceIndex:(NSInteger)sourceIndex gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
-{
-    _didTryToBeginDataInteraction = YES;
-
-    if (self.forceRequestToFail) {
-        [_webView _simulateFailedDataInteractionWithIndex:sourceIndex];
-        return;
-    }
-
-    _phase = DataInteractionBegan;
-
-    // End the data interaction gesture recognizer.
-    auto location = self._currentLocation;
-    [self _recognizeGestureAtLocation:location withState:UIGestureRecognizerStateEnded];
-
-    // Officially begin data interaction by initializing the info.
-    NSArray *items = [_webView _simulatedItemsForDataInteractionWithIndex:sourceIndex];
-    _dataInteractionInfo = adoptNS([[MockDataInteractionInfo alloc] initWithItems:items location:location window:[_webView window]]);
-    [_webView _simulateWillBeginDataInteractionWithIndex:sourceIndex withSession:nil];
-}
-
</del><span class="cx"> - (void)webViewDidSendDataInteractionStartRequest:(WKWebView *)webView
</span><span class="cx"> {
</span><span class="cx">     // This addresses a race condition in the testing harness wherein the web process might take longer than usual to process the
</span></span></pre>
</div>
</div>

</body>
</html>