<!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>[244559] trunk/Source/WebKit</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/244559">244559</a></dd>
<dt>Author</dt> <dd>pvollan@apple.com</dd>
<dt>Date</dt> <dd>2019-04-23 13:27:24 -0700 (Tue, 23 Apr 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>[iOS] Input field on ddg.gg is auto focused when url is entered with the software keyboard
https://bugs.webkit.org/show_bug.cgi?id=196740

Reviewed by Megan Gardner.

When an url for a page with an autofocused input field  is entered with the software keyboard,
the input field is auto selected, and the software keyboard reappears. This does not happen
when picking the url from favorites. After using the software keyboard to enter the url, the
activity state is being changed to focused. The method '_elementDidFocus' checks whether the
activity state changed, and allows the software keyboard to be shown in this case. To avoid
showing the software keyboard in this case, send the changing activity state bitfield to the
UI process, and check if the focus flag is the only flag set.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitUIProcessPageClienth">trunk/Source/WebKit/UIProcess/PageClient.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebPageProxyh">trunk/Source/WebKit/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebPageProxymessagesin">trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKitUIProcessiosPageClientImplIOSh">trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessiosPageClientImplIOSmm">trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessiosWKContentViewInteractionh">trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessiosWKContentViewInteractionmm">trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessiosWebPageProxyIOSmm">trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPagecpp">trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPageh">trunk/Source/WebKit/WebProcess/WebPage/WebPage.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (244558 => 244559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2019-04-23 20:25:59 UTC (rev 244558)
+++ trunk/Source/WebKit/ChangeLog       2019-04-23 20:27:24 UTC (rev 244559)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2019-04-23  Per Arne Vollan  <pvollan@apple.com>
+
+        [iOS] Input field on ddg.gg is auto focused when url is entered with the software keyboard
+        https://bugs.webkit.org/show_bug.cgi?id=196740
+
+        Reviewed by Megan Gardner.
+
+        When an url for a page with an autofocused input field  is entered with the software keyboard,
+        the input field is auto selected, and the software keyboard reappears. This does not happen
+        when picking the url from favorites. After using the software keyboard to enter the url, the
+        activity state is being changed to focused. The method '_elementDidFocus' checks whether the
+        activity state changed, and allows the software keyboard to be shown in this case. To avoid
+        showing the software keyboard in this case, send the changing activity state bitfield to the
+        UI process, and check if the focus flag is the only flag set.
+  
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
+
</ins><span class="cx"> 2019-04-23  Guy Lewin  <guy@lewin.co.il>
</span><span class="cx"> 
</span><span class="cx">         Multiple File Input Icon Set Regardless of File List
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/PageClient.h (244558 => 244559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/PageClient.h       2019-04-23 20:25:59 UTC (rev 244558)
+++ trunk/Source/WebKit/UIProcess/PageClient.h  2019-04-23 20:27:24 UTC (rev 244559)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include "WebColorPicker.h"
</span><span class="cx"> #include "WebDataListSuggestionsDropdown.h"
</span><span class="cx"> #include "WebPopupMenuProxy.h"
</span><ins>+#include <WebCore/ActivityState.h>
</ins><span class="cx"> #include <WebCore/AlternativeTextClient.h>
</span><span class="cx"> #include <WebCore/DragActions.h>
</span><span class="cx"> #include <WebCore/EditorClient.h>
</span><span class="lines">@@ -382,7 +383,7 @@
</span><span class="cx">     virtual void restorePageState(Optional<WebCore::FloatPoint> scrollPosition, const WebCore::FloatPoint& scrollOrigin, const WebCore::FloatBoxExtent& obscuredInsetsOnSave, double scale) = 0;
</span><span class="cx">     virtual void restorePageCenterAndScale(Optional<WebCore::FloatPoint> center, double scale) = 0;
</span><span class="cx"> 
</span><del>-    virtual void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, API::Object* userData) = 0;
</del><ins>+    virtual void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges, API::Object* userData) = 0;
</ins><span class="cx">     virtual void elementDidBlur() = 0;
</span><span class="cx">     virtual void focusedElementDidChangeInputMode(WebCore::InputMode) = 0;
</span><span class="cx">     virtual void didReceiveEditorStateUpdateAfterFocus() = 0;
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (244558 => 244559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebPageProxy.h     2019-04-23 20:25:59 UTC (rev 244558)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h        2019-04-23 20:27:24 UTC (rev 244559)
</span><span class="lines">@@ -347,7 +347,7 @@
</span><span class="cx">     FocusedElementInformation information;
</span><span class="cx">     bool userIsInteracting;
</span><span class="cx">     bool blurPreviousNode;
</span><del>-    bool changingActivityState;
</del><ins>+    OptionSet<WebCore::ActivityState::Flag> activityStateChanges;
</ins><span class="cx">     RefPtr<API::Object> userData;
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -1907,7 +1907,7 @@
</span><span class="cx"> 
</span><span class="cx">     void didGetTapHighlightGeometries(uint64_t requestID, const WebCore::Color& color, const Vector<WebCore::FloatQuad>& geometries, const WebCore::IntSize& topLeftRadius, const WebCore::IntSize& topRightRadius, const WebCore::IntSize& bottomLeftRadius, const WebCore::IntSize& bottomRightRadius, bool nodeHasBuiltInClickHandling);
</span><span class="cx"> 
</span><del>-    void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, const UserData&);
</del><ins>+    void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges, const UserData&);
</ins><span class="cx">     void elementDidBlur();
</span><span class="cx">     void focusedElementDidChangeInputMode(WebCore::InputMode);
</span><span class="cx">     void didReceiveEditorStateUpdateAfterFocus();
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in (244558 => 244559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in   2019-04-23 20:25:59 UTC (rev 244558)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in      2019-04-23 20:27:24 UTC (rev 244559)
</span><span class="lines">@@ -404,7 +404,7 @@
</span><span class="cx">     RestorePageCenterAndScale(Optional<WebCore::FloatPoint> unobscuredCenter, double scale)
</span><span class="cx">     DidGetTapHighlightGeometries(uint64_t requestID, WebCore::Color color, Vector<WebCore::FloatQuad> geometries, WebCore::IntSize topLeftRadius, WebCore::IntSize topRightRadius, WebCore::IntSize bottomLeftRadius, WebCore::IntSize bottomRightRadius, bool nodeHasBuiltInClickHandling)
</span><span class="cx"> 
</span><del>-    ElementDidFocus(struct WebKit::FocusedElementInformation information, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, WebKit::UserData userData)
</del><ins>+    ElementDidFocus(struct WebKit::FocusedElementInformation information, bool userIsInteracting, bool blurPreviousNode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges, WebKit::UserData userData)
</ins><span class="cx">     ElementDidBlur()
</span><span class="cx">     FocusedElementDidChangeInputMode(enum:uint8_t WebCore::InputMode mode)
</span><span class="cx">     ScrollingNodeScrollWillStartScroll()
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessiosPageClientImplIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h (244558 => 244559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h    2019-04-23 20:25:59 UTC (rev 244558)
+++ trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h       2019-04-23 20:27:24 UTC (rev 244559)
</span><span class="lines">@@ -149,7 +149,7 @@
</span><span class="cx">     void restorePageState(Optional<WebCore::FloatPoint>, const WebCore::FloatPoint&, const WebCore::FloatBoxExtent&, double) override;
</span><span class="cx">     void restorePageCenterAndScale(Optional<WebCore::FloatPoint>, double) override;
</span><span class="cx"> 
</span><del>-    void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, API::Object* userData) override;
</del><ins>+    void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges, API::Object* userData) override;
</ins><span class="cx">     void elementDidBlur() override;
</span><span class="cx">     void focusedElementDidChangeInputMode(WebCore::InputMode) override;
</span><span class="cx">     void didReceiveEditorStateUpdateAfterFocus() override;
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessiosPageClientImplIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm (244558 => 244559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm   2019-04-23 20:25:59 UTC (rev 244558)
+++ trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm      2019-04-23 20:27:24 UTC (rev 244559)
</span><span class="lines">@@ -535,7 +535,7 @@
</span><span class="cx">     [m_webView _restorePageStateToUnobscuredCenter:center scale:scale];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PageClientImpl::elementDidFocus(const FocusedElementInformation& nodeInformation, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, API::Object* userData)
</del><ins>+void PageClientImpl::elementDidFocus(const FocusedElementInformation& nodeInformation, bool userIsInteracting, bool blurPreviousNode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges, API::Object* userData)
</ins><span class="cx"> {
</span><span class="cx">     MESSAGE_CHECK(!userData || userData->type() == API::Object::Type::Data);
</span><span class="cx"> 
</span><span class="lines">@@ -550,7 +550,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    [m_contentView _elementDidFocus:nodeInformation userIsInteracting:userIsInteracting blurPreviousNode:blurPreviousNode changingActivityState:changingActivityState userObject:userObject];
</del><ins>+    [m_contentView _elementDidFocus:nodeInformation userIsInteracting:userIsInteracting blurPreviousNode:blurPreviousNode activityStateChanges:activityStateChanges userObject:userObject];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool PageClientImpl::isFocusingElement()
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessiosWKContentViewInteractionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (244558 => 244559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h     2019-04-23 20:25:59 UTC (rev 244558)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h        2019-04-23 20:27:24 UTC (rev 244559)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx"> #import "WKSyntheticTapGestureRecognizer.h"
</span><span class="cx"> #import "_WKFormInputSession.h"
</span><span class="cx"> #import <UIKit/UIView.h>
</span><ins>+#import <WebCore/ActivityState.h>
</ins><span class="cx"> #import <WebCore/Color.h>
</span><span class="cx"> #import <WebCore/FloatQuad.h>
</span><span class="cx"> #import <wtf/BlockPtr.h>
</span><span class="lines">@@ -424,7 +425,7 @@
</span><span class="cx"> - (BOOL)_mayDisableDoubleTapGesturesDuringSingleTap;
</span><span class="cx"> - (void)_disableDoubleTapGesturesDuringTapIfNecessary:(uint64_t)requestID;
</span><span class="cx"> - (void)_handleSmartMagnificationInformationForPotentialTap:(uint64_t)requestID renderRect:(const WebCore::FloatRect&)renderRect fitEntireRect:(BOOL)fitEntireRect viewportMinimumScale:(double)viewportMinimumScale viewportMaximumScale:(double)viewportMaximumScale;
</span><del>-- (void)_elementDidFocus:(const WebKit::FocusedElementInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode changingActivityState:(BOOL)changingActivityState userObject:(NSObject <NSSecureCoding> *)userObject;
</del><ins>+- (void)_elementDidFocus:(const WebKit::FocusedElementInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode activityStateChanges:(OptionSet<WebCore::ActivityState::Flag>)activityStateChanges userObject:(NSObject <NSSecureCoding> *)userObject;
</ins><span class="cx"> - (void)_elementDidBlur;
</span><span class="cx"> - (void)_didUpdateInputMode:(WebCore::InputMode)mode;
</span><span class="cx"> - (void)_didReceiveEditorStateUpdateAfterFocus;
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessiosWKContentViewInteractionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (244558 => 244559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm    2019-04-23 20:25:59 UTC (rev 244558)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm       2019-04-23 20:27:24 UTC (rev 244559)
</span><span class="lines">@@ -4946,7 +4946,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_elementDidFocus:(const WebKit::FocusedElementInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode changingActivityState:(BOOL)changingActivityState userObject:(NSObject <NSSecureCoding> *)userObject
</del><ins>+- (void)_elementDidFocus:(const WebKit::FocusedElementInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode activityStateChanges:(OptionSet<WebCore::ActivityState::Flag>)activityStateChanges userObject:(NSObject <NSSecureCoding> *)userObject
</ins><span class="cx"> {
</span><span class="cx">     SetForScope<BOOL> isChangingFocusForScope { _isChangingFocus, hasFocusedElement(_focusedElementInformation) };
</span><span class="cx">     auto inputViewUpdateDeferrer = std::exchange(_inputViewUpdateDeferrer, nullptr);
</span><span class="lines">@@ -4982,7 +4982,10 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">             if (self.isFirstResponder || _becomingFirstResponder) {
</span><del>-                if (changingActivityState)
</del><ins>+                // When the software keyboard is being used to enter an url, only the focus activity state is changing.
+                // In this case, auto focus on the page being navigated to should be disabled, unless a hardware
+                // keyboard is attached.
+                if (activityStateChanges && activityStateChanges != WebCore::ActivityState::IsFocused)
</ins><span class="cx">                     return YES;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(WATCHOS)
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessiosWebPageProxyIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (244558 => 244559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm     2019-04-23 20:25:59 UTC (rev 244558)
+++ trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm        2019-04-23 20:27:24 UTC (rev 244559)
</span><span class="lines">@@ -408,7 +408,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (auto arguments = std::exchange(m_deferredElementDidFocusArguments, nullptr))
</span><del>-        pageClient().elementDidFocus(arguments->information, arguments->userIsInteracting, arguments->blurPreviousNode, arguments->changingActivityState, arguments->userData.get());
</del><ins>+        pageClient().elementDidFocus(arguments->information, arguments->userIsInteracting, arguments->blurPreviousNode, arguments->activityStateChanges, arguments->userData.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool WebPageProxy::updateLayoutViewportParameters(const WebKit::RemoteLayerTreeTransaction& layerTreeTransaction)
</span><span class="lines">@@ -927,7 +927,7 @@
</span><span class="cx">     process().send(Messages::WebPage::SetIsShowingInputViewForFocusedElement(showingInputView), m_pageID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::elementDidFocus(const FocusedElementInformation& information, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, const UserData& userData)
</del><ins>+void WebPageProxy::elementDidFocus(const FocusedElementInformation& information, bool userIsInteracting, bool blurPreviousNode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges, const UserData& userData)
</ins><span class="cx"> {
</span><span class="cx">     m_waitingForPostLayoutEditorStateUpdateAfterFocusingElement = true;
</span><span class="cx"> 
</span><span class="lines">@@ -934,11 +934,11 @@
</span><span class="cx">     API::Object* userDataObject = process().transformHandlesToObjects(userData.object()).get();
</span><span class="cx">     if (m_editorState.isMissingPostLayoutData) {
</span><span class="cx">         // FIXME: We should try to eliminate m_deferredElementDidFocusArguments altogether, in favor of only deferring actions that are dependent on post-layout editor state information.
</span><del>-        m_deferredElementDidFocusArguments = std::make_unique<ElementDidFocusArguments>(ElementDidFocusArguments { information, userIsInteracting, blurPreviousNode, changingActivityState, userDataObject });
</del><ins>+        m_deferredElementDidFocusArguments = std::make_unique<ElementDidFocusArguments>(ElementDidFocusArguments { information, userIsInteracting, blurPreviousNode, activityStateChanges, userDataObject });
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    pageClient().elementDidFocus(information, userIsInteracting, blurPreviousNode, changingActivityState, userDataObject);
</del><ins>+    pageClient().elementDidFocus(information, userIsInteracting, blurPreviousNode, activityStateChanges, userDataObject);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::elementDidBlur()
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (244558 => 244559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp       2019-04-23 20:25:59 UTC (rev 244558)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp  2019-04-23 20:27:24 UTC (rev 244559)
</span><span class="lines">@@ -3130,7 +3130,7 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT_WITH_MESSAGE(m_page, "setActivityState called on %" PRIu64 " but WebCore page was null", pageID());
</span><span class="cx">     if (m_page) {
</span><del>-        SetForScope<bool> currentlyChangingActivityState { m_changingActivityState, true };
</del><ins>+        SetForScope<OptionSet<ActivityState::Flag>> currentlyChangingActivityState { m_lastActivityStateChanges, changed };
</ins><span class="cx">         m_page->setActivityState(activityState);
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -5406,7 +5406,7 @@
</span><span class="cx"> 
</span><span class="cx">         m_formClient->willBeginInputSession(this, &element, WebFrame::fromCoreFrame(*element.document().frame()), m_userIsInteracting, userData);
</span><span class="cx"> 
</span><del>-        send(Messages::WebPageProxy::ElementDidFocus(information, m_userIsInteracting, m_recentlyBlurredElement, m_changingActivityState, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
</del><ins>+        send(Messages::WebPageProxy::ElementDidFocus(information, m_userIsInteracting, m_recentlyBlurredElement, m_lastActivityStateChanges, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
</ins><span class="cx"> #elif PLATFORM(MAC)
</span><span class="cx">         // FIXME: This can be unified with the iOS code above by bringing ElementDidFocus to macOS.
</span><span class="cx">         // This also doesn't take other noneditable controls into account, such as input type color.
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (244558 => 244559)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2019-04-23 20:25:59 UTC (rev 244558)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h    2019-04-23 20:27:24 UTC (rev 244559)
</span><span class="lines">@@ -1757,7 +1757,7 @@
</span><span class="cx">     bool m_hasEverFocusedElementDueToUserInteractionSincePageTransition { false };
</span><span class="cx">     bool m_isTouchBarUpdateSupressedForHiddenContentEditable { false };
</span><span class="cx">     bool m_isNeverRichlyEditableForTouchBar { false };
</span><del>-    bool m_changingActivityState { false };
</del><ins>+    OptionSet<WebCore::ActivityState::Flag> m_lastActivityStateChanges;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTEXT_MENUS)
</span><span class="cx">     bool m_isShowingContextMenu { false };
</span></span></pre>
</div>
</div>

</body>
</html>