<!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>[209067] 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/209067">209067</a></dd>
<dt>Author</dt> <dd>bburg@apple.com</dd>
<dt>Date</dt> <dd>2016-11-29 06:02:42 -0800 (Tue, 29 Nov 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Automation: add ObjC SPI to set whether a page is controlled by automation
https://bugs.webkit.org/show_bug.cgi?id=165001
&lt;rdar://problem/29350432&gt;

Reviewed by Dan Bernstein.

Add SPI property to WKWebViewConfiguration and plumb it through to
initialize WebPageProxy::m_controlledByAutomation. This is propagated
to the WebProcess on creation via WebPageCreationParameters.

* UIProcess/API/APIPageConfiguration.cpp:
(API::PageConfiguration::copy):
* UIProcess/API/APIPageConfiguration.h:
(API::PageConfiguration::isControlledByAutomation):
(API::PageConfiguration::setControlledByAutomation):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _isControlledByAutomation]):
(-[WKWebViewConfiguration _setControlledByAutomation:]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIPageConfigurationcpp">trunk/Source/WebKit2/UIProcess/API/APIPageConfiguration.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIPageConfigurationh">trunk/Source/WebKit2/UIProcess/API/APIPageConfiguration.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewConfigurationmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewConfigurationPrivateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (209066 => 209067)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-11-29 12:57:34 UTC (rev 209066)
+++ trunk/Source/WebKit2/ChangeLog        2016-11-29 14:02:42 UTC (rev 209067)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2016-11-21  Brian Burg  &lt;bburg@apple.com&gt;
+
+        Web Automation: add ObjC SPI to set whether a page is controlled by automation
+        https://bugs.webkit.org/show_bug.cgi?id=165001
+        &lt;rdar://problem/29350432&gt;
+
+        Reviewed by Dan Bernstein.
+
+        Add SPI property to WKWebViewConfiguration and plumb it through to
+        initialize WebPageProxy::m_controlledByAutomation. This is propagated
+        to the WebProcess on creation via WebPageCreationParameters.
+
+        * UIProcess/API/APIPageConfiguration.cpp:
+        (API::PageConfiguration::copy):
+        * UIProcess/API/APIPageConfiguration.h:
+        (API::PageConfiguration::isControlledByAutomation):
+        (API::PageConfiguration::setControlledByAutomation):
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _initializeWithConfiguration:]):
+        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
+        (-[WKWebViewConfiguration init]):
+        (-[WKWebViewConfiguration copyWithZone:]):
+        (-[WKWebViewConfiguration _isControlledByAutomation]):
+        (-[WKWebViewConfiguration _setControlledByAutomation:]):
+        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::WebPageProxy):
+
</ins><span class="cx"> 2016-11-28  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] BadDamage X Window System error in WebKit::AcceleratedBackingStoreX11::update when called from WebPageProxy::exitAcceleratedCompositingMode
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIPageConfigurationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/APIPageConfiguration.cpp (209066 => 209067)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIPageConfiguration.cpp        2016-11-29 12:57:34 UTC (rev 209066)
+++ trunk/Source/WebKit2/UIProcess/API/APIPageConfiguration.cpp        2016-11-29 14:02:42 UTC (rev 209067)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -68,6 +68,7 @@
</span><span class="cx">     copy-&gt;m_alwaysRunsAtForegroundPriority = this-&gt;m_alwaysRunsAtForegroundPriority;
</span><span class="cx"> #endif
</span><span class="cx">     copy-&gt;m_initialCapitalizationEnabled = this-&gt;m_initialCapitalizationEnabled;
</span><ins>+    copy-&gt;m_controlledByAutomation = this-&gt;m_controlledByAutomation;
</ins><span class="cx"> 
</span><span class="cx">     return copy;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIPageConfigurationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/APIPageConfiguration.h (209066 => 209067)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIPageConfiguration.h        2016-11-29 12:57:34 UTC (rev 209066)
+++ trunk/Source/WebKit2/UIProcess/API/APIPageConfiguration.h        2016-11-29 14:02:42 UTC (rev 209067)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -95,6 +95,9 @@
</span><span class="cx">     bool waitsForPaintAfterViewDidMoveToWindow() const { return m_waitsForPaintAfterViewDidMoveToWindow; }
</span><span class="cx">     void setWaitsForPaintAfterViewDidMoveToWindow(bool shouldSynchronize) { m_waitsForPaintAfterViewDidMoveToWindow = shouldSynchronize; }
</span><span class="cx"> 
</span><ins>+    bool isControlledByAutomation() const { return m_controlledByAutomation; }
+    void setControlledByAutomation(bool controlledByAutomation) { m_controlledByAutomation = controlledByAutomation; }
+
</ins><span class="cx"> private:
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;WebKit::WebProcessPool&gt; m_processPool;
</span><span class="lines">@@ -116,6 +119,7 @@
</span><span class="cx"> #endif
</span><span class="cx">     bool m_initialCapitalizationEnabled = true;
</span><span class="cx">     bool m_waitsForPaintAfterViewDidMoveToWindow = true;
</span><ins>+    bool m_controlledByAutomation = false;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace API
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (209066 => 209067)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2016-11-29 12:57:34 UTC (rev 209066)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2016-11-29 14:02:42 UTC (rev 209067)
</span><span class="lines">@@ -450,6 +450,7 @@
</span><span class="cx">     pageConfiguration-&gt;preferenceValues().set(WebKit::WebPreferencesKey::allowUniversalAccessFromFileURLsKey(), WebKit::WebPreferencesStore::Value(!![_configuration _allowUniversalAccessFromFileURLs]));
</span><span class="cx">     pageConfiguration-&gt;setInitialCapitalizationEnabled([_configuration _initialCapitalizationEnabled]);
</span><span class="cx">     pageConfiguration-&gt;setWaitsForPaintAfterViewDidMoveToWindow([_configuration _waitsForPaintAfterViewDidMoveToWindow]);
</span><ins>+    pageConfiguration-&gt;setControlledByAutomation([_configuration _isControlledByAutomation]);
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     pageConfiguration-&gt;preferenceValues().set(WebKit::WebPreferencesKey::showsURLsInToolTipsEnabledKey(), WebKit::WebPreferencesStore::Value(!![_configuration _showsURLsInToolTips]));
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewConfigurationmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm (209066 => 209067)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm        2016-11-29 12:57:34 UTC (rev 209066)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm        2016-11-29 14:02:42 UTC (rev 209067)
</span><span class="lines">@@ -124,6 +124,7 @@
</span><span class="cx"> #endif
</span><span class="cx">     BOOL _initialCapitalizationEnabled;
</span><span class="cx">     BOOL _waitsForPaintAfterViewDidMoveToWindow;
</span><ins>+    BOOL _controlledByAutomation;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(APPLE_PAY)
</span><span class="cx">     BOOL _applePayEnabled;
</span><span class="lines">@@ -289,6 +290,7 @@
</span><span class="cx">     configuration-&gt;_mainContentUserGestureOverrideEnabled = self-&gt;_mainContentUserGestureOverrideEnabled;
</span><span class="cx">     configuration-&gt;_initialCapitalizationEnabled = self-&gt;_initialCapitalizationEnabled;
</span><span class="cx">     configuration-&gt;_waitsForPaintAfterViewDidMoveToWindow = self-&gt;_waitsForPaintAfterViewDidMoveToWindow;
</span><ins>+    configuration-&gt;_controlledByAutomation = self-&gt;_controlledByAutomation;
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     configuration-&gt;_allowsInlineMediaPlayback = self-&gt;_allowsInlineMediaPlayback;
</span><span class="lines">@@ -671,6 +673,16 @@
</span><span class="cx">     _waitsForPaintAfterViewDidMoveToWindow = shouldSynchronize;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (BOOL)_isControlledByAutomation
+{
+    return _controlledByAutomation;
+}
+
+- (void)_setControlledByAutomation:(BOOL)controlledByAutomation
+{
+    _controlledByAutomation = controlledByAutomation;
+}
+
</ins><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> - (BOOL)_showsURLsInToolTips
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewConfigurationPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h (209066 => 209067)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h        2016-11-29 12:57:34 UTC (rev 209066)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h        2016-11-29 14:02:42 UTC (rev 209067)
</span><span class="lines">@@ -57,6 +57,7 @@
</span><span class="cx"> @property (nonatomic, setter=_setInitialCapitalizationEnabled:) BOOL _initialCapitalizationEnabled WK_API_AVAILABLE(macosx(10.12), ios(10.0));
</span><span class="cx"> @property (nonatomic, setter=_setApplePayEnabled:) BOOL _applePayEnabled WK_API_AVAILABLE(macosx(10.12), ios(10.0));
</span><span class="cx"> @property (nonatomic, setter=_setWaitsForPaintAfterViewDidMoveToWindow:) BOOL _waitsForPaintAfterViewDidMoveToWindow WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
</span><ins>+@property (nonatomic, setter=_setControlledByAutomation:, getter=_isControlledByAutomation) BOOL _controlledByAutomation WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
</ins><span class="cx"> 
</span><span class="cx"> #if TARGET_OS_IPHONE
</span><span class="cx"> @property (nonatomic, setter=_setAlwaysRunsAtForegroundPriority:) BOOL _alwaysRunsAtForegroundPriority WK_API_AVAILABLE(ios(9_0));
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (209066 => 209067)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2016-11-29 12:57:34 UTC (rev 209066)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2016-11-29 14:02:42 UTC (rev 209067)
</span><span class="lines">@@ -405,6 +405,7 @@
</span><span class="cx">     , m_sessionID(m_configuration-&gt;sessionID())
</span><span class="cx">     , m_isPageSuspended(false)
</span><span class="cx">     , m_addsVisitedLinks(true)
</span><ins>+    , m_controlledByAutomation(m_configuration-&gt;isControlledByAutomation())
</ins><span class="cx"> #if ENABLE(REMOTE_INSPECTOR)
</span><span class="cx">     , m_allowsRemoteInspection(true)
</span><span class="cx"> #endif
</span></span></pre>
</div>
</div>

</body>
</html>