Skip to content
Permalink
Browse files
Web Automation: add ObjC SPI to set whether a page is controlled by a…
…utomation

https://bugs.webkit.org/show_bug.cgi?id=165001
<rdar://problem/29350432>

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):

Canonical link: https://commits.webkit.org/182757@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209067 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
burg committed Nov 29, 2016
1 parent 48881b0 commit 070770a62785d370e02b163eb7fed2dcf53040da
@@ -1,3 +1,31 @@
2016-11-21 Brian Burg <bburg@apple.com>

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

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):

2016-11-28 Carlos Garcia Campos <cgarcia@igalia.com>

[GTK] BadDamage X Window System error in WebKit::AcceleratedBackingStoreX11::update when called from WebPageProxy::exitAcceleratedCompositingMode
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2015 Apple Inc. All rights reserved.
* Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -68,6 +68,7 @@ Ref<PageConfiguration> PageConfiguration::copy() const
copy->m_alwaysRunsAtForegroundPriority = this->m_alwaysRunsAtForegroundPriority;
#endif
copy->m_initialCapitalizationEnabled = this->m_initialCapitalizationEnabled;
copy->m_controlledByAutomation = this->m_controlledByAutomation;

return copy;
}
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2015 Apple Inc. All rights reserved.
* Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -95,6 +95,9 @@ class PageConfiguration : public ObjectImpl<Object::Type::PageConfiguration> {
bool waitsForPaintAfterViewDidMoveToWindow() const { return m_waitsForPaintAfterViewDidMoveToWindow; }
void setWaitsForPaintAfterViewDidMoveToWindow(bool shouldSynchronize) { m_waitsForPaintAfterViewDidMoveToWindow = shouldSynchronize; }

bool isControlledByAutomation() const { return m_controlledByAutomation; }
void setControlledByAutomation(bool controlledByAutomation) { m_controlledByAutomation = controlledByAutomation; }

private:

RefPtr<WebKit::WebProcessPool> m_processPool;
@@ -116,6 +119,7 @@ class PageConfiguration : public ObjectImpl<Object::Type::PageConfiguration> {
#endif
bool m_initialCapitalizationEnabled = true;
bool m_waitsForPaintAfterViewDidMoveToWindow = true;
bool m_controlledByAutomation = false;
};

} // namespace API
@@ -450,6 +450,7 @@ - (void)_initializeWithConfiguration:(WKWebViewConfiguration *)configuration
pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::allowUniversalAccessFromFileURLsKey(), WebKit::WebPreferencesStore::Value(!![_configuration _allowUniversalAccessFromFileURLs]));
pageConfiguration->setInitialCapitalizationEnabled([_configuration _initialCapitalizationEnabled]);
pageConfiguration->setWaitsForPaintAfterViewDidMoveToWindow([_configuration _waitsForPaintAfterViewDidMoveToWindow]);
pageConfiguration->setControlledByAutomation([_configuration _isControlledByAutomation]);

#if PLATFORM(MAC)
pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::showsURLsInToolTipsEnabledKey(), WebKit::WebPreferencesStore::Value(!![_configuration _showsURLsInToolTips]));
@@ -124,6 +124,7 @@ @implementation WKWebViewConfiguration {
#endif
BOOL _initialCapitalizationEnabled;
BOOL _waitsForPaintAfterViewDidMoveToWindow;
BOOL _controlledByAutomation;

#if ENABLE(APPLE_PAY)
BOOL _applePayEnabled;
@@ -289,6 +290,7 @@ - (id)copyWithZone:(NSZone *)zone
configuration->_mainContentUserGestureOverrideEnabled = self->_mainContentUserGestureOverrideEnabled;
configuration->_initialCapitalizationEnabled = self->_initialCapitalizationEnabled;
configuration->_waitsForPaintAfterViewDidMoveToWindow = self->_waitsForPaintAfterViewDidMoveToWindow;
configuration->_controlledByAutomation = self->_controlledByAutomation;

#if PLATFORM(IOS)
configuration->_allowsInlineMediaPlayback = self->_allowsInlineMediaPlayback;
@@ -671,6 +673,16 @@ - (void)_setWaitsForPaintAfterViewDidMoveToWindow:(BOOL)shouldSynchronize
_waitsForPaintAfterViewDidMoveToWindow = shouldSynchronize;
}

- (BOOL)_isControlledByAutomation
{
return _controlledByAutomation;
}

- (void)_setControlledByAutomation:(BOOL)controlledByAutomation
{
_controlledByAutomation = controlledByAutomation;
}

#if PLATFORM(MAC)
- (BOOL)_showsURLsInToolTips
{
@@ -57,6 +57,7 @@
@property (nonatomic, setter=_setInitialCapitalizationEnabled:) BOOL _initialCapitalizationEnabled WK_API_AVAILABLE(macosx(10.12), ios(10.0));
@property (nonatomic, setter=_setApplePayEnabled:) BOOL _applePayEnabled WK_API_AVAILABLE(macosx(10.12), ios(10.0));
@property (nonatomic, setter=_setWaitsForPaintAfterViewDidMoveToWindow:) BOOL _waitsForPaintAfterViewDidMoveToWindow WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
@property (nonatomic, setter=_setControlledByAutomation:, getter=_isControlledByAutomation) BOOL _controlledByAutomation WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));

#if TARGET_OS_IPHONE
@property (nonatomic, setter=_setAlwaysRunsAtForegroundPriority:) BOOL _alwaysRunsAtForegroundPriority WK_API_AVAILABLE(ios(9_0));
@@ -405,6 +405,7 @@ WebPageProxy::WebPageProxy(PageClient& pageClient, WebProcessProxy& process, uin
, m_sessionID(m_configuration->sessionID())
, m_isPageSuspended(false)
, m_addsVisitedLinks(true)
, m_controlledByAutomation(m_configuration->isControlledByAutomation())
#if ENABLE(REMOTE_INSPECTOR)
, m_allowsRemoteInspection(true)
#endif

0 comments on commit 070770a

Please sign in to comment.