<!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>[169294] 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/169294">169294</a></dd>
<dt>Author</dt> <dd>enrica@apple.com</dd>
<dt>Date</dt> <dd>2014-05-23 17:18:32 -0700 (Fri, 23 May 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>REGRESSION (WebKit2): Keyboard disappears/appears automatically between text boxes.
https://bugs.webkit.org/show_bug.cgi?id=133243
&lt;rdar://problem/16761913&gt;

Reviewed by Benjamin Poulain.

We need to ensure that when an element loses focus and another one gets it,
this is handled in one single message in the UI process to avoid seeing
the keyboard animating in and out.
This is accomplished by always postponing the blur notification until all events
have been processed.
If a new node is focused before the delayed blur notification is sent to the UI
process, the message we send includes both blur and focus notification. In this case,
the postponed blur notification is not sent.

* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::startAssistingNode):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
(-[WKContentView _startAssistingNode:userIsInteracting:userObject:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::startAssistingNode):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::elementDidFocus):
(WebKit::WebPage::elementDidBlur):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</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="#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="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (169293 => 169294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-05-24 00:13:43 UTC (rev 169293)
+++ trunk/Source/WebKit2/ChangeLog        2014-05-24 00:18:32 UTC (rev 169294)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2014-05-23  Enrica Casucci  &lt;enrica@apple.com&gt;
+
+        REGRESSION (WebKit2): Keyboard disappears/appears automatically between text boxes.
+        https://bugs.webkit.org/show_bug.cgi?id=133243
+        &lt;rdar://problem/16761913&gt;
+
+        Reviewed by Benjamin Poulain.
+
+        We need to ensure that when an element loses focus and another one gets it,
+        this is handled in one single message in the UI process to avoid seeing
+        the keyboard animating in and out.
+        This is accomplished by always postponing the blur notification until all events
+        have been processed.
+        If a new node is focused before the delayed blur notification is sent to the UI
+        process, the message we send includes both blur and focus notification. In this case,
+        the postponed blur notification is not sent.
+
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::startAssistingNode):
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
+        (-[WKContentView _startAssistingNode:userIsInteracting:userObject:]): Deleted.
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::startAssistingNode):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::WebPage):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::elementDidFocus):
+        (WebKit::WebPage::elementDidBlur):
+
</ins><span class="cx"> 2014-05-23  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove an assertion.
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (169293 => 169294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/PageClient.h        2014-05-24 00:13:43 UTC (rev 169293)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h        2014-05-24 00:18:32 UTC (rev 169294)
</span><span class="lines">@@ -247,7 +247,7 @@
</span><span class="cx">     virtual void didCommitLayerTree(const RemoteLayerTreeTransaction&amp;) = 0;
</span><span class="cx">     virtual void dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint&amp; newScrollPosition) = 0;
</span><span class="cx"> 
</span><del>-    virtual void startAssistingNode(const AssistedNodeInformation&amp;, bool userIsInteracting, API::Object* userData) = 0;
</del><ins>+    virtual void startAssistingNode(const AssistedNodeInformation&amp;, bool userIsInteracting, bool blurPreviousNode, API::Object* userData) = 0;
</ins><span class="cx">     virtual void stopAssistingNode() = 0;
</span><span class="cx">     virtual void selectionDidChange() = 0;
</span><span class="cx">     virtual bool interpretKeyEvent(const NativeWebKeyboardEvent&amp;, bool isCharEvent) = 0;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (169293 => 169294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-05-24 00:13:43 UTC (rev 169293)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-05-24 00:18:32 UTC (rev 169294)
</span><span class="lines">@@ -1393,7 +1393,7 @@
</span><span class="cx">     void dynamicViewportUpdateChangedTarget(double newTargetScale, const WebCore::FloatPoint&amp; newScrollPosition);
</span><span class="cx">     void didGetTapHighlightGeometries(uint64_t requestID, const WebCore::Color&amp; color, const Vector&lt;WebCore::FloatQuad&gt;&amp; geometries, const WebCore::IntSize&amp; topLeftRadius, const WebCore::IntSize&amp; topRightRadius, const WebCore::IntSize&amp; bottomLeftRadius, const WebCore::IntSize&amp; bottomRightRadius);
</span><span class="cx"> 
</span><del>-    void startAssistingNode(const AssistedNodeInformation&amp;, bool userIsInteracting, IPC::MessageDecoder&amp;);
</del><ins>+    void startAssistingNode(const AssistedNodeInformation&amp;, bool userIsInteracting, bool blurPreviousNode, IPC::MessageDecoder&amp;);
</ins><span class="cx">     void stopAssistingNode();
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (169293 => 169294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2014-05-24 00:13:43 UTC (rev 169293)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2014-05-24 00:18:32 UTC (rev 169294)
</span><span class="lines">@@ -325,7 +325,7 @@
</span><span class="cx">     DynamicViewportUpdateChangedTarget(double newTargetScale, WebCore::FloatPoint newScrollPosition)
</span><span class="cx">     DidGetTapHighlightGeometries(uint64_t requestID, WebCore::Color color, Vector&lt;WebCore::FloatQuad&gt; geometries, WebCore::IntSize topLeftRadius, WebCore::IntSize topRightRadius, WebCore::IntSize bottomLeftRadius, WebCore::IntSize bottomRightRadius)
</span><span class="cx"> 
</span><del>-    StartAssistingNode(WebKit::AssistedNodeInformation information, bool userIsInteracting, WebKit::InjectedBundleUserMessageEncoder userData) Variadic
</del><ins>+    StartAssistingNode(WebKit::AssistedNodeInformation information, bool userIsInteracting, bool blurPreviousNode, WebKit::InjectedBundleUserMessageEncoder userData) Variadic
</ins><span class="cx">     StopAssistingNode()
</span><span class="cx">     NotifyRevealedSelection()
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h (169293 => 169294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2014-05-24 00:13:43 UTC (rev 169293)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2014-05-24 00:18:32 UTC (rev 169294)
</span><span class="lines">@@ -112,7 +112,7 @@
</span><span class="cx">     virtual void didCommitLayerTree(const RemoteLayerTreeTransaction&amp;) override;
</span><span class="cx">     virtual void dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint&amp; newScrollPosition) override;
</span><span class="cx"> 
</span><del>-    virtual void startAssistingNode(const AssistedNodeInformation&amp;, bool userIsInteracting, API::Object* userData) override;
</del><ins>+    virtual void startAssistingNode(const AssistedNodeInformation&amp;, bool userIsInteracting, bool blurPreviousNode, API::Object* userData) override;
</ins><span class="cx">     virtual void stopAssistingNode() override;
</span><span class="cx">     virtual void selectionDidChange() override;
</span><span class="cx">     virtual bool interpretKeyEvent(const NativeWebKeyboardEvent&amp;, bool isCharEvent) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm (169293 => 169294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2014-05-24 00:13:43 UTC (rev 169293)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2014-05-24 00:18:32 UTC (rev 169294)
</span><span class="lines">@@ -410,7 +410,7 @@
</span><span class="cx">     [m_webView _dynamicViewportUpdateChangedTargetToScale:newScale position:newScrollPosition];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PageClientImpl::startAssistingNode(const AssistedNodeInformation&amp; nodeInformation, bool userIsInteracting, API::Object* userData)
</del><ins>+void PageClientImpl::startAssistingNode(const AssistedNodeInformation&amp; nodeInformation, bool userIsInteracting, bool blurPreviousNode, API::Object* userData)
</ins><span class="cx"> {
</span><span class="cx">     MESSAGE_CHECK(!userData || userData-&gt;type() == API::Object::Type::Data);
</span><span class="cx"> 
</span><span class="lines">@@ -426,7 +426,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    [m_contentView _startAssistingNode:nodeInformation userIsInteracting:userIsInteracting userObject:userObject];
</del><ins>+    [m_contentView _startAssistingNode:nodeInformation userIsInteracting:userIsInteracting blurPreviousNode:blurPreviousNode userObject:userObject];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::stopAssistingNode()
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewInteractionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h (169293 => 169294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h        2014-05-24 00:13:43 UTC (rev 169293)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h        2014-05-24 00:18:32 UTC (rev 169294)
</span><span class="lines">@@ -155,7 +155,7 @@
</span><span class="cx"> - (void)_commitPotentialTapFailed;
</span><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><del>-- (void)_startAssistingNode:(const WebKit::AssistedNodeInformation&amp;)information userIsInteracting:(BOOL)userIsInteracting userObject:(NSObject &lt;NSSecureCoding&gt; *)userObject;
</del><ins>+- (void)_startAssistingNode:(const WebKit::AssistedNodeInformation&amp;)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode userObject:(NSObject &lt;NSSecureCoding&gt; *)userObject;
</ins><span class="cx"> - (void)_stopAssistingNode;
</span><span class="cx"> - (void)_selectionChanged;
</span><span class="cx"> - (void)_updateChangedSelection;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewInteractionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (169293 => 169294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2014-05-24 00:13:43 UTC (rev 169293)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2014-05-24 00:18:32 UTC (rev 169294)
</span><span class="lines">@@ -2132,11 +2132,14 @@
</span><span class="cx">     return _formAccessoryView.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_startAssistingNode:(const AssistedNodeInformation&amp;)information userIsInteracting:(BOOL)userIsInteracting userObject:(NSObject &lt;NSSecureCoding&gt; *)userObject
</del><ins>+- (void)_startAssistingNode:(const AssistedNodeInformation&amp;)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode userObject:(NSObject &lt;NSSecureCoding&gt; *)userObject
</ins><span class="cx"> {
</span><span class="cx">     if (!userIsInteracting &amp;&amp; !_textSelectionAssistant)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    if (blurPreviousNode)
+        [self _stopAssistingNode];
+
</ins><span class="cx">     // FIXME: We should remove this check when we manage to send StartAssistingNode from the WebProcess
</span><span class="cx">     // only when it is truly time to show the keyboard.
</span><span class="cx">     if (_assistedNodeInformation.elementType == information.elementType &amp;&amp; _assistedNodeInformation.elementRect == information.elementRect)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (169293 => 169294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2014-05-24 00:13:43 UTC (rev 169293)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2014-05-24 00:18:32 UTC (rev 169294)
</span><span class="lines">@@ -557,14 +557,14 @@
</span><span class="cx">     m_pageClient.didGetTapHighlightGeometries(requestID, color, highlightedQuads, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::startAssistingNode(const AssistedNodeInformation&amp; information, bool userIsInteracting, IPC::MessageDecoder&amp; decoder)
</del><ins>+void WebPageProxy::startAssistingNode(const AssistedNodeInformation&amp; information, bool userIsInteracting, bool blurPreviousNode, IPC::MessageDecoder&amp; decoder)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;API::Object&gt; userData;
</span><span class="cx">     WebContextUserMessageDecoder messageDecoder(userData, process());
</span><span class="cx">     if (!decoder.decode(messageDecoder))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_pageClient.startAssistingNode(information, userIsInteracting, userData.get());
</del><ins>+    m_pageClient.startAssistingNode(information, userIsInteracting, blurPreviousNode, userData.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::stopAssistingNode()
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (169293 => 169294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-05-24 00:13:43 UTC (rev 169293)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-05-24 00:18:32 UTC (rev 169294)
</span><span class="lines">@@ -295,6 +295,7 @@
</span><span class="cx">     , m_scaleWasSetByUIProcess(false)
</span><span class="cx">     , m_userHasChangedPageScaleFactor(false)
</span><span class="cx">     , m_userIsInteracting(false)
</span><ins>+    , m_hasPendingBlurNotification(false)
</ins><span class="cx">     , m_screenSize(parameters.screenSize)
</span><span class="cx">     , m_availableScreenSize(parameters.availableScreenSize)
</span><span class="cx">     , m_inDynamicSizeUpdate(false)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (169293 => 169294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-05-24 00:13:43 UTC (rev 169293)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-05-24 00:18:32 UTC (rev 169294)
</span><span class="lines">@@ -1202,6 +1202,7 @@
</span><span class="cx">     bool m_scaleWasSetByUIProcess;
</span><span class="cx">     bool m_userHasChangedPageScaleFactor;
</span><span class="cx">     bool m_userIsInteracting;
</span><ins>+    bool m_hasPendingBlurNotification;
</ins><span class="cx">     WebCore::FloatSize m_screenSize;
</span><span class="cx">     WebCore::FloatSize m_availableScreenSize;
</span><span class="cx">     RefPtr&lt;WebCore::Range&gt; m_currentBlockSelection;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (169293 => 169294)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-05-24 00:13:43 UTC (rev 169293)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-05-24 00:18:32 UTC (rev 169294)
</span><span class="lines">@@ -1900,14 +1900,20 @@
</span><span class="cx">         if (m_userIsInteracting)
</span><span class="cx">             m_formClient-&gt;willBeginInputSession(this, toElement(node), WebFrame::fromCoreFrame(*node-&gt;document().frame()), userData);
</span><span class="cx"> 
</span><del>-        send(Messages::WebPageProxy::StartAssistingNode(information, m_userIsInteracting, InjectedBundleUserMessageEncoder(userData.get())));
</del><ins>+        send(Messages::WebPageProxy::StartAssistingNode(information, m_userIsInteracting, m_hasPendingBlurNotification, InjectedBundleUserMessageEncoder(userData.get())));
+        m_hasPendingBlurNotification = false;
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPage::elementDidBlur(WebCore::Node* node)
</span><span class="cx"> {
</span><span class="cx">     if (m_assistedNode == node) {
</span><del>-        send(Messages::WebPageProxy::StopAssistingNode());
</del><ins>+        m_hasPendingBlurNotification = true;
+        dispatch_async(dispatch_get_main_queue(), ^{
+            if (m_hasPendingBlurNotification)
+                send(Messages::WebPageProxy::StopAssistingNode());
+            m_hasPendingBlurNotification = false;
+        });
</ins><span class="cx">         m_assistedNode = 0;
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>