blob: 486af3513f81aa2ce39e0c11fbbe9ca99271b804 [file] [log] [blame]
2019-11-08 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthn] Add quirk needed to support legacy Google NFC Titan security keys
https://bugs.webkit.org/show_bug.cgi?id=204024
<rdar://problem/56962320>
Reviewed by Brent Fulgham.
Some legacy U2F keys such as Google T1 Titan don't understand the FIDO applet command. Instead,
they are configured to only have the FIDO applet. Therefore, when the above command fails, we
use U2F_VERSION command to double check if the connected tag can actually speak U2F, indicating
we are interacting with one of these legacy keys.
* UIProcess/WebAuthentication/Cocoa/NfcConnection.mm:
(WebKit::fido::compareVersion):
(WebKit::fido::trySelectFidoApplet):
(WebKit::NfcConnection::transact const):
(WebKit::NfcConnection::didDetectTags):
2019-11-08 Jonathan Bedard <jbedard@apple.com>
Unreviewed, rolling out r252260.
Breaks half of API tests
Reverted changeset:
"Make DownloadID an ObjectIdentifier"
https://bugs.webkit.org/show_bug.cgi?id=203962
https://trac.webkit.org/changeset/252260
2019-11-08 Antti Koivisto <antti@apple.com>
Use separate cache directory for development WebKit on Mac
https://bugs.webkit.org/show_bug.cgi?id=204015
Reviewed by Youenn Fablet.
Replace the NetworkCache::lastStableVersion scheme with a completely separate directory.
This way potential bugs in development WebKit can't end up affecting system WebKit cache.
This also removes the need to keep lastStableVersion updated.
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::makeCachePath):
Add '/Development' to cache path if this is not system WebKit.
(WebKit::NetworkCache::Storage::open):
(WebKit::NetworkCache::Storage::deleteOldVersions):
No need to avoid deleting lastStableVersion anymore.
* NetworkProcess/cache/NetworkCacheStorage.h:
2019-11-08 Per Arne Vollan <pvollan@apple.com>
[macOS] [iOS] Add logging and telemetry to mach lookup rules
https://bugs.webkit.org/show_bug.cgi?id=203999
Reviewed by Brent Fulgham.
Add logging and telemetry to help determine if mach lookups to a set of services can be denied in the WebContent process.
No new tests, since this only adds logging and telemetry.
* WebProcess/com.apple.WebProcess.sb.in:
2019-11-08 Alex Christensen <achristensen@webkit.org>
Make DownloadID an ObjectIdentifier
https://bugs.webkit.org/show_bug.cgi?id=203962
Reviewed by Youenn Fablet.
Also deprecate the unused WKDownloadGetID because this identifier is internal.
* NetworkProcess/Downloads/Download.cpp:
(WebKit::Download::Download):
(WebKit::Download::didReceiveData):
(WebKit::Download::didFinish):
(WebKit::Download::didFail):
(WebKit::Download::didCancel):
(WebKit::Download::messageSenderDestinationID const):
* NetworkProcess/Downloads/DownloadID.h:
(WebKit::DownloadID::DownloadID): Deleted.
(WebKit::DownloadID::operator== const): Deleted.
(WebKit::DownloadID::operator!= const): Deleted.
(WebKit::DownloadID::downloadID const): Deleted.
(IPC::ArgumentCoder<WebKit::DownloadID>::encode): Deleted.
(IPC::ArgumentCoder<WebKit::DownloadID>::decode): Deleted.
(WTF::DownloadIDHash::hash): Deleted.
(WTF::DownloadIDHash::equal): Deleted.
(WTF::HashTraits<WebKit::DownloadID>::emptyValue): Deleted.
(WTF::HashTraits<WebKit::DownloadID>::constructDeletedValue): Deleted.
(WTF::HashTraits<WebKit::DownloadID>::isDeletedValue): Deleted.
* NetworkProcess/Downloads/DownloadMonitor.cpp:
(WebKit::DownloadMonitor::applicationWillEnterForeground):
(WebKit::DownloadMonitor::applicationDidEnterBackground):
(WebKit::DownloadMonitor::timerFired):
* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::messageSenderDestinationID const):
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/NetworkDataTask.h:
(WebKit::NetworkDataTask::setPendingDownloadID):
(WebKit::NetworkDataTask::isDownload const):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::pendingDownloadCanceled):
(WebKit::NetworkProcess::findPendingDownloadLocation):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::convertToDownload):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
(-[WKNetworkSessionDelegate URLSession:downloadTask:didFinishDownloadingToURL:]):
(-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
(WebKit::NetworkSessionCocoa::continueDidReceiveChallenge):
* Scripts/webkit/messages.py:
* Shared/Authentication/AuthenticationManager.h:
* UIProcess/API/C/WKDownload.cpp:
(WKDownloadGetID):
* UIProcess/API/C/WKDownload.h:
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::DownloadProxy):
(WebKit::generateDownloadID): Deleted.
* UIProcess/Downloads/DownloadProxy.h:
* UIProcess/Downloads/DownloadProxyMap.cpp:
(WebKit::DownloadProxyMap::createDownloadProxy):
(WebKit::DownloadProxyMap::downloadFinished):
(WebKit::DownloadProxyMap::invalidate):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::startDownload):
(WebKit::WebFrame::convertMainResourceLoadToDownload):
* WebProcess/WebPage/WebFrame.h:
* WebProcess/WebPage/WebPage.h:
2019-11-08 Alex Christensen <achristensen@webkit.org>
Fix flaky tests in http/tests/cache/disk-cache
https://bugs.webkit.org/show_bug.cgi?id=203822
Reviewed by Youenn Fablet.
Right now tests that set the cache model do so using a race condition. I think this will fix the flakyness we've observed.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setCacheModelSynchronouslyForTesting):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetCacheModelSynchronouslyForTesting):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::setCacheModelSynchronouslyForTesting):
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setCacheModelSynchronouslyForTesting):
* UIProcess/WebsiteData/WebsiteDataStore.h:
2019-11-08 Alex Christensen <achristensen@webkit.org>
Revert some changes accidentally committed with r252257
https://bugs.webkit.org/show_bug.cgi?id=202178
* UIProcess/API/C/WKContextPrivate.h:
2019-11-08 Alex Christensen <achristensen@webkit.org>
Move schemes for SchemeRegistry from WebProcessPool to LegacyGlobalSettings
https://bugs.webkit.org/show_bug.cgi?id=202178
Reviewed by Youenn Fablet.
The current users of the SPI to set these only have one WebProcessPool, so they intend these settings to be global.
Moving them to LegacyGlobalSettings allows me to make a NetworkProcessProxy without a WebProcessPool and not regress existing functionality.
I move only the four sets of schemes needed to launch a NetworkProcess to remove the dependency the NetworkProcess has on the WebProcessPool.
* UIProcess/LegacyGlobalSettings.h:
(WebKit::LegacyGlobalSettings::schemesToRegisterAsSecure):
(WebKit::LegacyGlobalSettings::registerURLSchemeAsSecure):
(WebKit::LegacyGlobalSettings::schemesToRegisterAsBypassingContentSecurityPolicy):
(WebKit::LegacyGlobalSettings::registerURLSchemeAsBypassingContentSecurityPolicy):
(WebKit::LegacyGlobalSettings::schemesToRegisterAsLocal):
(WebKit::LegacyGlobalSettings::registerURLSchemeAsLocal):
(WebKit::LegacyGlobalSettings::schemesToRegisterAsNoAccess):
(WebKit::LegacyGlobalSettings::registerURLSchemeAsNoAccess):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::initializeNewWebProcess):
(WebKit::WebProcessPool::registerURLSchemeAsSecure):
(WebKit::WebProcessPool::registerURLSchemeAsBypassingContentSecurityPolicy):
(WebKit::WebProcessPool::registerURLSchemeAsLocal):
(WebKit::WebProcessPool::registerURLSchemeAsNoAccess):
* UIProcess/WebProcessPool.h:
2019-11-08 Daniel Bates <dabates@apple.com>
Add WebKit Legacy SPI to retrieve editable elements in rect
https://bugs.webkit.org/show_bug.cgi?id=204006
<rdar://problem/57024093>
Reviewed by Wenson Hsieh.
Write WebPage::textInputContextsInRect() in terms of Page::editableElementsInRect().
Also make use of Element::clientRect() instead of elementRectInRootViewCoordinates(),
which duplicates what the former does.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::textInputContextsInRect): Write in terms of Page::editableElementsInRect().
(WebKit::WebPage::contextForElement const): Use Element::clientRect() which does what
elementRectInRootViewCoordinates() does.
(WebKit::elementRectInRootViewCoordinates): Deleted.
(WebKit::isEditableTextInputElement): Deleted.
2019-11-06 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthn] Return NotAllowedError immediately for UI cancellations
https://bugs.webkit.org/show_bug.cgi?id=203937
<rdar://problem/56962420>
Reviewed by Brent Fulgham.
NotAllowedError representing UI cancellations should be returned to sites
immediately such that sites could show appropriate error page immediately.
Covered by existing tests.
* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManager::cancelRequest):
(WebKit::AuthenticatorManager::clearState):
(WebKit::AuthenticatorManager::resetState): Deleted.
* UIProcess/WebAuthentication/AuthenticatorManager.h:
2019-11-08 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Add pointer lock permission request API
https://bugs.webkit.org/show_bug.cgi?id=203896
Reviewed by Adrian Perez de Castro.
Add a WebKitPointerLockPermissionRequest class to handle pointer lock permissions.
* PlatformGTK.cmake:
* SourcesGTK.txt:
* UIProcess/API/glib/WebKitPointerLockPermissionRequest.cpp: Added.
(webkitPointerLockPermissionRequestAllow):
(webkitPointerLockPermissionRequestDeny):
(webkit_permission_request_interface_init):
(webkitPointerLockPermissionRequestDispose):
(webkit_pointer_lock_permission_request_class_init):
(webkitPointerLockPermissionRequestCreate):
(webkitPointerLockPermissionRequestDidLosePointerLock):
* UIProcess/API/glib/WebKitPointerLockPermissionRequestPrivate.h: Added.
* UIProcess/API/glib/WebKitUIClient.cpp:
(UIClient::~UIClient):
* UIProcess/API/glib/WebKitWebView.cpp:
(webkitWebViewPermissionRequest):
(webkitWebViewDenyPointerLockRequest):
* UIProcess/API/glib/WebKitWebViewPrivate.h:
* UIProcess/API/gtk/WebKitPointerLockPermissionRequest.h: Added.
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/gtk/docs/webkit2gtk-4.0.types:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
* UIProcess/API/gtk/webkit2.h:
2019-11-07 Tim Horton <timothy_horton@apple.com>
Remove an unused icon resource
https://bugs.webkit.org/show_bug.cgi?id=203983
Reviewed by Wenson Hsieh.
* Resources/mac/mediaIcon.pdf: Removed.
* WebKit.xcodeproj/project.pbxproj:
This file has not been used in years.
2019-11-07 Per Arne Vollan <pvollan@apple.com>
[iOS] Add logging and telemetry to more mach lookup rules
https://bugs.webkit.org/show_bug.cgi?id=203978
Reviewed by Brent Fulgham.
Add logging and telemetry to help determine if mach lookup of these services can be denied in the WebContent process.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-11-07 Alex Christensen <achristensen@webkit.org>
Re-enable NSURLSession isolation after r252116
https://bugs.webkit.org/show_bug.cgi?id=203934
<rdar://problem/56921584>
Reviewed by Chris Dumez.
r252116 was a rollout of r248640, which introduced cases where data tasks from different NSURLSessions
which can have the same task identifiers were put into the same maps. This key collision caused data from the wrong
tasks to be sent to NetworkResourceLoader, causing rare and strange loading bugs. In order to prevent insertion into
wrong maps again, I made a new abstraction, SessionWrapper, which wraps a NSURLSession, its delegate, and all maps
that are scoped to that NSURLSession. Along the way I found a few other places where we had made similar mistakes.
Covered by an API test which would've failed before r252116 because it exercises the key collision condition,
and by tests which were skipped in r252116 and I now unskipped.
* NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
(WebKit::Download::resume):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
(WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate initWithSessionWrapper:withCredentials:]):
(-[WKNetworkSessionDelegate sessionInvalidated]):
(-[WKNetworkSessionDelegate existingTask:]):
(-[WKNetworkSessionDelegate sessionCocoa]):
(-[WKNetworkSessionDelegate URLSession:didBecomeInvalidWithError:]):
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]):
(processServerTrustEvaluation):
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
(-[WKNetworkSessionDelegate URLSession:downloadTask:didFinishDownloadingToURL:]):
(-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
(-[WKNetworkSessionDelegate URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
(-[WKNetworkSessionDelegate existingWebSocketTask:]):
(WebKit::SessionWrapper::initialize):
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
(WebKit::NetworkSessionCocoa::initializeEphemeralStatelessSession):
(WebKit::NetworkSessionCocoa::sessionWrapperForTask):
(WebKit::NetworkSessionCocoa::isolatedSession):
(WebKit::NetworkSessionCocoa::invalidateAndCancel):
(WebKit::NetworkSessionCocoa::continueDidReceiveChallenge):
(WebKit::NetworkSessionCocoa::createWebSocketTask):
(WebKit::NetworkSessionCocoa::addWebSocketTask):
(WebKit::NetworkSessionCocoa::removeWebSocketTask):
(-[WKNetworkSessionDelegate initWithNetworkSession:withCredentials:]): Deleted.
(WebKit::NetworkSessionCocoa::initializeEphemeralStatelessCookielessSession): Deleted.
(WebKit::NetworkSessionCocoa::session): Deleted.
(WebKit::NetworkSessionCocoa::dataTaskForIdentifier): Deleted.
(WebKit::NetworkSessionCocoa::downloadTaskWithResumeData): Deleted.
(WebKit::NetworkSessionCocoa::addDownloadID): Deleted.
(WebKit::NetworkSessionCocoa::downloadID): Deleted.
(WebKit::NetworkSessionCocoa::takeDownloadID): Deleted.
(WebKit::NetworkSessionCocoa::webSocketDataTaskForIdentifier): Deleted.
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _logUserInteraction:completionHandler:]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2019-11-07 Peng Liu <peng.liu6@apple.com>
ASSERTION FAILED: m_clientCounts.contains(contextId) in WebKit::VideoFullscreenManagerProxy::removeClientForContext(uint64_t)
https://bugs.webkit.org/show_bug.cgi?id=203918
Reviewed by Jer Noble.
Postpone the transition to exit fullscreen of a video element
before the previous transition of fullscreen mode change is completed.
Fix a flakey layout test (media/video-autoplay.html). No new test is needed.
* WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::VideoFullscreenManager::exitVideoFullscreenForVideoElement):
2019-11-07 Carlos Garcia Campos <cgarcia@igalia.com>
WebDriver: correctly handle errors when focusing element before sending key events
https://bugs.webkit.org/show_bug.cgi?id=203945
Reviewed by Carlos Alberto Lopez Perez.
Handle ElementNotInteractable JavaScript exception to generate the appropriate Automation error.
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
2019-11-06 Eric Liang <ericliang@apple.com>
AX: WKWebView does not shift Accessibility Focus for Catalyst (203798)
https://bugs.webkit.org/show_bug.cgi?id=203798
Reviewed by Chris Fleizach.
Added the code to register/unregister remote UI Process identifier on the host app.
This is used so that the host app can appear as the sender for notifications sent from its web processes. Unfortunately this has to be done in WebKit: in accessibility bundles the swizzled code is not called because of bundle loading time.
Added AppKit softlink for Mac catalyst.
* SourcesCocoa.txt:
* UIProcess/Cocoa/WebViewImpl.mm:
* UIProcess/ios/AppKitSoftLink.h: Added.
* UIProcess/ios/AppKitSoftLink.mm: Added.
* UIProcess/ios/ViewGestureControllerIOS.mm:
(-[WKSwipeTransitionController gestureRecognizerForInteractiveTransition:WithTarget:action:]):
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _updateRemoteAccessibilityRegistration:]):
(-[WKContentView _accessibilityRegisterUIProcessTokens]):
(-[WKContentView _processDidExit]):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
* WebProcess/WebPage/mac/WebPageMac.mm:
* WebProcess/cocoa/WebProcessCocoa.mm:
2019-11-06 Keith Rollin <krollin@apple.com>
Update availability annotations to match the macOS 10.15 and iOS 13.0 GM SDKs
https://bugs.webkit.org/show_bug.cgi?id=202243
<rdar://problem/55720747>
Reviewed by Brent Fulgham.
Changed WK_MAC_TBA and WK_IOS_TBA to 10.15 and 13.0, respectively, in
all declarations that appear in the GM SDKs.
* Configurations/WebKit.xcconfig:
* Shared/API/Cocoa/WKMain.h:
* UIProcess/API/Cocoa/NSAttributedString.h:
* UIProcess/API/Cocoa/WKContextMenuElementInfo.h:
* UIProcess/API/Cocoa/WKError.h:
* UIProcess/API/Cocoa/WKErrorPrivate.h:
* UIProcess/API/Cocoa/WKNavigation.h:
* UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
* UIProcess/API/Cocoa/WKNavigationDelegate.h:
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/API/Cocoa/WKNavigationResponsePrivate.h:
* UIProcess/API/Cocoa/WKPreferences.h:
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* UIProcess/API/Cocoa/WKPreviewActionItem.h:
* UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.h:
* UIProcess/API/Cocoa/WKPreviewElementInfo.h:
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
* UIProcess/API/Cocoa/WKUIDelegate.h:
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.h:
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/WKWebpagePreferences.h:
* UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
* UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
* UIProcess/API/Cocoa/_WKContentRuleListAction.h:
* UIProcess/API/Cocoa/_WKCustomHeaderFields.h:
* UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
* UIProcess/API/Cocoa/_WKElementAction.h:
* UIProcess/API/Cocoa/_WKInspectorWindow.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKTextInputContext.h:
* UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/_WKTouchEventGenerator.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
2019-11-06 Antti Koivisto <antti@apple.com>
REGRESSION: [ iOS ] ( r251015 ) Layout Test fast/text/whitespace/pre-wrap-overflow-selection.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=203366
<rdar://problem/56580680>
Reviewed by Simon Fraser.
WKBundlePageForceRepaint may fail to do synchronous layer flush if there is a pending layer flush in-flight and waiting
for completion message from UI process. Layer flush also flushes pending editor state so that doesn't get done either.
This may cause randomness in test results.
In this case the randomness is the switch between simple and complex line layout, triggered by editor state flush. The results
between line layout paths are observably identical but produce slightly different render tree dumps.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageFlushPendingEditorStateUpdate):
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
Add a function for forcing editor state flush, called from the test runner dump() function.
2019-11-06 Chris Dumez <cdumez@apple.com>
Unreviewed, fix watchOS build after r252011.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::startBackgroundActivityForFullscreenInput):
2019-11-06 Fujii Hironori <Hironori.Fujii@sony.com>
WEBCORE_TESTSUPPORT_EXPORT should be used only for WebCoreTestSupport, not for WebCore
https://bugs.webkit.org/show_bug.cgi?id=203876
Reviewed by Ross Kirsling.
* config.h: Removed WEBCORE_TESTSUPPORT_EXPORT definition because it shouldn't be used in WebKit.
2019-11-06 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r251907.
Causes white flashing in some cases <rdar://problem/56957850>
Reverted changeset:
"Take down the gesture snapshot early when the back/forward
cache is not leveraged"
https://bugs.webkit.org/show_bug.cgi?id=203713
https://trac.webkit.org/changeset/251907
2019-11-06 Chris Dumez <cdumez@apple.com>
Make sure we never end up with NetworkDataTaskCocoa TaskIdentifier conflicts
https://bugs.webkit.org/show_bug.cgi?id=203902
Reviewed by Antti Koivisto.
Consolidate the all the code related to data task registration / lookup / unregistration
in NetworkSessionCocoa and add a utility method (dataTaskMap()) to decide which data
task map to use. This makes it less error-prone and unlikely that someone would update
part of the code and fail to update the rest accordingly.
I also converted the debug assertions into release ones so that we crash in case of
id confusion instead of having a very bad and hard to diagnose bug like Bug 201822.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
(WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::dataTaskForIdentifier):
(WebKit::NetworkSessionCocoa::registerDataTask):
(WebKit::NetworkSessionCocoa::unregisterDataTask):
2019-11-06 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Implement support for Pointer Lock API
https://bugs.webkit.org/show_bug.cgi?id=202956
Reviewed by Carlos Alberto Lopez Perez.
Add platform specific implementation of Pointer Lock for the GTK port.
* PlatformGTK.cmake: Generate code for pointer-constraints and relative-pointer Wayland protocols.
* Shared/NativeWebMouseEvent.h: Add optional mouse movement delta.
* Shared/gtk/NativeWebMouseEventGtk.cpp:
(WebKit::NativeWebMouseEvent::NativeWebMouseEvent): Pass movement delta to WebEventFactory::createWebMouseEvent().
* Shared/gtk/WebEventFactory.cpp:
(WebKit::WebEventFactory::createWebMouseEvent): Initialize deltaX and deltaY for motion events using the received delta.
* Shared/gtk/WebEventFactory.h: Add optional mouse movement delta.
* SourcesGTK.txt: Add new files to compilation.
* UIProcess/API/glib/WebKitUIClient.cpp: Add implementation for requestPointerLock and didLosePointerLock.
* UIProcess/API/glib/WebKitWebView.cpp:
(webkitWebViewRequestPointerLock): Call webkitWebViewBaseRequestPointerLock().
(webkitWebViewDidLosePointerLock): Call webkitWebViewBaseDidLosePointerLock().
* UIProcess/API/glib/WebKitWebViewPrivate.h:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseDispose): Unlock the pointer and release the PointerLockManager.
(webkitWebViewBaseHandleMouseEvent): Initialize the mouse movement delta for motion events and save the current event.
(webkitWebViewBaseMotionNotifyEvent): Let PointerLockManager handle motion events while pointer is locked.
(webkitWebViewBaseRequestPointerLock): Create a PointerLockManager and request it to lock the pointer.
(webkitWebViewBaseDidLosePointerLock): Request PointerLockManager to unlock the pointer.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/gtk/PointerLockManager.cpp: Added.
(WebKit::PointerLockManager::create):
(WebKit::PointerLockManager::PointerLockManager):
(WebKit::PointerLockManager::~PointerLockManager):
(WebKit::PointerLockManager::lock):
(WebKit::PointerLockManager::unlock):
(WebKit::PointerLockManager::handleMotion):
* UIProcess/gtk/PointerLockManager.h: Added.
(WebKit::PointerLockManager::didReceiveMotionEvent):
* UIProcess/gtk/PointerLockManagerWayland.cpp: Added.
(WebKit::PointerLockManagerWayland::PointerLockManagerWayland):
(WebKit::PointerLockManagerWayland::~PointerLockManagerWayland):
(WebKit::PointerLockManagerWayland::lock):
(WebKit::PointerLockManagerWayland::unlock):
* UIProcess/gtk/PointerLockManagerWayland.h: Added.
* UIProcess/gtk/PointerLockManagerX11.cpp: Added.
(WebKit::PointerLockManagerX11::PointerLockManagerX11):
(WebKit::PointerLockManagerX11::didReceiveMotionEvent):
* UIProcess/gtk/PointerLockManagerX11.h: Added.
2019-11-05 Chris Dumez <cdumez@apple.com>
[iOS] Scroll position does not get restored when doing a history navigation while the reader view is shown
https://bugs.webkit.org/show_bug.cgi?id=203871
<rdar://problem/56564603>
Reviewed by Tim Horton.
Previously, attempts to restore the scroll position on the web view while it is being dynamically resized
would get ignored. Instead, we now delay restoring the scroll position until after the view is resized.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]):
(-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
2019-11-05 Kate Cheney <katherine_cheney@apple.com>
Layout test website-data-removal-for-site-navigated-to-with-link-decoration.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=203706
<rdar://problem/56801615>
Reviewed by Chris Dumez.
No new tests, this change is tested by the existing resourceLoadStatistics
tests.
This test started flaking when a new memory store was being created
between tests to maintain consistency. The call to grandfatherExistingWebsiteData
from populateMemoryStoreFromDisk in the persistent storage was
async, causing a race condition that led to occasional failures.
Adding a completion handler and changing the callsite of
populateMemoryStoreFromDisk should fix this problem.
* NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
* NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h:
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::populateMemoryStoreFromDisk):
2019-11-05 John Wilander <wilander@apple.com>
Temporarily turn off NSURLSession isolation
https://bugs.webkit.org/show_bug.cgi?id=201822
Reviewed by Chris Dumez.
Existing tests skipped.
Re-enabling it is tracked in rdar://problem/56921584.
* NetworkProcess/cache/NetworkCacheStorage.h:
Bumps the version to force a clean cache.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
Skips setting needsIsolatedSession.
2019-11-05 Per Arne Vollan <pvollan@apple.com>
Eliminate mach lookup to cfprefsd on process startup
https://bugs.webkit.org/show_bug.cgi?id=202866
Reviewed by Geoffrey Garen.
Currently, the WebContent and Networking process is calling CFBundleGetValueForInfoDictionaryKey on startup
to get the entry point function name into the WebKit bundle. This causes a mach lookup to cfprefsd which
should be avoided. Instead, we can send the service name as part of the bootstrap message when the UI process
is starting the process, and have the new process read this value from the message on startup to determine
the name of the entry point. This is possibly also an improvement in launch time, since we avoid reading a
value from Info.plist.
* NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkService/Info-OSX.plist:
* NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkService/Info-iOS.plist:
* PluginProcess/EntryPoint/Cocoa/XPCService/PluginService.64.Info.plist:
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(WebKit::XPCServiceEventHandler):
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
* WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-OSX.plist:
* WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-iOS.plist:
2019-11-05 Per Arne Vollan <pvollan@apple.com>
[iOS] Add logging and telemetry to mach services believed to be unused
https://bugs.webkit.org/show_bug.cgi?id=203831
Reviewed by Geoffrey Garen.
The sandbox rules for mach services believed to be unused should have logging and telemetry added to confirm
whether the assumption is correct.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-11-05 Tuomas Karkkainen <tuomas.webkit@apple.com>
move CrashReporterClientSPI.h and parts of WKCrashReporter to WTF so it can be used in JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=203803
Reviewed by Saam Barati.
No new tests added because functionality is not changing, code is only
moved from WebKit to WTF.
* Platform/cocoa/WKCrashReporter.mm:
(WebKit::setCrashReportApplicationSpecificInformation):
(WebKit::setCrashLogMessage): Deleted.
* WebKit.xcodeproj/project.pbxproj:
2019-11-05 Wenson Hsieh <wenson_hsieh@apple.com>
Native text substitutions interfere with HTML <datalist> options resulting in crash
https://bugs.webkit.org/show_bug.cgi?id=203116
<rdar://problem/49875932>
Reviewed by Tim Horton.
On macOS, an NSTableView inside a separate window is used to render suggestions when showing a datalist. The
crash happens when this table view is reloaded while clicking a datalist suggestion; that is, if -[NSTableView
reloadData] is invoked after the user sends a platform MouseDown event on the table view cell but before the
MouseUp is received, the selected row of the table view will be -1 when the action, `-selectedRow:`, is invoked.
In this particular case, the table view reload is triggered as a result of hiding the autocorrection bubble on
macOS, thereby committing the alternative text suggestion and changing the value of the text field via an
editing command.
To avoid crashing, we simply make `-selectedRow:` robust in the case where the index is invalid.
Test: fast/forms/datalist/datalist-click-crash.html
* UIProcess/mac/WebDataListSuggestionsDropdownMac.mm:
(-[WKDataListSuggestionsController selectedRow:]):
2019-11-05 Sihui Liu <sihui_liu@apple.com>
REGRESSION (r250754): web page using IDBIndex doesn't load occasionally
https://bugs.webkit.org/show_bug.cgi?id=203431
Reviewed by Brady Eidson.
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::didFireVersionChangeEvent):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
2019-11-05 Fujii Hironori <Hironori.Fujii@sony.com>
Unreviewed build fix for !ENABLE(MEDIA_STREAM) builds
https://bugs.webkit.org/show_bug.cgi?id=203362
<rdar://problem/56648232>
* UIProcess/UserMediaPermissionRequestProxy.h: Enclosed isUserGesturePriviledged with #if ENABLE(MEDIA_STREAM).
2019-11-05 youenn fablet <youenn@apple.com>
mp4 video element broken with service worker
https://bugs.webkit.org/show_bug.cgi?id=184447
<rdar://problem/39313155>
Reviewed by Chris Dumez.
Make a response as range-requested as per https://fetch.spec.whatwg.org/#http-network-or-cache-fetch step 15.
* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::checkRedirection):
(WebKit::NetworkLoadChecker::validateResponse):
* NetworkProcess/NetworkLoadChecker.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didReceiveResponse):
(WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
2019-11-05 youenn fablet <youenn@apple.com>
Enforce user gesture for getUserMedia in case a previous getUserMedia call was denied
https://bugs.webkit.org/show_bug.cgi?id=203362
Reviewed by Eric Carlson.
In case the request has user gesture priviledge, do not look at denied request history.
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::getRequestAction):
* UIProcess/UserMediaPermissionRequestProxy.h:
(WebKit::UserMediaPermissionRequestProxy::isUserGesturePriviledged const):
2019-11-04 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthn] Guard against unexpected -[_WKWebAuthenticationPanel cancel]
https://bugs.webkit.org/show_bug.cgi?id=203830
<rdar://problem/56797134>
Reviewed by Brent Fulgham .
-[_WKWebAuthenticationPanel cancel] was only expected to be called on behalf of an
explicit user cancel from the UI. However, clients may call it in different other
unexpected scenarios as well. We should guard against that.
To do so, two counter ways are implemented:
1) AuthenticatorManager::cancelRequest is changed to invoke the pending request if there
is no GlobalFrameID. This case can only be reached via calling -[_WKWebAuthenticationPanel cancel]
before AuthenticatorManager::cancelRequest.
2) WebAuthenticationPanelClient::updatePanel and WebAuthenticationPanelClient::dismissPanel
will call delegate methods in the next run loop to prevent -[_WKWebAuthenticationPanel cancel]
being called in the delegates.
Covered by new API tests.
* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManager::cancelRequest):
(WebKit::AuthenticatorManager::createService const):
(WebKit::AuthenticatorManager::invokePendingCompletionHandler):
* UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm:
(WebKit::WebAuthenticationPanelClient::updatePanel const):
(WebKit::WebAuthenticationPanelClient::dismissPanel const):
2019-11-04 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed fix for non-unified build.
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
* NetworkProcess/NetworkResourceLoader.cpp:
* Shared/ServiceWorkerInitializationData.cpp:
* UIProcess/API/APIAttachment.cpp:
* WebProcess/Storage/WebServiceWorkerProvider.h:
Add missing includes.
2019-11-04 Per Arne Vollan <pvollan@apple.com>
Fix crash caused by syscall sandbox violation
https://bugs.webkit.org/show_bug.cgi?id=203826
<rdar://problem/56332491>
Reviewed by Brent Fulgham.
A new syscall needs to be allowed in the WebContent process' sandbox.
* WebProcess/com.apple.WebProcess.sb.in:
2019-11-04 John Wilander <wilander@apple.com>
Resource Load Statistics: Flush the shared ResourceLoadObserver when the webpage is closed by JavaScript
https://bugs.webkit.org/show_bug.cgi?id=203623
<rdar://problem/56756427>
Reviewed by Alex Christensen.
This patch adds flushing of pending statistics when a window is closed by JavaScript,
when a webpage is removed from the web process, and when the web process prepares to
suspend.
New API test added.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
Now calls logTestingEvent() so that the test infrastructure can wait for updates.
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _seedResourceLoadStatisticsForTestingWithFirstParty:thirdParty:shouldScheduleNotification:completionHandler:]):
Test infrastructure to seed every web process' WebCore::ResourceLoadObserver with test data.
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _clearResourceLoadStatistics:]):
(-[WKWebsiteDataStore _isRegisteredAsSubresourceUnderFirstParty:thirdParty:completionHandler:]):
Test infrastructure.
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::seedResourceLoadStatisticsForTesting):
Test infrastructure.
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
Made sure the completion handler is called even if there is no network process.
(WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
Now tells all web processes to turn ITP on or off.
* WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
(WebKit::WebResourceLoadObserver::~WebResourceLoadObserver):
(WebKit::WebResourceLoadObserver::logSubresourceLoadingForTesting):
Test infrastructure to seed the observer with test data.
* WebProcess/WebCoreSupport/WebResourceLoadObserver.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setWebsiteDataStoreParameters):
Now checks whether a shared observer already exists before setting one.
(WebKit::WebProcess::removeWebPage):
(WebKit::WebProcess::prepareToSuspend):
These two functions now call WebProcess::flushResourceLoadStatistics().
(WebKit::WebProcess::setResourceLoadStatisticsEnabled):
This function now sets the process' shared WebCore::ResourceLoadObserver if none exists.
(WebKit::WebProcess::flushResourceLoadStatistics):
This function tells the shared WebCore::ResourceLoadObserver to send any pending
statistics to the central ITP store.
(WebKit::WebProcess::seedResourceLoadStatisticsForTesting):
Test infrastructure to seed the shared observer with test data.
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
2019-11-04 Chris Dumez <cdumez@apple.com>
[iOS][WK2] Simplify process assertion handling for the network process and service worker processes
https://bugs.webkit.org/show_bug.cgi?id=203633
Reviewed by Alex Christensen.
Simplify process assertion handling for the network process and service worker processes.
In particular, the following changes were made:
1. Put the NetworkProcessProxy in charge of keeping the network process runnable instead
of relying on the WebProcessPool to do it.
2. Put the WebProcessProxy in charge of keeping the web process runnable due to service
worker activity, instead of relying on the WebProcessPool to do it.
3. Introduce a new Variant data type which can store a foreground activity, a background
activity or no activity. This avoid having 2 separate and mutually-exclusive data
members for foreground and background activities.
4. The new code is a bit more correct because it makes sure the the activity we're holding
is valid, instead of simply checking that it has an activity. This means that if the
process assertion was previously invalidated, we will now properly take a new activity,
which will re-take a process assertion.
This patch also reduces the #ifdefing for IOS_FAMILY, since ProcessThrottler and
ProcessAssertion exist on all platforms.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::updateProcessAssertion):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::isValidBackgroundActivity):
(WebKit::ProcessThrottler::isValidForegroundActivity):
* UIProcess/ProcessThrottler.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::m_backgroundWebProcessCounter):
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::networkProcessCrashed):
(WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
(WebKit::WebProcessPool::disconnectProcess):
(WebKit::WebProcessPool::terminateNetworkProcess):
(WebKit::WebProcessPool::updateProcessAssertions):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didSetAssertionState):
(WebKit::WebProcessProxy::updateServiceWorkerProcessAssertion):
(WebKit::WebProcessProxy::enableServiceWorkers):
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::isStandaloneServiceWorkerProcess const):
2019-11-03 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthn] CtapAuthenticator::tryDowngrade should distinguish requestData().options
https://bugs.webkit.org/show_bug.cgi?id=203771
<rdar://problem/56832618>
Reviewed by Brent Fulgham.
CtapAuthenticator::tryDowngrade assumes the request is a getAssertion request. This is true
for most cases but not for Google's registration. For Google's registration, a quirk is
implemented to use U2F commands for registration if GoogleLegacyAppIdSupportExtension asks
us to do so.
No tests given there is no way to simulate google.com in our test infrastructures.
* UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
(WebKit::CtapAuthenticator::tryDowngrade):
2019-11-03 Tim Horton <timothy_horton@apple.com>
WKWebView can get stuck blank (Web Content process thinks the app is backgrounded)
https://bugs.webkit.org/show_bug.cgi?id=203774
<rdar://problem/53399054>
Reviewed by Chris Dumez.
With careful timing, if a WKWebView swaps out its content view in the
background, the incoming view can fail to inform the Web Content process
when the app comes to the foreground, leaving the layer tree frozen.
This occurs because the last-sent state is stored per-WKApplicationStateTrackingView,
and the content view is the WKApplicationStateTrackingView, so it is possible
for e.g. a WKPDFView to be in the hierarchy, keeping the correct state,
with an initialized-but-never-parented WKContentView hanging off the WKWebView.
If it is never parented, WKContentView will think that the current application
state is foreground (_lastObservedStateWasBackground is initialized to NO).
If you go into the background with a WKPDFView as the current content view,
it will inform the Web Content process that the application has backgrounded.
If, still in the background, WKWebView swaps from the WKPDFView to
the WKContentView, and then comes into the foreground, when we get the
notification that the app came to the foreground, we will not forward it
to the Web Content process, because WKContentView's _lastObservedStateWasBackground
remains NO.
To fix this, move _lastObservedStateWasBackground to WebPageProxy, so that
it always tracks the most recently sent state, regardless of which content view
is active.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::resetState):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::lastObservedStateWasBackground const):
* UIProcess/ios/WKApplicationStateTrackingView.mm:
(-[WKApplicationStateTrackingView willMoveToWindow:]):
(-[WKApplicationStateTrackingView didMoveToWindow]):
(-[WKApplicationStateTrackingView _applicationDidEnterBackground]):
(-[WKApplicationStateTrackingView _applicationWillEnterForeground]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::applicationDidEnterBackground):
(WebKit::WebPageProxy::applicationWillEnterForeground):
2019-11-02 Devin Rousso <drousso@apple.com>
Web Inspector: Add diagnostic logging for frontend feature usage
https://bugs.webkit.org/show_bug.cgi?id=203579
<rdar://problem/56717410>
Reviewed by Brian Burg.
This patch enables diagnostic logging for the Web Inspector web process
and adds the necessary `InspectorFrontendClient` plumbing to `WebInspectorUI`.
Original patch by Matt Baker <mattbaker@apple.com>.
* WebProcess/WebPage/WebInspectorUI.h:
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::supportsDiagnosticLogging): Added.
(WebKit::WebInspectorUI::logDagnosticEvent): Added.
* WebProcess/WebPage/RemoteWebInspectorUI.h:
* WebProcess/WebPage/RemoteWebInspectorUI.cpp:
(WebKit::RemoteWebInspectorUI::supportsDiagnosticLogging): Added.
(WebKit::RemoteWebInspectorUI::logDiagnosticEvent): Added.
* UIProcess/mac/WKInspectorViewController.mm:
(-[WKInspectorViewController configuration]):
Default to enabling diagnostic logging for the Web Inspector frontend window.
* Configurations/FeatureDefines.xcconfig:
Add `ENABLE_INSPECTOR_TELEMETRY`, which is only enabled for macOS.
2019-11-01 Brady Eidson <beidson@apple.com>
Promote "_getWebArchive" to API.
<rdar://problem/17317547> and https://bugs.webkit.org/show_bug.cgi?id=203767
Reviewed by Andy Estes.
* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView createWebArchiveDataWithCompletionHandler:]):
(-[WKWebView _getWebArchiveDataWithCompletionHandler:]):
2019-11-01 Brady Eidson <beidson@apple.com>
Rejigger WKWebArchive headers.
https://bugs.webkit.org/show_bug.cgi?id=203648
Reviewed by Andy Estes.
* Shared/API/c/mac/WKWebArchiveRef.cpp: Renamed from Source/WebKit/Shared/API/c/mac/WKWebArchive.cpp.
(WKWebArchiveGetTypeID):
(WKWebArchiveCreate):
(WKWebArchiveCreateWithData):
(WKWebArchiveCreateFromRange):
(WKWebArchiveCopyMainResource):
(WKWebArchiveCopySubresources):
(WKWebArchiveCopySubframeArchives):
(WKWebArchiveCopyData):
* Shared/API/c/mac/WKWebArchiveRef.h: Copied from Source/WebKit/Shared/API/c/mac/WKWebArchive.h.
* SourcesCocoa.txt:
* UIProcess/API/Cocoa/WKWebArchive.h: Renamed from Source/WebKit/Shared/API/c/mac/WKWebArchive.h.
* WebKit.xcodeproj/project.pbxproj:
2019-11-01 Eric Carlson <eric.carlson@apple.com>
Add experimental TextTrackCue API
https://bugs.webkit.org/show_bug.cgi?id=203649
<rdar://problem/55675172>
Reviewed by Jer Noble.
* Shared/WebPreferences.yaml:
2019-11-01 Brian Burg <bburg@apple.com>
REGRESSION(r248696): Element Click on Mac is adding an extra page topContentInsets to y-coordinate
https://bugs.webkit.org/show_bug.cgi?id=203765
<rdar://problem/56014369>
Reviewed by Devin Rousso.
* UIProcess/Automation/mac/WebAutomationSessionMac.mm:
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):
The topContentInsets is accounted for by rootViewToWindow(), so don't add it in manually.
2019-11-01 Per Arne Vollan <pvollan@apple.com>
Investigate if mach lookup access to *.apple-extension-service, *.viewservice, and com.apple.uikit.viewservice.* can be denied
https://bugs.webkit.org/show_bug.cgi?id=203626
Reviewed by Alexey Proskuryakov.
Modify the allow rule for these services to include the telemetry option.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-11-01 Peng Liu <peng.liu6@apple.com>
Turn on the Picture-in-Picture API feature by default
https://bugs.webkit.org/show_bug.cgi?id=203725
Reviewed by Jer Noble.
* Shared/WebPreferences.yaml:
2019-10-31 Chris Dumez <cdumez@apple.com>
Take down the gesture snapshot early when the back/forward cache is not leveraged
https://bugs.webkit.org/show_bug.cgi?id=203713
<rdar://problem/56803910>
Reviewed by Tim Horton.
Take down the gesture snapshot as soon as the gesture is done when the back/forward cache
is not leveraged. Otherwise, the snapshot may stay up for a long time (while we load, parse
and restore scroll position) and it would look to the user as if the view was unresponsive.
Showing the page slowly loading in such cases is less confusing as the user knows what's
going on and is even able to interact with the partially loaded page.
* Shared/WebBackForwardListItem.cpp:
(WebKit::WebBackForwardListItem::hasCachedWebPage const):
* Shared/WebBackForwardListItem.h:
* UIProcess/ViewGestureController.cpp:
(WebKit::ViewGestureController::endSwipeGesture):
* UIProcess/ViewGestureController.h:
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::makeSnapshotBlank):
(WebKit::ViewGestureController::endSwipeGesture):
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::makeSnapshotBlank):
2019-10-31 Per Arne Vollan <pvollan@apple.com>
[iOS] Fix mach lookup sandbox violations in the Mail app
https://bugs.webkit.org/show_bug.cgi?id=203697
Reviewed by Alexey Proskuryakov.
Allow mach lookup to the services "com.apple.logd.events" and "com.apple.distributed_notifications@1v3",
which are seen when running the Mail application. Also allow "com.apple.aggregated", which was previously
allowed, and is showing up in reports.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-10-31 Tim Horton <timothy_horton@apple.com>
Turn on IOSurface support in the iOS Simulator
https://bugs.webkit.org/show_bug.cgi?id=203026
<rdar://problem/56320993>
Reviewed by Simon Fraser.
* Configurations/WebKit.xcconfig:
Always link IOSurface now that we always have it.
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
Turn on Accelerated Drawing and Accelerated Drawing for Canvas by default.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _takeViewSnapshot]):
Don't use RGB10 if we don't have it.
(-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
Don't use render server snapshotting in hidden windows, because it
(correctly, but unhelpfully) cannot capture contents in that case.
2019-10-31 Dean Jackson <dino@apple.com>
REGRESSION (r251215): Mail failed to build
https://bugs.webkit.org/show_bug.cgi?id=203700
<rdar://problem/56787012>
Reviewed by Antoine Quint.
Revert the private modulemap. It didn't include enough things
and caused some internal builds to fail.
We'll put it back with everything included sometime soon.
* Configurations/WebKit.xcconfig:
* Modules/OSX.modulemap: Renamed from Source/WebKit/Modules/macOS.modulemap.
* Modules/iOS.private.modulemap: Removed.
* Modules/macOS.private.modulemap: Removed.
* Shared/API/Cocoa/WebKitPrivate.h:
2019-10-31 Alex Christensen <achristensen@apple.com>
Enable more features in Mac CMake build
https://bugs.webkit.org/show_bug.cgi?id=203699
Rubber-stamped by Tim Horton.
* PlatformMac.cmake:
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::createCaptureSource):
2019-10-31 Russell Epstein <repstein@apple.com>
Unreviewed, rolling out r251861.
Caused 50+ Layout Test Crashes
Reverted changeset:
"Use SecurityOriginData in NetworkProcess where possible
without other changes"
https://bugs.webkit.org/show_bug.cgi?id=203615
https://trac.webkit.org/changeset/251861
2019-10-31 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r251854.
Broke iOS build
Reverted changeset:
"Rejigger WKWebArchive headers."
https://bugs.webkit.org/show_bug.cgi?id=203648
https://trac.webkit.org/changeset/251854
2019-10-31 Alex Christensen <achristensen@webkit.org>
Remove unneeded HAVE_TIMINGDATAOPTIONS
https://bugs.webkit.org/show_bug.cgi?id=202990
Reviewed by Brady Eidson.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2019-10-31 Alex Christensen <achristensen@webkit.org>
Use SecurityOriginData in NetworkProcess where possible without other changes
https://bugs.webkit.org/show_bug.cgi?id=203615
Reviewed by Brady Eidson.
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
* NetworkProcess/NetworkResourceLoadParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::shouldInterruptLoadForXFrameOptions):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
2019-10-31 Alex Christensen <achristensen@webkit.org>
Expose more WKPreferences SPI
https://bugs.webkit.org/show_bug.cgi?id=203631
<rdar://problem/56717160>
Reviewed by Brady Eidson.
I added a unit test for the one that can be easily tested.
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setWebAudioEnabled:]):
(-[WKPreferences _webAudioEnabled]):
(-[WKPreferences _setAcceleratedCompositingEnabled:]):
(-[WKPreferences _acceleratedCompositingEnabled]):
(-[WKPreferences _setRequestAnimationFrameEnabled:]):
(-[WKPreferences _requestAnimationFrameEnabled]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2019-10-31 Alex Christensen <achristensen@webkit.org>
CMake build should make WebKit framework able to be used by Safari
https://bugs.webkit.org/show_bug.cgi?id=203685
Rubber-stamped by Tim Horton.
* PlatformMac.cmake:
2019-10-31 Brady Eidson <beidson@apple.com>
Rejigger WKWebArchive headers.
https://bugs.webkit.org/show_bug.cgi?id=203648
Reviewed by Andy Estes.
* Shared/API/c/mac/WKWebArchiveRef.cpp: Renamed from Source/WebKit/Shared/API/c/mac/WKWebArchive.cpp.
(WKWebArchiveGetTypeID):
(WKWebArchiveCreate):
(WKWebArchiveCreateWithData):
(WKWebArchiveCreateFromRange):
(WKWebArchiveCopyMainResource):
(WKWebArchiveCopySubresources):
(WKWebArchiveCopySubframeArchives):
(WKWebArchiveCopyData):
* Shared/API/c/mac/WKWebArchiveRef.h: Copied from Source/WebKit/Shared/API/c/mac/WKWebArchive.h.
* SourcesCocoa.txt:
* UIProcess/API/Cocoa/WKWebArchive.h: Renamed from Source/WebKit/Shared/API/c/mac/WKWebArchive.h.
* WebKit.xcodeproj/project.pbxproj:
2019-10-31 Wenson Hsieh <wenson_hsieh@apple.com>
Add telemetry to test a potential cause of crashes under -[WKContentView _interpretKeyEvent:isCharEvent:]
https://bugs.webkit.org/show_bug.cgi?id=203630
<rdar://problem/56769229>
Reviewed by Simon Fraser.
This iOS-specific crash occurs under `-_interpretKeyEvent:isCharEvent:`, when we first try to access WebEvent's
properties with `event.keyboardFlags`. This suggests that between storing the WebEvent in WebPageProxy's
m_keyEventQueue, and later receiving an InterpretKeyEvent sync IPC message in the UI process, something ends up
overreleasing (or otherwise writing over or corrupting) the WebEvent.
However, from code inspection, nothing appears to overrelease the WebEvent; an alternate possibility is that the
API is somehow being invoked from a background thread, which would explain why the WebEvent may sometimes get
destroyed too early.
To try and detect this scenario (and avoid keeping any strong references to WebEvent at all), add an
`os_log_fault` in case the API is being called on a background thread, and bail immediately.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
2019-10-31 Miguel Gomez <magomez@igalia.com>
[CoordGraphics] Avoid painting backing stores for zero-opacity layers
https://bugs.webkit.org/show_bug.cgi?id=184143
Reviewed by Žan Doberšek.
Do not check whether a backingStore is required by a layer inside CoordinatedGraphicsScene. This
decision is made by the appropriate CoordinatedGraphicsLayer and propagated to the scene by
sending a valid or null Nicosia::BackingStore instance through the state.
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::updateBackingStore):
(WebKit::layerShouldHaveBackingStore): Deleted.
2019-10-30 Peng Liu <peng.liu6@apple.com>
[Picture-in-Picture Web API] Enable the support for iOS
https://bugs.webkit.org/show_bug.cgi?id=202618
Reviewed by Jer Noble.
Enable the Picture-in-Picture API support for iOS (iPad only).
* Configurations/FeatureDefines.xcconfig:
* WebProcess/cocoa/VideoFullscreenManager.mm:
2019-10-30 Alex Christensen <achristensen@webkit.org>
Prevent Mac CMake build from bit rotting
https://bugs.webkit.org/show_bug.cgi?id=203647
Rubber-stamped by Tim Horton.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::m_messagePortChannelRegistry):
* PlatformMac.cmake:
* UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
(-[_WKWebAuthenticationPanel delegate]):
(-[_WKWebAuthenticationPanel setDelegate:]):
* UIProcess/WebProcessProxy.cpp:
2019-10-30 Per Arne Vollan <pvollan@apple.com>
It should be possible to create a mach sandbox extension for the WebContent process before the audit token is known
https://bugs.webkit.org/show_bug.cgi?id=203618
Reviewed by Brent Fulgham.
Currently, we are only able to create a mach sandbox extension for the WebContent process if we know its
audit token. It should be possible to create a mach extension without the audit token, since this is
needed when we want to create extensions before the PID or audit token is known. These extensions are
typically sent in the WebProcess creation parameters.
No new tests, this is not a behavior change, but a patch in preparation for future patches.
* Shared/Cocoa/SandboxExtensionCocoa.mm:
(WebKit::SandboxExtensionImpl::sandboxExtensionForType):
(WebKit::SandboxExtension::createHandleForMachLookup):
(WebKit::SandboxExtension::createHandleForMachLookupByAuditToken): Deleted.
* Shared/SandboxExtension.h:
* UIProcess/ios/WebProcessProxyIOS.mm:
(WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded):
2019-10-30 Per Arne Vollan <pvollan@apple.com>
Fix some sysctl read violations in the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=203632
Reviewed by Brent Fulgham.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-10-30 Dean Jackson <dino@apple.com>
REGRESSION(r251568) If we didn't start a Service Worker, don't try talking to it
https://bugs.webkit.org/show_bug.cgi?id=203639
<rdar://problem/56762071>
Reviewed by Chris Dumez.
Similar to the fix that introduced this regression, if the UI process does
not have the entitlement to start a service worker, we should not try
to load with one.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad): If the
parent process doesn't have a service worker, use the regular load path.
2019-10-30 Simon Fraser <simon.fraser@apple.com>
Turn Resize Observer on by default
https://bugs.webkit.org/show_bug.cgi?id=203644
rdar://problem/56026799
Reviewed by Tim Horton.
Change the defaultValue of Resize Observer to true.
* Shared/WebPreferences.yaml:
2019-10-30 Per Arne Vollan <pvollan@apple.com>
Lookup to mach services with the WebKit extension should list the allowed services
https://bugs.webkit.org/show_bug.cgi?id=203619
Reviewed by Alexey Proskuryakov.
To tighten the mach lookup rule which allows lookup to services with the "com.apple.webkit.extension.mach"
extension, all allowed services should be listed. Currently, we are only creating mach lookup extensions to
"com.apple.iphone.axserver-systemwide", but more will come in the future.
No new tests. Testing this requires UI interaction on the device to enable Accessibility.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-10-30 Alex Christensen <achristensen@webkit.org>
WKContentRuleLists should block requests from service workers
https://bugs.webkit.org/show_bug.cgi?id=201980
<rdar://problem/55516735>
Reviewed by Chris Dumez.
Test: http/tests/contentextensions/service-worker.https.html
Also covered by an API test.
* Shared/ServiceWorkerInitializationData.cpp: Added.
(WebKit::ServiceWorkerInitializationData::encode const):
(WebKit::ServiceWorkerInitializationData::decode):
* Shared/ServiceWorkerInitializationData.h: Added.
* Sources.txt:
* UIProcess/UserContent/WebUserContentControllerProxy.cpp:
(WebKit::WebUserContentControllerProxy::addProcess):
(WebKit::WebUserContentControllerProxy::contentRuleListData):
* UIProcess/UserContent/WebUserContentControllerProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess):
(WebKit::WebProcessPool::createWebPage):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::createForServiceWorkers):
(WebKit::WebProcessProxy::establishServiceWorkerContext):
(WebKit::contentRuleListsFromIdentifier):
(WebKit::WebProcessProxy::enableServiceWorkers):
* UIProcess/WebProcessProxy.h:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
(WebKit::m_userAgent):
(WebKit::WebSWContextManagerConnection::installServiceWorker):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
2019-10-30 Andres Gonzalez <andresg_22@apple.com>
Create base class common to AccessibilityObject and AXIsolatedTreeNode.
https://bugs.webkit.org/show_bug.cgi?id=203408
Reviewed by Chris Fleizach.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKAccessibilityRootObject):
(WKAccessibilityFocusedObject):
2019-10-30 Chris Dumez <cdumez@apple.com>
Unreviewed, fix reversed assertion landed in r251778.
* UIProcess/ProcessThrottler.h:
(WebKit::ProcessThrottler::Activity::invalidate):
2019-10-30 Chris Dumez <cdumez@apple.com>
Unreviewed, fix WatchOS build after r251778.
* UIProcess/WebProcessProxy.h:
2019-10-30 Chris Dumez <cdumez@apple.com>
WKFrameIsDisplayingMarkupDocument() should return true after a window.open/document.write
https://bugs.webkit.org/show_bug.cgi?id=203587
<rdar://problem/56717726>
Reviewed by Alex Christensen.
When doing a document.open(), we were propagating the document's URL to the UIProcess but not its
MIME type. WKFrameIsDisplayingMarkupDocument() was relying on this MIME type.
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::didExplicitOpen):
* UIProcess/WebFrameProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didExplicitOpenForFrame):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidExplicitOpen):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2019-10-30 Chris Dumez <cdumez@apple.com>
REGRESSION (r238252): HTTP POST is losing application/x-www-form-urlencoded body if there's a redirect to different host
https://bugs.webkit.org/show_bug.cgi?id=201950
<rdar://problem/55577782>
Reviewed by Alex Christensen.
The resource request body was getting lost on cross-site redirects. This was caused by the fact that a cross-site
redirect would cause a process-swap and the request to start again from a new process. This would work fine if
the request does not have a body. However, we have an optimization in place which avoids encoding the request body
whenever it is sent over IPC. Because the WebResourceLoader::WillSendRequest IPC would not encode the request body,
any decision to process swap as a result of this IPC (i.e. redirect) would cause the new request in the new process
to be missing its body. To address the issue, we now make sure to pass the request body in the WillSendRequest IPC
and reconsile the request with its body on the recipient side.
Test: http/tests/misc/form-submit-file-cross-site-redirect.html
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest):
* NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
(WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse):
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::willSendRequest):
* WebProcess/Network/WebResourceLoader.h:
* WebProcess/Network/WebResourceLoader.messages.in:
2019-10-30 Jer Noble <jer.noble@apple.com>
Enable Remote Playback API by default
https://bugs.webkit.org/show_bug.cgi?id=203595
Reviewed by Eric Carlson.
* Shared/WebPreferences.yaml:
2019-10-30 Chris Dumez <cdumez@apple.com>
[iOS] [WK2] Improve process assertion-related logging to help identify causes of leaked assertions
https://bugs.webkit.org/show_bug.cgi?id=203438
Reviewed by Antti Koivisto.
Improve process assertion-related logging to help identify causes of leaked assertions. Previously,
whenever our code needed to prevent suspension of a child process due to some kind of activity, it
would simply grab a "token" from the child process' ProcessThrottler. This, in-turn, would cause
the ProcessThrottler to take the right kind of ProcessAssertion or release it when nobody holds
any tokens any more.
We frequently have issues where the UIProcess keeps its assertions around for too long after getting
backgrounding. This causes the assertions to get invalidated and the UIProcess will usually suspend
(albeit with a delay, which is bad for power). Sometimes though, we get killed because our invalidation
handler does not get a chance to release the assertion in time.
Finding out why we're keeping around assertions is currently very difficult because we cannot easily
see in the logs who is still holding ProcessThrottler tokens. To make such debugging easier, clients
now notify the ProcessThrottler when they start some activity and provide a user-readable description
of the activity. The client then gets a ForegroundActivity or BackgroundActivity object instead of
simply a token. As a result, we are now able to log when a given activity that prevents suspension
begins and ends, with a user-friendly string. Also, when the assertion gets invalidated, it will
invalidate all these pending activities and we'll see in the logs the name of the activities that
were still going on upon invalidation.
* Shared/API/Cocoa/RemoteObjectRegistry.h:
(WebKit::RemoteObjectRegistry::backgroundActivity):
* Shared/API/Cocoa/RemoteObjectRegistry.mm:
(WebKit::RemoteObjectRegistry::sendInvocation):
* UIProcess/Cocoa/DownloadClient.h:
* UIProcess/Cocoa/DownloadClient.mm:
(WebKit::DownloadClient::takeActivityToken):
(WebKit::DownloadClient::releaseActivityTokenIfNecessary):
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationState):
(WebKit::NavigationState::releaseNetworkActivity):
(WebKit::NavigationState::didChangeIsLoading):
(WebKit::NavigationState::didSwapWebProcesses):
* UIProcess/Cocoa/UIRemoteObjectRegistry.cpp:
(WebKit::UIRemoteObjectRegistry::backgroundActivity):
* UIProcess/Cocoa/UIRemoteObjectRegistry.h:
* UIProcess/Cocoa/WebProcessProxyCocoa.mm:
(WebKit::WebProcessProxy::processWasResumed):
* UIProcess/GenericCallback.h:
(WebKit::CallbackBase::CallbackBase):
(WebKit::GenericCallback::create):
(WebKit::GenericCallback::GenericCallback):
(WebKit::CallbackMap::put):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::fetchWebsiteData):
(WebKit::NetworkProcessProxy::deleteWebsiteData):
(WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcessProxy::didClose):
(WebKit::NetworkProcessProxy::setIsHoldingLockedFiles):
(WebKit::NetworkProcessProxy::syncAllCookies):
(WebKit::NetworkProcessProxy::didSyncAllCookies):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::ProcessThrottler):
(WebKit::ProcessThrottler::~ProcessThrottler):
(WebKit::ProcessThrottler::addActivity):
(WebKit::ProcessThrottler::removeActivity):
(WebKit::ProcessThrottler::invalidateAllActivities):
(WebKit::ProcessThrottler::expectedAssertionState):
(WebKit::ProcessThrottler::setAssertionState):
(WebKit::ProcessThrottler::uiAssertionWillExpireImminently):
* UIProcess/ProcessThrottler.h:
(WebKit::ProcessThrottler::Activity::Activity):
(WebKit::ProcessThrottler::Activity::~Activity):
(WebKit::ProcessThrottler::Activity::isValid const):
(WebKit::ProcessThrottler::Activity::invalidate):
(WebKit::ProcessThrottler::shouldBeRunnable const):
(WebKit::ProcessThrottler::foregroundActivity):
(WebKit::ProcessThrottler::backgroundActivity):
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
* UIProcess/ProvisionalPageProxy.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::SuspendedPageProxy):
(WebKit::SuspendedPageProxy::didProcessRequestToSuspend):
* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebBackForwardCacheEntry.cpp:
(WebKit::WebBackForwardCacheEntry::~WebBackForwardCacheEntry):
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
(WebKit::WebCookieManagerProxy::deleteCookie):
(WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince):
(WebKit::WebCookieManagerProxy::setCookies):
(WebKit::WebCookieManagerProxy::getAllCookies):
(WebKit::WebCookieManagerProxy::getCookies):
(WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
(WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::updateThrottleState):
(WebKit::WebPageProxy::waitForDidUpdateActivityState):
(WebKit::WebPageProxy::setInitialFocus):
(WebKit::WebPageProxy::validateCommand):
(WebKit::WebPageProxy::executeEditCommand):
(WebKit::WebPageProxy::requestFontAttributesAtSelectionStart):
(WebKit::WebPageProxy::replaceMatches):
(WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld):
(WebKit::WebPageProxy::runJavaScriptInFrame):
(WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
(WebKit::WebPageProxy::getSourceForFrame):
(WebKit::WebPageProxy::getContentsAsString):
(WebKit::WebPageProxy::getBytecodeProfile):
(WebKit::WebPageProxy::getSamplingProfilerOutput):
(WebKit::WebPageProxy::getContentsAsMHTMLData):
(WebKit::WebPageProxy::getSelectionOrContentsAsString):
(WebKit::WebPageProxy::getSelectionAsWebArchiveData):
(WebKit::WebPageProxy::getMainResourceDataOfFrame):
(WebKit::WebPageProxy::getResourceDataFromFrame):
(WebKit::WebPageProxy::getWebArchiveOfFrame):
(WebKit::WebPageProxy::forceRepaint):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
(WebKit::WebPageProxy::drawToPDF):
(WebKit::WebPageProxy::getMarkedRangeAsync):
(WebKit::WebPageProxy::getSelectedRangeAsync):
(WebKit::WebPageProxy::characterIndexForPointAsync):
(WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
(WebKit::WebPageProxy::takeSnapshot):
(WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
(WebKit::WebPageProxy::getLoadDecisionForIcon):
(WebKit::WebPageProxy::insertAttachment):
(WebKit::WebPageProxy::updateAttachmentAttributes):
(WebKit::WebPageProxy::getApplicationManifest):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::initializeNewWebProcess):
(WebKit::WebProcessPool::updateProcessAssertions):
(WebKit::WebProcessPool::reinstateNetworkProcessAssertionState):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::shutDown):
(WebKit::WebProcessProxy::fetchWebsiteData):
(WebKit::WebProcessProxy::deleteWebsiteData):
(WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
(WebKit::WebProcessProxy::setIsHoldingLockedFiles):
(WebKit::WebProcessProxy::startBackgroundActivityForFullscreenInput):
(WebKit::WebProcessProxy::endBackgroundActivityForFullscreenInput):
* UIProcess/WebProcessProxy.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView presentViewControllerForCurrentFocusedElement]):
(-[WKContentView dismissAllInputViewControllers:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::requestFocusedElementInformation):
(WebKit::WebPageProxy::selectWithGesture):
(WebKit::WebPageProxy::updateSelectionWithTouches):
(WebKit::WebPageProxy::applyAutocorrection):
(WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
(WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
(WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection):
(WebKit::WebPageProxy::selectPositionAtPoint):
(WebKit::WebPageProxy::beginSelectionInDirection):
(WebKit::WebPageProxy::updateSelectionWithExtentPoint):
(WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary):
(WebKit::WebPageProxy::requestDictationContext):
(WebKit::WebPageProxy::getSelectionContext):
(WebKit::WebPageProxy::selectWithTwoTouches):
(WebKit::WebPageProxy::applicationDidEnterBackground):
(WebKit::WebPageProxy::requestRectsForGranularityWithSelectionOffset):
(WebKit::WebPageProxy::requestRectsAtSelectionOffsetWithText):
(WebKit::WebPageProxy::moveSelectionByOffset):
(WebKit::WebPageProxy::focusNextFocusedElement):
(WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF):
2019-10-30 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(2.27.2): [GTK] Overview item remove button broken
https://bugs.webkit.org/show_bug.cgi?id=203461
Reviewed by Adrian Perez de Castro.
This is a regression of the switch to new custom protocols implementation. Epiphany is passing NULL as content
type of ephy-resource requests, in which case we should try to guess the mime type, but we are not doing it.
* UIProcess/API/glib/WebKitURISchemeRequest.cpp:
(webkitURISchemeRequestReadCallback): Use MIMETypeRegistry to guess the mime type when content type is nullptr,
like NetworkDataTask does.
2019-10-29 Andy Estes <aestes@apple.com>
[Quick Look] Clean up LegacyPreviewLoaderClients
https://bugs.webkit.org/show_bug.cgi?id=203472
Reviewed by Brady Eidson.
Replaced QuickLookDocumentData with ShareableResource.
Removed messages WebPageProxy::DidRequestPasswordForQuickLookDocumentInMainFrame and
WebPage::DidReceivePasswordForQuickLookDocument, replacing them with async message
WebPageProxy::RequestPasswordForQuickLookDocumentInMainFrame.
* Shared/ios/QuickLookDocumentData.cpp: Removed.
* Shared/ios/QuickLookDocumentData.h: Removed.
* SourcesCocoa.txt:
* UIProcess/API/APILoaderClient.h:
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::didFinishLoadForQuickLookDocumentInMainFrame):
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::didFinishLoadForQuickLookDocumentInMainFrame):
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::requestPasswordForQuickLookDocumentInMainFrame):
(WebKit::ProvisionalPageProxy::didReceiveMessage):
(WebKit::ProvisionalPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame): Deleted.
* UIProcess/ProvisionalPageProxy.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didFinishLoadForQuickLookDocumentInMainFrame):
(WebKit::WebPageProxy::requestPasswordForQuickLookDocumentInMainFrame):
(WebKit::WebPageProxy::requestPasswordForQuickLookDocumentInMainFrameShared):
(WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame): Deleted.
(WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrameShared): Deleted.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.cpp:
(WebKit::WebPreviewLoaderClient::WebPreviewLoaderClient):
(WebKit::WebPreviewLoaderClient::didReceiveBuffer):
(WebKit::WebPreviewLoaderClient::didFinishLoading):
(WebKit::WebPreviewLoaderClient::didFail):
(WebKit::WebPreviewLoaderClient::didRequestPassword):
(WebKit::passwordCallbacks): Deleted.
(WebKit::WebPreviewLoaderClient::~WebPreviewLoaderClient): Deleted.
(WebKit::WebPreviewLoaderClient::didReceiveDataArray): Deleted.
(WebKit::WebPreviewLoaderClient::didReceivePassword): Deleted.
* WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.h:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::didStartLoadForQuickLookDocumentInMainFrame):
(WebKit::WebPage::didFinishLoadForQuickLookDocumentInMainFrame):
(WebKit::WebPage::requestPasswordForQuickLookDocumentInMainFrame):
(WebKit::WebPage::didReceivePasswordForQuickLookDocument): Deleted.
2019-10-29 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthn] Add more information to _WKWebAuthenticationPanel
https://bugs.webkit.org/show_bug.cgi?id=202561
<rdar://problem/55973910>
Reviewed by Youenn Fablet and Brent Fulgham.
This change adds transports and type to _WKWebAuthenticationPanel such that
clients can know what transport the current ceremony demands and the type of
the current ceremony. These extra information allow clients to give users
more specific instructions to interact with authenticators.
To pass transports to client, the way how them is collected is changed significantly:
1) The timing is moved to runPanel before the client delegate call.
2) NfcService::isAvailable is added for AuthenticatorManager to determine if NFC
is available in the current device.
3) AuthenticatorManager::filterTransports is added to filter transports requested
by RP to ones that are available. This process is handled by each service naturally
before.
4) AuthenticatorManager::startRequest is now being splitted into AuthenticatorManager::handleRequest,
AuthenticatorManager::runPanel and AuthenticatorManager::getTransports.
To pass type to _WKWebAuthenticationPanel, ClientDataType is moved from
WebCore::AuthenticatorCoordinator to WebCore::WebAuthenticationConstants in
order to be reused to indicate the ceremony type.
* UIProcess/API/APIWebAuthenticationPanel.cpp:
(API::WebAuthenticationPanel::create):
(API::WebAuthenticationPanel::WebAuthenticationPanel):
* UIProcess/API/APIWebAuthenticationPanel.h:
* UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h:
* UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
(-[_WKWebAuthenticationPanel relyingPartyID]):
(wkWebAuthenticationTransport):
(-[_WKWebAuthenticationPanel transports]):
(wkWebAuthenticationType):
(-[_WKWebAuthenticationPanel type]):
* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::WebCore::collectTransports):
(WebKit::WebCore::getClientDataType):
(WebKit::AuthenticatorManager::handleRequest):
(WebKit::AuthenticatorManager::filterTransports const):
(WebKit::AuthenticatorManager::startDiscovery):
(WebKit::AuthenticatorManager::initTimeOutTimer):
(WebKit::AuthenticatorManager::runPanel):
(WebKit::AuthenticatorManager::getTransports const):
(WebKit::AuthenticatorManager::respondReceivedInternal): Deleted.
(WebKit::AuthenticatorManager::startRequest): Deleted.
* UIProcess/WebAuthentication/AuthenticatorManager.h:
(WebKit::AuthenticatorManager::respondReceivedInternal):
* UIProcess/WebAuthentication/Cocoa/NfcService.h:
* UIProcess/WebAuthentication/Cocoa/NfcService.mm:
(WebKit::NfcService::isAvailable):
(WebKit::NfcService::platformStartDiscovery):
* UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
(WebKit::MockAuthenticatorManager::filterTransports const):
* UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.h:
2019-10-29 Wenson Hsieh <wenson_hsieh@apple.com>
REGRESSION (r251693): [iOS] Unable to change selection in a focused element if the element's bounds change
https://bugs.webkit.org/show_bug.cgi?id=203582
Reviewed by Tim Horton.
The refactoring in r251693 broke the ability to change selection in an editable area by tapping in iOS Safari,
in the case where the editable element's bounds change after focus. This is because the aforementioned change
now compares position informations' element context against the focused element information's element context to
check whether or not the position information request was inside the focused element. However, if the bounds of
the focused element change in between the position information request and when the element is initially
focused, the `operator==` comparison will fail, causing us to prevent text selection.
To fix this, only check whether or not the two element contexts refer to the same element in the DOM by
comparing page, document and element identifiers, but not the element's bounding rect.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:nodeHasBuiltInClickHandling:]):
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
2019-10-07 Jer Noble <jer.noble@apple.com>
Implement the Remote Playback API.
https://bugs.webkit.org/show_bug.cgi?id=162971
Reviewed by Youenn Fablet.
Add a preference to enable the Remote Playback API. Pass the playbackTargetPickerWasDismissed()
notification on to Page.
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesGetRemotePlaybackEnabled):
(WKPreferencesSetRemotePlaybackEnabled):
* UIProcess/API/C/WKPreferencesRef.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::playbackTargetPickerWasDismissed):
* UIProcess/WebPageProxy.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::mockMediaPlaybackTargetPickerDismissPopup):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::playbackTargetPickerWasDismissed):
2019-10-29 Per Arne Vollan <pvollan@apple.com>
REGRESSION: WebContent getting killed due to syscall filter violation
https://bugs.webkit.org/show_bug.cgi?id=203575
Reviewed by Alexey Proskuryakov.
The sandbox profile on macOS needs to open up for a syscall.
No new tests, covered by existing tests.
* WebProcess/com.apple.WebProcess.sb.in:
2019-10-29 Brent Fulgham <bfulgham@apple.com>
[iOS] Clean up sandbox to group similar rules together
https://bugs.webkit.org/show_bug.cgi?id=203525
<rdar://problem/56686416>
Reviewed by Per Arne Vollan.
Clean up the sandbox rules by grouping rules by feature areas to make future editing easier.
This change should have no impact on behavior.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-10-29 Myles C. Maxfield <mmaxfield@apple.com>
REGRESSION (r251413): Nightly build crashes on launch due to -[WKPreferences _setShouldAllowDesignSystemUIFonts:]: unrecognized selector
https://bugs.webkit.org/show_bug.cgi?id=203549
Reviewed by Simon Fraser.
r251413 deleted an SPI that new Safari stopped calling. However,
old Safari continues to call it. The solution is just to add stub
implementations so old Safari doesn't fail to link at runtime.
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _shouldAllowDesignSystemUIFonts]):
(-[WKPreferences _setShouldAllowDesignSystemUIFonts:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2019-10-27 Wenson Hsieh <wenson_hsieh@apple.com>
Add enterkeyhint support
https://bugs.webkit.org/show_bug.cgi?id=189546
<rdar://problem/51021148>
Reviewed by Tim Horton.
This patch adds support for the enterkeyhint HTML attribute on iOS.
Tests: EnterKeyHintTests.EnterKeyHintInContentEditableElement
EnterKeyHintTests.EnterKeyHintInTextInput
EnterKeyHintTests.EnterKeyHintInTextArea
* Shared/FocusedElementInformation.cpp:
(WebKit::FocusedElementInformation::encode const):
(WebKit::FocusedElementInformation::decode):
* Shared/FocusedElementInformation.h:
Add a new flag to FocusedElementInformation to indicate the EnterKeyHint type that should be used when bringing
up an input view for the focused element.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView textInputTraits]):
Map the given EnterKeyHint type to a UIReturnKeyType. If an unsupported (i.e. "previous") or default
EnterKeyHint value is used, then we fall back to existing behavior which deduces the default enterkeyhint value
from the input type if the focused element is inside an actionable form; otherwise, we avoid setting any value
for the `returnKeyType`, defaulting to `UIReturnKeyDefault`.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getFocusedElementInformation):
2019-10-29 Kate Cheney <katherine_cheney@apple.com>
Layout Test http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration-database.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=203542#add_comment
<rdar://problem/56689764>
Reviewed by John Wilander.
This test was a flaky failure due to its calling
scheduleStatisticsProcessingRequestIfNecessary() after logging a cross
site load with link decoration. This call is currently unecessary
because this function is not yet used to classify resources, and is
causing the test to execute a callback before it is ready.
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
2019-10-29 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r251639.
Caused flakey API failures for GetDisplayMediaTest.Constraints
Reverted changeset:
"Enforce user gesture for getUserMedia in case a previous
getUserMedia call was denied"
https://bugs.webkit.org/show_bug.cgi?id=203362
https://trac.webkit.org/changeset/251639
2019-10-29 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r251646.
Caused flakey API failures for GetDisplayMediaTest.Constraints
Reverted changeset:
"Unreviewed build fix for !ENABLE(MEDIA_STREAM) builds"
https://bugs.webkit.org/show_bug.cgi?id=203362
https://trac.webkit.org/changeset/251646
2019-10-29 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r251594.
Caused an API test failure
Reverted changeset:
"mp4 video element broken with service worker"
https://bugs.webkit.org/show_bug.cgi?id=184447
https://trac.webkit.org/changeset/251594
2019-10-29 Chris Dumez <cdumez@apple.com>
Notification permissions are not remembered for origins without port
https://bugs.webkit.org/show_bug.cgi?id=203537
<rdar://problem/55281080>
Reviewed by Brady Eidson.
When WKSecurityOriginCreate() gets called with a port that is invalid, then pass
WTF::nullopt to construct the security origin instead of the invalid port.
The issue is that the port for security origins is optional internally. However,
our API (WKSecurityOriginGetPort() & WKSecurityOrigin.port) will return 0 when
there is no port. As a result, clients such as Safari sometimes pass 0 as port to construct
a new WKSecurityOriginRef().
This was causing issues with regards to notifications because Safari would construct
origins whose string representation looks like "https://www.apple.com:0" and it would
not match the "https://www.apple.com" we expect internally.
* Shared/API/c/WKSecurityOriginRef.cpp:
(WKSecurityOriginCreate):
2019-10-29 Adrian Perez de Castro <aperez@igalia.com>
Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.27.2 release
* wpe/NEWS: Add release notes for 2.27.2.
2019-10-28 Wenson Hsieh <wenson_hsieh@apple.com>
Replace InteractionInformationAtPosition.nodeAtPositionIsFocusedElement with an element context
https://bugs.webkit.org/show_bug.cgi?id=203498
Reviewed by Tim Horton.
Refactors InteractionInformationAtPosition, such that it doesn't need a special flag to indicate whether there
is a focused element at the position. This is a followup to webkit.org/b/203264; no new tests, as there should
be no change in behavior.
* Shared/FocusedElementInformation.cpp:
(WebKit::FocusedElementInformation::encode const):
(WebKit::FocusedElementInformation::decode):
* Shared/FocusedElementInformation.h:
Add an elementContext to FocusedElementInformation to represent the focused element; then, instead of checking
whether there is a focused element underneath the request position, simply check that the position information's
element context matches the FocusedElementInformation's element context.
Additionally, rename elementRect in FocusedElementInformation to interactionRect, to draw a distinction between
this rect and the new ElementContext's boundingRect.
* Shared/ios/InteractionInformationAtPosition.h:
* Shared/ios/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::encode const):
(WebKit::InteractionInformationAtPosition::decode):
Remove the nodeAtPositionIsFocusedElement flag.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:nodeHasBuiltInClickHandling:]):
(-[WKContentView _zoomToRevealFocusedElement]):
(-[WKContentView _selectionClipRect]):
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
In various places that consult nodeAtPositionIsFocusedElement, instead check that the position information's
hit-tested element context is the same as the focused element, via FocusedElementInformation.
(-[WKContentView _didCommitLoadForMainFrame]):
Nuke the cached position information data upon navigation; without this tweak, we will fail when running several
iOS layout tests back-to-back, that tap in exactly the same location.
(rectToRevealWhenZoomingToFocusedElement):
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
(-[WKContentView _elementDidBlur]):
(-[WKContentView rectForFocusedFormControlView:]):
(-[WKContentView _didChangeFocusedElementRect:toRect:]): Deleted.
Remove code to invalidate cached position information when changing the focused element rect.
* UIProcess/ios/forms/WKFormPopover.mm:
(-[WKRotatingPopover presentPopoverAnimated:]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::positionInformation):
(WebKit::WebPage::getFocusedElementInformation):
2019-10-28 Adrian Perez de Castro <aperez@igalia.com>
[GTK][WPE] Fix various non-unified build issues introduced since r251436
https://bugs.webkit.org/show_bug.cgi?id=203492
Reviewed by Alex Christensen and Mark Lam.
* UIProcess/InspectorTargetProxy.h: Add forward declaration of ProvisionalPageProxy.
* UIProcess/Plugins/PluginProcessProxy.cpp: Add missin inclusion of
WebProcessProxyMessages.h
* UIProcess/ProcessThrottler.cpp: Add missing inclusion of wtf/CompletionHandler.h
* UIProcess/ProvisionalPageProxy.h: Add missing inclusion of WebCore/FrameIdentifier.h
* UIProcess/WebPageInspectorController.h: Add missing inclusion of WebCore/PageIdentifier.h
* WebProcess/WebPage/WebPageInspectorTargetController.cpp: Add missing inclusion of
WebPageInspectorTargetFrontendChannel.h
2019-10-28 Per Arne Vollan <pvollan@apple.com>
[iOS] Fix sandbox violations
https://bugs.webkit.org/show_bug.cgi?id=203505
Reviewed by Brent Fulgham.
Running layout tests shows that allowing mach lookup is needed for a set of services which was previously denied.
This patch add rules for allowing these services again. The service 'com.apple.logd.events' is still denied, since
it has not been observed to be in use.
No new tests, covered by existing tests.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-10-28 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r251675.
Broke some builds
Reverted changeset:
"Remove unused WKWebsiteDataStore setter SPI"
https://bugs.webkit.org/show_bug.cgi?id=203114
https://trac.webkit.org/changeset/251675
2019-10-28 Wenson Hsieh <wenson_hsieh@apple.com>
Add bindings support for the enterkeyhint HTML attribute
https://bugs.webkit.org/show_bug.cgi?id=203440
Reviewed by Ryosuke Niwa.
Add a new runtime switch for the enterkeyhint attribute, and enable it by default on macOS and iOS.
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
2019-10-28 Alex Christensen <achristensen@webkit.org>
Remove unused _WKProcessPoolConfiguration SPI
https://bugs.webkit.org/show_bug.cgi?id=203066
Reviewed by Youenn Fablet.
After rdar://problem/56260478 this is not used, so away it goes!
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const): Deleted.
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
(WebKit::globalCTDataConnectionServiceType): Deleted.
(WebKit::NetworkSessionCocoa::ctDataConnectionServiceType const): Deleted.
(WebKit::NetworkSessionCocoa::setCTDataConnectionServiceType): Deleted.
* NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm:
(WebKit::NetworkConnectionToWebProcess::paymentCoordinatorCTDataConnectionServiceType):
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration suppressesConnectionTerminationOnSystemChange]): Deleted.
(-[_WKProcessPoolConfiguration setSuppressesConnectionTerminationOnSystemChange:]): Deleted.
(-[_WKProcessPoolConfiguration CTDataConnectionServiceType]): Deleted.
(-[_WKProcessPoolConfiguration setCTDataConnectionServiceType:]): Deleted.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::paymentCoordinatorCTDataConnectionServiceType):
2019-10-28 Alex Christensen <achristensen@webkit.org>
Remove unused WKWebsiteDataStore setter SPI
https://bugs.webkit.org/show_bug.cgi?id=203114
Reviewed by Anders Carlsson.
They have been replaced by _WKWebsiteDataStoreConfiguration SPI which was adopted in rdar://problem/56349165
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _setBoundInterfaceIdentifier:]): Deleted.
(-[WKWebsiteDataStore _boundInterfaceIdentifier]): Deleted.
(-[WKWebsiteDataStore _setAllowsCellularAccess:]): Deleted.
(-[WKWebsiteDataStore _allowsCellularAccess]): Deleted.
(-[WKWebsiteDataStore _setProxyConfiguration:]): Deleted.
(-[WKWebsiteDataStore _proxyConfiguration]): Deleted.
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::setBoundInterfaceIdentifier): Deleted.
(WebKit::WebsiteDataStore::setAllowsCellularAccess): Deleted.
(WebKit::WebsiteDataStore::setProxyConfiguration): Deleted.
2019-10-28 Brady Eidson <beidson@apple.com>
Expose _printOperationWithPrintInfo: SPI as API
<rdar://problem/36557179> and https://bugs.webkit.org/show_bug.cgi?id=203496
Reviewed by Andy Estes.
* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView printOperationWithPrintInfo:]):
(-[WKWebView _printOperationWithPrintInfo:]):
2019-10-28 Kate Cheney <katherine_cheney@apple.com>
Layout Test http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=203491
<rdar://problem/56674176>
Reviewed by Chris Dumez.
No new tests, this change is tested by the existing resourceLoadStatistics
tests.
This test started flaking when a new memory store was being created
between tests to maintain consistency. The call to grandfatherExistingWebsiteData
from populateMemoryStoreFromDisk in the persistent storage was
async, causing a race condition that led to occasional failures.
Adding a completion handler and changing the callsite of
populateMemoryStoreFromDisk should fix this problem.
* NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
* NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h:
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
The persistent store in the databaseEnabled case was never being used
and is unnecessary.
(WebKit::WebResourceLoadStatisticsStore::populateMemoryStoreFromDisk):
Since persistent storage only exists when using the memory store,
populateMemoryStoreFromDisk should check if
m_persistentStorage has been initialized.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setUseITPDatabase):
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
(WebKit::NetworkSession::recreateResourceLoadStatisticStore):
* NetworkProcess/NetworkSession.h:
2019-10-28 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] 3 editing/pasteboard/smart-paste-paragraph-* tests are flaky
https://bugs.webkit.org/show_bug.cgi?id=203264
<rdar://problem/56512107>
Reviewed by Tim Horton.
Fixes several flaky layout tests that exercise a corner case in our logic for caching position information
responses in the UI process. When focusing an element via a tap, we send a position information request for the
tap location in -_webTouchEventsRecognized:. After the web process computes the information and hands it back to
the UI process, we cache this in WKContentView's _positionInformation.
However, at the time of computing the request, the tapped element has not been focused yet, so the value of the
position information's nodeAtPositionIsFocusedElement flag is false. After the tap is recognized, we'll then
focus the element, such that if a subsequent position information request were to arrive at the same location,
it would have a nodeAtPositionIsFocusedElement flag set to true.
In this state, if the user taps _exactly_ at the same location again, UIKit (through text interaction gestures)
will ask us for information at the same point; we will end up using the cached information, for which
nodeAtPositionIsFocusedElement is false, causing us to incorrectly prevent the text interaction. In this
particular case, we fail to select text via a double tap gesture.
To address this, we invalidate the cached position information in the UI process whenever the focused element
rect changes (e.g. when the focused element changes); the only exception to this is when the previously cached
position information was not over the focused element, and the new focused element rect is empty, in which case
the value of nodeAtPositionIsFocusedElement is guaranteed to have not changed.
While this may potentially leads to an additional synchronous position information request when tapping at the
same location after focusing an element, this is very difficult to achieve in practice, since the tap location
would need to be _exactly_ at the same location.
No new test, since this is exercised by existing flaky layout tests.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
(-[WKContentView _elementDidBlur]):
Also, add a FIXME about how we clear out surprisingly little of _focusedElementInformation when blurring the
focused element.
(-[WKContentView _didChangeFocusedElementRect:toRect:]):
2019-10-28 John Wilander <wilander@apple.com>
Storage Access API: Make the API work with the experimental 3rd-party cookie blocking
https://bugs.webkit.org/show_bug.cgi?id=203428
<rdar://problem/56626949>
Reviewed by Alex Christensen.
Tests: http/tests/storageAccess/deny-due-to-no-interaction-under-general-third-party-cookie-blocking.html
http/tests/storageAccess/grant-with-prompt-under-general-third-party-cookie-blocking.html
http/tests/storageAccess/has-storage-access-under-general-third-party-cookie-blocking-with-cookie.html
http/tests/storageAccess/has-storage-access-under-general-third-party-cookie-blocking-without-cookie.html
This patch adds Storage Access API support for the experimental 3rd-party cookie blocking that
landed in <https://trac.webkit.org/changeset/251467>.
There are three policies at play because it can be changed with the experimental setting:
1. The underlying cookie policy.
2. Shipping ITP.
3. The off by default, experimental 3rd-party cookie blocking.
To support them all, a CookieAccess enum was added to encode how the API should respond.
The enum has these values:
CannotRequest - This third-party cannot request storage access based on the current policy.
BasedOnCookiePolicy – This third-party should be treated according to the underlying cookie policy.
OnlyIfGranted – This third-party can and must get access through the Storage Access API.
Here's the truth table I used to work through the logic for both
document.hasStorageAccess() and document.requestStorageAccess():
Access | Is | User | Has | 3rd-party | |
granted | prevalent | interaction | cookie | cookie block | RESULT |
-------------------------------------------------------------------
| | | |  | | false |
-------------------------------------------------------------------
| | | |  | true | false |
-------------------------------------------------------------------
| | | | true | | true |
-------------------------------------------------------------------
| | | | true | true | false |
-------------------------------------------------------------------
| | | true |  | | false |
-------------------------------------------------------------------
| | | true |  | true | false |
-------------------------------------------------------------------
| | | true | true | | true |
-------------------------------------------------------------------
| | | true | true | true | false |
-------------------------------------------------------------------
| | true | !care | !care | !care | false |
-------------------------------------------------------------------
| true | !care | !care | !care | !care | true |
-------------------------------------------------------------------
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::cookieAccess const):
(WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess):
(WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
(WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener):
Extra checks removed since there's no harm in granting access
to a third-party that already has access by way of the underlying
cookie policy. Also, this is a temporary compatibility fix.
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::cookieAccess const):
(WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
(WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
(WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
Extra checks removed since there's no harm in granting access
to a third-party that already has access by way of the underlying
cookie policy. Also, this is a temporary compatibility fix.
* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
* NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
(WebKit::ResourceLoadStatisticsStore::setIsThirdPartyCookieBlockingEnabled):
(WebKit::ResourceLoadStatisticsStore::isThirdPartyCookieBlockingEnabled const):
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::setIsThirdPartyCookieBlockingEnabled):
This is now the single path to control this setting in both ITP
and the network storage session. See comment below.
* NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setShouldBlockThirdPartyCookiesForTesting):
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
(WebKit::NetworkSession::setIsThirdPartyCookieBlockingEnabled):
Restructured these so that they are initiated like the rest of the
parameters and only have a single path for changes so that a
reset to consistent state resets all the state.
* NetworkProcess/NetworkSession.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2019-10-28 Alex Christensen <achristensen@webkit.org>
Remove unused NetworkProcessCreationParameters.urlSchemesRegisteredAsCanDisplayOnlyIfCanRequest
https://bugs.webkit.org/show_bug.cgi?id=203393
Reviewed by Chris Dumez.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::registerURLSchemeAsCanDisplayOnlyIfCanRequest):
2019-10-28 Carlos Alberto Lopez Perez <clopez@igalia.com>
[GTK][WPE] Enable CSS typed OM
https://bugs.webkit.org/show_bug.cgi?id=192875
Reviewed by Carlos Garcia Campos.
Enable the runtime feature by default on GTK/WPE when building with
experimental features enabled.
Covered by existing tests.
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
2019-10-28 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Simplify the Input Method implementation
https://bugs.webkit.org/show_bug.cgi?id=203149
Reviewed by Adrian Perez de Castro.
* Shared/NativeWebKeyboardEvent.h: Stop using WebCore::CompositionResults.
(WebKit::NativeWebKeyboardEvent::text const):
(WebKit::NativeWebKeyboardEvent::handledByInputMethod const):
(WebKit::NativeWebKeyboardEvent::fakedForComposition const):
* Shared/gtk/NativeWebKeyboardEventGtk.cpp: Ditto.
(WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent):
* Shared/gtk/WebEventFactory.cpp:
(WebKit::WebEventFactory::createWebKeyboardEvent): Ditto.
* Shared/gtk/WebEventFactory.h:
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::doneWithKeyEvent): Updated to use the new name.
* UIProcess/API/gtk/WebKitWebViewBase.cpp: Stop using WebCore::CompositionResults.
(webkitWebViewBaseKeyPressEvent):
(webkitWebViewBaseKeyReleaseEvent):
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h: Remove unused function.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setComposition): Use EditingRange instead of two integers and remove replacement range
that is unused.
(WebKit::WebPageProxy::confirmComposition): Remove unused selection range parameters.
* UIProcess/WebPageProxy.h:
* UIProcess/gtk/InputMethodFilter.cpp:
(WebKit::InputMethodFilter::handleKeyboardEvent):
(WebKit::InputMethodFilter::handleKeyboardEventWithCompositionResults):
(WebKit::InputMethodFilter::confirmComposition):
(WebKit::InputMethodFilter::updatePreedit):
(WebKit::InputMethodFilter::confirmCurrentComposition):
(WebKit::InputMethodFilter::sendCompositionAndPreeditWithFakeKeyEvents):
(WebKit::InputMethodFilter::logHandleKeyboardEventForTesting):
(WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting):
* UIProcess/gtk/InputMethodFilter.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::targetFrameForEditing): Receive a reference instead of a pointer.
(WebKit::WebPage::confirmComposition): Remove the unused code to handle the selection range.
(WebKit::WebPage::setComposition): Remove the unused code to handle the replacement range.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2019-10-27 Fujii Hironori <Hironori.Fujii@sony.com>
Unreviewed build fix for !ENABLE(MEDIA_STREAM) builds
https://bugs.webkit.org/show_bug.cgi?id=203362
<rdar://problem/56648232>
* UIProcess/UserMediaPermissionRequestProxy.h: Enclosed isUserGesturePriviledged with #if ENABLE(MEDIA_STREAM).
2019-10-21 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthn] Warn users when multiple NFC tags present
https://bugs.webkit.org/show_bug.cgi?id=200932
<rdar://problem/54890736>
Reviewed by Brent Fulgham.
This patch utilizes -[_WKWebAuthenticationPanelDelegate panel:updateWebAuthenticationPanel:] to
inform clients about multiple physical tags are presenting such that clients can instruct users
to select only one of them physically. Given a physical tag could have multiple different
interfaces, which NearField will treat them into different NFTags, the tagID is then used to
identify if there are actually multiple physical tags.
This patch also adds the ability to restart polling of a partiuclar NFReaderSession to NfcConnection
and the ability to restart the whole session to NfcService. The former is used to recover from errors
in the discovery stages, and the latter is used to recover from errors returned from authenticators
in the request stages. For the latter, given NfcConnection is not awared of the syntax of FIDO2/U2F
protocol, and CtapAuthenticator/U2fAuthenticator are not awared the transport of the underneath driver.
A generic restartDiscovery process is added to each service and it is up to the actual service to
implement the actual process such that AuthenticatorManager can arbitrarily call it after exceptions
are returned to restart the whole NFC session. To achieve restartDiscovery, NfcConnection is made
RefCounted as well such that both the NfcService and the CtapNfcDriver could hold it at the same time.
CtapNfcDriver uses the connection to complete requests as before while NfcService has the new capability
to use it to stop the current session when restartDiscovery kicks off.
* Platform/spi/Cocoa/NearFieldSPI.h:
* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManager::serviceStatusUpdated):
(WebKit::AuthenticatorManager::respondReceived):
(WebKit::AuthenticatorManager::restartDiscovery):
* UIProcess/WebAuthentication/AuthenticatorManager.h:
* UIProcess/WebAuthentication/AuthenticatorTransportService.cpp:
(WebKit::AuthenticatorTransportService::startDiscovery):
(WebKit::AuthenticatorTransportService::restartDiscovery):
* UIProcess/WebAuthentication/AuthenticatorTransportService.h:
(WebKit::AuthenticatorTransportService::restartDiscoveryInternal):
* UIProcess/WebAuthentication/Cocoa/NfcConnection.h:
* UIProcess/WebAuthentication/Cocoa/NfcConnection.mm:
(WebKit::NfcConnection::create):
(WebKit::NfcConnection::NfcConnection):
(WebKit::NfcConnection::~NfcConnection):
(WebKit::NfcConnection::stop const):
(WebKit::NfcConnection::didDetectTags):
(WebKit::NfcConnection::restartPolling):
(WebKit::NfcConnection::startPolling):
(WebKit::NfcConnection::didDetectTags const): Deleted.
* UIProcess/WebAuthentication/Cocoa/NfcService.h:
* UIProcess/WebAuthentication/Cocoa/NfcService.mm:
(WebKit::NfcService::NfcService):
(WebKit::NfcService::didConnectTag):
(WebKit::NfcService::didDetectMultipleTags const):
(WebKit::NfcService::setConnection):
(WebKit::NfcService::restartDiscoveryInternal):
(WebKit::NfcService::platformStartDiscovery):
(WebKit::NfcService::setDriver): Deleted.
* UIProcess/WebAuthentication/Mock/MockNfcService.h:
* UIProcess/WebAuthentication/Mock/MockNfcService.mm:
(-[WKMockNFTag tagID]):
(-[WKMockNFTag initWithNFTag:]):
(-[WKMockNFTag dealloc]):
(-[WKMockNFTag initWithType:]):
(-[WKMockNFTag initWithType:tagID:]):
(WebKit::MockNfcService::receiveStopPolling):
(WebKit::MockNfcService::receiveStartPolling):
(WebKit::MockNfcService::platformStartDiscovery):
(WebKit::MockNfcService::detectTags):
(WebKit::MockNfcService::detectTags const): Deleted.
* UIProcess/WebAuthentication/fido/CtapNfcDriver.cpp:
(WebKit::CtapNfcDriver::CtapNfcDriver):
* UIProcess/WebAuthentication/fido/CtapNfcDriver.h:
* UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp:
2019-10-26 youenn fablet <youenn@apple.com>
Enforce user gesture for getUserMedia in case a previous getUserMedia call was denied
https://bugs.webkit.org/show_bug.cgi?id=203362
Reviewed by Eric Carlson.
In case the request has user gesture priviledge, do not look at denied request history.
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::getRequestAction):
* UIProcess/UserMediaPermissionRequestProxy.h:
(WebKit::UserMediaPermissionRequestProxy::isUserGesturePriviledged const):
2019-10-26 Chris Lord <clord@igalia.com>
Put OffscreenCanvas behind a build flag
https://bugs.webkit.org/show_bug.cgi?id=203146
Reviewed by Ryosuke Niwa.
Split the ImageBitmapOffscreenCanvas setting into two separate
settings so OffscreenCanvas can be disabled at build time.
* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::WebInspectorUI):
2019-10-25 Chris Dumez <cdumez@apple.com>
REGRESSION(r251599): Crash in MobileSafari tests (ASSERTION FAILED: m_pendingRequestToSuspendID)
https://bugs.webkit.org/show_bug.cgi?id=203437
<rdar://problem/56633399>
Reviewed by Geoffrey Garen.
* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::updateAssertionIfNeeded):
Start the timer before sending the PrepareToSuspend IPC. The reason is that if the process has been
terminated, the completion handler may run synchronously and cancel the request to suspend / stop
the timer. Therefore, re-starting the timer after would be a mistake.
2019-10-25 David Kilzer <ddkilzer@apple.com>
Unused arguments in MESSAGE_CHECK_CONTEXTID() macros
<https://webkit.org/b/203389>
<rdar://problem/55935374>
Reviewed by Alex Christensen.
* UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
(#define MESSAGE_CHECK_CONTEXTID):
- Rename macro argument from `contextID` to `identifier`
and change `contextId`to `identifier` in the body of
the macro so that the argument is always used.
(WebKit::PlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID):
(WebKit::PlaybackSessionManagerProxy::currentTimeChanged):
(WebKit::PlaybackSessionManagerProxy::bufferedTimeChanged):
(WebKit::PlaybackSessionManagerProxy::seekableRangesVectorChanged):
(WebKit::PlaybackSessionManagerProxy::canPlayFastReverseChanged):
(WebKit::PlaybackSessionManagerProxy::audioMediaSelectionOptionsChanged):
(WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionOptionsChanged):
(WebKit::PlaybackSessionManagerProxy::audioMediaSelectionIndexChanged):
(WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionIndexChanged):
(WebKit::PlaybackSessionManagerProxy::externalPlaybackPropertiesChanged):
(WebKit::PlaybackSessionManagerProxy::wirelessVideoPlaybackDisabledChanged):
(WebKit::PlaybackSessionManagerProxy::mutedChanged):
(WebKit::PlaybackSessionManagerProxy::volumeChanged):
(WebKit::PlaybackSessionManagerProxy::durationChanged):
(WebKit::PlaybackSessionManagerProxy::playbackStartedTimeChanged):
(WebKit::PlaybackSessionManagerProxy::rateChanged):
(WebKit::PlaybackSessionManagerProxy::pictureInPictureSupportedChanged):
(WebKit::PlaybackSessionManagerProxy::pictureInPictureActiveChanged):
(WebKit::PlaybackSessionManagerProxy::handleControlledElementIDResponse const):
- Change `contextID` to `contextId` to match local variable name
now that MESSAGE_CHECK_CONTEXTID() doesn't paper over this
typo for us.
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(#define MESSAGE_CHECK_CONTEXTID):
- Rename macro argument from `contextID` to `identifier`
and change `contextId`to `identifier` in the body of
the macro so that the argument is always used.
* UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
(#define MESSAGE_CHECK_CONTEXTID):
- Rename macro argument and variable in the body of the
macro from `id` to `identifier` for consistency.
2019-10-25 Per Arne Vollan <pvollan@apple.com>
[iOS] Fix sandbox violations seen while running layout tests
https://bugs.webkit.org/show_bug.cgi?id=203419
Reviewed by Brent Fulgham.
Deny mach lookup to 'com.apple.logd' and 'com.apple.logd.events' and suppress logs, since these are
believed to be unneeded in the WebContent process. Allow sysctl write to 'vm.footprint_suspend'.
Deny mach lookup to 'com.apple.system.notification_center' and suppress logs, since allowing this
is not believed to be needed in the WebContent process.
No new tests, covered by existing tests.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-10-25 Matt Lewis <jlewis3@apple.com>
Rolling out r251579,r251162,r251512,r251500, and r251498 for build failures
and test failures
Unreviewed rollout.
* Platform/spi/Cocoa/NearFieldSPI.h:
* UIProcess/API/APIWebAuthenticationPanel.cpp:
(API::WebAuthenticationPanel::create):
(API::WebAuthenticationPanel::WebAuthenticationPanel):
* UIProcess/API/APIWebAuthenticationPanel.h:
* UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h:
* UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
(-[_WKWebAuthenticationPanel relyingPartyID]):
(wkWebAuthenticationTransport): Deleted.
(-[_WKWebAuthenticationPanel transports]): Deleted.
(wkWebAuthenticationType): Deleted.
(-[_WKWebAuthenticationPanel type]): Deleted.
* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::WebCore::collectTransports):
(WebKit::AuthenticatorManager::handleRequest):
(WebKit::AuthenticatorManager::respondReceived):
(WebKit::AuthenticatorManager::respondReceivedInternal):
(WebKit::AuthenticatorManager::startDiscovery):
(WebKit::AuthenticatorManager::initTimeOutTimer):
(WebKit::AuthenticatorManager::runPanel):
(WebKit::AuthenticatorManager::startRequest):
(WebKit::AuthenticatorManager::invokePendingCompletionHandler):
(WebKit::WebCore::getClientDataType): Deleted.
(WebKit::AuthenticatorManager::serviceStatusUpdated): Deleted.
(WebKit::AuthenticatorManager::filterTransports const): Deleted.
(WebKit::AuthenticatorManager::getTransports const): Deleted.
(WebKit::AuthenticatorManager::restartDiscovery): Deleted.
* UIProcess/WebAuthentication/AuthenticatorManager.h:
(WebKit::AuthenticatorManager::respondReceivedInternal): Deleted.
* UIProcess/WebAuthentication/AuthenticatorTransportService.cpp:
(WebKit::AuthenticatorTransportService::startDiscovery):
(WebKit::AuthenticatorTransportService::restartDiscovery): Deleted.
* UIProcess/WebAuthentication/AuthenticatorTransportService.h:
(WebKit::AuthenticatorTransportService::restartDiscoveryInternal): Deleted.
* UIProcess/WebAuthentication/Cocoa/NfcConnection.h:
* UIProcess/WebAuthentication/Cocoa/NfcConnection.mm:
(WebKit::NfcConnection::NfcConnection):
(WebKit::NfcConnection::~NfcConnection):
(WebKit::NfcConnection::didDetectTags const):
(WebKit::NfcConnection::create): Deleted.
(WebKit::NfcConnection::stop const): Deleted.
(WebKit::NfcConnection::didDetectTags): Deleted.
(WebKit::NfcConnection::restartPolling): Deleted.
(WebKit::NfcConnection::startPolling): Deleted.
* UIProcess/WebAuthentication/Cocoa/NfcService.h:
* UIProcess/WebAuthentication/Cocoa/NfcService.mm:
(WebKit::NfcService::NfcService):
(WebKit::NfcService::didConnectTag):
(WebKit::NfcService::setDriver):
(WebKit::NfcService::platformStartDiscovery):
(WebKit::NfcService::isAvailable): Deleted.
(WebKit::NfcService::didDetectMultipleTags const): Deleted.
(WebKit::NfcService::setConnection): Deleted.
(WebKit::NfcService::restartDiscoveryInternal): Deleted.
* UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
(WebKit::MockAuthenticatorManager::filterTransports const): Deleted.
* UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.h:
* UIProcess/WebAuthentication/Mock/MockNfcService.h:
* UIProcess/WebAuthentication/Mock/MockNfcService.mm:
(-[WKMockNFTag initWithNFTag:]):
(-[WKMockNFTag dealloc]):
(-[WKMockNFTag initWithType:]):
(WebKit::MockNfcService::platformStartDiscovery):
(WebKit::MockNfcService::detectTags const):
(-[WKMockNFTag tagID]): Deleted.
(-[WKMockNFTag initWithType:tagID:]): Deleted.
(WebKit::MockNfcService::receiveStopPolling): Deleted.
(WebKit::MockNfcService::receiveStartPolling): Deleted.
* UIProcess/WebAuthentication/fido/CtapNfcDriver.cpp:
(WebKit::CtapNfcDriver::CtapNfcDriver):
* UIProcess/WebAuthentication/fido/CtapNfcDriver.h:
* UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp:
2019-10-24 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS 13] fast/forms/ios/accessory-bar-navigation.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=203294
<rdar://problem/54520848>
Reviewed by Tim Horton.
Add an SPI declaration (as well as an internal-SKD-only header import) for UIKeyboardPreferencesController.
See Tools/ChangeLog for more details.
* Platform/spi/ios/UIKitSPI.h:
2019-10-24 Ryosuke Niwa <rniwa@webkit.org>
Add exclusion rules to text manipulation SPI
https://bugs.webkit.org/show_bug.cgi?id=203398
<rdar://problem/56567256>
Reviewed by Wenson Hsieh.
Added SPI to specify the configuration for the text manipulation (see r251574), in particular, the set of rules
governing which content should be excluded or included in text manipulations.
Test: TextManipulation.StartTextManipulationExitEarlyWithoutDelegate
* SourcesCocoa.txt:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _startTextManipulationsWithConfiguration:completion:]): Takes _WKTextManipulationConfiguration
as an argument. Also fixed a bug that we weren't calling the completion handler when the delegate was not set.
(-[WKWebView _completeTextManipulation:completion:]):
(-[WKWebView _startTextManipulationsWithCompletionHandler:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKTextManipulationConfiguration.h: Added.
* UIProcess/API/Cocoa/_WKTextManipulationConfiguration.mm: Added.
* UIProcess/API/Cocoa/_WKTextManipulationExclusionRule.h: Added.
* UIProcess/API/Cocoa/_WKTextManipulationExclusionRule.mm: Added.
(-[_WKTextManipulationExclusionRule initExclusion:forElement:]): Added.
(-[_WKTextManipulationExclusionRule initExclusion:forAttribute:value:]): Added.
(-[_WKTextManipulationExclusionRule elementName]): Added.
(-[_WKTextManipulationExclusionRule attributeName]): Added.
(-[_WKTextManipulationExclusionRule attributeValue]): Added.
* UIProcess/API/Cocoa/_WKTextManipulationToken.h: Added excluded boolean property.
* UIProcess/API/Cocoa/_WKTextManipulationToken.mm: Removed the superflous import of RetainPtr.h
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::startTextManipulations):
(WebKit::WebPageProxy::completeTextManipulation):
* UIProcess/WebPageProxy.h:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::startTextManipulations):
(WebKit::WebPage::completeTextManipulation):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2019-10-25 Chris Dumez <cdumez@apple.com>
[iOS][WK2] Use sendWithAsyncReply() to simplify the prepareToSuspend logic
https://bugs.webkit.org/show_bug.cgi?id=203422
Reviewed by Alex Christensen.
Use sendWithAsyncReply() to simplify the prepareToSuspend logic and make it easier to
understand.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::processWillSuspendImminentlyForTestingSync):
(WebKit::NetworkProcess::prepareToSuspend):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _processWillSuspendImminentlyForTesting]):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::sendPrepareToSuspend):
(WebKit::NetworkProcessProxy::processReadyToSuspend): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::processReadyToSuspend):
(WebKit::ProcessThrottler::sendPrepareToSuspendIPC):
* UIProcess/ProcessThrottler.h:
* UIProcess/ProcessThrottlerClient.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::sendPrepareToSuspend):
(WebKit::WebProcessProxy::processReadyToSuspend): Deleted.
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::prepareToSuspend):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
2019-10-25 youenn fablet <youenn@apple.com>
WebProcess should unregister its interest for a SWServerRegistration when all its corresponding ServiceWorkerRegistrations are destroyed
https://bugs.webkit.org/show_bug.cgi?id=203410
Reviewed by Chris Dumez.
A SWServerRegistration is keeping a list of web processes that should be notified of change to its state.
Previously, WebProcesses were registering their interest to a SWServerRegistration on construction of a ServiceWorkerRegistration,
and unregistering their interest on destruction of a ServiceWorkerRegistration.
This does not work in case two ServiceWorkerRegistrations are created for the same SWServerRegistration in the same WebProcess.
In that case, when one of the two ServiceWorkerRegistration is destroyed, the WebProcess will no longer be notified of changes to the SWServerRegistration,
thus breaking the second ServiceWorkerRegistration behavior.
We introduce a map at WebProcess level to keep track of the number of ServiceWorkerRegistration created for a given SWServerRegistration.
Covered by re-enabled tests.
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
(WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::addServiceWorkerRegistration):
(WebKit::WebProcess::removeServiceWorkerRegistration):
* WebProcess/WebProcess.h:
2019-10-25 youenn fablet <youenn@apple.com>
mp4 video element broken with service worker
https://bugs.webkit.org/show_bug.cgi?id=184447
<rdar://problem/39313155>
Reviewed by Chris Dumez.
Make a response as range-requested as per https://fetch.spec.whatwg.org/#http-network-or-cache-fetch step 15.
* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::checkRedirection):
(WebKit::NetworkLoadChecker::validateResponse):
* NetworkProcess/NetworkLoadChecker.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didReceiveResponse):
(WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
2019-10-25 Chris Dumez <cdumez@apple.com>
[iOS] Regression(r251067) WebProcesses with service workers no longer keep their network process alive
https://bugs.webkit.org/show_bug.cgi?id=203388
<rdar://problem/56600074>
Reviewed by Geoffrey Garen.
Historically, WebProcessProxy::didSetAssertionState() used to return early for service worker processes
because we did not want service worker processes to prevent the network process from suspending. The
WebProcesses using the service worker process would prevent the network process from suspending when
they are visible, so it would work fine.
However, after r251067, there is no longer a concept of service worker process per se. Service workers
will now sometimes run in regular WebProcesses where we have pages. In such cases, didSetAssertionState()
would still return early and fail to keep its network process alive, even when the page(s) in this process
are visible on screen.
To address the issue, we now only return early if the process has a service worker but no page.
This should restore pre-existing behavior.
Note that this was causing hangs such as <rdar://problem/56245136> because the WebProcess would be
stuck on sync IPC to a suspended network process.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didSetAssertionState):
2019-10-25 Chris Dumez <cdumez@apple.com>
Standardize "PageID=" vs "pageID =" in release logging
https://bugs.webkit.org/show_bug.cgi?id=203002
Reviewed by Geoffrey Garen.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLayerTree:]):
(-[WKWebView _updateVisibleContentRects]):
(-[WKWebView _cancelAnimatedResize]):
(-[WKWebView _didCompleteAnimatedResize]):
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
(-[WKWebView _endAnimatedResize]):
(-[WKWebView _resizeWhileHidingContentWithUpdates:]):
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::processDidTerminate):
(WebKit::ProvisionalPageProxy::cancel):
(WebKit::ProvisionalPageProxy::loadData):
(WebKit::ProvisionalPageProxy::loadRequest):
(WebKit::ProvisionalPageProxy::goToBackForwardItem):
(WebKit::ProvisionalPageProxy::didCreateMainFrame):
(WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
(WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
(WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::loadResource):
(WebKit::WebLoaderStrategy::scheduleLoad):
(WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler):
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
(WebKit::WebLoaderStrategy::loadResourceSynchronously):
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::willSendRequest):
(WebKit::WebResourceLoader::didReceiveResponse):
(WebKit::WebResourceLoader::didReceiveData):
(WebKit::WebResourceLoader::didFinishResourceLoad):
(WebKit::WebResourceLoader::serviceWorkerDidNotHandle):
(WebKit::WebResourceLoader::didFailResourceLoad):
(WebKit::WebResourceLoader::didBlockAuthenticationChallenge):
(WebKit::WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied):
(WebKit::WebResourceLoader::didReceiveResource):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
(WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::freezeLayerTree):
(WebKit::WebPage::unfreezeLayerTree):
2019-10-24 Chris Dumez <cdumez@apple.com>
Simplify ProcessThrottler implementation
https://bugs.webkit.org/show_bug.cgi?id=203370
Reviewed by Alex Christensen.
Simplify ProcessThrottler implementation by:
- Getting rid of CancelPrepareToSuspend IPC. Instead a regular ProcessDidResume IPC is sent to
the child process.
- Getting rid of the ProcessWillSuspendImminently IPC and send a regular ProcessDidResume IPC
with a 'isSuspensionImminent' flag instead.
- Whether the suspension is imminent or not, the child process now always responds with
a ProcessReadyToSuspend IPC. This simplifies our logic as the idea is that treating imminent
and non-imminent suspension should share as much of the same logic as possible.
- All PrepareToSuspend IPCs now have an associated identifier and the child process sends back
this identifier when responding with a ProcessReadyToSuspend IPC. This allows the
ProcessThrottler to easily ignore outdated requests to suspend, without requiring the
m_suspendMessageCount data member we had.
This patch also adds more logging to ProcessThrottler and the suspension logic in the child
processes. All ProcessThrottler logging now also shows the child process's PID for clarity.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::processWillSuspendImminentlyForTestingSync):
(WebKit::NetworkProcess::prepareToSuspend):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _processWillSuspendImminentlyForTesting]):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::sendPrepareToSuspend):
(WebKit::NetworkProcessProxy::processReadyToSuspend):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/ProcessThrottler.cpp:
(WebKit::generatePrepareToSuspendRequestID):
(WebKit::ProcessThrottler::ProcessThrottler):
(WebKit::m_backgroundCounter):
(WebKit::ProcessThrottler::expectedAssertionState):
(WebKit::ProcessThrottler::updateAssertionStateNow):
(WebKit::ProcessThrottler::setAssertionState):
(WebKit::ProcessThrottler::updateAssertionIfNeeded):
(WebKit::ProcessThrottler::didConnectToProcess):
(WebKit::ProcessThrottler::prepareToSuspendTimeoutTimerFired):
(WebKit::ProcessThrottler::processReadyToSuspend):
(WebKit::ProcessThrottler::clearPendingRequestToSuspend):
(WebKit::ProcessThrottler::sendPrepareToSuspendIPC):
(WebKit::ProcessThrottler::uiAssertionWillExpireImminently):
* UIProcess/ProcessThrottler.h:
* UIProcess/ProcessThrottlerClient.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::sendPrepareToSuspend):
(WebKit::WebProcessProxy::processReadyToSuspend):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::prepareToSuspend):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
2019-10-23 Ryosuke Niwa <rniwa@webkit.org>
Add a mechanism to find and manipulate text by paragraphs
https://bugs.webkit.org/show_bug.cgi?id=203286
Reviewed by Wenson Hsieh.
This patch introduces a new SPI to find paragraphs of text and let client replace the content of each paragraph.
For now, this SPI is limited to find & replace contents of main frame's document.
WKWebView's _startTextManipulationsWithCompletionHandler sends StartTextManipulations message to WebContent process
to find all paragraphs in the main frame. WebContent process will send back DidFindTextManipulationItem message
for each paragraph, which in turn calls back _WKTextManipulationDelegate's _webView: didFindTextManipulationItem:.
Upon receiving this delegate callback, the client can invoke WKWebView's _completeTextManipulation to replace
the content. It will send CompleteTextManipulation to WebContent process, which will invoke completeManipulation
on main frame's document's TextManipulationController.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _textManipulationDelegate]): Aded.
(-[WKWebView _setTextManipulationDelegate:]): Aded.
(-[WKWebView _startTextManipulationsWithCompletionHandler:]):
(-[WKWebView _completeTextManipulation:completion:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKTextManipulationDelegate.h: Added.
* UIProcess/API/Cocoa/_WKTextManipulationItem.h: Added.
* UIProcess/API/Cocoa/_WKTextManipulationItem.mm: Added.
(-[_WKTextManipulationItem initWithIdentifier:tokens:]):
(-[_WKTextManipulationItem identifier]):
(-[_WKTextManipulationItem tokens]):
* UIProcess/API/Cocoa/_WKTextManipulationToken.h: Added.
* UIProcess/API/Cocoa/_WKTextManipulationToken.mm: Added.
(-[_WKTextManipulationToken init]):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::startTextManipulations):
(WebKit::WebPageProxy::didFindTextManipulationItem):
(WebKit::WebPageProxy::completeTextManipulation):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::startTextManipulations):
(WebKit::WebPage::completeTextManipulation):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2019-10-24 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r251558.
This broke internal builds
Reverted changeset:
"Add a mechanism to find and manipulate text by paragraphs"
https://bugs.webkit.org/show_bug.cgi?id=203286
https://trac.webkit.org/changeset/251558
2019-10-24 Alex Christensen <achristensen@webkit.org>
REGRESSION(r251409) Service worker connection should not be established without service worker entitlement
https://bugs.webkit.org/show_bug.cgi?id=203385
<rdar://problem/37790257>
Reviewed by Chris Dumez.
r251409 introduced a new call to establishSWServerConnection that should have an entitlement check.
This was caught by a unit test in CI that is not easy to reproduce in WebKit's test. See the radar.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
2019-10-24 Brent Fulgham <bfulgham@apple.com>
[iOS] Mismatch in com.apple.coremedia.audiodeviceclock declarations
https://bugs.webkit.org/show_bug.cgi?id=203367
<rdar://problem/56581166>
Reviewed by Per Arne Vollan.
The 'common.sb' sandbox allows access to "com.apple.coremedia.audiodeviceclock.xpc", but
the WebContent sandbox blocked access to "com.apple.coremedia.audiodeviceclock". This means
we aren't blocking that endpoint.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-10-24 Brent Fulgham <bfulgham@apple.com>
[iOS] Mismatch in com.apple.MediaPlayer.RemotePlayerService declarations
https://bugs.webkit.org/show_bug.cgi?id=203368
<rdar://problem/56581152>
Reviewed by Per Arne Vollan.
The 'common.sb' sandbox allows access to the xpc-service-name "com.apple.MediaPlayer.RemotePlayerService",
but we block access to the global-name "com.apple.MediaPlayer.RemoteService". We aren't blocking
the right thing.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-10-24 Brady Eidson <beidson@apple.com>
Expose pageZoom as API.
https://bugs.webkit.org/show_bug.cgi?id=203381
Reviewed by Andy Estes.
No new tests (No behavior change, identical to SPI)
* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView setPageZoom:]):
(-[WKWebView pageZoom]):
(-[WKWebView _pageZoomFactor]):
(-[WKWebView _setPageZoomFactor:]):
2019-10-23 Ryosuke Niwa <rniwa@webkit.org>
Add a mechanism to find and manipulate text by paragraphs
https://bugs.webkit.org/show_bug.cgi?id=203286
Reviewed by Wenson Hsieh.
This patch introduces a new SPI to find paragraphs of text and let client replace the content of each paragraph.
For now, this SPI is limited to find & replace contents of main frame's document.
WKWebView's _startTextManipulationsWithCompletionHandler sends StartTextManipulations message to WebContent process
to find all paragraphs in the main frame. WebContent process will send back DidFindTextManipulationItem message
for each paragraph, which in turn calls back _WKTextManipulationDelegate's _webView: didFindTextManipulationItem:.
Upon receiving this delegate callback, the client can invoke WKWebView's _completeTextManipulation to replace
the content. It will send CompleteTextManipulation to WebContent process, which will invoke completeManipulation
on main frame's document's TextManipulationController.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _textManipulationDelegate]): Aded.
(-[WKWebView _setTextManipulationDelegate:]): Aded.
(-[WKWebView _startTextManipulationsWithCompletionHandler:]):
(-[WKWebView _completeTextManipulation:completion:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKTextManipulationDelegate.h: Added.
* UIProcess/API/Cocoa/_WKTextManipulationItem.h: Added.
* UIProcess/API/Cocoa/_WKTextManipulationItem.mm: Added.
(-[_WKTextManipulationItem initWithIdentifier:tokens:]):
(-[_WKTextManipulationItem identifier]):
(-[_WKTextManipulationItem tokens]):
* UIProcess/API/Cocoa/_WKTextManipulationToken.h: Added.
* UIProcess/API/Cocoa/_WKTextManipulationToken.mm: Added.
(-[_WKTextManipulationToken init]):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::startTextManipulations):
(WebKit::WebPageProxy::didFindTextManipulationItem):
(WebKit::WebPageProxy::completeTextManipulation):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::startTextManipulations):
(WebKit::WebPage::completeTextManipulation):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
2019-10-24 Brent Fulgham <bfulgham@apple.com>
Unreviewed fix after r251511.
Some syctl names were omitted from the initial checkin.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-10-24 Brady Eidson <beidson@apple.com>
Formalize PDF snapshot API.
https://bugs.webkit.org/show_bug.cgi?id=203374
Reviewed by Tim Horton.
Covered by API tests and MiniBrowser usage.
* SourcesCocoa.txt:
* UIProcess/API/Cocoa/WKPDFConfiguration.h: Added.
* UIProcess/API/Cocoa/WKPDFConfiguration.mm: Added.
(-[WKPDFConfiguration init]):
(-[WKPDFConfiguration copyWithZone:]):
* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView createPDFWithConfiguration:completionHandler:]):
(-[WKWebView _takePDFSnapshotWithConfiguration:completionHandler:]):
* UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h: Unified build strikes again.
* WebKit.xcodeproj/project.pbxproj:
2019-10-24 Brent Fulgham <bfulgham@apple.com>
[iOS] Remove 'deny' rules that do not have a corresponding 'allow' rule
https://bugs.webkit.org/show_bug.cgi?id=203352
Reviewed by Per Arne Vollan.
Now that we no longer import 'common.sb', and have removed entries that allowed
services that we block, we can remove the 'deny' command. This is safe because
everything is denied by default.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-10-24 Alex Christensen <achristensen@webkit.org>
Pass CORS-enabled schemes through WebProcess instead of having them NetworkProcess-global
https://bugs.webkit.org/show_bug.cgi?id=202891
Reviewed by Youenn Fablet.
No change in behavior. Now the LegacySchemeRegistry is not used as much in the NetworkProcess, a step towards no use at all.
This functionality is currently only available through the glib API webkit_security_manager_register_uri_scheme_as_cors_enabled
but it has been requested in bug 201180 and bug 199064.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
(WebKit::NetworkConnectionToWebProcess::loadPing):
(WebKit::NetworkConnectionToWebProcess::registerURLSchemesAsCORSEnabled):
* NetworkProcess/NetworkConnectionToWebProcess.h:
(WebKit::NetworkConnectionToWebProcess::schemeRegistry):
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::NetworkLoadChecker):
(WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
* NetworkProcess/NetworkLoadChecker.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::registerURLSchemeAsCORSEnabled const): Deleted.
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
* NetworkProcess/NetworkSchemeRegistry.cpp: Added.
(WebKit::NetworkSchemeRegistry::registerURLSchemeAsCORSEnabled):
(WebKit::NetworkSchemeRegistry::shouldTreatURLSchemeAsCORSEnabled):
* NetworkProcess/NetworkSchemeRegistry.h: Added.
(WebKit::NetworkSchemeRegistry::create):
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::PingLoad):
Use nullptr, indicating that the PingLoad constructor that is used in ad click attribution should not check the custom scheme registry.
This is Ok because ad click attribution is only used for HTTP family schemes.
(WebKit::m_blobFiles):
* NetworkProcess/PingLoad.h:
* Sources.txt:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::registerURLSchemeAsCORSEnabled):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::registerURLSchemeAsCORSEnabled):
(WebKit::WebProcess::ensureNetworkProcessConnection):
(WebKit::WebProcess::registerURLSchemeAsCORSEnabled const): Deleted.
* WebProcess/WebProcess.h:
2019-10-24 Carlos Alberto Lopez Perez <clopez@igalia.com>
[GTK][WPE] Enable runtime setting with experimental features for Server Timing API
https://bugs.webkit.org/show_bug.cgi?id=203295
Reviewed by Carlos Garcia Campos.
Enable the runtime ServerTiming by default when GTK or WPE is built
with experimental features enabled.
No new tests, no change in behaviour for WTR.
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
2019-10-23 Chris Dumez <cdumez@apple.com>
WebBackForwardCache::removeEntriesMatching() may re-enter and crash
https://bugs.webkit.org/show_bug.cgi?id=203341
<rdar://problem/56553939>
Reviewed by Geoffrey Garen.
When WebBackForwardCache::removeEntriesMatching() was clearing the WebBackForwardListItem's
WebBackForwardCacheEntry, it could destroyed a SuspendedPageProxy which could shutdown a
WebProcess. Upon shutting down, we would try to remove WebBackForwardCache entries associated
with a given process, re-enter removeEntriesMatching() and crash.
To address the issue, I made WebBackForwardCache::removeEntriesMatching() safe to re-enter.
We now clear the WebBackForwardListItems' WebBackForwardCacheEntries only after we're done
updating m_itemsWithCachedPage.
* UIProcess/WebBackForwardCache.cpp:
(WebKit::WebBackForwardCache::removeEntriesMatching):
2019-10-23 Megan Gardner <megan_gardner@apple.com>
Rename force-press-related functions to refer to context menus, and fix a former force-press test
https://bugs.webkit.org/show_bug.cgi?id=202663
<rdar://problem/52699530>
Reviewed by Dean Jackson.
Add plumbing for contextMenu tests to function again, and rename all
relevant fuctions to more correctly reflect that this does not specifically
require a force press to activate any longer.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didShowContextMenu]):
(-[WKWebView _didDismissContextMenu]):
(-[WKWebView _didShowForcePressPreview]): Deleted.
(-[WKWebView _didDismissForcePressPreview]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _contextMenuInteraction:configurationForMenuAtLocation:completion:]):
(-[WKContentView _presentedViewControllerForPreviewItemController:]):
(-[WKContentView _previewItemController:didDismissPreview:committing:]):
(-[WKContentView _previewItemControllerDidCancelPreview:]):
2019-10-23 Tim Horton <timothy_horton@apple.com>
macCatalyst: Should dispatch contextmenu event on right click
https://bugs.webkit.org/show_bug.cgi?id=203316
<rdar://problem/54617376>
Reviewed by Wenson Hsieh.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::isContextClick):
(WebKit::handleContextMenuEvent):
(WebKit::WebPage::contextMenuForKeyEvent):
(WebKit::handleMouseEvent):
* WebProcess/WebPage/WebPage.h:
2019-10-23 Brent Fulgham <bfulgham@apple.com>
[iOS] Stop including 'common.sb'
https://bugs.webkit.org/show_bug.cgi?id=203318
Reviewed by Per Arne Vollan.
Replace the 'import' of common.sb with the equivalent statements. This is the
first step in a task to remove uneeded sandbox rules.
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2019-10-23 Kate Cheney <katherine_cheney@apple.com>
Implement dumpResourceLoadStatistics in SQLite ITP Database
https://bugs.webkit.org/show_bug.cgi?id=203224
<rdar://problem/56482165>
Reviewed by John Wilander.
This patch implements dumpResourceLoadStatistics() in the ITP database
store. This function required a boolean flag isScheduledForWebsiteDataRemoval that
now must be stored in the database, resulting in a small schema change.
Because of the schema change, this patch also compares any existing
database file against the new schema, and deletes the existing file if the schema is
not current.
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
The logic for topFrameLinkDecorationsFromQuery was the opposite
of all other "xyzFrom" queries. When merging data from the memory
store, the load statistic being inserted holds a list of topFrames
which it has been redirected to from. I think it makes more sense
to also organize the table this way.
(WebKit::ObservedDomainsTableSchemaV1):
(WebKit::ObservedDomainsTableSchemaV1Alternate):
For support on both iOS and MacOS, there are two CREATE TABLE queries
to compare to, depending on whether the query result contains quotes
around the table name.
(WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
(WebKit::ResourceLoadStatisticsDatabaseStore::openITPDatabase):
(WebKit::ResourceLoadStatisticsDatabaseStore::openAndDropOldDatabaseIfNecessary):
The code to check for the current schema was adapted from SQLiteIDBBackingStore.cpp
(WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
(WebKit::ResourceLoadStatisticsDatabaseStore::insertObservedDomain):
(WebKit::ResourceLoadStatisticsDatabaseStore::ensureAndMakeDomainList):
The previous naming of the list parameter in this function was
confusing because it is used by many different relationships not just
subframes under top frames.
(WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationshipList):
topFrameLinkDecorationsFrom were never inserted into the database.
(WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships):
(WebKit::ResourceLoadStatisticsDatabaseStore::merge):
(WebKit::ResourceLoadStatisticsDatabaseStore::mergeStatistic):
Since the statement to get all data for a given domain is now used in
multiple places, I stored the query as a constexpr auto.
(WebKit::ResourceLoadStatisticsDatabaseStore::logCrossSiteLoadWithLinkDecoration):
Matched the memory store functionality, which calls the boolean
"gotLinkDecorationFromPrevalentResource." I thought isScheduledForWebsiteDataRemoval
would be more clear of a name, because this flag gets cleared even when
prevalent top frame link decorations for this domain still exist in the table.
(WebKit::ResourceLoadStatisticsDatabaseStore::dumpResourceLoadStatistics):
(WebKit::ResourceLoadStatisticsDatabaseStore::setIsScheduledForWebsiteDataRemoval):
(WebKit::ResourceLoadStatisticsDatabaseStore::prevalentDomains): Deleted.
(WebKit::ResourceLoadStatisticsDatabaseStore::domains):
To match memory store functionality, the check for website data to
delete should check all domains, not just prevalent ones.
(WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUnexpiredRecentUserInteraction):
(WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllWebsiteDataFor):
This now needs to check if the resource is prevalent, because it is
no longer guaranteed.
(WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllButCookiesFor):
(WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor):
(WebKit::ResourceLoadStatisticsDatabaseStore::getDomainStringFromDomainID):
(WebKit::ResourceLoadStatisticsDatabaseStore::getSubStatisticStatement):
(WebKit::ResourceLoadStatisticsDatabaseStore::appendSubStatisticList):
(WebKit::ResourceLoadStatisticsDatabaseStore::resourceToString):
This functionality matches the toString function in
ResourceLoadStatistics.cpp.
(WebKit::CompletionHandler<void):
* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
2019-10-23 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: notify inspector when provisional page is created, committed and destroyed
https://bugs.webkit.org/show_bug.cgi?id=202704
Reviewed by Devin Rousso.
Target.targetCreated event is now generated for provisional pages as well as for regular
ones. This is the first step toward reattaching inspector earlier during PSON. In the future
if debugging is in progress the provisional target (page) will be paused until a signal from
inspector frontend. This will enable the frontend configure all agents before navigation starts.
* Sources.txt:
* UIProcess/API/APIWebAuthenticationPanel.cpp:
(API::WebAuthenticationPanel::WebAuthenticationPanel): Added explicit namespace specifier
to the constructor's argument as otherwise compilation fails due to conflict between API::String
and WTF::String.
* UIProcess/InspectorTargetProxy.cpp:
(WebKit::InspectorTargetProxy::create):
(WebKit::InspectorTargetProxy::connect):
(WebKit::InspectorTargetProxy::disconnect):
(WebKit::InspectorTargetProxy::sendMessageToTargetBackend):
(WebKit::InspectorTargetProxy::didCommitProvisionalTarget):
(WebKit::InspectorTargetProxy::isProvisional const):
(WebKit::InspectorTargetProxy::previousTargetID const):
* UIProcess/InspectorTargetProxy.h: Target proxy can start as a provisional target (with a pointer to
ProvisionalPageProxy) and later either be committed or destroyed.
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::didReceiveMessage): Forward inspector messages to parent page's WebPageInspectorController.
Since each WebPage has a unique identifier the target ids will be globally unique and there is no risk of collisions.
* UIProcess/ProvisionalPageProxy.h:
(WebKit::ProvisionalPageProxy::page const):
* UIProcess/WebPageInspectorController.cpp:
(WebKit::getTargetID):
(WebKit::WebPageInspectorController::WebPageInspectorController):
(WebKit::WebPageInspectorController::clearTargets):
(WebKit::WebPageInspectorController::createInspectorTarget):
(WebKit::WebPageInspectorController::destroyInspectorTarget):
(WebKit::WebPageInspectorController::didCreateProvisionalPage):
(WebKit::WebPageInspectorController::didDestroyProvisionalPage):
(WebKit::WebPageInspectorController::didCommitProvisionalPage):
(WebKit::WebPageInspectorController::addTarget):
* UIProcess/WebPageInspectorController.h:
* UIProcess/WebPageInspectorTargetAgent.cpp: Removed. Merged this agent into InspectorTargetAgent.
* UIProcess/WebPageInspectorTargetAgent.h: Removed.
* UIProcess/WebPageProxy.cpp:
(WebKit::m_resetRecentCrashCountTimer):
(WebKit::WebPageProxy::finishAttachingToWebProcess):
(WebKit::WebPageProxy::commitProvisionalPage):
* UIProcess/WebPageProxy.h: Moved the target management logic into WebPageInspectorController.
WebPageProxy/ProvisionalPageProxy are expected to notifiy it about key lifecycle events and also
forward to it messages from inspector in the inspected WebProcess. How it translates to Target
events is inspector's business.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPageInspectorTarget.cpp:
(WebKit::WebPageInspectorTarget::identifier const):
(WebKit::WebPageInspectorTarget::connect):
(WebKit::WebPageInspectorTarget::disconnect):
(WebKit::WebPageInspectorTarget::toTargetID):
* WebProcess/WebPage/WebPageInspectorTarget.h: Made the target own frontend channel instance as it's the
only place where the page specific channel is used.
* WebProcess/WebPage/WebPageInspectorTargetController.cpp:
(WebKit::WebPageInspectorTargetController::removeTarget):
(WebKit::WebPageInspectorTargetController::connectInspector):
(WebKit::WebPageInspectorTargetController::disconnectInspector):
* WebProcess/WebPage/WebPageInspectorTargetController.h:
* WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.cpp:
(WebKit::WebPageInspectorTargetFrontendChannel::WebPageInspectorTargetFrontendChannel):
(WebKit::WebPageInspectorTargetFrontendChannel::sendMessageToFrontend):