<!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>[212898] 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/212898">212898</a></dd>
<dt>Author</dt> <dd>wenson_hsieh@apple.com</dd>
<dt>Date</dt> <dd>2017-02-23 09:23:51 -0800 (Thu, 23 Feb 2017)</dd>
</dl>
<h3>Log Message</h3>
<pre>Data interaction causes selection to fall out of sync between web/UI processes
https://bugs.webkit.org/show_bug.cgi?id=168735
<rdar://problem/30657817>
Reviewed by Tim Horton.
Source/WebKit2:
Fixes a bug with data interaction causing selection state to fall out of sync between the UI and web processes,
and also introduces testing infrastructure and tests for grabbing UI-side selection view rects in TestWebKitAPI.
While performing a data interaction operation, we now lift restrictions for assisting the focused node.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanupInteraction]):
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
Tools:
Adds a new method to TestWKWebView for querying selection view rects from the UI process and augments data
interaction unit tests to check for selection rects using this new hook.
* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
(makeCGRectValue):
(TestWebKitAPI::TEST):
* TestWebKitAPI/cocoa/TestWKWebView.h:
* TestWebKitAPI/cocoa/TestWKWebView.mm:
(-[TestWKWebView selectionRectsAfterPresentationUpdate]):
* TestWebKitAPI/ios/DataInteractionSimulator.h:
* TestWebKitAPI/ios/DataInteractionSimulator.mm:
(-[DataInteractionSimulator _resetSimulatedState]):
(-[DataInteractionSimulator runFrom:to:]):
(-[DataInteractionSimulator finalSelectionRects]):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</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="#trunkToolsTestWebKitAPITestsiosDataInteractionTestsmm">trunk/Tools/TestWebKitAPI/Tests/ios/DataInteractionTests.mm</a></li>
<li><a href="#trunkToolsTestWebKitAPIcocoaTestWKWebViewh">trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.h</a></li>
<li><a href="#trunkToolsTestWebKitAPIcocoaTestWKWebViewmm">trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.mm</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 (212897 => 212898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2017-02-23 16:58:26 UTC (rev 212897)
+++ trunk/Source/WebKit2/ChangeLog        2017-02-23 17:23:51 UTC (rev 212898)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2017-02-22 Wenson Hsieh <wenson_hsieh@apple.com>
+
+ Data interaction causes selection to fall out of sync between web/UI processes
+ https://bugs.webkit.org/show_bug.cgi?id=168735
+ <rdar://problem/30657817>
+
+ Reviewed by Tim Horton.
+
+ Fixes a bug with data interaction causing selection state to fall out of sync between the UI and web processes,
+ and also introduces testing infrastructure and tests for grabbing UI-side selection view rects in TestWebKitAPI.
+ While performing a data interaction operation, we now lift restrictions for assisting the focused node.
+
+ * UIProcess/ios/WKContentViewInteraction.h:
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView cleanupInteraction]):
+ (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
+
</ins><span class="cx"> 2017-02-23 Carlos Garcia Campos <cgarcia@igalia.com>
</span><span class="cx">
</span><span class="cx"> [GTK] Crash attempting to load Flash plugin in Wayland
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewInteractionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h (212897 => 212898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h        2017-02-23 16:58:26 UTC (rev 212897)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h        2017-02-23 17:23:51 UTC (rev 212898)
</span><span class="lines">@@ -190,6 +190,7 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(DATA_INTERACTION)
</span><span class="cx"> WebKit::WKDataInteractionState _dataInteractionState;
</span><ins>+ BOOL _isPerformingDataInteractionOperation;
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewInteractionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (212897 => 212898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2017-02-23 16:58:26 UTC (rev 212897)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2017-02-23 17:23:51 UTC (rev 212898)
</span><span class="lines">@@ -645,6 +645,7 @@
</span><span class="cx"> [_dataInteractionGestureRecognizer setDelegate:nil];
</span><span class="cx"> [self removeGestureRecognizer:_dataInteractionGestureRecognizer.get()];
</span><span class="cx"> [self teardownDataInteractionDelegates];
</span><ins>+ _isPerformingDataInteractionOperation = NO;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> _inspectorNodeSearchEnabled = NO;
</span><span class="lines">@@ -3773,6 +3774,9 @@
</span><span class="cx"> else {
</span><span class="cx"> // The default behavior is to allow node assistance if the user is interacting or the keyboard is already active.
</span><span class="cx"> shouldShowKeyboard = userIsInteracting || _textSelectionAssistant;
</span><ins>+#if ENABLE(DATA_INTERACTION)
+ shouldShowKeyboard |= _isPerformingDataInteractionOperation;
+#endif
</ins><span class="cx"> }
</span><span class="cx"> if (!shouldShowKeyboard)
</span><span class="cx"> return;
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (212897 => 212898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2017-02-23 16:58:26 UTC (rev 212897)
+++ trunk/Tools/ChangeLog        2017-02-23 17:23:51 UTC (rev 212898)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2017-02-22 Wenson Hsieh <wenson_hsieh@apple.com>
+
+ Data interaction causes selection to fall out of sync between web/UI processes
+ https://bugs.webkit.org/show_bug.cgi?id=168735
+ <rdar://problem/30657817>
+
+ Reviewed by Tim Horton.
+
+ Adds a new method to TestWKWebView for querying selection view rects from the UI process and augments data
+ interaction unit tests to check for selection rects using this new hook.
+
+ * TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
+ (makeCGRectValue):
+ (TestWebKitAPI::TEST):
+ * TestWebKitAPI/cocoa/TestWKWebView.h:
+ * TestWebKitAPI/cocoa/TestWKWebView.mm:
+ (-[TestWKWebView selectionRectsAfterPresentationUpdate]):
+ * TestWebKitAPI/ios/DataInteractionSimulator.h:
+ * TestWebKitAPI/ios/DataInteractionSimulator.mm:
+ (-[DataInteractionSimulator _resetSimulatedState]):
+ (-[DataInteractionSimulator runFrom:to:]):
+ (-[DataInteractionSimulator finalSelectionRects]):
+
</ins><span class="cx"> 2017-02-22 Carlos Garcia Campos <cgarcia@igalia.com>
</span><span class="cx">
</span><span class="cx"> Better handle Thread and RunLoop initialization
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsiosDataInteractionTestsmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/ios/DataInteractionTests.mm (212897 => 212898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/ios/DataInteractionTests.mm        2017-02-23 16:58:26 UTC (rev 212897)
+++ trunk/Tools/TestWebKitAPI/Tests/ios/DataInteractionTests.mm        2017-02-23 17:23:51 UTC (rev 212898)
</span><span class="lines">@@ -47,6 +47,11 @@
</span><span class="cx">
</span><span class="cx"> @end
</span><span class="cx">
</span><ins>+static NSValue *makeCGRectValue(CGFloat x, CGFloat y, CGFloat width, CGFloat height)
+{
+ return [NSValue valueWithCGRect:CGRectMake(x, y, width, height)];
+}
+
</ins><span class="cx"> namespace TestWebKitAPI {
</span><span class="cx">
</span><span class="cx"> TEST(DataInteractionTests, ImageToContentEditable)
</span><span class="lines">@@ -63,6 +68,7 @@
</span><span class="cx"> EXPECT_TRUE([observedEventNames containsObject:DataInteractionEnterEventName]);
</span><span class="cx"> EXPECT_TRUE([observedEventNames containsObject:DataInteractionOverEventName]);
</span><span class="cx"> EXPECT_TRUE([observedEventNames containsObject:DataInteractionPerformOperationEventName]);
</span><ins>+ EXPECT_TRUE([[dataInteractionSimulator finalSelectionRects] isEqualToArray:@[ makeCGRectValue(1, 201, 215, 174) ]]);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> TEST(DataInteractionTests, ImageToTextarea)
</span><span class="lines">@@ -81,6 +87,9 @@
</span><span class="cx"> EXPECT_TRUE([observedEventNames containsObject:DataInteractionEnterEventName]);
</span><span class="cx"> EXPECT_TRUE([observedEventNames containsObject:DataInteractionOverEventName]);
</span><span class="cx"> EXPECT_TRUE([observedEventNames containsObject:DataInteractionPerformOperationEventName]);
</span><ins>+
+ NSArray *expectedSelectionRects = [NSArray arrayWithObjects:makeCGRectValue(6, 203, 188, 14), makeCGRectValue(6, 217, 188, 14), makeCGRectValue(6, 231, 66, 14), nil];
+ EXPECT_TRUE([[dataInteractionSimulator finalSelectionRects] isEqualToArray:expectedSelectionRects]);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> TEST(DataInteractionTests, ContentEditableToContentEditable)
</span><span class="lines">@@ -99,6 +108,7 @@
</span><span class="cx"> EXPECT_TRUE([observedEventNames containsObject:DataInteractionEnterEventName]);
</span><span class="cx"> EXPECT_TRUE([observedEventNames containsObject:DataInteractionOverEventName]);
</span><span class="cx"> EXPECT_TRUE([observedEventNames containsObject:DataInteractionPerformOperationEventName]);
</span><ins>+ EXPECT_TRUE([[dataInteractionSimulator finalSelectionRects] isEqualToArray:@[ makeCGRectValue(1, 201, 961, 227) ]]);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> TEST(DataInteractionTests, ContentEditableToTextarea)
</span><span class="lines">@@ -117,6 +127,7 @@
</span><span class="cx"> EXPECT_TRUE([observedEventNames containsObject:DataInteractionEnterEventName]);
</span><span class="cx"> EXPECT_TRUE([observedEventNames containsObject:DataInteractionOverEventName]);
</span><span class="cx"> EXPECT_TRUE([observedEventNames containsObject:DataInteractionPerformOperationEventName]);
</span><ins>+ EXPECT_TRUE([[dataInteractionSimulator finalSelectionRects] isEqualToArray:@[ makeCGRectValue(6, 203, 990, 232) ]]);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> TEST(DataInteractionTests, LinkToInput)
</span><span class="lines">@@ -134,6 +145,7 @@
</span><span class="cx"> EXPECT_TRUE([observedEventNames containsObject:DataInteractionEnterEventName]);
</span><span class="cx"> EXPECT_TRUE([observedEventNames containsObject:DataInteractionOverEventName]);
</span><span class="cx"> EXPECT_TRUE([observedEventNames containsObject:DataInteractionPerformOperationEventName]);
</span><ins>+ EXPECT_TRUE([[dataInteractionSimulator finalSelectionRects] isEqualToArray:@[ makeCGRectValue(101, 273, 2613, 232) ]]);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> TEST(DataInteractionTests, BackgroundImageLinkToInput)
</span><span class="lines">@@ -151,6 +163,7 @@
</span><span class="cx"> EXPECT_TRUE([observedEventNames containsObject:DataInteractionEnterEventName]);
</span><span class="cx"> EXPECT_TRUE([observedEventNames containsObject:DataInteractionOverEventName]);
</span><span class="cx"> EXPECT_TRUE([observedEventNames containsObject:DataInteractionPerformOperationEventName]);
</span><ins>+ EXPECT_TRUE([[dataInteractionSimulator finalSelectionRects] isEqualToArray:@[ makeCGRectValue(101, 241, 2613, 232) ]]);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> TEST(DataInteractionTests, CanPreventStart)
</span><span class="lines">@@ -167,6 +180,7 @@
</span><span class="cx"> NSArray *observedEventNames = [dataInteractionSimulator observedEventNames];
</span><span class="cx"> EXPECT_FALSE([observedEventNames containsObject:DataInteractionEnterEventName]);
</span><span class="cx"> EXPECT_FALSE([observedEventNames containsObject:DataInteractionOverEventName]);
</span><ins>+ EXPECT_TRUE([[dataInteractionSimulator finalSelectionRects] isEqualToArray:@[ ]]);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> TEST(DataInteractionTests, CanPreventOperation)
</span><span class="lines">@@ -183,6 +197,7 @@
</span><span class="cx"> NSArray *observedEventNames = [dataInteractionSimulator observedEventNames];
</span><span class="cx"> EXPECT_TRUE([observedEventNames containsObject:DataInteractionEnterEventName]);
</span><span class="cx"> EXPECT_TRUE([observedEventNames containsObject:DataInteractionOverEventName]);
</span><ins>+ EXPECT_TRUE([[dataInteractionSimulator finalSelectionRects] isEqualToArray:@[ ]]);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> TEST(DataInteractionTests, EnterAndLeaveEvents)
</span><span class="lines">@@ -201,6 +216,7 @@
</span><span class="cx"> EXPECT_TRUE([observedEventNames containsObject:DataInteractionOverEventName]);
</span><span class="cx"> EXPECT_TRUE([observedEventNames containsObject:DataInteractionLeaveEventName]);
</span><span class="cx"> EXPECT_FALSE([observedEventNames containsObject:DataInteractionPerformOperationEventName]);
</span><ins>+ EXPECT_TRUE([[dataInteractionSimulator finalSelectionRects] isEqualToArray:@[ ]]);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> TEST(DataInteractionTests, HandlesDataInteractionFailureGracefully)
</span><span class="lines">@@ -235,6 +251,7 @@
</span><span class="cx"> [dataInteractionSimulator setExternalItemProvider:simulatedItemProvider.get()];
</span><span class="cx"> [dataInteractionSimulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
</span><span class="cx"> EXPECT_WK_STREQ(textPayload.UTF8String, [webView stringByEvaluatingJavaScript:@"editor.textContent"].UTF8String);
</span><ins>+ EXPECT_TRUE([[dataInteractionSimulator finalSelectionRects] isEqualToArray:@[ makeCGRectValue(1, 201, 1936, 227) ]]);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> TEST(DataInteractionTests, ExternalSourceJPEGOnly)
</span><span class="lines">@@ -253,6 +270,7 @@
</span><span class="cx"> [dataInteractionSimulator setExternalItemProvider:simulatedItemProvider.get()];
</span><span class="cx"> [dataInteractionSimulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)];
</span><span class="cx"> EXPECT_TRUE([webView editorContainsImageElement]);
</span><ins>+ EXPECT_TRUE([[dataInteractionSimulator finalSelectionRects] isEqualToArray:@[ makeCGRectValue(1, 201, 215, 174) ]]);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace TestWebKitAPI
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIcocoaTestWKWebViewh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.h (212897 => 212898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.h        2017-02-23 16:58:26 UTC (rev 212897)
+++ trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.h        2017-02-23 17:23:51 UTC (rev 212898)
</span><span class="lines">@@ -24,6 +24,7 @@
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> #import <WebKit/WebKit.h>
</span><ins>+#import <wtf/RetainPtr.h>
</ins><span class="cx">
</span><span class="cx"> #if WK_API_ENABLED
</span><span class="cx">
</span><span class="lines">@@ -41,6 +42,12 @@
</span><span class="cx"> - (void)performAfterLoading:(dispatch_block_t)actions;
</span><span class="cx"> @end
</span><span class="cx">
</span><ins>+#if PLATFORM(IOS)
+@interface TestWKWebView (IOSOnly)
+@property (nonatomic, readonly) RetainPtr<NSArray> selectionRectsAfterPresentationUpdate;
+@end
+#endif
+
</ins><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> @interface TestWKWebView (MacOnly)
</span><span class="cx"> // Simulates clicking with a pressure-sensitive device, if possible.
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIcocoaTestWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.mm (212897 => 212898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.mm        2017-02-23 16:58:26 UTC (rev 212897)
+++ trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.mm        2017-02-23 17:23:51 UTC (rev 212898)
</span><span class="lines">@@ -259,6 +259,29 @@
</span><span class="cx">
</span><span class="cx"> @end
</span><span class="cx">
</span><ins>+#if PLATFORM(IOS)
+
+@implementation TestWKWebView (IOSOnly)
+
+- (RetainPtr<NSArray>)selectionRectsAfterPresentationUpdate
+{
+ RetainPtr<TestWKWebView> retainedSelf = self;
+
+ __block bool isDone = false;
+ __block RetainPtr<NSArray> selectionRects;
+ [self _doAfterNextPresentationUpdate:^() {
+ selectionRects = adoptNS([[retainedSelf _uiTextSelectionRects] retain]);
+ isDone = true;
+ }];
+
+ TestWebKitAPI::Util::run(&isDone);
+ return selectionRects;
+}
+
+@end
+
+#endif
+
</ins><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> @implementation TestWKWebView (MacOnly)
</span><span class="cx"> - (void)mouseDownAtPoint:(NSPoint)point simulatePressure:(BOOL)simulatePressure
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIiosDataInteractionSimulatorh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/ios/DataInteractionSimulator.h (212897 => 212898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/ios/DataInteractionSimulator.h        2017-02-23 16:58:26 UTC (rev 212897)
+++ trunk/Tools/TestWebKitAPI/ios/DataInteractionSimulator.h        2017-02-23 17:23:51 UTC (rev 212898)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx"> RetainPtr<MockDataInteractionInfo> _dataInteractionInfo;
</span><span class="cx"> RetainPtr<NSMutableArray> _observedEventNames;
</span><span class="cx"> RetainPtr<UIItemProvider> _externalItemProvider;
</span><ins>+ RetainPtr<NSArray *> _finalSelectionRects;
</ins><span class="cx"> CGPoint _startLocation;
</span><span class="cx"> CGPoint _endLocation;
</span><span class="cx">
</span><span class="lines">@@ -68,6 +69,7 @@
</span><span class="cx"> @property (nonatomic, strong) UIItemProvider *externalItemProvider;
</span><span class="cx"> @property (nonatomic, readonly) BOOL didTryToBeginDataInteraction;
</span><span class="cx"> @property (nonatomic, readonly) NSArray *observedEventNames;
</span><ins>+@property (nonatomic, readonly) NSArray *finalSelectionRects;
</ins><span class="cx">
</span><span class="cx"> @end
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIiosDataInteractionSimulatormm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/ios/DataInteractionSimulator.mm (212897 => 212898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/ios/DataInteractionSimulator.mm        2017-02-23 16:58:26 UTC (rev 212897)
+++ trunk/Tools/TestWebKitAPI/ios/DataInteractionSimulator.mm        2017-02-23 17:23:51 UTC (rev 212898)
</span><span class="lines">@@ -121,6 +121,7 @@
</span><span class="cx"> _isDoneWithCurrentRun = false;
</span><span class="cx"> _didTryToBeginDataInteraction = NO;
</span><span class="cx"> _observedEventNames = adoptNS([[NSMutableArray alloc] init]);
</span><ins>+ _finalSelectionRects = @[ ];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (NSArray *)observedEventNames
</span><span class="lines">@@ -155,8 +156,14 @@
</span><span class="cx"> Util::run(&_isDoneWithCurrentRun);
</span><span class="cx"> [_gestureRecognizer setMockNumberOfTouches:0];
</span><span class="cx"> [_webView clearMessageHandlers:dataInteractionEventNames()];
</span><ins>+ _finalSelectionRects = [_webView selectionRectsAfterPresentationUpdate];
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+- (NSArray *)finalSelectionRects
+{
+ return _finalSelectionRects.get();
+}
+
</ins><span class="cx"> - (void)_advanceProgress
</span><span class="cx"> {
</span><span class="cx"> _gestureProgress = std::min(1.0, std::max(0.0, progressIncrementStep + _gestureProgress));
</span></span></pre>
</div>
</div>
</body>
</html>