<!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>[213584] trunk/Source/WebKit2</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/213584">213584</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2017-03-08 10:33:15 -0800 (Wed, 08 Mar 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Switching focus from a UITextField to an editable WKWebView causes the keyboard to dance
https://bugs.webkit.org/show_bug.cgi?id=168932
&lt;rdar://problem/30193996&gt;

Reviewed by Beth Dakin.

When WKWebView first becomes first responder from a tap, we don't have
enough information to immediately respond accurately to various questions
from UIKit, because we haven't had time to ask the Web Content process
what is under the touch. Defer updating input views until we get a
response or lose first responder status, so that the keyboard doesn't
start transitioning to its new state until we know what that is.

There is currently no test because TestWebKitAPI has no UIApplication,
and thus cannot generate mock events.

* Platform/spi/ios/UIKitSPI.h:
* WebKit2.xcodeproj/project.pbxproj:
* UIProcess/ios/InputViewUpdateDeferrer.h: Added.
* UIProcess/ios/InputViewUpdateDeferrer.mm: Added.
Add an RAII object that defers input view updates while alive.

* UIProcess/ios/WKContentView.mm:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanupInteraction]):
(-[WKContentView _commitPotentialTapFailed]):
(-[WKContentView _didNotHandleTapAsClick:]):
(-[WKContentView _didCompleteSyntheticClick]):
(-[WKContentView _singleTapCommited:]):
(-[WKContentView _attemptClickAtLocation:]):
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
Create a InputViewUpdateDeferrer just before we become first responder
from a tap, and destroy it when we get a response (of any kind) or lose
first-responder status (or interaction is torn down).

* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didCompleteSyntheticClick):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didCompleteSyntheticClick):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::completeSyntheticClick):
Plumb an indication that the synthetic click completed, regardless of
how it was handled.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2PlatformspiiosUIKitSPIh">trunk/Source/WebKit2/Platform/spi/ios/UIKitSPI.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPageClienth">trunk/Source/WebKit2/UIProcess/PageClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxymessagesin">trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosPageClientImplIOSh">trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosPageClientImplIOSmm">trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKContentViewmm">trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm</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="#trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm">trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2UIProcessiosInputViewUpdateDeferrerh">trunk/Source/WebKit2/UIProcess/ios/InputViewUpdateDeferrer.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosInputViewUpdateDeferrermm">trunk/Source/WebKit2/UIProcess/ios/InputViewUpdateDeferrer.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (213583 => 213584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2017-03-08 18:22:56 UTC (rev 213583)
+++ trunk/Source/WebKit2/ChangeLog        2017-03-08 18:33:15 UTC (rev 213584)
</span><span class="lines">@@ -1,3 +1,54 @@
</span><ins>+2017-03-08  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        Switching focus from a UITextField to an editable WKWebView causes the keyboard to dance
+        https://bugs.webkit.org/show_bug.cgi?id=168932
+        &lt;rdar://problem/30193996&gt;
+
+        Reviewed by Beth Dakin.
+
+        When WKWebView first becomes first responder from a tap, we don't have
+        enough information to immediately respond accurately to various questions
+        from UIKit, because we haven't had time to ask the Web Content process
+        what is under the touch. Defer updating input views until we get a
+        response or lose first responder status, so that the keyboard doesn't
+        start transitioning to its new state until we know what that is.
+
+        There is currently no test because TestWebKitAPI has no UIApplication,
+        and thus cannot generate mock events.
+
+        * Platform/spi/ios/UIKitSPI.h:
+        * WebKit2.xcodeproj/project.pbxproj:
+        * UIProcess/ios/InputViewUpdateDeferrer.h: Added.
+        * UIProcess/ios/InputViewUpdateDeferrer.mm: Added.
+        Add an RAII object that defers input view updates while alive.
+
+        * UIProcess/ios/WKContentView.mm:
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView cleanupInteraction]):
+        (-[WKContentView _commitPotentialTapFailed]):
+        (-[WKContentView _didNotHandleTapAsClick:]):
+        (-[WKContentView _didCompleteSyntheticClick]):
+        (-[WKContentView _singleTapCommited:]):
+        (-[WKContentView _attemptClickAtLocation:]):
+        (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
+        Create a InputViewUpdateDeferrer just before we become first responder
+        from a tap, and destroy it when we get a response (of any kind) or lose
+        first-responder status (or interaction is torn down).
+
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::didCompleteSyntheticClick):
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::didCompleteSyntheticClick):
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::completeSyntheticClick):
+        Plumb an indication that the synthetic click completed, regardless of
+        how it was handled.
+
</ins><span class="cx"> 2017-03-08  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [WK2] Guard GLib-specific code in Module, Connection files with USE(GLIB)
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformspiiosUIKitSPIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Platform/spi/ios/UIKitSPI.h (213583 => 213584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/spi/ios/UIKitSPI.h        2017-03-08 18:22:56 UTC (rev 213583)
+++ trunk/Source/WebKit2/Platform/spi/ios/UIKitSPI.h        2017-03-08 18:33:15 UTC (rev 213584)
</span><span class="lines">@@ -864,6 +864,11 @@
</span><span class="cx"> - (CGRect)accessibilityConvertRectToSceneReferenceCoordinates:(CGRect)rect;
</span><span class="cx"> @end
</span><span class="cx"> 
</span><ins>+@interface UIPeripheralHost (IPI)
+- (void)_beginIgnoringReloadInputViews;
+- (void)_endIgnoringReloadInputViews;
+@end
+
</ins><span class="cx"> @interface UIResponder ()
</span><span class="cx"> - (UIResponder *)firstResponder;
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (213583 => 213584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/PageClient.h        2017-03-08 18:22:56 UTC (rev 213583)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h        2017-03-08 18:33:15 UTC (rev 213584)
</span><span class="lines">@@ -208,6 +208,7 @@
</span><span class="cx">     virtual WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&amp;) = 0;
</span><span class="cx">     virtual WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&amp;) = 0;
</span><span class="cx">     virtual void didNotHandleTapAsClick(const WebCore::IntPoint&amp;) = 0;
</span><ins>+    virtual void didCompleteSyntheticClick() = 0;
</ins><span class="cx"> #endif
</span><span class="cx">     
</span><span class="cx">     virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&amp;, bool wasEventHandled) = 0;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (213583 => 213584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2017-03-08 18:22:56 UTC (rev 213583)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2017-03-08 18:33:15 UTC (rev 213584)
</span><span class="lines">@@ -547,6 +547,7 @@
</span><span class="cx">     void applicationDidBecomeActive();
</span><span class="cx">     void commitPotentialTapFailed();
</span><span class="cx">     void didNotHandleTapAsClick(const WebCore::IntPoint&amp;);
</span><ins>+    void didCompleteSyntheticClick();
</ins><span class="cx">     void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID);
</span><span class="cx">     void contentSizeCategoryDidChange(const String&amp; contentSizeCategory);
</span><span class="cx">     void getSelectionContext(std::function&lt;void(const String&amp;, const String&amp;, const String&amp;, CallbackBase::Error)&gt;);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (213583 => 213584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2017-03-08 18:22:56 UTC (rev 213583)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2017-03-08 18:33:15 UTC (rev 213584)
</span><span class="lines">@@ -182,6 +182,7 @@
</span><span class="cx">     ShowPlaybackTargetPicker(bool hasVideo, WebCore::IntRect elementRect)
</span><span class="cx">     CommitPotentialTapFailed()
</span><span class="cx">     DidNotHandleTapAsClick(WebCore::IntPoint point)
</span><ins>+    DidCompleteSyntheticClick()
</ins><span class="cx">     DisableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID)
</span><span class="cx">     DrawToPDFCallback(IPC::DataReference pdfData, uint64_t callbackID)
</span><span class="cx">     SelectionRectsCallback(Vector&lt;WebCore::SelectionRect&gt; selectionRects, uint64_t callbackID);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosInputViewUpdateDeferrerh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/ios/InputViewUpdateDeferrer.h (0 => 213584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/InputViewUpdateDeferrer.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/ios/InputViewUpdateDeferrer.h        2017-03-08 18:33:15 UTC (rev 213584)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &lt;wtf/Noncopyable.h&gt;
+
+#if PLATFORM(IOS)
+
+namespace WebKit {
+
+class InputViewUpdateDeferrer {
+    WTF_MAKE_NONCOPYABLE(InputViewUpdateDeferrer);
+public:
+    InputViewUpdateDeferrer();
+    ~InputViewUpdateDeferrer();
+};
+
+}
+
+#endif // PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosInputViewUpdateDeferrermm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/ios/InputViewUpdateDeferrer.mm (0 => 213584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/InputViewUpdateDeferrer.mm                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/ios/InputViewUpdateDeferrer.mm        2017-03-08 18:33:15 UTC (rev 213584)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;InputViewUpdateDeferrer.h&quot;
+
+#if PLATFORM(IOS)
+
+#import &quot;UIKitSPI.h&quot;
+
+using namespace WebKit;
+
+namespace WebKit {
+
+InputViewUpdateDeferrer::InputViewUpdateDeferrer()
+{
+    [[UIPeripheralHost sharedInstance] _beginIgnoringReloadInputViews];
+}
+
+InputViewUpdateDeferrer::~InputViewUpdateDeferrer()
+{
+    [[UIPeripheralHost sharedInstance] _endIgnoringReloadInputViews];
+}
+    
+}
+
+#endif // PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h (213583 => 213584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2017-03-08 18:22:56 UTC (rev 213583)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2017-03-08 18:33:15 UTC (rev 213584)
</span><span class="lines">@@ -184,6 +184,7 @@
</span><span class="cx">     void didFailLoadForMainFrame() override;
</span><span class="cx">     void didSameDocumentNavigationForMainFrame(SameDocumentNavigationType) override;
</span><span class="cx">     void didNotHandleTapAsClick(const WebCore::IntPoint&amp;) override;
</span><ins>+    void didCompleteSyntheticClick() override;
</ins><span class="cx"> 
</span><span class="cx">     void didChangeBackgroundColor() override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm (213583 => 213584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2017-03-08 18:22:56 UTC (rev 213583)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2017-03-08 18:33:15 UTC (rev 213584)
</span><span class="lines">@@ -221,6 +221,11 @@
</span><span class="cx"> {
</span><span class="cx">     [m_contentView _didNotHandleTapAsClick:point];
</span><span class="cx"> }
</span><ins>+    
+void PageClientImpl::didCompleteSyntheticClick()
+{
+    [m_contentView _didCompleteSyntheticClick];
+}
</ins><span class="cx"> 
</span><span class="cx"> bool PageClientImpl::decidePolicyForGeolocationPermissionRequest(WebFrameProxy&amp; frame, API::SecurityOrigin&amp; origin, GeolocationPermissionRequestProxy&amp; request)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm (213583 => 213584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm        2017-03-08 18:22:56 UTC (rev 213583)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm        2017-03-08 18:33:15 UTC (rev 213584)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #import &quot;APIPageConfiguration.h&quot;
</span><span class="cx"> #import &quot;AccessibilityIOS.h&quot;
</span><span class="cx"> #import &quot;ApplicationStateTracker.h&quot;
</span><ins>+#import &quot;InputViewUpdateDeferrer.h&quot;
</ins><span class="cx"> #import &quot;Logging.h&quot;
</span><span class="cx"> #import &quot;PageClientImplIOS.h&quot;
</span><span class="cx"> #import &quot;PrintInfo.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewInteractionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h (213583 => 213584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h        2017-03-08 18:22:56 UTC (rev 213583)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h        2017-03-08 18:33:15 UTC (rev 213584)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><ins>+class InputViewUpdateDeferrer;
</ins><span class="cx"> class NativeWebTouchEvent;
</span><span class="cx"> class SmartMagnificationController;
</span><span class="cx"> class WebOpenPanelResultListenerProxy;
</span><span class="lines">@@ -165,6 +166,8 @@
</span><span class="cx">     WebKit::WKSelectionDrawingInfo _lastSelectionDrawingInfo;
</span><span class="cx"> 
</span><span class="cx">     std::optional&lt;WebKit::InteractionInformationRequest&gt; _outstandingPositionInformationRequest;
</span><ins>+    
+    std::unique_ptr&lt;WebKit::InputViewUpdateDeferrer&gt; _inputViewUpdateDeferrer;
</ins><span class="cx"> 
</span><span class="cx">     BOOL _isEditable;
</span><span class="cx">     BOOL _showingTextStyleOptions;
</span><span class="lines">@@ -241,6 +244,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> - (void)_commitPotentialTapFailed;
</span><span class="cx"> - (void)_didNotHandleTapAsClick:(const WebCore::IntPoint&amp;)point;
</span><ins>+- (void)_didCompleteSyntheticClick;
</ins><span class="cx"> - (void)_didGetTapHighlightForRequest:(uint64_t)requestID color:(const WebCore::Color&amp;)color quads:(const Vector&lt;WebCore::FloatQuad&gt;&amp;)highlightedQuads topLeftRadius:(const WebCore::IntSize&amp;)topLeftRadius topRightRadius:(const WebCore::IntSize&amp;)topRightRadius bottomLeftRadius:(const WebCore::IntSize&amp;)bottomLeftRadius bottomRightRadius:(const WebCore::IntSize&amp;)bottomRightRadius;
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)_mayDisableDoubleTapGesturesDuringSingleTap;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewInteractionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (213583 => 213584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2017-03-08 18:22:56 UTC (rev 213583)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2017-03-08 18:33:15 UTC (rev 213584)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> #import &quot;APIUIClient.h&quot;
</span><span class="cx"> #import &quot;EditingRange.h&quot;
</span><ins>+#import &quot;InputViewUpdateDeferrer.h&quot;
</ins><span class="cx"> #import &quot;Logging.h&quot;
</span><span class="cx"> #import &quot;ManagedConfigurationSPI.h&quot;
</span><span class="cx"> #import &quot;NativeWebKeyboardEvent.h&quot;
</span><span class="lines">@@ -658,6 +659,8 @@
</span><span class="cx">         [_fileUploadPanel dismiss];
</span><span class="cx">         _fileUploadPanel = nil;
</span><span class="cx">     }
</span><ins>+    
+    _inputViewUpdateDeferrer = nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_removeDefaultGestureRecognizers
</span><span class="lines">@@ -851,6 +854,8 @@
</span><span class="cx">     [self _cancelInteraction];
</span><span class="cx">     [_webSelectionAssistant resignedFirstResponder];
</span><span class="cx">     [_textSelectionAssistant deactivateSelection];
</span><ins>+    
+    _inputViewUpdateDeferrer = nullptr;
</ins><span class="cx"> 
</span><span class="cx">     bool superDidResign = [super resignFirstResponder];
</span><span class="cx"> 
</span><span class="lines">@@ -1593,10 +1598,14 @@
</span><span class="cx"> - (void)_commitPotentialTapFailed
</span><span class="cx"> {
</span><span class="cx">     [self _cancelInteraction];
</span><ins>+    
+    _inputViewUpdateDeferrer = nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_didNotHandleTapAsClick:(const WebCore::IntPoint&amp;)point
</span><span class="cx"> {
</span><ins>+    _inputViewUpdateDeferrer = nullptr;
+
</ins><span class="cx">     // FIXME: we should also take into account whether or not the UI delegate
</span><span class="cx">     // has handled this notification.
</span><span class="cx">     if (_hasValidPositionInformation &amp;&amp; point == _positionInformation.request.point &amp;&amp; _positionInformation.isDataDetectorLink) {
</span><span class="lines">@@ -1611,12 +1620,20 @@
</span><span class="cx">     _isDoubleTapPending = NO;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_didCompleteSyntheticClick
+{
+    _inputViewUpdateDeferrer = nullptr;
+}
+
</ins><span class="cx"> - (void)_singleTapCommited:(UITapGestureRecognizer *)gestureRecognizer
</span><span class="cx"> {
</span><span class="cx">     ASSERT(gestureRecognizer == _singleTapGestureRecognizer);
</span><span class="cx"> 
</span><del>-    if (![self isFirstResponder])
</del><ins>+    if (![self isFirstResponder]) {
+        if (!_inputViewUpdateDeferrer)
+            _inputViewUpdateDeferrer = std::make_unique&lt;InputViewUpdateDeferrer&gt;();
</ins><span class="cx">         [self becomeFirstResponder];
</span><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     if (_webSelectionAssistant &amp;&amp; ![_webSelectionAssistant shouldHandleSingleTapAtPoint:gestureRecognizer.location]) {
</span><span class="cx">         [self _singleTapDidReset:gestureRecognizer];
</span><span class="lines">@@ -1676,8 +1693,11 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_attemptClickAtLocation:(CGPoint)location
</span><span class="cx"> {
</span><del>-    if (![self isFirstResponder])
</del><ins>+    if (![self isFirstResponder]) {
+        if (!_inputViewUpdateDeferrer)
+            _inputViewUpdateDeferrer = std::make_unique&lt;InputViewUpdateDeferrer&gt;();
</ins><span class="cx">         [self becomeFirstResponder];
</span><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     [_inputPeripheral endEditing];
</span><span class="cx">     _page-&gt;handleTap(location, _layerTreeTransactionIdAtLastTouchStart);
</span><span class="lines">@@ -3734,6 +3754,8 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_startAssistingNode:(const AssistedNodeInformation&amp;)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode userObject:(NSObject &lt;NSSecureCoding&gt; *)userObject
</span><span class="cx"> {
</span><ins>+    _inputViewUpdateDeferrer = nullptr;
+
</ins><span class="cx">     id &lt;_WKInputDelegate&gt; inputDelegate = [_webView _inputDelegate];
</span><span class="cx">     RetainPtr&lt;WKFocusedElementInfo&gt; focusedElementInfo = adoptNS([[WKFocusedElementInfo alloc] initWithAssistedNodeInformation:information isUserInitiated:userIsInteracting]);
</span><span class="cx">     BOOL shouldShowKeyboard;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (213583 => 213584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2017-03-08 18:22:56 UTC (rev 213583)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2017-03-08 18:33:15 UTC (rev 213584)
</span><span class="lines">@@ -1038,6 +1038,11 @@
</span><span class="cx">     m_pageClient.didNotHandleTapAsClick(point);
</span><span class="cx">     m_uiClient-&gt;didNotHandleTapAsClick(point);
</span><span class="cx"> }
</span><ins>+    
+void WebPageProxy::didCompleteSyntheticClick()
+{
+    m_pageClient.didCompleteSyntheticClick();
+}
</ins><span class="cx"> 
</span><span class="cx"> void WebPageProxy::disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (213583 => 213584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2017-03-08 18:22:56 UTC (rev 213583)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2017-03-08 18:33:15 UTC (rev 213584)
</span><span class="lines">@@ -697,6 +697,8 @@
</span><span class="cx">                 2DC6D9C418C44A610043BAD4 /* WKWebViewContentProviderRegistry.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DC6D9C218C44A610043BAD4 /* WKWebViewContentProviderRegistry.mm */; };
</span><span class="cx">                 2DD12A081A8177F3002C74E6 /* WKPageRenderingProgressEvents.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DD12A071A8177F3002C74E6 /* WKPageRenderingProgressEvents.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2DD13BD518F7DADD00E130A1 /* FindControllerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DD13BD318F7DADD00E130A1 /* FindControllerIOS.mm */; };
</span><ins>+                2DD45ADE1E5F8972006C355F /* InputViewUpdateDeferrer.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DD45ADC1E5F8972006C355F /* InputViewUpdateDeferrer.h */; };
+                2DD45ADF1E5F8972006C355F /* InputViewUpdateDeferrer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DD45ADD1E5F8972006C355F /* InputViewUpdateDeferrer.mm */; };
</ins><span class="cx">                 2DD67A2E1BD819730053B251 /* APIFindMatchesClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DD67A2D1BD819730053B251 /* APIFindMatchesClient.h */; };
</span><span class="cx">                 2DD67A351BD861060053B251 /* WKTextFinderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DD67A331BD861060053B251 /* WKTextFinderClient.h */; };
</span><span class="cx">                 2DD67A361BD861060053B251 /* WKTextFinderClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DD67A341BD861060053B251 /* WKTextFinderClient.mm */; };
</span><span class="lines">@@ -2862,6 +2864,8 @@
</span><span class="cx">                 2DC6D9C218C44A610043BAD4 /* WKWebViewContentProviderRegistry.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebViewContentProviderRegistry.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2DD12A071A8177F3002C74E6 /* WKPageRenderingProgressEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPageRenderingProgressEvents.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2DD13BD318F7DADD00E130A1 /* FindControllerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = FindControllerIOS.mm; path = ios/FindControllerIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                2DD45ADC1E5F8972006C355F /* InputViewUpdateDeferrer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InputViewUpdateDeferrer.h; path = ios/InputViewUpdateDeferrer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2DD45ADD1E5F8972006C355F /* InputViewUpdateDeferrer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = InputViewUpdateDeferrer.mm; path = ios/InputViewUpdateDeferrer.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 2DD67A2D1BD819730053B251 /* APIFindMatchesClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIFindMatchesClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2DD67A331BD861060053B251 /* WKTextFinderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKTextFinderClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2DD67A341BD861060053B251 /* WKTextFinderClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKTextFinderClient.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5247,6 +5251,8 @@
</span><span class="cx">                                 A19DD3BF1D07D16800AC823B /* _WKWebViewPrintFormatterInternal.h */,
</span><span class="cx">                                 1AD4C1911B39F33200ABC28E /* ApplicationStateTracker.h */,
</span><span class="cx">                                 1AD4C1901B39F33200ABC28E /* ApplicationStateTracker.mm */,
</span><ins>+                                2DD45ADC1E5F8972006C355F /* InputViewUpdateDeferrer.h */,
+                                2DD45ADD1E5F8972006C355F /* InputViewUpdateDeferrer.mm */,
</ins><span class="cx">                                 0F0C365D18C110A500F607D7 /* LayerRepresentation.mm */,
</span><span class="cx">                                 0FCB4E3618BBE044000FCFC9 /* PageClientImplIOS.h */,
</span><span class="cx">                                 0FCB4E3718BBE044000FCFC9 /* PageClientImplIOS.mm */,
</span><span class="lines">@@ -8813,6 +8819,7 @@
</span><span class="cx">                                 7CD5EBBF1746B04C000C1C45 /* WKTypeRefWrapper.h in Headers */,
</span><span class="cx">                                 1AD8790A18B6C38A006CAFD7 /* WKUIDelegate.h in Headers */,
</span><span class="cx">                                 3743925818BC4C60001C8675 /* WKUIDelegatePrivate.h in Headers */,
</span><ins>+                                2DD45ADE1E5F8972006C355F /* InputViewUpdateDeferrer.h in Headers */,
</ins><span class="cx">                                 BC40760A124FF0270068F20A /* WKURL.h in Headers */,
</span><span class="cx">                                 BC40761C124FF0370068F20A /* WKURLCF.h in Headers */,
</span><span class="cx">                                 BC40760C124FF0270068F20A /* WKURLRequest.h in Headers */,
</span><span class="lines">@@ -9678,6 +9685,7 @@
</span><span class="cx">                                 C02BFF1E1251502E009CCBEA /* NativeWebKeyboardEventMac.mm in Sources */,
</span><span class="cx">                                 31EA25D2134F78C0005B1452 /* NativeWebMouseEventMac.mm in Sources */,
</span><span class="cx">                                 2DA9449F1884E4F000ED86DB /* NativeWebTouchEventIOS.mm in Sources */,
</span><ins>+                                2DD45ADF1E5F8972006C355F /* InputViewUpdateDeferrer.mm in Sources */,
</ins><span class="cx">                                 DF58C6361371ACA000F9A37C /* NativeWebWheelEventMac.mm in Sources */,
</span><span class="cx">                                 1ADCB86A189831B30022EE5A /* NavigationActionData.cpp in Sources */,
</span><span class="cx">                                 1ABC3DF51899E437004F0626 /* NavigationState.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (213583 => 213584)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2017-03-08 18:22:56 UTC (rev 213583)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2017-03-08 18:33:15 UTC (rev 213584)
</span><span class="lines">@@ -621,6 +621,8 @@
</span><span class="cx"> 
</span><span class="cx">     if (!tapWasHandled || !nodeRespondingToClick || !nodeRespondingToClick-&gt;isElementNode())
</span><span class="cx">         send(Messages::WebPageProxy::DidNotHandleTapAsClick(roundedIntPoint(location)));
</span><ins>+    
+    send(Messages::WebPageProxy::DidCompleteSyntheticClick());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPage::handleTap(const IntPoint&amp; point, uint64_t lastLayerTreeTransactionId)
</span></span></pre>
</div>
</div>

</body>
</html>