2020-08-06 Adrian Perez de Castro [WPE][GTK] Wrong argument order for clone syscall seccomp filter on s390x https://bugs.webkit.org/show_bug.cgi?id=215212 Reviewed by Michael Catanzaro. Patch based on this Flatpak pull request: https://github.com/flatpak/flatpak/pull/3777 No new tests needed. * UIProcess/Launcher/glib/BubblewrapLauncher.cpp: (WebKit::setupSeccomp): Add preprocessor guard to choose the correct clone() system call argument on S390. 2020-07-28 Adrian Perez de Castro Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.28.4 release * wpe/NEWS: Add release notes for 2.28.4. 2020-07-28 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.28.4 release * gtk/NEWS: Add release notes for 2.28.4. 2020-07-09 Adrian Perez de Castro Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.28.3 release * wpe/NEWS: Add release notes for 2.28.3. 2020-07-09 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.28.3 release * gtk/NEWS: Add release notes for 2.28.3. 2020-03-19 Alex Christensen Sanitize suggested download filename received from web process https://bugs.webkit.org/show_bug.cgi?id=209300 Reviewed by Chris Dumez. * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync): 2020-07-03 Michael Catanzaro [WPE][GTK] Bubblewrap sandbox should not attempt to bind empty paths https://bugs.webkit.org/show_bug.cgi?id=202880 Reviewed by Carlos Garcia Campos. If an empty path is set in LD_LIBRARY_PATH (e.g. /foo::/bar), we wind up passing --ro-bind-try --ro-bind-try to bwrap, where the second --ro-bind-try is treated as the source path to mount, and the next flag we pass gets treated as the destination path. The web process crashes with this confusing error: bwrap: Can't create file at /.flatpak-info: Read-only file system * UIProcess/Launcher/glib/BubblewrapLauncher.cpp: (WebKit::bindIfExists): 2020-05-28 Lauro Moura [GTK][WPE] Buildfix after r262242 Unreviewed build fix. * Shared/glib/ArgumentCodersGLib.cpp: (IPC::decode): 2020-05-28 Michael Catanzaro [WPE][GTK] GVariant decoding must copy the serialized data https://bugs.webkit.org/show_bug.cgi?id=212441 Reviewed by Carlos Garcia Campos. I tracked this down to ArgumentCodersGLib.cpp. The problem is that we construct a GVariant using g_variant_new_from_data(), which does not copy or take ownership of the data, so here we accidentally create the GVariant using data we don't own. (Here, the data is owned by the Decoder itself in its internal m_buffer.) Anyway, this is fixable by manually copying and freeing it with the GDestroyNotify parameter, but it's easier to switch to g_variant_new_from_bytes() because GBytes takes ownership when constructed. * Shared/glib/ArgumentCodersGLib.cpp: (IPC::decode): 2020-04-16 Carlos Alberto Lopez Perez [GTK] MiniBrowser opens new windows too small causing failures on some WPT tests https://bugs.webkit.org/show_bug.cgi?id=210206 Reviewed by Carlos Garcia Campos. Provide the size of the default window (if is set) when windowRect is called before the window is shown. * UIProcess/API/glib/WebKitUIClient.cpp: 2020-03-31 Don Olmstead [PlayStation] Fix build breaks after r259112 https://bugs.webkit.org/show_bug.cgi?id=209830 Unreviewed build fix. Replace PLATFORM(WPE) with USE(LIBWPE) within WebWheelEvent. * Shared/WebEvent.h: * Shared/WebWheelEvent.cpp: (WebKit::WebWheelEvent::encode const): (WebKit::WebWheelEvent::decode): 2020-03-27 Chris Lord [GTK][WPE] Enable kinetic scrolling with async scrolling https://bugs.webkit.org/show_bug.cgi?id=209230 Reviewed by Žan Doberšek. Modify WPE mousewheel event delivery so that it includes the necessary phases needed to infer press/release times and allow for kinetic scrolling. * Shared/NativeWebWheelEvent.h: * Shared/WebEvent.h: * Shared/WebWheelEvent.cpp: (WebKit::WebWheelEvent::encode const): (WebKit::WebWheelEvent::decode): * Shared/libwpe/NativeWebWheelEventLibWPE.cpp: (WebKit::NativeWebWheelEvent::NativeWebWheelEvent): * Shared/libwpe/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebWheelEvent): * Shared/libwpe/WebEventFactory.h: * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::doneWithTouchEvent): * UIProcess/API/wpe/ScrollGestureController.cpp: (WebKit::ScrollGestureController::handleEvent): * UIProcess/API/wpe/ScrollGestureController.h: (WebKit::ScrollGestureController::phase): * UIProcess/API/wpe/WPEView.cpp: (WKWPE::m_backend): 2020-03-26 Michael Catanzaro Syscall param sendmsg(msg.msg_iov[0]) points to uninitialised byte(s) in IPC::Connection::sendOutgoingMessage https://bugs.webkit.org/show_bug.cgi?id=146729 Reviewed by Carlos Garcia Campos. The entire MessageInfo is passed to write(), so we have to zero the padding bytes to avoid writing uninitialized memory. * Platform/IPC/unix/UnixMessage.h: (IPC::MessageInfo::MessageInfo): 2020-06-01 Michael Catanzaro [WPE][GTK] pthread_create() fails with EPERM in the second WebKitWebProcess with sandbox on https://bugs.webkit.org/show_bug.cgi?id=212380 Reviewed by Adrian Perez de Castro. Dereference scmp_arg_cmp before use. * UIProcess/Launcher/glib/BubblewrapLauncher.cpp: (WebKit::setupSeccomp): 2020-04-24 Adrian Perez de Castro Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.28.2 release * wpe/NEWS: Add release notes for 2.28.2. 2020-04-24 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.28.2 release * gtk/NEWS: Add release notes for 2.28.2. 2020-04-23 John Frankish [GTK] Crash in cairo_surface_mark_dirty_rectangle() in accelerated compositing mode under X11 https://bugs.webkit.org/show_bug.cgi?id=210636 Reviewed by Carlos Garcia Campos. When cairo is configured to use xcb instead of xlib, it might use an image surface attached to the xlib one as snapshot. In that case a flush is needed to detach that snapshot after we have drawn the surface in the context. * UIProcess/gtk/AcceleratedBackingStoreX11.cpp: (WebKit::AcceleratedBackingStoreX11::paint): Call cairo_surface_flush() after drawing. 2020-04-17 Carlos Garcia Campos [GTK][X11] REGRESSION(r259944): Wrong position of select popup menu in X11 https://bugs.webkit.org/show_bug.cgi?id=210603 Reviewed by Michael Catanzaro. gdk_window_move_to_rect expects the given rectangle in coordinates relative to the top-left corner of the window that the popup window is transient for. We were using screen coordinates. * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: (WebKit::WebPopupMenuProxyGtk::showPopupMenu): Translate widget coordinates to window coordinates before passing the rectangle to gdk_window_move_to_rect(). 2020-04-17 Carlos Garcia Campos [GTK] UI process crash when entering compositing mode when WPE_RENDERER is enabled https://bugs.webkit.org/show_bug.cgi?id=209118 Reviewed by Michael Catanzaro. Check if EGL_WL_bind_wayland_display extension is available when using WPE_RENDERER, since we don't suport the SHM interface. * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp: (WebKit::AcceleratedBackingStoreWayland::checkRequirements): Return false if EGL_WL_bind_wayland_display is not present. 2020-04-13 Adrian Perez de Castro Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.28.1 release * wpe/NEWS: Add release notes for 2.28.1. 2020-04-13 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.28.1 release * gtk/NEWS: Add release notes for 2.28.1. 2020-03-31 Zan Dobersek [GTK][WPE] Jumpy rendering of fixed-element layers while scrolling https://bugs.webkit.org/show_bug.cgi?id=209466 Reviewed by Carlos Garcia Campos. Move the Nicosia::SceneIntegration ownership into the CompositingCoordinator class, along with the SceneIntegration::Client inheritance. LayerTreeHost in turn now implements the updateScene() method that triggers a scene update when invoked. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::CompositingCoordinator): (WebKit::CompositingCoordinator::invalidate): (WebKit::CompositingCoordinator::attachLayer): (WebKit::CompositingCoordinator::requestUpdate): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp: (WebKit::LayerTreeHost::LayerTreeHost): (WebKit::LayerTreeHost::~LayerTreeHost): (WebKit::LayerTreeHost::updateScene): (WebKit::LayerTreeHost::sceneIntegration): Deleted. (WebKit::LayerTreeHost::requestUpdate): Deleted. * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: 2020-04-08 Carlos Garcia Campos Ensure base cache path exists before calculating disk cache capacity https://bugs.webkit.org/show_bug.cgi?id=209338 Reviewed by Adrian Perez de Castro. The base cache path might not exist yet in Cache::open() since it's Storage::open() the one calling FileSystem::makeAllDirectories() with the final cache directory. In such case, computeCapacity() fails because FileSystem::getVolumeFreeSpace() needs an existing file. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::open): 2020-04-12 Carlos Garcia Campos [GTK] Use gdk_window_move_to_rect() to position popup menus https://bugs.webkit.org/show_bug.cgi?id=210069 Reviewed by Michael Catanzaro. * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: (WebKit::WebPopupMenuProxyGtk::showPopupMenu): 2020-04-12 Carlos Garcia Campos [GTK] Page is not drawn with PSON, hardware acceleration and address typed in URL bar https://bugs.webkit.org/show_bug.cgi?id=208091 Reviewed by Michael Catanzaro. This happens only when accelerated compositing mode policy is set to always. In this case, the bindSurfaceToWebPage wayland message is received before the WebPageProxy has updated the web page identifier. We should always check if there's a provisional page and get its web page identifier. * UIProcess/gtk/WaylandCompositor.cpp: (WebKit::WaylandCompositor::bindSurfaceToWebPage): 2020-04-12 Carlos Garcia Campos [GTK][PSON] Crash in WaylandCompositor::Surface destructor with USE_WPE_RENDERER disabled https://bugs.webkit.org/show_bug.cgi?id=209345 Reviewed by Michael Catanzaro. In case of PSON the web page identifier can change fo the same web page proxy. When swapping processes the new web page calls bindSurfaceToWebPage(), but we still have the web page proxy bound to the previous surface. We just need to unbind the current surface before binding the new one. * UIProcess/gtk/WaylandCompositor.cpp: (WebKit::WaylandCompositor::bindSurfaceToWebPage): 2020-03-23 Chris Lord [WPE] AsyncScrolling: horizontal scrolling is inverted https://bugs.webkit.org/show_bug.cgi?id=208638 Reviewed by Adrian Perez de Castro. * UIProcess/API/wpe/ScrollGestureController.cpp: (WebKit::ScrollGestureController::handleEvent): 2020-04-03 Adrian Perez de Castro Unreviewed fix after r259382 Rubber-stamped by Carlos Garcia Campos. No new tests needed. * UIProcess/API/glib/WebKitWebContext.cpp: (webkit_web_context_register_uri_scheme): Change g_return_if_fail() calls to actually check that the passed scheme is not one of the special ones. 2020-04-02 Adrian Perez de Castro [WPE][GTK] Public API should not allow trying to register a special URI scheme https://bugs.webkit.org/show_bug.cgi?id=209900 Reviewed by Carlos Garcia Campos. No new tests needed. * UIProcess/API/glib/WebKitWebContext.cpp: (webkit_web_context_register_uri_scheme): Use g_return_if_fail() to check at the public API level whether the passed URI scheme is special and bail out early. 2020-04-02 Carlos Garcia Campos [GTK] [2.28.0] The Yelp build crashes if DISPLAY is not set https://bugs.webkit.org/show_bug.cgi?id=209431 Reviewed by Carlos Alberto Lopez Perez. Remove the assert when display is not X11 nor Wayland, and simply return false to ensure acceleration is not used. * UIProcess/gtk/AcceleratedBackingStore.cpp: (WebKit::AcceleratedBackingStore::checkRequirements): 2020-03-26 Michael Catanzaro [GTK] Crash in WebKit::LayerTreeHost::LayerTreeHost with bubblewrap sandbox enabled https://bugs.webkit.org/show_bug.cgi?id=209106 Reviewed by Carlos Garcia Campos. Don't bind the WaylandCompositor socket unless we're running under Wayland and it's actually started successfully. * UIProcess/Launcher/glib/BubblewrapLauncher.cpp: (WebKit::bindWayland): 2020-03-24 Michael Catanzaro [GTK] Crash in WebKit::LayerTreeHost::LayerTreeHost with bubblewrap sandbox enabled https://bugs.webkit.org/show_bug.cgi?id=209106 Reviewed by Adrian Perez de Castro. The bubblewrap sandbox is blocking access to WebKit's nested Wayland compositor. Apparently nobody has ever tested the nested Wayland compositor with the sandbox enabled until now. * UIProcess/Launcher/glib/BubblewrapLauncher.cpp: (WebKit::bindWayland): 2020-03-12 Adrian Perez de Castro Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.28.0 release * wpe/NEWS: Add release notes for 2.28.0. 2020-03-10 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.28.0 release * gtk/NEWS: Add release notes for 2.28.0. 2020-03-09 Zan Dobersek [WPE] AsyncScrolling: scrolling with the mouse wheel over sub-scrollable areas scrolls the main frame https://bugs.webkit.org/show_bug.cgi?id=208635 Reviewed by Carlos Garcia Campos. Rework the default values for the async frame and overflow scrolling so that the latter stays disabled for Nicosia-using ports as it undergoes bigger changes. * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultAsyncFrameAndOverflowScrollingEnabled): (WebKit::defaultAsyncFrameScrollingEnabled): 2020-03-09 Carlos Garcia Campos [GTK][WPE] Surrounding text for input methods should not be limited to the current paragraph https://bugs.webkit.org/show_bug.cgi?id=208706 Reviewed by Žan Doberšek. It should include all the text around the cursor position. * Shared/EditorState.cpp: (WebKit::EditorState::PostLayoutData::encode const): Rename paragraphContext* as surroundingContext*. (WebKit::EditorState::PostLayoutData::decode): Ditto. * Shared/EditorState.h: * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseUpdateTextInputState): Ditto. * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::selectionDidChange): Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::deleteSurrounding): Use content editable text as context instead of just paragraph. * WebProcess/WebPage/glib/WebPageGLib.cpp: (WebKit::WebPage::platformEditorState const): Ditto. 2020-03-08 Konstantin Tokarev [GTK] Fix compilation with disabled OpenGL https://bugs.webkit.org/show_bug.cgi?id=208773 Reviewed by Yusuke Suzuki. * UIProcess/API/glib/WebKitProtocolHandler.cpp: (WebKit::WebKitProtocolHandler::handleGPU): 2020-03-05 Sihui Liu Assertion failed: shouldBeActive() in BackgroundProcessResponsivenessTimer::responsivenessCheckTimerFired() https://bugs.webkit.org/show_bug.cgi?id=208596 Reviewed by Chris Dumez. Update state of BackgroundProcessResponsivenessTimer when ServiceWorker is enabled or disabled in web process. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::disableServiceWorkers): (WebKit::WebProcessProxy::enableServiceWorkers): 2020-03-01 Ting-Wei Lan [GTK] Fix the build when Wayland target is disabled https://bugs.webkit.org/show_bug.cgi?id=208407 Reviewed by Darin Adler. Values in the enum WebCore::PlatformDisplay::Type are only defined when their corresponding platform targets are enabled, so we need #if checks around uses of them. * UIProcess/API/glib/WebKitProtocolHandler.cpp: (WebKit::WebKitProtocolHandler::handleGPU): * UIProcess/API/glib/WebKitUIClient.cpp: (UIClient::windowConfigureEventCallback): 2020-02-27 Adrian Perez de Castro Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.27.91 release * wpe/NEWS: Add release notes for 2.27.91. 2020-02-27 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.27.91 release * gtk/NEWS: Add release notes for 2.27.91. 2020-02-24 Youenn Fablet Protect WebProcessPool from null weak pointers in m_serviceWorkerProcesses map https://bugs.webkit.org/show_bug.cgi?id=208143 rdar://problem/58285589 Reviewed by Alex Christensen. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createWebPage): (WebKit::WebProcessPool::updateServiceWorkerUserAgent): (WebKit::WebProcessPool::updateProcessAssertions): When iterating through the map, make sure it does not have a null entry. 2020-02-20 Sihui Liu WebIDBServer resume should return early if suspend does not happen https://bugs.webkit.org/show_bug.cgi?id=208027 Reviewed by Geoffrey Garen. We should not try releasing a lock that is not held. * NetworkProcess/IndexedDB/WebIDBServer.cpp: (WebKit::WebIDBServer::resume): 2020-02-20 Chris Dumez REGRESSION (r255677): Reloading tab with beforeunload prompt closes tab when asking to stay on page https://bugs.webkit.org/show_bug.cgi?id=208015 Reviewed by Geoffrey Garen. Make sure we only restart the tryClose timer after the beforeunload prompt if the timer was actually active before the prompt (i.e. tryClose was actually called). On Reload, tryClose is not called but beforeunload prompt may still happen. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): 2020-02-19 Brian Burg Web Automation: Automation.setWindowFrameOfBrowsingContext should accept negative x and y-origin values https://bugs.webkit.org/show_bug.cgi?id=207974 Reviewed by Darin Adler. According to the spec, negative origin values are supported: https://w3c.github.io/webdriver/#set-window-rect * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext): 2020-02-19 Ryosuke Niwa Crash in WebPageProxy::didStartProvisionalLoadForFrameShared https://bugs.webkit.org/show_bug.cgi?id=207973 Reviewed by Chris Dumez. Use RefPtr to store Frame*. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared): 2020-02-19 Chris Dumez Regression(r247567) HTTP Disk cache capacity is no longer set https://bugs.webkit.org/show_bug.cgi?id=207959 Reviewed by Alex Christensen. NetworkProcess::initializeNetworkProcess() was setting the cache model, which would iterate over all network sessions to update their network cache capacity. The issue was that network sessions were not constructed yet at this point. When the network session(s) would get created later on, they would construct their NetworkCache and it would use the default capacity (i.e. std::numeric_limits::max()). To make this safer, I have moved the capacity computation to the Cache::open() method and now pass the capacity when constructing the network cache storage. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::setCacheModelSynchronouslyForTesting): (WebKit::NetworkProcess::setCacheModel): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::cacheModel const): * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::initialize): * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::computeCapacity): (WebKit::NetworkCache::Cache::open): (WebKit::NetworkCache::Cache::capacity const): (WebKit::NetworkCache::Cache::updateCapacity): (WebKit::NetworkCache::Cache::setCapacity): Deleted. * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::open): (WebKit::NetworkCache::Storage::Storage): (WebKit::NetworkCache::Storage::setCapacity): * NetworkProcess/cache/NetworkCacheStorage.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setCacheModel): 2020-02-19 Chris Dumez Disable the process cache when process-per-tab is disabled in the debug menu https://bugs.webkit.org/show_bug.cgi?id=207949 Reviewed by Geoffrey Garen. Disable the process cache when process-per-tab is disabled in the debug menu. The process cache is a process-swap-on-navigation optimization and process-swap-on-navigation is already disabled when process-per-tab is disabled. The process cache is not useful with such configuration and actually leads to crashes too. * UIProcess/WebProcessCache.cpp: (WebKit::WebProcessCache::updateCapacity): 2020-02-19 Brent Fulgham Re-disable top-level data URL navigations https://bugs.webkit.org/show_bug.cgi?id=207917 Reviewed by Darin Adler. In Bug 207719 we allowed top-level navigations to data URLs by default. This patch updates client loading API calls so that we can go back to a default block of these loads without breaking WebKit clients. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadDataImpl): Recognize direct data loads started from client API. * WebProcess/WebPage/WebPage.h: 2020-02-18 Zan Dobersek [WPE] Support 2D axis, smooth-motion events https://bugs.webkit.org/show_bug.cgi?id=207881 Reviewed by Carlos Garcia Campos. WPE's WebEventFactory should also handle axis events that are capable of providing information about axis change in both dimensions. In case of smooth motion, the delta values should be preserved and not transformed into line-steps. Similarly, the ScrollGestureController should also adopt the 2D axis event type, producing smooth-motion events when dispatching handling a scroll gesture. The changes are guarded and only enabled when building against at least libwpe 1.5.0 since that's when the new API was added. * Shared/libwpe/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebWheelEvent): * UIProcess/API/wpe/ScrollGestureController.cpp: (WebKit::ScrollGestureController::handleEvent): * UIProcess/API/wpe/ScrollGestureController.h: (WebKit::ScrollGestureController::axisEvent): 2020-02-17 Alberto Garcia [WPE] Change the QML plugin install path https://bugs.webkit.org/show_bug.cgi?id=207761 Reviewed by Philippe Normand. This way there's no need to set QML2_IMPORT_PATH manually. * PlatformWPE.cmake: 2020-02-16 Youenn Fablet Log WebSocket failure in case of network crash https://bugs.webkit.org/show_bug.cgi?id=207801 Reviewed by Darin Adler. Covered by http/tests/websocket/tests/hybi/network-process-crash-error.html. * WebProcess/Network/WebSocketChannel.cpp: (WebKit::WebSocketChannel::didReceiveMessageError): (WebKit::WebSocketChannel::networkProcessCrashed): Add a console log message in case of error coming from network process. 2020-02-15 Pavel Feldman [Geoclue] Avoid usage of provider in callbacks after it has been destroyed https://bugs.webkit.org/show_bug.cgi?id=207420 GeoclueGeolocationProvider was making non-cancelable g_dbus_proxy_call(s) with bare |this| pointer. Reviewed by Carlos Garcia Campos. * UIProcess/geoclue/GeoclueGeolocationProvider.cpp: (WebKit::GeoclueGeolocationProvider::start): (WebKit::GeoclueGeolocationProvider::stop): (WebKit::GeoclueGeolocationProvider::setupManager): (WebKit::GeoclueGeolocationProvider::createClient): (WebKit::GeoclueGeolocationProvider::startClient): (WebKit::GeoclueGeolocationProvider::didFail): * UIProcess/geoclue/GeoclueGeolocationProvider.h: 2020-02-14 Alberto Garcia [WPE] WPEQtView.h includes the uninstalled WPEQtViewBackend.h https://bugs.webkit.org/show_bug.cgi?id=207765 Reviewed by Philippe Normand. Do a forward declaration instead of including the header. * UIProcess/API/wpe/qt/WPEQtView.cpp: * UIProcess/API/wpe/qt/WPEQtView.h: 2020-02-13 Youenn Fablet Protect WebSWServerConnection::scheduleJobInServer from bad scopeURL https://bugs.webkit.org/show_bug.cgi?id=207722 Reviewed by Chris Dumez. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::scheduleJobInServer): In case of bad scope, fail the job early on. * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::scheduleJobInServer): Remove the RELEASE_ASSERT from now since we defend in Network process. We will add it back in ServiceWorkerRegistration::getOrCreate as a follow-up. 2020-02-13 Brent Fulgham REGRESSION (r255961): Default state for data URL handling is incorrect https://bugs.webkit.org/show_bug.cgi?id=207719 Reviewed by Chris Dumez. The default selected in r255961 breaks too many WebKit framework users. Switch from opt-out to opt-in while we work through compatibility issues. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): 2020-02-13 Commit Queue Unreviewed, rolling out r254557. https://bugs.webkit.org/show_bug.cgi?id=207725 The assert is correct, but unfortunately it will alwasy fail since there is an existing bug in HTMLTextFormControlElement::indexForPosition(). See bug #207724 for more details. (Requested by dydz on #webkit). Reverted changeset: "Enable the offset assertion in HTMLTextFormControlElement::indexForPosition" https://bugs.webkit.org/show_bug.cgi?id=205706 https://trac.webkit.org/changeset/254557 2020-02-13 Said Abou-Hallawa Unreviewed, rolling out r255158, 255405 and r255486 Caused test flakiness and PLT regression. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetRenderingUpdateThrottlingEnabled): Deleted. (WKPreferencesGetRenderingUpdateThrottlingEnabled): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: (-[WKOneShotDisplayLinkHandler setPreferredFramesPerSecond:]): Deleted. (WebKit::RemoteLayerTreeDrawingAreaProxy::setPreferredFramesPerSecond): Deleted. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm: (WebKit::RemoteLayerTreeDisplayRefreshMonitor::setPreferredFramesPerSecond): Deleted. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::setPreferredFramesPerSecond): Deleted. 2020-02-12 Youenn Fablet WebSWServerConnection::registerServiceWorkerClient is not sending IPC message to UIProcess when it should https://bugs.webkit.org/show_bug.cgi?id=207537 Reviewed by Chris Dumez. Covered by added API test. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::registerServiceWorkerClient): Fix use after move so that we can get the context connection and send the IPC message to UIProcess as expected. 2020-02-11 Chris Dumez Unreviewed, revert r255662 as it seems to cause blank views in SVC. https://bugs.webkit.org/show_bug.cgi?id=207144 * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2020-02-10 Daniel Bates Disallow setting base URL to a data or JavaScript URL https://bugs.webkit.org/show_bug.cgi?id=207136 Reviewed by Brent Fulgham. Apply base URL restrictions to apps linked to a future WebKit to avoid breaking existing apps. * Shared/WebPreferences.yaml: * UIProcess/API/Cocoa/WKWebView.mm: (shouldRestrictBaseURLSchemes): Added. (-[WKWebView _setupPageConfiguration:]): Update settings. * UIProcess/Cocoa/VersionChecks.h: 2020-02-10 Chris Dumez Crash under WebProcessProxy::shouldSendPendingMessage() https://bugs.webkit.org/show_bug.cgi?id=207464 Reviewed by Alex Christensen. I suspect the WebProcessProxy object is getting destroyed as we are iterating over the pending messages in AuxiliaryProcessProxy::didFinishLaunching(), thus crashing when calling WebProcessProxy::shouldSendPendingMessage() inside the loop. As a speculative fix, protect |this| at the beginning of WebProcessProxy::didFinishLaunching(). * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didFinishLaunching): 2020-02-10 Adrian Perez de Castro Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.27.90 release * wpe/NEWS: Add release notes for 2.27.90. 2020-02-10 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.27.90 release * gtk/NEWS: Add release notes for 2.27.90. 2020-02-10 Adrian Perez de Castro [geolocation] Fix non-unified build issues https://bugs.webkit.org/show_bug.cgi?id=207457 Unreviewed build fix. No new tests needed. * UIProcess/GeolocationPermissionRequestManagerProxy.h: Add missing includes. * UIProcess/WebGeolocationManagerProxy.cpp: Ditto. 2020-02-10 Adrian Perez de Castro [GTK][WebInspector] Do not make Web Inspector windows transient https://bugs.webkit.org/show_bug.cgi?id=207455 Reviewed by Carlos Garcia Campos. Stop setting Web Inspector windows as transient for the window containing the web view being inspected, to allow changing their relative stacking order. No changes are needed for inspector windows to continue being destroyed correctly when the corresponding web view is destroyed because code for handling that was already present in WebInspectorProxyGtk.cpp. No new tests needed. * UIProcess/Inspector/gtk/RemoteWebInspectorProxyGtk.cpp: (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow): Do not pass a parent window parameter to webkitInspectorWindowNew(). * UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::platformCreateFrontendWindow): Remove code to obtain the top level window of the WebKitWebView, which no longer needs being passed to webkitInspectorWindowNew(). * UIProcess/Inspector/gtk/WebKitInspectorWindow.cpp: (webkitInspectorWindowNew): Do not set the GtkWindow.transient-for property for the Web Inspector window. Remove the parent window parameter. * UIProcess/Inspector/gtk/WebKitInspectorWindow.h: Remove the parent window parameter for webkitInspectorWindowNew(). 2020-02-10 Enrique Ocaña González [GTK] Mouse pointer no longer hidden during fullscreen video playback https://bugs.webkit.org/show_bug.cgi?id=197346 Reviewed by Adrian Perez de Castro. Covered by existing tests. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::setCursorHiddenUntilMouseMoves): Added implementation. 2020-02-07 Jon Lee Web Inspector: Revert slim toolbar https://bugs.webkit.org/show_bug.cgi?id=207422 Reviewed by Timothy Hatcher. The slim toolbar needs a little more work before landing. This patch reverts r255547, r255557, r255890, r255892, r255893, r255901, r255980. * UIProcess/Inspector/RemoteWebInspectorProxy.cpp: * UIProcess/Inspector/RemoteWebInspectorProxy.h: * UIProcess/Inspector/RemoteWebInspectorProxy.messages.in: * UIProcess/Inspector/WebInspectorProxy.cpp: * UIProcess/Inspector/WebInspectorProxy.h: * UIProcess/Inspector/WebInspectorProxy.messages.in: * UIProcess/Inspector/gtk/RemoteWebInspectorProxyGtk.cpp: * UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp: * UIProcess/Inspector/mac/RemoteWebInspectorProxyMac.mm: * UIProcess/Inspector/mac/WebInspectorProxyMac.mm: * UIProcess/Inspector/win/RemoteWebInspectorProxyWin.cpp: * UIProcess/Inspector/win/WebInspectorProxyWin.cpp: * WebProcess/Inspector/RemoteWebInspectorUI.cpp: * WebProcess/Inspector/RemoteWebInspectorUI.h: * WebProcess/Inspector/WebInspectorUI.cpp: * WebProcess/Inspector/WebInspectorUI.h: 2020-02-07 Chris Dumez [IPC Hardening] Protect against bad parameters in WebProcessProxy::getPluginProcessConnection() https://bugs.webkit.org/show_bug.cgi?id=207416 Reviewed by David Kilzer. * UIProcess/Plugins/PluginProcessManager.cpp: (WebKit::PluginProcessManager::getPluginProcessConnection): * UIProcess/Plugins/PluginProcessManager.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::getPluginProcessConnection): 2020-02-07 Alex Christensen Harden HashTable IPC decoders https://bugs.webkit.org/show_bug.cgi?id=207415 Reviewed by Chris Dumez. * Platform/IPC/ArgumentCoders.h: 2020-02-07 Chris Dumez [Hardening] Validate Geolocation access permission on UIProcess side https://bugs.webkit.org/show_bug.cgi?id=207393 Reviewed by Brent Fulgham. * UIProcess/GeolocationPermissionRequestManagerProxy.cpp: (WebKit::GeolocationPermissionRequestManagerProxy::didReceiveGeolocationPermissionDecision): (WebKit::GeolocationPermissionRequestManagerProxy::isValidAuthorizationToken const): (WebKit::GeolocationPermissionRequestManagerProxy::revokeAuthorizationToken): * UIProcess/GeolocationPermissionRequestManagerProxy.h: * UIProcess/WebGeolocationManagerProxy.cpp: (WebKit::WebGeolocationManagerProxy::startUpdating): * UIProcess/WebGeolocationManagerProxy.h: * UIProcess/WebGeolocationManagerProxy.messages.in: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::geolocationPermissionRequestManager): * UIProcess/WebPageProxy.messages.in: * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp: (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation): (WebKit::GeolocationPermissionRequestManager::revokeAuthorizationToken): (WebKit::GeolocationPermissionRequestManager::didReceiveGeolocationPermissionDecision): * WebProcess/Geolocation/GeolocationPermissionRequestManager.h: * WebProcess/Geolocation/WebGeolocationManager.cpp: (WebKit::WebGeolocationManager::registerWebPage): * WebProcess/Geolocation/WebGeolocationManager.h: * WebProcess/WebCoreSupport/WebGeolocationClient.cpp: (WebKit::WebGeolocationClient::startUpdating): (WebKit::WebGeolocationClient::revokeAuthorizationToken): * WebProcess/WebCoreSupport/WebGeolocationClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didReceiveGeolocationPermissionDecision): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2020-02-07 Timothy Hatcher Crash under WKBundleFrameForJavaScriptContext dereferencing a NULL WebCore::Frame. https://bugs.webkit.org/show_bug.cgi?id=207407 rdar://problem/59206599 Reviewed by Tim Horton. * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::frameForContext): Add a null check for the coreFrame. 2020-02-07 youenn fablet BackgroundProcessResponsivenessTimer should not be active if running active pages and service workers https://bugs.webkit.org/show_bug.cgi?id=207264 Reviewed by Chris Dumez. In case a service worker is running, the process might still be foreground if a page is running in the same process. Not observable. * UIProcess/BackgroundProcessResponsivenessTimer.cpp: (WebKit::BackgroundProcessResponsivenessTimer::shouldBeActive const): 2020-02-07 Chris Dumez Address post-landing review comments from Darin on r255989. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::terminateServiceWorkerProcess): 2020-02-07 Patrick Griffis [GTK][WPE] Add same-site cookie support https://bugs.webkit.org/show_bug.cgi?id=204137 Reviewed by Carlos Garcia Campos. Implements same-site cookie support in the soup backend. * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::continueHTTPRedirection): 2020-02-06 Chris Dumez REGRESSION (r254706): Crash under WebProcessPool::terminateServiceWorkerProcess() https://bugs.webkit.org/show_bug.cgi?id=207354 Reviewed by Geoffrey Garen. No new tests, not easily testable AFAIK since this happens on failure to send sync IPC to the service worker when terminating it. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::terminateServiceWorkerProcess): 'auto' resolved to 'WeakPtr' in this method and the call to disableServiceWorkers() could cause the process to get destroyed. We would then do a null dereference on the next line. 2020-02-10 Adrian Perez de Castro [GTK][WebInspector] Always allow data:// URIs for inspector views https://bugs.webkit.org/show_bug.cgi?id=207454 Reviewed by Carlos Garcia Campos. No new tests needed. * UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::platformCreateFrontendPage): The Web Inspector may use navigation to data:// URLs, so always allow it. 2020-02-06 Patrick Griffis [GTK][WPE] Re-add flatpak sandbox support https://bugs.webkit.org/show_bug.cgi?id=204732 Reviewed by Michael Catanzaro. This brings back the Flatpak based sandbox now that upstream has added features to their spawn portal to accomodate our needs. * SourcesGTK.txt: * SourcesWPE.txt: * UIProcess/Launcher/glib/FlatpakLauncher.cpp: Added. (WebKit::flatpakSpawn): * UIProcess/Launcher/glib/FlatpakLauncher.h: Added. * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: (WebKit::isFlatpakSpawnUsable): (WebKit::isInsideFlatpak): (WebKit::ProcessLauncher::launchProcess): 2020-02-09 Lauro Moura [GTK][WPE] Expose allowTopNavigationToDataURL https://bugs.webkit.org/show_bug.cgi?id=207384 Reviewed by Adrian Perez de Castro. This patch exposes the new property "allow-top-navigation-to-data-urls" from r255961 to the glib-based APIs. * UIProcess/API/glib/WebKitSettings.cpp: (webKitSettingsSetProperty): Set new property. (webKitSettingsGetProperty): Get new property. (webkit_settings_class_init): Register new property. (webkit_settings_get_allow_top_navigation_to_data_urls): Added. (webkit_settings_set_allow_top_navigation_to_data_urls): Added. * UIProcess/API/gtk/WebKitSettings.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/wpe/WebKitSettings.h: * UIProcess/API/wpe/docs/wpe-1.0-sections.txt: 2020-02-06 Brent Fulgham Prevent navigating top level frames to Data URLs https://bugs.webkit.org/show_bug.cgi?id=206962 Reviewed by Youenn Fablet. Expose a new off-by-default preference to allow top-level navigation to Data URIs. Tests: fast/loader/data-url-frame-allowed.html, fast/loader/data-url-load-denied.html * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetTopNavigationToDataURLsAllowed): (WKPreferencesGetTopNavigationToDataURLsAllowed): * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setTopNavigationToDataURLsAllowed:]): (-[WKPreferences _topNavigationToDataURLsAllowed]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setupPageConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _allowTopNavigationToDataURLs]): (-[WKWebViewConfiguration _setAllowTopNavigationToDataURLs:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/Inspector/mac/WKInspectorViewController.mm: (-[WKInspectorViewController configuration]): 2020-02-06 Chris Dumez [IPC Hardening] Protect against bad identifier in WebPageProxy::DidInsertAttachmentWithIdentifier() https://bugs.webkit.org/show_bug.cgi?id=207311 Reviewed by Alex Christensen. * UIProcess/WebPageProxy.cpp: 2020-02-06 youenn fablet ServiceWorkerProvider::registerServiceWorkerClients is no longer needed https://bugs.webkit.org/show_bug.cgi?id=207193 Reviewed by Chris Dumez. Remove the request from WebProcessPool to register all service worker clients at launch of the first service worker process. This is no longer needed and does not scale since our service workers are launched in different processes nowadays. In case network process crashes, WebProcess will need to reregister their service worker clients. This is lazily done when WebProcess tries to reconnect to the Network Process. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::ensureNetworkProcessConnection): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2020-02-05 Don Olmstead [PlayStation] Miscellaneous build fixes February 2020 edition https://bugs.webkit.org/show_bug.cgi?id=207312 Unreviewed build fix. * NetworkProcess/NetworkDataTaskBlob.cpp: Add missing include. * UIProcess/Downloads/DownloadProxyMap.h: Add missing forward declaration. 2020-02-05 Chris Dumez Regression(r248734) StorageAreaMap objects are getting leaked https://bugs.webkit.org/show_bug.cgi?id=207073 Reviewed by Darin Adler. Make sure that StorageAreaMap objects are getting removed from the HashMap in StorageNamespaceImpl, once they no longer have any users. * WebProcess/WebStorage/StorageAreaImpl.cpp: (WebKit::StorageAreaImpl::StorageAreaImpl): (WebKit::StorageAreaImpl::~StorageAreaImpl): * WebProcess/WebStorage/StorageAreaMap.cpp: (WebKit::StorageAreaMap::incrementUseCount): (WebKit::StorageAreaMap::decrementUseCount): * WebProcess/WebStorage/StorageAreaMap.h: * WebProcess/WebStorage/StorageNamespaceImpl.cpp: (WebKit::StorageNamespaceImpl::destroyStorageAreaMap): (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap): Deleted. * WebProcess/WebStorage/StorageNamespaceImpl.h: (WebKit::StorageNamespaceImpl::storageType const): Deleted. (WebKit::StorageNamespaceImpl::storageNamespaceID const): Deleted. (WebKit::StorageNamespaceImpl::topLevelOrigin const): Deleted. (WebKit::StorageNamespaceImpl::quotaInBytes const): Deleted. 2020-02-05 Chris Dumez [IPC hardening] Protect against bad identifier in CacheStorageEngineConnection::reference() / dereference() https://bugs.webkit.org/show_bug.cgi?id=207302 Reviewed by Alex Christensen. * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::reference): (WebKit::CacheStorageEngineConnection::dereference): 2020-02-05 Chris Dumez [IPC hardening] Protect against bad parameters in NetworkRTCProvider::createResolver() https://bugs.webkit.org/show_bug.cgi?id=207301 Reviewed by Alex Christensen. * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::createResolver): 2020-02-05 Patrick Griffis [GTK][WPE] Add more fontconfig paths into the sandbox https://bugs.webkit.org/show_bug.cgi?id=207293 Reviewed by Michael Catanzaro. These paths were reported to be used on Debian. * UIProcess/Launcher/glib/BubblewrapLauncher.cpp: (WebKit::bindFonts): 2020-02-05 Chris Dumez [IPC hardening] Protect against bad originIdentifier String in WebPageProxy::reachedApplicationCacheOriginQuota() / requestGeolocationPermissionForFrame() https://bugs.webkit.org/show_bug.cgi?id=207292 Reviewed by David Kilzer. * UIProcess/WebPageProxy.cpp: 2020-02-05 Chris Dumez [IPC Hardening] Protect against targetId String being invalid in WebPageProxy::createInspectorTarget() / destroyInspectorTarget() https://bugs.webkit.org/show_bug.cgi?id=207288 Reviewed by Geoffrey Garen. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::createInspectorTarget): (WebKit::WebPageProxy::destroyInspectorTarget): 2020-02-05 Chris Dumez [IPC hardening] Protect against m_inspectorPage being null inWebInspectorProxy::attach() https://bugs.webkit.org/show_bug.cgi?id=207289 Reviewed by David Kilzer. * UIProcess/Inspector/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::attach): 2020-02-05 Chris Dumez [IPC Hardening] Protect against m_inspectorPage being null in WebInspectorProxy::detach() https://bugs.webkit.org/show_bug.cgi?id=207286 Reviewed by David Kilzer. * UIProcess/Inspector/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::detach): 2020-02-05 Chris Dumez [IPC Hardening] Protect against null String under WebInspectorProxy::save() / WebInspectorProxy::append() https://bugs.webkit.org/show_bug.cgi?id=207284 Reviewed by David Kilzer. * UIProcess/Inspector/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::save): (WebKit::WebInspectorProxy::append): 2020-02-05 Chris Dumez [IPC Hardening] Protect against m_inspectorPage being null in WebInspectorProxy::setAttachedWindowHeight() / setAttachedWindowWidth() https://bugs.webkit.org/show_bug.cgi?id=207287 Reviewed by Geoffrey Garen. * UIProcess/Inspector/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::setAttachedWindowHeight): (WebKit::WebInspectorProxy::setAttachedWindowWidth): 2020-02-05 Chris Dumez [IPC Hardening] Protect against m_inspectedPage / m_inspectorPage being null in WebInspectorProxy::resetState() https://bugs.webkit.org/show_bug.cgi?id=207285 Reviewed by David Kilzer. * UIProcess/Inspector/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::resetState): 2020-02-05 Chris Dumez [IPC Hardening] Protect against bad RegistrableDomain under WebProcessProxy::didCollectPrewarmInformation() https://bugs.webkit.org/show_bug.cgi?id=207281 Reviewed by Geoffrey Garen. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didCollectPrewarmInformation): 2020-02-05 Chris Dumez [IPC Hardening] Protect against bad ClientOrigin under Engine::readCachesFromDisk() https://bugs.webkit.org/show_bug.cgi?id=207280 Reviewed by Geoffrey Garen. Protect against bad ClientOrigin under Engine::readCachesFromDisk(), as it is coming from IPC from the WebContent process. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::readCachesFromDisk): 2020-02-05 Alex Christensen Make WKWebView._negotiatedLegacyTLS accurate when loading main resouorce from network or cache https://bugs.webkit.org/show_bug.cgi?id=207207 Reviewed by Chris Dumez. In PageLoadState::didCommitLoad, I was resetting the value of _negotiatedLegacyTLS to false. That created a race condition when loading the main resource because the NetworkProcess would message the UIProcess setting _negotiatedLegacyTLS to false, while the NetworkProcess would message the WebProcess which would message the UIProcess to call PageLoadState::didCommitLoad which would reset it to false. Now it resets it to the correct value, whatever it is. Updating the ResourceResponseBase serialization code has the desirable side effect that the disk cache will remember whether legacy TLS was used to fetch each resource. This will make it so _negotiatedLegacyTLS is true if we read content from the disk cache that was originally fetched using legacy TLS. In order to not increase the memory footprint of ResourceResponse, I changed m_httpStatusCode from an int to a short. It just needs to be able to cover the values 0-600 or so, which really only needs 10 bits. Covered by new API tests. * NetworkProcess/NetworkCORSPreflightChecker.cpp: (WebKit::NetworkCORSPreflightChecker::didReceiveResponse): * NetworkProcess/NetworkCORSPreflightChecker.h: * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::didReceiveResponse): (WebKit::NetworkDataTask::negotiatedLegacyTLS const): Deleted. * NetworkProcess/NetworkDataTask.h: (WebKit::NetworkDataTaskClient::negotiatedLegacyTLS const): Deleted. * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse): * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::didReceiveResponse): (WebKit::NetworkLoad::notifyDidReceiveResponse): (WebKit::NetworkLoad::throttleDelayCompleted): (WebKit::NetworkLoad::negotiatedLegacyTLS const): Deleted. * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::didReceiveResponse): * NetworkProcess/PingLoad.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::didReceiveResponse): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): * NetworkProcess/curl/NetworkDataTaskCurl.cpp: (WebKit::NetworkDataTaskCurl::invokeDidReceiveResponse): * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): * UIProcess/PageLoadState.cpp: (WebKit::PageLoadState::didCommitLoad): * UIProcess/PageLoadState.h: * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::didCommitLoadForFrame): * UIProcess/ProvisionalPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::commitProvisionalPage): (WebKit::WebPageProxy::didCommitLoadForFrame): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad): 2020-02-05 Chris Dumez Unreviewed, rolling out r255706. Caused assertions in API tests Reverted changeset: "Partial revert of r248734 to fix leak of StorageAreaMaps" https://bugs.webkit.org/show_bug.cgi?id=207073 https://trac.webkit.org/changeset/255706 2020-02-05 Chris Dumez Unreviewed, follow-up assertion fix after r255662. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): 2020-02-01 Darin Adler Replace RGBA32 typedef with a class to improve type safety https://bugs.webkit.org/show_bug.cgi?id=206862 Reviewed by Sam Weinig. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): Use uint32_t explicitly to convert the color value into a SimpleColor. (IPC::ArgumentCoder::decode): Same thing, only the other direction. 2020-02-04 Chris Dumez Partial revert of r248734 to fix leak of StorageAreaMaps https://bugs.webkit.org/show_bug.cgi?id=207073 Reviewed by Alex Christensen. Do a partial revert of r248734 so that the StorageNamespaceImpl no longer holds a strong reference to its StorageAreaMap objects. The code for removing entries from StorageNamespaceImpl::m_storageAreaMaps (StorageNamespaceImpl::didDestroyStorageAreaMap()) was dead code after r248734 and thus StorageAreaMap were never destroyed. * WebProcess/WebStorage/StorageAreaImpl.cpp: (WebKit::StorageAreaImpl::create): (WebKit::StorageAreaImpl::StorageAreaImpl): (WebKit::StorageAreaImpl::length): (WebKit::StorageAreaImpl::key): (WebKit::StorageAreaImpl::item): (WebKit::StorageAreaImpl::setItem): (WebKit::StorageAreaImpl::removeItem): (WebKit::StorageAreaImpl::clear): (WebKit::StorageAreaImpl::contains): (WebKit::StorageAreaImpl::storageType const): * WebProcess/WebStorage/StorageAreaImpl.h: * WebProcess/WebStorage/StorageAreaMap.cpp: (WebKit::StorageAreaMap::create): (WebKit::StorageAreaMap::~StorageAreaMap): * WebProcess/WebStorage/StorageAreaMap.h: * WebProcess/WebStorage/StorageNamespaceImpl.cpp: (WebKit::StorageNamespaceImpl::storageArea): * WebProcess/WebStorage/StorageNamespaceImpl.h: 2020-02-04 Chris Dumez Unreviewed, follow-up assertion fix after r255662. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): 2020-02-04 youenn fablet NetworkProcess should be notified by UIProcess when its service worker process connection should be on https://bugs.webkit.org/show_bug.cgi?id=207122 Reviewed by Chris Dumez. Add completion handlers to the messaging from NetworkProcess -> UIProcess -> WebProcess -> NetworkProcess used to create a service worker context connection. This allows NetworkProcess to ask again for a connection if the connection is still needed but NetworkProcess did not find the context connection. This is difficult to test since we would need for the process selected to host service workers to exit between the time it is selected and the time it sends the message to Networking process. To ensure that the context connection is created by WebProcess, WebProcessProxy takes a background assertion until WebProcess finishes creating the context connection to Network process. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::establishSWContextConnection): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::swServerForSession): * NetworkProcess/NetworkProcess.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::establishWorkerContextConnectionToNetworkProcess): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::establishServiceWorkerContext): * UIProcess/WebProcessProxy.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::m_userAgent): (WebKit::WebSWContextManagerConnection::establishConnection): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2020-02-04 Chris Dumez Unreviewed, follow-up assertion fix after r255662. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): 2020-02-04 Carlos Garcia Campos REGRESSION(r255595): page not closed after beforeunload handler returns true https://bugs.webkit.org/show_bug.cgi?id=207189 Reviewed by Chris Dumez. We are assuming the try close did timeout in that case, because the timer is stopped before running the beforeunload dialog. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): Start the try close timer again when the beforeunload dialog replies. 2020-02-04 Carlos Garcia Campos Unreviewed. [GTK] Add an env var to force single process model WEBKIT_USE_SINGLE_WEB_PROCESS=1 can be used to force the single process model when PSON is disabled. This is a temporary solution for applications still depending on the single process mode behavior. It will be only available in 2.28 series. * UIProcess/API/glib/WebKitWebContext.cpp: (webkitWebContextConstructed): 2020-02-04 Fujii Hironori [Win][Clang] WebProcessMain.h(28,14): error: token is not a valid binary operator in a preprocessor subexpression https://bugs.webkit.org/show_bug.cgi?id=207188 Unreviewed build fix for WinCairo port. * NetworkProcess/EntryPoint/win/NetworkProcessMain.cpp: * WebProcess/EntryPoint/win/WebProcessMain.cpp: Added #include "config.h". 2020-02-03 Wenson Hsieh Add a WebKitAdditions hook to provide additional customizations to UIDragInteraction https://bugs.webkit.org/show_bug.cgi?id=207177 Reviewed by Tim Horton. Add a WebKitAdditions extension point that runs immediately after setting up UIDragInteraction and UIDropInteraction. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupDragAndDropInteractions]): 2020-02-03 Chris Dumez Stop relying on ResponsivenessTimer to keep the WebProcess from suspending during initialization https://bugs.webkit.org/show_bug.cgi?id=207144 Reviewed by Brady Eidson. Stop relying on ResponsivenessTimer to keep the WebProcess from suspending during initialization. Instead, make the WebProcess::InitializeWebProcess IPC async with a reply and take a process assertion on behalf of the WebContent process until we get a response back. This avoids sending an extra WebProcess::MainThreadPing IPC to the WebProcess for no reason (since we're already sending the WebProcess::InitializeWebProcess IPC) and this is also more reliable since the ResponsivenessTimer can actually time out and cause the process to get suspended during initialization still. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2020-02-03 Jiewen Tan Pass a hint from the extension to decidePolicyForSOAuthorizationLoadWithCurrentPolicy https://bugs.webkit.org/show_bug.cgi?id=207079 Reviewed by Brent Fulgham. Pass a localized human readable hint from the extension to decidePolicyForSOAuthorizationLoadWithCurrentPolicy, such that clients can display it to tell users what the extension is trying to do. Hints could be something like "Sign In With Apple". Covered new test contents within existing tests. * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.h: * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm: (WebKit::SOAuthorizationSession::start): (WebKit::SOAuthorizationSession::continueStartAfterGetAuthorizationHints): (WebKit::SOAuthorizationSession::continueStartAfterDecidePolicy): 2020-02-03 Wenson Hsieh Unreviewed, fix the internal build after * UIProcess/ios/WKContentViewInteraction.h: Declare this helper in the header, now that it's consulted by some WebKitAdditions code. 2020-02-03 Wenson Hsieh Add a WebKitAdditions hook to override the behavior of -[WKContentView gestureRecognizer:shouldReceiveTouch:] https://bugs.webkit.org/show_bug.cgi?id=207162 Reviewed by Tim Horton. Allow an internal implementation of `-_allowGestureRecognizer:toReceiveTouch:` to prevent touches from being routed to certain gesture recognizers, if necessary. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView gestureRecognizer:shouldReceiveTouch:]): 2020-02-03 Chris Dumez [WK2] Use per-UIProcess default cookie storage for Mac Catalyst apps https://bugs.webkit.org/show_bug.cgi?id=207139 Reviewed by Brent Fulgham. Use per-UIProcess default cookie storage for Mac Catalyst apps, similarly to what we do for regular macOS apps. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): 2020-02-03 Wenson Hsieh [iOS 13] Dragging on-screen volume control on a YouTube video selects text around the panel https://bugs.webkit.org/show_bug.cgi?id=207140 Reviewed by Tim Horton. This bug occurs on iPadOS when long pressing the volume controls on the desktop version of YouTube, and then performing a pan gesture; this activates the highlight text selection gesture recognizer added in iOS 13, causing text to be selected while adjusting the volume using these custom controls. On macOS, we avoid this because `Node::canStartSelection()` returns `false`, due to a container node having both `user-drag: element` and `user-select: none`; in this scenario, we allow dragging to take precendence over text selection, so the volume slider can be moved using a mouse without simultaneously selecting text. This logic is currently absent on iOS, where UIKit text interaction gesture recognizers ask us for information about the DOM at given locations, and we determine whether to allow text interaction gestures (such as long pressing) to begin in `-textInteractionGesture:shouldBeginAtPoint:` and `-hasSelectablePositionAtPoint:`. Ideally, we'd want to eventually unify these two codepaths for triggering text selection (and preferably just have both go through EventHandler); in lieu of this, simply make the iOS codepath behave a little more like macOS by adding a bit to allow text interaction gestures to bail in the case where at least one container of the hit-tested element is both draggable and unselectable. Test: editing/selection/ios/prefer-drag-over-text-selection.html * Shared/ios/InteractionInformationAtPosition.h: * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): (WebKit::InteractionInformationAtPosition::decode): Add the new bit to InteractionInformationAtPosition. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): Avoid beginning text selection if the bit is set. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::selectionPositionInformation): Move a comment about the ">= 97% of the document's visible area" heuristic next to the relevant code, and also leave a FIXME mentioning that we should reconsider whether this is really needed; it seems that this was originally intended to avoid ending up with an excessively large block selection, but block selection has been removed entirely since iOS 12. That said, this logic may still be helping avoid situations where the text selection is too aggressive on iOS and ends up selecting too much text. 2020-02-03 Chris Dumez Regression(r253224) WKUIDelegate.webViewDidClose may get called twice after calling _tryClose on the WKWebView https://bugs.webkit.org/show_bug.cgi?id=207121 Reviewed by Alex Christensen. WKUIDelegate.webViewDidClose may get called twice after calling _tryClose on the WKWebView, in case we time out while waiting for an answer from the WebProcess but the WebProcess eventually responds. Change is covered by new API test. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::tryClose): 2020-02-03 Eric Carlson [macOS] AirPlay sometimes stops after 60 minutes of playback https://bugs.webkit.org/show_bug.cgi?id=207056 Reviewed by Jer Noble. * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: 2020-02-03 Sam Weinig Start splitting platform specific overrides of default enable behavior into their own files https://bugs.webkit.org/show_bug.cgi?id=207105 Reviewed by Dean Jackson. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::shouldPlugInAutoStartFromOrigin): Switch to using the ENABLE() helper macro to correctly guard against the case that ENABLE_PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC is defined and equal to 0. 2020-02-03 Keith Rollin Unreviewed watchOS build fix after r255559- add missing semi-colon. * UIProcess/ios/forms/WKFocusedFormControlView.mm: (-[WKFocusedFormControlView scrollOffsetForCrownInputOffset:]): 2020-02-03 Zan Dobersek Use std::hypot() where possible https://bugs.webkit.org/show_bug.cgi?id=198483 Reviewed by Carlos Garcia Campos. Use std::hypot() where possible, allowing for a possibly more precise calculation of square roots of sums of two or three square values. * Platform/classifier/ResourceLoadStatisticsClassifier.cpp: (WebKit::vectorLength): * UIProcess/ios/forms/WKFocusedFormControlView.mm: (-[WKFocusedFormControlView scrollOffsetForCrownInputOffset:]): 2020-02-01 Michael Catanzaro Silence compiler warnings https://bugs.webkit.org/show_bug.cgi?id=207015 Reviewed by Darin Adler. Use UNUSED_VARIABLE() for variable that is only used inside RELEASE_LOG(), which is Apple-specific. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didFailLoading): 2020-02-01 Devin Rousso Web Inspector: move the items in the toolbar into the tab bar to save vertical space https://bugs.webkit.org/show_bug.cgi?id=204627 Reviewed by Timothy Hatcher. Now that there is no toolbar area, there is nothing obstructing the ability for the window to be moved around when dragging via the title bar area. As such, we can remove the unused `InspectorFrontendHost` APIs. * WebProcess/Inspector/WebInspectorUI.h: * WebProcess/Inspector/WebInspectorUI.cpp: (WebKit::WebInspectorUI::startWindowDrag): Deleted. (WebKit::WebInspectorUI::moveWindowBy): Deleted. * UIProcess/Inspector/WebInspectorProxy.messages.in: * UIProcess/Inspector/WebInspectorProxy.h: * UIProcess/Inspector/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::startWindowDrag): Deleted. (WebKit::WebInspectorProxy::platformStartWindowDrag): Deleted. * UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::platformStartWindowDrag): Deleted. * UIProcess/Inspector/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::platformStartWindowDrag): Deleted. * UIProcess/Inspector/win/WebInspectorProxyWin.cpp: (WebKit::WebInspectorProxy::platformStartWindowDrag): Deleted. * UIProcess/Inspector/wpe/WebInspectorProxyWPE.cpp: (WebKit::WebInspectorProxy::platformStartWindowDrag): Deleted. * WebProcess/Inspector/RemoteWebInspectorUI.h: * WebProcess/Inspector/RemoteWebInspectorUI.cpp: (WebKit::RemoteWebInspectorUI::startWindowDrag): Deleted. (WebKit::RemoteWebInspectorUI::moveWindowBy): Deleted. * UIProcess/Inspector/RemoteWebInspectorProxy.messages.in: * UIProcess/Inspector/RemoteWebInspectorProxy.cpp: * UIProcess/Inspector/RemoteWebInspectorProxy.h: (WebKit::RemoteWebInspectorProxy::startWindowDrag): Deleted. (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag): Deleted. * UIProcess/Inspector/gtk/RemoteWebInspectorProxyGtk.cpp: (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag): Deleted. * UIProcess/Inspector/mac/RemoteWebInspectorProxyMac.mm: (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag): Deleted. * UIProcess/Inspector/win/RemoteWebInspectorProxyWin.cpp: (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag): Deleted. 2020-01-31 David Quesada REGRESSION(r252185): NetworkSessionCocoa cancels downloads that receive authentication challenges https://bugs.webkit.org/show_bug.cgi?id=206984 rdar://problem/58999654 Reviewed by Brady Eidson. r252185 changed the early return in WKNetworkSessionDelegate's -...task:didReceiveChallenge:... method from "cancel the task and return early if self has no _session" to "cancel the task and return early if we can't determine the network session for the given data task". When this method is called for an NSURLSessionDownloadTask, this early return is hit because there is no NetworkDataTaskCocoa for an active download. As a result, the download is canceled when it might have otherwise been able to proceed. Fix this by adding a code path to fetch the NetworkSession associated with the Download when an NSURLSessionDownloadTask receives an authentication challenge. This ensures we can actually handle the challenge appropriately and not just cancel the task. * NetworkProcess/Downloads/Download.h: (WebKit::Download::sessionID const): Expose the session ID so we can use it to look up the NetworkSession for a Download. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): Remove an unnecessary redeclaration of networkDataTask, and also an unneeded assertion that networkDataTask != nullptr. Even if this is the case, the code that eventually handles this task will null check it and handle the challenge as a websocket task or download task based on the taskIdentifier. 2020-01-31 Wenson Hsieh Add support for specifying background colors when setting marked text https://bugs.webkit.org/show_bug.cgi?id=207065 Reviewed by Tim Horton. Implement -setAttributedMarkedText:selectedRange: on WKContentView, and have it extract highlight color information from the given attributed string. Plumb this through to the web process by serializing and deserializing `WebCore::CompositionHighlight`s. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setMarkedText): * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.mm: (compositionHighlights): For each marked text clause, grab the specified background color (defaulting to Color::compositionFill) and use it to create a list of CompositionHighlights. (-[WKContentView setAttributedMarkedText:selectedRange:]): (-[WKContentView setMarkedText:selectedRange:]): (-[WKContentView _setMarkedText:highlights:selectedRange:]): * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageSetComposition): Add testing support for specifying highlight ranges when setting marked text. * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: * WebProcess/WebCoreSupport/glib/WebEditorClientGLib.cpp: (WebKit::WebEditorClient::didDispatchInputMethodKeydown): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setCompositionForTesting): (WebKit::WebPage::setCompositionAsync): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2020-01-31 Andy Estes Unreviewed build fix after r255522. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): Switched to a C-style cast. 2020-01-31 Alex Christensen Add KVO SPI WKWebView._negotiatedLegacyTLS https://bugs.webkit.org/show_bug.cgi?id=207067 Reviewed by Andy Estes. Covered by API tests. * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::negotiatedLegacyTLS const): * NetworkProcess/NetworkDataTask.h: (WebKit::NetworkDataTaskClient::negotiatedLegacyTLS const): * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::negotiatedLegacyTLS const): * NetworkProcess/NetworkLoad.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::negotiatedLegacyTLS const): * Shared/Authentication/AuthenticationManager.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _negotiatedLegacyTLS]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::willChangeNegotiatedLegacyTLS): (WebKit::NavigationState::didChangeNegotiatedLegacyTLS): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::negotiatedLegacyTLS): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/PageLoadState.cpp: (WebKit::PageLoadState::commitChanges): (WebKit::PageLoadState::hasNegotiatedLegacyTLS const): (WebKit::PageLoadState::negotiatedLegacyTLS): (WebKit::PageLoadState::didCommitLoad): * UIProcess/PageLoadState.h: (WebKit::PageLoadState::Observer::willChangeNegotiatedLegacyTLS): (WebKit::PageLoadState::Observer::didChangeNegotiatedLegacyTLS): (WebKit::PageLoadState::Data::Data): Deleted. * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: 2020-01-31 Chris Dumez Unreviewed macOS build fix after r255518 * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleGestureEvent): 2020-01-31 Chris Dumez [ iOS ] imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.serviceworker.html is flaky failing. https://bugs.webkit.org/show_bug.cgi?id=206934 Reviewed by Brady Eidson. Flakiness would happen when the service worker would take too long to launch and the responsiveness timer would fire and report the process as unresponsive while still launching or very shortly after. When a service worker is reported as unresponsive, we would kill it. To address the issue, several changes were made: - Responsiveness checks are now disabled for slow builds (Debug, ASAN, GuardMalloc) - We only start the ResponsivenessTimer after the process has finished launching since the responsiveness check relies on IPC to the process and we cannot send the IPC until after the process has launched. * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp: (WebKit::DrawingAreaProxyCoordinatedGraphics::sendUpdateBackingStoreState): * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::goToBackForwardItem): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::launchProcessForReload): (WebKit::WebPageProxy::launchProcessWithItem): (WebKit::WebPageProxy::loadRequestWithNavigationShared): (WebKit::WebPageProxy::loadFile): (WebKit::WebPageProxy::loadDataWithNavigationShared): (WebKit::WebPageProxy::loadAlternateHTML): (WebKit::WebPageProxy::loadWebArchiveData): (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick): (WebKit::WebPageProxy::stopLoading): (WebKit::WebPageProxy::reload): (WebKit::WebPageProxy::goToBackForwardItem): (WebKit::WebPageProxy::dispatchActivityStateChange): (WebKit::WebPageProxy::processNextQueuedMouseEvent): (WebKit::WebPageProxy::handleKeyboardEvent): (WebKit::WebPageProxy::handleGestureEvent): (WebKit::WebPageProxy::handlePreventableTouchEvent): (WebKit::WebPageProxy::handleTouchEvent): (WebKit::WebPageProxy::runJavaScriptAlert): (WebKit::WebPageProxy::runJavaScriptConfirm): (WebKit::WebPageProxy::runJavaScriptPrompt): (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): (WebKit::WebPageProxy::runOpenPanel): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::mayBecomeUnresponsive): (WebKit::WebProcessProxy::didFinishLaunching): (WebKit::WebProcessProxy::startResponsivenessTimer): (WebKit::WebProcessProxy::isResponsive): * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::responsivenessTimer): 2020-01-31 Kate Cheney Add page configuration additions to APIPageConfiguration https://bugs.webkit.org/show_bug.cgi?id=206090 Reviewed by Andy Estes. * UIProcess/API/APIPageConfiguration.cpp: 2020-01-31 David Kilzer REGRESSION: [ iPadOS ] imported/w3c/web-platform-tests/dom/events/Event-dispatch-on-disabled-elements.html always fails Reviewed by Brent Fulgham. Test: imported/w3c/web-platform-tests/dom/events/Event-dispatch-on-disabled-elements.html * Platform/spi/ios/UIKitSPI.h: (-[UIViewController isPerformingModalTransition]): Add SPI declaration. 2020-01-31 Brent Fulgham REGRESSION (r251511): [iOS] HDR Playback broken https://bugs.webkit.org/show_bug.cgi?id=207052 Reviewed by Maciej Stachowiak. I missed an XPC service in Bug 203318 when I stopped importing the 'common.sb' sandbox. This broke some aspects of HDR playback for certain clients. This patch returns the XPC service, and unblocks access to a network preference file that AVFoundation needs to read to support some media playback features. * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2020-01-31 Alejandro G. Castro Compilation broken without service workers https://bugs.webkit.org/show_bug.cgi?id=207037 Reviewed by Chris Dumez. Protect the use of m_swServers, check if the SERVICE_WORKER is enabled. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::lowMemoryHandler): 2020-01-31 David Quesada Remove unused WKProcessPool downloads SPI https://bugs.webkit.org/show_bug.cgi?id=207029 rdar://problem/59052066 Reviewed by Anders Carlsson. Remove two unused SPI for starting/resuming downloads from a process pool. These methods were deprecated in favor of variants that also require a WKWebsiteDataStore, and all clients of these methods have switched to the new versions. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _downloadURLRequest:originatingWebView:]): Deleted. (-[WKProcessPool _resumeDownloadFromData:path:originatingWebView:]): Deleted. * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: 2020-01-31 Don Olmstead [CMake] Add _PRIVATE_LIBRARIES to framework https://bugs.webkit.org/show_bug.cgi?id=207004 Reviewed by Konstantin Tokarev. Move uses of PRIVATE within _LIBRARIES to _PRIVATE_LIBRARIES. Any _LIBRARIES appended afterwards will have that visibility set erroneously. * CMakeLists.txt: * PlatformFTW.cmake: * PlatformGTK.cmake: * PlatformWin.cmake: 2020-01-31 Zan Dobersek [WPE] Touch-based scrolling roundtrips through the WebProcess https://bugs.webkit.org/show_bug.cgi?id=206922 Reviewed by Adrian Perez de Castro. Short-cut the touch events through the ScrollGestureCotroller while it is actively handling the processed touch events, avoiding roundtrip through the WebProcess. This effectively means that when the scroll gesture is in action, any touch events that would affect that gesture are piped into the controller, producing a corresponding axis event or ending the gesture. The ScrollGestureCotroller ownership is moved into the WKWPE::View class in order to make accessing into that object easier from where the touch events are handled. * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::PageClientImpl): (WebKit::PageClientImpl::doneWithTouchEvent): * UIProcess/API/wpe/PageClientImpl.h: * UIProcess/API/wpe/ScrollGestureController.h: (WebKit::ScrollGestureController::isHandling const): * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::View): (WKWPE::m_backend): * UIProcess/API/wpe/WPEView.h: (WKWPE::View::scrollGestureController const): 2020-01-30 Jiewen Tan Add logging to show the flow of AppSSO https://bugs.webkit.org/show_bug.cgi?id=206778 Reviewed by Brent Fulgham. * Platform/Logging.h: * UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm: (WebKit::SOAuthorizationSession::shouldStart): (WebKit::SOAuthorizationSession::start): (WebKit::SOAuthorizationSession::fallBackToWebPath): (WebKit::SOAuthorizationSession::abort): (WebKit::SOAuthorizationSession::complete): (WebKit::SOAuthorizationSession::presentViewController): (WebKit::SOAuthorizationSession::dismissViewController): 2020-01-30 Jiewen Tan Unreviewed, another speculative test fix after r255041 * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm: (WebKit::MockLocalConnection::getAttestation const): Adds kSecAttrAccessible: kSecAttrAccessibleAfterFirstUnlock to secItem to bypass potential error due to screen locks. 2020-01-30 Alex Christensen Add WKNavigationDelegate SPI to disable TLS 1.0 and 1.1 https://bugs.webkit.org/show_bug.cgi?id=206979 Reviewed by Brady Eidson. * NetworkProcess/NetworkCORSPreflightChecker.cpp: (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge): * NetworkProcess/NetworkCORSPreflightChecker.h: * NetworkProcess/NetworkDataTask.h: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::didReceiveChallenge): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/NetworkSessionCreationParameters.cpp: (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/NetworkSessionCreationParameters.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::didReceiveChallenge): * NetworkProcess/PingLoad.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::didReceiveChallenge): (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (processServerTrustEvaluation): (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): (WebKit::NetworkSessionCocoa::continueDidReceiveChallenge): * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge): * Shared/Authentication/AuthenticationManager.h: * UIProcess/API/APINavigationClient.h: (API::NavigationClient::shouldAllowLegacyTLS): * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::systemAllowsLegacyTLSFor): (WebKit::NavigationState::NavigationClient::shouldAllowLegacyTLS): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: 2020-01-30 Tim Horton Can still get stuck after swipe backwards with a slow server, even after r254552 https://bugs.webkit.org/show_bug.cgi?id=207017 Reviewed by Chris Dumez. * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::unfreezeLayerTreeDueToSwipeAnimation): * UIProcess/ProvisionalPageProxy.h: * UIProcess/WebPageProxy.cpp: There's a second case where you can get stuck with the "swipe gesture" layer tree freeze reason in the web process: when doing a cross-origin navigation where the load takes more than 3 seconds (the swipe snapshot timeout) to commit, the provisional page will have mirrored the original page's frozen state upon creation, but will not ever receive the unfreeze, because it is sent while still provisional. To fix this, just forward the unfreeze message to the provisional page. 2020-01-30 Per Arne Vollan [iOS] Issue mach sandbox extension to the frontboard and icon service when the attachment element is enabled https://bugs.webkit.org/show_bug.cgi?id=205443 Reviewed by Brent Fulgham. When support for the html attachment element is enabled, issue a mach lookup extension to the frontboard and icon service for the WebContent process, since these daemons are being contacted when icons for attachments are being queried. Also, retrieve the focus ring color in the UI process, since getting this color requires access to the frontboard daemon. Test: fast/sandbox/ios/sandbox-mach-lookup-attachment-element.html * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2020-01-30 Tim Horton REGRESSION (r253267): Swipe from edge on Twitter images no longer goes back https://bugs.webkit.org/show_bug.cgi?id=207011 Reviewed by Wenson Hsieh. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]): The new touch-event async deferring gesture recognizer was erroneously deferring edge swipes, which are not allowed to be blocked by touch events. Opt them out of the new gesture gate mechanism. 2020-01-30 Jonathan Bedard PAL: Remove old iOS version macros https://bugs.webkit.org/show_bug.cgi?id=206905 Reviewed by Darin Adler. * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm: Remove USE(NSPROGRESS_PUBLISHING_SPI) * NetworkProcess/Downloads/cocoa/WKDownloadProgress.mm: Ditto. 2020-01-30 youenn fablet Disable Service Workers before terminating an unresponsive service worker process https://bugs.webkit.org/show_bug.cgi?id=206994 Reviewed by Chris Dumez. In case a process becomes unresponsive, we terminate it in case it is a service worker process. In that case, we should make sure not to call the service worker process crash callback. To do so, disable service workers before terminating the IPC connection. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didBecomeUnresponsive): 2020-01-30 Brent Fulgham [iOS] Remove report rule for 'com.apple.runningboard' from the Network and GPU process sandboxes https://bugs.webkit.org/show_bug.cgi?id=206980 Reviewed by Maciej Stachowiak. Remove the logging now that we have useful backtraces. * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: 2020-01-30 youenn fablet [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder https://bugs.webkit.org/show_bug.cgi?id=206582 Reviewed by Eric Carlson. * GPUProcess/webrtc/RemoteMediaRecorder.cpp: (WebKit::RemoteMediaRecorder::create): Use new constructor. 2020-01-30 Carlos Garcia Campos REGRESSION(r253636): [GTK] Mouse cursor changes using onMouseXYZ are erratic https://bugs.webkit.org/show_bug.cgi?id=206454 Reviewed by Tim Horton. Since r253636 only platforms defining HAVE_NSCURSOR claim to support setting the cursor. * WebProcess/WebCoreSupport/WebChromeClient.h: Do not implement supportsSettingCursor() for GTK port either. 2020-01-29 Tim Horton REGRESSION (r255322): macCatalyst: Tapping in an input field doesn't change the selection location https://bugs.webkit.org/show_bug.cgi?id=206978 Reviewed by Wenson Hsieh. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: (WebKit::WebChromeClient::shouldUseMouseEventForSelection): (WebKit::WebChromeClient::shouldUseMouseEventsForSelection): Deleted. Allow single-click events to change the selection; this is required in order to allow WebCore to set the selection in the case that the UITextInteraction gestures haven't yet been installed. Continue to not allow multi-click events to change the selection, because these are the ones that conflict with UIKit's behaviors. 2020-01-29 Commit Queue Unreviewed, rolling out r254379. https://bugs.webkit.org/show_bug.cgi?id=206969 Introduced media regressions (Requested by perarne on #webkit). Reverted changeset: "[iOS] Remove used media-related mach services from the WebContent process sandbox" https://bugs.webkit.org/show_bug.cgi?id=206089 https://trac.webkit.org/changeset/254379 2020-01-29 Per Arne Vollan [iOS] Deny mach lookup access to aggregate service https://bugs.webkit.org/show_bug.cgi?id=206710 Reviewed by Darin Adler. Tighten sandbox by denying access to this service. Test: fast/sandbox/ios/sandbox-mach-lookup.html * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2020-01-29 Wenson Hsieh [iPadOS] Select popovers on amazon.com sometimes dismiss immediately after appearing https://bugs.webkit.org/show_bug.cgi?id=206948 Reviewed by Tim Horton. Amazon adds active touchstart event listeners to their select elements, where they call preventDefault() and programmatically focus the select element. Doing so prevents clicks from being dispatched by allowing the web touch event gesture to recognize instead of the synthetic click gesture, which (inside -_singleTapRecognized:) would otherwise dismiss any currently presented popover. After making touchstart events dispatch asynchronously, preventing touchstart no longer causes other native gestures (such as the synthetic click gesture) to fail in the case where there is a sync touchmove or touchend event listener, and the touch gesture has ended before the touchstart handler has finished executing and told the UI process whether or not the touch was handled. This is because the touchend or touchmove is dispatched synchronously while the touchstart is still being processed; while the web page sees the correct order of events, the UI process will end up learning that the synchronous touch was handled before the response to the asynchronously dispatched touchstart event has arrived. Our current logic in the sync touch event dispatch case then unconditionally ends gesture deferral by calling `doneDeferringNativeGestures` with `handled` equal to whether or not the touch event (a "touchend", in this case) had been handled. However, in the case where touchstart event is prevented but the touchend event is not, this will cause us to prematurely stop deferring gestures even though the page called `preventDefault()` in the touchstart event handler, and allow the synthetic click gesture to recognize when it shouldn't. To fix this, keep deferring native gestures after handling a sync touch in the case where a touchstart event is still being handled; instead, remember whether the touch event was handled using a new member variable (`m_handledSynchronousTouchEventWhileDispatchingPreventableTouchStart`), and consult this when the response to the touchstart has been received in the UI process to determine whether platform gestures should be allowed to recognize. This variable is reset once we're done handling the touchstart. Test: fast/events/touch/ios/prevent-default-with-slow-touchstart-handler.html * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handlePreventableTouchEvent): * UIProcess/WebPageProxy.h: 2020-01-29 Chris Dumez [iOS] Make sure unused service worker processes exit promptly on low memory warning https://bugs.webkit.org/show_bug.cgi?id=206939 Reviewed by Alex Christensen. Make sure unused service worker processes exit promptly on low memory warning. They normally take 10 seconds to exit for performance reasons. However, in case of memory pressure, keeping those processes around that long is not the right thing to do. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::lowMemoryHandler): 2020-01-29 Chris Dumez Unreviewed, fix Catalyst build after r255366 * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultDisallowSyncXHRDuringPageDismissalEnabled): * Shared/WebPreferencesDefaultValues.h: * Shared/ios/WebPreferencesDefaultValuesIOS.mm: 2020-01-29 Sihui Liu Crash under com.apple.WebKit.Networking at WebKit: WebKit::WebIDBServer::suspend https://bugs.webkit.org/show_bug.cgi?id=206904 Reviewed by Maciej Stachowiak. Wait until m_server is set in constructor of WebIDBServer to make sure m_server can be accessed in WebIDBServer::suspend. * NetworkProcess/IndexedDB/WebIDBServer.cpp: (WebKit::WebIDBServer::WebIDBServer): 2020-01-29 Brent Fulgham Unreviewed, rolling out r255217 and r255217. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2020-01-29 Chris Dumez [iOS] Add managed preference to allow legacy sync XHRs during page dismissal https://bugs.webkit.org/show_bug.cgi?id=206944 Reviewed by Alex Christensen. Add managed preference for iOS to allow enterprise customers to keep using legacy sync XHRs during page dismissal. * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultDisallowSyncXHRDuringPageDismissalEnabled): * Shared/WebPreferencesDefaultValues.h: * Shared/ios/WebPreferencesDefaultValuesIOS.mm: (WebKit::allowsDeprecatedSynchronousXMLHttpRequestDuringUnload): 2020-01-29 Carlos Garcia Campos Unreviewed. Move unsetenv to WebProcessMain.cpp after r255342 I forgot to do that before landing the patch. * WebProcess/EntryPoint/unix/WebProcessMain.cpp: (main): * WebProcess/gtk/WebProcessMainGtk.cpp: 2020-01-29 youenn fablet Send WebsiteDataStore media parameters to GPUProcess when needed https://bugs.webkit.org/show_bug.cgi?id=206870 Reviewed by Eric Carlson. Whenever opening a new WebProcess/GPUProcess connection, make sure GPUProcess knows WebProcess session parameters. Make sure to remove session parameters when data store is destroyed. Update media code to no longer send the corresponding parameters for each media load. Covered by existing tests no longer triggering sandbox violations. * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::mediaCacheDirectory const): (WebKit::GPUConnectionToWebProcess::mediaKeysStorageDirectory const): * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::addSession): (WebKit::GPUProcess::removeSession): (WebKit::GPUProcess::mediaCacheDirectory const): (WebKit::GPUProcess::mediaKeysStorageDirectory const): * GPUProcess/GPUProcess.h: * GPUProcess/GPUProcess.messages.in: * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::load): (WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaKeysStorageDirectory const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaCacheDirectory const): * GPUProcess/media/RemoteMediaPlayerProxy.h: * GPUProcess/media/RemoteMediaPlayerProxyConfiguration.h: (WebKit::RemoteMediaPlayerProxyConfiguration::encode const): (WebKit::RemoteMediaPlayerProxyConfiguration::decode): * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::singleton): (WebKit::GPUProcessProxy::openGPUProcessConnection): (WebKit::gpuProcessSessionParameters): (WebKit::GPUProcessProxy::addSession): (WebKit::GPUProcessProxy::removeSession): * UIProcess/GPU/GPUProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::~WebsiteDataStore): * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer): 2020-01-29 youenn fablet [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder https://bugs.webkit.org/show_bug.cgi?id=206582 Reviewed by Eric Carlson. * GPUProcess/webrtc/RemoteMediaRecorder.cpp: (WebKit::RemoteMediaRecorder::create): Use new constructor. 2020-01-29 Carlos Garcia Campos [GTK] WebDriver: screenshot ignores CSS transformations or WebGL content. https://bugs.webkit.org/show_bug.cgi?id=206514 Reviewed by Carlos Alberto Lopez Perez. WebPage::scaledSnapshotWithOptions() doesn't work when accelerated compositing is enabled. To fix this, we need to take the screenshot from the UI process, like we do for the layout tests. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::takeViewSnapshot): Pass clip rectangle to webkitWebViewBaseTakeViewSnapshot. * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseTakeViewSnapshot): Use the given clip rectangle if not nullopt. * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::takeScreenshot): In case of full web view snapshot just call WebPageProxy::takeViewSnapshot() with a nullopt clip rectangle. In case of element snapshot, send SnapshotRectForScreenshot message to the web process to get the clip rectangle and then call WebPageProxy::takeViewSnapshot(). (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData): Empty implementation for other ports. * UIProcess/Automation/WebAutomationSession.h: Make platformGetBase64EncodedPNGData() static. * UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp: (WebKit::base64EncodedPNGData): Moved common code to this new function. (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData): New function to get the encoded PNG from a ViewSnapshot. * UIProcess/PageClient.h: Add optional clip rectangle parameter to takeViewSnapshot(). * UIProcess/ViewSnapshotStore.cpp: (WebKit::ViewSnapshotStore::recordSnapshot): Pass nullopt to takeViewSnapshot(). * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::takeViewSnapshot): * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::takeViewSnapshot): * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::snapshotElementRectForScreenshot): Renamed to avoid conflict with new IPC message handler. (WebKit::WebAutomationSessionProxy::takeScreenshot): Call snapshotRectForScreenshot() to get the snapshot rectangle and convert it to document coords. (WebKit::WebAutomationSessionProxy::snapshotRectForScreenshot): Get the snapshot rectangle in client coords. (WebKit::snapshotRectForScreenshot): Deleted. * WebProcess/Automation/WebAutomationSessionProxy.h: * WebProcess/Automation/WebAutomationSessionProxy.messages.in: Add SnapshotRectForScreenshot message. 2020-01-28 Carlos Garcia Campos [GTK] Should use light theme unless website declares support for dark themes in color-schemes property https://bugs.webkit.org/show_bug.cgi?id=197947 Reviewed by Michael Catanzaro. Handle the theme changes in the UI process, converting dark variant to the light one before sending the theme name to the web process. The web process is still notified when a dark theme is in use, so that if website prefers a dark color scheme it will be used, but the gtk theme that will be used for controls styling will always be light. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): Encode themeName. (WebKit::WebPageCreationParameters::decode): Decode themeName. * Shared/WebPageCreationParameters.h: * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::themeName const): Get the theme name that should be used by the web process. * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/API/gtk/WebKitWebViewBase.cpp: (themeChanged): Call WebPageProxy::themeDidChange(). (applicationPreferDarkThemeChanged): (webkitWebViewBaseSetToplevelOnScreenWindow): Use a different callback for the theme name change. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/gtk/WebPageProxyGtk.cpp: (WebKit::WebPageProxy::themeDidChange): Send ThemeDidChange message to the web process with the theme name to use. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): Initialize the theme name. (WebKit::WebPage::effectiveAppearanceDidChange): Use this now for GTK port too. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Add ThemeDidChange message. * WebProcess/WebPage/gtk/WebPageGtk.cpp: (WebKit::WebPage::themeDidChange): Set the theme given name in gtk settings. * WebProcess/gtk/WebProcessMainGtk.cpp: 2020-01-28 Timothy Horton Fix the build * UIProcess/ios/WKMouseGestureRecognizer.mm: (-[WKMouseGestureRecognizer touchesEnded:withEvent:]): 2020-01-28 Tim Horton macCatalyst: Right clicking on a link follows it immediately https://bugs.webkit.org/show_bug.cgi?id=206919 Reviewed by Wenson Hsieh. * UIProcess/ios/WKMouseGestureRecognizer.mm: (-[WKMouseGestureRecognizer createMouseEventWithType:forEvent:]): (-[WKMouseGestureRecognizer touchesBegan:withEvent:]): (-[WKMouseGestureRecognizer touchesEnded:withEvent:]): UIKit's _buttonMask does not include the currently-released button, so in order to correctly identify the released button in touchesEnded, store the mask for the length of the click. 2020-01-28 Tim Horton macCatalyst: Triple clicking to select a sentence results in an empty selection https://bugs.webkit.org/show_bug.cgi?id=206863 Reviewed by Wenson Hsieh. * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h: * UIProcess/API/Cocoa/WKWebViewTesting.mm: (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]): * UIProcess/API/mac/WKWebViewPrivateForTestingMac.h: * UIProcess/API/mac/WKWebViewTestingMac.mm: (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]): Deleted. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::handleProcessSwapOrExit): (WebKit::WebViewImpl::doAfterProcessingAllPendingMouseEvents): Deleted. (WebKit::WebViewImpl::didFinishProcessingAllPendingMouseEvents): Deleted. (WebKit::WebViewImpl::flushPendingMouseEventCallbacks): Deleted. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::doAfterProcessingAllPendingMouseEvents): (WebKit::WebPageProxy::didFinishProcessingAllPendingMouseEvents): (WebKit::WebPageProxy::flushPendingMouseEventCallbacks): * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::didFinishProcessingAllPendingMouseEvents): Deleted. Move "doAfterProcessingAllPendingMouseEvents" to WebPage instead of WebViewImpl, so it can be used on all platforms. Expose it via WKWebView. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: (WebKit::WebChromeClient::shouldUseMouseEventsForSelection): 2020-01-28 Andres Gonzalez Fix for crash in AppKit accessibility. https://bugs.webkit.org/show_bug.cgi?id=206902 Reviewed by Chris Fleizach. Accessibility methods invoked in the secondary thread that Return id values retrieved from the main thread, need to retain/autoRelease the returned ids. * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: (-[WKAccessibilityWebPageObject ALLOW_DEPRECATED_IMPLEMENTATIONS_END]): (-[WKAccessibilityWebPageObject accessibilityAttributeSizeValue]): (-[WKAccessibilityWebPageObject accessibilityAttributePositionValue]): (-[WKAccessibilityWebPageObject accessibilityDataDetectorValue:point:]): 2020-01-28 Brent Fulgham Unreviewed test fix after r255217 Re-activate SecurityServer mach port access in Catalina and older. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2020-01-28 Brent Fulgham Reset the application bundle identifier between test runs https://bugs.webkit.org/show_bug.cgi?id=206858 Reviewed by Per Arne Vollan. Clear the application bundle identifier set during testing when resetting the test system to a known state in preparation for the next run. Tests: fast/sandbox/ios/sandbox-mach-lookup.html, fast/sandbox/ios/sandbox-mach-lookup-mail.html * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h: * UIProcess/API/Cocoa/WKWebViewTesting.mm: (+[WKWebView _clearApplicationBundleIdentifierTestingOverride]): Added. 2020-01-24 Sergio Villar Senin Remove WebVR from the tree https://bugs.webkit.org/show_bug.cgi?id=206739 Reviewed by Darin Adler. * Shared/WebPreferences.yaml: removed WebVR preference. 2020-01-28 youenn fablet Remove unneeded message checks in GPUProcess code https://bugs.webkit.org/show_bug.cgi?id=206866 Reviewed by Eric Carlson. Remove message check macros and checks since they are not needed due to the use of ObjectIdentifier. No change of behavior. * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: (WebKit::RemoteMediaPlayerManagerProxy::createMediaPlayer): * GPUProcess/media/RemoteMediaPlayerProxy.cpp: 2020-01-27 Antoine Quint [Web Animations] Make Animation.timeline read-write only if a runtime flag is enabled https://bugs.webkit.org/show_bug.cgi?id=206173 Reviewed by Dean Jackson. Add a new WebAnimationsMutableTimelines runtime flag. * Shared/WebPreferences.yaml: 2020-01-28 Carlos Garcia Campos [GTK][WPE] QR code not loaded in web.whatsapp.com https://bugs.webkit.org/show_bug.cgi?id=203404 Reviewed by Michael Catanzaro. This is a regression of the switch to use libsoup API for the WebSockets implementation. The QR code is loaded using a WebSocket connection, but the server is always replying with a 400 Bad Request to the Upgrade requests coming from an existing HTTP connection. We need to ensure a new dedicated connection is used for WebSockets. * NetworkProcess/soup/WebSocketTaskSoup.cpp: (WebKit::WebSocketTask::WebSocketTask): Set the SOUP_MESSAGE_NEW_CONNECTION flag to the SoupMessage before starting the connection. 2020-01-27 Carlos Garcia Campos [GTK] Remote Inspector: add support for service workers targets https://bugs.webkit.org/show_bug.cgi?id=206821 Reviewed by Žan Doberšek. Add support for debugging service workers. * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp: (WebKit::RemoteInspectorProtocolHandler::handleRequest): Pass target type to message handler too. (WebKit::RemoteInspectorProtocolHandler::inspect): Pass the received target type to the client. * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.h: * UIProcess/glib/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorProxy::load): It now receives the debuggable type that is set to the API::DebuggableInfo. (WebKit::RemoteInspectorClient::messageHandlers): Handle service worker targets too. (WebKit::debuggableType): Helper to convert the target type to debuggable type. (WebKit::RemoteInspectorClient::inspect): Pass the debuggable tupe to RemoteInspectorProxy::load(). * UIProcess/glib/RemoteInspectorClient.h: * UIProcess/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::infoForLocalDebuggable): Use WebPage as debuggable type instead of the default. 2020-01-27 Simon Fraser REGRESSION (r253634): cricbuzz.com media controls vanish depending on page scale https://bugs.webkit.org/show_bug.cgi?id=206788 rdar://problem/58780584 Reviewed by Tim Horton. r253634 changed "delegatesPageScaling"'" to a flag on ScrollView. However, this changed behavior for subframes; Settings are propagated down, but only the main ScrollView had delegatesPageScaling set on it. "delegatesPageScaling" is a page-level thing (subframes don't independently zoom), so it should live on Page. Move it there. The bug was triggered by incorrectly taking page scale into account for rects in the compositing overlap map (see RenderLayerCompositor::addToOverlapMap()) in subframes, and those rects changing on zoom. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): * WebProcess/WebPage/ios/FindControllerIOS.mm: (WebKit::FindIndicatorOverlayClientIOS::drawRect): 2020-01-27 Fujii Hironori [WinCairo][curl] ASSERTION FAILED: sessionID != PAL::SessionID::defaultSessionID() in WebKit::CacheStorage::Engine::destroyEngine since r255137 https://bugs.webkit.org/show_bug.cgi?id=206859 Reviewed by Don Olmstead. After r255137, WinCairo debug WK2 is still failing an assertion while shutdown, which is ensuring the destructing session isn't the default session. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::destroyEngine): Conditioned out the assertion for curl port as well as Soup port does. 2020-01-27 David Quesada Support observing a different set of view service state notifications in ApplicationStateTracker https://bugs.webkit.org/show_bug.cgi?id=201737 rdar://problem/54786414 Reviewed by Chris Dumez. * UIProcess/ApplicationStateTracker.mm: Make ApplicationStateTracker conditionally (based on a flag to be defined in WebKitAdditions) use a different pair of notifications when it is in a view service or extension. These notifications report state changes of the individual scene that hosts the web view, rather than the state of the overall host application. This allows for more accurate state tracking for web views in extensions or view services hosted by apps with multiple open scenes. 2020-01-27 Alex Christensen Add WKWebView SPI equivalent of WKView.shouldClipToVisibleRect https://bugs.webkit.org/show_bug.cgi?id=206849 Reviewed by Simon Fraser. Books currently uses WKView.setShouldClipToVisibleRect and needs to migrate to WKWebView, but it needs to do so without modifying the other properties in _setMinimumLayoutWidth, which is currently the only other caller of WebViewImpl::setClipsToVisibleRect. Expose an SPI that only calls WebViewImpl::setClipsToVisibleRect. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/mac/WKWebViewMac.mm: (-[WKWebView _clipsToVisibleRect]): (-[WKWebView _setClipsToVisibleRect:]): 2020-01-27 Brent Fulgham Remove SecurityServer from WebContent sandboxes https://bugs.webkit.org/show_bug.cgi?id=206832 Reviewed by Per Arne Vollan. We no longer need access to 'com.apple.SecurityServer' and 'com.apple.ocspd' on recent macaOS systems. Tested by existing test suite. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2020-01-27 Devin Rousso Web Inspector: consolidate UIProcess/WebProcess files into Inspector folders https://bugs.webkit.org/show_bug.cgi?id=206721 Reviewed by Alex Christensen and Don Olmstead. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources.make: * PlatformGTK.cmake: * PlatformMac.cmake: * PlatformFTW.cmake: * PlatformWin.cmake: * Sources.txt: * SourcesCocoa.txt: * SourcesGTK.txt: * WebKit.xcodeproj/project.pbxproj: * UIProcess/Inspector/InspectorTargetProxy.h: Renamed from Source/WebKit/UIProcess/InspectorTargetProxy.h. * UIProcess/Inspector/InspectorTargetProxy.cpp: Renamed from Source/WebKit/UIProcess/InspectorTargetProxy.cpp. * UIProcess/Inspector/RemoteWebInspectorProxy.messages.in: Renamed from Source/WebKit/UIProcess/RemoteWebInspectorProxy.messages.in. * UIProcess/Inspector/RemoteWebInspectorProxy.h: Renamed from Source/WebKit/UIProcess/RemoteWebInspectorProxy.h. * UIProcess/Inspector/RemoteWebInspectorProxy.cpp: Renamed from Source/WebKit/UIProcess/RemoteWebInspectorProxy.cpp. * UIProcess/Inspector/WebInspectorProxy.messages.in: Renamed from Source/WebKit/UIProcess/WebInspectorProxy.messages.in. * UIProcess/Inspector/WebInspectorProxy.h: Renamed from Source/WebKit/UIProcess/WebInspectorProxy.h. * UIProcess/Inspector/WebInspectorProxy.cpp: Renamed from Source/WebKit/UIProcess/WebInspectorProxy.cpp. * UIProcess/Inspector/WebInspectorUtilities.h: Renamed from Source/WebKit/UIProcess/WebInspectorUtilities.h. * UIProcess/Inspector/WebInspectorUtilities.cpp: Renamed from Source/WebKit/UIProcess/WebInspectorUtilities.cpp. * UIProcess/Inspector/WebPageDebuggable.h: Renamed from Source/WebKit/UIProcess/WebPageDebuggable.h. * UIProcess/Inspector/WebPageDebuggable.cpp: Renamed from Source/WebKit/UIProcess/WebPageDebuggable.cpp. * UIProcess/Inspector/WebPageInspectorController.h: Renamed from Source/WebKit/UIProcess/WebPageInspectorController.h. * UIProcess/Inspector/WebPageInspectorController.cpp: Renamed from Source/WebKit/UIProcess/WebPageInspectorController.cpp. * UIProcess/Inspector/glib/RemoteInspectorClient.h: Renamed from Source/WebKit/UIProcess/glib/RemoteInspectorClient.h. * UIProcess/Inspector/glib/RemoteInspectorClient.cpp: Renamed from Source/WebKit/UIProcess/glib/RemoteInspectorClient.cpp. * UIProcess/Inspector/gtk/RemoteWebInspectorProxyGtk.cpp: Renamed from Source/WebKit/UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp. * UIProcess/Inspector/gtk/WebInspectorProxyGtk.cpp: Renamed from Source/WebKit/UIProcess/gtk/WebInspectorProxyGtk.cpp. * UIProcess/Inspector/gtk/WebInspectorProxyClient.h: Renamed from Source/WebKit/UIProcess/gtk/WebInspectorProxyClient.h. * UIProcess/Inspector/gtk/WebKitInspectorWindow.h: Renamed from Source/WebKit/UIProcess/gtk/WebKitInspectorWindow.h. * UIProcess/Inspector/gtk/WebKitInspectorWindow.cpp: Renamed from Source/WebKit/UIProcess/gtk/WebKitInspectorWindow.cpp. * UIProcess/Inspector/ios/WKInspectorHighlightView.h: Renamed from Source/WebKit/UIProcess/WKInspectorHighlightView.h. * UIProcess/Inspector/ios/WKInspectorHighlightView.mm: Renamed from Source/WebKit/UIProcess/WKInspectorHighlightView.mm. * UIProcess/Inspector/ios/WKInspectorNodeSearchGestureRecognizer.h: Renamed from Source/WebKit/UIProcess/ios/WKInspectorNodeSearchGestureRecognizer.h. * UIProcess/Inspector/ios/WKInspectorNodeSearchGestureRecognizer.mm: Renamed from Source/WebKit/UIProcess/ios/WKInspectorNodeSearchGestureRecognizer.mm. * UIProcess/Inspector/mac/RemoteWebInspectorProxyMac.mm: Renamed from Source/WebKit/UIProcess/mac/RemoteWebInspectorProxyMac.mm. * UIProcess/Inspector/mac/WKInspectorViewController.h: Renamed from Source/WebKit/UIProcess/mac/WKInspectorViewController.h. * UIProcess/Inspector/mac/WKInspectorViewController.mm: Renamed from Source/WebKit/UIProcess/mac/WKInspectorViewController.mm. * UIProcess/Inspector/mac/WKInspectorWKWebView.h: Renamed from Source/WebKit/UIProcess/mac/WKInspectorWKWebView.h. * UIProcess/Inspector/mac/WKInspectorWKWebView.mm: Renamed from Source/WebKit/UIProcess/mac/WKInspectorWKWebView.mm. * UIProcess/Inspector/mac/WebInspectorProxyMac.mm: Renamed from Source/WebKit/UIProcess/mac/WebInspectorProxyMac.mm. * UIProcess/Inspector/socket/RemoteInspectorClient.h: Renamed from Source/WebKit/UIProcess/socket/RemoteInspectorClient.h. * UIProcess/Inspector/socket/RemoteInspectorClient.cpp: Renamed from Source/WebKit/UIProcess/socket/RemoteInspectorClient.cpp. * UIProcess/Inspector/socket/RemoteInspectorProtocolHandler.h: Renamed from Source/WebKit/UIProcess/socket/RemoteInspectorProtocolHandler.h. * UIProcess/Inspector/socket/RemoteInspectorProtocolHandler.cpp: Renamed from Source/WebKit/UIProcess/socket/RemoteInspectorProtocolHandler.cpp. * UIProcess/Inspector/win/RemoteWebInspectorProxyWin.cpp: Renamed from Source/WebKit/UIProcess/win/RemoteWebInspectorProxyWin.cpp. * UIProcess/Inspector/win/WebInspectorProxyWin.cpp: Renamed from Source/WebKit/UIProcess/win/WebInspectorProxyWin.cpp. * WebProcess/Inspector/RemoteWebInspectorUI.messages.in: Renamed from Source/WebKit/WebProcess/WebPage/RemoteWebInspectorUI.messages.in. * WebProcess/Inspector/RemoteWebInspectorUI.h: Renamed from Source/WebKit/WebProcess/WebPage/RemoteWebInspectorUI.h. * WebProcess/Inspector/RemoteWebInspectorUI.cpp: Renamed from Source/WebKit/WebProcess/WebPage/RemoteWebInspectorUI.cpp. * WebProcess/Inspector/WebInspector.messages.in: Renamed from Source/WebKit/WebProcess/WebPage/WebInspector.messages.in. * WebProcess/Inspector/WebInspector.h: Renamed from Source/WebKit/WebProcess/WebPage/WebInspector.h. * WebProcess/Inspector/WebInspector.cpp: Renamed from Source/WebKit/WebProcess/WebPage/WebInspector.cpp. * WebProcess/Inspector/WebInspectorClient.h: Renamed from Source/WebKit/WebProcess/WebCoreSupport/WebInspectorClient.h. * WebProcess/Inspector/WebInspectorClient.cpp: Renamed from Source/WebKit/WebProcess/WebCoreSupport/WebInspectorClient.cpp. * WebProcess/Inspector/WebInspectorFrontendAPIDispatcher.h: Renamed from Source/WebKit/WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.h. * WebProcess/Inspector/WebInspectorFrontendAPIDispatcher.cpp: Renamed from Source/WebKit/WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp. * WebProcess/Inspector/WebInspectorInterruptDispatcher.messages.in: Renamed from Source/WebKit/WebProcess/WebPage/WebInspectorInterruptDispatcher.messages.in. * WebProcess/Inspector/WebInspectorInterruptDispatcher.h: Renamed from Source/WebKit/WebProcess/WebPage/WebInspectorInterruptDispatcher.h. * WebProcess/Inspector/WebInspectorInterruptDispatcher.cpp: Renamed from Source/WebKit/WebProcess/WebPage/WebInspectorInterruptDispatcher.cpp. * WebProcess/Inspector/WebInspectorUI.messages.in: Renamed from Source/WebKit/WebProcess/WebPage/WebInspectorUI.messages.in. * WebProcess/Inspector/WebInspectorUI.h: Renamed from Source/WebKit/WebProcess/WebPage/WebInspectorUI.h. * WebProcess/Inspector/WebInspectorUI.cpp: Renamed from Source/WebKit/WebProcess/WebPage/WebInspectorUI.cpp. * WebProcess/Inspector/WebPageInspectorTarget.h: Renamed from Source/WebKit/WebProcess/WebPage/WebPageInspectorTarget.h. * WebProcess/Inspector/WebPageInspectorTarget.cpp: Renamed from Source/WebKit/WebProcess/WebPage/WebPageInspectorTarget.cpp. * WebProcess/Inspector/WebPageInspectorTargetController.h: Renamed from Source/WebKit/WebProcess/WebPage/WebPageInspectorTargetController.h. * WebProcess/Inspector/WebPageInspectorTargetController.cpp: Renamed from Source/WebKit/WebProcess/WebPage/WebPageInspectorTargetController.cpp. * WebProcess/Inspector/WebPageInspectorTargetFrontendChannel.h: Renamed from Source/WebKit/WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.h. * WebProcess/Inspector/WebPageInspectorTargetFrontendChannel.cpp: Renamed from Source/WebKit/WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.cpp. * WebProcess/Inspector/gtk/WebInspectorUIGtk.cpp: Renamed from Source/WebKit/WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp. * WebProcess/Inspector/mac/WebInspectorUIMac.mm: Renamed from Source/WebKit/WebProcess/WebPage/mac/WebInspectorUIMac.mm. * WebProcess/Inspector/win/WebInspectorUIWin.mm: Renamed from Source/WebKit/WebProcess/WebPage/win/WebInspectorUIWin.mm. * UIProcess/API/APIAttachment.h: * UIProcess/API/Cocoa/WKWebViewTesting.mm: Add some missing includes. 2020-01-27 Chris Dumez Unreviewed, drop unused MESSAGE_CHECK_CONTEXTID() macro in UserMediaCaptureManagerProxy.cpp. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: 2020-01-27 Devin Rousso Web Inspector: unable to evaluate in the isolated world of content scripts injected by safari app extensions https://bugs.webkit.org/show_bug.cgi?id=206110 Reviewed by Timothy Hatcher, Joseph Pecoraro, and Brian Burg. In addition to evaluating in subframe execution contexts, add the ability for Web Inspector to evaluate in non-normal isolated worlds. * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h: * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp: (WebKit::InjectedBundleScriptWorld::create): * WebProcess/UserContent/WebUserContentController.cpp: (WebKit::WebUserContentController::addUserContentWorlds): * WebProcess/InjectedBundle/API/glib/WebKitScriptWorld.cpp: (webkit_script_world_new): (webkit_script_world_new_with_name): Treat isolated worlds created by API calls as `User` worlds. 2020-01-27 Chris Dumez Unreviewed, revert r253984 as it appears to be causing assertion leaks. https://bugs.webkit.org/show_bug.cgi?id=205687 * Configurations/WebKit.xcconfig: * Platform/spi/ios/RunningBoardServicesSPI.h: Removed. * Scripts/process-entitlements.sh: * Shared/DependencyProcessAssertion.cpp: Removed. * Shared/DependencyProcessAssertion.h: Removed. * Shared/NativeWebTouchEvent.h: * Shared/ios/DependencyProcessAssertionIOS.mm: Removed. * Sources.txt: * SourcesCocoa.txt: * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::processWasResumed): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeConnection): * WebProcess/WebProcess.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::processTaskStateDidChange): (WebKit::WebProcess::releaseProcessWasResumedAssertions): 2020-01-27 Jiewen Tan Unreviewed, a build fix after r255111 * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm: Adding some missing headers. 2020-01-27 Chris Dumez Unreviewed, revert r254210 as it seems to be causing process assertion leaks. https://bugs.webkit.org/show_bug.cgi?id=205836 * Shared/AuxiliaryProcess.cpp: (WebKit::AuxiliaryProcess::initializeConnection): * Shared/AuxiliaryProcess.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeConnection): * WebProcess/WebProcess.h: 2020-01-27 Brent Fulgham Remove last bits of location services rules https://bugs.webkit.org/show_bug.cgi?id=206023 Reviewed by Per Arne Vollan. Remove the user preferences that were allowed by the sandbox back when location services were used in the process. * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2020-01-27 Said Abou-Hallawa Throttling requestAnimationFrame should be controlled by RenderingUpdateScheduler https://bugs.webkit.org/show_bug.cgi?id=204713 Reviewed by Simon Fraser. Create an IPC message on the DrawingArea to send a message from the WebProcess to the UIProcess to setPreferredFramesPerSecond of the DisplayRefreshMonitor. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetRenderingUpdateThrottlingEnabled): (WKPreferencesGetRenderingUpdateThrottlingEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: Add a WKPreference key for RenderingUpdateThrottlingEnabled. * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: (-[WKOneShotDisplayLinkHandler setPreferredFramesPerSecond:]): (WebKit::RemoteLayerTreeDrawingAreaProxy::setPreferredFramesPerSecond): Set the preferredFramesPerSecond of the CADisplayLink. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm: (WebKit::RemoteLayerTreeDisplayRefreshMonitor::setPreferredFramesPerSecond): Delegate the call to RemoteLayerTreeDrawingArea. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::setPreferredFramesPerSecond): Send the IPC message from the WebProcess to the UIProcess. 2020-01-27 Kate Cheney Delete the ITP storage file that is not being used (plist or database file) when switching to a new storage type https://bugs.webkit.org/show_bug.cgi?id=206601 Reviewed by Alex Christensen. This patch also deletes the temporary files SQLite creates when constructing a new database. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): 2020-01-27 Brent Fulgham Remove locationd entitlements from the WebContent process https://bugs.webkit.org/show_bug.cgi?id=206022 Reviewed by Per Arne Vollan. Now that we have removed mach connections related to 'com.apple.locationd', we should also remove the process entitlements. No new tests. There are no changes to behavior. * Scripts/process-entitlements.sh: 2020-01-27 Ryan Haddad Unreviewed, rolling out r255131. Caused assertion failures on iOS debug bots. Reverted changeset: "Throttling requestAnimationFrame should be controlled by RenderingUpdateScheduler" https://bugs.webkit.org/show_bug.cgi?id=204713 https://trac.webkit.org/changeset/255131 2020-01-27 Chris Dumez NetworkProcessProxy: MESSAGE_CHECK identifiers sent over IPC https://bugs.webkit.org/show_bug.cgi?id=206814 Reviewed by David Kilzer. MESSAGE_CHECK identifiers sent over IPC in NetworkProcessProxy class. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::didFetchWebsiteData): (WebKit::NetworkProcessProxy::didDeleteWebsiteData): (WebKit::NetworkProcessProxy::didDeleteWebsiteDataForOrigins): 2020-01-26 Fujii Hironori [WinCairo][curl] ASSERTION FAILED: sessionID != PAL::SessionID::defaultSessionID() in NetworkProcess since r255067 https://bugs.webkit.org/show_bug.cgi?id=206817 Reviewed by Darin Adler. Since r255067 (Bug 206700), the assertion is failing in NetworkProcess::destroySession while shutdown, which is ensuring the destructing session isn't the default session. Covered by existing tests. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::destroySession): Conditioned out the assertion for curl port as well as Soup port does. 2020-01-26 Chris Dumez Frequent sync BackForwardBackListCount/BackForwardForwardListCount IPC on reddit.com https://bugs.webkit.org/show_bug.cgi?id=206438 Reviewed by Darin Adler. Frequent sync BackForwardBackListCount/BackForwardForwardListCount IPC on reddit.com. When scrolling on reddit.com, you frequently see 2 consecutive sync IPCs (WebPageProxy::BackForwardBackListCount then WebPageProxy::BackForwardForwardListCount) from the WebContent process to the UIProcess. Those are bad for performance. This happens every time the script on the page accesses history.length, which is unfortunate, since this history length rarely changes. To address the issue, the following changes were made: 1. Merge BackForwardBackListCount / BackForwardForwardListCount IPCs into a single BackForwardListCounts IPC which returns both the back & forward counts, since we often need both (e.g. when accessing history.length) and since gettings those counts is very cheap compared to the cost of a sync IPC. 2. Cache those counts in WebBackForwardListProxy and blow away the cached counts whenever the back/forward list changes. In the common case (where the back/forward list rarely changes), we now see a single sync IPC instead of many (verified on reddit.com). No new tests, merely a performance improvement. * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::addItemFromUIProcess): (WebKit::WebBackForwardListProxy::addItem): (WebKit::WebBackForwardListProxy::goToItem): (WebKit::WebBackForwardListProxy::backListCount const): (WebKit::WebBackForwardListProxy::forwardListCount const): (WebKit::WebBackForwardListProxy::cacheListCountsIfNecessary const): (WebKit::WebBackForwardListProxy::clearCachedListCounts): (WebKit::WebBackForwardListProxy::close): (WebKit::WebBackForwardListProxy::clear): * WebProcess/WebPage/WebBackForwardListProxy.h: 2020-01-26 youenn fablet Use ObjectIdentifier for remote RealtimeMediaSource https://bugs.webkit.org/show_bug.cgi?id=206808 Reviewed by Eric Carlson. Use ObjectIdentifier instead of uint64_t. This is clearer and prevents receiving identifier of value zero from IPC. Remove related message checks. * Scripts/webkit/messages.py: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::SourceProxy::SourceProxy): (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): (WebKit::UserMediaCaptureManagerProxy::startProducingData): (WebKit::UserMediaCaptureManagerProxy::stopProducingData): (WebKit::UserMediaCaptureManagerProxy::end): (WebKit::UserMediaCaptureManagerProxy::capabilities): (WebKit::UserMediaCaptureManagerProxy::setMuted): (WebKit::UserMediaCaptureManagerProxy::applyConstraints): (WebKit::UserMediaCaptureManagerProxy::clone): (WebKit::UserMediaCaptureManagerProxy::requestToEnd): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::Source): (WebKit::UserMediaCaptureManager::Source::sourceID const): (WebKit::UserMediaCaptureManager::createCaptureSource): (WebKit::UserMediaCaptureManager::sourceStopped): (WebKit::UserMediaCaptureManager::captureFailed): (WebKit::UserMediaCaptureManager::sourceMutedChanged): (WebKit::UserMediaCaptureManager::sourceSettingsChanged): (WebKit::UserMediaCaptureManager::storageChanged): (WebKit::UserMediaCaptureManager::ringBufferFrameBoundsChanged): (WebKit::UserMediaCaptureManager::audioSamplesAvailable): (WebKit::UserMediaCaptureManager::remoteVideoSampleAvailable): (WebKit::UserMediaCaptureManager::sourceEnded): (WebKit::UserMediaCaptureManager::applyConstraintsSucceeded): (WebKit::UserMediaCaptureManager::applyConstraintsFailed): (WebKit::UserMediaCaptureManager::cloneVideoSource): * WebProcess/cocoa/UserMediaCaptureManager.h: * WebProcess/cocoa/UserMediaCaptureManager.messages.in: 2020-01-26 Darin Adler Protect against crashes during WKWebView init function when methods are called before the view is fully initialized https://bugs.webkit.org/show_bug.cgi?id=206799 rdar://problem/58871371 Reviewed by Sam Weinig. Part way through creating WKWebView, some methods can be called and they need to be careful not to use anything that may not be initialized yet. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView dealloc]): Check _page for null, since this might happen if the superclass's init method returned nil. * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _frameOrBoundsChanged]): Check _page for null, since this might be called before object initialization is complete. (-[WKWebView setSemanticContentAttribute:]): Ditto. * UIProcess/API/mac/WKWebViewMac.mm: (-[WKWebView setFrameSize:]): Check _impl for null since this might be called before oject initialization is complete. (-[WKWebView setUserInterfaceLayoutDirection:]): Ditto. (-[WKWebView renewGState]): Ditto. 2020-01-26 Said Abou-Hallawa Throttling requestAnimationFrame should be controlled by RenderingUpdateScheduler https://bugs.webkit.org/show_bug.cgi?id=204713 Reviewed by Simon Fraser. Create an IPC message on the DrawingArea to send a message from the WebProcess to the UIProcess to setPreferredFramesPerSecond of the DisplayRefreshMonitor. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetRenderingUpdateThrottlingEnabled): (WKPreferencesGetRenderingUpdateThrottlingEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: Add a WKPreference key for RenderingUpdateThrottlingEnabled. * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: (-[WKOneShotDisplayLinkHandler setPreferredFramesPerSecond:]): (WebKit::RemoteLayerTreeDrawingAreaProxy::setPreferredFramesPerSecond): Set the preferredFramesPerSecond of the CADisplayLink. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm: (WebKit::RemoteLayerTreeDisplayRefreshMonitor::setPreferredFramesPerSecond): Delegate the call to RemoteLayerTreeDrawingArea. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::setPreferredFramesPerSecond): Send the IPC message from the WebProcess to the UIProcess. 2020-01-25 Brady Eidson Make ContentWorlds be identified by an ObjectIdentifier instead of a uint64_t https://bugs.webkit.org/show_bug.cgi?id=206784 Reviewed by Alex Christensen. Refactor: No behavior change. * Scripts/webkit/messages.py: * Shared/AuxiliaryProcess.cpp: (WebKit::AuxiliaryProcess::initialize): * Shared/ContentWorldShared.h: (WebKit::pageContentWorldIdentifier): * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * Shared/WebUserContentControllerDataTypes.cpp: (WebKit::WebUserScriptData::decode): (WebKit::WebUserStyleSheetData::decode): (WebKit::WebScriptMessageHandlerData::decode): * Shared/WebUserContentControllerDataTypes.h: * UIProcess/API/APIContentWorld.cpp: (API::ContentWorld::pageContentWorld): (API::ContentWorld::defaultClientWorld): (API::ContentWorld::ContentWorld): (API::ContentWorldBase::generateIdentifier): Deleted. * UIProcess/API/APIContentWorld.h: (API::ContentWorldBase::identifier const): (API::ContentWorldBase::worldData const): (API::ContentWorldBase::ContentWorldBase): * UIProcess/API/APIUserContentWorld.cpp: (API::UserContentWorld::UserContentWorld): * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses): (WebKit::WebUserContentControllerProxy::removeAllUserScripts): (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets): * WebProcess/UserContent/WebUserContentController.cpp: (WebKit::worldMap): (WebKit::WebUserContentController::worldForIdentifier): (WebKit::WebUserContentController::addUserContentWorld): (WebKit::WebUserContentController::addUserContentWorlds): (WebKit::WebUserContentController::removeUserContentWorlds): (WebKit::WebUserContentController::addUserScripts): (WebKit::WebUserContentController::removeUserScript): (WebKit::WebUserContentController::removeAllUserScripts): (WebKit::WebUserContentController::addUserStyleSheets): (WebKit::WebUserContentController::removeUserStyleSheet): (WebKit::WebUserContentController::removeAllUserStyleSheets): (WebKit::WebUserContentController::addUserScriptMessageHandlers): (WebKit::WebUserContentController::removeUserScriptMessageHandler): (WebKit::WebUserContentController::removeAllUserScriptMessageHandlers): * WebProcess/UserContent/WebUserContentController.h: * WebProcess/UserContent/WebUserContentController.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::runJavaScript): (WebKit::WebPage::runJavaScriptInMainFrameScriptWorld): (WebKit::WebPage::runJavaScriptInFrame): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2020-01-25 Per Arne Vollan [Cocoa] Media mime types map should be created in the UI process https://bugs.webkit.org/show_bug.cgi?id=206478 Reviewed by Darin Adler. Send the mime type map from the UI process to the WebContent process as part of the WebProcess creation parameters. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2020-01-25 Antti Koivisto [LFC][Integration] Re-enable line layout integration https://bugs.webkit.org/show_bug.cgi?id=206795 Reviewed by Zalan Bujtas. * Shared/WebPreferences.yaml: 2020-01-24 Tim Horton macCatalyst: Don't get any custom cursors in subframes https://bugs.webkit.org/show_bug.cgi?id=206781 Reviewed by Simon Fraser. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::positionInformation): Adjust the hit test to allow child frame content, and reorganize the rest of the code to use the hit frame instead of the main frame. 2020-01-24 Jiewen Tan Unreviewed, a speculative test fix after r255041 * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm: (WebKit::MockLocalConnection::getAttestation const): 2020-01-24 Wenson Hsieh [iOS] Long pressing text inside a selection should update the selection https://bugs.webkit.org/show_bug.cgi?id=206769 Reviewed by Tim Horton. Makes it possible to update the selection using text interaction gestures inside an existing text selection. To do this, we remove code that was previously required in order to disambiguate text selection and drag gestures. However, since adopting asynchronous drag interaction SPI, this check has not been necessary. The only other purpose of this check was to avoid triggering text selection gestures after canceling a drag that did not begin (i.e. the touch location did not move). Instead of bailing in -textInteractionGestures: shouldBeginAtPoint: and -hasSelectablePositionAtPoint:, we can achieve the same effect by simply resetting the text interaction gestures when the drag lift begins (at which point we know the drag interaction is starting). This also ensures that on iPad, in the case where the drag was cancelled by the page, long pressing may still trigger text selection. Test: editing/selection/ios/select-text-in-existing-selection.html * Shared/ios/InteractionInformationAtPosition.h: * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): (WebKit::InteractionInformationAtPosition::decode): Remove the hasSelectionAtPosition flag from position information, since we no longer need it. * UIProcess/ios/WKContentViewInteraction.mm: (-[UIGestureRecognizer _wk_cancel]): Drive-by fix: just ignore the gesture if it is already disabled. This prevents us from causing a gesture recognizer that was previously disabled to become enabled as a result of calling -_wk_cancel. (-[WKContentView hasSelectablePositionAtPoint:]): (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): (-[WKContentView cancelActiveTextInteractionGestures]): Instead of making the text interaction gestures return NO from -gestureRecognizerShouldBegin:, explicitly cancel the text interaction gestures that may select text. (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::positionInformation): Remove the hasSelectionAtPosition flag from position information, since we no longer need it. 2020-01-24 Alex Christensen Update EditorState from WebProcess when requesting context menu https://bugs.webkit.org/show_bug.cgi?id=206775 Reviewed by Wenson Hsieh. When generating a context menu, AppKit calls -validRequestorForSendType:returnType: which queries the editor state in WebViewImpl::validRequestorForSendAndReturnTypes. Without updating the editor state, the first time you right click on a link, the Services menu item did not appear because we were looking at a stale editor state. Verified manually this fixes the bug. * WebProcess/WebPage/WebContextMenu.cpp: (WebKit::WebContextMenu::show): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::handleSelectionServiceClick): 2020-01-24 Tim Horton macCatalyst: Right clicking on links follows the link, but shouldn't https://bugs.webkit.org/show_bug.cgi?id=206777 Reviewed by Wenson Hsieh. * UIProcess/ios/WKMouseGestureRecognizer.mm: (-[WKMouseGestureRecognizer createMouseEventWithType:forEvent:]): (-[WKMouseGestureRecognizer touchesEnded:withEvent:]): I got 'button' and 'buttons' backwards. 'button' indicates which button the event is about, so in MouseUp, it should still be 2. 'buttons' indicate which buttons are still down, so in MouseUp, it should not include 2. Since we don't currently track mouse button chording here, we'll just say "none". Leave a FIXME about that. This makes WebCore's behavior correct, and now it doesn't follow the link. 2020-01-24 Jiewen Tan Unreviewed, a build fix after r255056 * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm: (WebKit::MockLocalConnection::getAttestation const): 2020-01-24 Per Arne Vollan Unreviewed, rolling out r255050. Introduced crashes on bots Reverted changeset: "[Cocoa] Media mime types map should be created in the UI process" https://bugs.webkit.org/show_bug.cgi?id=206478 https://trac.webkit.org/changeset/255050 2020-01-24 Brent Fulgham [iOS] Add missing sysctl-read permission (already available in macOS sandbox) https://bugs.webkit.org/show_bug.cgi?id=206713 Reviewed by Per Arne Vollan. Correct a sandbox violation encountered when attempting to log the system hostname. This was already handled properly on macOS, but the rule was not added to the iOS sandbox. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2020-01-24 Adrian Perez de Castro Fix various non-unified build issues introduced since r254751 https://bugs.webkit.org/show_bug.cgi?id=206736 Reviewed by Carlos Garcia Campos. * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp: Add missing WebFrame.h inclusion. 2020-01-24 Don Olmstead Centralize AuxiliaryProcessMainBase implementations https://bugs.webkit.org/show_bug.cgi?id=206700 Reviewed by Carlos Garcia Campos. Non-Cocoa ports share a common usage of AuxiliaryProcessMainBase but the implementations don't share a lot of code. This patch centralizes the code and the naming used. * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp: (main): * NetworkProcess/EntryPoint/win/NetworkProcessMain.cpp: (main): * NetworkProcess/NetworkProcessMain.h: Renamed from Source/WebKit/NetworkProcess/win/NetworkProcessMainWin.h. * NetworkProcess/curl/NetworkProcessMainCurl.cpp: Renamed from Source/WebKit/NetworkProcess/win/NetworkProcessMainWin.cpp. (WebKit::initializeAuxiliaryProcess): (WebKit::NetworkProcessMain): * NetworkProcess/soup/NetworkProcessMainSoup.cpp: (WebKit::NetworkProcessMain): (WebKit::NetworkProcessMainUnix): Deleted. * NetworkProcess/unix/NetworkProcessMainUnix.h: Removed. * PlatformFTW.cmake: * PlatformGTK.cmake: * PlatformWPE.cmake: * PlatformWin.cmake: * PluginProcess/EntryPoint/unix/PluginProcessMain.cpp: (main): * PluginProcess/PluginProcessMain.h: Renamed from Source/WebKit/PluginProcess/unix/PluginProcessMainUnix.h. * PluginProcess/unix/PluginProcessMainUnix.cpp: (WebKit::PluginProcessMain): (WebKit::PluginProcessMainUnix): Deleted. * Shared/AuxiliaryProcessMain.h: Renamed from Source/WebKit/Shared/unix/AuxiliaryProcessMain.h. * WebProcess/EntryPoint/unix/WebProcessMain.cpp: (main): * WebProcess/EntryPoint/win/WebProcessMain.cpp: (main): * WebProcess/WebProcessMain.h: Renamed from Source/WebKit/WebProcess/win/WebProcessMainWin.h. * WebProcess/gtk/WebProcessMainGtk.cpp: (WebKit::WebProcessMain): (WebKit::WebProcessMainUnix): Deleted. * WebProcess/playstation/WebProcessMainPlayStation.cpp: Renamed from Source/WebKit/WebProcess/unix/WebProcessMainUnix.h. (WebKit::WebProcessMain): * WebProcess/win/WebProcessMainWin.cpp: (WebKit::WebProcessMain): (WebKit::WebProcessMainWin): Deleted. * WebProcess/wpe/WebProcessMainWPE.cpp: (WebKit::WebProcessMain): (WebKit::WebProcessMainUnix): Deleted. * webkitglib-symbols.map: 2020-01-24 Carlos Garcia Campos [GTK] Reduce the maximum time we wait for draw events in DrawingMonitor https://bugs.webkit.org/show_bug.cgi?id=206662 Reviewed by Carlos Alberto Lopez Perez. 1 second is too much, we can wait up to 100_ms instead and wait for the next frame after 16_ms. We should also ensure there's a draw event since this is called from dispatchAfterEnsuringDrawing(). * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp: (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::start): (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::didDraw): 2020-01-24 youenn fablet Make sure fetch tasks go to network if service worker never gets to activated https://bugs.webkit.org/show_bug.cgi?id=206648 Reviewed by Chris Dumez. In case activating completion handlers are not called, the fetch task timeout should kick in and make the load go to network process. The issue is that our code was using the context connection to do so. If the fetch task is waiting for the worker activation, the context connection might not be set and the timeout will be a no-op. To fix this, the fetch task will do as if its context is closed when the timeout fires. The fetck task now has a weak pointer to the WebSWServerConnection and will use to terminate the service worker as done previously. We no longer handle all ongoing fetch tasks of the ongoing service worker. Each individual fetch task timeout provides the same level of protection. The service worker will anyway get terminated which will race to finalize the service worker fetch tasks with each of their timeout. * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask): (WebKit::ServiceWorkerFetchTask::timeoutTimerFired): * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::createFetchTask): (WebKit::WebSWServerConnection::fetchTaskTimedOut): * NetworkProcess/ServiceWorker/WebSWServerConnection.h: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::fetchTaskTimedOut): 2020-01-23 Jiewen Tan Unreviewed, a follow up on r254894 * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm: (WebKit::MockLocalConnection::getAttestation const): Includes the status code in the message. 2020-01-23 Wenson Hsieh [iOS] Support setting minimum effective device width during dynamic viewport size updates https://bugs.webkit.org/show_bug.cgi?id=206709 Reviewed by Tim Horton. Changes to minimum effective device width are currently always propagated to the web process via out-of-band updates to the web process. During animated resize, Safari currently changes the minimum effective device width prior to updating the view size; this causes the viewport configuration to temporarily be in a state where the new value for minimum effective device width is used, but the old viewport width and height are still used. This subsequently breaks existing logic in WebPage::dynamicViewportSizeUpdate that attempts to keep the portion of the unobscured content width that is visible consistent before and after rotation (see visibleHorizontalFraction), since that code will be mislead into believing that the wrong fraction of content width is visible. To fix this, we roll minimum effective device width changes along with view size (and other attributes) in dynamic viewport size updates. Test: WebKit.ChangeFrameAndMinimumEffectiveDeviceWidthDuringAnimatedResize * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setViewScale:]): (-[WKWebView _setMinimumEffectiveDeviceWidth:]): During animated resize, just set m_minimumEffectiveDeviceWidth without notifying the web process; if the value changed during the update block, we send the new minimum effective device width to the web page as a part of the dynamic viewport size update. Also, make a drive-by adjustment to use `_page->viewLayoutSize()` instead of recomputing the active layout bounds when we know that only the minimum effective device width is changing. We also apply the same adjustment above, in -_setViewScale:. * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _beginAnimatedResizeWithUpdates:]): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::viewLayoutSize const): (WebKit::WebPageProxy::setMinimumEffectiveDeviceWidthWithoutViewportConfigurationUpdate): Add a helper method to update the minimum effective device width without updating the viewport configuration in the web process. This is only used when the minimum effective device width is specified in the middle of a dynamic viewport size update (i.e. animated resize). * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::dynamicViewportSizeUpdate): Plumb the new minimum effective device width over to the web process as a part of the dynamic viewport size update, and update both the new view size and minimum effective device width on the viewport configuration at the same time. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): 2020-01-23 Per Arne Vollan [Cocoa] Media mime types map should be created in the UI process https://bugs.webkit.org/show_bug.cgi?id=206478 Reviewed by Darin Adler. Send the mime type map from the UI process to the WebContent process as part of the WebProcess creation parameters. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2020-01-22 Darin Adler Remove some unneeded definitions from Platform.h family headers https://bugs.webkit.org/show_bug.cgi?id=206642 Reviewed by Eric Carlson. * Platform/cocoa/PaymentAuthorizationViewController.mm: (-[WKPaymentAuthorizationViewControllerDelegate _getPaymentServicesMerchantURL:]): Removed HAVE(PASSKIT_API_TYPE) because it's always 1 on Cocoa platforms and this is Cocoa-only code. * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toAPIType): Ditto. (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Ditto. 2020-01-23 Tim Horton macCatalyst: I-Beam is too conservative, doesn't show up in editable areas with no text https://bugs.webkit.org/show_bug.cgi?id=206716 Reviewed by Simon Fraser. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::lineCaretExtent): (WebKit::populateCaretContext): (WebKit::WebPage::positionInformation): Instead of uniting the caret position for the first and last position on the line to find the I-Beam region, use the bounds of the selection rect for the line, which extends beyond existing text, matching our traditional behavior of showing the I-Beam over blank regions. 2020-01-23 Tomoki Imai Set proper TextureMapperLayer::m_contentsLayer in updateImageBacking https://bugs.webkit.org/show_bug.cgi?id=206212 Reviewed by Žan Doberšek. There is a chance to set a wrong TextureMapperLayer::m_contentsLayer. It occurs when - The previous content layer is removed, and it doesn't have the next content layer. (layerState.contentLayer == nullptr) - It has an image backing, which is not visible. (layerState.imageBacking != nullptr, entry.update.isVisible == false) In that case, it didn't call TextureMapperLayer::setContentsLayer(nullptr) even if it doesn't have a new content layer. This patch set TextureMapperLayer::m_contentsLayer in updateImageBacking regardless of the visibility. setBackingStore is not needed in updateImageBacking, as it should be handle only by layerState.backingStore. Should be covered by the existing testcases. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::updateImageBacking): Call TextureMapperLayer::setContentsLayer(nullptr) instead of TextureMapperLayer::setBackingStore(nullptr) when it's not visible. 2020-01-23 Daniel Bates Add a variant of -selectPositionAtPoint that can select an arbitrary point https://bugs.webkit.org/show_bug.cgi?id=206712 Reviewed by Wenson Hsieh. Adds a variant of -selectPositionAtPoint, called _selectPositionAtPoint, that takes a boolean as to whether to constrain the specified point to stay within the focused element. I will make use of this functionality in a subsequent patch. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView selectPositionAtPoint:completionHandler:]): Moved implementation to -_selectPositionAtPoint and write this function in terms of it. (-[WKContentView _selectPositionAtPoint:stayingWithinFocusedElement:completionHandler:]): Added. 2020-01-23 Kate Cheney Background thread with ITP Database should lock when the network process is suspended https://bugs.webkit.org/show_bug.cgi?id=206593 rdar://problem/58713379 Reviewed by Chris Dumez. This patch adds a function to hang the background queue when the NetworkProcess is preparing to suspend. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::suspend): (WebKit::WebResourceLoadStatisticsStore::resume): * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::prepareToSuspend): (WebKit::NetworkProcess::resume): 2020-01-23 Per Arne Vollan [iOS] Make it possible for WebKit clients to enable connections to asset services in the WebContent process https://bugs.webkit.org/show_bug.cgi?id=206551 Reviewed by Brent Fulgham. Add SPI to grant and revoke access to asset services in the WebContent process. No new tests, since this should have an API test, but API tests are not running on iOS devices. We could create an API test for simulator, but the simulator has no sandbox. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _grantAccessToAssetServices]): (-[WKWebView _revokeAccessToAssetServices]): * UIProcess/WebPageProxy.h: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::grantAccessToAssetServices): (WebKit::WebPageProxy::revokeAccessToAssetServices): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::grantAccessToAssetServices): (WebKit::WebProcess::revokeAccessToAssetServices): 2020-01-23 Brent Fulgham [iOS] Remove access to 'awd' directories https://bugs.webkit.org/show_bug.cgi?id=206098 Reviewed by Per Arne Vollan. Now that we have removed 'awd' features from the WebContent process, and have blocked access to the mach service, we should remove the ability to interact with the 'awd' directories on device. No new tests. No change in behavior. * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2020-01-23 Per Arne Vollan [Cocoa] Broker access to the PowerManagement API https://bugs.webkit.org/show_bug.cgi?id=206373 Reviewed by Darin Adler. Send flag indicating whether device has battery to the WebContent process as part of the WebProcess creation parameters. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2020-01-23 Ryan Haddad Unreviewed, rolling out r254990. Breaks watchOS / tvOS builds. Reverted changeset: "[iOS] Make it possible for WebKit clients to enable connections to asset services in the WebContent process" https://bugs.webkit.org/show_bug.cgi?id=206551 https://trac.webkit.org/changeset/254990 2020-01-23 Brent Fulgham [iOS] Unreviewed follow-up sandbox fix. https://bugs.webkit.org/show_bug.cgi?id=206562 I missed a couple of rules that are being overly chatty in the logs in r254982. This adds appropriate commands to silence them. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2020-01-23 Per Arne Vollan [iOS] Make it possible for WebKit clients to enable connections to asset services in the WebContent process https://bugs.webkit.org/show_bug.cgi?id=206551 Reviewed by Brent Fulgham. Add SPI to grant and revoke access to asset services in the WebContent process. No new tests, since this should have an API test, but API tests are not running on iOS devices. We could create an API test for simulator, but the simulator has no sandbox. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _grantAccessToAssetServices]): (-[WKWebView _revokeAccessToAssetServices]): * UIProcess/WebPageProxy.h: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::grantAccessToAssetServices): (WebKit::WebPageProxy::revokeAccessToAssetServices): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::grantAccessToAssetServices): (WebKit::WebProcess::revokeAccessToAssetServices): 2020-01-23 Per Arne Vollan [iOS] Camera is lost during WebRTC demo https://bugs.webkit.org/show_bug.cgi?id=206613 Reviewed by Brent Fulgham. Fix observed sandbox violations in the Networking process. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: 2020-01-23 Brent Fulgham Stop capturing telemetry for well-understood sandbox rules (206562) https://bugs.webkit.org/show_bug.cgi?id=206562 Reviewed by Per Arne Vollan. Remove logging of sandbox rules that are now understood, and either confirmed to be needed for proper WebKit operation or identified for removal through a future update. No new tests. No change in behavior. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2020-01-23 Alexander Mikhaylenko [GTK] Navigation gesture creates CSS nodes and doesn't remove them https://bugs.webkit.org/show_bug.cgi?id=206591 Reviewed by Carlos Garcia Campos. Even though foreign drawing uses a temporary GtkStyleContext, calling gtk_style_context_set_parent() adds all its CSS nodes to the global hierarchy, and then they aren't cleaned up. This shouldn't happen. * UIProcess/gtk/ViewGestureControllerGtk.cpp: (WebKit::ViewGestureController::createStyleContext):Stop setting GtkStyleContext parent. 2020-01-22 Jon Lee [Media in GPU process] Pipe more MediaPlayerPrivate and client methods https://bugs.webkit.org/show_bug.cgi?id=206468 Reviewed by Eric Carlson. Pipe more of the media player and client functions. Generally, these are void functions that require no parameters. Also, the client *changed() functions, when implemented, tend to call the accessor of the property that just changed. This seems rather circuitous. The client methods ought to just also pass along the value of the new changed value. This patch refactors mediaPlayerCurrentPlaybackTargetIsWirelessChanged to do exactly that. * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::mediaPlayerResourceNotSupported): (WebKit::RemoteMediaPlayerProxy::mediaPlayerEngineUpdated): (WebKit::RemoteMediaPlayerProxy::mediaPlayerActiveSourceBuffersChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerWaitingForKeyChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): (WebKit::RemoteMediaPlayerProxy::setWirelessVideoPlaybackDisabled): (WebKit::RemoteMediaPlayerProxy::setShouldPlayToPlaybackTarget): (WebKit::RemoteMediaPlayerProxy::keyAdded): (WebKit::RemoteMediaPlayerProxy::beginSimulatedHDCPError): (WebKit::RemoteMediaPlayerProxy::endSimulatedHDCPError): (WebKit::RemoteMediaPlayerProxy::notifyActiveSourceBuffersChanged): (WebKit::RemoteMediaPlayerProxy::applicationWillResignActive): (WebKit::RemoteMediaPlayerProxy::applicationDidBecomeActive): * GPUProcess/media/RemoteMediaPlayerProxy.h: * GPUProcess/media/RemoteMediaPlayerProxy.messages.in: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::setWirelessVideoPlaybackDisabled): (WebKit::MediaPlayerPrivateRemote::currentPlaybackTargetIsWirelessChanged): Cache value in new member variable. (WebKit::MediaPlayerPrivateRemote::isCurrentPlaybackTargetWireless const): Return value. (WebKit::MediaPlayerPrivateRemote::setShouldPlayToPlaybackTarget): (WebKit::MediaPlayerPrivateRemote::keyAdded): (WebKit::MediaPlayerPrivateRemote::waitingForKeyChanged): (WebKit::MediaPlayerPrivateRemote::beginSimulatedHDCPError): (WebKit::MediaPlayerPrivateRemote::endSimulatedHDCPError): (WebKit::MediaPlayerPrivateRemote::notifyActiveSourceBuffersChanged): (WebKit::MediaPlayerPrivateRemote::applicationWillResignActive): (WebKit::MediaPlayerPrivateRemote::applicationDidBecomeActive): (WebKit::MediaPlayerPrivateRemote::resourceNotSupported): (WebKit::MediaPlayerPrivateRemote::engineUpdated): (WebKit::MediaPlayerPrivateRemote::activeSourceBuffersChanged): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in: 2020-01-22 Keith Rollin Fix SDK availability macros https://bugs.webkit.org/show_bug.cgi?id=206463 Reviewed by Timothy Hatcher. Bug 197841 updated WebKit.xcconfig with regards to when it runs a header post-processing script. This post-processing script grovels over our exported headers, changing macros like WK_API_AVAILABLE to the standard API_AVAILABLE. Because of the change in Bug 197841, the script was no longer being run when preparing macOS 10.15 SDKs, which was breaking those SDKs. Fix this by reverting the change, allowing the macros to be replaced for macOS 10.15. We also need to touch WKFoundation.h in order to support incremental builds. If we don't, then the version of WKFoundation.h that was exported in the previous build and that was incorrectly post-processed would remain incorrectly post-processed. Touch the file so that it will get re-exported and re-post-processed. No new tests - no added or changed functionality. * Configurations/WebKit.xcconfig: * Shared/API/Cocoa/WKFoundation.h: 2020-01-22 Chris Dumez Frequent NetworkConnectionToWebProcess::CookiesEnabled sync IPC when browsing reddit.com https://bugs.webkit.org/show_bug.cgi?id=206450 Reviewed by Darin Adler. Frequent NetworkConnectionToWebProcess::CookiesEnabled sync IPC when browsing reddit.com. This happens every time the page script calls navigator.cookieEnabled. To address the issue, we now store the "cookie accept policy" on the WebContent process side. This allows us to know synchronously on the WebContent process if cookies are enabled or not and without any IPC to the network process. To achieve this, I added a new cookieAcceptPolicy member to NetworkProcessConnectionInfo so that the WebContent process is aware of the initial policy when it connects to the network process. The policy on the WebContent process side is then kept up to date via IPCs from the network process to the WebContent processes whenever the cookie accept policy changes. * NetworkProcess/Cookies/WebCookieManager.cpp: (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy): (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy): * NetworkProcess/Cookies/WebCookieManager.h: * NetworkProcess/Cookies/WebCookieManager.messages.in: * NetworkProcess/Cookies/curl/WebCookieManagerCurl.cpp: * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm: * NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::cookieAcceptPolicyChanged): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::createNetworkConnectionToWebProcess): (WebKit::NetworkProcess::cookieAcceptPolicyChanged): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkProcessCreationParameters.h: * Shared/WebProcessCreationParameters.h: * UIProcess/API/APIHTTPCookieStore.cpp: (API::HTTPCookieStore::setHTTPCookieAcceptPolicy): (API::HTTPCookieStore::setHTTPCookieAcceptPolicyInDefaultUIProcessCookieStore): * UIProcess/API/APIHTTPCookieStore.h: * UIProcess/API/C/WKAPICast.h: (WebKit::toHTTPCookieAcceptPolicy): (WebKit::toAPI): * UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm: (API::toNSHTTPCookieAcceptPolicy): (API::HTTPCookieStore::setHTTPCookieAcceptPolicyInDefaultUIProcessCookieStore): * UIProcess/API/Cocoa/WKHTTPCookieStore.mm: * UIProcess/API/Cocoa/WKProcessPool.mm: (toHTTPCookieAcceptPolicy): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::openNetworkProcessConnection): * UIProcess/WebCookieManagerProxy.h: * UIProcess/WebProcessPool.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::NetworkProcessConnection): (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles): (WebKit::NetworkProcessConnection::cookiesEnabled): (WebKit::NetworkProcessConnection::cookieAcceptPolicyChanged): * WebProcess/Network/NetworkProcessConnection.h: (WebKit::NetworkProcessConnection::create): * WebProcess/Network/NetworkProcessConnection.messages.in: * WebProcess/Network/NetworkProcessConnectionInfo.h: (WebKit::NetworkProcessConnectionInfo::encode const): (WebKit::NetworkProcessConnectionInfo::decode): * WebProcess/WebPage/WebCookieJar.cpp: (WebKit::WebCookieJar::cookiesEnabled const): - Return false early if the document has no frame / page (cookie-averse as per spec) - Return false early if ITP is enabled and it is a third-party iframe without storage access. This bypasses the sync IPC call completely for such iframes. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::ensureNetworkProcessConnection): 2020-01-22 Chris Dumez [IPC Hardening] Only process Messages::NetworkProcess messages when sent by the UIProcess https://bugs.webkit.org/show_bug.cgi?id=206558 Unreviewed post-landing review comments from Darin Adler after r254892. * Platform/IPC/StringReference.h: (IPC::operator==): (IPC::operator!=): (IPC::StringReference::Hash::equal): (IPC::StringReference::operator==): Deleted. (IPC::StringReference::operator!=): Deleted. 2020-01-22 Antti Koivisto [LFC][Integration] Disable integration to see performance impact https://bugs.webkit.org/show_bug.cgi?id=206576 Reviewed by Zalan Bujtas. * Shared/WebPreferences.yaml: 2020-01-22 youenn fablet Add logging of the source of a response used to respond a fetch event https://bugs.webkit.org/show_bug.cgi?id=206426 Reviewed by Darin Adler. * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::didReceiveResponse): Log the source of the response. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::havePerformedSecurityChecks const): Add case of DOMCache, similar to ServiceWorker. 2020-01-21 Fujii Hironori [Win][WK2] Pressing space key on text input form scrolls the page https://bugs.webkit.org/show_bug.cgi?id=201632 Reviewed by Ross Kirsling. r223262 was add WebPage::performDefaultBehaviorForKeyEvent for Windows port by copying GTK port's implementation. But, Windows port is using unique key event processing. It dispatches WebEvent::RawKeyDown and WebEvent::Char separately even though other ports dispatch only WebEvent::KeyDown by unifying them. Because WebPage::performDefaultBehaviorForKeyEvent handled WebEvent::RawKeyDown of space key to scroll page, and consumed the event, the keypress event of space key wasn't dispatched. The keypress event of a space key is handled in EventHandler::defaultSpaceEventHandler. performDefaultBehaviorForKeyEvent don't need to do it. Tests: Coverted by fast/events/space-scroll-event.html * WebProcess/WebPage/win/WebPageWin.cpp: (WebKit::WebPage::performDefaultBehaviorForKeyEvent): Don't handle VK_SPACE. 2020-01-21 Jiewen Tan [WebAuthn] Incorporate more detailed UnknownError messages for LocalAuthenticator https://bugs.webkit.org/show_bug.cgi?id=191530 Reviewed by Brent Fulgham. This patch replaces UnknownError messages within LocalAuthenticator with the LOG_ERROR messages. At the meantime, it enhances MockLocalConnection::getAttestation to return errors instead of assertions. * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: (WebKit::LocalAuthenticator::makeCredential): (WebKit::LocalAuthenticator::continueMakeCredentialAfterUserConsented): (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested): (WebKit::LocalAuthenticator::getAssertion): (WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented): * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm: (WebKit::MockLocalConnection::getAttestation const): 2020-01-21 Chris Dumez [IPC Hardening] Only process Messages::NetworkProcess messages when sent by the UIProcess https://bugs.webkit.org/show_bug.cgi?id=206558 Reviewed by Alex Christensen. Port UpdateQuotaBasedOnSpaceUsageForTesting IPC from the NetworkProcess to the NetworkConnectionToWebProcess since it is sent by the WebContent process. As a result, we can now stop forwarding all Messages::NetworkProcess IPC messages from the WebContent process to the NetworkProcess class. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didReceiveMessage): (WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage): (WebKit::NetworkConnectionToWebProcess::updateQuotaBasedOnSpaceUsageForTesting): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::didReceiveMessage): (WebKit::NetworkProcess::didReceiveSyncMessage): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Platform/IPC/StringReference.h: (IPC::StringReference::operator!=): * WebProcess/Cache/WebCacheStorageConnection.cpp: (WebKit::WebCacheStorageConnection::updateQuotaBasedOnSpaceUsage): 2020-01-22 Simon Fraser Fixed elements no longer stay fixed with elastic overscroll https://bugs.webkit.org/show_bug.cgi?id=206227 rdar://problem/58707084 Reviewed by Antti Koivisto. Intended behavior on iOS and macOS is for position:fixed and sticky elements to maintain their position relative to the view bounds when rubber-banding ("overscrolling"). This broke some time back. This change restores the correct behavior with the call to layoutViewportRespectingRubberBanding() in ScrollingTreeFixedNode::applyLayerPositions() and ScrollingTreeStickyNode::computeLayerPosition(). layoutViewportRespectingRubberBanding() computes a layout viewport without clamping. The rest of the changes are to support testing. internals.unconstrainedScrollTo() didn't work for main frame scrolling because of scroll position clamping in various places, so propagate ScrollClamping in more places (and replace the redundant ScrollPositionClamp with ScrollClamping). "requested scroll position" updates now carry along both clamping and "is programmatic" data, wrapped in a struct which is passed around the scrolling tree. This allows us to not clamp the scroll position (for testing) in more places. * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder::encode): (ArgumentCoder::decode): (ArgumentCoder::encode): (ArgumentCoder::decode): (WebKit::dump): * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeRequestsScroll): * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::scrollingTreeNodeRequestsScroll): * UIProcess/RemoteLayerTree/RemoteScrollingTree.h: * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm: (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren): * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren): 2020-01-21 Daniel Bates Add Legacy WebKit SPI and WebKit IPI to show and hide placeholder https://bugs.webkit.org/show_bug.cgi?id=206459 Reviewed by Wenson Hsieh. Add Modern WebKit IPI to control whether the placeholder can be shown or not when a form control is empty. This is for aesthetics. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setCanShowPlaceholder): Added. * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setCanShowPlaceholder): Added. Maps the input text to its element. If it's a HTML text form control element then calls through to HTMLTextFormControlElement::setCanShowPlaceholder(). * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Added new message. 2020-01-21 Jiewen Tan ProvisionalPageProxy::loadData should pass last navigation's shouldOpenExternalURLsPolicy flag to WebPageProxy https://bugs.webkit.org/show_bug.cgi?id=206462 Reviewed by Chris Dumez. Covered by API tests. This patch also does it for ProvisionalPageProxy::loadRequest. * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::loadData): (WebKit::ProvisionalPageProxy::loadRequest): * UIProcess/ProvisionalPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::continueNavigationInNewProcess): 2020-01-21 Rob Buis Add build flag for stale-while-revalidate https://bugs.webkit.org/show_bug.cgi?id=204169 Reviewed by Youenn Fablet. * Configurations/FeatureDefines.xcconfig: * NetworkProcess/cache/AsyncRevalidation.cpp: * NetworkProcess/cache/AsyncRevalidation.h: * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::responseNeedsRevalidation): (WebKit::NetworkCache::makeStoreDecision): (WebKit::NetworkCache::Cache::retrieve): * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: 2020-01-21 David Kilzer IPC::Decoder should use nullptr as invalid value Follow-up fix noticed by Chris Dumez. * Platform/IPC/Decoder.cpp: (IPC::alignedBufferIsLargeEnoughToContain): Fix typo in comment. 2020-01-21 Chris Dumez [macOS] Add managed preference to allow synchronous XHR during page dismissal https://bugs.webkit.org/show_bug.cgi?id=206540 Reviewed by Alex Christensen. Add managed preference to allow synchronous XHR during page dismissal. This is temporarily needed by some enterprise products until they can update their code. * Shared/WebPreferences.yaml: * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultDisallowSyncXHRDuringPageDismissalEnabled): * Shared/WebPreferencesDefaultValues.h: 2020-01-21 Ryan Haddad Unreviewed, rolling out r254876. Broke Catalina builds. Reverted changeset: "Fix SDK availability macros" https://bugs.webkit.org/show_bug.cgi?id=206463 https://trac.webkit.org/changeset/254876 2020-01-21 Jer Noble [iPad] YouTube does not automatically AirPlay when a route is selected from Control Center https://bugs.webkit.org/show_bug.cgi?id=206539 Reviewed by Eric Carlson. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::playbackTargetSelected const): 2020-01-21 Alex Christensen Add SPI on WKURLSchemeTask to access WKFrameInfo of originating frame https://bugs.webkit.org/show_bug.cgi?id=204265 Reviewed by Brady Eidson. Covered by API tests. * Shared/URLSchemeTaskParameters.cpp: (WebKit::URLSchemeTaskParameters::encode const): (WebKit::URLSchemeTaskParameters::decode): * Shared/URLSchemeTaskParameters.h: * UIProcess/API/Cocoa/WKURLSchemeTask.mm: (-[WKURLSchemeTaskImpl _frame]): * UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::startURLSchemeTaskShared): (WebKit::WebPageProxy::loadSynchronousURLSchemeTask): * UIProcess/WebURLSchemeHandler.cpp: (WebKit::WebURLSchemeHandler::startTask): * UIProcess/WebURLSchemeHandler.h: * UIProcess/WebURLSchemeTask.cpp: (WebKit::WebURLSchemeTask::create): (WebKit::WebURLSchemeTask::WebURLSchemeTask): * UIProcess/WebURLSchemeTask.h: (WebKit::WebURLSchemeTask::frameInfo const): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler): * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp: (WebKit::WebURLSchemeHandlerProxy::startNewTask): * WebProcess/WebPage/WebURLSchemeHandlerProxy.h: * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp: (WebKit::WebURLSchemeTaskProxy::WebURLSchemeTaskProxy): (WebKit::WebURLSchemeTaskProxy::startLoading): (WebKit::WebURLSchemeTaskProxy::stopLoading): (WebKit::WebURLSchemeTaskProxy::didComplete): (WebKit::WebURLSchemeTaskProxy::hasLoader): * WebProcess/WebPage/WebURLSchemeTaskProxy.h: (WebKit::WebURLSchemeTaskProxy::create): 2020-01-21 Keith Rollin Fix SDK availability macros https://bugs.webkit.org/show_bug.cgi?id=206463 Reviewed by Timothy Hatcher. Bug 197841 updated WebKit.xcconfig with regards to when it runs a header post-processing script. This post-processing script grovels over our exported headers, changing macros like WK_API_AVAILABLE to the standard API_AVAILABLE. Because of the change in Bug 197841, the script was no longer being run when preparing macOS 10.15 SDKs, which was breaking those SDKs. Fix this by reverting the change, allowing the macros to be replaced for macOS 10.15. No new tests - no added or changed functionality. * Configurations/WebKit.xcconfig: 2020-01-21 Tim Horton macCatalyst: Two-finger click is dispatched to DOM as left click https://bugs.webkit.org/show_bug.cgi?id=206549 Reviewed by Simon Fraser. * UIProcess/ios/WKMouseGestureRecognizer.mm: (-[WKMouseGestureRecognizer createMouseEventWithType:forEvent:]): (-[WKMouseGestureRecognizer touchesBegan:withEvent:]): (-[WKMouseGestureRecognizer touchesMoved:withEvent:]): (-[WKMouseGestureRecognizer touchesEnded:withEvent:]): (-[WKMouseGestureRecognizer _hoverEntered:withEvent:]): (-[WKMouseGestureRecognizer _hoverMoved:withEvent:]): (-[WKMouseGestureRecognizer _hoverExited:withEvent:]): (-[WKMouseGestureRecognizer createMouseEventWithType:]): Deleted. We correctly say button=2 for ctrl-click, but not for secondary-button click. 2020-01-21 Alex Christensen Revert suppressesConnectionTerminationOnSystemChange part of r254081 https://bugs.webkit.org/show_bug.cgi?id=205751 There was an API client that still hadn't migrated to the replacement SPI. * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const): * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration suppressesConnectionTerminationOnSystemChange]): (-[_WKProcessPoolConfiguration setSuppressesConnectionTerminationOnSystemChange:]): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): 2020-01-21 Brent Fulgham Performance tests fail if stderr logging is encountered https://bugs.webkit.org/show_bug.cgi?id=206544 Reviewed by Per Arne Vollan. Switch to LOG_ERROR, rather than WTFLogAlways, to avoid confusing the PerformanceTests system. * Shared/Cocoa/SandboxExtensionCocoa.mm: (WebKit::SandboxExtension::createHandleForReadByAuditToken): 2020-01-21 youenn fablet Provide camera/microphone sandbox extensions to GPUProcess https://bugs.webkit.org/show_bug.cgi?id=206531 Reviewed by Eric Carlson. Send at creation of GPUProcess sandbox extensions to camera and microphone. This is currently gated by the UIProcess application being Safari. This should be changed to checks based on camera/microphone entitlements. Extensions are provided at creation of the GPUProcess as it is as trusted as the UIProcess. We do not make it conditional to getUserMedia being enabled as GPUProcess may be created for more than one configuration. Relax the GPUProcess sandbox on MacOS to allow microphone access until we can use microphone sandbox extension for that purpose. Manually tested by capturing audio/video with real devices. * GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::initializeGPUProcess): * GPUProcess/GPUProcessCreationParameters.cpp: (WebKit::GPUProcessCreationParameters::encode const): (WebKit::GPUProcessCreationParameters::decode): * GPUProcess/GPUProcessCreationParameters.h: * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::isSafari): (WebKit::shouldCreateCameraSandboxExtension): (WebKit::shouldCreateMicrophoneSandboxExtension): (WebKit::GPUProcessProxy::singleton): 2020-01-21 Brady Eidson API::(User)ContentWorld cleanup https://bugs.webkit.org/show_bug.cgi?id=206509 Reviewed by Darin Adler. No behavior change. - Give (User)ContentWorld a shared base class for upcoming work. - Reference them by identifier instead of object instance whenever possible. - Other shared class cleanup. * UIProcess/API/APIContentWorld.cpp: (API::ContentWorldBase::generateIdentifier): (API::ContentWorld::ContentWorld): (API::ContentWorld::~ContentWorld): * UIProcess/API/APIContentWorld.h: (API::ContentWorldBase::identifier const): (API::ContentWorldBase::name const): (API::ContentWorldBase::worldData const): (API::ContentWorldBase::ContentWorldBase): * UIProcess/API/APIUserContentWorld.cpp: (API::UserContentWorld::UserContentWorld): (API::UserContentWorld::generateIdentifier): Deleted. * UIProcess/API/APIUserContentWorld.h: * UIProcess/UserContent/WebScriptMessageHandler.h: (WebKit::WebScriptMessageHandler::world): (WebKit::WebScriptMessageHandler::userContentWorld const): Deleted. (WebKit::WebScriptMessageHandler::userContentWorld): Deleted. * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::addProcess): (WebKit::WebUserContentControllerProxy::addUserContentWorldUse): (WebKit::WebUserContentControllerProxy::shouldSendRemoveUserContentWorldsMessage): (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler): (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName): (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers): * UIProcess/UserContent/WebUserContentControllerProxy.h: 2020-01-21 Chris Dumez Minor improvements to StorageAreaMap https://bugs.webkit.org/show_bug.cgi?id=206433 Reviewed by Darin Adler. Minor improvements to StorageAreaMap: 1. The class does not need to be RefCounted, as it is solely owned by StorageNamespaceImpl. Having it RefCounted was actually dangerous because StorageAreaMap had a raw pointer data member to its owner: m_storageNamespace. This raw pointer could become stale if you extend the lifetime of the StorageAreaMap object to outlive its StorageNamespaceImpl. 2. Make StorageAreaMap::connect() private as it is never called from outside the class 3. Reorder data members for better packing 4. Use modern loops in the implementation 5. Rename loadValuesIfNeeded() to ensureStorageMap() and have it return the StorageMap object. This makes calls site more concise and it makes it clearer when this method needs to be called. 6. Mark class as final 7. Replace LOG_ERROR() with RELEASE_LOG_ERROR() so that we can see error logging in sysdiagnoses 8. Use more references instead of raw pointers to make it clear when null checks are not needed * WebProcess/WebStorage/StorageAreaImpl.cpp: (WebKit::StorageAreaImpl::create): (WebKit::StorageAreaImpl::StorageAreaImpl): * WebProcess/WebStorage/StorageAreaImpl.h: * WebProcess/WebStorage/StorageAreaMap.cpp: (WebKit::StorageAreaMap::StorageAreaMap): (WebKit::StorageAreaMap::length): (WebKit::StorageAreaMap::key): (WebKit::StorageAreaMap::item): (WebKit::StorageAreaMap::setItem): (WebKit::StorageAreaMap::removeItem): (WebKit::StorageAreaMap::clear): (WebKit::StorageAreaMap::contains): (WebKit::StorageAreaMap::resetValues): (WebKit::StorageAreaMap::ensureStorageMap): (WebKit::StorageAreaMap::applyChange): (WebKit::StorageAreaMap::dispatchSessionStorageEvent): (WebKit::StorageAreaMap::dispatchLocalStorageEvent): (WebKit::StorageAreaMap::connect): (WebKit::StorageAreaMap::disconnect): * WebProcess/WebStorage/StorageAreaMap.h: * WebProcess/WebStorage/StorageAreaMap.messages.in: * WebProcess/WebStorage/StorageNamespaceImpl.cpp: (WebKit::StorageNamespaceImpl::storageArea): * WebProcess/WebStorage/StorageNamespaceImpl.h: 2020-01-21 Alejandro G. Castro [GTK][WPE] TestWebKitUserContentFilterStore is crashing https://bugs.webkit.org/show_bug.cgi?id=206527 Reviewed by Adrian Perez de Castro. We are asserting looking for a category of error when converting in the toGError function, but depending on the function called the category can be different. * UIProcess/API/glib/WebKitUserContentFilterStore.cpp: (toGError): (webkitUserContentFilterStoreSaveBytes): Moved the ASSERT to the function that uses this category, the other functions calling toGError were already ASSERTing the correct category. 2020-01-21 Carlos Garcia Campos [GTK][WPE] Enable WebGL by default https://bugs.webkit.org/show_bug.cgi?id=205335 Reviewed by Adrian Perez de Castro. * UIProcess/API/glib/WebKitSettings.cpp: (webkit_settings_class_init): 2020-01-21 Carlos Garcia Campos [GTK][WPE] Enable WebAudio by default https://bugs.webkit.org/show_bug.cgi?id=205334 Reviewed by Adrian Perez de Castro. * UIProcess/API/glib/WebKitSettings.cpp: (webkit_settings_class_init): 2020-01-21 youenn fablet Log the destination of a load when hitting network process https://bugs.webkit.org/show_bug.cgi?id=206422 Reviewed by Darin Adler. * NetworkProcess/NetworkResourceLoader.cpp: No change of behavior, adding more precise logging. 2020-01-20 David Kilzer Fix missing header guards and clean up empty files in WebCore, WebKitLegacy, WebKit, Tools Reviewed by Eric Carlson. * Platform/IPC/Attachment.h: - Fix "# pragma" formatting. (It functioned, but WebKit style doesn't indent macros like this.) * Platform/ios/AccessibilityIOS.h: * Shared/ShareSheetCallbackID.h: * Shared/mac/SecItemShim.h: * UIProcess/API/C/WKPageRenderingProgressEventsInternal.h: * UIProcess/API/Cocoa/WKNavigationData.h: * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/API/Cocoa/WKWebArchive.h: - Add #pragma once statement. 2020-01-20 Adrian Perez de Castro Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.27.4 release * wpe/NEWS: Add release notes for 2.27.4 2020-01-20 Zan Dobersek [WPE] Add WebKitRectangle, use it for WebKitWebView's SHOW_MENU signal https://bugs.webkit.org/show_bug.cgi?id=206495 Reviewed by Carlos Garcia Campos. Add WebKitRectangle, a new boxed-type API containing information about a simple rectangle consisting of integer coordinates. This would correspond to types like GdkRectangle or cairo_rectangle_int_t. Objects of this type are for now needed to inform the position and size of the option menu. The `show-menu` signal signature is adjusted accordingly. No new tests -- the relevant test was updated. * PlatformWPE.cmake: * SourcesWPE.txt: * UIProcess/API/glib/WebKitWebView.cpp: (WebKitWebViewClient::showOptionMenu): (webkit_web_view_class_init): (webkitWebViewShowOptionMenu): * UIProcess/API/glib/WebKitWebViewPrivate.h: * UIProcess/API/wpe/WebKitPopupMenu.cpp: (WebKit::WebKitPopupMenu::showPopupMenu): * UIProcess/API/wpe/WebKitRectangle.cpp: Added. (webkit_rectangle_copy): (webkit_rectangle_free): * UIProcess/API/wpe/WebKitRectangle.h: Added. * UIProcess/API/wpe/WebKitWebView.h: * UIProcess/API/wpe/WebKitWebViewClient.h: * UIProcess/API/wpe/docs/wpe-1.0-sections.txt: * UIProcess/API/wpe/docs/wpe-docs.sgml: 2020-01-20 Carlos Garcia Campos [GTK][WPE] InputMethodFilter: do not notify about focus in when only content type changed https://bugs.webkit.org/show_bug.cgi?id=206502 Reviewed by Adrian Perez de Castro. That's unbalancing the focus in/out notifications. * UIProcess/API/glib/InputMethodFilter.cpp: (WebKit::InputMethodFilter::setContext): Always call notifyContentType(). (WebKit::InputMethodFilter::setState): Only call notifyFocusedIn() and notifyFocusedOut when there's a focus change. (WebKit::InputMethodFilter::notifyContentType): Notify content type if changed. (WebKit::InputMethodFilter::notifyFocusedIn): Move the content type notification to its own function. * UIProcess/API/glib/InputMethodFilter.h: 2020-01-20 Carlos Garcia Campos [GTK][WPE] Also include the selection index in webkit_input_method_context_notify_surrounding() https://bugs.webkit.org/show_bug.cgi?id=206497 Reviewed by Adrian Perez de Castro. Input methods also want to know the selection. * Shared/EditorState.cpp: (WebKit::EditorState::PostLayoutData::encode const): Encode paragraphContextSelectionPosition. (WebKit::EditorState::PostLayoutData::decode): Decode paragraphContextSelectionPosition. * Shared/EditorState.h: Add paragraphContextSelectionPosition. * UIProcess/API/glib/InputMethodFilter.cpp: (WebKit::InputMethodFilter::notifySurrounding): Also include the selection index. * UIProcess/API/glib/InputMethodFilter.h: * UIProcess/API/glib/WebKitInputMethodContext.cpp: (webkit_input_method_context_notify_surrounding): * UIProcess/API/gtk/WebKitInputMethodContext.h: * UIProcess/API/gtk/WebKitInputMethodContextImplGtk.cpp: (webkitInputMethodContextImplGtkNotifySurrounding): Ignore the selection index, since GtkIMContext doesn't support it. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseUpdateTextInputState): Pass paragraphContextSelectionPosition to InputMethodFilter::notifySurrounding(). * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::selectionDidChange): Ditto. * UIProcess/API/wpe/WebKitInputMethodContext.h: * WebProcess/WebPage/glib/WebPageGLib.cpp: (WebKit::WebPage::platformEditorState const): Get the selection index too. 2020-01-20 Zan Dobersek [WPE] Expose the WebKitOptionMenu APIs https://bugs.webkit.org/show_bug.cgi?id=206287 Reviewed by Carlos Garcia Campos. Enable the GLib-based API covering option menu functionality for WPE. Most of this can be shared with the GTK port. The only difference is in the two additional parameters emitted on the WebKitWebView's "show-menu" signal (GdkEvent and GdkRectangle) that WPE doesn't support at the moment. The rectangle information will be possible to emit in the near future once a usable API type is available for this information. The WebKitPopupMenu implementation for WPE would only work with the GLib-based API. To avoid using it with other APIs, this is implemented only on the WebKitWebViewClient interface (renamed from 'WebViewClient' and its declaration moved into a separate header file) inheriting from API::ViewClient. The relevant API test is enabled for WPE. * PlatformWPE.cmake: * SourcesWPE.txt: * UIProcess/API/glib/WebKitWebView.cpp: (WebKitWebViewClient::WebKitWebViewClient): (WebKitWebViewClient::showOptionMenu): (WebKitWebViewClient::handleDownloadRequest): (WebKitWebViewClient::frameDisplayed): (WebKitWebViewClient::willStartLoad): (WebKitWebViewClient::didChangePageID): (WebKitWebViewClient::didReceiveUserMessage): (webkitWebViewConstructed): (webkit_web_view_class_init): (webkitWebViewShowOptionMenu): * UIProcess/API/glib/WebKitWebViewPrivate.h: * UIProcess/API/wpe/APIViewClient.h: (API::ViewClient::isGLibBasedAPI): * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::createPopupMenuProxy): * UIProcess/API/wpe/WPEView.h: (WKWPE::View::client const): * UIProcess/API/wpe/WebKitOptionMenu.h: Added. * UIProcess/API/wpe/WebKitOptionMenuItem.h: Added. * UIProcess/API/wpe/WebKitPopupMenu.cpp: Added. (WebKit::WebKitPopupMenu::create): (WebKit::WebKitPopupMenu::WebKitPopupMenu): (WebKit::menuCloseCallback): (WebKit::WebKitPopupMenu::showPopupMenu): (WebKit::WebKitPopupMenu::hidePopupMenu): (WebKit::WebKitPopupMenu::cancelTracking): (WebKit::WebKitPopupMenu::selectItem): (WebKit::WebKitPopupMenu::activateItem): * UIProcess/API/wpe/WebKitPopupMenu.h: Added. * UIProcess/API/wpe/WebKitWebView.h: * UIProcess/API/wpe/WebKitWebViewClient.h: Added. * UIProcess/API/wpe/docs/wpe-1.0-sections.txt: * UIProcess/API/wpe/webkit.h: 2020-01-20 youenn fablet Add support for MediaStream video track rendering in GPUProcess https://bugs.webkit.org/show_bug.cgi?id=206286 Reviewed by Eric Carlson. Implement WebProcess SampleBufferDisplayLayer and GPUProcess RemoteSampleBufferDisplayLayer. RemoteSampleBufferDisplayLayer is a wrapper around LocalSampleBufferDisplayLayer. A synchronous IPC is used at creation time of the layer to make sure we have a shared layer synchronously. Future refactoring should allow to remove that constraint as done in regular video playing. Override SampleBufferDisplayLayer create function pointer when rendering is to be done in GPUProcess. * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::sampleBufferDisplayLayerManager): (WebKit::GPUConnectionToWebProcess::didReceiveMessage): (WebKit::GPUConnectionToWebProcess::didReceiveSyncMessage): * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.cpp: Added. (WebKit::RemoteSampleBufferDisplayLayer::create): (WebKit::RemoteSampleBufferDisplayLayer::RemoteSampleBufferDisplayLayer): (WebKit::RemoteSampleBufferDisplayLayer::~RemoteSampleBufferDisplayLayer): (WebKit::RemoteSampleBufferDisplayLayer::contextID): (WebKit::RemoteSampleBufferDisplayLayer::bounds const): (WebKit::RemoteSampleBufferDisplayLayer::updateDisplayMode): (WebKit::RemoteSampleBufferDisplayLayer::updateAffineTransform): (WebKit::RemoteSampleBufferDisplayLayer::updateBoundsAndPosition): (WebKit::RemoteSampleBufferDisplayLayer::flush): (WebKit::RemoteSampleBufferDisplayLayer::flushAndRemoveImage): (WebKit::RemoteSampleBufferDisplayLayer::enqueueSample): (WebKit::RemoteSampleBufferDisplayLayer::clearEnqueuedSamples): (WebKit::RemoteSampleBufferDisplayLayer::messageSenderConnection const): (WebKit::RemoteSampleBufferDisplayLayer::sampleBufferDisplayLayerStatusDidChange): (WebKit::RemoteSampleBufferDisplayLayer::streamTime const): * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.h: Added. * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.messages.in: Added. * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.cpp: Added. (WebKit::RemoteSampleBufferDisplayLayerManager::RemoteSampleBufferDisplayLayerManager): (WebKit::RemoteSampleBufferDisplayLayerManager::didReceiveLayerMessage): (WebKit::RemoteSampleBufferDisplayLayerManager::createLayer): (WebKit::RemoteSampleBufferDisplayLayerManager::releaseLayer): * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.h: Added. * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.messages.in: Added. * Scripts/webkit/messages.py: * Shared/WebCoreArgumentCoders.h: * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Sources.txt: * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/GPUProcessConnection.cpp: (WebKit::GPUProcessConnection::sampleBufferDisplayLayerManager): (WebKit::GPUProcessConnection::didReceiveMessage): * WebProcess/GPU/GPUProcessConnection.h: * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::updatePreferences): * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.cpp: Added. (WebKit::SampleBufferDisplayLayer::create): (WebKit::SampleBufferDisplayLayer::SampleBufferDisplayLayer): (WebKit::SampleBufferDisplayLayer::~SampleBufferDisplayLayer): (WebKit::SampleBufferDisplayLayer::didFail const): (WebKit::SampleBufferDisplayLayer::updateDisplayMode): (WebKit::SampleBufferDisplayLayer::bounds const): (WebKit::SampleBufferDisplayLayer::updateAffineTransform): (WebKit::SampleBufferDisplayLayer::updateBoundsAndPosition): (WebKit::SampleBufferDisplayLayer::flush): (WebKit::SampleBufferDisplayLayer::flushAndRemoveImage): (WebKit::SampleBufferDisplayLayer::enqueueSample): (WebKit::SampleBufferDisplayLayer::clearEnqueuedSamples): (WebKit::SampleBufferDisplayLayer::rootLayer): (WebKit::SampleBufferDisplayLayer::setDidFail): (WebKit::SampleBufferDisplayLayer::boundsChanged): * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.h: Added. * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.messages.in: Added. * WebProcess/GPU/webrtc/SampleBufferDisplayLayerIdentifier.h: Added. * WebProcess/GPU/webrtc/SampleBufferDisplayLayerManager.cpp: Added. (WebKit::SampleBufferDisplayLayerManager::didReceiveLayerMessage): (WebKit::SampleBufferDisplayLayerManager::createLayer): (WebKit::SampleBufferDisplayLayerManager::addLayer): (WebKit::SampleBufferDisplayLayerManager::removeLayer): * WebProcess/GPU/webrtc/SampleBufferDisplayLayerManager.h: Added. * WebProcess/WebProcess.h: 2020-01-19 Eric Carlson Make MediaPlayerPrivateRemote a message receiver https://bugs.webkit.org/show_bug.cgi?id=206487 Reviewed by Dean Jackson. Make MediaPlayerPrivateRemote a message receiver so we don't need a trampoline for every method in the MediaPlayerPrivateRemoteManager. No new tests, no change of behavior. * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * GPUProcess/media/RemoteAudioTrackProxy.cpp: (WebKit::RemoteAudioTrackProxy::RemoteAudioTrackProxy): (WebKit::RemoteAudioTrackProxy::configurationChanged): (WebKit::RemoteAudioTrackProxy::willRemove): * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::requestResource): (WebKit::RemoteMediaPlayerProxy::removeResource): (WebKit::RemoteMediaPlayerProxy::mediaPlayerNetworkStateChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerReadyStateChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerVolumeChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerMuteChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerTimeChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerDurationChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerRateChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerEngineFailedToLoad const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerPlaybackStateChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerCharacteristicChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable): (WebKit::RemoteMediaPlayerProxy::sendCachedState): * GPUProcess/media/RemoteMediaResourceManager.cpp: * GPUProcess/media/RemoteVideoTrackProxy.cpp: (WebKit::RemoteVideoTrackProxy::RemoteVideoTrackProxy): (WebKit::RemoteVideoTrackProxy::configurationChanged): (WebKit::RemoteVideoTrackProxy::willRemove): * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/GPUProcessConnection.cpp: (WebKit::GPUProcessConnection::didReceiveMessage): * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::requestResource): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in: Added. * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::didReceivePlayerMessage): (WebKit::RemoteMediaPlayerManager::networkStateChanged): Deleted. (WebKit::RemoteMediaPlayerManager::readyStateChanged): Deleted. (WebKit::RemoteMediaPlayerManager::volumeChanged): Deleted. (WebKit::RemoteMediaPlayerManager::muteChanged): Deleted. (WebKit::RemoteMediaPlayerManager::timeChanged): Deleted. (WebKit::RemoteMediaPlayerManager::durationChanged): Deleted. (WebKit::RemoteMediaPlayerManager::rateChanged): Deleted. (WebKit::RemoteMediaPlayerManager::playbackStateChanged): Deleted. (WebKit::RemoteMediaPlayerManager::engineFailedToLoad): Deleted. (WebKit::RemoteMediaPlayerManager::characteristicChanged): Deleted. (WebKit::RemoteMediaPlayerManager::sizeChanged): Deleted. (WebKit::RemoteMediaPlayerManager::addRemoteAudioTrack): Deleted. (WebKit::RemoteMediaPlayerManager::removeRemoteAudioTrack): Deleted. (WebKit::RemoteMediaPlayerManager::remoteAudioTrackConfigurationChanged): Deleted. (WebKit::RemoteMediaPlayerManager::addRemoteVideoTrack): Deleted. (WebKit::RemoteMediaPlayerManager::removeRemoteVideoTrack): Deleted. (WebKit::RemoteMediaPlayerManager::remoteVideoTrackConfigurationChanged): Deleted. (WebKit::RemoteMediaPlayerManager::firstVideoFrameAvailable): Deleted. (WebKit::RemoteMediaPlayerManager::requestResource): Deleted. (WebKit::RemoteMediaPlayerManager::removeResource): Deleted. (WebKit::RemoteMediaPlayerManager::updateCachedState): Deleted. * WebProcess/GPU/media/RemoteMediaPlayerManager.h: (WebKit::RemoteMediaPlayerManager::didReceiveMessageFromGPUProcess): Deleted. * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in: 2020-01-19 Claudio Saavedra [GTK] Remove usage of deprecated GTimeVal https://bugs.webkit.org/show_bug.cgi?id=206358 Reviewed by Žan Doberšek. Use g_get_monotonic_time() for counting clicks instead of deprecated and unsafe API. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (ClickCounter::currentClickCountForGdkButtonEvent): 2020-01-17 Cathie Chen Add support for scroll behavior parsing https://bugs.webkit.org/show_bug.cgi?id=205009 Reviewed by Frédéric Wang. Based on the patch by Frédéric Wang. Add CSSOM smooth scrolling as an experimental feature. * Shared/WebPreferences.yaml: 2020-01-17 Peng Liu Fix a build failure related to the feature flag (GPU_PROCESS) https://bugs.webkit.org/show_bug.cgi?id=206453 Reviewed by Eric Carlson. No new tests - no added or changed functionality. * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in: * GPUProcess/media/RemoteMediaPlayerProxy.messages.in: 2020-01-17 Matt Lewis Unreviewed, rolling out r254688. This caused internal test crashes. Reverted changeset: "Add support for MediaStream video track rendering in GPUProcess" https://bugs.webkit.org/show_bug.cgi?id=206286 https://trac.webkit.org/changeset/254688 2020-01-17 Daniel Bates [iOS] ASSERTION FAILED: ASSERT_NOT_REACHED() in selectionChangedWithTouch(WKContentView*, WebCore::IntPoint const&, unsigned int, unsigned int, WebKit::CallbackBase::Error) https://bugs.webkit.org/show_bug.cgi?id=206427 Reviewed by Wenson Hsieh. Remove ASSERT_NOT_REACHED() usage in callbacks selectionChangedWithTouch() and selectionChangedWithGesture(). These callbacks can handle being- and should expect to sometimes be- invoked with a non-None error value. In particular, if the WebProcess crashes then these callbacks will be invoked with error CallbackBase::Error::ProcessExited. * UIProcess/ios/WKContentViewInteraction.mm: (selectionChangedWithGesture): Remove ASSERT_NOT_REACHED() when an error occurs. This function is capable of handling this error. (selectionChangedWithTouch): Ditto. 2020-01-17 Brent Fulgham [iOS] Remove the IOHIDEventServiceFastPathUserClient IOKit class https://bugs.webkit.org/show_bug.cgi?id=206387 Reviewed by Per Arne Vollan. After Bug 204770, we no longer interact with the device motion or geolocation systems inside the WebContent process. Testing and telemetry shows that we no longer access the IOHIDEventServiceFastPathUserClient, and so should remove access to it. No new tests because there is no change in behavior. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2020-01-17 Brady Eidson TestWebKitAPI.AsyncFunction.Promise times out on slower machines in debug builds. and https://bugs.webkit.org/show_bug.cgi?id=206012 Reviewed by Keith Miller. For existing API test. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _garbageCollectJavaScriptObjectsForTesting]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: 2020-01-17 Daniel Bates [iOS] Focusing editable element with WebPage::selectPositionAtPoint() does not bring up keyboard https://bugs.webkit.org/show_bug.cgi?id=206385 Reviewed by Wenson Hsieh. Update the view's state to indicate that the user is performing an interaction for the scope of WebPage::selectPositionAtPoint(). This permits WebKit to show the keyboard if selecting the position causes a change in focus (say, the point is inside an unfocused text field). We likely should do a similar change for all other WebKit IPIs that perform a WebCore::EUserTriggered::UserTriggered tagged selection change though the callers should be audited to ensure they weren't accidentally depending on the existing behavior that prevents such selections from bringing up the keyboard. For now, I only fix WebPage::selectPositionAtPoint() as I've audited that all callers expect it to bring up the keyboard, if needed. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::selectPositionAtPoint): 2020-01-17 Adrian Perez de Castro Fix various non-unified build issues introduced since r254327 https://bugs.webkit.org/show_bug.cgi?id=206356 Reviewed by Chris Dumez. * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp: (WebKit::WebContextMenuClient::insertEmoji): Add missing namespace to WebCore::Frame parameter. 2020-01-17 Fujii Hironori [WinCairo][WK2] ASSERT(isUIThread()) is failing since r254723 https://bugs.webkit.org/show_bug.cgi?id=206394 Reviewed by Carlos Alberto Lopez Perez. AtomString::init() should be called after WTF::initializeThreading() is called on Windows because it has ASSERT(isUIThread()) and Windows doesn't have a API to get main thread handle like pthread_main_np. * Shared/WebKit2Initialize.cpp: (WebKit::InitializeWebKit2): Call AtomString::init() after JSC::initializeThreading(). 2020-01-17 Chris Dumez IPC hardening for WebPasteboardProxy::SetPasteboardBufferForType message https://bugs.webkit.org/show_bug.cgi?id=206381 Reviewed by Anders Carlsson. IPC hardening for WebPasteboardProxy::SetPasteboardBufferForType message. Make sure that the Strings passed over IPC are not null and that the SharedBuffer returned by SharedBuffer::map() is not null. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::setPasteboardBufferForType): 2020-01-17 Carlos Garcia Campos [GTK][WPE] Composition underline color is not applied https://bugs.webkit.org/show_bug.cgi?id=206353 Reviewed by Sergio Villar Senin. CompositionUnderline::compositionUnderlineColor is not encoded/decoded in IPC messages, so the web process always uses CompositionUnderlineColor::TextColor ignoring the given color. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): Encode compositionUnderlineColor. (IPC::ArgumentCoder::decode): Decode compositionUnderlineColor. 2020-01-16 Zan Dobersek Unreviewed. Move the common WebKitOptionMenu GLib API implementation parts out from the GTK-specific directory and under UIProcess/API/glib/. * SourcesGTK.txt: * UIProcess/API/glib/WebKitOptionMenu.cpp: Copied from Source/WebKit/UIProcess/API/gtk/WebKitOptionMenu.cpp. * UIProcess/API/glib/WebKitOptionMenuItem.cpp: Copied from Source/WebKit/UIProcess/API/gtk/WebKitOptionMenuItem.cpp. * UIProcess/API/glib/WebKitOptionMenuItemPrivate.h: Copied from Source/WebKit/UIProcess/API/gtk/WebKitOptionMenuItemPrivate.h. * UIProcess/API/glib/WebKitOptionMenuPrivate.h: Copied from Source/WebKit/UIProcess/API/gtk/WebKitOptionMenuPrivate.h. * UIProcess/API/gtk/WebKitOptionMenu.cpp: Removed. * UIProcess/API/gtk/WebKitOptionMenuItem.cpp: Removed. * UIProcess/API/gtk/WebKitOptionMenuItemPrivate.h: Removed. * UIProcess/API/gtk/WebKitOptionMenuPrivate.h: Removed. 2020-01-16 Brent Fulgham [iOS] Add telemetry for IOKIt classes not seen in test runs https://bugs.webkit.org/show_bug.cgi?id=206386 Reviewed by Per Arne Vollan. Capture telemetry to show which IOKit classes are acitvely used in WebKit. No new tests because this does not change behavior. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2020-01-16 Chris Dumez IPC hardening for WebPageProxy::SetPromisedDataForImage message https://bugs.webkit.org/show_bug.cgi?id=206380 Reviewed by Geoffrey Garen. IPC hardening for WebPageProxy::SetPromisedDataForImage message. Make sure the shared memory handle sent over IPC is not null and null check the SharedMemory object after calling SharedMemory::map(). * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::setPromisedDataForImage): 2020-01-16 Daniel Chen Call AtomString::init in WebKit2Initialize. Reviewed by Timothy Hatcher. * Shared/Cocoa/WebKit2InitializeCocoa.mm: (WebKit::runInitializationCode): * Shared/WebKit2Initialize.cpp: (WebKit::InitializeWebKit2): 2020-01-16 Chris Dumez IPC hardening for WebPageProxy::savePDFToTemporaryFolder* / WebPageProxy::openPDFFromTemporaryFolder* messages https://bugs.webkit.org/show_bug.cgi?id=206378 Reviewed by Geoffrey Garen. IPC hardening for WebPageProxy::savePDFToTemporaryFolder* / WebPageProxy::openPDFFromTemporaryFolder* messages. Make sure the UUID passed over IPC is a valid HashMap key. * UIProcess/WebPageProxy.h: * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplication): (WebKit::WebPageProxy::openPDFFromTemporaryFolderWithNativeApplication): 2020-01-16 Chris Dumez IPC hardening for WebPageProxy::RegisterAttachmentIdentifier* https://bugs.webkit.org/show_bug.cgi?id=206376 Reviewed by David Kilzer. IPC hardening for WebPageProxy::RegisterAttachmentIdentifier*, validate identifiers sent over IPC to make sure they are valid keys in our HashMap. * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: 2020-01-16 Don Olmstead [PlayStation] Enable WebKit https://bugs.webkit.org/show_bug.cgi?id=205965 Reviewed by Ross Kirsling. Add the CMake platform for PlayStation. Add stubs for platform specific bits. This gets us to linking through WebKit. * Platform/unix/ModuleUnix.cpp: Added. (WebKit::Module::load): (WebKit::Module::unload): (WebKit::Module::platformFunctionPointer const): * PlatformPlayStation.cmake: Added. * UIProcess/Launcher/playstation/ProcessLauncherPlayStation.cpp: Added. (WebKit::ProcessLauncher::launchProcess): (WebKit::ProcessLauncher::terminateProcess): (WebKit::ProcessLauncher::platformInvalidate): * UIProcess/WebPageProxy.h: * UIProcess/WebsiteData/playstation/WebsiteDataStorePlayStation.cpp: Added. (WebKit::WebsiteDataStore::platformInitialize): (WebKit::WebsiteDataStore::platformDestroy): (WebKit::WebsiteDataStore::platformRemoveRecentSearches): (WebKit::WebsiteDataStore::defaultApplicationCacheDirectory): (WebKit::WebsiteDataStore::defaultCacheStorageDirectory): (WebKit::WebsiteDataStore::defaultNetworkCacheDirectory): (WebKit::WebsiteDataStore::defaultIndexedDBDatabaseDirectory): (WebKit::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory): (WebKit::WebsiteDataStore::defaultLocalStorageDirectory): (WebKit::WebsiteDataStore::defaultMediaKeysStorageDirectory): (WebKit::WebsiteDataStore::defaultWebSQLDatabaseDirectory): (WebKit::WebsiteDataStore::defaultResourceLoadStatisticsDirectory): (WebKit::WebsiteDataStore::cacheDirectoryFileSystemRepresentation): (WebKit::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation): * UIProcess/playstation/WebPageProxyPlayStation.cpp: Added. (WebKit::WebPageProxy::platformInitialize): (WebKit::WebPageProxy::viewBackend): (WebKit::WebPageProxy::standardUserAgent): (WebKit::WebPageProxy::saveRecentSearches): (WebKit::WebPageProxy::loadRecentSearches): (WebKit::WebPageProxy::updateEditorState): * UIProcess/playstation/WebProcessPoolPlayStation.cpp: Added. (WebKit::WebProcessPool::platformInitialize): (WebKit::WebProcessPool::platformInitializeNetworkProcess): (WebKit::WebProcessPool::platformInitializeWebProcess): (WebKit::WebProcessPool::platformInvalidateContext): (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions): * WebProcess/InjectedBundle/playstation/InjectedBundlePlayStation.cpp: Added. (WebKit::InjectedBundle::initialize): (WebKit::InjectedBundle::setBundleParameter): (WebKit::InjectedBundle::setBundleParameters): * WebProcess/WebPage/playstation/WebPagePlayStation.cpp: Added. (WebKit::WebPage::platformInitialize): (WebKit::WebPage::platformReinitialize): (WebKit::WebPage::platformDetach): (WebKit::WebPage::performDefaultBehaviorForKeyEvent): (WebKit::WebPage::platformCanHandleRequest): (WebKit::WebPage::platformUserAgent const): (WebKit::WebPage::handleEditingKeyboardEvent): (WebKit::WebPage::platformEditorState const): * WebProcess/playstation/WebProcessPlayStation.cpp: Added. (WebKit::WebProcess::platformInitializeWebProcess): (WebKit::WebProcess::platformSetWebsiteDataStoreParameters): (WebKit::WebProcess::platformTerminate): (WebKit::WebProcess::platformSetCacheModel): 2020-01-16 Chris Dumez Regression(r253224) No longer able to prevent a tab from closing via the beforeunload prompt https://bugs.webkit.org/show_bug.cgi?id=206366 Reviewed by Geoffrey Garen. Change is covered by new API test. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _tryClose]): (-[WKWebView _isClosed]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add new _tryClose / _isClosed SPI on WKWebView in order to write an API test to cover the change. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): In WebPageProxy::tryClose(), we start a timer before sending the TryClose async IPC to the WebProcess. We would then stop the timer when receiving the response to the TryClose IPC. If the timer fires, we would forcefully close the page. The issue was that before answering the TryClose IPC, the WebContent process would send a sync RunBeforeUnloadConfirmPanel IPC to the UIProcess to show the confirmation prompt, and this would fail to stop the timer. WebPageProxy::runBeforeUnloadConfirmPanel() would spin a nested run loop to show the prompt and we would time out while showing the prompt. 2020-01-16 Alex Christensen Add finite timeout when synchronously terminating a service worker https://bugs.webkit.org/show_bug.cgi?id=206325 Reviewed by Youenn Fablet. When this message reply is never received, it hangs everything. If we haven't received verification that a service worker was terminated in 10 seconds, unhang everything and tell the UI process to terminate the hanging service worker process. Continue handling messages during these 10 seconds to hopefully turn a bad hang into no perceptible hang. * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::syncTerminateWorker): 2020-01-16 Brady Eidson Make the callAsyncJavaScriptFunction function actually be async (so await works). and https://bugs.webkit.org/show_bug.cgi?id=206364 Reviewed by Geoffrey Garen. * UIProcess/API/Cocoa/WKWebViewPrivate.h: Update callAsyncJavaScriptFunction: header docs. 2020-01-16 Don Olmstead Non-unified build fixes mid January 2020 edition https://bugs.webkit.org/show_bug.cgi?id=206363 Unreviewed build fix. * NetworkProcess/cache/NetworkCacheBlobStorage.cpp: * NetworkProcess/curl/NetworkDataTaskCurl.cpp: * PlatformFTW.cmake: * PlatformWin.cmake: * UIProcess/API/APIContentWorld.cpp: * UIProcess/Automation/WebAutomationSession.cpp: * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp: * WebProcess/WebCoreSupport/win/WebContextMenuClientWin.cpp: Removed. 2020-01-16 Brady Eidson REGRESSION: (r254668) [Mac Debug wk2] 21 http/tests/navigation/* tests are crashing with ASSERTION FAILED: world.first != 1. https://bugs.webkit.org/show_bug.cgi?id=206357 Unreviewed followup to r254668 to fix tests. ASSERT is no longer valid. Also, having the magic constant "1" in code is mysterious. Make it properly named everywhere. * Shared/ContentWorldShared.h: Copied from Source/WebKit/UIProcess/API/APIUserContentWorld.cpp. * UIProcess/API/APIContentWorld.cpp: (API::ContentWorld::pageContentWorld): * UIProcess/API/APIUserContentWorld.cpp: (API::UserContentWorld::generateIdentifier): (API::UserContentWorld::UserContentWorld): * UIProcess/API/APIUserContentWorld.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/UserContent/WebUserContentController.cpp: (WebKit::WebUserContentController::addUserContentWorld): 2020-01-16 youenn fablet Add support for MediaStream video track rendering in GPUProcess https://bugs.webkit.org/show_bug.cgi?id=206286 Reviewed by Eric Carlson. Implement WebProcess SampleBufferDisplayLayer and GPUProcess RemoteSampleBufferDisplayLayer. RemoteSampleBufferDisplayLayer is a wrapper around LocalSampleBufferDisplayLayer. A synchronous IPC is used at creation time of the layer to make sure we have a shared layer synchronously. Future refactoring should allow to remove that constraint as done in regular video playing. Override SampleBufferDisplayLayer create function pointer when rendering is to be done in GPUProcess. * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::sampleBufferDisplayLayerManager): (WebKit::GPUConnectionToWebProcess::didReceiveMessage): (WebKit::GPUConnectionToWebProcess::didReceiveSyncMessage): * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.cpp: Added. (WebKit::RemoteSampleBufferDisplayLayer::create): (WebKit::RemoteSampleBufferDisplayLayer::RemoteSampleBufferDisplayLayer): (WebKit::RemoteSampleBufferDisplayLayer::~RemoteSampleBufferDisplayLayer): (WebKit::RemoteSampleBufferDisplayLayer::contextID): (WebKit::RemoteSampleBufferDisplayLayer::bounds const): (WebKit::RemoteSampleBufferDisplayLayer::updateDisplayMode): (WebKit::RemoteSampleBufferDisplayLayer::updateAffineTransform): (WebKit::RemoteSampleBufferDisplayLayer::updateBoundsAndPosition): (WebKit::RemoteSampleBufferDisplayLayer::flush): (WebKit::RemoteSampleBufferDisplayLayer::flushAndRemoveImage): (WebKit::RemoteSampleBufferDisplayLayer::enqueueSample): (WebKit::RemoteSampleBufferDisplayLayer::clearEnqueuedSamples): (WebKit::RemoteSampleBufferDisplayLayer::messageSenderConnection const): (WebKit::RemoteSampleBufferDisplayLayer::sampleBufferDisplayLayerStatusDidChange): (WebKit::RemoteSampleBufferDisplayLayer::streamTime const): * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.h: Added. * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.messages.in: Added. * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.cpp: Added. (WebKit::RemoteSampleBufferDisplayLayerManager::RemoteSampleBufferDisplayLayerManager): (WebKit::RemoteSampleBufferDisplayLayerManager::didReceiveLayerMessage): (WebKit::RemoteSampleBufferDisplayLayerManager::createLayer): (WebKit::RemoteSampleBufferDisplayLayerManager::releaseLayer): * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.h: Added. * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.messages.in: Added. * Scripts/webkit/messages.py: * Shared/WebCoreArgumentCoders.h: * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Sources.txt: * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/GPUProcessConnection.cpp: (WebKit::GPUProcessConnection::sampleBufferDisplayLayerManager): (WebKit::GPUProcessConnection::didReceiveMessage): * WebProcess/GPU/GPUProcessConnection.h: * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::updatePreferences): * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.cpp: Added. (WebKit::SampleBufferDisplayLayer::create): (WebKit::SampleBufferDisplayLayer::SampleBufferDisplayLayer): (WebKit::SampleBufferDisplayLayer::~SampleBufferDisplayLayer): (WebKit::SampleBufferDisplayLayer::didFail const): (WebKit::SampleBufferDisplayLayer::updateDisplayMode): (WebKit::SampleBufferDisplayLayer::bounds const): (WebKit::SampleBufferDisplayLayer::updateAffineTransform): (WebKit::SampleBufferDisplayLayer::updateBoundsAndPosition): (WebKit::SampleBufferDisplayLayer::flush): (WebKit::SampleBufferDisplayLayer::flushAndRemoveImage): (WebKit::SampleBufferDisplayLayer::enqueueSample): (WebKit::SampleBufferDisplayLayer::clearEnqueuedSamples): (WebKit::SampleBufferDisplayLayer::rootLayer): (WebKit::SampleBufferDisplayLayer::setDidFail): (WebKit::SampleBufferDisplayLayer::boundsChanged): * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.h: Added. * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.messages.in: Added. * WebProcess/GPU/webrtc/SampleBufferDisplayLayerIdentifier.h: Added. * WebProcess/GPU/webrtc/SampleBufferDisplayLayerManager.cpp: Added. (WebKit::SampleBufferDisplayLayerManager::didReceiveLayerMessage): (WebKit::SampleBufferDisplayLayerManager::createLayer): (WebKit::SampleBufferDisplayLayerManager::addLayer): (WebKit::SampleBufferDisplayLayerManager::removeLayer): * WebProcess/GPU/webrtc/SampleBufferDisplayLayerManager.h: Added. * WebProcess/WebProcess.h: 2020-01-16 David Kilzer Enable -Wconditional-uninitialized in WebInspectorUI, WebKitLegacy, WebKit projects Reviewed by Tim Horton. * Configurations/Base.xcconfig: (WARNING_CFLAGS): Add -Wconditional-uninitialized switch. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::performInteractionSequence): Initialize `x`, `y` stack variables since the compiler can't reason about the behavior of JSON::Object::getInteger(). * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::getAllScriptsInPDFDocument): Initialize `length` stack variable. Also add check that `length` is non-zero. 2020-01-16 Carlos Garcia Campos [GTK][WPE] Web process crash when IM tries to delete surrounding text https://bugs.webkit.org/show_bug.cgi?id=206352 Reviewed by Adrian Perez de Castro. TextIterator::rangeFromLocationAndLength() can return nullptr when the start of the range can't be found. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::deleteSurrounding): Return early if selectionRange is nullptr. 2020-01-16 Cathie Chen Mapping HTML attributes width/height to the default aspect ratio of https://bugs.webkit.org/show_bug.cgi?id=201641 Reviewed by Frédéric Wang Add experimental flag: AspectRatioOfImgFromWidthAndHeightEnabled. * Shared/WebPreferences.yaml: 2020-01-15 Brady Eidson Add WKContentWorld SPI, and use it in JavaScript execution. https://bugs.webkit.org/show_bug.cgi?id=206310 Reviewed by Alex Christensen. Covered by API tests. _WKContentWorld is a UI Process wrapper for an InjectedBundleScriptWorld. Much like _WKUserContentWorld is. But different in that: - Its APIs are named different things - Only one unique instance per string name - It is used with evaluateJavascript: and callAsyncJavaScriptFunction: instead of WKUserContentController. But _WKContentWorld and _WKUserContentWorld do have to work together a little bit to avoid conflicts in the WebProcess. The new versions of evaluateJavascript: and callAsyncJavaScriptFunction: are also included, as well as API tests for all the new stuff. * Shared/API/APIObject.h: * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * UIProcess/API/APIContentWorld.cpp: Copied from Source/WebKit/UIProcess/API/APIUserContentWorld.cpp. (API::ContentWorld::sharedWorldWithName): (API::ContentWorld::pageContentWorld): (API::ContentWorld::defaultClientWorld): (API::ContentWorld::ContentWorld): (API::ContentWorld::~ContentWorld): * UIProcess/API/APIContentWorld.h: Copied from Source/WebKit/UIProcess/API/APIUserContentWorld.h. * UIProcess/API/APIUserContentWorld.cpp: (API::UserContentWorld::generateIdentifier): (API::UserContentWorld::UserContentWorld): (API::generateIdentifier): Deleted. * UIProcess/API/APIUserContentWorld.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView evaluateJavaScript:completionHandler:]): (-[WKWebView _evaluateJavaScript:asAsyncFunction:withArguments:forceUserGesture:completionHandler:inWorld:]): (-[WKWebView _callAsyncJavaScriptFunction:withArguments:inWorld:completionHandler:]): (-[WKWebView _evaluateJavaScript:inWorld:completionHandler:]): (-[WKWebView _evaluateJavaScriptWithoutUserGesture:completionHandler:]): (-[WKWebView _evaluateJavaScript:asAsyncFunction:withArguments:forceUserGesture:completionHandler:]): Deleted. (-[WKWebView _callAsyncFunction:withArguments:completionHandler:]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKContentWorld.h: Added. * UIProcess/API/Cocoa/_WKContentWorld.mm: Copied from Source/WebKit/UIProcess/API/APIUserContentWorld.h. (+[_WKContentWorld pageContentWorld]): (+[_WKContentWorld defaultClientWorld]): (+[_WKContentWorld worldWithName:]): (-[_WKContentWorld dealloc]): (-[_WKContentWorld name]): (-[_WKContentWorld _apiObject]): * UIProcess/API/Cocoa/_WKContentWorldInternal.h: Copied from Source/WebKit/UIProcess/API/APIUserContentWorld.h. * UIProcess/UserContent/WebUserContentControllerProxy.cpp: * UIProcess/UserContent/WebUserContentControllerProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runJavaScriptInMainFrame): (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld): * UIProcess/WebPageProxy.h: * WebProcess/UserContent/WebUserContentController.cpp: (WebKit::worldMap): (WebKit::WebUserContentController::worldForIdentifier): (WebKit::WebUserContentController::addUserContentWorld): (WebKit::WebUserContentController::addUserContentWorlds): * WebProcess/UserContent/WebUserContentController.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::runJavaScript): (WebKit::WebPage::runJavaScriptInMainFrameScriptWorld): (WebKit::WebPage::runJavaScriptInFrame): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * Sources.txt: * WebKit.xcodeproj/project.pbxproj: 2020-01-15 Ross Kirsling [PlayStation] Add stubs for WebContextMenuClient https://bugs.webkit.org/show_bug.cgi?id=206324 Reviewed by Don Olmstead. * WebProcess/WebCoreSupport/WebContextMenuClient.cpp: (WebKit::WebContextMenuClient::lookUpInDictionary): (WebKit::WebContextMenuClient::isSpeaking): (WebKit::WebContextMenuClient::speak): (WebKit::WebContextMenuClient::stopSpeaking): * WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp: (WebKit::WebContextMenuClient::lookUpInDictionary): Deleted. (WebKit::WebContextMenuClient::isSpeaking): Deleted. (WebKit::WebContextMenuClient::speak): Deleted. (WebKit::WebContextMenuClient::stopSpeaking): Deleted. Bring GTK/WPE stubs down for broader use. 2020-01-15 Ross Kirsling [PlayStation] Add stub for WebPopupMenu::setUpPlatformData https://bugs.webkit.org/show_bug.cgi?id=206323 Reviewed by Don Olmstead. * SourcesGTK.txt: * SourcesWPE.txt: * WebProcess/WebCoreSupport/WebPopupMenu.cpp: (WebKit::WebPopupMenu::setUpPlatformData): * WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp: Removed. * WebProcess/WebCoreSupport/wpe/WebPopupMenuWPE.cpp: Removed. Bring GTK/WPE stub down for broader use. 2020-01-15 Ross Kirsling [PlayStation] Add stubs for WebEditorClient https://bugs.webkit.org/show_bug.cgi?id=206320 Reviewed by Don Olmstead. * WebProcess/WebCoreSupport/WebEditorClient.cpp: 2020-01-15 Don Olmstead Share WebInspector stubs for ports without local inspection https://bugs.webkit.org/show_bug.cgi?id=206267 Reviewed by Alex Christensen. No new tests. No change in behavior. Ports that do no allow local inspection of a web page can share a number of stubs around the Web Inspector. This is the case for iOS, WPE and the PlayStation port. Make the platform guards specific to actual implementations. * SourcesWPE.txt: * UIProcess/RemoteWebInspectorProxy.cpp: * UIProcess/WebInspectorProxy.cpp: * UIProcess/mac/RemoteWebInspectorProxyMac.mm: * UIProcess/wpe/WebInspectorProxyWPE.cpp: Removed. * WebProcess/WebPage/RemoteWebInspectorUI.cpp: (WebKit::RemoteWebInspectorUI::localizedStringsURL const): * WebProcess/WebPage/WebInspectorUI.cpp: (WebKit::WebInspectorUI::canSave): (WebKit::WebInspectorUI::localizedStringsURL const): * WebProcess/WebPage/mac/WebInspectorUIMac.mm: * WebProcess/WebPage/wpe/WebInspectorUIWPE.cpp: Removed. * WebProcess/WebPage/wpe/WebInspectorWPE.cpp: Removed. 2020-01-15 David Kilzer [Cocoa] Create a simulated crash log when the UI Process receives an invalid CoreIPC message Reviewed by Chris Dumez. * UIProcess/AuxiliaryProcessProxy.cpp: (WebKit::AuxiliaryProcessProxy::logInvalidMessage): - Extract common logging code to new method that calls RELEASE_LOG_FAULT(). * UIProcess/AuxiliaryProcessProxy.h: (WebKit::AuxiliaryProcessProxy::logInvalidMessage): (WebKit::AuxiliaryProcessProxy::processName): - Add method declarations. * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::didReceiveInvalidMessage): - Use new AuxiliaryProcessProxy::logInvalidMessage(). * UIProcess/GPU/GPUProcessProxy.h: (WebKit::GPUProcessProxy::processName const): - Add implementation. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::didReceiveInvalidMessage): - Use new AuxiliaryProcessProxy::logInvalidMessage(). * UIProcess/Network/NetworkProcessProxy.h: (WebKit::NetworkProcessProxy::processName const): - Add implementation. * UIProcess/Plugins/PluginProcessProxy.cpp: (WebKit::PluginProcessProxy::didReceiveInvalidMessage): - Use new AuxiliaryProcessProxy::logInvalidMessage(). * UIProcess/Plugins/PluginProcessProxy.h: (WebKit::PluginProcessProxy::processName const): - Add implementation. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didReceiveInvalidMessage): - Use new AuxiliaryProcessProxy::logInvalidMessage(). * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::processName const): - Add implementation. 2020-01-15 youenn fablet Add support for MediaStream audio track rendering in GPUProcess https://bugs.webkit.org/show_bug.cgi?id=206175 Reviewed by Eric Carlson. Implement an AudioMediaStreamTrackRenderer at WebKit level by creating a remote renderer in GPUProcess and sending IPC to pass audio data as well as orders (start/stop/setMuted). Implement the remote renderer using WebCore audio track renderer. Enable WebKit remote renderer F GPU process for media is enabled. * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::audioTrackRendererManager): (WebKit::GPUConnectionToWebProcess::didReceiveMessage): * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.cpp: Added. (WebKit::nextLogIdentifier): (WebKit::nullLogger): (WebKit::RemoteAudioMediaStreamTrackRenderer::RemoteAudioMediaStreamTrackRenderer): (WebKit::RemoteAudioMediaStreamTrackRenderer::~RemoteAudioMediaStreamTrackRenderer): (WebKit::RemoteAudioMediaStreamTrackRenderer::storage): (WebKit::RemoteAudioMediaStreamTrackRenderer::start): (WebKit::RemoteAudioMediaStreamTrackRenderer::stop): (WebKit::RemoteAudioMediaStreamTrackRenderer::clear): (WebKit::RemoteAudioMediaStreamTrackRenderer::setMuted): (WebKit::RemoteAudioMediaStreamTrackRenderer::setVolume): (WebKit::RemoteAudioMediaStreamTrackRenderer::audioSamplesStorageChanged): (WebKit::RemoteAudioMediaStreamTrackRenderer::audioSamplesAvailable): * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.h: Added. * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.messages.in: Added. * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager.cpp: Added. (WebKit::RemoteAudioMediaStreamTrackRendererManager::didReceiveRendererMessage): (WebKit::RemoteAudioMediaStreamTrackRendererManager::createRenderer): (WebKit::RemoteAudioMediaStreamTrackRendererManager::releaseRenderer): * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager.h: Added. (WebKit::RemoteAudioMediaStreamTrackRendererManager::didReceiveMessageFromWebProcess): * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager.messages.in: Added. * Scripts/webkit/messages.py: * Sources.txt: * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::updatePreferences): * WebProcess/GPU/webrtc/AudioMediaStreamTrackRenderer.cpp: Added. (WebKit::AudioMediaStreamTrackRenderer::create): (WebKit::AudioMediaStreamTrackRenderer::AudioMediaStreamTrackRenderer): (WebKit::AudioMediaStreamTrackRenderer::~AudioMediaStreamTrackRenderer): (WebKit::AudioMediaStreamTrackRenderer::start): (WebKit::AudioMediaStreamTrackRenderer::stop): (WebKit::AudioMediaStreamTrackRenderer::clear): (WebKit::AudioMediaStreamTrackRenderer::setMuted): (WebKit::AudioMediaStreamTrackRenderer::setVolume): (WebKit::AudioMediaStreamTrackRenderer::pushSamples): (WebKit::AudioMediaStreamTrackRenderer::storageChanged): * WebProcess/GPU/webrtc/AudioMediaStreamTrackRenderer.h: Added. (WebKit::AudioMediaStreamTrackRenderer::identifier const): * WebProcess/GPU/webrtc/AudioMediaStreamTrackRendererIdentifier.h: Added. 2020-01-14 Commit Queue Unreviewed, rolling out r254548. https://bugs.webkit.org/show_bug.cgi?id=206279 Broke launching WebContent (Requested by ap_ on #webkit). Reverted changeset: "Expand WebContent process sandbox with additional syscall" https://bugs.webkit.org/show_bug.cgi?id=206260 https://trac.webkit.org/changeset/254548 2020-01-14 Ryosuke Niwa Enable the offset assertion in HTMLTextFormControlElement::indexForPosition https://bugs.webkit.org/show_bug.cgi?id=205706 Reviewed by Darin Adler. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::rangeNearPositionMatchesText): 2020-01-14 Chris Dumez document.cookie should not do a sync IPC to the network process for iframes that do not have storage access https://bugs.webkit.org/show_bug.cgi?id=206108 Reviewed by Geoff Garen and John Wilander. When ITP is enabled and ThirdPartyCookieBlockingMode::All mode is used (default in Safari), we can now detect that a third-party iframe does not have cookie access completely on the WebContent process side, instead of doing the check on the Network process side. The benefit is that this avoids doing a synchronous IPC every time a third-party iframe which does not have storage access tries to access document.cookie in JavaScript. Given that this should apply to a lot of iframes, this change is very beneficial to performance. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue): (WebKit::NetworkConnectionToWebProcess::getRawCookies): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::logCookieInformationInternal): * NetworkProcess/NetworkSessionCreationParameters.cpp: (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/NetworkSessionCreationParameters.h: * Scripts/webkit/messages.py: * Shared/WebProcessDataStoreParameters.h: (WebKit::WebProcessDataStoreParameters::encode const): (WebKit::WebProcessDataStoreParameters::decode): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::setShouldBlockThirdPartyCookiesForTesting): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::webProcessDataStoreParameters): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::setShouldBlockThirdPartyCookiesForTesting): * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::thirdPartyCookieBlockingMode const): (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::thirdPartyCookieBlockingMode const): (WebKit::WebsiteDataStore::setResourceLoadStatisticsShouldBlockThirdPartyCookiesForTesting): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp: (WebKit::WebResourceLoadObserver::requestStorageAccessUnderOpener): (WebKit::WebResourceLoadObserver::logUserInteractionWithReducedTimeResolution): * WebProcess/WebCoreSupport/WebResourceLoadObserver.h: * WebProcess/WebPage/WebCookieJar.cpp: (WebKit::shouldBlockCookies): (WebKit::WebCookieJar::cookies const): (WebKit::WebCookieJar::setCookies): (WebKit::WebCookieJar::cookieRequestHeaderFieldValue const): (WebKit::WebCookieJar::getRawCookies const): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::addDomainWithPageLevelStorageAccess): (WebKit::WebPage::hasPageLevelStorageAccess const): * WebProcess/WebPage/WebPage.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::setWebsiteDataStoreParameters): (WebKit::WebProcess::setShouldBlockThirdPartyCookiesForTesting): * WebProcess/WebProcess.h: (WebKit::WebProcess::thirdPartyCookieBlockingMode const): * WebProcess/WebProcess.messages.in: 2020-01-14 Peng Liu [Media in GPU process] Implement the remote video layer support https://bugs.webkit.org/show_bug.cgi?id=206043 Reviewed by Youenn Fablet. RemoteMediaPlayerProxy in the GPU process creates a LayerHostingContext with createForExternalHostingProcess() and share the context ID with the MediaPlayerPrivateRemote in the Web process. Then the MediaPlayerPrivateRemote creates a hosting layer with the context ID for rendering. This patch updates RemoteMediaPlayerProxy::PrepareForPlayback to provide the initial video content box and scale for the VideoFullscreenLayerManagerObjC on the GPU process to create WebVideoContainerLayer. It adds XPC message RemoteMediaPlayerManager::FirstVideoFrameAvailable to notify the renderer on the Web process that the video layer is ready. RemoteMediaPlayerManagerProxy::SetSize message is removed to avoid the unnecessary XPC message because MediaPlayerPrivateAVFoundationObjC::setSize() does nothing. * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::prepareForPlayback): (WebKit::RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable): (WebKit::RemoteMediaPlayerProxy::mediaPlayerRenderingModeChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerContentBoxRect const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerContentsScale const): (WebKit::RemoteMediaPlayerProxy::setSize): Deleted. * GPUProcess/media/RemoteMediaPlayerProxy.h: * GPUProcess/media/RemoteMediaPlayerProxy.messages.in: * Platform/cocoa/LayerHostingContext.h: Renamed from Source/WebKit/Platform/mac/LayerHostingContext.h. * Platform/cocoa/LayerHostingContext.mm: Renamed from Source/WebKit/Platform/mac/LayerHostingContext.mm. (WebKit::LayerHostingContext::createPlatformLayerForHostingContext): * Platform/ios/PaymentAuthorizationController.mm: * PluginProcess/mac/PluginControllerProxyMac.mm: * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::prepareForPlayback): (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote::load): (WebKit::MediaPlayerPrivateRemote::firstVideoFrameAvailable): (WebKit::MediaPlayerPrivateRemote::platformLayer const): (WebKit::MediaPlayerPrivateRemote::setSize): Deleted. * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::characteristicChanged): (WebKit::RemoteMediaPlayerManager::sizeChanged): (WebKit::RemoteMediaPlayerManager::addRemoteVideoTrack): (WebKit::RemoteMediaPlayerManager::removeRemoteVideoTrack): (WebKit::RemoteMediaPlayerManager::remoteVideoTrackConfigurationChanged): (WebKit::RemoteMediaPlayerManager::firstVideoFrameAvailable): * WebProcess/GPU/media/RemoteMediaPlayerManager.h: * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in: * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: 2020-01-10 Jiewen Tan [WebAuthn] Implement SPI to tell UI clients to select assertion responses https://bugs.webkit.org/show_bug.cgi?id=206112 Reviewed by Alex Christensen. Covered by API tests. This patch adds a new delegate method in _WKWebAuthenticationPanelDelegate to tell UI clients to select an assertion response when multiple are returned from an authenticator. Here is the SPI: @protocol _WKWebAuthenticationPanelDelegate @optional ... - (void)panel:(_WKWebAuthenticationPanel *)panel selectAssertionResponse:(NSArray < _WKWebAuthenticationAssertionResponse *> *)responses completionHandler:(void (^)(_WKWebAuthenticationAssertionResponse *))completionHandler; ... @end A new interface is introduced to represent an authenticator assertion response: @interface _WKWebAuthenticationAssertionResponse : NSObject @property (nonatomic, readonly, copy) NSString *name; @property (nonatomic, readonly, copy) NSString *displayName; @property (nonatomic, readonly, copy) NSData *userHandle; @end Only members that can assist users to make a decision are exposed to UI clients. * Shared/API/APIObject.h: * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * Sources.txt: * SourcesCocoa.txt: * UIProcess/API/APIWebAuthenticationAssertionResponse.cpp: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h. (API::WebAuthenticationAssertionResponse::create): (API::WebAuthenticationAssertionResponse::WebAuthenticationAssertionResponse): * UIProcess/API/APIWebAuthenticationAssertionResponse.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h. * UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponse.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h. * UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponse.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h. (-[_WKWebAuthenticationAssertionResponse dealloc]): (-[_WKWebAuthenticationAssertionResponse name]): (-[_WKWebAuthenticationAssertionResponse displayName]): (-[_WKWebAuthenticationAssertionResponse userHandle]): (-[_WKWebAuthenticationAssertionResponse _apiObject]): * UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponseInternal.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h. * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h: * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h: * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm: (WebKit::WebAuthenticationPanelClient::WebAuthenticationPanelClient): (WebKit::WebAuthenticationPanelClient::selectAssertionResponses const): * WebKit.xcodeproj/project.pbxproj: 2020-01-14 Luming Yin Update API availability for autoplay event https://bugs.webkit.org/show_bug.cgi?id=202214 Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Make enums and WKUIDelegate method related to autoplay event available on iOS. * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::toWKAutoplayEventFlags): (WebKit::toWKAutoplayEvent): (WebKit::UIDelegate::UIClient::handleAutoplayEvent): Make delegate methods related to autoplay events available on iOS. 2020-01-14 Tim Horton REGRESSION (r253394): After swiping back during a navigation, WKWebView gets stuck with the forward content, stops repainting https://bugs.webkit.org/show_bug.cgi?id=206268 Reviewed by Simon Fraser. * UIProcess/ViewGestureController.cpp: (WebKit::ViewGestureController::endSwipeGesture): * UIProcess/ViewGestureController.h: * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::endSwipeGesture): (WebKit::ViewGestureController::removeSwipeSnapshot): * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::removeSwipeSnapshot): After r253394, we start loading the destination page in willEndSwipeGesture, when we know the gesture will complete, instead of in endSwipeGesture, when it is actually done. This means that if we decide that we should tear down the snapshot immediately, this can now happen in the window between willEndSwipeGesture and endSwipeGesture. However, removeSwipeSnapshot has numerous dependencies on endSwipeGesture (especially on iOS, where there are /also/ dependencies in the other direction - endSwipeGesture will never be called after removeSwipeSnapshot because of the gestureID mismatch). Regardless, it does not make sense to remove the snapshot while the animation is still running. So, if something causes removeSwipeSnapshot to be called before endSwipeGesture, we just set a bit and call it inside endSwipeGesture instead. This ends up putting the snapshot removal ordering back as it was before r253394. 2020-01-14 Per Arne Vollan REGRESSION(iOS 13): createMediaElementSource not working https://bugs.webkit.org/show_bug.cgi?id=203435 Reviewed by David Kilzer. The WebContent process is missing an entitlement according to logs. * Scripts/process-entitlements.sh: 2020-01-14 Brent Fulgham Expand WebContent process sandbox with additional syscall https://bugs.webkit.org/show_bug.cgi?id=206260 Reviewed by Per Arne Vollan. Testing shows that we will improve performance on some platforms by supporting an additional Syscall. This patch revises our sandboxes so that WebKit can use this fast path if available. No new tests. No change in test result behavior. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * WebProcess/com.apple.WebProcess.sb.in: 2020-01-14 Commit Queue Unreviewed, rolling out r254533 and r254535. https://bugs.webkit.org/show_bug.cgi?id=206263 Breaks iOS and macOS builds (Requested by ryanhaddad on #webkit). Reverted changesets: "[WebAuthn] Implement SPI to tell UI clients to select assertion responses" https://bugs.webkit.org/show_bug.cgi?id=206112 https://trac.webkit.org/changeset/254533 "Unreviewed, a build fix after r254533" https://trac.webkit.org/changeset/254535 2020-01-14 Wenson Hsieh [iOS] Keyboard input is severely delayed after switching away from unresponsive tab https://bugs.webkit.org/show_bug.cgi?id=206242 Reviewed by Tim Horton. UIKit delivers key events to WKWebView using asynchronous SPI (-handleKeyWebEvent:withCompletionHandler:). The completion handler is invoked when the web page has processed the event, and determines whether to proceed with default behavior via the `BOOL handled` argument. Using UIKeyboardImpl's UIKeyboardTaskQueue, UIKit appends subsequent key events to a queue, to be processed by the current first responder after the current key event has been handled. In the scenario where the web page is completely unresponsive, this means key events that come after an event that has been dispatched to the unresponsive page will be stuck in the task queue; this manifests in behaviors similar to the one in this bug: - Using a hardware keyboard, press any key in an unresponsive page in Safari. - Press CMD+T (to create a new tab and focus the unified field) or CMT+L (to just focus the unified field). - Try to type in the unified field. The result is that no characters are inserted in the unified field, because the hardware key events are stuck in UIKeyboardTaskQueue waiting for the unresponsive page to finish handling the current key event. To fix this, we introduce a mechanism for invoking the key event handler on WKContentView before the web page has actually finished processing the event, but only in the case where the web view has resigned first responder (and therefore won't receive subsequent key events anyways). Tests: KeyboardInputTests.ResigningFirstResponderCancelsKeyEvents KeyboardInputTests.WaitForKeyEventHandlerInFirstResponder * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::hasQueuedKeyEvent const): (WebKit::WebPageProxy::firstQueuedKeyEvent const): * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView resignFirstResponderForWebView]): After the content view has resigned first responder with a pending key event handler (and if it did not immediately become first responder again in the same runloop), then invoke the key event handler early, passing in `YES` for `handled` to prevent any default actions such as text insertion from being dispatched to the view. 2020-01-14 Jiewen Tan Unreviewed, a build fix after r254533 * UIProcess/WebAuthentication/fido/FidoAuthenticator.cpp: 2020-01-10 Jiewen Tan [WebAuthn] Implement SPI to tell UI clients to select assertion responses https://bugs.webkit.org/show_bug.cgi?id=206112 Reviewed by Alex Christensen. Covered by API tests. This patch adds a new delegate method in _WKWebAuthenticationPanelDelegate to tell UI clients to select an assertion response when multiple are returned from an authenticator. Here is the SPI: @protocol _WKWebAuthenticationPanelDelegate @optional ... - (void)panel:(_WKWebAuthenticationPanel *)panel selectAssertionResponse:(NSArray < _WKWebAuthenticationAssertionResponse *> *)responses completionHandler:(void (^)(_WKWebAuthenticationAssertionResponse *))completionHandler; ... @end A new interface is introduced to represent an authenticator assertion response: @interface _WKWebAuthenticationAssertionResponse : NSObject @property (nonatomic, readonly, copy) NSString *name; @property (nonatomic, readonly, copy) NSString *displayName; @property (nonatomic, readonly, copy) NSData *userHandle; @end Only members that can assist users to make a decision are exposed to UI clients. * Shared/API/APIObject.h: * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * Sources.txt: * SourcesCocoa.txt: * UIProcess/API/APIWebAuthenticationAssertionResponse.cpp: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h. (API::WebAuthenticationAssertionResponse::create): (API::WebAuthenticationAssertionResponse::WebAuthenticationAssertionResponse): * UIProcess/API/APIWebAuthenticationAssertionResponse.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h. * UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponse.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h. * UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponse.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h. (-[_WKWebAuthenticationAssertionResponse dealloc]): (-[_WKWebAuthenticationAssertionResponse name]): (-[_WKWebAuthenticationAssertionResponse displayName]): (-[_WKWebAuthenticationAssertionResponse userHandle]): (-[_WKWebAuthenticationAssertionResponse _apiObject]): * UIProcess/API/Cocoa/_WKWebAuthenticationAssertionResponseInternal.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h. * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h: * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h: * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm: (WebKit::WebAuthenticationPanelClient::WebAuthenticationPanelClient): (WebKit::WebAuthenticationPanelClient::selectAssertionResponses const): * WebKit.xcodeproj/project.pbxproj: 2020-01-14 Ross Kirsling WebPasteboardProxyWPE should be WebPasteboardProxyLibWPE https://bugs.webkit.org/show_bug.cgi?id=206243 Reviewed by Adrian Perez de Castro. WebPasteboardProxy.h already has USE(LIBWPE) so we basically just need to move the file. * SourcesWPE.txt: * UIProcess/WebPasteboardProxy.cpp: * UIProcess/libwpe/WebPasteboardProxyLibWPE.cpp: Renamed from Source/WebKit/UIProcess/wpe/WebPasteboardProxyWPE.cpp. 2020-01-14 Eric Carlson Make MediaPlayerPrivateRemoteProxy a message receiver https://bugs.webkit.org/show_bug.cgi?id=206237 Reviewed by Youenn Fablet. No new tests, no functional change. Make MediaPlayerPrivateRemoteProxy a message receiver so we don't need a trampoline for every method in the MediaPlayerPrivateRemoteManagerProxy. * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::didReceiveMessage): * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: (WebKit::RemoteMediaPlayerManagerProxy::didReceivePlayerMessage): (WebKit::RemoteMediaPlayerManagerProxy::prepareForPlayback): Deleted. (WebKit::RemoteMediaPlayerManagerProxy::load): Deleted. (WebKit::RemoteMediaPlayerManagerProxy::cancelLoad): Deleted. (WebKit::RemoteMediaPlayerManagerProxy::prepareToPlay): Deleted. (WebKit::RemoteMediaPlayerManagerProxy::play): Deleted. (WebKit::RemoteMediaPlayerManagerProxy::pause): Deleted. (WebKit::RemoteMediaPlayerManagerProxy::seek): Deleted. (WebKit::RemoteMediaPlayerManagerProxy::seekWithTolerance): Deleted. (WebKit::RemoteMediaPlayerManagerProxy::setVolume): Deleted. (WebKit::RemoteMediaPlayerManagerProxy::setMuted): Deleted. (WebKit::RemoteMediaPlayerManagerProxy::setPreload): Deleted. (WebKit::RemoteMediaPlayerManagerProxy::setPrivateBrowsingMode): Deleted. (WebKit::RemoteMediaPlayerManagerProxy::setPreservesPitch): Deleted. (WebKit::RemoteMediaPlayerManagerProxy::prepareForRendering): Deleted. (WebKit::RemoteMediaPlayerManagerProxy::setSize): Deleted. (WebKit::RemoteMediaPlayerManagerProxy::setVisible): Deleted. (WebKit::RemoteMediaPlayerManagerProxy::setShouldMaintainAspectRatio): Deleted. (WebKit::RemoteMediaPlayerManagerProxy::setVideoFullscreenFrame): Deleted. (WebKit::RemoteMediaPlayerManagerProxy::setVideoFullscreenGravity): Deleted. (WebKit::RemoteMediaPlayerManagerProxy::acceleratedRenderingStateChanged): Deleted. (WebKit::RemoteMediaPlayerManagerProxy::setShouldDisableSleep): Deleted. (WebKit::RemoteMediaPlayerManagerProxy::setRate): Deleted. (WebKit::RemoteMediaPlayerManagerProxy::audioTrackSetEnabled): Deleted. (WebKit::RemoteMediaPlayerManagerProxy::videoTrackSetSelected): Deleted. * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in: * GPUProcess/media/RemoteMediaPlayerProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/media/AudioTrackPrivateRemote.cpp: (WebKit::AudioTrackPrivateRemote::setEnabled): * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::prepareForPlayback): (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote::load): (WebKit::MediaPlayerPrivateRemote::cancelLoad): (WebKit::MediaPlayerPrivateRemote::prepareToPlay): (WebKit::MediaPlayerPrivateRemote::play): (WebKit::MediaPlayerPrivateRemote::pause): (WebKit::MediaPlayerPrivateRemote::setPreservesPitch): (WebKit::MediaPlayerPrivateRemote::setVolumeDouble): (WebKit::MediaPlayerPrivateRemote::setMuted): (WebKit::MediaPlayerPrivateRemote::setPreload): (WebKit::MediaPlayerPrivateRemote::setPrivateBrowsingMode): (WebKit::MediaPlayerPrivateRemote::seek): (WebKit::MediaPlayerPrivateRemote::seekWithTolerance): (WebKit::MediaPlayerPrivateRemote::prepareForRendering): (WebKit::MediaPlayerPrivateRemote::setSize): (WebKit::MediaPlayerPrivateRemote::setVisible): (WebKit::MediaPlayerPrivateRemote::setShouldMaintainAspectRatio): (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenFrame): (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenGravity): (WebKit::MediaPlayerPrivateRemote::acceleratedRenderingStateChanged): (WebKit::MediaPlayerPrivateRemote::setShouldDisableSleep): * WebProcess/GPU/media/VideoTrackPrivateRemote.cpp: (WebKit::VideoTrackPrivateRemote::setSelected): 2020-01-14 Don Olmstead Share TextChecker stub for ports without text checking https://bugs.webkit.org/show_bug.cgi?id=205964 Reviewed by Ross Kirsling. No new tests. No change in behavior. The Windows and WPE ports have the same stub for text checking. Combine those two for non-Cocoa and non-GTK ports. * PlatformFTW.cmake: * PlatformWin.cmake: * Sources.txt: * SourcesWPE.txt: * UIProcess/TextChecker.cpp: Renamed from Source/WebKit/UIProcess/wpe/TextCheckerWPE.cpp. (WebKit::checkerState): (WebKit::TextChecker::state): (WebKit::TextChecker::checkTextOfParagraph): * UIProcess/win/TextCheckerWin.cpp: Removed. * WebKit.xcodeproj/project.pbxproj: 2020-01-14 Ryan Haddad Unreviewed, rolling out r254505. Breaks watchOS/tvOS/Catalyst builds. Reverted changeset: "Add support for MediaStream audio track rendering in GPUProcess" https://bugs.webkit.org/show_bug.cgi?id=206175 https://trac.webkit.org/changeset/254505 2020-01-14 Víctor Manuel Jáquez Leal Suppress compiler warnings https://bugs.webkit.org/show_bug.cgi?id=206235 Reviewed by Youenn Fablet. Use PRIu64 formatter for uint64_t instead of %llu. No functional changes. * UIProcess/WebPageProxy.cpp: 2020-01-13 Darin Adler Use even more "shortest form" formatting, and less "fixed precision" and "fixed width" https://bugs.webkit.org/show_bug.cgi?id=198918 Reviewed by Sam Weinig. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::dumpContentsToFile): Use shortest instead of fixed. Also use makeString instead of StringBuilder. * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::asJSON const): Use shortest instead of fixed. Also use multiple-argument append on StringBuilder to make the function shorter and easier to read. * Shared/Gamepad/GamepadData.cpp: (WebKit::GamepadData::loggingString const): Ditto. * UIProcess/ViewGestureController.cpp: (WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog): Use shortest instead of fixed. 2020-01-14 Víctor Manuel Jáquez Leal [GLib] Remove unused private variable https://bugs.webkit.org/show_bug.cgi?id=206232 Reviewed by Carlos Garcia Campos. Remove m_context which is not used. No functional changes. * UIProcess/API/glib/WebKitProtocolHandler.cpp: (WebKit::WebKitProtocolHandler::WebKitProtocolHandler): * UIProcess/API/glib/WebKitProtocolHandler.h: 2020-01-14 youenn fablet Add support for MediaStream audio track rendering in GPUProcess https://bugs.webkit.org/show_bug.cgi?id=206175 Reviewed by Eric Carlson. Implement an AudioMediaStreamTrackRenderer at WebKit level by creating a remote renderer in GPUProcess and sending IPC to pass audio data as well as orders (start/stop/setMuted). Implement the remote renderer using WebCore audio track renderer. Enable WebKit remote renderer F GPU process for media is enabled. * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::audioTrackRendererManager): (WebKit::GPUConnectionToWebProcess::didReceiveMessage): * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.cpp: Added. (WebKit::nextLogIdentifier): (WebKit::nullLogger): (WebKit::RemoteAudioMediaStreamTrackRenderer::RemoteAudioMediaStreamTrackRenderer): (WebKit::RemoteAudioMediaStreamTrackRenderer::~RemoteAudioMediaStreamTrackRenderer): (WebKit::RemoteAudioMediaStreamTrackRenderer::storage): (WebKit::RemoteAudioMediaStreamTrackRenderer::start): (WebKit::RemoteAudioMediaStreamTrackRenderer::stop): (WebKit::RemoteAudioMediaStreamTrackRenderer::clear): (WebKit::RemoteAudioMediaStreamTrackRenderer::setMuted): (WebKit::RemoteAudioMediaStreamTrackRenderer::setVolume): (WebKit::RemoteAudioMediaStreamTrackRenderer::audioSamplesStorageChanged): (WebKit::RemoteAudioMediaStreamTrackRenderer::audioSamplesAvailable): * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.h: Added. * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRenderer.messages.in: Added. * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager.cpp: Added. (WebKit::RemoteAudioMediaStreamTrackRendererManager::didReceiveRendererMessage): (WebKit::RemoteAudioMediaStreamTrackRendererManager::createRenderer): (WebKit::RemoteAudioMediaStreamTrackRendererManager::releaseRenderer): * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager.h: Added. (WebKit::RemoteAudioMediaStreamTrackRendererManager::didReceiveMessageFromWebProcess): * GPUProcess/webrtc/RemoteAudioMediaStreamTrackRendererManager.messages.in: Added. * Scripts/webkit/messages.py: * Sources.txt: * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::updatePreferences): * WebProcess/GPU/webrtc/AudioMediaStreamTrackRenderer.cpp: Added. (WebKit::AudioMediaStreamTrackRenderer::create): (WebKit::AudioMediaStreamTrackRenderer::AudioMediaStreamTrackRenderer): (WebKit::AudioMediaStreamTrackRenderer::~AudioMediaStreamTrackRenderer): (WebKit::AudioMediaStreamTrackRenderer::start): (WebKit::AudioMediaStreamTrackRenderer::stop): (WebKit::AudioMediaStreamTrackRenderer::clear): (WebKit::AudioMediaStreamTrackRenderer::setMuted): (WebKit::AudioMediaStreamTrackRenderer::setVolume): (WebKit::AudioMediaStreamTrackRenderer::pushSamples): (WebKit::AudioMediaStreamTrackRenderer::storageChanged): * WebProcess/GPU/webrtc/AudioMediaStreamTrackRenderer.h: Added. (WebKit::AudioMediaStreamTrackRenderer::identifier const): * WebProcess/GPU/webrtc/AudioMediaStreamTrackRendererIdentifier.h: Added. 2020-01-14 youenn fablet CacheStorage::Engine::clearCachesForOriginFromDisk ASSERT is buggy https://bugs.webkit.org/show_bug.cgi?id=206057 Reviewed by John Wilander. The ASSERT is only valid if the engine is initialized. It is not needed to initialize it if the plan is to remove all disk files. Instead, update ASSERT to check that either m_salt is not there or the salt is there and the path is as expected. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::clearCachesForOriginFromDirectories): 2020-01-14 Eric Carlson Expose video tracks for media files in the GPUProcess https://bugs.webkit.org/show_bug.cgi?id=206209 Reviewed by Jer Noble. * GPUProcess/media/RemoteAudioTrackProxy.cpp: (WebKit::RemoteAudioTrackProxy::configuration): * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: (WebKit::RemoteMediaPlayerManagerProxy::videoTrackSetSelected): * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in: * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidAddVideoTrack): (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidRemoveVideoTrack): (WebKit::RemoteMediaPlayerProxy::videoTrackSetSelected): * GPUProcess/media/RemoteMediaPlayerProxy.h: * GPUProcess/media/RemoteVideoTrackProxy.cpp: Copied from Source/WebKit/GPUProcess/media/RemoteAudioTrackProxy.cpp. (WebKit::RemoteVideoTrackProxy::RemoteVideoTrackProxy): (WebKit::RemoteVideoTrackProxy::configuration): (WebKit::RemoteVideoTrackProxy::configurationChanged): (WebKit::RemoteVideoTrackProxy::willRemove): (WebKit::RemoteVideoTrackProxy::selectedChanged): (WebKit::RemoteVideoTrackProxy::idChanged): (WebKit::RemoteVideoTrackProxy::labelChanged): (WebKit::RemoteVideoTrackProxy::languageChanged): * GPUProcess/media/RemoteVideoTrackProxy.h: Added. * GPUProcess/media/TrackPrivateRemoteConfiguration.h: (WebKit::TrackPrivateRemoteConfiguration::encode const): (WebKit::TrackPrivateRemoteConfiguration::decode): * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::clearCachesForOriginFromDirectories): * Sources.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/media/AudioTrackPrivateRemote.cpp: (WebKit::AudioTrackPrivateRemote::updateConfiguration): * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::addRemoteVideoTrack): (WebKit::MediaPlayerPrivateRemote::removeRemoteVideoTrack): (WebKit::MediaPlayerPrivateRemote::remoteVideoTrackConfigurationChanged): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::addRemoteVideoTrack): (WebKit::RemoteMediaPlayerManager::removeRemoteVideoTrack): (WebKit::RemoteMediaPlayerManager::remoteVideoTrackConfigurationChanged): * WebProcess/GPU/media/RemoteMediaPlayerManager.h: * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in: * WebProcess/GPU/media/RemoteVideoTrackProxy.cpp: Copied from Source/WebKit/GPUProcess/media/RemoteAudioTrackProxy.cpp. (WebKit::RemoteVideoTrackProxy::RemoteVideoTrackProxy): (WebKit::RemoteVideoTrackProxy::configuration): (WebKit::RemoteVideoTrackProxy::configurationChanged): (WebKit::RemoteVideoTrackProxy::willRemove): (WebKit::RemoteVideoTrackProxy::selectedChanged): (WebKit::RemoteVideoTrackProxy::idChanged): (WebKit::RemoteVideoTrackProxy::labelChanged): (WebKit::RemoteVideoTrackProxy::languageChanged): * WebProcess/GPU/media/RemoteVideoTrackProxy.h: Added. * WebProcess/GPU/media/VideoTrackPrivateRemote.cpp: Copied from Source/WebKit/WebProcess/GPU/media/AudioTrackPrivateRemote.cpp. (WebKit::VideoTrackPrivateRemote::VideoTrackPrivateRemote): (WebKit::VideoTrackPrivateRemote::setSelected): (WebKit::VideoTrackPrivateRemote::updateConfiguration): * WebProcess/GPU/media/VideoTrackPrivateRemote.h: Added. (WebKit::VideoTrackPrivateRemote::create): 2020-01-13 Don Olmstead [WebAuthn] Support CTAP Client Pin https://bugs.webkit.org/show_bug.cgi?id=191516 Unreviewed build fix after r254439. CryptoKeyEC was forward declared into WebCore but the namespace was not used in continueGetPinTokenAfterRequestPin. Looks like something in the unified sources was covering this issue. * UIProcess/WebAuthentication/fido/CtapAuthenticator.h: 2020-01-13 Ross Kirsling Expose Phase on all WebWheelEvent implementations https://bugs.webkit.org/show_bug.cgi?id=206195 Reviewed by Don Olmstead. No change to behavior; just unhide what needn't be hidden. * Shared/WebEvent.h: (WebKit::WebWheelEvent::directionInvertedFromDevice const): (WebKit::WebWheelEvent::momentumPhase const): * Shared/WebWheelEvent.cpp: (WebKit::WebWheelEvent::WebWheelEvent): 2020-01-13 Don Olmstead Share WebPreferences stub for ports without an implementation https://bugs.webkit.org/show_bug.cgi?id=206186 Reviewed by Alex Christensen. No new tests. No change in behavior. Moved the platform agnostic stubs that were common in the GTK, WPE and Windows ports into WebPreferences.cpp. Only Cocoa ports are implementing the platform specific parts of WebPreferences. Also moving WebPreferencesMac.mm to WebPreferencesCocoa.mm. There were no platform guards for iOS family code and there was no iOS specific implementation. * PlatformFTW.cmake: * PlatformWin.cmake: * SourcesCocoa.txt: * SourcesWPE.txt: * UIProcess/Cocoa/WebPreferencesCocoa.mm: Renamed from Source/WebKit/UIProcess/mac/WebPreferencesMac.mm. * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::platformInitializeStore): (WebKit::WebPreferences::platformUpdateStringValueForKey): (WebKit::WebPreferences::platformUpdateBoolValueForKey): (WebKit::WebPreferences::platformUpdateUInt32ValueForKey): (WebKit::WebPreferences::platformUpdateDoubleValueForKey): (WebKit::WebPreferences::platformUpdateFloatValueForKey): (WebKit::WebPreferences::platformDeleteKey): (WebKit::WebPreferences::platformGetStringUserValueForKey): (WebKit::WebPreferences::platformGetBoolUserValueForKey): (WebKit::WebPreferences::platformGetUInt32UserValueForKey): (WebKit::WebPreferences::platformGetDoubleUserValueForKey): * UIProcess/gtk/WebPreferencesGtk.cpp: (WebKit::WebPreferences::platformUpdateStringValueForKey): Deleted. (WebKit::WebPreferences::platformUpdateBoolValueForKey): Deleted. (WebKit::WebPreferences::platformUpdateUInt32ValueForKey): Deleted. (WebKit::WebPreferences::platformUpdateDoubleValueForKey): Deleted. (WebKit::WebPreferences::platformUpdateFloatValueForKey): Deleted. (WebKit::WebPreferences::platformDeleteKey): Deleted. (WebKit::WebPreferences::platformGetStringUserValueForKey): Deleted. (WebKit::WebPreferences::platformGetBoolUserValueForKey): Deleted. (WebKit::WebPreferences::platformGetUInt32UserValueForKey): Deleted. (WebKit::WebPreferences::platformGetDoubleUserValueForKey): Deleted. * UIProcess/win/WebPreferencesWin.cpp: Removed. * UIProcess/wpe/WebPreferencesWPE.cpp: Removed. * WebKit.xcodeproj/project.pbxproj: 2020-01-13 Keith Rollin Reformat WebProcessPool logging https://bugs.webkit.org/show_bug.cgi?id=205882 Reviewed by Brent Fulgham. Update the format used by WebProcessPool in its RELEASE_LOG logging. Use the format used by WebPageProxy and NetworkResourceLoader, which is generally of the form: - [] ::: So, for example: Using prewarmed process 0 becomes: 0x7f81e8804008 - WebProcessPool::processForRegistrableDomain: Using prewarmed process (process=0x1471c2a00, PID=64197) No new tests - no added or changed functionality. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::applicationIsAboutToSuspend): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess): (WebKit::WebProcessPool::tryTakePrewarmedProcess): (WebKit::WebProcessPool::prewarmProcess): (WebKit::WebProcessPool::processForRegistrableDomain): (WebKit::WebProcessPool::didReachGoodTimeToPrewarm): (WebKit::WebProcessPool::handleMemoryPressureWarning): (WebKit::WebProcessPool::processForNavigation): (WebKit::WebProcessPool::processForNavigationInternal): (WebKit::WebProcessPool::setWebProcessHasUploads): (WebKit::WebProcessPool::clearWebProcessHasUploads): (WebKit::WebProcessPool::setWebProcessIsPlayingAudibleMedia): (WebKit::WebProcessPool::clearWebProcessIsPlayingAudibleMedia): (WebKit::WebProcessPool::setUseSeparateServiceWorkerProcess): 2020-01-13 Kate Cheney _WKResourceLoadStatisticsFirstParty should be forward declared not imported in _WKResourceLoadStatisticsThirdParty https://bugs.webkit.org/show_bug.cgi?id=206183 Reviewed by Alex Christensen. * UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.h: * UIProcess/API/Cocoa/_WKResourceLoadStatisticsThirdParty.h: * UIProcess/API/Cocoa/_WKResourceLoadStatisticsThirdParty.mm: The additional import statement here was unnecessary because this file imports _WKResourceLoadStatisticsThirdPartyInternal.h which forward declares the _WKResourceLoadStatisticsFirstParty class. 2020-01-13 Kate Cheney Unreviewed followup fix to: https://bugs.webkit.org/show_bug.cgi?id=205288. This flag should be off-by-default. * Shared/WebPreferences.yaml: 2020-01-13 Alex Christensen Propogate UIEdgeInsets from WKWebView to WKSafeBrowsingWarning on iOS https://bugs.webkit.org/show_bug.cgi?id=206201 Reviewed by Tim Horton. Manually verified this fixes the radar. * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _computedObscuredInsetForSafeBrowsingWarning]): (-[WKWebView safeAreaInsetsDidChange]): (-[WKWebView _setObscuredInsets:]): 2020-01-13 Eric Carlson Expose audio tracks for media files in the GPUProcess https://bugs.webkit.org/show_bug.cgi?id=206152 Reviewed by youenn fablet. * GPUProcess/media/RemoteAudioTrackProxy.cpp: Added. (WebKit::RemoteAudioTrackProxy::RemoteAudioTrackProxy): (WebKit::RemoteAudioTrackProxy::configuration): (WebKit::RemoteAudioTrackProxy::configurationChanged): (WebKit::RemoteAudioTrackProxy::willRemove): (WebKit::RemoteAudioTrackProxy::enabledChanged): (WebKit::RemoteAudioTrackProxy::idChanged): (WebKit::RemoteAudioTrackProxy::labelChanged): (WebKit::RemoteAudioTrackProxy::languageChanged): * GPUProcess/media/RemoteAudioTrackProxy.h: Added. * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: (WebKit::RemoteMediaPlayerManagerProxy::setRate): (WebKit::RemoteMediaPlayerManagerProxy::audioTrackSetEnabled): * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in: * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidAddAudioTrack): (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidRemoveAudioTrack): (WebKit::RemoteMediaPlayerProxy::audioTrackSetEnabled): * GPUProcess/media/RemoteMediaPlayerProxy.h: * GPUProcess/media/TrackPrivateRemoteConfiguration.h: Added. (WebKit::TrackPrivateRemoteConfiguration::encode const): (WebKit::TrackPrivateRemoteConfiguration::decode): * GPUProcess/media/TrackPrivateRemoteIdentifier.h: Added. * Scripts/webkit/messages.py: * Sources.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/media/AudioTrackPrivateRemote.cpp: Added. (WebKit::AudioTrackPrivateRemote::AudioTrackPrivateRemote): (WebKit::AudioTrackPrivateRemote::setEnabled): (WebKit::AudioTrackPrivateRemote::updateConfiguration): * WebProcess/GPU/media/AudioTrackPrivateRemote.h: Added. (WebKit::AudioTrackPrivateRemote::create): * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::addRemoteAudioTrack): (WebKit::MediaPlayerPrivateRemote::removeRemoteAudioTrack): (WebKit::MediaPlayerPrivateRemote::remoteAudioTrackConfigurationChanged): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::timeChanged): (WebKit::RemoteMediaPlayerManager::durationChanged): (WebKit::RemoteMediaPlayerManager::engineFailedToLoad): (WebKit::RemoteMediaPlayerManager::characteristicChanged): (WebKit::RemoteMediaPlayerManager::sizeChanged): (WebKit::RemoteMediaPlayerManager::addRemoteAudioTrack): (WebKit::RemoteMediaPlayerManager::removeRemoteAudioTrack): (WebKit::RemoteMediaPlayerManager::remoteAudioTrackConfigurationChanged): (WebKit::RemoteMediaPlayerManager::updateCachedState): * WebProcess/GPU/media/RemoteMediaPlayerManager.h: * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in: * WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp: 2020-01-06 Jiewen Tan [WebAuthn] Support CTAP Client Pin https://bugs.webkit.org/show_bug.cgi?id=191516 Reviewed by Brent Fulgham. This patch implements authenticatorClientPIN from the spec: https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#authenticatorClientPIN Specifically, it implements section 5.5.1, 5.5.3, 5.5.4, 5.5.7, and 5.5.8. Here is the flow how makeCredential/getAssertion works with a PIN in our implementation: 1. Determine if the connected authenticator has a PIN; 2. If yes, send the makeCredential/getAssertion request to the authenticator with an empty pinAuth such that the authenticator will wink for user gestures. This step intends to confirm the authenticator is the one the user wants to use. Otherwise, we don't know which authenticator to send the PIN if multiple are connected; 3. Once the user confirms the authetnicator, it will return either CTAP2_ERR_PIN_INVALID or CTAP2_ERR_PIN_AUTH_INVALID. Some authenticators return CTAP2_ERR_PIN_AUTH_INVALID even though it is not suggested by the spec; 4. Get retries from the authenticator; 5. Get key agreement from the authenticator; 6. Ask the UI client for the PIN and at the meantime inform it the retries; 7. Get pin token from the authenticator; 8. Resend the makeCredential/getAssertion request with the desired pinAuth. Besides implementating the above flow, this patch also fixes some bugs within the PIN commands encoder: 1. pinAuth/pinProtocol are wrongly encoded for makeCredential/getAssertion; 2. AES CBC should be called without any padding. Therefore, CryptoAlgorithmAES_CBC adds a no padding mode; 3. The sharedSecret is the SHA256 digest of the ECDH key agreement instead of the raw key agreement. * UIProcess/API/APIWebAuthenticationPanelClient.h: (API::WebAuthenticationPanelClient::requestPin const): * UIProcess/WebAuthentication/Authenticator.h: * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManager::requestPin): * UIProcess/WebAuthentication/AuthenticatorManager.h: * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h: * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm: (WebKit::WebAuthenticationPanelClient::WebAuthenticationPanelClient): (WebKit::WebAuthenticationPanelClient::requestPin const): * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp: (WebKit::MockHidConnection::feedReports): * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp: (WebKit::CtapAuthenticator::makeCredential): (WebKit::CtapAuthenticator::continueMakeCredentialAfterResponseReceived): (WebKit::CtapAuthenticator::getAssertion): (WebKit::CtapAuthenticator::continueGetAssertionAfterResponseReceived): (WebKit::CtapAuthenticator::getRetries): (WebKit::CtapAuthenticator::continueGetKeyAgreementAfterGetRetries): (WebKit::CtapAuthenticator::continueRequestPinAfterGetKeyAgreement): (WebKit::CtapAuthenticator::continueGetPinTokenAfterRequestPin): (WebKit::CtapAuthenticator::continueRequestAfterGetPinToken): (WebKit::CtapAuthenticator::continueMakeCredentialAfterResponseReceived const): Deleted. * UIProcess/WebAuthentication/fido/CtapAuthenticator.h: 2020-01-13 Brent Fulgham [iOS] Remove 'com.apple.diagnosticd' from WebContent process sandbox https://bugs.webkit.org/show_bug.cgi?id=206114 Reviewed by Per Arne Vollan. In Bug 205292 we began dynamically adding a sandbox extension for 'com.apple.diagnosticd' when needed. We should remove the blanket permission from the sandbox. Test: fast/sandbox/ios/sandbox-mach-lookup.html * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2020-01-12 Wenson Hsieh [macCatalyst] UI process crashes on launch after r254101 https://bugs.webkit.org/show_bug.cgi?id=206156 Reviewed by Brent Fulgham. Fixes the crash by not soft-linking BackBoardServices in an attempt to invoke BKSDisplayBrightnessGetCurrent on macCatalyst. Prior to r254101, this was only defined on iOS and not watchOS or tvOS; after this change, it should be defined only on iOS, watchOS and tvOS. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::registerNotificationObservers): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): * UIProcess/WebProcessPool.h: * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: * WebProcess/cocoa/WebProcessCocoa.mm: 2020-01-13 Antti Koivisto [LFC][Integration] Enable LFC integration https://bugs.webkit.org/show_bug.cgi?id=206128 Reviewed by Zalan Bujtas. * Shared/WebPreferences.yaml: 2020-01-13 Carlos Garcia Campos WebDriver: pressed virtual keys not correctly handled in action sequences https://bugs.webkit.org/show_bug.cgi?id=205997 Reviewed by Brian Burg. When modifiers are present we need to translate the keys that might be affected by the modifiers. * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: (WebKit::doKeyStrokeEvent): 2020-01-13 Carlos Garcia Campos Unreviewed. [GTK][WPE] Add missing autocleanup definition for WebKitInputMethodContext I forgot to add it in r253749. * UIProcess/API/gtk/WebKitAutocleanups.h: * UIProcess/API/wpe/WebKitAutocleanups.h: 2020-01-12 Tim Horton Remove CorePDF linkage in WebKit https://bugs.webkit.org/show_bug.cgi?id=206103 Reviewed by Wenson Hsieh. * Configurations/WebKit.xcconfig: 2020-01-11 Alex Christensen Expose frame information on _WKResourceLoadInfo https://bugs.webkit.org/show_bug.cgi?id=206104 Reviewed by Dean Jackson. * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::resourceLoadInfo): * Shared/API/Cocoa/_WKFrameHandle.h: * Shared/API/Cocoa/_WKFrameHandle.mm: (-[_WKFrameHandle frameID]): (-[_WKFrameHandle initWithCoder:]): (-[_WKFrameHandle encodeWithCoder:]): (-[_WKFrameHandle _frameID]): Deleted. * Shared/API/Cocoa/_WKFrameHandleInternal.h: * Shared/ResourceLoadInfo.h: (WebKit::ResourceLoadInfo::encode const): (WebKit::ResourceLoadInfo::decode): * UIProcess/API/APIResourceLoadInfo.h: * UIProcess/API/Cocoa/_WKInspector.mm: (-[_WKInspector showMainResourceForFrame:]): * UIProcess/API/Cocoa/_WKResourceLoadInfo.h: * UIProcess/API/Cocoa/_WKResourceLoadInfo.mm: (-[_WKResourceLoadInfo frame]): (-[_WKResourceLoadInfo parentFrame]): * UIProcess/API/mac/WKWebViewMac.mm: (-[WKWebView _canChangeFrameLayout:]): (-[WKWebView _printOperationWithPrintInfo:forFrame:]): * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm: (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]): * UIProcess/ios/WKContentView.mm: (-[WKContentView _wk_pageCountForPrintFormatter:]): * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::evaluateJavaScriptCallback): * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm: (+[WKWebProcessPlugInFrame lookUpFrameFromHandle:]): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::addParametersFromFrame): (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): (WebKit::WebLoaderStrategy::loadResourceSynchronously): (WebKit::WebLoaderStrategy::startPingLoad): * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::installServiceWorker): 2020-01-11 Kate Cheney Add correct grandfathering functionality to the ITP database backend https://bugs.webkit.org/show_bug.cgi?id=205844 Reviewed by John Wilander. This patch adds functionality for grandfathering statistics upon creation of a new ITP database file. The memory store relies on the presence of the ITP plist to indicate whether the data should be grandfathered. Since the database does not use a plist, this patch adds a boolean variable to track whether the database file previously existed or not to indicate when to grandfather. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::openITPDatabase): * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: The boolean variable m_isNewResourceLoadStatisticDatabaseFile is set to true if the database file did not previously exist, indicating ITP is being used for the first time and data should be grandfathered. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::populateMemoryStoreFromDisk): This is where the grandfathering happens. The call to logTestingEvent is for API testing purposes only. (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): If a scheduleClearInMemoryAndPersistent is called, the plist is deleted, and data will be grandfathered upon recreation. To mimic this, the ITP database store is cleared and becomes "new" again, so the boolean is set to true. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetIsITPDatabaseEnabled): (WKPreferencesGetIsITPDatabaseEnabled): * UIProcess/API/C/WKPreferencesRef.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _isITPDatabaseEnabled]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: In order to properly run the grandfathering API tests, the 'isITPDatabaseEnabled' boolean needs to be exposed from Web Preferences. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: The API tests rely on the ITP database flag being set correctly. Since being on-by-default, the ITP database flag does not show up in the user defaults menu if enabled. This patch fixes this by first checking to see if the value is in the defaults menu, otherwise returning the default preferences value. This ensures the preferences value matches the actual store being initialized. 2020-01-10 Eric Carlson [Media in GPU process] Extend the GPU process sandbox to allow access to local files when necessary https://bugs.webkit.org/show_bug.cgi?id=205967 Reviewed by youenn fablet. No new tests, un-skipped existing tests that pass because of this change. The GPU process sandbox does not allow access to local files so extend it before attempting to open a file:// url, and revoke the extension when the file is closed. * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: (WebKit::RemoteMediaPlayerManagerProxy::load): * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in: * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::invalidate): (WebKit::RemoteMediaPlayerProxy::load): * GPUProcess/media/RemoteMediaPlayerProxy.h: * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::openGPUProcessConnection): * UIProcess/GPU/GPUProcessProxy.h: * UIProcess/WebProcessProxy.cpp: * UIProcess/WebProcessProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/GPUProcessConnection.h: (WebKit::GPUProcessConnection::setAuditToken): (WebKit::GPUProcessConnection::auditToken const): * WebProcess/GPU/GPUProcessConnectionInfo.h: (WebKit::GPUProcessConnectionInfo::encode const): (WebKit::GPUProcessConnectionInfo::decode): * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::prepareForPlayback): (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote::load): (WebKit::MediaPlayerPrivateRemote::cancelLoad): (WebKit::MediaPlayerPrivateRemote::prepareToPlay): (WebKit::MediaPlayerPrivateRemote::play): (WebKit::MediaPlayerPrivateRemote::pause): (WebKit::MediaPlayerPrivateRemote::setPreservesPitch): (WebKit::MediaPlayerPrivateRemote::setVolumeDouble): (WebKit::MediaPlayerPrivateRemote::setMuted): (WebKit::MediaPlayerPrivateRemote::setPreload): (WebKit::MediaPlayerPrivateRemote::setPrivateBrowsingMode): (WebKit::MediaPlayerPrivateRemote::seek): (WebKit::MediaPlayerPrivateRemote::seekWithTolerance): (WebKit::MediaPlayerPrivateRemote::prepareForRendering): (WebKit::MediaPlayerPrivateRemote::setSize): (WebKit::MediaPlayerPrivateRemote::setVisible): (WebKit::MediaPlayerPrivateRemote::setShouldMaintainAspectRatio): (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenFrame): (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenGravity): (WebKit::MediaPlayerPrivateRemote::acceleratedRenderingStateChanged): (WebKit::MediaPlayerPrivateRemote::setShouldDisableSleep): (WebKit::MediaPlayerPrivateRemote::requestResource): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/RemoteMediaPlayerMIMETypeCache.cpp: (WebKit::RemoteMediaPlayerMIMETypeCache::canDecodeExtendedType): (WebKit::RemoteMediaPlayerMIMETypeCache::supportsTypeAndCodecs): (WebKit::RemoteMediaPlayerMIMETypeCache::initializeCache): * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer): (WebKit::RemoteMediaPlayerManager::deleteRemoteMediaPlayer): (WebKit::RemoteMediaPlayerManager::getSupportedTypes): (WebKit::RemoteMediaPlayerManager::originsInMediaCache): (WebKit::RemoteMediaPlayerManager::clearMediaCache): (WebKit::RemoteMediaPlayerManager::clearMediaCacheForOrigins): (WebKit::RemoteMediaPlayerManager::gpuProcessConnection const): * WebProcess/GPU/media/RemoteMediaPlayerManager.h: (WebKit::RemoteMediaPlayerManager::parentProcess const): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::ensureGPUProcessConnection): 2020-01-10 Jer Noble [iOS] Audio from non-frontmost tab continues when app is backgrounded https://bugs.webkit.org/show_bug.cgi?id=206101 Reviewed by Eric Carlson. Tests: WKWebViewPausePlayingAudioTests.InWindow WKWebViewPausePlayingAudioTests.OutOfWindow The ApplicationStateTracker will only send notifications about application state to WebPageProxies when those proxies' views are actually in-window. Add a separate application state observer strictly for media which fires only when application state notifications are received while the view is not in-window. * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView _commonInitializationWithProcessPool:configuration:]): (-[WKContentView _applicationDidEnterBackground:]): (-[WKContentView _applicationWillEnterForeground:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::applicationDidEnterBackgroundForMedia): (WebKit::WebPageProxy::applicationWillEnterForegroundForMedia): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::applicationDidEnterBackgroundForMedia): (WebKit::WebPage::applicationWillEnterForegroundForMedia): 2020-01-10 Simon Fraser Introduce ENABLE_META_VIEWPORT and use it in some WK2 code https://bugs.webkit.org/show_bug.cgi?id=206091 Reviewed by Tim Horton. Use ENABLE(META_VIEWPORT) rather than PLATFORM(IOS_FAMILY) to enable various bits of viewport-related code. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/API/C/WKPage.cpp: (WKPageSetIgnoresViewportScaleLimits): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didCommitLoad): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::viewportConfiguration const): 2020-01-10 Jonathan Bedard Python3: Support Source/WebKit/Scripts/webkit https://bugs.webkit.org/show_bug.cgi?id=206078 Reviewed by Stephanie Lewis. Covered by existing unit tests. * Scripts/webkit/LegacyMessages-expected.h: Sort forward declarations. * Scripts/webkit/Messages-expected.h: Ditto. * Scripts/webkit/messages.py: Sort printed outputs. 2020-01-10 Brent Fulgham [iOS] Remove reporting for some well-understood sandbox rules https://bugs.webkit.org/show_bug.cgi?id=206111 Reviewed by Per Arne Vollan. Remove sandbox rules designed to generate reporting about resource use for some well-understood items that are frequently hit in WebKit use. No new tests. No change in behavior. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2020-01-10 Brent Fulgham [iOS] Remove used media-related mach services from the WebContent process sandbox https://bugs.webkit.org/show_bug.cgi?id=206089 Reviewed by Per Arne Vollan. After conducting multiple test passes and large-scale living-on testing with telemetry, we have confirmed that the following XPC services are not used by the media logic in WebKit, and can be removed: com.apple.coremedia.cpeprotector.xpc com.apple.coremedia.figcontentkeysession.xpc com.apple.coremedia.routingsessionmanager.xpc com.apple.coremedia.sts Test: fast/sandbox/ios/sandbox-mach-lookup.html * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2020-01-10 Brent Fulgham [iOS] Remove 'com.apple.awdd' from the WebContent process sandbox https://bugs.webkit.org/show_bug.cgi?id=206095 Reviewed by Per Arne Vollan. We no longer need access to 'com.apple.awdd' in the iOS WebContent sandbox. We should remove it from the sandbox. Test: fast/sandbox/ios/sandbox-mach-lookup.html * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2020-01-09 Per Arne Vollan Map CSS value ID to system color in the UI process https://bugs.webkit.org/show_bug.cgi?id=204314 Reviewed by Dean Jackson. Create mapping between CSS value IDs and system colors in the UI process and send to the WebContent process on process startup. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2020-01-10 Mark Lam Gardening: simple build fix after r254119. Not reviewed. We should be using ASSERT_ENABLED instead of ASSERT_DSIABLED. * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::sendRequestCallback): 2020-01-10 Brent Fulgham [iOS] Remove 'com.apple.powerlog.plxpclogger.xpc' from the WebContent process sandbox https://bugs.webkit.org/show_bug.cgi?id=206086 Reviewed by Per Arne Vollan. Telemetry and testing have confirmed that we no longer need a mach connection to the 'com.apple.powerlog.plxpclogger.xpc' service. We should remove it from the WebContent process sandbox. Test: fast/sandbox/ios/sandbox-mach-lookup.html * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2020-01-10 Brent Fulgham Remove 'com.apple.iohideventsystem' from the WebContent process sandbox https://bugs.webkit.org/show_bug.cgi?id=206085 Reviewed by Alex Christensen. After r253357 we no longer need access to 'com.apple.iohideventsystem', and should remove it from the WebContent process sandbox. Test: fast/sandbox/ios/sandbox-mach-lookup.html * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2020-01-10 Brent Fulgham [iOS] Remove 'com.apple.cookied' from the WebContent process sandbox https://bugs.webkit.org/show_bug.cgi?id=206083 Reviewed by Per Arne Vollan. Telemetry and testing have confirmed that we no longer use the 'com.apple.cookied' mach connection in the WebContent process on iOS. We should remove this from the WebContent process sandbox Tested by fast/sandbox/ios/sandbox-mach-lookup.html. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2020-01-10 Brent Fulgham Remove com.apple.locationd.registration from the WebContent sandbox https://bugs.webkit.org/show_bug.cgi?id=206021 Reviewed by Per Arne Vollan. Now that we generate a dynamic extension for 'com.apple.locationd.registration', we should remove the blanket allow rule from the sandbox. Test: fast/sandbox/ios/sandbox-mach-lookup.html * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2020-01-10 Simon Fraser Clean up -[WKWebView _didCommitLayerTree:] https://bugs.webkit.org/show_bug.cgi?id=206049 Reviewed by Tim Horton. In preparation for sharing more of this code with macOS, factors parts of -[WKWebView _didCommitLayerTree:] into new functions. Also pull out part of -[WKWebView _updateVisibleContentRects] into its own function. * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _trackTransactionCommit:]): (-[WKWebView _updateScrollViewForTransaction:]): (-[WKWebView _restoreScrollAndZoomStateForTransaction:]): (-[WKWebView _didCommitLayerTree:]): (-[WKWebView _allowsDoubleTapGestures]): (-[WKWebView currentlyVisibleContentInsetsWithScale:obscuredInsets:]): (-[WKWebView _updateVisibleContentRects]): (areEssentiallyEqualAsFloat): Deleted. 2020-01-10 Simon Fraser [macOS UI-side compositing] Introduce WKScrollView and WKContentView for macOS https://bugs.webkit.org/show_bug.cgi?id=206042 Reviewed by Tim Horton. Add WKScrollViewMac and WKWebViewMac, with bare-bones implementations. WKScrollViewMac has a WKScrollViewDelegate to make it more iOS-like, to avoid clients having to register boundsDidChange notifications, and WKWebView on macOS becomes the delegate. These views are only created when UI-side compositing is enabled. * SourcesCocoa.txt: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/mac/WKContentViewMac.h: Added. * UIProcess/API/mac/WKContentViewMac.mm: Added. (-[WKContentView initWithFrame:page:]): (-[WKContentView isFlipped]): (-[WKContentView _setAcceleratedCompositingRootLayer:]): * UIProcess/API/mac/WKScrollViewMac.h: Added. * UIProcess/API/mac/WKScrollViewMac.mm: Added. (+[WKScrollView isCompatibleWithResponsiveScrolling]): (-[WKScrollView initWithFrame:]): (-[WKScrollView dealloc]): (-[WKScrollView delegate]): (-[WKScrollView setDelegate:]): (-[WKScrollView contentOffset]): (-[WKScrollView boundsDidChange:]): (-[WKScrollView setContentInsets:]): * UIProcess/API/mac/WKWebViewMac.h: * UIProcess/API/mac/WKWebViewMac.mm: (-[WKWebView scrollViewDidScroll:]): (-[WKWebView scrollViewContentInsetsDidChange:]): (-[WKWebView _setupScrollAndContentViews]): * UIProcess/ios/WebPageProxyIOS.mm: * WebKit.xcodeproj/project.pbxproj: 2020-01-10 Jiewen Tan [WebAuthn] Support authenticatorGetNextAssertion https://bugs.webkit.org/show_bug.cgi?id=203346 Reviewed by Brent Fulgham. This patch implements authenticatorGetNextAssertion as suggested by the spec: https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#authenticatorGetNextAssertion The work flow is as follow: 1) When a valid assertion response is received, check its numberOfCredentials member; 2) When it is larger then 1, use authenticatorGetNextAssertion to get all remaining responses; 3) Once all responses are gathered, ask UI clients to pick one to return. * UIProcess/API/APIWebAuthenticationPanelClient.h: (API::WebAuthenticationPanelClient::selectAssertionResponses const): * UIProcess/WebAuthentication/Authenticator.h: * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManager::selectAssertionResponses): * UIProcess/WebAuthentication/AuthenticatorManager.h: * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp: (WebKit::MockHidConnection::parseRequest): * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp: (WebKit::CtapAuthenticator::continueGetAssertionAfterResponseReceived): (WebKit::CtapAuthenticator::continueGetNextAssertionAfterResponseReceived): * UIProcess/WebAuthentication/fido/CtapAuthenticator.h: 2020-01-10 Brent Fulgham Remove 'com.apple.nehelper' from the WebContent sandbox. https://bugs.webkit.org/show_bug.cgi?id=206025 Reviewed by Per Arne Vollan. Now that we generate a dynamic extension for 'com.apple.nehelper' and 'com.apple.nesessionmanager.content-filter', we should remove the blanket allow rules from the sandbox. Tests: fast/sandbox/ios/sandbox-mach-lookup.html, fast/sandbox/mac/sandbox-mach-lookup.html * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * WebProcess/com.apple.WebProcess.sb.in: 2020-01-10 Víctor Manuel Jáquez Leal Silence compiler warning https://bugs.webkit.org/show_bug.cgi?id=206070 Reviewed by Chris Dumez. Silence compiler by using the proper formatter for log out. No functional changes. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::didReceiveMessage): 2020-01-10 Alex Christensen Expand _WKResourceLoadDelegate callbacks https://bugs.webkit.org/show_bug.cgi?id=206037 Reviewed by Youenn Fablet. Add 5 informative delegate callbacks at these times during the loading process: 1. When a request is sent. 2. When a redirect happens. 3. When a challenge happens. 4. When a response is received. 5. When loading completes or fails. As mentioned in r254183 these callbacks are only called when a _WKResourceLoadDelegate is given to a WKWebView. We add a new struct ResourceLoadInfo which will need to be expanded containing currently only the load identifier. Covered by new API tests which verify the validity of the sent information. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::didReceiveChallenge): * NetworkProcess/NetworkLoadClient.h: (WebKit::NetworkLoadClient::didReceiveChallenge): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::generateResourceLoadID): (WebKit::NetworkResourceLoader::startNetworkLoad): (WebKit::NetworkResourceLoader::resourceLoadInfo): (WebKit::NetworkResourceLoader::didReceiveResponse): (WebKit::NetworkResourceLoader::didFinishLoading): (WebKit::NetworkResourceLoader::didFailLoading): (WebKit::NetworkResourceLoader::didReceiveChallenge): Add a way to send a message informing that a challenge happened with information gathered from the NetworkResourceLoader, which previously was not informed of challenges because the challenges went directly from the NetworkLoad to the AuthenticationManager. (WebKit::NetworkResourceLoader::willSendRedirectedRequest): (WebKit::NetworkResourceLoader::continueWillSendRequest): (WebKit::m_shouldCaptureExtraNetworkLoadMetrics): Deleted. * NetworkProcess/NetworkResourceLoader.h: * Shared/API/APIObject.h: * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * Shared/ResourceLoadInfo.h: Added. (WebKit::ResourceLoadInfo::encode const): (WebKit::ResourceLoadInfo::decode): * SourcesCocoa.txt: * UIProcess/API/APIResourceLoadClient.h: * UIProcess/API/APIResourceLoadInfo.h: Added. * UIProcess/API/Cocoa/_WKResourceLoadDelegate.h: * UIProcess/API/Cocoa/_WKResourceLoadInfo.h: Added. * UIProcess/API/Cocoa/_WKResourceLoadInfo.mm: Added. (-[_WKResourceLoadInfo dealloc]): (-[_WKResourceLoadInfo resourceLoadID]): (-[_WKResourceLoadInfo _apiObject]): * UIProcess/API/Cocoa/_WKResourceLoadInfoInternal.h: Added. * UIProcess/Authentication/AuthenticationChallengeProxy.cpp: (WebKit::AuthenticationChallengeProxy::AuthenticationChallengeProxy): An AuthenticationChallengeProxy was only used for challenges that needed credentials, so they wrapped a CompletionHandler. This new type of informative-only challenge will be given a null CompletionHandler, which means no action can be taken. * UIProcess/Cocoa/ResourceLoadDelegate.h: * UIProcess/Cocoa/ResourceLoadDelegate.mm: (WebKit::ResourceLoadDelegate::setDelegate): (WebKit::ResourceLoadDelegate::ResourceLoadClient::didSendRequest const): (WebKit::ResourceLoadDelegate::ResourceLoadClient::didPerformHTTPRedirection const): (WebKit::ResourceLoadDelegate::ResourceLoadClient::didReceiveChallenge const): (WebKit::ResourceLoadDelegate::ResourceLoadClient::didReceiveResponse const): (WebKit::ResourceLoadDelegate::ResourceLoadClient::didCompleteWithError const): (WebKit::ResourceLoadDelegate::ResourceLoadClient::willSendRequest const): Deleted. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::resourceLoadDidSendRequest): (WebKit::NetworkProcessProxy::resourceLoadDidPerformHTTPRedirection): (WebKit::NetworkProcessProxy::resourceLoadDidReceiveChallenge): (WebKit::NetworkProcessProxy::resourceLoadDidReceiveResponse): (WebKit::NetworkProcessProxy::resourceLoadDidCompleteWithError): (WebKit::NetworkProcessProxy::pageWillSendRequest): Deleted. * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::loadResourceSynchronously): (WebKit::WebLoaderStrategy::startPingLoad): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::willSendRequest): 2020-01-10 Alex Christensen Add SPI to enable TLS 1.0 and 1.1 in WKWebViews https://bugs.webkit.org/show_bug.cgi?id=206046 Reviewed by Youenn Fablet. This is needed for Covered by API tests. * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration legacyTLSEnabled]): (-[_WKWebsiteDataStoreConfiguration setLegacyTLSEnabled:]): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::copy const): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: (WebKit::WebsiteDataStoreConfiguration::legacyTLSEnabled const): (WebKit::WebsiteDataStoreConfiguration::setLegacyTLSEnabled): 2020-01-10 Brent Fulgham [macOS] Issue sandbox extension to "com.apple.nesessionmanager" prior to 10.15 https://bugs.webkit.org/show_bug.cgi?id=206031 Reviewed by Per Arne Vollan. The mach name of 'com.apple.nesessionmanager' changed between macOS 10.14 and 10.15. We should continue to issue the old name when building for older operating systems." Covered by existing tests. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): 2020-01-10 Alex Christensen Remove WebsiteDataStore::setCacheStorageDirectory which has been replaced by WebsiteDataStoreConfiguration::setCacheStorageDirectory https://bugs.webkit.org/show_bug.cgi?id=205841 Reviewed by Youenn Fablet. * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp: (WKWebsiteDataStoreConfigurationCopyCacheStorageDirectory): (WKWebsiteDataStoreConfigurationSetCacheStorageDirectory): * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _cacheStorageDirectory]): Deleted. (-[WKWebsiteDataStore _setCacheStorageDirectory:]): Deleted. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters): * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::cacheStorageDirectory const): (WebKit::WebsiteDataStore::setCacheStorageDirectory): Deleted. 2020-01-10 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.27.4 release * gtk/NEWS: Add release notes for 2.27.4. 2020-01-10 Carlos Garcia Campos Unreviewed. Fix GTK and WPE API docs generation Fix the name of the new class. WebKitInputMethodFilter -> WebKitInputMethodContext. * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: * UIProcess/API/wpe/docs/wpe-docs.sgml: 2020-01-10 Carlos Garcia Campos Automation: resolveChildFrameWithNodeHandle should return NodeNotFound when node doesn't exist https://bugs.webkit.org/show_bug.cgi?id=205993 Reviewed by Brian Burg. According to the spec: "If element is stale, return error with error code stale element reference." https://w3c.github.io/webdriver/#switch-to-frame Fixes: imported/w3c/webdriver/tests/switch_to_frame/switch.py::test_frame_id_webelement_stale_reference * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle): 2020-01-10 Carlos Garcia Campos Automation: evaluateJavaScriptFunction should use Promises https://bugs.webkit.org/show_bug.cgi?id=204151 Reviewed by Brian Burg. Make the function to run scripts async and handle the result as a promise. To implement the script timeout we use another promise that starts the timer and then we run a Promise.race() with both promises. To simplify the results reporting, all exceptions (including timeout errors that are now handled as exceptions) are now handled as errors passed to the resultCallback. The boolean parameter has been removed, we can simply check the type of the value received because results are always strings and errors are always exception objects. * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::evaluateJavaScriptCallback): Handle the script result, including all possible errors now (not only timeouts). (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Any exception running the script should be an internal error now. The code to handle error has been moved to evaluateJavaScriptCallback(). * WebProcess/Automation/WebAutomationSessionProxy.js: (WebKitAutomation.AutomationSessionProxy.prototype.evaluateJavaScriptFunction): Call _execute and handle the promise result to call resultCallback wityh either the result or the error. (WebKitAutomation.AutomationSessionProxy.prototype._execute): Make the function to run the script async and handle the result as a promise. 2020-01-10 Carlos Garcia Campos Automation: scripts are executed in the wrong js context after a history navigation https://bugs.webkit.org/show_bug.cgi?id=204880 Reviewed by Brian Burg. After a history navigation we use the script object from the previous frame js context because didClearWindowObjectForFrame() is not called in that case. We are caching the script object for every frame ID, and after a history navigation the frame ID is the same, but the frame js context isn't. That also means we might be leaking the script objects in those cases, because we end up calling JSValueUnprotect with the wrong context. It would be easier to set the script object as a property of the global object and let JSC handle the lifetime. Instead of caching the script object and protect/unprotect it, we just check if the global object of the current js context has the property or not to get or create it. We use a private symbol as the key of the global object property to ensure it's not visible. * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::WebAutomationSessionProxy): Initialize m_scriptObjectIdentifier. (WebKit::WebAutomationSessionProxy::scriptObject): Helper function to get the script object for the given JavaScript context. (WebKit::WebAutomationSessionProxy::setScriptObject): Helper function to set the script object for the given JavaScript context. (WebKit::WebAutomationSessionProxy::scriptObjectForFrame): Get or create the script object. (WebKit::WebAutomationSessionProxy::elementForNodeHandle): Get the script object from global object. (WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame): Remove the code to unprotect script objects of the frame. * WebProcess/Automation/WebAutomationSessionProxy.h: Add m_scriptObjectIdentifier and remove m_webFrameScriptObjectMap. 2020-01-09 Ross Kirsling REGRESSION(r253868): Socket-based remote inspector cannot inspect any target https://bugs.webkit.org/show_bug.cgi?id=206045 Reviewed by Don Olmstead. Revert part of patch, ensuring Target struct stays consistent with socket inspector's messaging protocol. * UIProcess/socket/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::setTargetList): (WebKit::debuggableTypeToString): Deleted. * UIProcess/socket/RemoteInspectorClient.h: * UIProcess/socket/RemoteInspectorProtocolHandler.cpp: (WebKit::RemoteInspectorProtocolHandler::targetListChanged): (WebKit::debuggableTypeToString): Deleted. 2020-01-09 Tim Horton Adopt TARGET_OS_MACCATALYST in more places https://bugs.webkit.org/show_bug.cgi?id=206040 Reviewed by Simon Fraser. * Shared/API/Cocoa/WebKit.h: 2020-01-09 Simon Fraser Clean up -[WKWebView _initializeWithConfiguration:] https://bugs.webkit.org/show_bug.cgi?id=206039 Reviewed by Tim Horton. -[WKWebView _initializeWithConfiguration:] is full of platform #ifdefs so needs cleaning up before adding more code. Factor out WKScrollView and view hookup, pageConfiguration setup, and notification registration. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _setupPageConfiguration:]): * UIProcess/API/ios/WKWebViewIOS.h: * UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView _setupScrollAndContentViews]): (-[WKWebView _registerForNotifications]): 2020-01-09 John Wilander Check the existence of the optional m_sessionID before using it in WebProcess::setResourceLoadStatisticsEnabled() https://bugs.webkit.org/show_bug.cgi?id=206035 Reviewed by Brent Fulgham. No new tests. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::setResourceLoadStatisticsEnabled): Added a check that m_sessionID exists. 2020-01-09 Tim Horton Install WebKit framework symlink for more iOS-derived platforms https://bugs.webkit.org/show_bug.cgi?id=206030 Reviewed by Andy Estes. * WebKit.xcodeproj/project.pbxproj: 2020-01-09 Brent Fulgham Remove AGXCompilerService access from the WebContent sandbox https://bugs.webkit.org/show_bug.cgi?id=206020 Reviewed by Per Arne Vollan. Now that we generate a dynamic extension for 'com.apple.AGXCompilerService', we should remove the blanket allow rule from the sandbox. Covered by existing tests. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2020-01-09 Simon Fraser Use HAVE(TOUCH_BAR) instead of PLATFORM(COCOA) in more places https://bugs.webkit.org/show_bug.cgi?id=205975 Reviewed by Wenson Hsieh. Protect Touch Bar-related code with HAVE(TOUCH_BAR) instead of PLATFORM(COCOA). * Shared/TouchBarMenuData.cpp: * Shared/TouchBarMenuData.h: * Shared/TouchBarMenuItemData.cpp: * Shared/TouchBarMenuItemData.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::forceRequestCandidatesForTesting): (WebKit::WebViewImpl::setEditableElementIsFocused): * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didStartPageTransition): (WebKit::WebPage::didChangeSelectionOrOverflowScrollPosition): (WebKit::WebPage::didInsertMenuElement): (WebKit::WebPage::didRemoveMenuElement): (WebKit::WebPage::didInsertMenuItemElement): (WebKit::WebPage::didRemoveMenuItemElement): * WebProcess/WebPage/WebPage.h: 2020-01-09 Simon Fraser Add ENABLE_UI_SIDE_COMPOSITING and use it in a few places https://bugs.webkit.org/show_bug.cgi?id=205982 Reviewed by Jon Lee. All Remote* things should get wrapped in ENABLE(UI_SIDE_COMPOSITING) if other platforms build the files, so do some of that. VisibleContentRect* and ViewUpdateDispatcher* stuff is also UI-side compositing only. * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.h: (WebKit::RemoteScrollingCoordinatorTransaction::scrollingStateTree): * Shared/VisibleContentRectUpdateInfo.cpp: * Shared/VisibleContentRectUpdateInfo.h: * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::handleMouseEvent): * UIProcess/RemoteLayerTree/RemoteScrollingTree.h: * UIProcess/WebPageProxy.h: * WebProcess/WebPage/ViewUpdateDispatcher.cpp: * WebProcess/WebPage/ViewUpdateDispatcher.h: * WebProcess/WebPage/WebPage.h: 2020-01-09 Tim Horton Fix a tiny logging mistake in launchProcess https://bugs.webkit.org/show_bug.cgi?id=206026 Reviewed by Wenson Hsieh. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::launchProcess): 2020-01-09 John Wilander Resource Load Statistics: Add timing information to WebPageProxy::logFrameNavigation() to detect delayed client-side redirects https://bugs.webkit.org/show_bug.cgi?id=205522 Reviewed by Chris Dumez. The purpose of this patch is to capture navigations that happen programmatically after the document has loaded. These are delayed redirects and should be counted as redirects in ITP. To achieve this, a timestamp is captured in WebPageProxy::didFinishDocumentLoadForFrame() to be able to calculate how much time has passed since that timestamp in the IPC sent from WebPageProxy::logFrameNavigation(). The IPC also gets information on whether userInitiatedActivity exists so that ITP can decide whether to treat the navigation as triggered by the user or not. A new test was added and existing test expectations were updated. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::logFrameNavigation): Now takes the extra parameters delayAfterMainFrameDocumentLoad and wasPotentiallyInitiatedByUser. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: (WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation): Now takes the extra parameters delayAfterMainFrameDocumentLoad and wasPotentiallyInitiatedByUser. * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation): Now takes the extra parameters delayAfterMainFrameDocumentLoad and wasPotentiallyInitiatedByUser. The deleted WebResourceLoadStatisticsStore::logFrameNavigation() was dead code. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::logFrameNavigation): Now takes the extra parameters delayAfterMainFrameDocumentLoad and wasPotentiallyInitiatedByUser. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldSubmitTelemetry:]): Deleted. Dead code. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFinishDocumentLoadForFrame): Now captures a timestamp. (WebKit::WebPageProxy::decidePolicyForNavigationAction): Removed dead code. (WebKit::WebPageProxy::logFrameNavigation): Now sends the diff between now and the timestamp captured in WebPageProxy::didFinishDocumentLoadForFrame(). * UIProcess/WebPageProxy.h: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::platformInitialize): Removed dead code. (WebKit::WebsiteDataStore::platformDestroy): Removed dead code. * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::resourceLoadStatistics const): Deleted. Dead code. 2020-01-09 Andres Gonzalez WKAccessibilityWebPageObject should use Accessibility::retrieveValueFromMainThread. https://bugs.webkit.org/show_bug.cgi?id=206009 Reviewed by Chris Fleizach. - WKAccessibilityWebPageObject now uses Accessibility::retrieveValueFromMainThread, which is consistent with WebAccessibilityObjectWrapper. - It also uses a captured protectedSelf to ensure the object is alive when the lambda is invoked on the main thread. - Added nullity check for m_page in accessibilityAttributeSizeValue, which is a potential crasher in the multithreaded mode. * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: (-[WKAccessibilityWebPageObject ALLOW_DEPRECATED_IMPLEMENTATIONS_END]): (-[WKAccessibilityWebPageObject convertScreenPointToRootView:]): (-[WKAccessibilityWebPageObject accessibilityAttributeSizeValue]): (-[WKAccessibilityWebPageObject accessibilityAttributePositionValue]): (-[WKAccessibilityWebPageObject accessibilityDataDetectorValue:point:]): (-[WKAccessibilityWebPageObject accessibilityHitTest:]): (retrieveAccessibilityValueFromMainThread): Not needed since it uses now the one in Accessibility nasespace. 2020-01-09 John Wilander Resource Load Statistics: Flip experimental website data removal setting from an enable to a disable https://bugs.webkit.org/show_bug.cgi?id=205966 Reviewed by Brent Fulgham. To get default on behavior, experimental features in the network process need to be turned from enable flags to disable flags. This patch does that for the experimental website data removal flag. This change also aligns the init values of the setting to match the default. * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: * NetworkProcess/NetworkSession.h: * NetworkProcess/NetworkSessionCreationParameters.h: * Shared/WebPreferences.yaml: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): 2020-01-09 Megan Gardner Set the title for images so it will be correctly displayed in UIContextMenus https://bugs.webkit.org/show_bug.cgi?id=205980 Reviewed by Dean Jackson. Need to set the title text for images. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView continueContextMenuInteraction:]): 2020-01-09 Peng Liu Fullscreen videos do not enter PiP in first tap https://bugs.webkit.org/show_bug.cgi?id=205986 Reviewed by Eric Carlson. This patch essentially reverts the fix for webkit.org/b/204461. The fix for webkit.org/b/204461 depends on a fix in AVKit along with a corresponding update in WebKit (webkit.org/b/204979). We will need to reapply the fix for webkit.org/b/204461 after they are landed. * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement): (WebKit::VideoFullscreenManager::exitVideoFullscreenForVideoElement): 2020-01-09 Kate Cheney ITP API classes need WK_CLASS_AVAILABLE tags https://bugs.webkit.org/show_bug.cgi?id=205969 Reviewed by Dean Jackson. * UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.h: * UIProcess/API/Cocoa/_WKResourceLoadStatisticsThirdParty.h: * WebKit.xcodeproj/project.pbxproj: This updates the header file targets from Project to Private. 2020-01-09 youenn fablet REGRESSION: [ Mac wk2 ] fast/mediastream/captureInGPUProcess.html is a flaky failure https://bugs.webkit.org/show_bug.cgi?id=205873 Reviewed by Eric Carlson. GPUProcess and UIProcess were sometimes getting out of sync with regards to using mock devices or real capture devices. This ended up in GPUProcess trying to find mock devices based on real device IDs. Fix this issue by storing this bool value in GPUProcessProxy and send IPC to GPUProcess whenver this value is changed. Update GPUProcessProxy value whenever UserMediaPermissionRequestManagerProxy is asked to sync this value. * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::singleton): (WebKit::GPUProcessProxy::GPUProcessProxy): (WebKit::GPUProcessProxy::setUseMockCaptureDevices): * UIProcess/GPU/GPUProcessProxy.h: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs const): 2020-01-09 David Kilzer WebKitTestRunner leaks objects in a top-level autoreleasePool that's never cleared Reviewed by Joseph Pecoraro. * UIProcess/mac/WebPreferencesMac.mm: (WebKit::WebPreferences::platformInitializeStore): - Add an @autoreleasepool block around the contents of this method since it generates numerous autoreleased objects when run. 2020-01-08 Yusuke Suzuki Reduce binary size by purging C++ type information in Objective-C fields and parameters https://bugs.webkit.org/show_bug.cgi?id=205905 Reviewed by Saam Barati. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate initWithNetworkSession:wrapper:withCredentials:]): * Shared/API/Cocoa/WKBrowsingContextHandle.mm: (-[WKBrowsingContextHandle _initWithPageProxy:]): (-[WKBrowsingContextHandle _initWithPage:]): * Shared/API/Cocoa/WKBrowsingContextHandleInternal.h: * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm: (-[_WKRemoteObjectRegistry _initWithWebPage:]): (-[_WKRemoteObjectRegistry _initWithWebPageProxy:]): * Shared/API/Cocoa/_WKRemoteObjectRegistryInternal.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _page]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _getAllStorageAccessEntriesFor:completionHandler:]): * UIProcess/API/Cocoa/_WKThumbnailView.mm: * UIProcess/API/mac/WKView.mm: (-[WKView initWithFrame:processPool:configuration:]): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::WebViewImpl): (WebKit::WebViewImpl::setLayoutMode): (WebKit::WebViewImpl::fullScreenWindowController): (WebKit::WebViewImpl::remoteObjectRegistry): * UIProcess/ios/WKApplicationStateTrackingView.mm: (-[WKApplicationStateTrackingView willMoveToWindow:]): (-[WKApplicationStateTrackingView didMoveToWindow]): * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView initWithFrame:processPool:configuration:webView:]): * UIProcess/ios/fullscreen/WKFullScreenViewController.mm: (-[WKFullScreenViewController videoControlsManagerDidChange]): (-[WKFullScreenViewController _manager]): (-[WKFullScreenViewController _togglePiPAction:]): (-[WKFullScreenViewController _showPhishingAlert]): * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: (WebKit::WKWebViewState::applyTo): (WebKit::WKWebViewState::store): (-[WKFullScreenWindowController enterFullScreen]): (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController _completedExitFullScreen]): (-[WKFullScreenWindowController _exitFullscreenImmediately]): (-[WKFullScreenWindowController _manager]): * UIProcess/mac/WKFullScreenWindowController.h: * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController initWithWindow:webView:page:]): * UIProcess/mac/WKImmediateActionController.h: * UIProcess/mac/WKImmediateActionController.mm: (-[WKImmediateActionController initWithPage:view:viewImpl:recognizer:]): (-[WKImmediateActionController _animationControllerForDataDetectedText]): (-[WKImmediateActionController _animationControllerForDataDetectedLink]): * UIProcess/mac/WKInspectorViewController.h: * UIProcess/mac/WKInspectorViewController.mm: (-[WKInspectorViewController initWithInspectedPage:]): * UIProcess/mac/WKTextFinderClient.h: * UIProcess/mac/WKTextFinderClient.mm: (-[WKTextFinderClient initWithPage:view:usePlatformFindUI:]): * UIProcess/mac/WKViewLayoutStrategy.h: * UIProcess/mac/WKViewLayoutStrategy.mm: (+[WKViewLayoutStrategy layoutStrategyWithPage:view:viewImpl:mode:]): (-[WKViewLayoutStrategy initWithPage:view:viewImpl:mode:]): (-[WKViewViewSizeLayoutStrategy initWithPage:view:viewImpl:mode:]): (-[WKViewFixedSizeLayoutStrategy initWithPage:view:viewImpl:mode:]): (-[WKViewDynamicSizeComputedFromViewScaleLayoutStrategy initWithPage:view:viewImpl:mode:]): (-[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy initWithPage:view:viewImpl:mode:]): * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm: (-[WKDOMDocumentParserYieldToken initWithDocument:]): * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h: * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: (-[WKAccessibilityWebPageObjectBase axObjectCache]): (-[WKAccessibilityWebPageObjectBase setWebPage:]): 2020-01-08 John Wilander Resource Load Statistics: Flip experimental cookie blocking setting from an enable to a disable https://bugs.webkit.org/show_bug.cgi?id=205963 Reviewed by Brent Fulgham. To get default on behavior, experimental features in the network process need to be turned from enable flags to disable flags. This patch does that for the experimental cookie blocking flag. This change also aligns the init values of the setting to match the default. * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: * NetworkProcess/NetworkSession.h: * NetworkProcess/NetworkSessionCreationParameters.h: * Shared/WebPreferences.yaml: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): 2020-01-08 Brent Fulgham Allow some sysctl-read calls needed by WebRTC https://bugs.webkit.org/show_bug.cgi?id=205946 Reviewed by Per Arne Vollan. This patch allows some sysctl-read calls that are needed when running WebRTC tests. It also removes telemetry and logging from a UIKit class that was confirmed to be needed by Performance and PowerLogging code. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * WebProcess/com.apple.WebProcess.sb.in: 2020-01-08 Chris Dumez Unreviewed, fix some IOS_FAMILY builds after r254210. * Shared/AuxiliaryProcess.h: 2020-01-08 Dean Jackson [WebGL] More GraphicsContext3D to GraphicsContextGL renaming https://bugs.webkit.org/show_bug.cgi?id=205949 Reviewed by Antoine Quint. * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::copyVideoTextureToPlatformTexture): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: 2020-01-08 Simon Fraser Remove NATIVE_MOUSE_EVENT_HANDLER macros https://bugs.webkit.org/show_bug.cgi?id=205897 Reviewed by Tim Horton. Remove the NATIVE_MOUSE_EVENT_HANDLER and NATIVE_MOUSE_EVENT_HANDLER_INTERNAL which are almost identical, calling a couple of shared functions instead. The only reason the eventName was used was for logging, so just log the -[NSEvent type] instead. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::operator<<): (WebKit::WebViewImpl::nativeMouseEventHandler): (WebKit::WebViewImpl::nativeMouseEventHandlerInternal): (WebKit::WebViewImpl::mouseEntered): (WebKit::WebViewImpl::mouseExited): (WebKit::WebViewImpl::otherMouseDown): (WebKit::WebViewImpl::otherMouseDragged): (WebKit::WebViewImpl::otherMouseUp): (WebKit::WebViewImpl::rightMouseDown): (WebKit::WebViewImpl::rightMouseDragged): (WebKit::WebViewImpl::rightMouseUp): (WebKit::WebViewImpl::mouseMovedInternal): (WebKit::WebViewImpl::mouseDownInternal): (WebKit::WebViewImpl::mouseUpInternal): (WebKit::WebViewImpl::mouseDraggedInternal): 2020-01-08 Wenson Hsieh Remove an unused variable in WebCoreArgumentCodersCocoa.mm after r254202 https://bugs.webkit.org/show_bug.cgi?id=205939 Reviewed by Tim Horton. Remove an unused temporary variable that was only used for debugging. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::decodePlatformData): 2020-01-08 Chris Dumez Move UIProcess DependencyProcessAssertion from WebContent to AuxiliaryProcess https://bugs.webkit.org/show_bug.cgi?id=205836 Reviewed by Alex Christensen. Move UIProcess DependencyProcessAssertion from WebContent to AuxiliaryProcess, so that other auxiliary processes (Network Process, GPU Process) also benefit from it. * Shared/AuxiliaryProcess.cpp: (WebKit::AuxiliaryProcess::initializeConnection): * Shared/AuxiliaryProcess.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeConnection): * WebProcess/WebProcess.h: 2020-01-08 Brent Fulgham Network process sandboxes should not include 'common.sb' or 'system.sb' https://bugs.webkit.org/show_bug.cgi?id=205521 Reviewed by Per Arne Vollan. This patch replaces the 'include' with a copy/paste of the contents of the relevant sandbox include file. I removed definitions that were not referenced in the existing Network sandbox, but did not otherwise edit the contents. There are duplicates and redundancies after this patch, which I will remove as a follow-up step once we confirm that this has no regressions. I also updated the sandbox to generate telemetry for some mach connections that we think are unneeded, or that should be targeted for removal. No new tests. There should be no change in behavior. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: 2020-01-08 David Kilzer IPC::Connection::sendMessage() should use CRASH_WITH_INFO() Reviewed by Mark Lam. * Platform/IPC/cocoa/ConnectionCocoa.mm: (IPC::Connection::sendMessage): - Switch from CRASH() to CRASH_WITH_INFO(). 2020-01-08 Truitt Savell Unreviewed, rolling out r254174. Broke 80 tests on Catalina Reverted changeset: "Network process sandboxes should not include 'common.sb' or 'system.sb'" https://bugs.webkit.org/show_bug.cgi?id=205521 https://trac.webkit.org/changeset/254174 2020-01-08 Wenson Hsieh Add support for encoding WebCore::Font over IPC for DisplayList::DrawGlyphs https://bugs.webkit.org/show_bug.cgi?id=205830 Reviewed by Dean Jackson. Add basic support for encoding and decoding a FontHandle. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): When encoding a Font on Cocoa platforms, send across the font face data (if present); otherwise, fall back to sending the font descriptor for the UIFont or NSFont (as is the case for installed fonts). * Shared/WebCoreArgumentCoders.h: * Shared/curl/WebCoreArgumentCodersCurl.cpp: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): * Shared/soup/WebCoreArgumentCodersSoup.cpp: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): 2020-01-08 Milan Crha [GTK] Editing: Allow line breaks in lists https://bugs.webkit.org/show_bug.cgi?id=205913 Reviewed by Carlos Garcia Campos. * UIProcess/gtk/KeyBindingTranslator.cpp: Treat Shift+Enter as "InsertLineBreak", instead of "InsertNewLine". 2020-01-08 youenn fablet Implement MediaRecorder backend in GPUProcess https://bugs.webkit.org/show_bug.cgi?id=205802 Reviewed by Eric Carlson. Add support for sending audio/video tracks to record from WebProcess to GPUProcess. Add a MediaRecorderPrivate implementation that supports sending one audio track and/or one video track to GPUProcess and stopping/fetching data from the remote recorder in GPUProcess. In GPUProcess, implement the remote recorder using the existing WebCore recorder writer. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::userMediaCaptureManagerProxy): (WebKit::GPUConnectionToWebProcess::mediaRecorderManager): (WebKit::GPUConnectionToWebProcess::didReceiveMessage): * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: * GPUProcess/webrtc/RemoteMediaRecorder.cpp: Added. (WebKit::RemoteMediaRecorder::create): (WebKit::RemoteMediaRecorder::RemoteMediaRecorder): (WebKit::RemoteMediaRecorder::~RemoteMediaRecorder): (WebKit::RemoteMediaRecorder::storage): (WebKit::RemoteMediaRecorder::audioSamplesStorageChanged): (WebKit::RemoteMediaRecorder::audioSamplesAvailable): (WebKit::RemoteMediaRecorder::videoSampleAvailable): (WebKit::RemoteMediaRecorder::fetchData): (WebKit::RemoteMediaRecorder::stopRecording): * GPUProcess/webrtc/RemoteMediaRecorder.h: Added. * GPUProcess/webrtc/RemoteMediaRecorder.messages.in: Added. * GPUProcess/webrtc/RemoteMediaRecorderManager.cpp: Added. (WebKit::RemoteMediaRecorderManager::RemoteMediaRecorderManager): (WebKit::RemoteMediaRecorderManager::~RemoteMediaRecorderManager): (WebKit::RemoteMediaRecorderManager::didReceiveRemoteMediaRecorderMessage): (WebKit::RemoteMediaRecorderManager::createRecorder): (WebKit::RemoteMediaRecorderManager::releaseRecorder): * GPUProcess/webrtc/RemoteMediaRecorderManager.h: Added. (WebKit::RemoteMediaRecorderManager::didReceiveMessageFromWebProcess): * GPUProcess/webrtc/RemoteMediaRecorderManager.messages.in: Added. * Scripts/webkit/messages.py: * Sources.txt: * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/media/MediaRecorderProvider.cpp: Added. (WebCore::MediaRecorderProvider::createMediaRecorderPrivate): * WebProcess/GPU/media/MediaRecorderProvider.h: Added. * WebProcess/GPU/webrtc/MediaRecorderIdentifier.h: Added. * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp: Added. (WebKit::MediaRecorderPrivate::MediaRecorderPrivate): (WebKit::MediaRecorderPrivate::~MediaRecorderPrivate): (WebKit::MediaRecorderPrivate::sampleBufferUpdated): (WebKit::MediaRecorderPrivate::audioSamplesAvailable): (WebKit::MediaRecorderPrivate::storageChanged): (WebKit::MediaRecorderPrivate::fetchData): (WebKit::MediaRecorderPrivate::stopRecording): * WebProcess/GPU/webrtc/MediaRecorderPrivate.h: Added. * WebProcess/GPU/webrtc/MediaRecorderProvider.cpp: Added. (WebKit::MediaRecorderProvider::createMediaRecorderPrivate): * WebProcess/GPU/webrtc/MediaRecorderProvider.h: Added. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_overriddenMediaType): 2020-01-08 youenn fablet Improve logging of creating a service worker https://bugs.webkit.org/show_bug.cgi?id=205849 Reviewed by Chris Dumez. Add some release logging to identify which service worker is created in which process. No change of observable behavior. * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::installServiceWorker): 2020-01-07 Said Abou-Hallawa Implement css3-images image-orientation https://bugs.webkit.org/show_bug.cgi?id=89052 Reviewed by Simon Fraser. Remove the ENABLE_CSS_IMAGE_ORIENTATION feature flag. * Configurations/FeatureDefines.xcconfig: 2020-01-07 Alex Christensen Introduce _WKResourceLoadDelegate https://bugs.webkit.org/show_bug.cgi?id=205887 Reviewed by Dean Jackson. Add a new delegate that will be informed about main and subresource requests. This is distinct from the WKNavigationDelegate, which primarily receives callbacks about main resource requests. Because the IPC churn can be a significant performance reduction, only send the IPC messages if the page has such a client. This client will need to be expanded to implement but this is a minimal testable start. The simple case is covered by an API test. * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::startNetworkLoad): * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * SourcesCocoa.txt: * UIProcess/API/APIResourceLoadClient.h: Added. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): (-[WKWebView _resourceLoadDelegate]): (-[WKWebView _setResourceLoadDelegate:]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKResourceLoadDelegate.h: Added. * UIProcess/Cocoa/ResourceLoadDelegate.h: Added. * UIProcess/Cocoa/ResourceLoadDelegate.mm: Added. (WebKit::ResourceLoadDelegate::ResourceLoadDelegate): (WebKit::ResourceLoadDelegate::createResourceLoadClient): (WebKit::ResourceLoadDelegate::delegate): (WebKit::ResourceLoadDelegate::setDelegate): (WebKit::ResourceLoadDelegate::ResourceLoadClient::ResourceLoadClient): (WebKit::ResourceLoadDelegate::ResourceLoadClient::willSendRequest const): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::pageWillSendRequest): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setResourceLoadClient): * UIProcess/WebPageProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_overriddenMediaType): (WebKit::WebPage::setHasResourceLoadClient): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2020-01-07 Kate Cheney Create a mechanism for 'safe by default' web views https://bugs.webkit.org/show_bug.cgi?id=205407 Reviewed by Alex Christensen. Adds common cases to be used as the basis for 'safe by default' web views. The cases are in the form of an NS_ENUM _WKWebViewCategory and its equivalent C++ enum WebViewCategory. The conversion between these happens in WKWebViewConfiguration.mm. * Shared/WebViewCategory.h: Added. * UIProcess/API/APIPageConfiguration.cpp: (API::PageConfiguration::copy const): * UIProcess/API/APIPageConfiguration.h: (API::PageConfiguration::webViewCategory const): (API::PageConfiguration::setWebViewCategory): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (convertToAPIWebViewCategory): (convertFromAPIWebViewCategory): (-[WKWebViewConfiguration _webViewCategory]): (-[WKWebViewConfiguration _setWebViewCategory:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * WebKit.xcodeproj/project.pbxproj: 2020-01-07 Brent Fulgham Network process sandboxes should not include 'common.sb' or 'system.sb' https://bugs.webkit.org/show_bug.cgi?id=205521 Reviewed by Per Arne Vollan. This patch replaces the 'include' with a copy/paste of the contents of the relevant sandbox include file. I removed definitions that were not referenced in the existing Network sandbox, but did not otherwise edit the contents. There are duplicates and redundancies after this patch, which I will remove as a follow-up step once we confirm that this has no regressions. I also updated the sandbox to generate telemetry for some mach connections that we think are unneeded, or that should be targeted for removal. No new tests. There should be no change in behavior. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: 2020-01-07 Ross Kirsling Unreviewed restabilization of non-unified build. * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: * NetworkProcess/IndexedDB/WebIDBServer.cpp: (WebKit::WebIDBServer::create): (WebKit::WebIDBServer::WebIDBServer): (WebKit::WebIDBServer::closeAndDeleteDatabasesForOrigins): (WebKit::WebIDBServer::suspend): (WebKit::WebIDBServer::didFireVersionChangeEvent): * UIProcess/WebContextClient.h: 2020-01-07 Daniel Bates First character in each word-wrapped line has incorrect character rect when requested range spans multiple lines https://bugs.webkit.org/show_bug.cgi?id=205842 Reviewed by Zalan Bujtas. Pass BoundingRectBehavior::IgnoreEmptyTextSelections to Range::absoluteBoundingBox() to compute the glyph bounding box ignoring empty text selections that would typically occur if the start of the range coincide with the edge of a line box. This makes the behavior more consistent with the behavior of NSLayoutManager. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::requestDocumentEditingContext): 2020-01-07 Ryan Haddad Unreviewed, rolling out r254144. Broke the iOS build. Reverted changeset: "First character in each word-wrapped line has incorrect character rect when requested range spans multiple lines" https://bugs.webkit.org/show_bug.cgi?id=205842 https://trac.webkit.org/changeset/254144 2020-01-07 Keith Rollin Reformat WebFrameLoaderClient logging https://bugs.webkit.org/show_bug.cgi?id=205869 Reviewed by Brent Fulgham. Update the format used by WebFrameLoaderClient in its RELEASE_LOG logging. Use the format used by WebPageProxy and NetworkResourceLoader, which is generally of the form: - [] ::: So, for example: 0x4a1d7c310 - WebFrameLoaderClient::dispatchDidReachLayoutMilestone: dispatching didCompletePageTransition, page = 0x7f83ba009208 becomes: 0x4a1d7c310 - [webFrame=0x7ff703f03b68, webFrameID=3, webPage=0x7ff704831808, webPageID=15] WebFrameLoaderClient::dispatchDidReachLayoutMilestone: dispatching didCompletePageTransition No new tests - no added or changed functionality. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad): (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad): (WebKit::WebFrameLoaderClient::dispatchDidFailLoad): (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone): 2020-01-07 Daniel Bates First character in each word-wrapped line has incorrect character rect when requested range spans multiple lines https://bugs.webkit.org/show_bug.cgi?id=205842 Reviewed by Zalan Bujtas. Pass BoundingRectBehavior::IgnoreEmptyTextSelections to Range::absoluteBoundingBox() to compute the glyph bounding box ignoring empty text selections that would typically occur if the start of the range coincide with the edge of a line box. This makes the behavior more consistent with the behavior of NSLayoutManager. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::requestDocumentEditingContext): 2020-01-07 Commit Queue Unreviewed, rolling out r254132. https://bugs.webkit.org/show_bug.cgi?id=205868 It is breaking WinCairo build and internal builds. (Requested by youenn on #webkit). Reverted changeset: "Implement MediaRecorder backend in GPUProcess" https://bugs.webkit.org/show_bug.cgi?id=205802 https://trac.webkit.org/changeset/254132 2020-01-07 youenn fablet Implement MediaRecorder backend in GPUProcess https://bugs.webkit.org/show_bug.cgi?id=205802 Reviewed by Eric Carlson. Add support for sending audio/video tracks to record from WebProcess to GPUProcess. Add a MediaRecorderPrivate implementation that supports sending one audio track and/or one video track to GPUProcess and stopping/fetching data from the remote recorder in GPUProcess. In GPUProcess, implement the remote recorder using the existing WebCore recorder writer. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::userMediaCaptureManagerProxy): (WebKit::GPUConnectionToWebProcess::mediaRecorderManager): (WebKit::GPUConnectionToWebProcess::didReceiveMessage): * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: * GPUProcess/webrtc/RemoteMediaRecorder.cpp: Added. (WebKit::RemoteMediaRecorder::create): (WebKit::RemoteMediaRecorder::RemoteMediaRecorder): (WebKit::RemoteMediaRecorder::~RemoteMediaRecorder): (WebKit::RemoteMediaRecorder::storage): (WebKit::RemoteMediaRecorder::audioSamplesStorageChanged): (WebKit::RemoteMediaRecorder::audioSamplesAvailable): (WebKit::RemoteMediaRecorder::videoSampleAvailable): (WebKit::RemoteMediaRecorder::fetchData): (WebKit::RemoteMediaRecorder::stopRecording): * GPUProcess/webrtc/RemoteMediaRecorder.h: Added. * GPUProcess/webrtc/RemoteMediaRecorder.messages.in: Added. * GPUProcess/webrtc/RemoteMediaRecorderManager.cpp: Added. (WebKit::RemoteMediaRecorderManager::RemoteMediaRecorderManager): (WebKit::RemoteMediaRecorderManager::~RemoteMediaRecorderManager): (WebKit::RemoteMediaRecorderManager::didReceiveRemoteMediaRecorderMessage): (WebKit::RemoteMediaRecorderManager::createRecorder): (WebKit::RemoteMediaRecorderManager::releaseRecorder): * GPUProcess/webrtc/RemoteMediaRecorderManager.h: Added. (WebKit::RemoteMediaRecorderManager::didReceiveMessageFromWebProcess): * GPUProcess/webrtc/RemoteMediaRecorderManager.messages.in: Added. * Scripts/webkit/messages.py: * Sources.txt: * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/media/MediaRecorderProvider.cpp: Added. (WebCore::MediaRecorderProvider::createMediaRecorderPrivate): * WebProcess/GPU/media/MediaRecorderProvider.h: Added. * WebProcess/GPU/webrtc/MediaRecorderIdentifier.h: Added. * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp: Added. (WebKit::MediaRecorderPrivate::MediaRecorderPrivate): (WebKit::MediaRecorderPrivate::~MediaRecorderPrivate): (WebKit::MediaRecorderPrivate::sampleBufferUpdated): (WebKit::MediaRecorderPrivate::audioSamplesAvailable): (WebKit::MediaRecorderPrivate::storageChanged): (WebKit::MediaRecorderPrivate::fetchData): (WebKit::MediaRecorderPrivate::stopRecording): * WebProcess/GPU/webrtc/MediaRecorderPrivate.h: Added. * WebProcess/GPU/webrtc/MediaRecorderProvider.cpp: Added. (WebKit::MediaRecorderProvider::createMediaRecorderPrivate): * WebProcess/GPU/webrtc/MediaRecorderProvider.h: Added. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_overriddenMediaType): 2020-01-07 youenn fablet Add an option to make video capture in GPUProcess https://bugs.webkit.org/show_bug.cgi?id=205853 Reviewed by Eric Carlson. Add an option to make video capture in GPU process. Pass this option at creation of the web page so that the process can be updated after launch time. Apply the same principle to other audio/video capture parameters. Add SPI to update this preference. Fix bug in the passing of preference to process pool for the video capture in UIProcess parameter, which is now an experimental flag and not an internal one. Test: fast/mediastream/captureInGPUProcess.html * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * Shared/WebPreferences.yaml: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetCaptureVideoInGPUProcessEnabled): (WKPreferencesGetCaptureVideoInGPUProcessEnabled): * UIProcess/API/C/WKPreferencesRef.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/WebPageProxy.cpp: * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::updateBoolValueForInternalDebugFeatureKey): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_overriddenMediaType): * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::setupCaptureProcesses): (WebKit::UserMediaCaptureManager::VideoFactory::createVideoCaptureSource): * WebProcess/cocoa/UserMediaCaptureManager.h: (WebKit::UserMediaCaptureManager::VideoFactory::setShouldCaptureInGPUProcess): 2020-01-07 youenn fablet Fix non GPUProcess build issue in UserMediaCaptureManager https://bugs.webkit.org/show_bug.cgi?id=205851 Reviewed by Eric Carlson. Build fix, no change of behavior. * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::connection): 2020-01-07 Carlos Garcia Campos [GTK][WPE] Add API to retrieve and delete surrounding text for input methods https://bugs.webkit.org/show_bug.cgi?id=205716 Reviewed by Žan Doberšek. Extend WebKitInputMethodContext to be able to retrieve and delete surrounding text. * Shared/EditorState.cpp: (WebKit::EditorState::PostLayoutData::encode const): Encode paragraphContext and paragraphContextCursorPosition. (WebKit::EditorState::PostLayoutData::decode): Decode paragraphContext and paragraphContextCursorPosition. * Shared/EditorState.h: Add paragraphContext and paragraphContextCursorPosition. * UIProcess/API/glib/InputMethodFilter.cpp: (WebKit::InputMethodFilter::deleteSurroundingCallback): Callback to handle WebKitInputMethodContext::delete-surrounding signal. (WebKit::InputMethodFilter::setContext): Connect to WebKitInputMethodContext::delete-surrounding signal. (WebKit::InputMethodFilter::notifySurrounding): Save the new surrounding text and position and call webkit_input_method_context_notify_surrounding(). (WebKit::InputMethodFilter::deleteSurrounding): Ask WebKitWebView to delete the surrounding text. * UIProcess/API/glib/InputMethodFilter.h: * UIProcess/API/glib/WebKitInputMethodContext.cpp: (webkit_input_method_context_class_init): Add delete-surrounding signal. (webkit_input_method_context_notify_surrounding): Call the virtual method notify_surrounding if implemented. * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewDeleteSurrounding): Call WebPageProxy::deleteSurrounding(). * UIProcess/API/glib/WebKitWebViewPrivate.h: * UIProcess/API/gtk/WebKitInputMethodContext.h: * UIProcess/API/gtk/WebKitInputMethodContextImplGtk.cpp: (contextRetrieveSurrounding): Call gtk_im_context_set_surrounding() with the current surrounding text and position. (webkitInputMethodContextImplGtkConstructed): Connect to GtkIMContext::retrieve-surrounding signal. (webkitInputMethodContextImplGtkNotifySurrounding): Save the new surrounding text and position. (webkit_input_method_context_impl_gtk_class_init): Add implementation for notify_surrounding vfunc. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseUpdateTextInputState): Also notify the context about surrounding text and position. * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::selectionDidChange): Ditto. * UIProcess/API/wpe/WebKitInputMethodContext.h: * UIProcess/API/wpe/docs/wpe-1.0-sections.txt: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::deleteSurrounding): Send DeleteSurrounding message to web process. * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::deleteSurrounding): Delete the given range. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Add DeleteSurrounding message. * WebProcess/WebPage/glib/WebPageGLib.cpp: (WebKit::WebPage::platformEditorState const): Moved from GTK and WPE here and also added paragraphContext and paragraphContextCursorPosition initialization. * WebProcess/WebPage/gtk/WebPageGtk.cpp: Remove platformEditorState(). * WebProcess/WebPage/wpe/WebPageWPE.cpp: Ditto. 2020-01-07 Carlos Garcia Campos [GTK][WPE] Add API to set purpose and hints of active editable element to input methods https://bugs.webkit.org/show_bug.cgi?id=205605 Reviewed by Žan Doberšek. Add input-purpose and input-hints properties to WebKitInputMethodContext. The message SetInputMethodState now receives an optional InputMethodState struct with information about the purpose and hints of the active editable element. * Scripts/webkit/messages.py: Only include InputMethodState.h for GTK and WPE. * Shared/glib/InputMethodState.cpp: Added. (WebKit::InputMethodState::setPurposeOrHintForInputMode): (WebKit::inputElementHasDigitsPattern): (WebKit::InputMethodState::setPurposeForInputElement): (WebKit::InputMethodState::addHintsForAutocapitalizeType): (WebKit::InputMethodState::encode const): (WebKit::InputMethodState::decode): * Shared/glib/InputMethodState.h: Added. (WebKit::operator==): * SourcesGTK.txt: * SourcesWPE.txt: * UIProcess/API/glib/InputMethodFilter.cpp: (WebKit::InputMethodFilter::setContext): Use isEnabled() instead of m_enabled. (WebKit::InputMethodFilter::setState): Now receives an optional InputMethodState struct. (WebKit::InputMethodFilter::filterKeyEvent): Use isEnabled() instead of m_enabled. (WebKit::InputMethodFilter::isViewFocused const): Ditto. (WebKit::toWebKitPurpose): Helper to convert InputMethodState::Purpose to WebKitInputPurpose. (WebKit::toWebKitHints): Helper to convert InputMethodState::Hint to WebKitInputHints. (WebKit::InputMethodFilter::notifyFocusedIn): Set the purpose and hints to the context. (WebKit::InputMethodFilter::notifyFocusedOut): Use isEnabled() instead of m_enabled. (WebKit::InputMethodFilter::notifyCursorRect): Ditto. (WebKit::InputMethodFilter::preeditStarted): Ditto. (WebKit::InputMethodFilter::preeditChanged): Ditto. (WebKit::InputMethodFilter::preeditFinished): Ditto. (WebKit::InputMethodFilter::committed): Ditto. * UIProcess/API/glib/InputMethodFilter.h: (WebKit::InputMethodFilter::isEnabled const): Return true if we have a state. * UIProcess/API/glib/WebKitInputMethodContext.cpp: (webkitInputMethodContextSetProperty): Properties setter. (webkitInputMethodContextGetProperty): Properties getter. (webkit_input_method_context_class_init): Add implementation for properties getter and setter. (webkit_input_method_context_get_input_purpose): (webkit_input_method_context_set_input_purpose): (webkit_input_method_context_get_input_hints): (webkit_input_method_context_set_input_hints): * UIProcess/API/gtk/WebKitInputMethodContext.h: * UIProcess/API/gtk/WebKitInputMethodContextImplGtk.cpp: (toGtkInputPurpose): Helper to convert WebKitInputPurpose to GtkInputPurpose. (toGtkInputHints): Helper to convert WebKitInputHints to GtkInputHints. (inputPurposeChangedCallback): Set the purpose on GtkIMContext. (inputHintsChangedCallback): Set the hints on GtkIMContext. (webkitInputMethodContextImplGtkConstructed): Connect to notify signal for input-purpose and input-hints properties of the context. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseSetInputMethodState): * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::setInputMethodState): * UIProcess/API/wpe/PageClientImpl.h: * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::setInputMethodState): * UIProcess/API/wpe/WPEView.h: * UIProcess/API/wpe/WebKitInputMethodContext.h: * UIProcess/API/wpe/docs/wpe-1.0-sections.txt: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/gtk/WebPageProxyGtk.cpp: (WebKit::WebPageProxy::setInputMethodState): * UIProcess/wpe/WebPageProxyWPE.cpp: (WebKit::WebPageProxy::setInputMethodState): * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::setInputMethodState): * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/glib/WebPageGLib.cpp: (WebKit::inputMethodSateForElement): Build an InputMethodState for the given element. (WebKit::WebPage::setInputMethodState): 2020-01-07 Carlos Garcia Campos WebDriver: several w3c collections tests added in r230953 are failing https://bugs.webkit.org/show_bug.cgi?id=184966 Reviewed by Brian Burg. This is because JSON.stringify() is not enough, we need to first clone the value using the internal JSON clone algorithm explained in the spec. See https://w3c.github.io/webdriver/#dfn-internal-json-clone-algorithm. Fixes: imported/w3c/webdriver/tests/execute_script/collections.py::test_arguments imported/w3c/webdriver/tests/execute_script/collections.py::test_file_list imported/w3c/webdriver/tests/execute_script/collections.py::test_html_all_collection imported/w3c/webdriver/tests/execute_async_script/collections.py::test_arguments imported/w3c/webdriver/tests/execute_async_script/collections.py::test_file_list imported/w3c/webdriver/tests/execute_async_script/collections.py::test_html_all_collection * WebProcess/Automation/WebAutomationSessionProxy.js: (WebKitAutomation.AutomationSessionProxy.prototype._jsonStringify): Call JSON.stringify(), but without the replacer and passing the result of _jsonClone(). (WebKitAutomation.AutomationSessionProxy.prototype._isCollection): Helper to check if the value is a collection. (WebKitAutomation.AutomationSessionProxy.prototype._checkCyclic): Throw an error if the value is a cyclic structure. (WebKitAutomation.AutomationSessionProxy.prototype._jsonClone): Implement the internal JSON clone algorithm. (WebKitAutomation.AutomationSessionProxy.prototype._createNodeHandle): Trhow an error if the node is stale. 2020-01-07 Carlos Garcia Campos [SOUP] HSTS Support causes page loading to fail with "Operation was cancelled" https://bugs.webkit.org/show_bug.cgi?id=203620 Reviewed by Michael Catanzaro. The problem is that we are assuming that request cancellation happens synchronously, but it can happen that the async ready callback for the previous request is called after the new one has started. * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::sendRequestCallback): Return early if this is a previous request already cancelled. 2020-01-07 Carlos Garcia Campos WebDriver: handle no such element errors https://bugs.webkit.org/show_bug.cgi?id=204684 Reviewed by Brian Burg. Add InvalidNodeIdentifier to be generated when the elementID provided by WebDriver is not a valid node identifier. * UIProcess/Automation/Automation.json: Add InvalidNodeIdentifier error. * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::isValidNodeHandle): Helper function to check the given node handle is valid. (WebKit::isValidNodeIdentifier): JavaScript callback function to check the node identifier is valid. (WebKit::WebAutomationSessionProxy::scriptObjectForFrame): Add isValidNodeIdentifier function. (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Handle InvalidNodeIdentifier errors. (WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle): Call isValidNodeHandle() and generate InvalidNodeIdentifier error if it fails. (WebKit::WebAutomationSessionProxy::computeElementLayout): Ditto. (WebKit::WebAutomationSessionProxy::selectOptionElement): Ditto. (WebKit::WebAutomationSessionProxy::takeScreenshot): Ditto. * WebProcess/Automation/WebAutomationSessionProxy.js: (let.AutomationSessionProxy.prototype._nodeForIdentifier): Call isValidNodeIdentifier() and throw InvalidNodeIdentifier if it fails. 2020-01-07 Carlos Garcia Campos WebDriver: several tests in imported/w3c/webdriver/tests/state/get_element_attribute.py are failing https://bugs.webkit.org/show_bug.cgi?id=180415 Reviewed by Brian Burg. Update the ElementAttribute atom to properly handle boolean attributes, following what the selenium original atom does. * UIProcess/Automation/atoms/ElementAttribute.js: (getAttribute): (tagName.string_appeared_here.lowercaseAttributeName.string_appeared_here): (isBooleanAttribute): 2020-01-07 Chris Fleizach AX: Enable ACCESSIBILITY_ISOLATED_TREE https://bugs.webkit.org/show_bug.cgi?id=205535 Reviewed by Zalan Bujtas. * Configurations/FeatureDefines.xcconfig: * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetIsAccessibilityIsolatedTreeEnabled): (WKPreferencesGetIsAccessibilityIsolatedTreeEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: 2020-01-06 Per Arne Vollan [iOS] Get display level in the UI process for all iOS platforms https://bugs.webkit.org/show_bug.cgi?id=205835 Reviewed by Brent Fulgham. This was previously only done for iOS, but should be done for all iOS platforms. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::registerNotificationObservers): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): * UIProcess/WebProcessPool.h: * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: * WebProcess/cocoa/WebProcessCocoa.mm: 2020-01-06 Eric Carlson Add some of the remote media player messages needed for video playback https://bugs.webkit.org/show_bug.cgi?id=205812 Reviewed by Jer Noble. No new tests, it isn't possible to play video yet. * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: (WebKit::RemoteMediaPlayerManagerProxy::prepareForRendering): (WebKit::RemoteMediaPlayerManagerProxy::setSize): (WebKit::RemoteMediaPlayerManagerProxy::setVisible): (WebKit::RemoteMediaPlayerManagerProxy::setShouldMaintainAspectRatio): (WebKit::RemoteMediaPlayerManagerProxy::setVideoFullscreenFrame): (WebKit::RemoteMediaPlayerManagerProxy::setVideoFullscreenGravity): (WebKit::RemoteMediaPlayerManagerProxy::acceleratedRenderingStateChanged): (WebKit::RemoteMediaPlayerManagerProxy::setShouldDisableSleep): (WebKit::RemoteMediaPlayerManagerProxy::setRate): * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in: * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::getConfiguration): (WebKit::RemoteMediaPlayerProxy::prepareForRendering): (WebKit::RemoteMediaPlayerProxy::setSize): (WebKit::RemoteMediaPlayerProxy::setVisible): (WebKit::RemoteMediaPlayerProxy::setShouldMaintainAspectRatio): (WebKit::RemoteMediaPlayerProxy::setVideoFullscreenFrame): (WebKit::RemoteMediaPlayerProxy::setVideoFullscreenGravity): (WebKit::RemoteMediaPlayerProxy::acceleratedRenderingStateChanged): (WebKit::RemoteMediaPlayerProxy::setShouldDisableSleep): (WebKit::RemoteMediaPlayerProxy::setRate): (WebKit::RemoteMediaPlayerProxy::mediaPlayerReadyStateChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerRenderingCanBeAccelerated): * GPUProcess/media/RemoteMediaPlayerProxy.h: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::sizeChanged): (WebKit::MediaPlayerPrivateRemote::updateCachedState): (WebKit::MediaPlayerPrivateRemote::shouldIgnoreIntrinsicSize): (WebKit::MediaPlayerPrivateRemote::prepareForRendering): (WebKit::MediaPlayerPrivateRemote::setSize): (WebKit::MediaPlayerPrivateRemote::setVisible): (WebKit::MediaPlayerPrivateRemote::setShouldMaintainAspectRatio): (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenFrame): (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenGravity): (WebKit::MediaPlayerPrivateRemote::acceleratedRenderingStateChanged): (WebKit::MediaPlayerPrivateRemote::setShouldDisableSleep): (WebKit::MediaPlayerPrivateRemote::naturalSize const): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/RemoteMediaPlayerConfiguration.h: (WebKit::RemoteMediaPlayerConfiguration::encode const): (WebKit::RemoteMediaPlayerConfiguration::decode): * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::sizeChanged): * WebProcess/GPU/media/RemoteMediaPlayerManager.h: * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in: * WebProcess/GPU/media/RemoteMediaPlayerState.h: (WebKit::RemoteMediaPlayerState::encode const): (WebKit::RemoteMediaPlayerState::decode): 2020-01-06 Chris Dumez Improve logging for when a synchronous IPC times out https://bugs.webkit.org/show_bug.cgi?id=205829 Reviewed by Tim Horton. * Platform/IPC/Connection.cpp: (IPC::Connection::sendSyncMessage): (IPC::Connection::waitForSyncReply): * Platform/IPC/Connection.h: 2020-01-06 Peng Liu Build (unified) failure after adding source files to support media in GPU process https://bugs.webkit.org/show_bug.cgi?id=205616 Reviewed by Darin Adler. No new tests, no functional change. * Sources.txt: * SourcesGTK.txt: * WebKit.xcodeproj/project.pbxproj: 2020-01-06 Alex Christensen NetworkSessionCocoa::isolatedSession should not use iterator after mutating m_isolatedSessions https://bugs.webkit.org/show_bug.cgi?id=205824 Reviewed by Chris Dumez. Classic iterator use after mutating iterated container was causing crashes by returning a null SessionWrapper& This was introduced in r252185 or r248640. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::isolatedSession): 2020-01-06 Mark Lam Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::invalidateAndCancel): * NetworkProcess/NetworkSession.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::setCapacity): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (toNSURLSessionResponseDisposition): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * Platform/IPC/Connection.cpp: (IPC::Connection::waitForMessage): * Platform/IPC/MessageReceiver.h: (IPC::MessageReceiver::willBeAddedToMessageReceiverMap): (IPC::MessageReceiver::willBeRemovedFromMessageReceiverMap): * Platform/IPC/cocoa/ConnectionCocoa.mm: (IPC::readFromMachPort): * Platform/mac/MachUtilities.cpp: (setMachExceptionPort): * Shared/API/APIClient.h: (API::Client::Client): * Shared/API/Cocoa/WKRemoteObjectCoder.mm: * Shared/Cocoa/ArgumentCodersCocoa.h: * Shared/SharedStringHashTableReadOnly.cpp: * UIProcess/BackingStore.cpp: (WebKit::BackingStore::incorporateUpdate): * UIProcess/GenericCallback.h: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): * UIProcess/PageLoadState.h: (WebKit::PageLoadState::Transaction::Token::Token): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::~WebPageProxy): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveResponse): * WebProcess/Network/WebResourceLoader.h: * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::NetscapePluginStream): (WebKit::NetscapePluginStream::notifyAndDestroyStream): * WebProcess/Plugins/Netscape/NetscapePluginStream.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::runModal): * WebProcess/WebProcess.cpp: (WebKit::checkDocumentsCaptureStateConsistency): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::updateProcessName): 2020-01-06 Alex Christensen Remove WebsiteDataStore::setServiceWorkerRegistrationDirectory https://bugs.webkit.org/show_bug.cgi?id=205754 Reviewed by Youenn Fablet. The directory is now only set in the configuration, which will prevent misuse of the misplaced SPI. Updated API tests, which still work. * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp: (WKWebsiteDataStoreConfigurationCopyServiceWorkerRegistrationDirectory): (WKWebsiteDataStoreConfigurationSetServiceWorkerRegistrationDirectory): * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h: * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreCopyServiceWorkerRegistrationDirectory): Deleted. (WKWebsiteDataStoreSetServiceWorkerRegistrationDirectory): Deleted. * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _hasRegisteredServiceWorker]): (-[WKWebsiteDataStore _serviceWorkerRegistrationDirectory]): Deleted. (-[WKWebsiteDataStore _setServiceWorkerRegistrationDirectory:]): Deleted. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::setCacheStorageDirectory): (WebKit::WebsiteDataStore::serviceWorkerRegistrationDirectory const): Deleted. (WebKit::WebsiteDataStore::setServiceWorkerRegistrationDirectory): Deleted. 2020-01-06 Alex Christensen Remove _WKProcessPoolConfiguration.CTDataConnectionServiceType and suppressesConnectionTerminationOnSystemChange https://bugs.webkit.org/show_bug.cgi?id=205751 Reviewed by Darin Adler. Their replacements on _WKWebViewConfiguration have been adopted. * 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::dataConnectionServiceType const): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): (WebKit::globalCTDataConnectionServiceType): Deleted. (WebKit::NetworkSessionCocoa::setCTDataConnectionServiceType): Deleted. * 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): 2020-01-06 Keith Rollin Reformat WebPage logging https://bugs.webkit.org/show_bug.cgi?id=205709 Reviewed by Brent Fulgham. Update the format used by WebPage in its RELEASE_LOG logging. Use the format used by WebPageProxy and NetworkResourceLoader, which is generally of the form: - [] ::: So, for example: 0x4a1df5000 - WebLoaderStrategy::scheduleLoad: Resource is being scheduled with the NetworkProcess (frame=0x4a1db0220, priority=0, webPageID=15, frameID=3, resourceID=32)', becomes: 0x4a1df5000 - [resourceLoader=0x1418b7200, frameLoader=0x1326d7340, frame=0x4a1db0220, webPageID=15, frameID=3, resourceID=32] WebLoaderStrategy::scheduleLoad: Resource is being scheduled with the NetworkProcess (priority=2) This new form is a lot more verbose, but it really helps in tracing activity from the top of our page/frame/resource load stack to the bottom. No new tests - no added or changed functionality. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): (WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler): (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): (WebKit::WebLoaderStrategy::networkProcessCrashed): (WebKit::WebLoaderStrategy::loadResourceSynchronously): * WebProcess/Network/WebLoaderStrategy.h: 2020-01-06 Luming Yin Add WKWebView SPI to query _WKMediaMutedState https://bugs.webkit.org/show_bug.cgi?id=205789 Reviewed by Eric Carlson. Add plumbing for clients to query the media muted state on WKWebView. * SourcesCocoa.txt: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _mediaMutedState]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/MediaUtilities.h: Renamed from Source/WebKit/UIProcess/Cocoa/MediaCaptureUtilities.h. * UIProcess/Cocoa/MediaUtilities.mm: Renamed from Source/WebKit/UIProcess/Cocoa/MediaCaptureUtilities.mm. (WebKit::toWKMediaCaptureState): (WebKit::toWKMediaMutedState): * UIProcess/Cocoa/UIDelegate.mm: * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::mutedStateFlags const): * WebKit.xcodeproj/project.pbxproj: 2020-01-05 Dean Jackson Rename GraphicsContext3D to GraphicsContextGL https://bugs.webkit.org/show_bug.cgi?id=205778 Reviewed by Sam Weinig. Rename all the GraphicsContext3D things to GraphicsContextGL (includes Extensions3D and GRAPHICS_CONTEXT_3D). GraphicsContext3DBase now becomes GraphicsContextGL. GraphicsContext3D is now GraphicsContextGLOpenGL (since it represents the OpenGL implementation of the API). * CMakeLists.txt: * UIProcess/gtk/WaylandCompositor.cpp: (WebKit::WaylandCompositor::initializeEGL): * UIProcess/mac/HighPerformanceGPUManager.cpp: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::copyVideoTextureToPlatformTexture): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/mac/WebPageMac.mm: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::displayConfigurationChanged): 2020-01-06 Rob Buis Remove unused GlobalFrameID from NetworkCacheSpeculativeLoad https://bugs.webkit.org/show_bug.cgi?id=205796 Reviewed by Chris Dumez. Remove unused GlobalFrameID from NetworkCacheSpeculativeLoad and NetworkCache::update. No change in behavior. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didReceiveResponse): * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::update): * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad): (WebKit::NetworkCache::SpeculativeLoad::didReceiveResponse): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: 2020-01-06 Per Arne Vollan [iOS] Issue mach lookup extension to launch services daemon for Mail https://bugs.webkit.org/show_bug.cgi?id=205316 Reviewed by Brent Fulgham. Issue mach lookup extension to "com.apple.lsd.open" for Mail, since this service will be removed from the WebContent sandbox. Test: fast/sandbox/ios/sandbox-mach-lookup-mail.html * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h: * UIProcess/API/Cocoa/WKWebViewTesting.mm: (+[WKWebView _setApplicationBundleIdentifier:]): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): (WebKit::WebProcessPool::platformInitializeNetworkProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2020-01-06 Youenn Fablet RemoteVideoSample::create does not need to take a MediaSample r value https://bugs.webkit.org/show_bug.cgi?id=205793 Reviewed by Eric Carlson. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: 2020-01-06 youenn fablet Implement RTC VTB encoders in GPUProcess https://bugs.webkit.org/show_bug.cgi?id=205713 Reviewed by Eric Carlson. Add support for remote video encoders in GPUProcess based on libwebrtc exposed routines. WebProcess sets callbacks in the webrtc backend to implement H264 encoding as a remote video encoder. In addition to video frames, we also need to send rate setting orders. * Configurations/WebKit.xcconfig: * GPUProcess/webrtc/LibWebRTCCodecsProxy.h: * GPUProcess/webrtc/LibWebRTCCodecsProxy.messages.in: * GPUProcess/webrtc/LibWebRTCCodecsProxy.mm: (WebKit::LibWebRTCCodecsProxy::~LibWebRTCCodecsProxy): (WebKit::LibWebRTCCodecsProxy::createEncoder): (WebKit::LibWebRTCCodecsProxy::releaseEncoder): (WebKit::LibWebRTCCodecsProxy::initializeEncoder): (WebKit::toWebRTCVideoRotation): (WebKit::LibWebRTCCodecsProxy::encodeFrame): (WebKit::LibWebRTCCodecsProxy::setEncodeRates): * Scripts/webkit/messages.py: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp: (WebKit::createVideoEncoder): (WebKit::releaseVideoEncoder): (WebKit::initializeVideoEncoder): (WebKit::toMediaSampleVideoRotation): (WebKit::encodeVideoFrame): (WebKit::registerEncodeCompleteCallback): (WebKit::setEncodeRatesCallback): (WebKit::LibWebRTCCodecs::setCallbacks): (WebKit::LibWebRTCCodecs::createDecoder): (WebKit::LibWebRTCCodecs::releaseDecoder): (WebKit::LibWebRTCCodecs::failedDecoding): (WebKit::LibWebRTCCodecs::completedDecoding): (WebKit::LibWebRTCCodecs::createEncoder): (WebKit::LibWebRTCCodecs::releaseEncoder): (WebKit::LibWebRTCCodecs::initializeEncoder): (WebKit::LibWebRTCCodecs::encodeFrame): (WebKit::LibWebRTCCodecs::registerEncodeFrameCallback): (WebKit::LibWebRTCCodecs::setEncodeRates): (WebKit::LibWebRTCCodecs::completedEncoding): (WebKit::LibWebRTCCodecs::pixelBufferPool): * WebProcess/GPU/webrtc/LibWebRTCCodecs.h: * WebProcess/GPU/webrtc/LibWebRTCCodecs.messages.in: * WebProcess/GPU/webrtc/RTCEncoderIdentifier.h: Added. * WebProcess/Network/webrtc/LibWebRTCProvider.cpp: (WebKit::LibWebRTCProvider::createDecoderFactory): 2020-01-05 Eric Carlson [Media in GPU process] Add remote MIME type cache https://bugs.webkit.org/show_bug.cgi?id=205763 Reviewed by Dean Jackson. * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: (WebKit::RemoteMediaPlayerManagerProxy::supportsTypeAndCodecs): (WebKit::RemoteMediaPlayerManagerProxy::canDecodeExtendedType): (WebKit::RemoteMediaPlayerManagerProxy::supportsType): Deleted. * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in: * Sources.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/media/RemoteMediaPlayerMIMETypeCache.cpp: Added. (WebKit::RemoteMediaPlayerMIMETypeCache::RemoteMediaPlayerMIMETypeCache): (WebKit::RemoteMediaPlayerMIMETypeCache::mimeCache const): (WebKit::RemoteMediaPlayerMIMETypeCache::isAvailable const): (WebKit::RemoteMediaPlayerMIMETypeCache::staticContainerTypeList): (WebKit::RemoteMediaPlayerMIMETypeCache::isUnsupportedContainerType): (WebKit::RemoteMediaPlayerMIMETypeCache::canDecodeExtendedType): (WebKit::RemoteMediaPlayerMIMETypeCache::supportsTypeAndCodecs): (WebKit::RemoteMediaPlayerMIMETypeCache::initializeCache): * WebProcess/GPU/media/RemoteMediaPlayerMIMETypeCache.h: Added. * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::mimeCaches): (WebKit::RemoteMediaPlayerManager::typeCache): (WebKit::RemoteMediaPlayerManager::initialize): (WebKit::RemoteMediaPlayerManager::getSupportedTypes): (WebKit::RemoteMediaPlayerManager::supportsTypeAndCodecs): * WebProcess/GPU/media/RemoteMediaPlayerManager.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::setMediaMIMETypes): 2020-01-05 Sam Weinig Further simplify StringBuilder usage by standardizing hex formating to a single hex() function https://bugs.webkit.org/show_bug.cgi?id=205759 Reviewed by Dean Jackson. * UIProcess/DeviceIdHashSaltStorage.cpp: (WebKit::DeviceIdHashSaltStorage::completeDeviceIdHashSaltForOriginCall): * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::loggingString): Replace appendUnsignedAsHex() with append(hex()). 2020-01-05 Simon Fraser DumpRenderTree doesn't always call updateRendering() when a test completes https://bugs.webkit.org/show_bug.cgi?id=205761 Reviewed by Darin Adler. Use the QuartzCore SPI header. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: 2020-01-04 Keith Rollin Reformat WebPage logging https://bugs.webkit.org/show_bug.cgi?id=205705 Reviewed by Alex Christensen. Update the format used by WebPage in its RELEASE_LOG logging. Use the format used by WebPageProxy and NetworkResourceLoader, which is generally of the form: - [] ::: So, for example: 0x7f83ba009208 - WebPage (webPageID=15) - Adding a reason 1 to freeze layer tree (now 1); old reasons were 0 becomes: 0x7f83ba009208 - [webPageID=15] WebPage::freezeLayerTree: Adding a reason to freeze layer tree (reason=1, new=1, old=0) No new tests - no added or changed functionality. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_overriddenMediaType): (WebKit::WebPage::createPlugin): (WebKit::WebPage::freezeLayerTree): (WebKit::WebPage::unfreezeLayerTree): (WebKit::WebPage::markLayersVolatile): (WebKit::WebPage::cancelMarkLayersVolatile): (WebKit::WebPage::touchEventSync): 2020-01-03 Chris Dumez Add support for DragEvent https://bugs.webkit.org/show_bug.cgi?id=205758 Reviewed by Darin Adler. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick): 2020-01-03 Garrett Davidson IconLoadingClient::getLoadDecisionForIcon() leaks an Objective-C block https://bugs.webkit.org/show_bug.cgi?id=205750 Reviewed by Wenson Hsieh. Replace a Block_copy with makeBlockPtr to prevent leaking the ObjC block. * UIProcess/Cocoa/IconLoadingDelegate.mm: (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon): 2020-01-03 Tim Horton Crashes under -[WKWebView _addUpdateVisibleContentRectPreCommitHandler]_block_invoke https://bugs.webkit.org/show_bug.cgi?id=205749 Reviewed by Simon Fraser. Implement a speculative fix for a common crash. We believe that this is due to a mechanism UIKit uses to bounce -dealloc (in our case, of WKWebView and/or WKContentView) to the main thread when the last reference is dropped on a background thread. At that point, deallocation has already begun, -retain cannot revive the object, but -dealloc has not yet been called (because of the nature of this mechanism). To avoid this, make PageClientImpl -> WKContentView and WKContentView -> WKWebView weak instead of raw references. This way, we won't even get to _addUpdateVisibleContentRectPreCommitHandler with a deallocating WKWebView, nor try (and fail) to retain it for later use in the block. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::viewSize): (WebKit::PageClientImpl::didPerformDictionaryLookup): (WebKit::PageClientImpl::createValidationBubble): (WebKit::PageClientImpl::createDataListSuggestionsDropdown): (WebKit::PageClientImpl::createDrawingView): * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView _commonInitializationWithProcessPool:configuration:]): (-[WKContentView webView]): (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): (-[WKContentView _didCommitLayerTree:]): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView _updateLongPressAndHighlightLongPressGestures]): (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason:]): (-[WKContentView gestureRecognizerMayPinchToZoomWebView:]): (-[WKContentView _showAttachmentSheet]): (-[WKContentView _actionForLongPressFromPositionInformation:]): (-[WKContentView gestureRecognizerShouldBegin:]): (-[WKContentView hasSelectablePositionAtPoint:]): (-[WKContentView pointIsNearMarkedText:]): (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): (-[WKContentView _stylusSingleTapRecognized:]): (-[WKContentView _endPotentialTapAndEnableDoubleTapGesturesIfNecessary]): (-[WKContentView _updateInteractionTintColor]): (-[WKContentView canPerformActionForWebView:withSender:]): (-[WKContentView accessibilityRetrieveSpeakSelectionContent]): (-[WKContentView requestRectsToEvadeForSelectionCommandsWithCompletionHandler:]): (-[WKContentView accessoryAutoFill]): (-[WKContentView _updateAccessory]): (-[WKContentView _didChangeWebViewEditability]): (-[WKContentView insertTextSuggestion:]): (-[WKContentView isScrollableForKeyboardScrollViewAnimator:]): (-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:inDirection:]): (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]): (-[WKContentView addFocusedFormControlOverlay]): (-[WKContentView presentViewControllerForCurrentFocusedElement]): (-[WKContentView dismissAllInputViewControllers:]): (-[WKContentView _showShareSheet:inRect:completionHandler:]): (-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]): (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]): (-[WKContentView dataDetectionContextForPositionInformation:]): (-[WKContentView actionSheetAssistant:getAlternateURLForImage:completion:]): (-[WKContentView _didChangeDragInteractionPolicy]): (-[WKContentView dragLiftDelay]): (-[WKContentView setupDragAndDropInteractions]): (-[WKContentView _didPerformDragOperation:]): (-[WKContentView _dragDestinationActionForDropSession:]): (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationLists:stagedDragSource:]): (-[WKContentView _handleDropByInsertingImagePlaceholders:session:]): (-[WKContentView _dragInteraction:dataOwnerForSession:]): (-[WKContentView dragInteraction:previewForLiftingItem:session:]): (-[WKContentView dragInteraction:sessionWillBegin:]): (-[WKContentView dragInteraction:session:didEndWithOperation:]): (-[WKContentView dragInteraction:previewForCancellingItem:withDefault:]): (-[WKContentView _dropInteraction:dataOwnerForSession:]): (-[WKContentView dropInteraction:sessionDidUpdate:]): (-[WKContentView dropInteraction:performDrop:]): (-[WKContentView dismissQuickboardViewControllerAndRevealFocusedFormOverlayIfNecessary:]): (-[WKContentView viewController:inputContextViewHeightForSize:]): (-[WKContentView inputContextViewForViewController:]): (-[WKContentView _registerPreview]): (-[WKContentView assignLegacyDataForContextMenuInteraction]): (-[WKContentView _contextMenuInteraction:configurationForMenuAtLocation:completion:]): (-[WKContentView continueContextMenuInteraction:]): (-[WKContentView _createTargetedPreviewIfPossible]): (-[WKContentView contextMenuInteraction:willDisplayMenuForConfiguration:animator:]): (-[WKContentView contextMenuInteraction:willPerformPreviewActionForMenuWithConfiguration:animator:]): (-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]): (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]): (-[WKContentView _dataForPreviewItemController:atPosition:type:]): (-[WKContentView _presentedViewControllerForPreviewItemController:]): (-[WKContentView _previewItemController:commitPreview:]): (-[WKContentView _previewItemController:didDismissPreview:committing:]): 2020-01-03 Peng Liu Update the RemoteMediaPlayerManagerProxy::Load XPC message to provide the updated RemoteMediaPlayerConfiguration to the web process https://bugs.webkit.org/show_bug.cgi?id=205740 Reviewed by Eric Carlson. * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: (WebKit::RemoteMediaPlayerManagerProxy::load): * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in: * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::load): * GPUProcess/media/RemoteMediaPlayerProxy.h: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote::load): 2020-01-03 Andy Estes [Apple Pay] Provide a better error message when Apple Pay blocks user agent script evaluation https://bugs.webkit.org/show_bug.cgi?id=205730 Reviewed by Brady Eidson. * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::userAgentScriptsBlockedErrorMessage const): * WebProcess/ApplePay/WebPaymentCoordinator.h: 2020-01-03 Dean Jackson Provide pid to crashing service worker process and GPU process https://bugs.webkit.org/show_bug.cgi?id=205564 Build fix for TestWebKitAPI. * UIProcess/API/C/WKContext.h: 2020-01-03 Yusuke Suzuki Put more WebCore/WebKit JS objects into IsoSubspace https://bugs.webkit.org/show_bug.cgi?id=205711 Reviewed by Keith Miller. * WebProcess/Plugins/Netscape/JSNPMethod.h: * WebProcess/Plugins/Netscape/JSNPObject.h: 2020-01-03 Simon Fraser Add some shared schemes to the WebKit.xcworkspace https://bugs.webkit.org/show_bug.cgi?id=205698 Reviewed by Tim Horton. Make WebKit.xcworkspace show the following schemes by default: All Source All Tools WTF JavaScriptCore WebCore WebKit WebKitLegacy DumpRenderTree WebKitTestRunner TestWebKitAPI MiniBrowser MobileMiniBrowser. Also remove the MobileMiniBrowserUITests scheme. * WebKit.xcodeproj/xcshareddata/xcschemes/WebKit.xcscheme: Copied from Tools/MobileMiniBrowser/MobileMiniBrowser.xcodeproj/xcshareddata/xcschemes/MobileMiniBrowserUITests.xcscheme. 2020-01-03 youenn fablet Provide pid to crashing service worker process and GPU process https://bugs.webkit.org/show_bug.cgi?id=205564 Reviewed by Alex Christensen. No change of behavior, we provide pids to the WKContext callbacks. * UIProcess/API/C/WKContext.h: * UIProcess/API/C/WKContextPrivate.h: * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::gpuProcessCrashed): * UIProcess/WebContextClient.cpp: (WebKit::WebContextClient::serviceWorkerProcessDidCrash): (WebKit::WebContextClient::gpuProcessDidCrash): * UIProcess/WebContextClient.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::serviceWorkerProcessCrashed): (WebKit::WebProcessPool::gpuProcessCrashed): * UIProcess/WebProcessPool.h: 2020-01-03 Alex Christensen Deprecate _WKWebsitePolicies https://bugs.webkit.org/show_bug.cgi?id=205539 Reviewed by Wenson Hsieh. Its last use was removed in rdar://problem/58064847 but we need to keep it in WebKit until the next Safari release to keep Safari working with built versions of open source WebKit with run-safari. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _updateWebsitePolicies:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): 2020-01-03 youenn fablet NetworkResourceLoader::didFinishWithRedirectResponse should not assume the load is coming from network https://bugs.webkit.org/show_bug.cgi?id=205715 Reviewed by Alex Christensen. Covered by updated test. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didFinishWithRedirectResponse): If redirection is coming from cache, the load is not null. We just need to use the request URL since the redirection mode is manual. 2020-01-03 Chris Dumez Unreviewed, drop new assertion added in r253984 which hits on OpenSource bots * Shared/ios/DependencyProcessAssertionIOS.mm: (WebKit::DependencyProcessAssertion::DependencyProcessAssertion): 2020-01-03 Chris Dumez Improve release logging in ServiceWorkerFetchTask https://bugs.webkit.org/show_bug.cgi?id=205692 Reviewed by Youenn Fablet. Improve release logging in ServiceWorkerFetchTask to facilitate debugging. * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask): (WebKit::ServiceWorkerFetchTask::~ServiceWorkerFetchTask): (WebKit::ServiceWorkerFetchTask::start): (WebKit::ServiceWorkerFetchTask::contextClosed): (WebKit::ServiceWorkerFetchTask::startFetch): (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse): (WebKit::ServiceWorkerFetchTask::didReceiveResponse): (WebKit::ServiceWorkerFetchTask::didFinish): (WebKit::ServiceWorkerFetchTask::didFail): (WebKit::ServiceWorkerFetchTask::didNotHandle): (WebKit::ServiceWorkerFetchTask::cannotHandle): (WebKit::ServiceWorkerFetchTask::cancelFromClient): (WebKit::ServiceWorkerFetchTask::continueDidReceiveFetchResponse): (WebKit::ServiceWorkerFetchTask::continueFetchTaskWith): (WebKit::ServiceWorkerFetchTask::timeoutTimerFired): (WebKit::ServiceWorkerFetchTask::softUpdateIfNeeded): 2020-01-03 youenn fablet Fix non-libwebrtc builds after r253957 https://bugs.webkit.org/show_bug.cgi?id=205714 Unreviewed. * GPUProcess/webrtc/LibWebRTCCodecsProxy.mm: Move the includes inside the compilation guard. 2020-01-02 Keith Rollin Reformat WebProcess logging https://bugs.webkit.org/show_bug.cgi?id=205691 Reviewed by Chris Dumez. Update the format used by WebProcess in its RELEASE_LOG logging. Use the format used by WebPageProxy and NetworkResourceLoader, which is generally of the form: - [] ::: So, for example: 0x6f1df7000 - WebProcess::destroyRenderingResources() took 0.02ms becomes: 0x6f1df7000 - [sessionID=2] WebProcess::destroyRenderingResources: took 0.02ms While we're at it, also convert over to the RELEASE_LOG_IF_ALLOWED style of logging macro. We didn't used to be able to do this since the decision on whether or not to allow logging is typically based on SessionID, which didn't used to be an attribute of WebProcess. Now WebProcesses do (or can) have a SessionID, so use that to support the hiding of logging in private sessions. No new tests - no added or changed functionality. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): (WebKit::WebProcess::prepareToSuspend): (WebKit::WebProcess::markAllLayersVolatile): (WebKit::WebProcess::freezeAllLayerTrees): (WebKit::WebProcess::unfreezeAllLayerTrees): (WebKit::WebProcess::processDidResume): (WebKit::WebProcess::grantUserMediaDeviceSandboxExtensions): (WebKit::WebProcess::revokeUserMediaDeviceSandboxExtensions): * WebProcess/WebProcess.h: (WebKit::WebProcess::isAlwaysOnLoggingAllowed): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::updateProcessName): (WebKit::WebProcess::updateCPUMonitorState): (WebKit::WebProcess::destroyRenderingResources): (WebKit::WebProcess::updateFreezerStatus): 2020-01-02 Yusuke Suzuki and Simon Fraser Experiment: create lots of different malloc zones for easier accounting of memory use https://bugs.webkit.org/show_bug.cgi?id=186422 Reviewed by Saam Barati. * Shared/ShareableBitmap.cpp: (WebKit::ShareableBitmap::create): (WebKit::ShareableBitmap::~ShareableBitmap): * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::HistoryEntryDataEncoder::HistoryEntryDataEncoder): (WebKit::HistoryEntryDataEncoder::finishEncoding): (WebKit::encodeSessionHistoryEntryData): (WebKit::encodeLegacySessionState): 2020-01-02 Chris Dumez [iOS] Replace "unexpectedly resumed" observer with RunningBoard suspendible assertions https://bugs.webkit.org/show_bug.cgi?id=205687 Reviewed by Tim Horton. Adopt new RunningBoard process assertion to indicate that WebContent processes depend on their UIProcess (and therefore, the UIProcess must be running if the WebContent process is). This replaces our "Unexpectedly resumed" assertion which was causing unexpected terminations in some cases. * Configurations/WebKit.xcconfig: * Platform/spi/ios/RunningBoardServicesSPI.h: Added. * Scripts/process-entitlements.sh: * Shared/DependencyProcessAssertion.cpp: Added. (WebKit::DependencyProcessAssertion::DependencyProcessAssertion): (WebKit::DependencyProcessAssertion::~DependencyProcessAssertion): * Shared/DependencyProcessAssertion.h: Added. * Shared/ios/DependencyProcessAssertionIOS.mm: Added. (WebKit::DependencyProcessAssertion::DependencyProcessAssertion): (WebKit::DependencyProcessAssertion::~DependencyProcessAssertion): * Sources.txt: * SourcesCocoa.txt: * UIProcess/Cocoa/WebProcessProxyCocoa.mm: * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeConnection): * WebProcess/WebProcess.h: * WebProcess/cocoa/WebProcessCocoa.mm: 2020-01-02 Keith Rollin Reformat WebProcessCache logging https://bugs.webkit.org/show_bug.cgi?id=205683 Reviewed by Alex Christensen. Update the format used by WebProcessCache in its RELEASE_LOG logging. Use the format used by WebPageProxy and NetworkResourceLoader, which is generally of the form: - [] ::: So, for example: 0x1145ed208 - WebProcessCache::canCacheProcess(): Not caching process 83671 because it does not have an associated registrable domain becomes: 0x1145ed208 - [PID=83671] WebProcessCache::canCacheProcess: Not caching process because it does not have an associated registrable domain No new tests - no added or changed functionality. * UIProcess/WebProcessCache.cpp: (WebKit::WebProcessCache::canCacheProcess const): (WebKit::WebProcessCache::addProcessIfPossible): (WebKit::WebProcessCache::addProcess): (WebKit::WebProcessCache::takeProcess): (WebKit::WebProcessCache::updateCapacity): (WebKit::WebProcessCache::clear): (WebKit::WebProcessCache::clearAllProcessesForSession): (WebKit::WebProcessCache::setApplicationIsActive): (WebKit::WebProcessCache::removeProcess): 2020-01-02 Keith Rollin Reformat ProcessThrottler logging https://bugs.webkit.org/show_bug.cgi?id=205679 Reviewed by Alex Christensen. Update the format used by ProcessThrottler in its RELEASE_LOG logging. Use the format used by WebPageProxy and NetworkResourceLoader, which is generally of the form: - [] ::: So, for example: [PID: 0] 0x1145ce5e8 - ProcessThrottler::invalidateAllActivities() BEGIN becomes: 0x1145ce5e8 - [PID: 0] ProcessThrottler::invalidateAllActivities: BEGIN No new tests - no added or changed functionality. * UIProcess/ProcessThrottler.cpp: (WebKit::ProcessThrottler::invalidateAllActivities): (WebKit::ProcessThrottler::setAssertionState): (WebKit::ProcessThrottler::updateAssertionIfNeeded): (WebKit::ProcessThrottler::didConnectToProcess): (WebKit::ProcessThrottler::prepareToSuspendTimeoutTimerFired): (WebKit::ProcessThrottler::processReadyToSuspend): (WebKit::ProcessThrottler::sendPrepareToSuspendIPC): (WebKit::ProcessThrottler::uiAssertionWillExpireImminently): * UIProcess/ProcessThrottler.h: (WebKit::ProcessThrottler::Activity::Activity): (WebKit::ProcessThrottler::Activity::invalidate): 2020-01-02 Keith Rollin Reformat WebResourceLoader logging https://bugs.webkit.org/show_bug.cgi?id=205680 Reviewed by Alex Christensen. Update the format used by WebResourceLoader in its RELEASE_LOG logging. Use the format used by WebPageProxy and NetworkResourceLoader, which is generally of the form: - [] ::: So, for example: 0x4a1dbcb58 - WebResourceLoader::didFinishResourceLoad: (webPageID=15, frameID=3, resourceID=1, length=212132) becomes: 0x4a1dbcb58 - [webPageID=15, frameID=3, resourceID=1] WebResourceLoader::didFinishResourceLoad: (length=212132) No new tests - no added or changed functionality. * 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): 2020-01-02 Alex Christensen Add SPI to disable CORS on requests to URLs matching a pattern https://bugs.webkit.org/show_bug.cgi?id=205534 Reviewed by Chris Dumez. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/API/APIPageConfiguration.cpp: (API::PageConfiguration::copy const): (API::PageConfiguration::PageConfiguration): Deleted. (API::PageConfiguration::~PageConfiguration): Deleted. * UIProcess/API/APIPageConfiguration.h: (API::PageConfiguration::corsDisablingPatterns const): (API::PageConfiguration::setCORSDisablingPatterns): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration _corsDisablingPatterns]): (-[WKWebViewConfiguration _setCORSDisablingPatterns:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/WebPageProxy.cpp: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_overriddenMediaType): 2020-01-02 Sam Weinig Simplify StringBuilder API/align with makeString by removing appendFixed* functions and using FormatNumber struct instead https://bugs.webkit.org/show_bug.cgi?id=205671 Reviewed by Alex Christensen. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::dumpContentsToFile): * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::asJSON const): * Shared/Gamepad/GamepadData.cpp: (WebKit::GamepadData::loggingString const): Replace all uses of builder.appendFixedPrecisionNumber(...) with builder.append(FormattedNumber::fixedPrecision(...)). 2020-01-02 Carlos Garcia Campos [GTK] Make ondemand hardware acceleration policy never leave AC mode https://bugs.webkit.org/show_bug.cgi?id=205558 Reviewed by Sergio Villar Senin. We still enter AC mode on demand but we never leave it for the same drawing area. This avoids scrolling performance problems with some websites that start small accelerated animation while scrolling (like WebKit bugzilla review tool), due to constant enter/leave AC mode. * UIProcess/API/glib/WebKitSettings.cpp: (webkit_settings_class_init): Update API documentation. * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode): Force AC mode the first time we enter it. 2019-12-22 Jeff Miller Update user-visible copyright strings to include 2020 https://bugs.webkit.org/show_bug.cgi?id=205552 Reviewed by Darin Adler. * GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-OSX.plist: * GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-iOS.plist: * 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: * WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-OSX.plist: * WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-iOS.plist: 2019-12-31 Peng Liu Add remote media resource loader for the GPU process https://bugs.webkit.org/show_bug.cgi?id=205379 Reviewed by Youenn Fablet. In the GPU process, the RemoteMediaResourceLoader creates RemoteMediaResource(s), which will notify the media resource clients (WebCoreNSURLSessionDataTaskClient). Then the data will be forwarded to AVFoundation. In the Web process, MeidaResourceLoader creates MediaResource(s), which take care of downloading media data through the network process. The received data will be forwarded to RemoteMediaResourceProxy, which will forward the data to the corresponding RemoteMediaResource through XPC messages. (WebKit::GPUConnectionToWebProcess::remoteMediaResourceManager): (WebKit::GPUConnectionToWebProcess::didReceiveMessage): * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::~RemoteMediaPlayerProxy): (WebKit::RemoteMediaPlayerProxy::requestResource): (WebKit::RemoteMediaPlayerProxy::removeResource): (WebKit::RemoteMediaPlayerProxy::mediaPlayerCreateResourceLoader): * GPUProcess/media/RemoteMediaPlayerProxy.h: (WebKit::RemoteMediaPlayerProxy::~RemoteMediaPlayerProxy): Deleted. (WebKit::RemoteMediaPlayerProxy::mediaPlayerLogIdentifier): Deleted. * GPUProcess/media/RemoteMediaResource.cpp: Added. (WebKit::RemoteMediaResource::create): (WebKit::RemoteMediaResource::RemoteMediaResource): (WebKit::RemoteMediaResource::~RemoteMediaResource): (WebKit::RemoteMediaResource::stop): (WebKit::RemoteMediaResource::didPassAccessControlCheck const): (WebKit::RemoteMediaResource::responseReceived): (WebKit::RemoteMediaResource::redirectReceived): (WebKit::RemoteMediaResource::shouldCacheResponse): (WebKit::RemoteMediaResource::dataSent): (WebKit::RemoteMediaResource::dataReceived): (WebKit::RemoteMediaResource::accessControlCheckFailed): (WebKit::RemoteMediaResource::loadFailed): (WebKit::RemoteMediaResource::loadFinished): * GPUProcess/media/RemoteMediaResource.h: Added. (WebKit::RemoteMediaResource::ready const): (WebKit::RemoteMediaResource::setReady): * GPUProcess/media/RemoteMediaResourceIdentifier.h: Added. * GPUProcess/media/RemoteMediaResourceLoader.cpp: Added. (WebKit::RemoteMediaResourceLoader::RemoteMediaResourceLoader): (WebKit::RemoteMediaResourceLoader::~RemoteMediaResourceLoader): (WebKit::RemoteMediaResourceLoader::requestResource): * GPUProcess/media/RemoteMediaResourceLoader.h: Added. * GPUProcess/media/RemoteMediaResourceManager.cpp: Added. (WebKit::RemoteMediaResourceManager::RemoteMediaResourceManager): (WebKit::RemoteMediaResourceManager::~RemoteMediaResourceManager): (WebKit::RemoteMediaResourceManager::addMediaResource): (WebKit::RemoteMediaResourceManager::removeMediaResource): (WebKit::RemoteMediaResourceManager::responseReceived): (WebKit::RemoteMediaResourceManager::redirectReceived): (WebKit::RemoteMediaResourceManager::dataSent): (WebKit::RemoteMediaResourceManager::dataReceived): (WebKit::RemoteMediaResourceManager::accessControlCheckFailed): (WebKit::RemoteMediaResourceManager::loadFailed): (WebKit::RemoteMediaResourceManager::loadFinished): * GPUProcess/media/RemoteMediaResourceManager.h: Added. * GPUProcess/media/RemoteMediaResourceManager.messages.in: Added. * WebProcess/GPU/GPUProcessConnection.h: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote): (WebKit::MediaPlayerPrivateRemote::requestResource): (WebKit::MediaPlayerPrivateRemote::removeResource): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/MediaPlayerPrivateRemoteIdentifier.h: * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::supportsTypeAndCodecs): (WebKit::RemoteMediaPlayerManager::originsInMediaCache): (WebKit::RemoteMediaPlayerManager::clearMediaCacheForOrigins): (WebKit::RemoteMediaPlayerManager::networkStateChanged): (WebKit::RemoteMediaPlayerManager::readyStateChanged): (WebKit::RemoteMediaPlayerManager::volumeChanged): (WebKit::RemoteMediaPlayerManager::muteChanged): (WebKit::RemoteMediaPlayerManager::timeChanged): (WebKit::RemoteMediaPlayerManager::durationChanged): (WebKit::RemoteMediaPlayerManager::rateChanged): (WebKit::RemoteMediaPlayerManager::playbackStateChanged): (WebKit::RemoteMediaPlayerManager::engineFailedToLoad): (WebKit::RemoteMediaPlayerManager::requestResource): (WebKit::RemoteMediaPlayerManager::removeResource): * WebProcess/GPU/media/RemoteMediaPlayerManager.h: (WebKit::RemoteMediaPlayerManager::didReceiveMessageFromGPUProcess): (WebKit::RemoteMediaPlayerManager::didReceiveMessageFromWebProcess): Deleted. * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in: * WebProcess/GPU/media/RemoteMediaResourceProxy.cpp: Added. (WebKit::RemoteMediaResourceProxy::RemoteMediaResourceProxy): (WebKit::RemoteMediaResourceProxy::~RemoteMediaResourceProxy): (WebKit::RemoteMediaResourceProxy::responseReceived): (WebKit::RemoteMediaResourceProxy::redirectReceived): (WebKit::RemoteMediaResourceProxy::shouldCacheResponse): (WebKit::RemoteMediaResourceProxy::dataSent): (WebKit::RemoteMediaResourceProxy::dataReceived): (WebKit::RemoteMediaResourceProxy::accessControlCheckFailed): (WebKit::RemoteMediaResourceProxy::loadFailed): (WebKit::RemoteMediaResourceProxy::loadFinished): * WebProcess/GPU/media/RemoteMediaResourceProxy.h: Added. 2019-12-31 youenn fablet Implement RTC VTB decoders in GPUProcess https://bugs.webkit.org/show_bug.cgi?id=205607 Reviewed by Eric Carlson. Implement decoder factory callbacks. Implement WebProcess codecs by sending IPC for creating/releasing/decoding a frame. WebProcess receives IPC messages from GPU Process whenever a frame is decoded. * Configurations/WebKit.xcconfig: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::libWebRTCCodecsProxy): (WebKit::GPUConnectionToWebProcess::didReceiveMessage): * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/webrtc/LibWebRTCCodecsProxy.h: Added. (WebKit::LibWebRTCCodecsProxy::didReceiveMessageFromWebProcess): * GPUProcess/webrtc/LibWebRTCCodecsProxy.messages.in: Added. * GPUProcess/webrtc/LibWebRTCCodecsProxy.mm: Added. (WebKit::LibWebRTCCodecsProxy::LibWebRTCCodecsProxy): (WebKit::LibWebRTCCodecsProxy::~LibWebRTCCodecsProxy): (WebKit::LibWebRTCCodecsProxy::createDecoder): (WebKit::LibWebRTCCodecsProxy::releaseDecoder): (WebKit::LibWebRTCCodecsProxy::decodeFrame): * Scripts/webkit/messages.py: * Sources.txt: * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/GPUProcessConnection.cpp: (WebKit::GPUProcessConnection::didReceiveMessage): * WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp: Added. (WebKit::createVideoDecoder): (WebKit::releaseVideoDecoder): (WebKit::decodeVideoFrame): (WebKit::registerDecodeCompleteCallback): (WebKit::LibWebRTCCodecs::setVideoDecoderCallbacks): (WebKit::LibWebRTCCodecs::createDecoder): (WebKit::LibWebRTCCodecs::releaseDecoder): (WebKit::LibWebRTCCodecs::decodeFrame): (WebKit::LibWebRTCCodecs::registerDecodeFrameCallback): (WebKit::LibWebRTCCodecs::failedDecoding): (WebKit::LibWebRTCCodecs::completedDecoding): * WebProcess/GPU/webrtc/LibWebRTCCodecs.h: Added. * WebProcess/GPU/webrtc/LibWebRTCCodecs.messages.in: Added. * WebProcess/GPU/webrtc/RTCDecoderIdentifier.h: Added. * WebProcess/Network/webrtc/LibWebRTCProvider.cpp: (WebKit::LibWebRTCProvider::createDecoderFactory): * WebProcess/Network/webrtc/LibWebRTCProvider.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::libWebRTCCodecs): * WebProcess/WebProcess.h: 2019-12-30 Brady Eidson Add WKWebView SPI to evaluate a function with arguments https://bugs.webkit.org/show_bug.cgi?id=205239 Reviewed by Alex Christensen. * Shared/API/APISerializedScriptValue.h: * UIProcess/API/C/WKPage.cpp: (WKPageRunJavaScriptInMainFrame): * UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm: (API::sharedContext): (API::SerializedScriptValue::deserialize): (API::SerializedScriptValue::wireBytesFromNSObject): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView evaluateJavaScript:completionHandler:]): (validateArgument): (-[WKWebView _evaluateJavaScript:asAsyncFunction:withArguments:forceUserGesture:completionHandler:]): (-[WKWebView _callAsyncFunction:withArguments:completionHandler:]): (-[WKWebView _evaluateJavaScriptWithoutUserGesture:completionHandler:]): (-[WKWebView _evaluateJavaScript:forceUserGesture:completionHandler:]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/glib/WebKitWebView.cpp: (webkit_web_view_run_javascript): (webkit_web_view_run_javascript_in_world): (resourcesStreamReadCallback): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runJavaScriptInMainFrame): (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld): * UIProcess/WebPageProxy.h: * UIProcess/socket/RemoteInspectorProtocolHandler.cpp: (WebKit::RemoteInspectorProtocolHandler::runScript): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::runJavaScript): (WebKit::WebPage::runJavaScriptInMainFrameScriptWorld): (WebKit::WebPage::runJavaScriptInFrame): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2019-12-29 Peng Liu Tweak the format and comment in the code to support media in GPU process https://bugs.webkit.org/show_bug.cgi?id=205631 Reviewed by Eric Carlson. No new tests, no functional change. * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: (WebKit::RemoteMediaPlayerManagerProxy::logChannel const): * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: * GPUProcess/media/RemoteMediaPlayerProxy.h: * GPUProcess/media/RemoteMediaPlayerProxyConfiguration.h: * WebProcess/GPU/GPUProcessConnectionInfo.h: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: * WebProcess/GPU/media/MediaPlayerPrivateRemoteIdentifier.h: * WebProcess/GPU/media/RemoteMediaPlayerConfiguration.h: * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in: * WebProcess/GPU/media/RemoteMediaPlayerState.h: 2019-12-29 Eric Carlson Cleanup media IPC encoders https://bugs.webkit.org/show_bug.cgi?id=205630 Reviewed by Anders Carlsson. * GPUProcess/media/RemoteMediaPlayerProxyConfiguration.h: (WebKit::RemoteMediaPlayerProxyConfiguration::decode): * WebProcess/GPU/media/RemoteMediaPlayerConfiguration.h: (WebKit::RemoteMediaPlayerConfiguration::decode): 2019-12-28 Antti Koivisto Make simple line layout an internal feature https://bugs.webkit.org/show_bug.cgi?id=205615 Reviewed by Zalan Bujtas. So it can be enabled/disabled from run-webkit-tests command line. This also adds it to the internal feature menus, allowing removal of hardcoded menu entries. * Shared/WebPreferences.yaml: 2019-12-23 Darin Adler Refactor to simplify broadcasting to all media elements https://bugs.webkit.org/show_bug.cgi?id=205567 Reviewed by Eric Carlson. * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp: (WebKit::InjectedBundleHitTestResult::mediaType const): Use is. 2019-12-26 Carlos Garcia Campos [GTK][WPE] Remove duplicated code https://bugs.webkit.org/show_bug.cgi?id=205560 Reviewed by Sergio Villar Senin. Remove duplicated code related to IME between GTK and WPE that can be shared. * SourcesGTK.txt: * SourcesWPE.txt: * WebProcess/WebCoreSupport/glib/WebEditorClientGLib.cpp: Added. (WebKit::WebEditorClient::handleInputMethodKeydown): (WebKit::WebEditorClient::didDispatchInputMethodKeydown): * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp: * WebProcess/WebPage/glib/WebPageGLib.cpp: (WebKit::WebPage::setInputMethodState): * WebProcess/WebPage/gtk/WebPageGtk.cpp: * WebProcess/WebPage/wpe/WebPageWPE.cpp: 2019-12-24 Eric Carlson [Media in GPU process] Enable media player proxy logging https://bugs.webkit.org/show_bug.cgi?id=205557 Reviewed by Youenn Fablet. * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::create): (WebKit::GPUConnectionToWebProcess::GPUConnectionToWebProcess): (WebKit::GPUConnectionToWebProcess::logger): * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::createGPUConnectionToWebProcess): * GPUProcess/GPUProcess.h: * GPUProcess/GPUProcess.messages.in: * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: (WebKit::RemoteMediaPlayerManagerProxy::logger const): (WebKit::nullLogger): Deleted. * Platform/Logging.h: * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::openGPUProcessConnection): * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::logChannel const): 2019-12-24 youenn fablet Service Worker doesn't terminate after a period of time when thread blocking https://bugs.webkit.org/show_bug.cgi?id=202992 Reviewed by Chris Dumez. Add a preference to enable/disable service worker short timeouts. Add IPC handling for passing service worker heart beat failures and to get from WebProcess whether a given service worker is running or not. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::contextConnectionCreated): (WebKit::WebSWServerConnection::syncTerminateWorkerFromClient): (WebKit::WebSWServerConnection::isServiceWorkerRunning): * NetworkProcess/ServiceWorker/WebSWServerConnection.h: * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesGetServiceWorkerTestMode): (WKPreferencesSetServiceWorkerTestMode): * UIProcess/API/C/WKPreferencesRef.h: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::isServiceWorkerRunning): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::updatePreferencesStore): (WebKit::WebSWContextManagerConnection::didFailHeartBeatCheck): * WebProcess/Storage/WebSWContextManagerConnection.h: 2019-12-23 Alexey Proskuryakov watchOS build fix attempt Not sure what broke the build, seems like UserInterfaceIdiom.h used to be included via unified build, and no longer is. Added the include. While at it, removed an ancient __IPHONE_OS_VERSION_MIN_REQUIRED version check. * UIProcess/ios/forms/WKAirPlayRoutePicker.mm: 2019-12-23 Wenson Hsieh Unreviewed, fix the macCatalyst build after r253866 * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer): MediaPlayer::mediaKeysStorageDirectory() is guarded by ENABLE(LEGACY_ENCRYPTED_MEDIA). 2019-12-23 Carlos Garcia Campos WebDriver: fix handling of session timeouts for values higher than MAX_INT https://bugs.webkit.org/show_bug.cgi?id=204114 Reviewed by Brian Burg. Use number instead of integer for all optional timeout parameters. In the case of script timeout, not passing a value means a timeout should not be used, so use Optional also for the IPC message and handle the optional value in the web process to not set any timeout in that case. * UIProcess/Automation/Automation.json: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::waitForNavigationToComplete): (WebKit::WebAutomationSession::navigateBrowsingContext): (WebKit::WebAutomationSession::goBackInBrowsingContext): (WebKit::WebAutomationSession::goForwardInBrowsingContext): (WebKit::WebAutomationSession::reloadBrowsingContext): (WebKit::WebAutomationSession::evaluateJavaScriptFunction): * UIProcess/Automation/WebAutomationSession.h: * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): * WebProcess/Automation/WebAutomationSessionProxy.h: * WebProcess/Automation/WebAutomationSessionProxy.js: (let.AutomationSessionProxy.prototype.evaluateJavaScriptFunction): * WebProcess/Automation/WebAutomationSessionProxy.messages.in: 2019-12-23 Carlos Garcia Campos [GTK] InputMethod API unit tests don't work under X11 https://bugs.webkit.org/show_bug.cgi?id=205497 Reviewed by Žan Doberšek. Assume the web view is always focused when running tests under Xvfb, since there isn't a window manager to focus the toplevel window in that case. * UIProcess/API/glib/InputMethodFilter.cpp: (WebKit::InputMethodFilter::isViewFocused const): 2019-12-23 Carlos Garcia Campos [GTK][WPE] Special combination characters doesn't respect the keystroke order when high CPU load https://bugs.webkit.org/show_bug.cgi?id=185248 Reviewed by Žan Doberšek. Key events are queued by the WebPageProxy so that the next event is not sent to the web process until the previous one has been handled by the web process already. However, the composition results generated by key events are sent to the web process using IPC messages when they happen. In case of high CPU load it can happen that the composition results are sent to the web process even before the associated keys, that are still in the queue waiting to be sent. We need to ensure that composition results are always processed right after its associated key press event. So, instead of sending the results independently, we now include them as part of the key event. * Shared/NativeWebKeyboardEvent.h: Add optional preeditUnderlines and preeditSelectionRange parameters to constructor. * Shared/WebEvent.h: (WebKit::WebKeyboardEvent::preeditUnderlines const): Return the optional preeditUnderlines. (WebKit::WebKeyboardEvent::preeditSelectionRange const): Return the optional preeditSelectionRange. * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent): Copy preeditUnderlines and preeditSelectionRange too. * Shared/WebKeyboardEvent.cpp: (WebKit::WebKeyboardEvent::WebKeyboardEvent): Add optional preeditUnderlines and preeditSelectionRange parameters and initialize them. (WebKit::WebKeyboardEvent::encode const): Encode preeditUnderlines and preeditSelectionRange. (WebKit::WebKeyboardEvent::decode): Decode preeditUnderlines and preeditSelectionRange. * Shared/gtk/NativeWebKeyboardEventGtk.cpp: (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Add optional preeditUnderlines and preeditSelectionRange parameters and initialize them. * Shared/gtk/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebKeyboardEvent): Add optional preeditUnderlines and preeditSelectionRange parameters and pass them to WebKeyboardEvent constructor. * Shared/gtk/WebEventFactory.h: * Shared/libwpe/NativeWebKeyboardEventLibWPE.cpp: (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Add optional preeditUnderlines and preeditSelectionRange parameters and initialize them. * Shared/libwpe/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebKeyboardEvent): Add optional preeditUnderlines and preeditSelectionRang parameters and pass them to WebKeyboardEvent constructor. * Shared/libwpe/WebEventFactory.h: Add optional preeditUnderlines and preeditSelectionRange parameters to constructor. * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewSynthesizeCompositionKeyPress): Pass the preeditUnderlines and preeditSelectionRange to platform implementation. (webkitWebViewSetComposition): Remove the call to WebPageProxy::setComposition(). (webkitWebViewConfirmComposition): Remove the call to WebPageProxy::confirmComposition(). (webkitWebViewCancelComposition): Call WebPageProxy::cancelComposition(); * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseKeyPressEvent): Pass the preeditUnderlines and preeditSelectionRange to NativeWebKeyboardEvent constructor. (webkitWebViewBaseKeyReleaseEvent): Ditto. (webkitWebViewBaseSynthesizeCompositionKeyPress): Ditto. * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::handleKeyboardEvent): Ditto. (WKWPE::View::synthesizeCompositionKeyPress): Ditto. * UIProcess/API/wpe/WPEView.h: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: (WebKit::WebEditorClient::didDispatchInputMethodKeydown): Handle the composition results here, right after the associated key events has been dispatched. * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp: (WebKit::WebEditorClient::didDispatchInputMethodKeydown): Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::cancelComposition): Confirm the given string to cancel the composition. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Remove SetComposition message and rename ConfirmComposition as CancelComposition since it's now only used for canceling. 2019-12-22 Simon Fraser Make support for an internal feature, off by default https://bugs.webkit.org/show_bug.cgi?id=205542 Reviewed by Antti Koivisto. Make DialogElementEnabled an internal feature so it shows up in the menus and can be toggled on for experimentation. * Shared/WebPreferences.yaml: 2019-12-21 Simon Fraser Make support for an experimental feature, off by default https://bugs.webkit.org/show_bug.cgi?id=205542 Reviewed by Dean Jackson. Make DialogElementEnabled an experimental feature (off by default). * Shared/WebPreferences.yaml: 2019-12-21 Simon Fraser Make support for an experimental feature, off by default https://bugs.webkit.org/show_bug.cgi?id=205542 Reviewed by Dean Jackson. Make DialogElementEnabled an experimental feature (off by default). * Shared/WebPreferences.yaml: 2019-12-22 Eric Carlson [Media in GPU process] Add remote media player proxy configuration https://bugs.webkit.org/show_bug.cgi?id=205547 Reviewed by Tim Horton. * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: (WebKit::RemoteMediaPlayerManagerProxy::createMediaPlayer): * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in: * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::RemoteMediaPlayerProxy): (WebKit::RemoteMediaPlayerProxy::getConfiguration): (WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaKeysStorageDirectory const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerReferrer const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerUserAgent const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerSourceApplicationIdentifier const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerNetworkInterfaceName const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaCacheDirectory const): (WebKit::RemoteMediaPlayerProxy::mediaContentTypesRequiringHardwareSupport const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerPreferredAudioCharacteristics const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerShouldUsePersistentCache const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsVideo const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerKeyNeeded): (WebKit::RemoteMediaPlayerProxy::mediaPlayerGetRawCookies const): * GPUProcess/media/RemoteMediaPlayerProxy.h: (WebKit::RemoteMediaPlayerProxy::mediaPlayerLogIdentifier): * GPUProcess/media/RemoteMediaPlayerProxyConfiguration.h: Added. (WebKit::RemoteMediaPlayerProxyConfiguration::encode const): (WebKit::RemoteMediaPlayerProxyConfiguration::decode): * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote): (WebKit::MediaPlayerPrivateRemote::engineDescription const): (WebKit::MediaPlayerPrivateRemote::supportsScanning const): (WebKit::MediaPlayerPrivateRemote::supportsPictureInPicture const): (WebKit::MediaPlayerPrivateRemote::supportsAcceleratedRendering const): (WebKit::MediaPlayerPrivateRemote::canPlayToWirelessPlaybackTarget const): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/RemoteMediaPlayerConfiguration.h: Added. (WebKit::RemoteMediaPlayerConfiguration::encode const): (WebKit::RemoteMediaPlayerConfiguration::decode): * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer): 2019-12-21 Brian Burg Web Inspector: add InspectedTargetTypes diagnostic event and related hooks https://bugs.webkit.org/show_bug.cgi?id=205174 Reviewed by Devin Rousso. This change supplies Web Inspector with information about the debuggable that it is connected to. This is used for diagnostics and to customize the UI based on the target type being inspected. For remote Web Inspector, WebKit clients can populate an instance of _WKInspectorDebuggableInfo and use it when calling into -[_WKRemoteWebInspectorViewController loadForDebuggable:backendCommandsURL:]. For local Web Inspector, WebInspectorProxy fills in information for the local debuggable by consulting SystemVersion.plist (on Mac port). The new enum _WKInspectorDebuggableType replaces _WKRemoteWebInspectorDebuggableType. Its WebCore equivalent is Inspector::DebuggableType. The type and other information are carried around in a _WKInspectorDebuggableInfo class. The equivalents for this class are API::DebuggableInfo and DebuggableInfoData (for sending over IPC). The DebuggableInfoData is sent as part of the initial message from UIProcess to an Inspector WebProcess, similar to how a debuggableType string was sent before. * Sources.txt: * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: Add new files. * Shared/API/APIObject.h: * Shared/Cocoa/APIObject.mm: (API::Object::newObject): Add new object type. * Shared/WebCoreArgumentCoders.h: Add EnumTraits for Inspector::DebuggableType. * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewControllerPrivate.h: * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm: (legacyDebuggableTypeToModernDebuggableType): (-[_WKRemoteWebInspectorViewController loadForDebuggableType:backendCommandsURL:]): (-[_WKRemoteWebInspectorViewController loadForDebuggable:backendCommandsURL:]): (debuggableTypeString): Deleted. Use the new enum in a new method that clients can switch over to. The old method can be removed when it is no longer being used. * UIProcess/RemoteWebInspectorProxy.h: * UIProcess/RemoteWebInspectorProxy.cpp: (WebKit::RemoteWebInspectorProxy::RemoteWebInspectorProxy): (WebKit::RemoteWebInspectorProxy::load): (WebKit::RemoteWebInspectorProxy::reopen): Send DebuggableInfoData struct to RemoteWebInspectorUI. * UIProcess/WebInspectorProxy.h: * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::openLocalInspectorFrontend): (WebKit::WebInspectorProxy::infoForLocalDebuggable): Send DebuggableInfoData struct to WebInspectorUI. * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::systemVersionPlist): (WebKit::WebInspectorProxy::infoForLocalDebuggable): Add Mac implementation for local debuggables. * UIProcess/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::infoForLocalDebuggable): * UIProcess/win/WebInspectorProxyWin.cpp: (WebKit::WebInspectorProxy::infoForLocalDebuggable): * UIProcess/wpe/WebInspectorProxyWPE.cpp: (WebKit::WebInspectorProxy::infoForLocalDebuggable): Add stubs for other platforms. * UIProcess/glib/RemoteInspectorClient.cpp: * UIProcess/socket/RemoteInspectorClient.h: * UIProcess/socket/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::inspect): (WebKit::debuggableTypeToString): (WebKit::RemoteInspectorClient::setTargetList): Use Inspector::DebuggableType instead of String for debuggable type. * WebProcess/WebPage/RemoteWebInspectorUI.messages.in: * WebProcess/WebPage/RemoteWebInspectorUI.h: * WebProcess/WebPage/RemoteWebInspectorUI.cpp: (WebKit::RemoteWebInspectorUI::initialize): (WebKit::RemoteWebInspectorUI::debuggableType const): (WebKit::RemoteWebInspectorUI::targetPlatformName const): (WebKit::RemoteWebInspectorUI::targetBuildVersion const): (WebKit::RemoteWebInspectorUI::targetProductVersion const): (WebKit::RemoteWebInspectorUI::targetIsSimulator const): Implement new methods needed by InspectorFrontendClient / InspectorFrontendHost. * WebProcess/WebPage/WebInspectorUI.messages.in: * WebProcess/WebPage/WebInspectorUI.h: * WebProcess/WebPage/WebInspectorUI.cpp: (WebKit::WebInspectorUI::establishConnection): (WebKit::WebInspectorUI::targetPlatformName const): (WebKit::WebInspectorUI::targetBuildVersion const): (WebKit::WebInspectorUI::targetProductVersion const): Implement new methods needed by InspectorFrontendClient / InspectorFrontendHost. 2019-12-21 Eric Carlson [Media in GPU process] Add remote media player configuration https://bugs.webkit.org/show_bug.cgi?id=205541 Reviewed by Simon Fraser. * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: (WebKit::RemoteMediaPlayerManagerProxy::createMediaPlayer): * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in: * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::RemoteMediaPlayerProxy): (WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaKeysStorageDirectory const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerReferrer const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerUserAgent const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerSourceApplicationIdentifier const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerNetworkInterfaceName const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaCacheDirectory const): (WebKit::RemoteMediaPlayerProxy::mediaContentTypesRequiringHardwareSupport const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerPreferredAudioCharacteristics const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerShouldUsePersistentCache const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsVideo const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerKeyNeeded): (WebKit::RemoteMediaPlayerProxy::mediaPlayerGetRawCookies const): * GPUProcess/media/RemoteMediaPlayerProxy.h: (WebKit::RemoteMediaPlayerProxy::mediaPlayerLogIdentifier): * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer): 2019-12-21 Kate Cheney Add timeStamp to ITP database https://bugs.webkit.org/show_bug.cgi?id=205121 Reviewed by John Wilander. This patch adds support for collecting most-recently-updated timestamps for third-party/first-party domain pairs in the ITP database. It updates the timestamp when new statistics are merged into the database. It then exposes the timestamp via the _getResourceLoadStatisticsDataSummary API. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore): (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements): (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationshipList): Changed INSERT OR IGNORE queries to be INSERT OR REPLACE so the timestamp will be replaced upon a new attempted insert into one of the third-party/first-party relationship tables. ResourceLoadStatisticsDatabaseStore::insertDomainRelationshipList now checks for the keyword "REPLACE" to know if another bind is needed to update the timestamp. (WebKit::ResourceLoadStatisticsDatabaseStore::getMostRecentlyUpdatedTimestamp): Queries the most recent time that the third party has appeared as a subframe or subresource under the first party or redirected to the first party. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: (WebKit::ThirdPartyDataForSpecificFirstParty::toString const): Updated the toString to check if the timestamp occured in the last 24 hours for testing purposes. It doesn't print the specific time because it would change for every run and could not be tested. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _setUseITPDatabase:completionHandler:]): Added new function that enables the ITP Database backend so the timestamp parameter can be tested in in TestWebKitAPI. * UIProcess/API/APIResourceLoadStatisticsFirstParty.h: * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.h: * UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.mm: (-[_WKResourceLoadStatisticsFirstParty timeLastUpdated]): Added the new timestamp parameter to the _WKResourceLoadStatisticsFirstParty.mm class and its wrapper to be sent via API call. 2019-12-20 Eric Carlson [Media in GPU process] Get audio playing https://bugs.webkit.org/show_bug.cgi?id=205511 Reviewed by Jer Noble. * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: * GPUProcess/media/RemoteMediaPlayerProxy.h: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::updateCachedState): (WebKit::MediaPlayerPrivateRemote::maximumDurationToCacheMediaTime const): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/RemoteMediaPlayerManager.h: 2019-12-20 Jer Noble Enable HDR Media Capabilities by default https://bugs.webkit.org/show_bug.cgi?id=205518 Reviewed by Eric Carlson. * Shared/WebPreferences.yaml: 2019-12-20 Tim Horton Clean up and generalize some interaction additions https://bugs.webkit.org/show_bug.cgi?id=205430 Reviewed by Wenson Hsieh. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView cleanupInteraction]): 2019-12-20 Tim Horton Expose approximate caret extents for the hit line via InteractionInformationAtPosition https://bugs.webkit.org/show_bug.cgi?id=205526 Reviewed by Dean Jackson. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::positionInformation): Compute and expose the union of first and last caret rects on the line. * Shared/ios/InteractionInformationAtPosition.h: * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): (WebKit::InteractionInformationAtPosition::decode): * Shared/ios/InteractionInformationRequest.cpp: (WebKit::InteractionInformationRequest::encode const): (WebKit::InteractionInformationRequest::decode): (WebKit::InteractionInformationRequest::isValidForRequest): * Shared/ios/InteractionInformationRequest.h: Also, add a bit so that we can only fetch this data when needed. 2019-12-20 Brent Fulgham Remove access to 'com.apple.cfprefsd.agent' from the macOS sandbox https://bugs.webkit.org/show_bug.cgi?id=205478 Reviewed by Darin Adler. Telemetry and thorough testing has confirmed that we do not need access to this mach service, and so should remove it. Tested by fast/sandboxing/mac * WebProcess/com.apple.WebProcess.sb.in: 2019-12-20 Brian Burg Unreviewed, try to fix the non-unified sources build. * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp: (WebKit::MockAuthenticatorManager::filterTransports const): The current chunking of unified source files seems to provide a 'using namespace WebCore' for these references to AuthenticatorTransport. Add a namespace qualification so that this file compiles by itself. 2019-12-20 James Savage Include WKPDFConfiguration, WKFindConfiguration, and WKFindResult in umbrella header https://bugs.webkit.org/show_bug.cgi?id=205432 Reviewed by Wenson Hsieh. * Shared/API/Cocoa/WebKit.h: Include new headers. 2019-12-20 Brian Burg Web Inspector: convert some InspectorFrontendHost methods to getters https://bugs.webkit.org/show_bug.cgi?id=205475 Reviewed by Devin Rousso. No reason for these to be method calls, so expose as getters / attributes instead. * WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp: (WebKit::WebInspectorUI::localizedStringsURL const): (WebKit::RemoteWebInspectorUI::localizedStringsURL const): (WebKit::WebInspectorUI::localizedStringsURL): Deleted. (WebKit::RemoteWebInspectorUI::localizedStringsURL): Deleted. * WebProcess/WebPage/mac/WebInspectorUIMac.mm: (WebKit::WebInspectorUI::localizedStringsURL const): (WebKit::RemoteWebInspectorUI::localizedStringsURL const): (WebKit::WebInspectorUI::localizedStringsURL): Deleted. (WebKit::RemoteWebInspectorUI::localizedStringsURL): Deleted. * WebProcess/WebPage/win/WebInspectorUIWin.cpp: (WebKit::WebInspectorUI::localizedStringsURL const): (WebKit::RemoteWebInspectorUI::localizedStringsURL const): (WebKit::WebInspectorUI::localizedStringsURL): Deleted. (WebKit::RemoteWebInspectorUI::localizedStringsURL): Deleted. * WebProcess/WebPage/wpe/WebInspectorUIWPE.cpp: (WebKit::WebInspectorUI::localizedStringsURL const): (WebKit::RemoteWebInspectorUI::localizedStringsURL const): (WebKit::WebInspectorUI::localizedStringsURL): Deleted. (WebKit::RemoteWebInspectorUI::localizedStringsURL): Deleted. 2019-12-20 Alex Christensen Allow a managed configuration to re-enable TLS 1.0 and 1.1 https://bugs.webkit.org/show_bug.cgi?id=205479 Reviewed by Geoffrey Garen. * Platform/spi/ios/ManagedConfigurationSPI.h: Removed. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView canPerformActionForWebView:withSender:]): (-[WKContentView _defineForWebView:]): * WebKit.xcodeproj/project.pbxproj: 2019-12-20 youenn fablet Set whether to use mock capture devices at GPUProcess creation time. https://bugs.webkit.org/show_bug.cgi?id=205492 Reviewed by Eric Carlson. This ensures UIProcess remains always in sync with GPUProcess. Covered by fast/mediastream/captureAudioInGPUProcess.html. * GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::initializeGPUProcess): (WebKit::GPUProcess::setMockCaptureDevicesEnabled): * GPUProcess/GPUProcess.h: * GPUProcess/GPUProcessCreationParameters.cpp: (WebKit::GPUProcessCreationParameters::encode const): (WebKit::GPUProcessCreationParameters::decode): * GPUProcess/GPUProcessCreationParameters.h: * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::singleton): 2019-12-19 Brent Fulgham Log telemetry for IOUserClient lookups https://bugs.webkit.org/show_bug.cgi?id=205463 Reviewed by Per Arne Vollan. This patch adds some telemetry for IOKit classes. No new tests. No change in behavior. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * WebProcess/com.apple.WebProcess.sb.in: 2019-12-19 Chris Dumez Use a WeakHashSet for WKProcessAssertionBackgroundTaskManager._assertionsNeedingBackgroundTask https://bugs.webkit.org/show_bug.cgi?id=205471 Reviewed by Ryosuke Niwa. Use a WeakHashSet for WKProcessAssertionBackgroundTaskManager._assertionsNeedingBackgroundTask, instead of a HashSet of raw pointers, for extra safety. * UIProcess/ios/ProcessAssertionIOS.mm: (-[WKProcessAssertionBackgroundTaskManager removeAssertionNeedingBackgroundTask:]): (-[WKProcessAssertionBackgroundTaskManager _notifyAssertionsOfImminentSuspension]): (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]): 2019-12-19 Brent Fulgham Unblock iokit-get-property needed for frame buffer initialization https://bugs.webkit.org/show_bug.cgi?id=205468 Reviewed by Per Arne Vollan. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-12-19 Brent Fulgham Add telemetry to macOS WebContent sandbox https://bugs.webkit.org/show_bug.cgi?id=205464 Reviewed by Per Arne Vollan. Add telemetry to various mach lookups, like we did for iOS. No new tests. No change in behavior. * WebProcess/com.apple.WebProcess.sb.in: 2019-12-19 Per Arne Vollan REGRESSION (r253530): Incorrect colors in Dark Mode https://bugs.webkit.org/show_bug.cgi?id=205457 Unreviewed rollout of r253530. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2019-12-19 Alex Christensen Deprecate _WKRemoteObjectInterface methods without ofReply: https://bugs.webkit.org/show_bug.cgi?id=205073 Reviewed by Timothy Hatcher. Using them makes it hard to figure out how to add classes allowed for the reply, and there's a comment saying to deprecate them, so let's do it. * Shared/API/Cocoa/_WKRemoteObjectInterface.h: 2019-12-19 Brent Fulgham WebContent process does not need access to 'com.apple.system.logger' https://bugs.webkit.org/show_bug.cgi?id=205411 Reviewed by Per Arne Vollan. Telemetry and thorough testing has confirmed that we do not need access to this mach service, and so should remove it. Tested by fast/sandbox. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * WebProcess/com.apple.WebProcess.sb.in: 2019-12-19 Brent Fulgham Deny mach lookup access to "com.apple.TextInput" in the WebContent process https://bugs.webkit.org/show_bug.cgi?id=205423 Reviewed by Per Arne Vollan. Telemetry and thorough testing has confirmed that we do not need access to this mach service, and so should remove it. Tested by fast/sandbox/ios/sandbox-mach-lookup.html. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-12-19 youenn fablet CacheStorageEngine should not clear caches memory representation for ephemeral sessions https://bugs.webkit.org/show_bug.cgi?id=205332 Reviewed by Chris Dumez. * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::dispose): We cannot dispose an ephemeral cache memory representation since it can be reopened by a page with the same session. 2019-12-19 Brent Fulgham Deny mach lookup access to "com.apple.pluginkit.pkd" in the WebContent process https://bugs.webkit.org/show_bug.cgi?id=205421 Reviewed by Per Arne Vollan. Telemetry and thorough testing has confirmed that we do not need access to this mach service, and so should remove it. Tested by fast/sandbox/ios/sandbox-mach-lookup.html. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-12-19 Brent Fulgham Remove syscall filtering from GPU Process sandbox https://bugs.webkit.org/show_bug.cgi?id=205456 Reviewed by Tim Horton. We don't have a fully built-out GPU Process yet. Let's not lock down the syscall filter set until we know which are actually needed by the process. The current set is just copied over from the WebContent process, and are not likely to be the correct set. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: 2019-12-19 Chris Dumez imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting-installed.https.html is flaky https://bugs.webkit.org/show_bug.cgi?id=205408 Reviewed by Youenn Fablet. * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::didFinishSkipWaiting): Deleted. * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::skipWaiting): (WebKit::WebSWContextManagerConnection::didFinishSkipWaiting): Deleted. * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2019-12-19 Chris Dumez Stop blocking the worker thread in WorkerMessagePortChannelProvider::postMessageToRemote() https://bugs.webkit.org/show_bug.cgi?id=205414 Reviewed by Youenn Fablet. * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp: (WebKit::WebMessagePortChannelProvider::postMessageToRemote): * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h: 2019-12-19 Carlos Garcia Campos [GTK][WPE] Add initial API for input method https://bugs.webkit.org/show_bug.cgi?id=204679 Reviewed by Žan Doberšek. In the case of GTK port, it allows to use a custom IM instead of GtkIMContext that it's still used by default. In the case of WPE it brings IM support, but there's no default implementation so applications need to provide their own. * PlatformGTK.cmake: Add new public header WebKitInputMethodContext.h. * PlatformWPE.cmake: Ditto. * Shared/EditorState.cpp: (WebKit::EditorState::PostLayoutData::encode const): Encode caretRectAtStart for WPE too. (WebKit::EditorState::PostLayoutData::decode): Decode caretRectAtStart for WPE too. (WebKit::operator<<): Dump caretRectAtStart for WPE too. * Shared/EditorState.h: Define caretRectAtStart for WPE too. * Shared/NativeWebKeyboardEvent.h: (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Remove FakedForComposition parameter for GTK and add HandledByInputMethod to WPE. * Shared/WebEvent.h: * Shared/WebKeyboardEvent.cpp: (WebKit::WebKeyboardEvent::WebKeyboardEvent): Add handledByInputMethod parameter for WPE. (WebKit::WebKeyboardEvent::encode const): Encode m_handledByInputMethod in WPE too. (WebKit::WebKeyboardEvent::decode): Decode m_handledByInputMethod in WPE too. * Shared/gtk/NativeWebKeyboardEventGtk.cpp: (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Remove FakedForComposition and the redundant members that are already in the bcase class or no longer needed. * Shared/libwpe/NativeWebKeyboardEventLibWPE.cpp: (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Add text and handledByInputMethod parameters * Shared/libwpe/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebKeyboardEvent): Use the given text if not null and pass handledByInputMethod, to WebKeyboardEvent. * Shared/libwpe/WebEventFactory.h: * SourcesGTK.txt: Add new files to compilation. * SourcesWPE.txt: Ditto. * UIProcess/API/glib/InputMethodFilter.cpp: Added. (WebKit::InputMethodFilter::~InputMethodFilter): (WebKit::InputMethodFilter::preeditStartedCallback): (WebKit::InputMethodFilter::preeditChangedCallback): (WebKit::InputMethodFilter::preeditFinishedCallback): (WebKit::InputMethodFilter::committedCallback): (WebKit::InputMethodFilter::setContext): (WebKit::InputMethodFilter::setEnabled): (WebKit::InputMethodFilter::filterKeyEvent): (WebKit::InputMethodFilter::isViewFocused const): (WebKit::InputMethodFilter::notifyFocusedIn): (WebKit::InputMethodFilter::notifyFocusedOut): (WebKit::InputMethodFilter::notifyCursorRect): (WebKit::InputMethodFilter::preeditStarted): (WebKit::InputMethodFilter::preeditChanged): (WebKit::InputMethodFilter::preeditFinished): (WebKit::InputMethodFilter::committed): (WebKit::InputMethodFilter::cancelComposition): * UIProcess/API/glib/InputMethodFilter.h: Added. (WebKit::InputMethodFilter::context const): * UIProcess/API/glib/WebKitInputMethodContext.cpp: Added. (webkitInputMethodUnderlineGetCompositionUnderline): (webkit_input_method_underline_new): (webkit_input_method_underline_copy): (webkit_input_method_underline_free): (webkitInputMethodContextSetWebView): (webkitInputMethodContextGetWebView): (webkit_input_method_context_set_enable_preedit): (webkit_input_method_context_get_preedit): (webkit_input_method_context_notify_focus_in): (webkit_input_method_context_notify_focus_out): (webkit_input_method_context_notify_cursor_area): (webkit_input_method_context_reset): * UIProcess/API/glib/WebKitInputMethodContextPrivate.h: Added. (_WebKitInputMethodUnderline::_WebKitInputMethodUnderline): * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewConstructed): (webkitWebViewSynthesizeCompositionKeyPress): (webkitWebViewSetComposition): (webkitWebViewConfirmComposition): (webkitWebViewCancelComposition): (webkit_web_view_set_input_method_context): (webkit_web_view_get_input_method_context): * UIProcess/API/glib/WebKitWebViewPrivate.h: * UIProcess/API/gtk/InputMethodFilterGtk.cpp: Added. (WebKit::InputMethodFilter::platformTransformCursorRectToViewCoordinates): (WebKit::InputMethodFilter::platformEventKeyIsKeyPress const): * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::doneWithKeyEvent): Remove the early return in case of fake event, composition events are always handled by the web process. * UIProcess/API/gtk/WebKitInputMethodContext.h: Added. * UIProcess/API/gtk/WebKitInputMethodContextGtk.cpp: Added. (webkit_input_method_underline_set_color): (webkit_input_method_context_filter_key_event): * UIProcess/API/gtk/WebKitInputMethodContextImplGtk.cpp: Added. (contextPreeditStartCallback): (contextPreeditChangedCallback): (contextPreeditEndCallback): (contextCommitCallback): (webkitInputMethodContextImplGtkConstructed): (webkitInputMethodContextImplGtkSetEnablePreedit): (webkitInputMethodContextImplGtkGetPreedit): (webkitInputMethodContextImplGtkFilterKeyEvent): (webkitInputMethodContextImplGtkNotifyFocusIn): (webkitInputMethodContextImplGtkNotifyFocusOut): (webkitInputMethodContextImplGtkNotifyCursorArea): (webkitInputMethodContextImplGtkReset): (webkit_input_method_context_impl_gtk_class_init): (webkitInputMethodContextImplGtkNew): (webkitInputMethodContextImplGtkSetClientWindow): * UIProcess/API/gtk/WebKitInputMethodContextImplGtk.h: Added. * UIProcess/API/gtk/WebKitWebView.h: * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseRealize): If current IM filter is the default one, call webkitInputMethodContextImplGtkSetClientWindow(). (webkitWebViewBaseUnrealize): Ditto. (webkitWebViewBaseDispose): Set a nullptr context on IM filter. (webkitWebViewBaseKeyPressEvent): Use the new IM filter that simplifies the code. (webkitWebViewBaseKeyReleaseEvent): Ditto. (webkitWebViewBaseHandleMouseEvent): Cancel composition in case of click. (webkitWebViewBaseCreateWebPage): The new IM filter doesn't need to know the page. (webkitWebViewBaseUpdateTextInputState): Use new IM filter API. (webkitWebViewBaseSetInputMethodContext): Set the IM filter context. (webkitWebViewBaseGetInputMethodContext): Get the IM filter context. (webkitWebViewBaseSynthesizeCompositionKeyPress): Synthesize a key event for composition. * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: * UIProcess/API/gtk/webkit2.h: * UIProcess/API/wpe/InputMethodFilterWPE.cpp: Added. (WebKit::InputMethodFilter::platformTransformCursorRectToViewCoordinates): (WebKit::InputMethodFilter::platformEventKeyIsKeyPress const): * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::setInputMethodState): (WebKit::PageClientImpl::selectionDidChange): * UIProcess/API/wpe/PageClientImpl.h: * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::setInputMethodContext): Set the IM filter context. (WKWPE::View::inputMethodContext const): Get the IM filter context. (WKWPE::View::setInputMethodState): Enable or disable input methods. (WKWPE::View::selectionDidChange): Notify the IM filter about the cursor position change. (WKWPE::View::setViewState): Notify the IM filter about the focus change. (WKWPE::View::handleKeyboardEvent): Allow the IM filter to handle the key event. (WKWPE::View::synthesizeCompositionKeyPress): Synthesize a key event for composition. * UIProcess/API/wpe/WPEView.h: * UIProcess/API/wpe/WebKitInputMethodContext.h: Added. * UIProcess/API/wpe/WebKitInputMethodContextWPE.cpp: Added. (webkit_input_method_underline_set_color): (webkit_input_method_context_filter_key_event): * UIProcess/API/wpe/WebKitWebView.h: * UIProcess/API/wpe/docs/wpe-1.0-sections.txt: * UIProcess/API/wpe/docs/wpe-docs.sgml: * UIProcess/API/wpe/webkit.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/gtk/InputMethodFilter.cpp: Removed. * UIProcess/gtk/InputMethodFilter.h: Removed. * UIProcess/wpe/WebPageProxyWPE.cpp: (WebKit::WebPageProxy::updateEditorState): Save the editor state and notify about selection change. (WebKit::WebPageProxy::setInputMethodState): Notify the page client about the input method state. * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::setInputMethodState): Implement this for WPE too. * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp: (WebKit::WebEditorClient::handleInputMethodKeydown): Use handledByInputMethod() now. * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/wpe/WebPageWPE.cpp: (WebKit::WebPage::platformEditorState const): Save the current caret cursor rectangle in post layout data struct. (WebKit::WebPage::setInputMethodState): Send SetInputMethodState message to the UI process if state changed. 2019-12-19 Carlos Garcia Campos [CoordinatedGraphics] ThreadedDisplayRefreshMonitor is never released https://bugs.webkit.org/show_bug.cgi?id=205387 Reviewed by Žan Doberšek. Update the window screen ID after creating the layer tree host to ensure that the call to createDisplayRefreshMonitor will create the ThreadedDisplayRefrershMonitor instead of the default one. * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode): Use the dispalyID of the layer tree host. * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp: (WebKit::LayerTreeHost::LayerTreeHost): Initialize the display ID. * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: 2019-12-18 Sihui Liu IndexedDB: perform IDBServer work only on background thread https://bugs.webkit.org/show_bug.cgi?id=203690 Reviewed by Alex Christensen. * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient): * NetworkProcess/IndexedDB/WebIDBServer.cpp: (WebKit::WebIDBServer::create): (WebKit::WebIDBServer::WebIDBServer): (WebKit::WebIDBServer::closeAndDeleteDatabasesModifiedSince): (WebKit::WebIDBServer::closeAndDeleteDatabasesForOrigins): (WebKit::WebIDBServer::suspend): (WebKit::WebIDBServer::resume): (WebKit::WebIDBServer::openDatabase): (WebKit::WebIDBServer::deleteDatabase): (WebKit::WebIDBServer::abortTransaction): (WebKit::WebIDBServer::commitTransaction): (WebKit::WebIDBServer::didFinishHandlingVersionChangeTransaction): (WebKit::WebIDBServer::createObjectStore): (WebKit::WebIDBServer::deleteObjectStore): (WebKit::WebIDBServer::renameObjectStore): (WebKit::WebIDBServer::clearObjectStore): (WebKit::WebIDBServer::createIndex): (WebKit::WebIDBServer::deleteIndex): (WebKit::WebIDBServer::renameIndex): (WebKit::WebIDBServer::putOrAdd): (WebKit::WebIDBServer::getRecord): (WebKit::WebIDBServer::getAllRecords): (WebKit::WebIDBServer::getCount): (WebKit::WebIDBServer::deleteRecord): (WebKit::WebIDBServer::openCursor): (WebKit::WebIDBServer::iterateCursor): (WebKit::WebIDBServer::establishTransaction): (WebKit::WebIDBServer::databaseConnectionPendingClose): (WebKit::WebIDBServer::databaseConnectionClosed): (WebKit::WebIDBServer::abortOpenAndUpgradeNeeded): (WebKit::WebIDBServer::didFireVersionChangeEvent): (WebKit::WebIDBServer::openDBRequestCancelled): (WebKit::WebIDBServer::getAllDatabaseNames): (WebKit::WebIDBServer::addConnection): (WebKit::WebIDBServer::removeConnection): (WebKit::WebIDBServer::postTask): (WebKit::WebIDBServer::dispatchToThread): (WebKit::WebIDBServer::registerConnection): Deleted. (WebKit::WebIDBServer::unregisterConnection): Deleted. (WebKit::WebIDBServer::confirmDidCloseFromServer): Deleted. * NetworkProcess/IndexedDB/WebIDBServer.h: * NetworkProcess/IndexedDB/WebIDBServer.messages.in: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didReceiveMessage): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::prepareToSuspend): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::confirmDidCloseFromServer): Deleted. * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: 2019-12-18 Commit Queue Unreviewed, rolling out r253646. https://bugs.webkit.org/show_bug.cgi?id=205433 "We think this may have caused a membuster regression, so rolling it out." (Requested by nham on #webkit). Reverted changeset: "Navigation from empty page doesn't use cached web process" https://bugs.webkit.org/show_bug.cgi?id=205015 https://trac.webkit.org/changeset/253646 2019-12-18 Alex Christensen Add SPI WKWebView._updateWebpagePreferences to replace _updateWebsitePolicies https://bugs.webkit.org/show_bug.cgi?id=205427 Reviewed by Wenson Hsieh. This blocks the removal of _WKWebsitePolicies. This change is verified by an API test. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _updateWebsitePolicies:]): (-[WKWebView _updateWebpagePreferences:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2019-12-18 Tim Horton macCatalyst: Cursor should update when the platform deems it necessary https://bugs.webkit.org/show_bug.cgi?id=205429 Reviewed by Wenson Hsieh. * Shared/ios/InteractionInformationAtPosition.h: * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): (WebKit::InteractionInformationAtPosition::decode): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::positionInformation): Expose the current cursor and caret size on position information so that macCatalyst UIKit can retrieve it out-of-band (in addition to setting it when we do a hit-test, like in r253636. 2019-12-18 Alex Christensen Add ObjC version of WKBundleFrameIsMainFrame https://bugs.webkit.org/show_bug.cgi?id=205415 Reviewed by Brian Weinstein. I need this for rdar://problem/57132290 Covered by API tests. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm: (-[WKWebProcessPlugInFrame isMainFrame]): * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h: 2019-12-18 Eric Carlson Remove more unused MediaPlayer methods https://bugs.webkit.org/show_bug.cgi?id=205405 Reviewed by Jer Noble. * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::mediaPlayerHandlePlaybackCommand): Deleted. (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsInMediaDocument const): Deleted. * GPUProcess/media/RemoteMediaPlayerProxy.h: 2019-12-18 youenn fablet Add support for Audio Capture in GPUProcess https://bugs.webkit.org/show_bug.cgi?id=205056 Reviewed by Eric Carlson. Make UserMediaCaptureManager and Proxy able to work with GPU process. Add support for capturing audio in the GPU process, this is limited to mock audio sources for now as we do not support AudioSession in the GPU process. Covered by rebased test. * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::GPUConnectionToWebProcess): (WebKit::GPUConnectionToWebProcess::didReceiveMessage): (WebKit::GPUConnectionToWebProcess::didReceiveSyncMessage): * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::setMockCaptureDevicesEnabled): * GPUProcess/GPUProcess.h: * GPUProcess/GPUProcess.messages.in: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::UserMediaCaptureManagerProxy): (WebKit::UserMediaCaptureManagerProxy::~UserMediaCaptureManagerProxy): (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): (WebKit::UserMediaCaptureManagerProxy::applyConstraints): (WebKit::UserMediaCaptureManagerProxy::clone): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: (WebKit::UserMediaCaptureManagerProxy::didReceiveMessageFromGPUProcess): (WebKit::UserMediaCaptureManagerProxy::didReceiveSyncMessageFromGPUProcess): * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs const): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: * WebProcess/GPU/GPUProcessConnection.cpp: (WebKit::GPUProcessConnection::didReceiveMessage): * WebProcess/GPU/GPUProcessConnection.h: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::setShouldCaptureInGPUProcess): (WebKit::UserMediaCaptureManager::Source::shouldCaptureInGPUProcess const): (WebKit::UserMediaCaptureManager::Source::requestToEnd): (WebKit::UserMediaCaptureManager::createCaptureSource): (WebKit::UserMediaCaptureManager::sourceStopped): (WebKit::UserMediaCaptureManager::captureFailed): (WebKit::UserMediaCaptureManager::Source::connection): (WebKit::UserMediaCaptureManager::Source::startProducingData): (WebKit::UserMediaCaptureManager::Source::stopProducingData): (WebKit::UserMediaCaptureManager::Source::capabilities): (WebKit::UserMediaCaptureManager::Source::applyConstraints): (WebKit::UserMediaCaptureManager::sourceEnded): (WebKit::UserMediaCaptureManager::Source::hasEnded): (WebKit::UserMediaCaptureManager::Source::stopBeingObserved): (WebKit::UserMediaCaptureManager::AudioFactory::createAudioCaptureSource): * WebProcess/cocoa/UserMediaCaptureManager.h: (WebKit::UserMediaCaptureManager::didReceiveMessageFromGPUProcess): 2019-12-18 Ben Nham Add network loading signposts https://bugs.webkit.org/show_bug.cgi?id=204822 Reviewed by Alex Christensen. This adds os_signposts related to network loads to aid in debugging networking performance issues. Since URLs are logged in the signposts, this capability is only enabled on Apple internal builds when an environment variable is set. * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::signpostLogHandle): (WebKit::signpostsEnabled): (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::didSendData): (WebKit::NetworkDataTaskCocoa::didReceiveChallenge): (WebKit::NetworkDataTaskCocoa::didCompleteWithError): (WebKit::NetworkDataTaskCocoa::didReceiveData): (WebKit::NetworkDataTaskCocoa::didReceiveResponse): (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): (WebKit::NetworkDataTaskCocoa::cancel): (WebKit::NetworkDataTaskCocoa::resume): 2019-12-18 youenn fablet Refine RTCMonitor logging https://bugs.webkit.org/show_bug.cgi?id=205384 Reviewed by Eric Carlson. Catch the case where the rtc thread is blocked in WebProcess and NetworkProcess. Add logging of 'this' so as to disambiguate the case of several pages doing RTC in parallel. No change of behavior. * NetworkProcess/webrtc/NetworkRTCMonitor.cpp: (WebKit::NetworkRTCMonitor::startUpdatingIfNeeded): (WebKit::NetworkRTCMonitor::stopUpdating): (WebKit::NetworkRTCMonitor::onNetworksChanged): * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::NetworkRTCProvider): (WebKit::NetworkRTCProvider::close): (WebKit::NetworkRTCProvider::createSocket): * NetworkProcess/webrtc/NetworkRTCProvider.h: (WebKit::NetworkRTCProvider::canLog const): * WebProcess/Network/webrtc/WebRTCMonitor.cpp: (WebKit::WebRTCMonitor::StartUpdating): (WebKit::WebRTCMonitor::StopUpdating): (WebKit::WebRTCMonitor::networksChanged): 2019-12-18 Kate Cheney Only report prevalent domains in the ResourceLoadStatistics data summary API https://bugs.webkit.org/show_bug.cgi?id=205281 Reviewed by Brent Fulgham. ResourceLoadStatisticsStore::aggregatedThirdPartyData() should only return prevalent third party domains. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: 2019-12-18 Brent Fulgham Add syscall to GPU Process sandbox https://bugs.webkit.org/show_bug.cgi?id=205400 Reviewed by Simon Fraser. This patch temporarily adds a syscall to the sandbox to work around a bug in the system Sandbox framework. We will remove this in Bug 205400 once that issue is resolved. * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: 2019-12-18 Eric Carlson Enable generic cue API https://bugs.webkit.org/show_bug.cgi?id=205398 Reviewed by Jon Lee. No new tests, covered by existing tests. * Shared/WebPreferences.yaml: 2019-12-18 Eric Carlson Remove unused MediaPlayer methods https://bugs.webkit.org/show_bug.cgi?id=205341 Reviewed by Jer Noble. * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::mediaPlayerSawUnsupportedTracks): Deleted. (WebKit::RemoteMediaPlayerProxy::mediaPlayerRepaint): Deleted. (WebKit::RemoteMediaPlayerProxy::mediaPlayerAcceleratedCompositingEnabled): Deleted. (WebKit::RemoteMediaPlayerProxy::mediaPlayerSetSize): Deleted. (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsPaused const): Deleted. (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsLooping const): Deleted. * GPUProcess/media/RemoteMediaPlayerProxy.h: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::canLoadPoster const): Deleted. (WebKit::MediaPlayerPrivateRemote::setPoster): Deleted. * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: 2019-12-18 Simon Fraser Move m_exposedContentRect into the DelegatedScrollingGeometry optional https://bugs.webkit.org/show_bug.cgi?id=205377 Reviewed by Tim Horton. ScrollView's m_exposedContentRect is only set for delegated scrolling, so move it into DelegatedScrollingGeometry and remove the iOS #ifdefs around it. Move the WAK/NSView-related code into platformExposedContentRect() for iOS WK1. Stub out exposedContentRect() functions on TiledCoreAnimationDrawingArea. * WebProcess/WebPage/DrawingArea.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::setExposedContentRect): * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea): (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange): (WebKit::TiledCoreAnimationDrawingArea::setViewExposedRect): (WebKit::TiledCoreAnimationDrawingArea::exposedContentRect const): (WebKit::TiledCoreAnimationDrawingArea::setExposedContentRect): (WebKit::TiledCoreAnimationDrawingArea::adjustLayerFlushThrottling): 2019-12-18 Wenson Hsieh Enable the async clipboard API by default on macOS and iOS https://bugs.webkit.org/show_bug.cgi?id=205322 Reviewed by Tim Horton. Enables the asynchronous clipboard API by default on Cocoa platforms. * Shared/WebPreferences.yaml: * Shared/WebPreferencesDefaultValues.h: 2019-12-18 Philippe Normand [GTK][WebInspector] Support for saving remote data https://bugs.webkit.org/show_bug.cgi?id=204618 Reviewed by Carlos Garcia Campos. Similarly to what landed already in r251069, the Remote WebInspector GTK client can now save data coming from the inspector server. * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp: (WebKit::RemoteWebInspectorProxy::platformSave): 2019-12-17 Joonghun Park Unreviewed. Remove the build warning below since r253452. warning: unused variable ‘isNewEntry’ [-Wunused-variable] No new tests, no new behavioral changes. * NetworkProcess/IndexedDB/WebIDBServer.cpp: (WebKit::WebIDBServer::addConnection): 2019-12-17 Per Arne Vollan Unreviewed build fix after r253661. * UIProcess/ios/forms/WKFileUploadPanel.mm: 2019-12-17 Per Arne Vollan [iOS] The WebContent process should not use API to get the user interface idiom https://bugs.webkit.org/show_bug.cgi?id=205236 Reviewed by Brent Fulgham. This should be done in the UI process, since using the API in the WebContent process will connect to daemons we intend to block access to. Add a flag to the process creation parameters which indicates whether the user interface idiom is iPad or not. This flag will be set on the UI process side, and on the WebContent process side, this flag will be read and cached for later use. No new tests, covered by existing tests. * Platform/spi/ios/UIKitSPI.h: (currentUserInterfaceIdiomIsPad): Deleted. * Shared/UserInterfaceIdiom.h: Added. * Shared/UserInterfaceIdiom.mm: Added. (WebKit::userInterfaceIdiomIsPad): (WebKit::currentUserInterfaceIdiomIsPad): (WebKit::setCurrentUserInterfaceIdiomIsPad): * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * Shared/ios/WebPreferencesDefaultValuesIOS.mm: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/ios/SmartMagnificationController.mm: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKFormInputSession setAccessoryViewCustomButtonTitle:]): (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason:]): (-[WKContentView _shouldShowAutomaticKeyboardUIIgnoringInputMode]): (-[WKContentView _zoomToRevealFocusedElement]): (-[WKContentView requiresAccessoryView]): (-[WKContentView _updateAccessory]): (shouldShowKeyboardForElement): (-[WKContentView _shouldUseLegacySelectPopoverDismissalBehavior]): * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm: * UIProcess/ios/WebPageProxyIOS.mm: * UIProcess/ios/forms/WKFormColorControl.mm: (-[WKFormColorControl initWithView:]): * UIProcess/ios/forms/WKFormColorPicker.mm: * UIProcess/ios/forms/WKFormInputControl.mm: * UIProcess/ios/forms/WKFormSelectControl.mm: * WebKit.xcodeproj/project.pbxproj: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2019-12-17 Eric Carlson Add remote media player methods for prepareToPlay, preload, private browsing mode, preserves pitch, and failed to load https://bugs.webkit.org/show_bug.cgi?id=205351 Reviewed by Jer Noble. * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: (WebKit::RemoteMediaPlayerManagerProxy::prepareToPlay): (WebKit::RemoteMediaPlayerManagerProxy::setPreload): (WebKit::RemoteMediaPlayerManagerProxy::setPrivateBrowsingMode): (WebKit::RemoteMediaPlayerManagerProxy::setPreservesPitch): * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in: * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::prepareToPlay): (WebKit::RemoteMediaPlayerProxy::setPreload): (WebKit::RemoteMediaPlayerProxy::setPrivateBrowsingMode): (WebKit::RemoteMediaPlayerProxy::setPreservesPitch): * GPUProcess/media/RemoteMediaPlayerProxy.h: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::prepareToPlay): (WebKit::MediaPlayerPrivateRemote::setPreservesPitch): (WebKit::MediaPlayerPrivateRemote::setPreload): (WebKit::MediaPlayerPrivateRemote::setPrivateBrowsingMode): (WebKit::MediaPlayerPrivateRemote::engineFailedToLoad): (WebKit::MediaPlayerPrivateRemote::platformErrorCode const): Deleted. (WebKit::MediaPlayerPrivateRemote::requiresImmediateCompositing const): Deleted. * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::engineFailedToLoad): * WebProcess/GPU/media/RemoteMediaPlayerManager.h: * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in: 2019-12-17 Kate Cheney Add run-time flag for in-app browser privacy https://bugs.webkit.org/show_bug.cgi?id=205288 Reviewed by John Wilander. * Shared/WebPreferences.yaml: 2019-12-17 Ben Nham Navigation from empty page doesn't use cached web process https://bugs.webkit.org/show_bug.cgi?id=205015 Reviewed by Chris Dumez. When navigating from an empty page to another domain foo.com, we always use the source WebProcess (which is basically uninitialized) rather than using an already-initialized cached WebProcess that has navigated to foo.com. The cached WebProcess should probably be preferred since it has more relevant cached resources available to it (e.g. memory cache, JS bytecode cache, prewarmed fonts, ...). Added an API test. * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h: * UIProcess/API/Cocoa/WKWebViewTesting.mm: (-[WKWebView _ensureRunningProcessForTesting]): Allows tests to force WebProcess to launch to an empty document for testing purposes. This matches the behavior of how Safari uses WKWebView. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigationInternal): Prefer cached web process over source process if the source process hasn't committed any loads. 2019-12-17 Benjamin Nham Drop support for NSURLCache callbacks in NetworkProcess https://bugs.webkit.org/show_bug.cgi?id=203344 Reviewed by Alex Christensen. Remove the NSURLSession caching policy callback in NetworkProcess. It's no longer necessary since we don't use NSURLCache in NetworkProcess (https://bugs.webkit.org/show_bug.cgi?id=185990). * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]): Deleted. 2019-12-17 David Kilzer Remove SafeBrowsingResult Reviewed by Anders Carlsson. * UIProcess/Cocoa/SafeBrowsingResultCocoa.mm: Remove. * UIProcess/SafeBrowsingResult.h: Remove. 2019-12-17 youenn fablet WebKitTestRunner should report GPU process crashes https://bugs.webkit.org/show_bug.cgi?id=205338 Reviewed by Tim Horton. Expose a callback to notify of GPU process crash. No change of behavior. * UIProcess/API/C/WKContext.h: * UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::gpuProcessCrashed): * UIProcess/WebContextClient.cpp: (WebKit::WebContextClient::gpuProcessDidCrash): * UIProcess/WebContextClient.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::gpuProcessCrashed): * UIProcess/WebProcessPool.h: 2019-12-17 Tim Horton macCatalyst: Cursor should update on mouse movement and style change https://bugs.webkit.org/show_bug.cgi?id=205317 Reviewed by Anders Carlsson. * Configurations/WebKit.xcconfig: Link AppKit for NSCursor. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::decode): Enable Cursor encoders. * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::setCursor): * WebProcess/WebCoreSupport/WebChromeClient.cpp: * WebProcess/WebCoreSupport/WebChromeClient.h: Unifdef various things. Implement setCursor(). 2019-12-17 Carlos Garcia Campos [GTK][WPE] IndexedDB directory set in WebsiteDataManager is ignored https://bugs.webkit.org/show_bug.cgi?id=205330 Reviewed by Youenn Fablet. There are two problems here: 1- WebKitWebsiteDataManager is no longer setting the indexedDB directory to the WebsiteDatastore configuration. It seems the code was removed by mistake in r249778 when rolling out r249768. 2- The WebProcessPool is not considering the primary WebsiteDataStore for indexedDB configuration. Fixes: /webkit/WebKitWebsiteData/databases /webkit/WebKitWebsiteData/configuration * UIProcess/API/glib/WebKitWebsiteDataManager.cpp: (webkitWebsiteDataManagerGetDataStore): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): 2019-12-17 youenn fablet Bump the priority of CacheStorageEngine write operations https://bugs.webkit.org/show_bug.cgi?id=205329 Reviewed by Antti Koivisto. Introduce an IOChannel extra optional parameter to set the QOS. Use this parameter for IOChannels created by CacheStorageEngine when writing files to increase the priority to default. Increase the priority of the CacheStorageEngine background queue to default. No observable change of behavior except potential speed increase. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::Engine): (WebKit::CacheStorage::Engine::writeFile): * NetworkProcess/cache/NetworkCacheIOChannel.h: (WebKit::NetworkCache::IOChannel::open): * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm: (WebKit::NetworkCache::dispatchQueueFromPriority): (WebKit::NetworkCache::IOChannel::IOChannel): (WebKit::NetworkCache::IOChannel::open): * NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp: (WebKit::NetworkCache::IOChannel::open): * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: (WebKit::NetworkCache::IOChannel::open): 2019-12-17 youenn fablet WebKitTestRunner should report service worker process crashes https://bugs.webkit.org/show_bug.cgi?id=205267 Reviewed by Chris Dumez. Expose a way for WTR to be notified of service worker process crashes. * UIProcess/API/C/WKContext.h: * UIProcess/WebContextClient.cpp: (WebKit::WebContextClient::serviceWorkerProcessDidCrash): * UIProcess/WebContextClient.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::serviceWorkerProcessCrashed): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch): 2019-12-17 Chris Dumez Improve release logging in NetworkResourceLoader https://bugs.webkit.org/show_bug.cgi?id=205295 Reviewed by Youenn Fablet. Improve release logging in NetworkResourceLoader to facilitate debugging of loading-related issues. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::start): (WebKit::NetworkResourceLoader::retrieveCacheEntry): (WebKit::NetworkResourceLoader::retrieveCacheEntryInternal): (WebKit::NetworkResourceLoader::startNetworkLoad): (WebKit::NetworkResourceLoader::cleanup): (WebKit::NetworkResourceLoader::convertToDownload): (WebKit::NetworkResourceLoader::abort): (WebKit::NetworkResourceLoader::didReceiveResponse): (WebKit::NetworkResourceLoader::didReceiveBuffer): (WebKit::NetworkResourceLoader::didFinishLoading): (WebKit::NetworkResourceLoader::didFailLoading): (WebKit::NetworkResourceLoader::didBlockAuthenticationChallenge): (WebKit::NetworkResourceLoader::willSendRedirectedRequest): (WebKit::NetworkResourceLoader::continueWillSendRedirectedRequest): (WebKit::NetworkResourceLoader::didFinishWithRedirectResponse): (WebKit::NetworkResourceLoader::restartNetworkLoad): (WebKit::NetworkResourceLoader::continueWillSendRequest): (WebKit::NetworkResourceLoader::continueDidReceiveResponse): (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry): (WebKit::NetworkResourceLoader::didReceiveMainResourceResponse): (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): (WebKit::NetworkResourceLoader::sendResultForCacheEntry): (WebKit::NetworkResourceLoader::validateCacheEntry): (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry): (WebKit::NetworkResourceLoader::startWithServiceWorker): (WebKit::NetworkResourceLoader::serviceWorkerDidNotHandle): 2019-12-16 Simon Fraser Change 'delegatesPageScaling' from a Setting to a flag on ScrollView https://bugs.webkit.org/show_bug.cgi?id=205319 Reviewed by Tim Horton. delegatesPageScaling() is never toggled at runtime (even by tests), and it should be a flag on FrameView just like delegatesScrolling (maybe in future the flags can merge). So remove the Setting, and have DrawingArea control whether page scaling is delegated. In WebKit1, WebFrameLoaderClient::transitionToCommittedForNewPage() turns on delegated page scaling for iOS. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::usesDelegatedPageScaling const): * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea): * WebProcess/WebPage/ios/FindControllerIOS.mm: (WebKit::FindIndicatorOverlayClientIOS::drawRect): 2019-12-16 Wenson Hsieh -[UIWKDocumentContext markedTextRange] is wrong when the caret is not at the start of marked text https://bugs.webkit.org/show_bug.cgi?id=205302 Reviewed by Tim Horton. Makes a few minor adjustments around marked text handling in document editing context request code. 1. In the case where markedTextRects are requested, automatically expand the context range (i.e. contextBefore and contextAfter) to encompass the marked text. This fixes UIWKDocumentContext's logic that computes the marked text range by subtracting `contextBefore` string's length from `selectedRangeInMarkedText`'s location. (Note that this still requires an adjustment in UIKit to actually respect `selectedRangeInMarkedText` when computing `markedTextRange`. This is tracked in ). 2. Stop clamping compositionStart and compositionEnd to the range of interest (in this case, the selection range, which is a collapsed caret selection). This makes the composition range seem as if it were empty, which prevents us from computing the marked text string (and importantly, its length). 3. Flip the arguments to `distanceBetweenPositions`, such that we end up with a positive value for `selectedRangeInMarkedText` in the case where `compositionStart` is before `startOfRangeOfInterestInSelection`. Test: DocumentEditingContext.RequestMarkedTextRectsAndTextOnly * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::requestDocumentEditingContext): 2019-12-16 Per Arne Vollan [iOS] Issue mach lookup extension to diagnostics daemon https://bugs.webkit.org/show_bug.cgi?id=205292 Reviewed by Brent Fulgham. For internal installs, issue a mach lookup extension to the diagnostics daemon. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::isInternalInstall): (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2019-12-16 Daniel Bates Reproducible case of backwards nextParagraph returning a position ahead of the input position https://bugs.webkit.org/show_bug.cgi?id=196127 Reviewed by Wenson Hsieh. Remove workaround now that WebCore::nextParagraphBoundaryInDirection() behaves correctly. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::moveByGranularityRespectingWordBoundary): 2019-12-16 youenn fablet Make ServiceWorkerSoftUpdateLoader::loadWithCacheEntry more robust https://bugs.webkit.org/show_bug.cgi?id=205202 rdar://problem/57852910 Reviewed by Chris Dumez. In case loading an entry from the cache, we were calling didReceiveResponse, which may destroy the loader and then continue processing. Instead, add a processResponse method that checks the response and returns an error if needed. didReceiveResponse calls this method and returns early in case of error. So does the method loading data from the cache. Covered by existing tests. * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp: (WebKit::ServiceWorkerSoftUpdateLoader::loadWithCacheEntry): (WebKit::ServiceWorkerSoftUpdateLoader::didReceiveResponse): (WebKit::ServiceWorkerSoftUpdateLoader::processResponse): * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.h: 2019-12-16 Antti Koivisto Remove display:contents feature flag https://bugs.webkit.org/show_bug.cgi?id=205276 Reviewed by Ryosuke Niwa. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetDisplayContentsEnabled): Deleted. (WKPreferencesGetDisplayContentsEnabled): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: 2019-12-16 Wenson Hsieh Fix API availability for -_getResourceLoadStatisticsDataSummary: after r253484 https://bugs.webkit.org/show_bug.cgi?id=205256 Reviewed by Alex Christensen. Replaces WK_API_AVAILABLE(macos(10.15), ios(13.0)) with WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)), since this is new WebKit SPI that hasn't made its way into the SDK. * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: 2019-12-16 Daniel Bates -requestDocumentContext always returns 1 text unit more granularity than requested https://bugs.webkit.org/show_bug.cgi?id=205142 Reviewed by Darin Adler and Wenson Hsieh. Use WebCore::atBoundaryOfGranularity() to identify each boundary so that we return the position exactly granularityCount text units advanced from the specified position. When using sentence granularity we do not need to round the resulting position to the nearest word because it already falls before the next word (if there is one). For all other granularities we do what we do now and round to the nearest word, which may cross that granularity's boundary. Additionally, added assertions to ensure that we are passed a non-zero granularity count and a non- null initial position. The function takes advantage of these assumptions to 1) ensure correct results and 2) make use of a do-while loop. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::moveByGranularityRespectingWordBoundary): 2019-12-16 Simon Fraser Let the DrawingArea decide whether scrolling is delegated https://bugs.webkit.org/show_bug.cgi?id=205258 Reviewed by Anders Carlsson. Delegated scrolling was hardcoded on for iOS WK2 (as it is for iOS WK1) and off for macOS, but if macOS is using RemoteLayerTreeDrawingArea that should also use delegated scrolling. Also make some DrawingArea functions const, and put m_frame->coreFrame()->view() into a local RefPtr in WebFrameLoaderClient::transitionToCommittedForNewPage(). * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::supportsAsyncScrolling const): (WebKit::DrawingArea::usesDelegatedScrolling const): (WebKit::DrawingArea::shouldUseTiledBackingForFrameView const): (WebKit::DrawingArea::supportsAsyncScrolling): Deleted. (WebKit::DrawingArea::shouldUseTiledBackingForFrameView): Deleted. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::shouldUseTiledBackingForFrameView const): (WebKit::RemoteLayerTreeDrawingArea::shouldUseTiledBackingForFrameView): Deleted. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::shouldUseTiledBackingForFrameView const): (WebKit::TiledCoreAnimationDrawingArea::shouldUseTiledBackingForFrameView): Deleted. 2019-12-16 Eric Carlson Log when unimplemented remote MediaPlayer methods are called https://bugs.webkit.org/show_bug.cgi?id=205269 Reviewed by Youenn Fablet. * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::mediaPlayerPlaybackStateChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerSawUnsupportedTracks): (WebKit::RemoteMediaPlayerProxy::mediaPlayerResourceNotSupported): (WebKit::RemoteMediaPlayerProxy::mediaPlayerRepaint): (WebKit::RemoteMediaPlayerProxy::mediaPlayerSizeChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerEngineUpdated): (WebKit::RemoteMediaPlayerProxy::mediaPlayerFirstVideoFrameAvailable): (WebKit::RemoteMediaPlayerProxy::mediaPlayerCharacteristicChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerRenderingCanBeAccelerated): (WebKit::RemoteMediaPlayerProxy::mediaPlayerRenderingModeChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerAcceleratedCompositingEnabled): (WebKit::RemoteMediaPlayerProxy::mediaPlayerActiveSourceBuffersChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerCachedKeyForKeyId const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerKeyNeeded): (WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaKeysStorageDirectory const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerInitializationDataEncountered): (WebKit::RemoteMediaPlayerProxy::mediaPlayerWaitingForKeyChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerReferrer const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerUserAgent const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerEnterFullscreen): (WebKit::RemoteMediaPlayerProxy::mediaPlayerExitFullscreen): (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsFullscreen const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsFullscreenPermitted const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsVideo const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerContentBoxRect const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerContentsScale const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerSetSize): (WebKit::RemoteMediaPlayerProxy::mediaPlayerPause): (WebKit::RemoteMediaPlayerProxy::mediaPlayerPlay): (WebKit::RemoteMediaPlayerProxy::mediaPlayerPlatformVolumeConfigurationRequired const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsPaused const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsLooping const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerCachedResourceLoader): (WebKit::RemoteMediaPlayerProxy::mediaPlayerCreateResourceLoader): (WebKit::RemoteMediaPlayerProxy::doesHaveAttribute const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerShouldUsePersistentCache const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerMediaCacheDirectory const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidAddAudioTrack): (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidAddTextTrack): (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidAddVideoTrack): (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidRemoveAudioTrack): (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidRemoveTextTrack): (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidRemoveVideoTrack): (WebKit::RemoteMediaPlayerProxy::textTrackRepresentationBoundsChanged): (WebKit::RemoteMediaPlayerProxy::outOfBandTrackSources): (WebKit::RemoteMediaPlayerProxy::mediaPlayerNetworkInterfaceName const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerGetRawCookies const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerHandlePlaybackCommand): (WebKit::RemoteMediaPlayerProxy::mediaPlayerSourceApplicationIdentifier const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsInMediaDocument const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerEngineFailedToLoad const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerRequestedPlaybackRate const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerFullscreenMode const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerIsVideoFullscreenStandby const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerPreferredAudioCharacteristics const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerShouldDisableSleep const): (WebKit::RemoteMediaPlayerProxy::mediaContentTypesRequiringHardwareSupport const): (WebKit::RemoteMediaPlayerProxy::mediaPlayerShouldCheckHardwareSupport const): * GPUProcess/media/RemoteMediaPlayerProxy.h: 2019-12-16 Kate Cheney Add NS_UNAVAILABLE tags to prevent alloc inits for _WKResourceLoadStatistics* classes https://bugs.webkit.org/show_bug.cgi?id=205221 Reviewed by Anders Carlsson. This patch ensures that no one tries to alloc init _WKResourceLoadStatisticsFirstParty or _WKResourceLoadStatisticsThirdParty. They should only be created via the API call to create(). * UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.h: * UIProcess/API/Cocoa/_WKResourceLoadStatisticsThirdParty.h: 2019-12-16 youenn fablet http/wpt/service-workers/postMessage-fetch-order.https.html is a flaky failure after r253528 https://bugs.webkit.org/show_bug.cgi?id=205261 Reviewed by Chris Dumez. Instead of starting the fetch task asynchronously, start it synchronously but make sure that not handling the fetch is either coming from IPC or is done asynchronously. We add a boolean m_isDone that ensures that the loader will only be called once for didFail/didFinish/didNotHandle. This covers the potential case of a task for which cannotHandle is called synchronously at creation but the call to didNotHandle is not yet done. Before the call to didNotHandle is done, a timeout timer is firing and will call didNotHandle a first time. The second didNotHandle should be a no-op. Covered by existing tests and unflakes above test. * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::contextClosed): (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse): (WebKit::ServiceWorkerFetchTask::didReceiveResponse): (WebKit::ServiceWorkerFetchTask::didReceiveData): (WebKit::ServiceWorkerFetchTask::didReceiveFormData): (WebKit::ServiceWorkerFetchTask::didFinish): (WebKit::ServiceWorkerFetchTask::didFail): (WebKit::ServiceWorkerFetchTask::didNotHandle): Make sure to call didNotHandle only once based on m_isDone. (WebKit::ServiceWorkerFetchTask::cannotHandle): Do not expose didNotHandle as a public method. Instead expose cannotHandle that will call didNotHandle asynchronously. (WebKit::ServiceWorkerFetchTask::continueFetchTaskWith): No need to set a timer if we will not create a fetch event. * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: (WebKit::ServiceWorkerFetchTask::takeRequest): * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::fetchTaskTimedOut): Small refactoring to only use contextClosed and not expose whether the task is handled or not. This also potentially allows to call didNotHandle in case the service worker crashed before answering the fetch event. 2019-12-16 Emilio Cobos Álvarez [GTK] Build with USE_WPE_RENDERER=No fails with undefined EGL_WAYLAND_BUFFER_WL https://bugs.webkit.org/show_bug.cgi?id=205250 Reviewed by Carlos Garcia Campos. Define the enum if not present. No new tests, just a build fix. * UIProcess/gtk/WaylandCompositor.cpp: 2019-12-16 youenn fablet Reset cached getUserMedia queries when calling stopMediaCapture https://bugs.webkit.org/show_bug.cgi?id=205064 Reviewed by Eric Carlson. Reset cached queries when calling stop media capture API allows to trigger again the prompt after the API call. Covered by updated API test. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess): * UIProcess/UserMediaPermissionRequestManagerProxy.h: (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::stopMediaCapture): 2019-12-15 Wenson Hsieh -[WKWebView _detectDataWithTypes:completionHandler:] crashes when there is no running process https://bugs.webkit.org/show_bug.cgi?id=205254 Reviewed by Tim Horton. Bail early and call the completion handler in the case where we don't have a running web process, to avoid a null `Connection*` deref. Speculative fix for . * UIProcess/WebPageProxy.cpp: 2019-12-14 Adrian Perez de Castro [GTK][WPE] Fix various non-unified build issues introduced since r251698 https://bugs.webkit.org/show_bug.cgi?id=204891 Reviewed by Alex Christensen. * NetworkProcess/IndexedDB/WebIDBServer.cpp: Add missing WebCore namespace prefixes in function declarations. (WebKit::WebIDBServer::create): (WebKit::WebIDBServer::WebIDBServer): (WebKit::WebIDBServer::closeAndDeleteDatabasesForOrigins): (WebKit::WebIDBServer::suspend): (WebKit::WebIDBServer::idFireVersionChangeEvent): * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::requestSpace): Add missing namespace prefix for WebCore::ClientOrigin. * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp: Add missing inclusion of WebCore/RegistrableDomain.h (WebKit::NetworkCache::SubresourceInfo::isFirstParty const): Add missing namespace prefix for WebCore::RegistrableDomain. * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::setFilesForInputFileUpload): Add missing namespace prefix for WebCore::File::create() and WebCore::FileList::create() calls. 2019-12-14 Simon Fraser Rename "customFixedPositionRect" to "layoutViewportRect" https://bugs.webkit.org/show_bug.cgi?id=205241 Reviewed by Dean Jackson. WK2 computes the rect used to layout out position:fixed elements in the UI process. For historical reasons this was called customFixedPositionRect, but rename it to layoutViewportRect since that what it really is. * Shared/VisibleContentRectUpdateInfo.cpp: (WebKit::VisibleContentRectUpdateInfo::encode const): (WebKit::VisibleContentRectUpdateInfo::decode): (WebKit::operator<<): * Shared/VisibleContentRectUpdateInfo.h: (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): (WebKit::VisibleContentRectUpdateInfo::layoutViewportRect const): (WebKit::operator==): (WebKit::VisibleContentRectUpdateInfo::customFixedPositionRect const): Deleted. * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::currentLayoutViewport const): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::layoutViewportRect const): (WebKit::WebPageProxy::customFixedPositionRect const): Deleted. * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): (-[WKContentView _didCommitLayerTree:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::computeLayoutViewportRect const): (WebKit::WebPageProxy::unconstrainedLayoutViewportRect const): (WebKit::WebPageProxy::computeCustomFixedPositionRect const): Deleted. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateVisibleContentRects): 2019-12-14 Per Arne Vollan Map CSS value ID to system color in the UI process https://bugs.webkit.org/show_bug.cgi?id=204314 Reviewed by Brent Fulgham. Create mapping between CSS value IDs and system colors in the UI process and send to the WebContent process on process startup. No new tests, covered by existing tests. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2019-12-14 Per Arne Vollan [iOS] Deny mach lookup access to "*.viewservice" in the WebContent process https://bugs.webkit.org/show_bug.cgi?id=205240 Reviewed by Brent Fulgham. As part of sandbox hardening in the WebContent process, mach lookup access to “*.viewservice” should be removed. Test: fast/sandbox/ios/sandbox-mach-lookup.html * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-12-14 Chris Dumez WebSWServerConnection::startFetch() should never fail synchronously https://bugs.webkit.org/show_bug.cgi?id=205225 Reviewed by Geoffrey Garen. WebSWServerConnection::startFetch() should never fail synchronously. If it does, it will confuse the NetworkResourceLoader. NetworkResourceLoader::serviceWorkerDidNotHandle() will get called *before* NetworkResourceLoader::m_serviceWorkerFetchTask has been sent, which means that we would not properly deal with redirects. Worse, the call site which creates the ServiceWorkerFetchTask would then null out m_networkLoad, which would silently cancel the load that WebSWServerConnection::startFetch() started synchronously. No new tests, I am not sure how to test this. It would have to cause a redirect do a URL that has a service worker and then we would have to get WebSWServerConnection::startFetch() to fail synchronously. I think that to fail synchronously, we would have to not find a ServiceWorker with the given ID, or the ServiceWorker's hasTimedOutAnyFetchTasks would have to be set. I added a RELEASE_ASSERT() in NetworkResourceLoader::serviceWorkerDidNotHandle() that would have caught this. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): 2019-12-14 Simon Fraser Move code out of WKWebView.mm into platform-specific files, for easier navigation https://bugs.webkit.org/show_bug.cgi?id=205233 Reviewed by Tim Horton. Move as much platform-specific code out of WKWebView.mm as possible, moving it to WKWebViewMac/WKWebViewIOS. WKWebView (WKPrivate) is split into WKWebView (WKPrivateIOS) and WKWebView (WKPrivateMac) so the implementations of those functions can move. Code that remains in WKWebView.mm is either Cocoa-generic, or implements API. This is entirely cut/paste, other than the addition of -_takeFindStringFromSelectionInternal: for macOS to allow WKWebView.mm to call -takeFindStringFromSelection:. * SourcesCocoa.txt: * UIProcess/API/Cocoa/WKWebView.mm: (hardwareKeyboardAvailabilityChangedCallback): (-[WKWebView setAllowsBackForwardNavigationGestures:]): (-[WKWebView allowsBackForwardNavigationGestures]): (-[WKWebView setPageZoom:]): (-[WKWebView pageZoom]): (toFindOptions): (-[WKWebView findString:withConfiguration:completionHandler:]): (+[WKWebView handlesURLScheme:]): (-[WKWebView setMediaType:]): (-[WKWebView mediaType]): (-[WKWebView scrollView]): (-[WKWebView setAllowsMagnification:]): (-[WKWebView allowsMagnification]): (-[WKWebView setMagnification:centeredAtPoint:]): (-[WKWebView setMagnification:]): (-[WKWebView magnification]): (-[WKWebView printOperationWithPrintInfo:]): (-[WKWebView _showSafeBrowsingWarning:completionHandler:]): (-[WKWebView _clearSafeBrowsingWarning]): (-[WKWebView _clearSafeBrowsingWarningIfForMainFrameNavigation]): (-[WKWebView _internalDoAfterNextPresentationUpdate:withoutWaitingForPainting:withoutWaitingForAnimatedResize:]): (dictionaryRepresentationForEditorState): (nsTextAlignment): (selectionAttributes): (-[WKWebView _didChangeEditorState]): (-[WKWebView _toggleStrikeThrough:]): (-[WKWebView _increaseListLevel:]): (-[WKWebView _decreaseListLevel:]): (-[WKWebView _changeListType:]): (-[WKWebView inputAccessoryView]): (-[WKWebView inputView]): (-[WKWebView inputAssistantItem]): (-[WKWebView _selectionAttributes]): (-[WKWebView _viewportSizeForCSSViewportUnits]): (-[WKWebView _setViewportSizeForCSSViewportUnits:]): (-[WKWebView _inspector]): (-[WKWebView _mainFrame]): (-[WKWebView _isEditable]): (-[WKWebView _setEditable:]): (-[WKWebView _executeEditCommand:argument:completion:]): (-[WKWebView _textManipulationDelegate]): (-[WKWebView _setTextManipulationDelegate:]): (-[WKWebView _startTextManipulationsWithConfiguration:completion:]): (-[WKWebView _completeTextManipulation:completion:]): (-[WKWebView _takeFindStringFromSelection:]): (+[WKWebView _stringForFind]): (+[WKWebView _setStringForFind:]): (-[WKWebView _remoteObjectRegistry]): (-[WKWebView _handle]): (-[WKWebView _observedRenderingProgressEvents]): (-[WKWebView _historyDelegate]): (-[WKWebView _setHistoryDelegate:]): (-[WKWebView _updateMediaPlaybackControlsManager]): (-[WKWebView _canTogglePictureInPicture]): (-[WKWebView _isPictureInPictureActive]): (-[WKWebView _togglePictureInPicture]): (-[WKWebView _closeAllMediaPresentations]): (-[WKWebView _stopMediaCapture]): (-[WKWebView _stopAllMediaPlayback]): (-[WKWebView _suspendAllMediaPlayback]): (-[WKWebView _resumeAllMediaPlayback]): (-[WKWebView _unreachableURL]): (-[WKWebView _mainFrameURL]): (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]): (-[WKWebView _loadData:MIMEType:characterEncodingName:baseURL:userData:]): (-[WKWebView _loadRequest:shouldOpenExternalURLs:]): (-[WKWebView _certificateChain]): (-[WKWebView _committedURL]): (-[WKWebView _MIMEType]): (-[WKWebView _userAgent]): (-[WKWebView _applicationNameForUserAgent]): (-[WKWebView _setApplicationNameForUserAgent:]): (-[WKWebView _customUserAgent]): (-[WKWebView _setCustomUserAgent:]): (-[WKWebView _setUserContentExtensionsEnabled:]): (-[WKWebView _userContentExtensionsEnabled]): (-[WKWebView _webProcessIdentifier]): (-[WKWebView _provisionalWebProcessIdentifier]): (-[WKWebView _webProcessIsResponsive]): (-[WKWebView _killWebContentProcess]): (-[WKWebView _reloadWithoutContentBlockers]): (-[WKWebView _reloadExpiredOnly]): (-[WKWebView _killWebContentProcessAndResetState]): (-[WKWebView _convertRectFromRootViewCoordinates:]): (-[WKWebView _convertRectToRootViewCoordinates:]): (-[WKWebView _requestTextInputContextsInRect:completionHandler:]): (-[WKWebView _focusTextInputContext:completionHandler:]): (-[WKWebView _takePDFSnapshotWithConfiguration:completionHandler:]): (-[WKWebView _sessionStateData]): (-[WKWebView _sessionState]): (-[WKWebView _sessionStateWithFilter:]): (-[WKWebView _restoreFromSessionStateData:]): (-[WKWebView _restoreSessionState:andNavigate:]): (-[WKWebView _close]): (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]): (-[WKWebView _insertAttachmentWithFileWrapper:contentType:options:completion:]): (-[WKWebView _insertAttachmentWithFileWrapper:contentType:completion:]): (-[WKWebView _attachmentForIdentifier:]): (-[WKWebView _simulateDeviceOrientationChangeWithAlpha:beta:gamma:]): (+[WKWebView _handlesSafeBrowsing]): (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]): (-[WKWebView _showSafeBrowsingWarningWithURL:title:warning:details:completionHandler:]): (+[WKWebView _confirmMalwareSentinel]): (+[WKWebView _visitUnsafeWebsiteSentinel]): (-[WKWebView _isJITEnabled:]): (-[WKWebView _evaluateJavaScriptWithoutUserGesture:completionHandler:]): (-[WKWebView _updateWebsitePolicies:]): (-[WKWebView _allowsRemoteInspection]): (-[WKWebView _setAllowsRemoteInspection:]): (-[WKWebView _remoteInspectionNameOverride]): (-[WKWebView _setRemoteInspectionNameOverride:]): (-[WKWebView _addsVisitedLinks]): (-[WKWebView _setAddsVisitedLinks:]): (-[WKWebView _networkRequestsInProgress]): (layoutMilestones): (-[WKWebView _setObservedRenderingProgressEvents:]): (-[WKWebView _getMainResourceDataWithCompletionHandler:]): (-[WKWebView _getWebArchiveDataWithCompletionHandler:]): (-[WKWebView _getContentsAsStringWithCompletionHandler:]): (-[WKWebView _getContentsAsAttributedStringWithCompletionHandler:]): (-[WKWebView _getApplicationManifestWithCompletionHandler:]): (-[WKWebView _paginationMode]): (-[WKWebView _setPaginationMode:]): (-[WKWebView _paginationBehavesLikeColumns]): (-[WKWebView _setPaginationBehavesLikeColumns:]): (-[WKWebView _pageLength]): (-[WKWebView _setPageLength:]): (-[WKWebView _gapBetweenPages]): (-[WKWebView _setGapBetweenPages:]): (-[WKWebView _paginationLineGridEnabled]): (-[WKWebView _setPaginationLineGridEnabled:]): (-[WKWebView _pageCount]): (-[WKWebView _supportsTextZoom]): (-[WKWebView _textZoomFactor]): (-[WKWebView _setTextZoomFactor:]): (-[WKWebView _pageZoomFactor]): (-[WKWebView _setPageZoomFactor:]): (-[WKWebView _diagnosticLoggingDelegate]): (-[WKWebView _setDiagnosticLoggingDelegate:]): (-[WKWebView _findDelegate]): (-[WKWebView _setFindDelegate:]): (-[WKWebView _countStringMatches:options:maxCount:]): (-[WKWebView _findString:options:maxCount:]): (-[WKWebView _hideFindUI]): (-[WKWebView _saveBackForwardSnapshotForItem:]): (-[WKWebView _inputDelegate]): (-[WKWebView _setInputDelegate:]): (-[WKWebView _isDisplayingStandaloneImageDocument]): (-[WKWebView _isDisplayingStandaloneMediaDocument]): (-[WKWebView _isPlayingAudio]): (-[WKWebView _isShowingNavigationGestureSnapshot]): (-[WKWebView _layoutMode]): (-[WKWebView _setLayoutMode:]): (-[WKWebView _fixedLayoutSize]): (-[WKWebView _setFixedLayoutSize:]): (-[WKWebView _setBackgroundExtendsBeyondPage:]): (-[WKWebView _backgroundExtendsBeyondPage]): (-[WKWebView _viewScale]): (-[WKWebView _setViewScale:]): (-[WKWebView _setMinimumEffectiveDeviceWidth:]): (-[WKWebView _minimumEffectiveDeviceWidth]): (-[WKWebView _setScrollPerformanceDataCollectionEnabled:]): (-[WKWebView _scrollPerformanceDataCollectionEnabled]): (-[WKWebView _scrollPerformanceData]): (-[WKWebView _allowsMediaDocumentInlinePlayback]): (-[WKWebView _setAllowsMediaDocumentInlinePlayback:]): (-[WKWebView _setFullscreenDelegate:]): (-[WKWebView _fullscreenDelegate]): (-[WKWebView _isInFullscreen]): (-[WKWebView _mediaCaptureState]): (-[WKWebView _setMediaCaptureEnabled:]): (-[WKWebView _mediaCaptureEnabled]): (-[WKWebView _setPageMuted:]): (-[WKWebView _removeDataDetectedLinks:]): (-[WKWebView _doAfterNextPresentationUpdate:]): (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForPainting:]): (toAPIScrollbarStyle): Deleted. (toCoreScrollbarStyle): Deleted. (deviceOrientationForUIInterfaceOrientation): Deleted. (deviceOrientation): Deleted. (-[WKWebView setFrame:]): Deleted. (-[WKWebView setBounds:]): Deleted. (-[WKWebView layoutSubviews]): Deleted. (-[WKWebView _isShowingVideoPictureInPicture]): Deleted. (-[WKWebView _mayAutomaticallyShowVideoPictureInPicture]): Deleted. (-[WKWebView _incrementFocusPreservationCount]): Deleted. (-[WKWebView _decrementFocusPreservationCount]): Deleted. (-[WKWebView _resetFocusPreservationCount]): Deleted. (-[WKWebView _isRetainingActiveFocusedState]): Deleted. (-[WKWebView _effectiveAppearanceIsDark]): Deleted. (-[WKWebView _effectiveUserInterfaceLevelIsElevated]): Deleted. (-[WKWebView _shouldAvoidResizingWhenInputViewBoundsChange]): Deleted. (-[WKWebView _dragInteractionPolicy]): Deleted. (-[WKWebView _setDragInteractionPolicy:]): Deleted. (-[WKWebView _populateArchivedSubviews:]): Deleted. (-[WKWebView _isBackground]): Deleted. (-[WKWebView browsingContextController]): Deleted. (-[WKWebView becomeFirstResponder]): Deleted. (-[WKWebView canBecomeFirstResponder]): Deleted. (-[WKWebView resignFirstResponder]): Deleted. (-[WKWebView canPerformAction:withSender:]): Deleted. (-[WKWebView targetForAction:withSender:]): Deleted. (-[WKWebView willFinishIgnoringCalloutBarFadeAfterPerformingAction]): Deleted. (floorToDevicePixel): Deleted. (pointsEqualInDevicePixels): Deleted. (roundScrollViewContentSize): Deleted. (-[WKWebView _currentContentView]): Deleted. (-[WKWebView _contentProviderRegistry]): Deleted. (-[WKWebView _selectionGranularity]): Deleted. (-[WKWebView _setHasCustomContentView:loadedMIMEType:]): Deleted. (-[WKWebView _didFinishLoadingDataForCustomContentProviderWithSuggestedFilename:data:]): Deleted. (-[WKWebView _handleKeyUIEvent:]): Deleted. (-[WKWebView _willInvokeUIScrollViewDelegateCallback]): Deleted. (-[WKWebView _didInvokeUIScrollViewDelegateCallback]): Deleted. (contentZoomScale): Deleted. (baseScrollViewBackgroundColor): Deleted. (scrollViewBackgroundColor): Deleted. (-[WKWebView _updateScrollViewBackground]): Deleted. (-[WKWebView _videoControlsManagerDidChange]): Deleted. (-[WKWebView _initialContentOffsetForScrollView]): Deleted. (-[WKWebView _contentOffsetAdjustedForObscuredInset:]): Deleted. (-[WKWebView _effectiveObscuredInsetEdgesAffectedBySafeArea]): Deleted. (-[WKWebView _computedObscuredInset]): Deleted. (-[WKWebView _computedContentInset]): Deleted. (-[WKWebView _computedUnobscuredSafeAreaInset]): Deleted. (-[WKWebView _processWillSwapOrDidExit]): Deleted. (-[WKWebView _processWillSwap]): Deleted. (-[WKWebView _processDidExit]): Deleted. (-[WKWebView _didRelaunchProcess]): Deleted. (-[WKWebView _didCommitLoadForMainFrame]): Deleted. (contentOffsetBoundedInValidRange): Deleted. (changeContentOffsetBoundedInValidRange): Deleted. (-[WKWebView visibleRectInViewCoordinates]): Deleted. (areEssentiallyEqualAsFloat): Deleted. (-[WKWebView _didCommitLayerTreeDuringAnimatedResize:]): Deleted. (-[WKWebView _didCommitLayerTree:]): Deleted. (-[WKWebView _layerTreeCommitComplete]): Deleted. (-[WKWebView _couldNotRestorePageState]): Deleted. (-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]): Deleted. (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]): Deleted. (-[WKWebView _takeViewSnapshot]): Deleted. (-[WKWebView _zoomToPoint:atScale:animated:]): Deleted. (-[WKWebView _zoomToRect:atScale:origin:animated:]): Deleted. (constrainContentOffset): Deleted. (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]): Deleted. (-[WKWebView _scrollToRect:origin:minimumScrollDistance:]): Deleted. (-[WKWebView _zoomOutWithOrigin:animated:]): Deleted. (-[WKWebView _zoomToInitialScaleWithOrigin:animated:]): Deleted. (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Deleted. (-[WKWebView _initialScaleFactor]): Deleted. (-[WKWebView _contentZoomScale]): Deleted. (-[WKWebView _targetContentZoomScaleForRect:currentScale:fitEntireRect:minimumScale:maximumScale:]): Deleted. (-[WKWebView _zoomToRect:withOrigin:fitEntireRect:minimumScale:maximumScale:minimumScrollDistance:]): Deleted. (-[WKWebView didMoveToWindow]): Deleted. (-[WKWebView _setOpaqueInternal:]): Deleted. (-[WKWebView setOpaque:]): Deleted. (-[WKWebView setBackgroundColor:]): Deleted. (-[WKWebView _allowsDoubleTapGestures]): Deleted. (-[WKWebView _stylusTapGestureShouldCreateEditableImage]): Deleted. (-[WKWebView usesStandardContentView]): Deleted. (-[WKWebView scrollView:contentSizeForZoomScale:withProposedSize:]): Deleted. (-[WKWebView viewForZoomingInScrollView:]): Deleted. (-[WKWebView scrollViewWillBeginZooming:withView:]): Deleted. (-[WKWebView scrollViewWillBeginDragging:]): Deleted. (-[WKWebView _didFinishScrolling]): Deleted. (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Deleted. (-[WKWebView scrollViewDidEndDragging:willDecelerate:]): Deleted. (-[WKWebView scrollViewDidEndDecelerating:]): Deleted. (-[WKWebView scrollViewDidScrollToTop:]): Deleted. (-[WKWebView _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]): Deleted. (-[WKWebView scrollViewDidScroll:]): Deleted. (-[WKWebView scrollViewDidZoom:]): Deleted. (-[WKWebView scrollViewDidEndZooming:withView:atScale:]): Deleted. (-[WKWebView scrollViewDidEndScrollingAnimation:]): Deleted. (-[WKWebView _scrollViewDidInterruptDecelerating:]): Deleted. (-[WKWebView _enclosingViewForExposedRectComputation]): Deleted. (-[WKWebView _visibleRectInEnclosingView:]): Deleted. (-[WKWebView _visibleContentRect]): Deleted. (-[WKWebView _didScroll]): Deleted. (-[WKWebView _enclosingScrollerScrollingEnded:]): Deleted. (-[WKWebView _scrollViewSystemContentInset]): Deleted. (-[WKWebView activeViewLayoutSize:]): Deleted. (-[WKWebView _dispatchSetViewLayoutSize:]): Deleted. (-[WKWebView _dispatchSetMaximumUnobscuredSize:]): Deleted. (-[WKWebView _dispatchSetDeviceOrientation:]): Deleted. (-[WKWebView _frameOrBoundsChanged]): Deleted. (-[WKWebView _contentRectForUserInteraction]): Deleted. (-[WKWebView _scrollViewIsRubberBanding]): Deleted. (-[WKWebView safeAreaInsetsDidChange]): Deleted. (-[WKWebView _scheduleVisibleContentRectUpdate]): Deleted. (-[WKWebView _scrollViewIsInStableState:]): Deleted. (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]): Deleted. (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]): Deleted. (scrollViewCanScroll): Deleted. (-[WKWebView _contentBoundsExtendedForRubberbandingWithScale:]): Deleted. (-[WKWebView _updateVisibleContentRects]): Deleted. (-[WKWebView _didStartProvisionalLoadForMainFrame]): Deleted. (activeMaximumUnobscuredSize): Deleted. (activeOrientation): Deleted. (-[WKWebView _cancelAnimatedResize]): Deleted. (-[WKWebView _didCompleteAnimatedResize]): Deleted. (-[WKWebView _didFinishLoadForMainFrame]): Deleted. (-[WKWebView _didFailLoadForMainFrame]): Deleted. (-[WKWebView _didSameDocumentNavigationForMainFrame:]): Deleted. (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]): Deleted. (-[WKWebView _shouldUpdateKeyboardWithInfo:]): Deleted. (-[WKWebView _keyboardWillChangeFrame:]): Deleted. (-[WKWebView _keyboardDidChangeFrame:]): Deleted. (-[WKWebView _keyboardWillShow:]): Deleted. (-[WKWebView _keyboardDidShow:]): Deleted. (-[WKWebView _keyboardWillHide:]): Deleted. (-[WKWebView _windowDidRotate:]): Deleted. (-[WKWebView _contentSizeCategoryDidChange:]): Deleted. (-[WKWebView _contentSizeCategory]): Deleted. (-[WKWebView _accessibilitySettingsDidChange:]): Deleted. (-[WKWebView _isNavigationSwipeGestureRecognizer:]): Deleted. (-[WKWebView _navigationGestureDidBegin]): Deleted. (-[WKWebView _navigationGestureDidEnd]): Deleted. (-[WKWebView _showPasswordViewWithDocumentName:passwordHandler:]): Deleted. (-[WKWebView _hidePasswordView]): Deleted. (-[WKWebView _passwordView]): Deleted. (-[WKWebView _updateScrollViewInsetAdjustmentBehavior]): Deleted. (-[WKWebView _setAvoidsUnsafeArea:]): Deleted. (-[WKWebView _haveSetObscuredInsets]): Deleted. (-[WKWebView acceptsFirstResponder]): Deleted. (-[WKWebView viewWillStartLiveResize]): Deleted. (-[WKWebView viewDidEndLiveResize]): Deleted. (-[WKWebView isFlipped]): Deleted. (-[WKWebView intrinsicContentSize]): Deleted. (-[WKWebView prepareContentInRect:]): Deleted. (-[WKWebView setFrameSize:]): Deleted. (-[WKWebView _web_grantDOMPasteAccess]): Deleted. (-[WKWebView _prepareForImmediateActionAnimation]): Deleted. (-[WKWebView _cancelImmediateActionAnimation]): Deleted. (-[WKWebView _completeImmediateActionAnimation]): Deleted. (-[WKWebView ALLOW_DEPRECATED_IMPLEMENTATIONS_END]): Deleted. (-[WKWebView writeSelectionToPasteboard:types:]): Deleted. (-[WKWebView centerSelectionInVisibleArea:]): Deleted. (-[WKWebView validRequestorForSendType:returnType:]): Deleted. (-[WKWebView readSelectionFromPasteboard:]): Deleted. (-[WKWebView changeFont:]): Deleted. (-[WKWebView changeColor:]): Deleted. (-[WKWebView changeAttributes:]): Deleted. (-[WKWebView startSpeaking:]): Deleted. (-[WKWebView stopSpeaking:]): Deleted. (-[WKWebView showGuessPanel:]): Deleted. (-[WKWebView checkSpelling:]): Deleted. (-[WKWebView changeSpelling:]): Deleted. (-[WKWebView toggleContinuousSpellChecking:]): Deleted. (-[WKWebView isGrammarCheckingEnabled]): Deleted. (-[WKWebView setGrammarCheckingEnabled:]): Deleted. (-[WKWebView toggleGrammarChecking:]): Deleted. (-[WKWebView toggleAutomaticSpellingCorrection:]): Deleted. (-[WKWebView orderFrontSubstitutionsPanel:]): Deleted. (-[WKWebView toggleSmartInsertDelete:]): Deleted. (-[WKWebView isAutomaticQuoteSubstitutionEnabled]): Deleted. (-[WKWebView setAutomaticQuoteSubstitutionEnabled:]): Deleted. (-[WKWebView toggleAutomaticQuoteSubstitution:]): Deleted. (-[WKWebView isAutomaticDashSubstitutionEnabled]): Deleted. (-[WKWebView setAutomaticDashSubstitutionEnabled:]): Deleted. (-[WKWebView toggleAutomaticDashSubstitution:]): Deleted. (-[WKWebView isAutomaticLinkDetectionEnabled]): Deleted. (-[WKWebView setAutomaticLinkDetectionEnabled:]): Deleted. (-[WKWebView toggleAutomaticLinkDetection:]): Deleted. (-[WKWebView isAutomaticTextReplacementEnabled]): Deleted. (-[WKWebView setAutomaticTextReplacementEnabled:]): Deleted. (-[WKWebView toggleAutomaticTextReplacement:]): Deleted. (-[WKWebView uppercaseWord:]): Deleted. (-[WKWebView lowercaseWord:]): Deleted. (-[WKWebView capitalizeWord:]): Deleted. (-[WKWebView _wantsKeyDownForEvent:]): Deleted. (-[WKWebView scrollWheel:]): Deleted. (-[WKWebView swipeWithEvent:]): Deleted. (-[WKWebView mouseMoved:]): Deleted. (-[WKWebView mouseDown:]): Deleted. (-[WKWebView mouseUp:]): Deleted. (-[WKWebView mouseDragged:]): Deleted. (-[WKWebView mouseEntered:]): Deleted. (-[WKWebView mouseExited:]): Deleted. (-[WKWebView otherMouseDown:]): Deleted. (-[WKWebView otherMouseDragged:]): Deleted. (-[WKWebView otherMouseUp:]): Deleted. (-[WKWebView rightMouseDown:]): Deleted. (-[WKWebView rightMouseDragged:]): Deleted. (-[WKWebView rightMouseUp:]): Deleted. (-[WKWebView pressureChangeWithEvent:]): Deleted. (-[WKWebView acceptsFirstMouse:]): Deleted. (-[WKWebView shouldDelayWindowOrderingForEvent:]): Deleted. (-[WKWebView doCommandBySelector:]): Deleted. (-[WKWebView insertText:]): Deleted. (-[WKWebView insertText:replacementRange:]): Deleted. (-[WKWebView inputContext]): Deleted. (-[WKWebView performKeyEquivalent:]): Deleted. (-[WKWebView keyUp:]): Deleted. (-[WKWebView keyDown:]): Deleted. (-[WKWebView flagsChanged:]): Deleted. (-[WKWebView setMarkedText:selectedRange:replacementRange:]): Deleted. (-[WKWebView unmarkText]): Deleted. (-[WKWebView selectedRange]): Deleted. (-[WKWebView hasMarkedText]): Deleted. (-[WKWebView markedRange]): Deleted. (-[WKWebView attributedSubstringForProposedRange:actualRange:]): Deleted. (-[WKWebView characterIndexForPoint:]): Deleted. (-[WKWebView typingAttributesWithCompletionHandler:]): Deleted. (-[WKWebView firstRectForCharacterRange:actualRange:]): Deleted. (-[WKWebView selectedRangeWithCompletionHandler:]): Deleted. (-[WKWebView markedRangeWithCompletionHandler:]): Deleted. (-[WKWebView hasMarkedTextWithCompletionHandler:]): Deleted. (-[WKWebView attributedSubstringForProposedRange:completionHandler:]): Deleted. (-[WKWebView firstRectForCharacterRange:completionHandler:]): Deleted. (-[WKWebView characterIndexForPoint:completionHandler:]): Deleted. (-[WKWebView validAttributesForMarkedText]): Deleted. (-[WKWebView draggedImage:endedAt:operation:]): Deleted. (-[WKWebView draggingEntered:]): Deleted. (-[WKWebView draggingUpdated:]): Deleted. (-[WKWebView draggingExited:]): Deleted. (-[WKWebView prepareForDragOperation:]): Deleted. (-[WKWebView performDragOperation:]): Deleted. (-[WKWebView _hitTest:dragTypes:]): Deleted. (-[WKWebView _windowResizeMouseLocationIsInVisibleScrollerThumb:]): Deleted. (-[WKWebView viewWillMoveToWindow:]): Deleted. (-[WKWebView viewDidMoveToWindow]): Deleted. (-[WKWebView drawRect:]): Deleted. (-[WKWebView isOpaque]): Deleted. (-[WKWebView mouseDownCanMoveWindow]): Deleted. (-[WKWebView viewDidHide]): Deleted. (-[WKWebView viewDidUnhide]): Deleted. (-[WKWebView viewDidChangeBackingProperties]): Deleted. (-[WKWebView _activeSpaceDidChange:]): Deleted. (-[WKWebView accessibilityFocusedUIElement]): Deleted. (-[WKWebView accessibilityHitTest:]): Deleted. (-[WKWebView accessibilityAttributeValue:]): Deleted. (-[WKWebView accessibilityAttributeValue:forParameter:]): Deleted. (-[WKWebView hitTest:]): Deleted. (-[WKWebView conversationIdentifier]): Deleted. (-[WKWebView quickLookWithEvent:]): Deleted. (-[WKWebView addTrackingRect:owner:userData:assumeInside:]): Deleted. (-[WKWebView _addTrackingRect:owner:userData:assumeInside:useTrackingNum:]): Deleted. (-[WKWebView _addTrackingRects:owner:userDataList:assumeInsideList:trackingNums:count:]): Deleted. (-[WKWebView removeTrackingRect:]): Deleted. (-[WKWebView _removeTrackingRects:count:]): Deleted. (-[WKWebView view:stringForToolTip:point:userData:]): Deleted. (-[WKWebView pasteboardChangedOwner:]): Deleted. (-[WKWebView pasteboard:provideDataForType:]): Deleted. (-[WKWebView namesOfPromisedFilesDroppedAtDestination:]): Deleted. (-[WKWebView wantsUpdateLayer]): Deleted. (-[WKWebView updateLayer]): Deleted. (-[WKWebView smartMagnifyWithEvent:]): Deleted. (-[WKWebView magnifyWithEvent:]): Deleted. (-[WKWebView rotateWithEvent:]): Deleted. (-[WKWebView _usePlatformFindUI]): Deleted. (-[WKWebView _setUsePlatformFindUI:]): Deleted. (-[WKWebView _ensureTextFinderClient]): Deleted. (-[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:]): Deleted. (-[WKWebView replaceMatches:withString:inSelectionOnly:resultCollector:]): Deleted. (-[WKWebView scrollFindMatchToVisible:]): Deleted. (-[WKWebView documentContainerView]): Deleted. (-[WKWebView getSelectedText:]): Deleted. (-[WKWebView selectFindMatch:completionHandler:]): Deleted. (-[WKWebView _web_superInputContext]): Deleted. (-[WKWebView _web_superQuickLookWithEvent:]): Deleted. (-[WKWebView _web_superSwipeWithEvent:]): Deleted. (-[WKWebView _web_superMagnifyWithEvent:]): Deleted. (-[WKWebView _web_superSmartMagnifyWithEvent:]): Deleted. (-[WKWebView _web_superRemoveTrackingRect:]): Deleted. (-[WKWebView _web_superAccessibilityAttributeValue:]): Deleted. (-[WKWebView _web_superDoCommandBySelector:]): Deleted. (-[WKWebView _web_superPerformKeyEquivalent:]): Deleted. (-[WKWebView _web_superKeyDown:]): Deleted. (-[WKWebView _web_superHitTest:]): Deleted. (-[WKWebView _web_immediateActionAnimationControllerForHitTestResultInternal:withType:userData:]): Deleted. (-[WKWebView _web_prepareForImmediateActionAnimation]): Deleted. (-[WKWebView _web_cancelImmediateActionAnimation]): Deleted. (-[WKWebView _web_completeImmediateActionAnimation]): Deleted. (-[WKWebView _web_didChangeContentSize:]): Deleted. (-[WKWebView _web_dragDestinationActionForDraggingInfo:]): Deleted. (-[WKWebView _web_didPerformDragOperation:]): Deleted. (-[WKWebView _web_dismissContentRelativeChildWindows]): Deleted. (-[WKWebView _web_dismissContentRelativeChildWindowsWithAnimation:]): Deleted. (-[WKWebView _web_editorStateDidChange]): Deleted. (-[WKWebView _web_gestureEventWasNotHandledByWebCore:]): Deleted. (-[WKWebView filePromiseProvider:fileNameForType:]): Deleted. (-[WKWebView filePromiseProvider:writePromiseToURL:completionHandler:]): Deleted. (-[WKWebView draggingSession:sourceOperationMaskForDraggingContext:]): Deleted. (-[WKWebView draggingSession:endedAtPoint:operation:]): Deleted. (-[WKWebView makeTouchBar]): Deleted. (-[WKWebView candidateListTouchBarItem]): Deleted. (-[WKWebView _web_didAddMediaControlsManager:]): Deleted. (-[WKWebView _web_didRemoveMediaControlsManager]): Deleted. (-[WKWebView _interactWithMediaControlsForTesting]): Deleted. (-[WKWebView _useSystemAppearance]): Deleted. (-[WKWebView _setUseSystemAppearance:]): Deleted. (-[WKWebView _pageRefForTransitionToWKWebView]): Deleted. (-[WKWebView _canChangeFrameLayout:]): Deleted. (-[WKWebView _tryToSwipeWithEvent:ignoringPinnedState:]): Deleted. (-[WKWebView _ignoresNonWheelEvents]): Deleted. (-[WKWebView _setIgnoresNonWheelEvents:]): Deleted. (-[WKWebView _hasActiveVideoForControlsManager]): Deleted. (-[WKWebView _dismissContentRelativeChildWindows]): Deleted. (-[WKWebView _gestureEventWasNotHandledByWebCore:]): Deleted. (-[WKWebView _disableFrameSizeUpdates]): Deleted. (-[WKWebView _enableFrameSizeUpdates]): Deleted. (-[WKWebView _beginDeferringViewInWindowChanges]): Deleted. (-[WKWebView _endDeferringViewInWindowChanges]): Deleted. (-[WKWebView _endDeferringViewInWindowChangesSync]): Deleted. (-[WKWebView _fullScreenPlaceholderView]): Deleted. (-[WKWebView _fullScreenWindow]): Deleted. (-[WKWebView _underlayColor]): Deleted. (-[WKWebView _setUnderlayColor:]): Deleted. (-[WKWebView _setCustomSwipeViews:]): Deleted. (-[WKWebView _setCustomSwipeViewsTopContentInset:]): Deleted. (-[WKWebView _setDidMoveSwipeSnapshotCallback:]): Deleted. (-[WKWebView _setFrame:andScrollBy:]): Deleted. (-[WKWebView _setTotalHeightOfBanners:]): Deleted. (-[WKWebView _totalHeightOfBanners]): Deleted. (-[WKWebView _setShouldSuppressFirstResponderChanges:]): Deleted. (-[WKWebView _setFont:sender:]): Deleted. (-[WKWebView _setFontSize:sender:]): Deleted. (-[WKWebView _setTextColor:sender:]): Deleted. (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]): Deleted. (-[WKWebView _contentVisibleRect]): Deleted. (-[WKWebView _convertPointFromContentsToView:]): Deleted. (-[WKWebView _convertPointFromViewToContents:]): Deleted. (-[WKWebView didStartFormControlInteraction]): Deleted. (-[WKWebView didEndFormControlInteraction]): Deleted. (-[WKWebView _uiTextCaretRect]): Deleted. (-[WKWebView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]): Deleted. (-[WKWebView _accessibilityStoreSelection]): Deleted. (-[WKWebView _accessibilityClearSelection]): Deleted. (-[WKWebView _contentViewIsFirstResponder]): Deleted. (-[WKWebView _retainActiveFocusedState]): Deleted. (-[WKWebView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]): Deleted. (-[WKWebView _snapshotLayerContentsForBackForwardListItem:]): Deleted. (-[WKWebView _dataDetectionResults]): Deleted. (-[WKWebView _accessibilityRetrieveSpeakSelectionContent]): Deleted. (-[WKWebView _accessibilityDidGetSpeakSelectionContent:]): Deleted. (-[WKWebView _safeBrowsingWarning]): Deleted. (-[WKWebView _doAfterNextStablePresentationUpdate:]): Deleted. (-[WKWebView _detectDataWithTypes:completionHandler:]): Deleted. (-[WKWebView removeFromSuperview]): Deleted. (-[WKWebView _minimumLayoutSizeOverride]): Deleted. (-[WKWebView _setViewLayoutSizeOverride:]): Deleted. (-[WKWebView _obscuredInsets]): Deleted. (-[WKWebView _setObscuredInsets:]): Deleted. (-[WKWebView _obscuredInsetEdgesAffectedBySafeArea]): Deleted. (-[WKWebView _setObscuredInsetEdgesAffectedBySafeArea:]): Deleted. (-[WKWebView _unobscuredSafeAreaInsets]): Deleted. (-[WKWebView _setUnobscuredSafeAreaInsets:]): Deleted. (-[WKWebView _safeAreaShouldAffectObscuredInsets]): Deleted. (-[WKWebView _setInterfaceOrientationOverride:]): Deleted. (-[WKWebView _interfaceOrientationOverride]): Deleted. (-[WKWebView _clearInterfaceOrientationOverride]): Deleted. (-[WKWebView _maximumUnobscuredSizeOverride]): Deleted. (-[WKWebView _setMaximumUnobscuredSizeOverride:]): Deleted. (-[WKWebView _setAllowsViewportShrinkToFit:]): Deleted. (-[WKWebView _allowsViewportShrinkToFit]): Deleted. (-[WKWebView _beginInteractiveObscuredInsetsChange]): Deleted. (-[WKWebView _endInteractiveObscuredInsetsChange]): Deleted. (-[WKWebView _hideContentUntilNextUpdate]): Deleted. (-[WKWebView _beginAnimatedResizeWithUpdates:]): Deleted. (-[WKWebView _endAnimatedResize]): Deleted. (-[WKWebView _resizeWhileHidingContentWithUpdates:]): Deleted. (-[WKWebView _firePresentationUpdateForPendingStableStatePresentationCallbacks]): Deleted. (-[WKWebView _setOverlaidAccessoryViewsInset:]): Deleted. (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): Deleted. (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]): Deleted. (-[WKWebView _clearOverrideLayoutParameters]): Deleted. (viewportArgumentsFromDictionary): Deleted. (-[WKWebView _overrideViewportWithArguments:]): Deleted. (-[WKWebView _viewForFindUI]): Deleted. (-[WKWebView _isDisplayingPDF]): Deleted. (-[WKWebView _dataForDisplayedPDF]): Deleted. (-[WKWebView _suggestedFilenameForDisplayedPDF]): Deleted. (-[WKWebView _webViewPrintFormatter]): Deleted. (toUserInterfaceLayoutDirection): Deleted. (-[WKWebView setSemanticContentAttribute:]): Deleted. (-[WKWebView _drawsBackground]): Deleted. (-[WKWebView _setDrawsBackground:]): Deleted. (-[WKWebView _backgroundColor]): Deleted. (-[WKWebView _setBackgroundColor:]): Deleted. (-[WKWebView _setDrawsTransparentBackground:]): Deleted. (-[WKWebView _inspectorAttachmentView]): Deleted. (-[WKWebView _setInspectorAttachmentView:]): Deleted. (-[WKWebView _setOverlayScrollbarStyle:]): Deleted. (-[WKWebView _overlayScrollbarStyle]): Deleted. (-[WKWebView _windowOcclusionDetectionEnabled]): Deleted. (-[WKWebView _setWindowOcclusionDetectionEnabled:]): Deleted. (-[WKWebView shareSheetDidDismiss:]): Deleted. (-[WKWebView _setOverrideDeviceScaleFactor:]): Deleted. (-[WKWebView _overrideDeviceScaleFactor]): Deleted. (-[WKWebView _setTopContentInset:]): Deleted. (-[WKWebView _topContentInset]): Deleted. (-[WKWebView _pageExtendedBackgroundColor]): Deleted. (-[WKWebView _pinnedState]): Deleted. (-[WKWebView _rubberBandingEnabled]): Deleted. (-[WKWebView _setRubberBandingEnabled:]): Deleted. (-[WKWebView _immediateActionAnimationControllerForHitTestResult:withType:userData:]): Deleted. (-[WKWebView _setAutomaticallyAdjustsContentInsets:]): Deleted. (-[WKWebView _automaticallyAdjustsContentInsets]): Deleted. (-[WKWebView _minimumLayoutWidth]): Deleted. (-[WKWebView _setMinimumLayoutWidth:]): Deleted. (-[WKWebView _shouldExpandContentToViewHeightForAutoLayout]): Deleted. (-[WKWebView _setShouldExpandContentToViewHeightForAutoLayout:]): Deleted. (-[WKWebView _alwaysShowsHorizontalScroller]): Deleted. (-[WKWebView _setAlwaysShowsHorizontalScroller:]): Deleted. (-[WKWebView _alwaysShowsVerticalScroller]): Deleted. (-[WKWebView _setAlwaysShowsVerticalScroller:]): Deleted. (-[WKWebView _printOperationWithPrintInfo:]): Deleted. (-[WKWebView _printOperationWithPrintInfo:forFrame:]): Deleted. (-[WKWebView setUserInterfaceLayoutDirection:]): Deleted. (-[WKWebView _wantsMediaPlaybackControlsView]): Deleted. (-[WKWebView _setWantsMediaPlaybackControlsView:]): Deleted. (-[WKWebView _mediaPlaybackControlsView]): Deleted. (-[WKWebView _addMediaPlaybackControlsView:]): Deleted. (-[WKWebView _removeMediaPlaybackControlsView]): Deleted. (-[WKWebView _prepareForMoveToWindow:completionHandler:]): Deleted. (-[WKWebView _setThumbnailView:]): Deleted. (-[WKWebView _thumbnailView]): Deleted. (-[WKWebView _setIgnoresAllEvents:]): Deleted. (-[WKWebView _ignoresAllEvents]): Deleted. (-[WKWebView _spellCheckerDocumentTag]): Deleted. (-[WKWebView hasFullScreenWindowController]): Deleted. (-[WKWebView closeFullScreenWindowController]): Deleted. (-[WKWebView fullScreenWindowController]): Deleted. (-[WKWebView validateUserInterfaceItem:]): Deleted. (-[WKWebView goBack:]): Deleted. (-[WKWebView goForward:]): Deleted. (-[WKWebView reload:]): Deleted. (-[WKWebView reloadFromOrigin:]): Deleted. (-[WKWebView stopLoading:]): Deleted. (-[WKWebView _printFormatterClass]): Deleted. (-[WKWebView _printProvider]): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/WKWebViewTesting.mm: * UIProcess/API/ios/WKWebViewIOS.h: Copied from Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h. * UIProcess/API/ios/WKWebViewIOS.mm: Added. (deviceOrientationForUIInterfaceOrientation): (deviceOrientation): (-[WKWebView setFrame:]): (-[WKWebView setBounds:]): (-[WKWebView layoutSubviews]): (-[WKWebView _isShowingVideoPictureInPicture]): (-[WKWebView _mayAutomaticallyShowVideoPictureInPicture]): (-[WKWebView _incrementFocusPreservationCount]): (-[WKWebView _decrementFocusPreservationCount]): (-[WKWebView _resetFocusPreservationCount]): (-[WKWebView _isRetainingActiveFocusedState]): (-[WKWebView _effectiveAppearanceIsDark]): (-[WKWebView _effectiveUserInterfaceLevelIsElevated]): (-[WKWebView _populateArchivedSubviews:]): (-[WKWebView _isBackground]): (-[WKWebView browsingContextController]): (-[WKWebView becomeFirstResponder]): (-[WKWebView canBecomeFirstResponder]): (-[WKWebView resignFirstResponder]): (-[WKWebView canPerformAction:withSender:]): (-[WKWebView targetForAction:withSender:]): (-[WKWebView willFinishIgnoringCalloutBarFadeAfterPerformingAction]): (floorToDevicePixel): (pointsEqualInDevicePixels): (roundScrollViewContentSize): (-[WKWebView _currentContentView]): (-[WKWebView _contentProviderRegistry]): (-[WKWebView _selectionGranularity]): (-[WKWebView _setHasCustomContentView:loadedMIMEType:]): (-[WKWebView _didFinishLoadingDataForCustomContentProviderWithSuggestedFilename:data:]): (-[WKWebView _handleKeyUIEvent:]): (-[WKWebView _willInvokeUIScrollViewDelegateCallback]): (-[WKWebView _didInvokeUIScrollViewDelegateCallback]): (contentZoomScale): (baseScrollViewBackgroundColor): (scrollViewBackgroundColor): (-[WKWebView _updateScrollViewBackground]): (-[WKWebView _videoControlsManagerDidChange]): (-[WKWebView _initialContentOffsetForScrollView]): (-[WKWebView _contentOffsetAdjustedForObscuredInset:]): (-[WKWebView _effectiveObscuredInsetEdgesAffectedBySafeArea]): (-[WKWebView _computedObscuredInset]): (-[WKWebView _computedContentInset]): (-[WKWebView _computedUnobscuredSafeAreaInset]): (-[WKWebView _processWillSwapOrDidExit]): (-[WKWebView _processWillSwap]): (-[WKWebView _processDidExit]): (-[WKWebView _didRelaunchProcess]): (-[WKWebView _didCommitLoadForMainFrame]): (contentOffsetBoundedInValidRange): (changeContentOffsetBoundedInValidRange): (-[WKWebView visibleRectInViewCoordinates]): (areEssentiallyEqualAsFloat): (-[WKWebView _didCommitLayerTreeDuringAnimatedResize:]): (-[WKWebView _didCommitLayerTree:]): (-[WKWebView _layerTreeCommitComplete]): (-[WKWebView _couldNotRestorePageState]): (-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]): (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]): (-[WKWebView _takeViewSnapshot]): (-[WKWebView _zoomToPoint:atScale:animated:]): (-[WKWebView _zoomToRect:atScale:origin:animated:]): (constrainContentOffset): (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]): (-[WKWebView _scrollToRect:origin:minimumScrollDistance:]): (-[WKWebView _zoomOutWithOrigin:animated:]): (-[WKWebView _zoomToInitialScaleWithOrigin:animated:]): (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): (-[WKWebView _initialScaleFactor]): (-[WKWebView _contentZoomScale]): (-[WKWebView _targetContentZoomScaleForRect:currentScale:fitEntireRect:minimumScale:maximumScale:]): (-[WKWebView _zoomToRect:withOrigin:fitEntireRect:minimumScale:maximumScale:minimumScrollDistance:]): (-[WKWebView didMoveToWindow]): (-[WKWebView _setOpaqueInternal:]): (-[WKWebView setOpaque:]): (-[WKWebView setBackgroundColor:]): (-[WKWebView _allowsDoubleTapGestures]): (-[WKWebView _stylusTapGestureShouldCreateEditableImage]): (-[WKWebView usesStandardContentView]): (-[WKWebView scrollView:contentSizeForZoomScale:withProposedSize:]): (-[WKWebView viewForZoomingInScrollView:]): (-[WKWebView scrollViewWillBeginZooming:withView:]): (-[WKWebView scrollViewWillBeginDragging:]): (-[WKWebView _didFinishScrolling]): (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]): (-[WKWebView scrollViewDidEndDragging:willDecelerate:]): (-[WKWebView scrollViewDidEndDecelerating:]): (-[WKWebView scrollViewDidScrollToTop:]): (-[WKWebView _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]): (-[WKWebView scrollViewDidScroll:]): (-[WKWebView scrollViewDidZoom:]): (-[WKWebView scrollViewDidEndZooming:withView:atScale:]): (-[WKWebView scrollViewDidEndScrollingAnimation:]): (-[WKWebView _scrollViewDidInterruptDecelerating:]): (-[WKWebView _visibleRectInEnclosingView:]): (-[WKWebView _visibleContentRect]): (-[WKWebView _didScroll]): (-[WKWebView _enclosingScrollerScrollingEnded:]): (-[WKWebView _scrollViewSystemContentInset]): (-[WKWebView activeViewLayoutSize:]): (-[WKWebView _dispatchSetViewLayoutSize:]): (-[WKWebView _dispatchSetMaximumUnobscuredSize:]): (-[WKWebView _dispatchSetDeviceOrientation:]): (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _contentRectForUserInteraction]): (-[WKWebView _scrollViewIsRubberBanding]): (-[WKWebView safeAreaInsetsDidChange]): (-[WKWebView _scheduleVisibleContentRectUpdate]): (-[WKWebView _scrollViewIsInStableState:]): (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]): (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]): (scrollViewCanScroll): (-[WKWebView _contentBoundsExtendedForRubberbandingWithScale:]): (-[WKWebView _updateVisibleContentRects]): (-[WKWebView _didStartProvisionalLoadForMainFrame]): (activeMaximumUnobscuredSize): (activeOrientation): (-[WKWebView _cancelAnimatedResize]): (-[WKWebView _didCompleteAnimatedResize]): (-[WKWebView _didFinishLoadForMainFrame]): (-[WKWebView _didFailLoadForMainFrame]): (-[WKWebView _didSameDocumentNavigationForMainFrame:]): (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]): (-[WKWebView _shouldUpdateKeyboardWithInfo:]): (-[WKWebView _keyboardWillChangeFrame:]): (-[WKWebView _keyboardDidChangeFrame:]): (-[WKWebView _keyboardWillShow:]): (-[WKWebView _keyboardDidShow:]): (-[WKWebView _keyboardWillHide:]): (-[WKWebView _windowDidRotate:]): (-[WKWebView _contentSizeCategoryDidChange:]): (-[WKWebView _accessibilitySettingsDidChange:]): (-[WKWebView _contentSizeCategory]): (-[WKWebView _isNavigationSwipeGestureRecognizer:]): (-[WKWebView _navigationGestureDidBegin]): (-[WKWebView _navigationGestureDidEnd]): (-[WKWebView _showPasswordViewWithDocumentName:passwordHandler:]): (-[WKWebView _hidePasswordView]): (-[WKWebView _passwordView]): (-[WKWebView _updateScrollViewInsetAdjustmentBehavior]): (-[WKWebView _setAvoidsUnsafeArea:]): (-[WKWebView _haveSetObscuredInsets]): (-[WKWebView removeFromSuperview]): (-[WKWebView _firePresentationUpdateForPendingStableStatePresentationCallbacks]): (toUserInterfaceLayoutDirection): (-[WKWebView setSemanticContentAttribute:]): (-[WKWebView _contentVisibleRect]): (-[WKWebView _minimumLayoutSizeOverride]): (-[WKWebView _setViewLayoutSizeOverride:]): (-[WKWebView _maximumUnobscuredSizeOverride]): (-[WKWebView _setMaximumUnobscuredSizeOverride:]): (-[WKWebView _obscuredInsets]): (-[WKWebView _setObscuredInsets:]): (-[WKWebView _obscuredInsetEdgesAffectedBySafeArea]): (-[WKWebView _setObscuredInsetEdgesAffectedBySafeArea:]): (-[WKWebView _unobscuredSafeAreaInsets]): (-[WKWebView _setUnobscuredSafeAreaInsets:]): (-[WKWebView _safeAreaShouldAffectObscuredInsets]): (-[WKWebView _enclosingViewForExposedRectComputation]): (-[WKWebView _setInterfaceOrientationOverride:]): (-[WKWebView _interfaceOrientationOverride]): (-[WKWebView _clearInterfaceOrientationOverride]): (-[WKWebView _setAllowsViewportShrinkToFit:]): (-[WKWebView _allowsViewportShrinkToFit]): (-[WKWebView _isDisplayingPDF]): (-[WKWebView _dataForDisplayedPDF]): (-[WKWebView _suggestedFilenameForDisplayedPDF]): (-[WKWebView _webViewPrintFormatter]): (-[WKWebView _dragInteractionPolicy]): (-[WKWebView _setDragInteractionPolicy:]): (-[WKWebView _shouldAvoidResizingWhenInputViewBoundsChange]): (-[WKWebView _contentViewIsFirstResponder]): (-[WKWebView _uiTextCaretRect]): (-[WKWebView _safeBrowsingWarning]): (-[WKWebView _convertPointFromContentsToView:]): (-[WKWebView _convertPointFromViewToContents:]): (-[WKWebView _doAfterNextStablePresentationUpdate:]): (-[WKWebView _setFont:sender:]): (-[WKWebView _setFontSize:sender:]): (-[WKWebView _setTextColor:sender:]): (-[WKWebView _detectDataWithTypes:completionHandler:]): (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]): (-[WKWebView didStartFormControlInteraction]): (-[WKWebView didEndFormControlInteraction]): (-[WKWebView _beginInteractiveObscuredInsetsChange]): (-[WKWebView _endInteractiveObscuredInsetsChange]): (-[WKWebView _hideContentUntilNextUpdate]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _endAnimatedResize]): (-[WKWebView _resizeWhileHidingContentWithUpdates:]): (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]): (-[WKWebView _clearOverrideLayoutParameters]): (viewportArgumentsFromDictionary): (-[WKWebView _overrideViewportWithArguments:]): (-[WKWebView _viewForFindUI]): (-[WKWebView _setOverlaidAccessoryViewsInset:]): (-[WKWebView _retainActiveFocusedState]): (-[WKWebView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]): (-[WKWebView _snapshotLayerContentsForBackForwardListItem:]): (-[WKWebView _dataDetectionResults]): (-[WKWebView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]): (-[WKWebView _accessibilityStoreSelection]): (-[WKWebView _accessibilityClearSelection]): (-[WKWebView _accessibilityRetrieveSpeakSelectionContent]): (-[WKWebView _accessibilityDidGetSpeakSelectionContent:]): (-[WKWebView _fullScreenPlaceholderView]): (-[WKWebView hasFullScreenWindowController]): (-[WKWebView closeFullScreenWindowController]): (-[WKWebView fullScreenWindowController]): (-[WKWebView _printFormatterClass]): (-[WKWebView _printProvider]): * UIProcess/API/ios/WKWebViewTestingIOS.mm: * UIProcess/API/mac/WKView.mm: (toCoreScrollbarStyle): Deleted. (toAPIScrollbarStyle): Deleted. * UIProcess/API/mac/WKWebViewMac.h: Added. * UIProcess/API/mac/WKWebViewMac.mm: Added. (toAPIScrollbarStyle): (toCoreScrollbarStyle): (-[WKWebView acceptsFirstResponder]): (-[WKWebView becomeFirstResponder]): (-[WKWebView resignFirstResponder]): (-[WKWebView viewWillStartLiveResize]): (-[WKWebView viewDidEndLiveResize]): (-[WKWebView isFlipped]): (-[WKWebView intrinsicContentSize]): (-[WKWebView prepareContentInRect:]): (-[WKWebView setFrameSize:]): (-[WKWebView setUserInterfaceLayoutDirection:]): (-[WKWebView ALLOW_DEPRECATED_IMPLEMENTATIONS_END]): (-[WKWebView writeSelectionToPasteboard:types:]): (-[WKWebView centerSelectionInVisibleArea:]): (-[WKWebView validRequestorForSendType:returnType:]): (-[WKWebView readSelectionFromPasteboard:]): (-[WKWebView changeFont:]): (-[WKWebView changeColor:]): (-[WKWebView changeAttributes:]): (-[WKWebView startSpeaking:]): (-[WKWebView stopSpeaking:]): (-[WKWebView showGuessPanel:]): (-[WKWebView checkSpelling:]): (-[WKWebView changeSpelling:]): (-[WKWebView toggleContinuousSpellChecking:]): (-[WKWebView isGrammarCheckingEnabled]): (-[WKWebView setGrammarCheckingEnabled:]): (-[WKWebView toggleGrammarChecking:]): (-[WKWebView toggleAutomaticSpellingCorrection:]): (-[WKWebView orderFrontSubstitutionsPanel:]): (-[WKWebView toggleSmartInsertDelete:]): (-[WKWebView isAutomaticQuoteSubstitutionEnabled]): (-[WKWebView setAutomaticQuoteSubstitutionEnabled:]): (-[WKWebView toggleAutomaticQuoteSubstitution:]): (-[WKWebView isAutomaticDashSubstitutionEnabled]): (-[WKWebView setAutomaticDashSubstitutionEnabled:]): (-[WKWebView toggleAutomaticDashSubstitution:]): (-[WKWebView isAutomaticLinkDetectionEnabled]): (-[WKWebView setAutomaticLinkDetectionEnabled:]): (-[WKWebView toggleAutomaticLinkDetection:]): (-[WKWebView isAutomaticTextReplacementEnabled]): (-[WKWebView setAutomaticTextReplacementEnabled:]): (-[WKWebView toggleAutomaticTextReplacement:]): (-[WKWebView uppercaseWord:]): (-[WKWebView lowercaseWord:]): (-[WKWebView capitalizeWord:]): (-[WKWebView _wantsKeyDownForEvent:]): (-[WKWebView scrollWheel:]): (-[WKWebView swipeWithEvent:]): (-[WKWebView mouseMoved:]): (-[WKWebView mouseDown:]): (-[WKWebView mouseUp:]): (-[WKWebView mouseDragged:]): (-[WKWebView mouseEntered:]): (-[WKWebView mouseExited:]): (-[WKWebView otherMouseDown:]): (-[WKWebView otherMouseDragged:]): (-[WKWebView otherMouseUp:]): (-[WKWebView rightMouseDown:]): (-[WKWebView rightMouseDragged:]): (-[WKWebView rightMouseUp:]): (-[WKWebView pressureChangeWithEvent:]): (-[WKWebView acceptsFirstMouse:]): (-[WKWebView shouldDelayWindowOrderingForEvent:]): (-[WKWebView doCommandBySelector:]): (-[WKWebView inputContext]): (-[WKWebView performKeyEquivalent:]): (-[WKWebView keyUp:]): (-[WKWebView keyDown:]): (-[WKWebView flagsChanged:]): (-[WKWebView setMarkedText:selectedRange:replacementRange:]): (-[WKWebView unmarkText]): (-[WKWebView selectedRange]): (-[WKWebView hasMarkedText]): (-[WKWebView markedRange]): (-[WKWebView attributedSubstringForProposedRange:actualRange:]): (-[WKWebView characterIndexForPoint:]): (-[WKWebView typingAttributesWithCompletionHandler:]): (-[WKWebView firstRectForCharacterRange:actualRange:]): (-[WKWebView selectedRangeWithCompletionHandler:]): (-[WKWebView markedRangeWithCompletionHandler:]): (-[WKWebView hasMarkedTextWithCompletionHandler:]): (-[WKWebView attributedSubstringForProposedRange:completionHandler:]): (-[WKWebView firstRectForCharacterRange:completionHandler:]): (-[WKWebView characterIndexForPoint:completionHandler:]): (-[WKWebView validAttributesForMarkedText]): (-[WKWebView draggedImage:endedAt:operation:]): (-[WKWebView draggingEntered:]): (-[WKWebView draggingUpdated:]): (-[WKWebView draggingExited:]): (-[WKWebView prepareForDragOperation:]): (-[WKWebView performDragOperation:]): (-[WKWebView _hitTest:dragTypes:]): (-[WKWebView _windowResizeMouseLocationIsInVisibleScrollerThumb:]): (-[WKWebView viewWillMoveToWindow:]): (-[WKWebView viewDidMoveToWindow]): (-[WKWebView drawRect:]): (-[WKWebView isOpaque]): (-[WKWebView mouseDownCanMoveWindow]): (-[WKWebView viewDidHide]): (-[WKWebView viewDidUnhide]): (-[WKWebView viewDidChangeBackingProperties]): (-[WKWebView _activeSpaceDidChange:]): (-[WKWebView accessibilityFocusedUIElement]): (-[WKWebView accessibilityHitTest:]): (-[WKWebView accessibilityAttributeValue:]): (-[WKWebView accessibilityAttributeValue:forParameter:]): (-[WKWebView hitTest:]): (-[WKWebView conversationIdentifier]): (-[WKWebView quickLookWithEvent:]): (-[WKWebView addTrackingRect:owner:userData:assumeInside:]): (-[WKWebView _addTrackingRect:owner:userData:assumeInside:useTrackingNum:]): (-[WKWebView _addTrackingRects:owner:userDataList:assumeInsideList:trackingNums:count:]): (-[WKWebView removeTrackingRect:]): (-[WKWebView _removeTrackingRects:count:]): (-[WKWebView view:stringForToolTip:point:userData:]): (-[WKWebView pasteboardChangedOwner:]): (-[WKWebView pasteboard:provideDataForType:]): (-[WKWebView namesOfPromisedFilesDroppedAtDestination:]): (-[WKWebView wantsUpdateLayer]): (-[WKWebView updateLayer]): (-[WKWebView smartMagnifyWithEvent:]): (-[WKWebView magnifyWithEvent:]): (-[WKWebView rotateWithEvent:]): (-[WKWebView _ensureTextFinderClient]): (-[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:]): (-[WKWebView replaceMatches:withString:inSelectionOnly:resultCollector:]): (-[WKWebView scrollFindMatchToVisible:]): (-[WKWebView documentContainerView]): (-[WKWebView getSelectedText:]): (-[WKWebView selectFindMatch:completionHandler:]): (-[WKWebView filePromiseProvider:fileNameForType:]): (-[WKWebView filePromiseProvider:writePromiseToURL:completionHandler:]): (-[WKWebView draggingSession:sourceOperationMaskForDraggingContext:]): (-[WKWebView draggingSession:endedAtPoint:operation:]): (-[WKWebView _prepareForImmediateActionAnimation]): (-[WKWebView _cancelImmediateActionAnimation]): (-[WKWebView _completeImmediateActionAnimation]): (-[WKWebView _setDrawsTransparentBackground:]): (-[WKWebView shareSheetDidDismiss:]): (-[WKWebView makeTouchBar]): (-[WKWebView candidateListTouchBarItem]): (-[WKWebView _web_didAddMediaControlsManager:]): (-[WKWebView _web_didRemoveMediaControlsManager]): (-[WKWebView _interactWithMediaControlsForTesting]): (-[WKWebView validateUserInterfaceItem:]): (-[WKWebView goBack:]): (-[WKWebView goForward:]): (-[WKWebView reload:]): (-[WKWebView reloadFromOrigin:]): (-[WKWebView stopLoading:]): (-[WKWebView _web_superInputContext]): (-[WKWebView _web_superQuickLookWithEvent:]): (-[WKWebView _web_superSwipeWithEvent:]): (-[WKWebView _web_superMagnifyWithEvent:]): (-[WKWebView _web_superSmartMagnifyWithEvent:]): (-[WKWebView _web_superRemoveTrackingRect:]): (-[WKWebView _web_superAccessibilityAttributeValue:]): (-[WKWebView _web_superDoCommandBySelector:]): (-[WKWebView _web_superPerformKeyEquivalent:]): (-[WKWebView _web_superKeyDown:]): (-[WKWebView _web_superHitTest:]): (-[WKWebView _web_immediateActionAnimationControllerForHitTestResultInternal:withType:userData:]): (-[WKWebView _web_prepareForImmediateActionAnimation]): (-[WKWebView _web_cancelImmediateActionAnimation]): (-[WKWebView _web_completeImmediateActionAnimation]): (-[WKWebView _web_didChangeContentSize:]): (-[WKWebView _web_dragDestinationActionForDraggingInfo:]): (-[WKWebView _web_didPerformDragOperation:]): (-[WKWebView _web_dismissContentRelativeChildWindows]): (-[WKWebView _web_dismissContentRelativeChildWindowsWithAnimation:]): (-[WKWebView _web_editorStateDidChange]): (-[WKWebView _web_gestureEventWasNotHandledByWebCore:]): (-[WKWebView _web_grantDOMPasteAccess]): (-[WKWebView _takeFindStringFromSelectionInternal:]): (-[WKWebView insertText:]): (-[WKWebView insertText:replacementRange:]): (-[WKWebView _pageRefForTransitionToWKWebView]): (-[WKWebView _hasActiveVideoForControlsManager]): (-[WKWebView _ignoresNonWheelEvents]): (-[WKWebView _setIgnoresNonWheelEvents:]): (-[WKWebView _safeBrowsingWarning]): (-[WKWebView _pinnedState]): (-[WKWebView _rubberBandingEnabled]): (-[WKWebView _setRubberBandingEnabled:]): (-[WKWebView _pageExtendedBackgroundColor]): (-[WKWebView _backgroundColor]): (-[WKWebView _setBackgroundColor:]): (-[WKWebView _underlayColor]): (-[WKWebView _setUnderlayColor:]): (-[WKWebView _setTotalHeightOfBanners:]): (-[WKWebView _totalHeightOfBanners]): (-[WKWebView _drawsBackground]): (-[WKWebView _setDrawsBackground:]): (-[WKWebView _setTopContentInset:]): (-[WKWebView _topContentInset]): (-[WKWebView _setAutomaticallyAdjustsContentInsets:]): (-[WKWebView _automaticallyAdjustsContentInsets]): (-[WKWebView _setOverrideDeviceScaleFactor:]): (-[WKWebView _overrideDeviceScaleFactor]): (-[WKWebView _windowOcclusionDetectionEnabled]): (-[WKWebView _setWindowOcclusionDetectionEnabled:]): (-[WKWebView _spellCheckerDocumentTag]): (-[WKWebView _shouldExpandContentToViewHeightForAutoLayout]): (-[WKWebView _setShouldExpandContentToViewHeightForAutoLayout:]): (-[WKWebView _minimumLayoutWidth]): (-[WKWebView _setMinimumLayoutWidth:]): (-[WKWebView _alwaysShowsHorizontalScroller]): (-[WKWebView _setAlwaysShowsHorizontalScroller:]): (-[WKWebView _alwaysShowsVerticalScroller]): (-[WKWebView _setAlwaysShowsVerticalScroller:]): (-[WKWebView _useSystemAppearance]): (-[WKWebView _setUseSystemAppearance:]): (-[WKWebView _setOverlayScrollbarStyle:]): (-[WKWebView _overlayScrollbarStyle]): (-[WKWebView _inspectorAttachmentView]): (-[WKWebView _setInspectorAttachmentView:]): (-[WKWebView _setThumbnailView:]): (-[WKWebView _thumbnailView]): (-[WKWebView _setIgnoresAllEvents:]): (-[WKWebView _ignoresAllEvents]): (-[WKWebView _usePlatformFindUI]): (-[WKWebView _setUsePlatformFindUI:]): (-[WKWebView _setShouldSuppressFirstResponderChanges:]): (-[WKWebView _canChangeFrameLayout:]): (-[WKWebView _tryToSwipeWithEvent:ignoringPinnedState:]): (-[WKWebView _dismissContentRelativeChildWindows]): (-[WKWebView _setFrame:andScrollBy:]): (-[WKWebView _gestureEventWasNotHandledByWebCore:]): (-[WKWebView _disableFrameSizeUpdates]): (-[WKWebView _enableFrameSizeUpdates]): (-[WKWebView _beginDeferringViewInWindowChanges]): (-[WKWebView _endDeferringViewInWindowChanges]): (-[WKWebView _endDeferringViewInWindowChangesSync]): (-[WKWebView _setCustomSwipeViews:]): (-[WKWebView _setCustomSwipeViewsTopContentInset:]): (-[WKWebView _setDidMoveSwipeSnapshotCallback:]): (-[WKWebView _fullScreenPlaceholderView]): (-[WKWebView _fullScreenWindow]): (-[WKWebView _immediateActionAnimationControllerForHitTestResult:withType:userData:]): (-[WKWebView _printOperationWithPrintInfo:]): (-[WKWebView _printOperationWithPrintInfo:forFrame:]): (-[WKWebView _wantsMediaPlaybackControlsView]): (-[WKWebView _setWantsMediaPlaybackControlsView:]): (-[WKWebView _mediaPlaybackControlsView]): (-[WKWebView _addMediaPlaybackControlsView:]): (-[WKWebView _removeMediaPlaybackControlsView]): (-[WKWebView _prepareForMoveToWindow:completionHandler:]): * UIProcess/API/mac/WKWebViewTestingMac.mm: * UIProcess/ios/PageClientImplIOS.mm: * UIProcess/ios/WKContentView.mm: * UIProcess/ios/WKContentViewInteraction.mm: * UIProcess/ios/WKPDFView.mm: * UIProcess/ios/WKScrollView.mm: * UIProcess/ios/WKSystemPreviewView.mm: * WebKit.xcodeproj/project.pbxproj: 2019-12-14 David Kilzer Add release assert for selectedIndex in WebKit::WebPopupMenu::show() Reviewed by Wenson Hsieh. * WebProcess/WebCoreSupport/WebPopupMenu.cpp: (WebKit::WebPopupMenu::show): - Add release assert to check for valid `selectedIndex` to fix the bug. - Rename `index` parameter to `selectedIndex`. * WebProcess/WebCoreSupport/WebPopupMenu.h: (WebKit::WebPopupMenu::show): - Rename `index` parameter to `selectedIndex`. 2019-12-13 Brady Eidson Refactor ScriptController's proliferation of ExceptionDetails*. https://bugs.webkit.org/show_bug.cgi?id=205151 Reviewed by Alex Christensen. * UIProcess/API/C/WKPage.cpp: (WKPageRunJavaScriptInMainFrame): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _evaluateJavaScript:forceUserGesture:completionHandler:]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runJavaScriptInMainFrame): (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld): (WebKit::WebPageProxy::runJavaScriptInFrame): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::performJavaScriptURLRequest): * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp: (WebKit::WebInspectorFrontendAPIDispatcher::evaluateOrQueueExpression): (WebKit::WebInspectorFrontendAPIDispatcher::evaluateQueuedExpressions): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::runJavaScript): 2019-12-13 Eric Carlson Add remote media player message to load and play https://bugs.webkit.org/show_bug.cgi?id=205220 Reviewed by Jer Noble. Add WP -> GPU process messages: PrepareForPlayback, Load, CancelLoad, Play, Pause, SetVolume, and SetMuted Add GPUP -> WP message: PlaybackStateChanged * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: (WebKit::RemoteMediaPlayerManagerProxy::RemoteMediaPlayerManagerProxy): (WebKit::RemoteMediaPlayerManagerProxy::createMediaPlayer): (WebKit::RemoteMediaPlayerManagerProxy::deleteMediaPlayer): (WebKit::RemoteMediaPlayerManagerProxy::prepareForPlayback): (WebKit::RemoteMediaPlayerManagerProxy::load): (WebKit::RemoteMediaPlayerManagerProxy::cancelLoad): (WebKit::RemoteMediaPlayerManagerProxy::play): (WebKit::RemoteMediaPlayerManagerProxy::pause): (WebKit::RemoteMediaPlayerManagerProxy::setVolume): (WebKit::RemoteMediaPlayerManagerProxy::setMuted): (WebKit::RemoteMediaPlayerManagerProxy::logChannel const): * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: (WebKit::RemoteMediaPlayerManagerProxy::gpuConnectionToWebProcess const): (WebKit::RemoteMediaPlayerManagerProxy::webProcessConnection const): Deleted. * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in: * GPUProcess/media/RemoteMediaPlayerProxy.cpp: (WebKit::RemoteMediaPlayerProxy::RemoteMediaPlayerProxy): (WebKit::RemoteMediaPlayerProxy::load): (WebKit::RemoteMediaPlayerProxy::prepareForPlayback): (WebKit::RemoteMediaPlayerProxy::cancelLoad): (WebKit::RemoteMediaPlayerProxy::play): (WebKit::RemoteMediaPlayerProxy::pause): (WebKit::RemoteMediaPlayerProxy::setVolume): (WebKit::RemoteMediaPlayerProxy::setMuted): (WebKit::RemoteMediaPlayerProxy::mediaPlayerNetworkStateChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerReadyStateChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerVolumeChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerMuteChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerTimeChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerDurationChanged): (WebKit::RemoteMediaPlayerProxy::mediaPlayerRateChanged): * GPUProcess/media/RemoteMediaPlayerProxy.h: * WebProcess/GPU/GPUProcessConnection.cpp: (WebKit::GPUProcessConnection::didReceiveMessage): * WebProcess/GPU/GPUProcessConnection.h: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: (WebKit::MediaPlayerPrivateRemote::prepareForPlayback): (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote::load): (WebKit::MediaPlayerPrivateRemote::cancelLoad): (WebKit::MediaPlayerPrivateRemote::play): (WebKit::MediaPlayerPrivateRemote::pause): (WebKit::MediaPlayerPrivateRemote::setVolumeDouble): (WebKit::MediaPlayerPrivateRemote::setMuted): (WebKit::MediaPlayerPrivateRemote::muteChanged): (WebKit::MediaPlayerPrivateRemote::timeChanged): (WebKit::MediaPlayerPrivateRemote::playbackStateChanged): (WebKit::MediaPlayerPrivateRemote::paused const): Deleted. * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: (WebKit::RemoteMediaPlayerManager::RemoteMediaPlayerManager): (WebKit::RemoteMediaPlayerManager::~RemoteMediaPlayerManager): (WebKit::RemoteMediaPlayerManager::playbackStateChanged): * WebProcess/GPU/media/RemoteMediaPlayerManager.h: (WebKit::RemoteMediaPlayerManager::didReceiveMessageFromWebProcess): * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in: 2019-12-13 Chris Dumez [macOS] Swipe gesture snapshot stays too long if provisional load has not started yet when endSwipeGesture() is called https://bugs.webkit.org/show_bug.cgi?id=205206 Reviewed by Tim Horton. Swipe gesture snapshot stays too long if provisional load has not started yet when endSwipeGesture() is called on macOS. This is because the SnapshotRemovalTracker::eventOccurred() calls get ignored while the SnapshotRemovalTracker is paused and the SnapshotRemovalTracker only gets unpaused once the provisional load has started. The idea is that we should ignore any events from a previous navigation. However, the SwipeGestureEnd event is a UI-side event fired by the ViewGestureController itself, so there is reason to ignore it. Since we ask the WebContent process to do the load in willEndSwipeGesture(), it is possible that the provisional load has not started yet by the time endSwipeGesture() is called. In such case, the SwipeGestureEnd event would get ignored and we would keep the snapshot until the timeout. * UIProcess/ViewGestureController.cpp: (WebKit::stopWaitingForEvent): (WebKit::ViewGestureController::SnapshotRemovalTracker::eventOccurred): (WebKit::ViewGestureController::endSwipeGesture): (WebKit::ViewGestureController::SnapshotRemovalTracker::stopWaitingForEvent): Deleted. * UIProcess/ViewGestureController.h: 2019-12-13 David Kilzer Add MESSAGE_CHECK() for selectedIndex in Messages::WebPageProxy::ShowPopupMenu Reviewed by Chris Dumez. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::showPopupMenu): Add MESSAGE_CHECK() to validate the `selectedIndex` parameter, which must be -1 to select no items, or a valid zero-based index into `items`. 2019-12-13 Alex Christensen Allow cross-origin requests to WKURLSchemeHandlers https://bugs.webkit.org/show_bug.cgi?id=205198 Reviewed by Brady Eidson. Covered by an API test. * UIProcess/API/Cocoa/WKURLSchemeTask.h: Document the requirements for cross-origin requests. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::registerURLSchemeHandler): When we register a scheme handler, allow cross origin resources for that scheme. This will make the check in DocumentThreadableLoader::checkURLSchemeAsCORSEnabled allow the request to get to the WKURLSchemeHandler. The resposne must still have CORS header fields in order for the data to get to the web content, like CORS with HTTP. 2019-12-13 Wenson Hsieh Implement encoding/decoding for DisplayList::DrawNativeImage https://bugs.webkit.org/show_bug.cgi?id=205200 Reviewed by Simon Fraser. Add helper functions to encode and decode NativeImagePtr (RetainPtr on Cocoa platforms). This mirrors the implementation of encoding and decoding for WebCore::Image, which create and draws into ShareableBitmap, and send a handle to the data over IPC. * Shared/WebCoreArgumentCoders.cpp: (IPC::encodeImage): (IPC::decodeImage): (IPC::encodeNativeImage): (IPC::decodeNativeImage): Additionally make Image and NativeImagePtr encoding and decoding helpers fail quickly in the case where the ShareableBitmap failed to create a graphics context by having the encoder indicate whether a graphics context was created, and having the decoder fail if the graphics context could not be created. (IPC::encodeOptionalNativeImage): (IPC::decodeOptionalNativeImage): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: 2019-12-13 Per Arne Vollan [iOS] Deny mach lookup access to "*.apple-extension-service" in the WebContent process https://bugs.webkit.org/show_bug.cgi?id=205134 Reviewed by Brent Fulgham. Remove mach lookup access to "*.apple-extension-service" in the sandbox. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-12-13 youenn fablet Help debugging flaky http/tests/cache-storage/page-cache-domcachestorage-pending-promise.html https://bugs.webkit.org/show_bug.cgi?id=205209 Reviewed by Chris Dumez. Add a bunch of asserts that no pending activity is happening in the Cache Storage backend is happening when querying the backend representation, which is a debug tool. No change of behavior. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::representation): * NetworkProcess/cache/CacheStorageEngineCache.h: (WebKit::CacheStorage::Cache::hasPendingOpeningCallbacks const): * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::appendRepresentation const): 2019-12-13 Kate Cheney Create WebKit API calls for ITP Data https://bugs.webkit.org/show_bug.cgi?id=204932 Reviewed by Alex Christensen. This patch exposes ITP data captured in the network process through the Objective C API using two new classes: _WKResourceLoadStatisticsFirstParty and _WKResourceLoadStatisticsThirdParty. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: (WebKit::ensureThirdPartyDataForSpecificFirstPartyDomain): (WebKit::getThirdPartyDataForSpecificFirstPartyDomains): (WebKit::ResourceLoadStatisticsMemoryStore::aggregatedThirdPartyData const): * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: Updated mentions of ThirdPartyData to include the WebResourceLoadStatisticsStore:: class specifier after relocating ThirdPartyData. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::aggregatedThirdPartyData): * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: Updated the data to be sent via completion handler from WebResourceLoadStatisticsStore so that calls to aggregatedThirdPartyData() are happening on a background thread. * Shared/API/APIObject.h: * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * UIProcess/API/APIResourceLoadStatisticsFirstParty.h: Added. * UIProcess/API/APIResourceLoadStatisticsThirdParty.h: Added. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _getResourceLoadStatisticsDataSummary:]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.h: Added. * UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstParty.mm: Added. (-[_WKResourceLoadStatisticsFirstParty dealloc]): (-[_WKResourceLoadStatisticsFirstParty firstPartyDomain]): (-[_WKResourceLoadStatisticsFirstParty storageAccess]): (-[_WKResourceLoadStatisticsFirstParty _apiObject]): * UIProcess/API/Cocoa/_WKResourceLoadStatisticsFirstPartyInternal.h: Added. * UIProcess/API/Cocoa/_WKResourceLoadStatisticsThirdParty.h: Added. * UIProcess/API/Cocoa/_WKResourceLoadStatisticsThirdParty.mm: Added. (-[_WKResourceLoadStatisticsThirdParty dealloc]): (-[_WKResourceLoadStatisticsThirdParty thirdPartyDomain]): (-[_WKResourceLoadStatisticsThirdParty underFirstParties]): (-[_WKResourceLoadStatisticsThirdParty _apiObject]): * UIProcess/API/Cocoa/_WKResourceLoadStatisticsThirdPartyInternal.h: Added. _WKResourceLoadStatisticsFirstParty and _WKResourceLoadStatisticsThirdParty represent first and third party domains respectively which hold ITP data and are strongly typed to ensure the correct data is being exposed via API. The function and parameter names for storage access specify "third party" because each WKITPFirstParty holds data relevent to a specific third party and storage access would not make sense in just a first party context. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::getResourceLoadStatisticsDataSummary): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::getResourceLoadStatisticsDataSummary): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::getResourceLoadStatisticsDataSummary): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebKit.xcodeproj/project.pbxproj: 2019-12-13 Eric Carlson Add infrastructure needed for playing media player in the GPU process https://bugs.webkit.org/show_bug.cgi?id=205094 Reviewed by Youenn Fablet. * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * GPUProcess/GPUConnectionToWebProcess.cpp: (WebKit::GPUConnectionToWebProcess::GPUConnectionToWebProcess): (WebKit::GPUConnectionToWebProcess::~GPUConnectionToWebProcess): (WebKit::GPUConnectionToWebProcess::didReceiveMessage): (WebKit::GPUConnectionToWebProcess::didReceiveSyncMessage): * GPUProcess/GPUConnectionToWebProcess.h: * GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp: Added. (WebKit::nullLogger): (WebKit::RemoteMediaPlayerManagerProxy::PlayerProxy::PlayerProxy): (WebKit::RemoteMediaPlayerManagerProxy::PlayerProxy::~PlayerProxy): (WebKit::RemoteMediaPlayerManagerProxy::RemoteMediaPlayerManagerProxy): (WebKit::RemoteMediaPlayerManagerProxy::~RemoteMediaPlayerManagerProxy): (WebKit::RemoteMediaPlayerManagerProxy::createMediaPlayer): (WebKit::RemoteMediaPlayerManagerProxy::getSupportedTypes): (WebKit::RemoteMediaPlayerManagerProxy::supportsType): (WebKit::RemoteMediaPlayerManagerProxy::originsInMediaCache): (WebKit::RemoteMediaPlayerManagerProxy::clearMediaCache): (WebKit::RemoteMediaPlayerManagerProxy::clearMediaCacheForOrigins): (WebKit::RemoteMediaPlayerManagerProxy::supportsKeySystem): * GPUProcess/media/RemoteMediaPlayerManagerProxy.h: Added. (WebKit::RemoteMediaPlayerManagerProxy::webProcessConnection const): (WebKit::RemoteMediaPlayerManagerProxy::didReceiveMessageFromWebProcess): (WebKit::RemoteMediaPlayerManagerProxy::didReceiveSyncMessageFromWebProcess): * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in: Added. * Scripts/webkit/messages.py: * Sources.txt: * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: Added. (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote): (WebKit::MediaPlayerPrivateRemote::~MediaPlayerPrivateRemote): (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote::load): (WebKit::MediaPlayerPrivateRemote::load): (WebKit::MediaPlayerPrivateRemote::cancelLoad): (WebKit::MediaPlayerPrivateRemote::prepareToPlay): (WebKit::MediaPlayerPrivateRemote::platformLayer const): (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenLayer): (WebKit::MediaPlayerPrivateRemote::updateVideoFullscreenInlineImage): (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenFrame): (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenGravity): (WebKit::MediaPlayerPrivateRemote::setVideoFullscreenMode): (WebKit::MediaPlayerPrivateRemote::videoFullscreenStandbyChanged): (WebKit::MediaPlayerPrivateRemote::accessLog const): (WebKit::MediaPlayerPrivateRemote::errorLog const): (WebKit::MediaPlayerPrivateRemote::platformErrorCode const): (WebKit::MediaPlayerPrivateRemote::play): (WebKit::MediaPlayerPrivateRemote::pause): (WebKit::MediaPlayerPrivateRemote::setBufferingPolicy): (WebKit::MediaPlayerPrivateRemote::supportsPictureInPicture const): (WebKit::MediaPlayerPrivateRemote::supportsFullscreen const): (WebKit::MediaPlayerPrivateRemote::supportsScanning const): (WebKit::MediaPlayerPrivateRemote::requiresImmediateCompositing const): (WebKit::MediaPlayerPrivateRemote::canSaveMediaData const): (WebKit::MediaPlayerPrivateRemote::naturalSize const): (WebKit::MediaPlayerPrivateRemote::hasVideo const): (WebKit::MediaPlayerPrivateRemote::hasAudio const): (WebKit::MediaPlayerPrivateRemote::setVisible): (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote::durationMediaTime const): (WebKit::MediaPlayerPrivateRemote::currentMediaTime const): (WebKit::MediaPlayerPrivateRemote::getStartDate const): (WebKit::MediaPlayerPrivateRemote::seek): (WebKit::MediaPlayerPrivateRemote::seekWithTolerance): (WebKit::MediaPlayerPrivateRemote::seeking const): (WebKit::MediaPlayerPrivateRemote::startTime const): (WebKit::MediaPlayerPrivateRemote::setRateDouble): (WebKit::MediaPlayerPrivateRemote::rate const): (WebKit::MediaPlayerPrivateRemote::setPreservesPitch): (WebKit::MediaPlayerPrivateRemote::paused const): (WebKit::MediaPlayerPrivateRemote::setVolumeDouble): (WebKit::MediaPlayerPrivateRemote::setMuted): (WebKit::MediaPlayerPrivateRemote::hasClosedCaptions const): (WebKit::MediaPlayerPrivateRemote::setClosedCaptionsVisible): (WebKit::MediaPlayerPrivateRemote::maxFastForwardRate const): (WebKit::MediaPlayerPrivateRemote::minFastReverseRate const): (WebKit::MediaPlayerPrivateRemote::networkState const): (WebKit::MediaPlayerPrivateRemote::readyState const): (WebKit::MediaPlayerPrivateRemote::seekable const): (WebKit::MediaPlayerPrivateRemote::buffered const): (WebKit::MediaPlayerPrivateRemote::maxMediaTimeSeekable const): (WebKit::MediaPlayerPrivateRemote::minMediaTimeSeekable const): (WebKit::MediaPlayerPrivateRemote::seekableTimeRangesLastModifiedTime const): (WebKit::MediaPlayerPrivateRemote::liveUpdateInterval const): (WebKit::MediaPlayerPrivateRemote::totalBytes const): (WebKit::MediaPlayerPrivateRemote::didLoadingProgress const): (WebKit::MediaPlayerPrivateRemote::setSize): (WebKit::MediaPlayerPrivateRemote::paint): (WebKit::MediaPlayerPrivateRemote::paintCurrentFrameInContext): (WebKit::MediaPlayerPrivateRemote::copyVideoTextureToPlatformTexture): (WebKit::MediaPlayerPrivateRemote::nativeImageForCurrentTime): (WebKit::MediaPlayerPrivateRemote::setPreload): (WebKit::MediaPlayerPrivateRemote::hasAvailableVideoFrame const): (WebKit::MediaPlayerPrivateRemote::canLoadPoster const): (WebKit::MediaPlayerPrivateRemote::setPoster): (WebKit::MediaPlayerPrivateRemote::enterFullscreen): (WebKit::MediaPlayerPrivateRemote::exitFullscreen): (WebKit::MediaPlayerPrivateRemote::wirelessPlaybackTargetName const): (WebKit::MediaPlayerPrivateRemote::wirelessPlaybackTargetType const): (WebKit::MediaPlayerPrivateRemote::wirelessVideoPlaybackDisabled const): (WebKit::MediaPlayerPrivateRemote::setWirelessVideoPlaybackDisabled): (WebKit::MediaPlayerPrivateRemote::canPlayToWirelessPlaybackTarget const): (WebKit::MediaPlayerPrivateRemote::isCurrentPlaybackTargetWireless const): (WebKit::MediaPlayerPrivateRemote::setWirelessPlaybackTarget): (WebKit::MediaPlayerPrivateRemote::setShouldPlayToPlaybackTarget): (WebKit::MediaPlayerPrivateRemote::canEnterFullscreen const): (WebKit::MediaPlayerPrivateRemote::supportsAcceleratedRendering const): (WebKit::MediaPlayerPrivateRemote::acceleratedRenderingStateChanged): (WebKit::MediaPlayerPrivateRemote::shouldMaintainAspectRatio const): (WebKit::MediaPlayerPrivateRemote::setShouldMaintainAspectRatio): (WebKit::MediaPlayerPrivateRemote::hasSingleSecurityOrigin const): (WebKit::MediaPlayerPrivateRemote::didPassCORSAccessCheck const): (WebKit::MediaPlayerPrivateRemote::wouldTaintOrigin const): (WebKit::MediaPlayerPrivateRemote::movieLoadType const): (WebKit::MediaPlayerPrivateRemote::prepareForRendering): (WebKit::MediaPlayerPrivateRemote::mediaTimeForTimeValue const): (WebKit::MediaPlayerPrivateRemote::maximumDurationToCacheMediaTime const): (WebKit::MediaPlayerPrivateRemote::decodedFrameCount const): (WebKit::MediaPlayerPrivateRemote::droppedFrameCount const): (WebKit::MediaPlayerPrivateRemote::audioDecodedByteCount const): (WebKit::MediaPlayerPrivateRemote::videoDecodedByteCount const): (WebKit::MediaPlayerPrivateRemote::setPrivateBrowsingMode): (WebKit::MediaPlayerPrivateRemote::engineDescription const): (WebKit::MediaPlayerPrivateRemote::audioSourceProvider): (WebKit::MediaPlayerPrivateRemote::createSession): (WebKit::MediaPlayerPrivateRemote::setCDMSession): (WebKit::MediaPlayerPrivateRemote::keyAdded): (WebKit::MediaPlayerPrivateRemote::cdmInstanceAttached): (WebKit::MediaPlayerPrivateRemote::cdmInstanceDetached): (WebKit::MediaPlayerPrivateRemote::attemptToDecryptWithInstance): (WebKit::MediaPlayerPrivateRemote::waitingForKey const): (WebKit::MediaPlayerPrivateRemote::requiresTextTrackRepresentation const): (WebKit::MediaPlayerPrivateRemote::setTextTrackRepresentation): (WebKit::MediaPlayerPrivateRemote::syncTextTrackBounds): (WebKit::MediaPlayerPrivateRemote::tracksChanged): (WebKit::MediaPlayerPrivateRemote::simulateAudioInterruption): (WebKit::MediaPlayerPrivateRemote::beginSimulatedHDCPError): (WebKit::MediaPlayerPrivateRemote::endSimulatedHDCPError): (WebKit::MediaPlayerPrivateRemote::languageOfPrimaryAudioTrack const): (WebKit::MediaPlayerPrivateRemote::extraMemoryCost const): (WebKit::MediaPlayerPrivateRemote::fileSize const): (WebKit::MediaPlayerPrivateRemote::ended const): (WebKit::MediaPlayerPrivateRemote::videoPlaybackQualityMetrics): (WebKit::MediaPlayerPrivateRemote::notifyTrackModeChanged): (WebKit::MediaPlayerPrivateRemote::notifyActiveSourceBuffersChanged): (WebKit::MediaPlayerPrivateRemote::setShouldDisableSleep): (WebKit::MediaPlayerPrivateRemote::applicationWillResignActive): (WebKit::MediaPlayerPrivateRemote::applicationDidBecomeActive): (WebKit::MediaPlayerPrivateRemote::performTaskAtMediaTime): (WebKit::MediaPlayerPrivateRemote::shouldIgnoreIntrinsicSize): (WebKit::MediaPlayerPrivateRemote::logChannel const): * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: Added. * WebProcess/GPU/media/MediaPlayerPrivateRemoteIdentifier.h: Added. * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: Added. (WebKit::MediaPlayerRemoteFactory::MediaPlayerRemoteFactory): (WebKit::RemoteMediaPlayerManager::RemoteMediaPlayerManager): (WebKit::RemoteMediaPlayerManager::~RemoteMediaPlayerManager): (WebKit::RemoteMediaPlayerManager::supplementName): (WebKit::RemoteMediaPlayerManager::initialize): (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer): (WebKit::RemoteMediaPlayerManager::getSupportedTypes): (WebKit::RemoteMediaPlayerManager::supportsTypeAndCodecs): (WebKit::RemoteMediaPlayerManager::supportsKeySystem): (WebKit::RemoteMediaPlayerManager::originsInMediaCache): (WebKit::RemoteMediaPlayerManager::clearMediaCache): (WebKit::RemoteMediaPlayerManager::clearMediaCacheForOrigins): (WebKit::RemoteMediaPlayerManager::networkStateChanged): (WebKit::RemoteMediaPlayerManager::updatePreferences): (WebKit::RemoteMediaPlayerManager::gpuProcessConnection const): * WebProcess/GPU/media/RemoteMediaPlayerManager.h: Added. * WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in: Added. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): * WebProcess/WebProcess.cpp: 2019-12-13 Jim Mason [GTK] WebKitGTK build hangs on g-ir-scanner https://bugs.webkit.org/show_bug.cgi?id=204715 This patch fixes the static initialization order problem introduced by Bug 204503. The patch replaces the static data members with statics that are constructed only upon first access (i.e., the 'construct on first use' idiom). Reviewed by Carlos Garcia Campos. * UIProcess/glib/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::messageHandlers): (WebKit::RemoteInspectorClient::RemoteInspectorClient): * UIProcess/glib/RemoteInspectorClient.h: 2019-12-13 Per Arne Vollan [iOS] The AGX compiler service is incorrectly listed as a global name in sandbox https://bugs.webkit.org/show_bug.cgi?id=205189 Reviewed by Brent Fulgham. It should be a XPC service name. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-12-12 Simon Fraser Minor WKWebView.mm code rearrangement https://bugs.webkit.org/show_bug.cgi?id=205129 Reviewed by Tim Horton. Throw in some more #pragma marks and move some functions around, with the goal of having the implementation order mostly follow header order, and grouping related functions. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _pageForTesting]): (-[WKWebView _page]): (-[WKWebView urlSchemeHandlerForURLScheme:]): (+[WKWebView handlesURLScheme:]): (-[WKWebView _resolutionForShareSheetImmediateCompletionForTesting]): (-[WKWebView createPDFWithConfiguration:completionHandler:]): (-[WKWebView createWebArchiveDataWithCompletionHandler:]): (toFindOptions): (-[WKWebView findString:withConfiguration:completionHandler:]): (-[WKWebView setMediaType:]): (-[WKWebView mediaType]): (-[WKWebView layoutSubviews]): (-[WKWebView scrollView]): (-[WKWebView _isShowingVideoPictureInPicture]): (-[WKWebView _mayAutomaticallyShowVideoPictureInPicture]): (-[WKWebView _incrementFocusPreservationCount]): (-[WKWebView _decrementFocusPreservationCount]): (-[WKWebView _resetFocusPreservationCount]): (-[WKWebView _isRetainingActiveFocusedState]): (-[WKWebView _effectiveAppearanceIsDark]): (-[WKWebView _effectiveUserInterfaceLevelIsElevated]): (-[WKWebView _shouldAvoidResizingWhenInputViewBoundsChange]): (-[WKWebView _dragInteractionPolicy]): (-[WKWebView _setDragInteractionPolicy:]): (-[WKWebView _populateArchivedSubviews:]): (-[WKWebView _isBackground]): (-[WKWebView _setShouldSuppressFirstResponderChanges:]): (-[WKWebView _retainActiveFocusedState]): (-[WKWebView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]): (-[WKWebView _snapshotLayerContentsForBackForwardListItem:]): (-[WKWebView _dataDetectionResults]): (-[WKWebView _accessibilityRetrieveSpeakSelectionContent]): (-[WKWebView _accessibilityDidGetSpeakSelectionContent:]): (-[WKWebView _viewportSizeForCSSViewportUnits]): (-[WKWebView _setViewportSizeForCSSViewportUnits:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/SOAuthorization/SOAuthorizationCoordinator.mm: Unified sources build fix (seen while doing other stuff). 2019-12-12 Simon Fraser Move WKWebView code related to testing to new files, with new private "for testing" headers. https://bugs.webkit.org/show_bug.cgi?id=205021 Reviewed by Tim Horton. Move testing-only SPI to new private headers to discourage first parties from using them by mistake. Move test-only code to new files to reduce the size of WKWebView.mm. * SourcesCocoa.txt: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _internalDoAfterNextPresentationUpdate:withoutWaitingForPainting:withoutWaitingForAnimatedResize:]): (-[WKWebView _prepareForImmediateActionAnimation]): (-[WKWebView _cancelImmediateActionAnimation]): (-[WKWebView _completeImmediateActionAnimation]): (-[WKWebView _useSystemAppearance]): (-[WKWebView _setUseSystemAppearance:]): (-[WKWebView _pageRefForTransitionToWKWebView]): (-[WKWebView _canChangeFrameLayout:]): (-[WKWebView _tryToSwipeWithEvent:ignoringPinnedState:]): (-[WKWebView _ignoresNonWheelEvents]): (-[WKWebView _setIgnoresNonWheelEvents:]): (-[WKWebView _hasActiveVideoForControlsManager]): (-[WKWebView _dismissContentRelativeChildWindows]): (-[WKWebView _gestureEventWasNotHandledByWebCore:]): (-[WKWebView _disableFrameSizeUpdates]): (-[WKWebView _enableFrameSizeUpdates]): (-[WKWebView _beginDeferringViewInWindowChanges]): (-[WKWebView _endDeferringViewInWindowChanges]): (-[WKWebView _endDeferringViewInWindowChangesSync]): (-[WKWebView _fullScreenPlaceholderView]): (-[WKWebView _fullScreenWindow]): (-[WKWebView _underlayColor]): (-[WKWebView _setUnderlayColor:]): (-[WKWebView _setCustomSwipeViews:]): (-[WKWebView _setCustomSwipeViewsTopContentInset:]): (-[WKWebView _setDidMoveSwipeSnapshotCallback:]): (-[WKWebView _setFrame:andScrollBy:]): (-[WKWebView _setTotalHeightOfBanners:]): (-[WKWebView _totalHeightOfBanners]): (-[WKWebView _setFont:sender:]): (-[WKWebView _setFontSize:sender:]): (-[WKWebView _setTextColor:sender:]): (-[WKWebView inputAccessoryView]): (-[WKWebView inputView]): (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]): (-[WKWebView _contentVisibleRect]): (-[WKWebView _convertPointFromContentsToView:]): (-[WKWebView _convertPointFromViewToContents:]): (-[WKWebView didStartFormControlInteraction]): (-[WKWebView didEndFormControlInteraction]): (-[WKWebView _uiTextCaretRect]): (-[WKWebView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]): (-[WKWebView _accessibilityStoreSelection]): (-[WKWebView _accessibilityClearSelection]): (-[WKWebView _contentViewIsFirstResponder]): (-[WKWebView _inspector]): (-[WKWebView _mainFrame]): (-[WKWebView _isEditable]): (-[WKWebView _setEditable:]): (-[WKWebView _executeEditCommand:argument:completion:]): (-[WKWebView _textManipulationDelegate]): (-[WKWebView _setTextManipulationDelegate:]): (-[WKWebView _startTextManipulationsWithConfiguration:completion:]): (-[WKWebView _completeTextManipulation:completion:]): (-[WKWebView _takeFindStringFromSelection:]): (+[WKWebView _stringForFind]): (+[WKWebView _setStringForFind:]): (-[WKWebView _remoteObjectRegistry]): (-[WKWebView _handle]): (-[WKWebView _observedRenderingProgressEvents]): (-[WKWebView _historyDelegate]): (-[WKWebView _setHistoryDelegate:]): (-[WKWebView _updateMediaPlaybackControlsManager]): (-[WKWebView _canTogglePictureInPicture]): (-[WKWebView _isPictureInPictureActive]): (-[WKWebView _togglePictureInPicture]): (-[WKWebView _closeAllMediaPresentations]): (-[WKWebView _stopMediaCapture]): (-[WKWebView _stopAllMediaPlayback]): (-[WKWebView _suspendAllMediaPlayback]): (-[WKWebView _resumeAllMediaPlayback]): (-[WKWebView _unreachableURL]): (-[WKWebView _mainFrameURL]): (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]): (-[WKWebView _loadData:MIMEType:characterEncodingName:baseURL:userData:]): (-[WKWebView _loadRequest:shouldOpenExternalURLs:]): (-[WKWebView _certificateChain]): (-[WKWebView _committedURL]): (-[WKWebView _MIMEType]): (-[WKWebView _userAgent]): (-[WKWebView _applicationNameForUserAgent]): (-[WKWebView _setApplicationNameForUserAgent:]): (-[WKWebView _customUserAgent]): (-[WKWebView _setCustomUserAgent:]): (-[WKWebView _setUserContentExtensionsEnabled:]): (-[WKWebView _userContentExtensionsEnabled]): (-[WKWebView _webProcessIdentifier]): (-[WKWebView _provisionalWebProcessIdentifier]): (-[WKWebView _killWebContentProcess]): (-[WKWebView _safeBrowsingWarning]): (-[WKWebView _reloadWithoutContentBlockers]): (-[WKWebView _reloadExpiredOnly]): (-[WKWebView _killWebContentProcessAndResetState]): (-[WKWebView _convertRectFromRootViewCoordinates:]): (-[WKWebView _convertRectToRootViewCoordinates:]): (-[WKWebView _requestTextInputContextsInRect:completionHandler:]): (-[WKWebView _focusTextInputContext:completionHandler:]): (-[WKWebView _takePDFSnapshotWithConfiguration:completionHandler:]): (-[WKWebView _setShouldSuppressFirstResponderChanges:]): (-[WKWebView _retainActiveFocusedState]): (-[WKWebView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]): (-[WKWebView _snapshotLayerContentsForBackForwardListItem:]): (-[WKWebView _dataDetectionResults]): (-[WKWebView _accessibilityRetrieveSpeakSelectionContent]): (-[WKWebView _accessibilityDidGetSpeakSelectionContent:]): (-[WKWebView inputAssistantItem]): (-[WKWebView _sessionStateData]): (-[WKWebView _sessionState]): (-[WKWebView _sessionStateWithFilter:]): (-[WKWebView _restoreFromSessionStateData:]): (-[WKWebView _restoreSessionState:andNavigate:]): (-[WKWebView _close]): (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]): (-[WKWebView _insertAttachmentWithFileWrapper:contentType:options:completion:]): (-[WKWebView _insertAttachmentWithFileWrapper:contentType:completion:]): (-[WKWebView _attachmentForIdentifier:]): (-[WKWebView _simulateDeviceOrientationChangeWithAlpha:beta:gamma:]): (+[WKWebView _handlesSafeBrowsing]): (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]): (-[WKWebView _showSafeBrowsingWarningWithURL:title:warning:details:completionHandler:]): (+[WKWebView _confirmMalwareSentinel]): (+[WKWebView _visitUnsafeWebsiteSentinel]): (-[WKWebView _isJITEnabled:]): (-[WKWebView _evaluateJavaScriptWithoutUserGesture:completionHandler:]): (-[WKWebView _updateWebsitePolicies:]): (-[WKWebView _allowsRemoteInspection]): (-[WKWebView _setAllowsRemoteInspection:]): (-[WKWebView _remoteInspectionNameOverride]): (-[WKWebView _setRemoteInspectionNameOverride:]): (-[WKWebView _addsVisitedLinks]): (-[WKWebView _setAddsVisitedLinks:]): (-[WKWebView _networkRequestsInProgress]): (layoutMilestones): (-[WKWebView _setObservedRenderingProgressEvents:]): (-[WKWebView _getMainResourceDataWithCompletionHandler:]): (-[WKWebView _getWebArchiveDataWithCompletionHandler:]): (-[WKWebView _getContentsAsStringWithCompletionHandler:]): (-[WKWebView _getContentsAsAttributedStringWithCompletionHandler:]): (-[WKWebView _getApplicationManifestWithCompletionHandler:]): (-[WKWebView _paginationMode]): (-[WKWebView _setPaginationMode:]): (-[WKWebView _paginationBehavesLikeColumns]): (-[WKWebView _setPaginationBehavesLikeColumns:]): (-[WKWebView _pageLength]): (-[WKWebView _setPageLength:]): (-[WKWebView _gapBetweenPages]): (-[WKWebView _setGapBetweenPages:]): (-[WKWebView _paginationLineGridEnabled]): (-[WKWebView _setPaginationLineGridEnabled:]): (-[WKWebView _pageCount]): (-[WKWebView _supportsTextZoom]): (-[WKWebView _textZoomFactor]): (-[WKWebView _setTextZoomFactor:]): (-[WKWebView setPageZoom:]): (-[WKWebView pageZoom]): (-[WKWebView _pageZoomFactor]): (-[WKWebView _setPageZoomFactor:]): (-[WKWebView _diagnosticLoggingDelegate]): (-[WKWebView _setDiagnosticLoggingDelegate:]): (-[WKWebView _findDelegate]): (-[WKWebView _setFindDelegate:]): (toFindOptions): (-[WKWebView _countStringMatches:options:maxCount:]): (-[WKWebView _findString:options:maxCount:]): (-[WKWebView _hideFindUI]): (-[WKWebView _saveBackForwardSnapshotForItem:]): (-[WKWebView _inputDelegate]): (-[WKWebView _setInputDelegate:]): (-[WKWebView _isDisplayingStandaloneImageDocument]): (-[WKWebView _isDisplayingStandaloneMediaDocument]): (-[WKWebView _isPlayingAudio]): (-[WKWebView _isShowingNavigationGestureSnapshot]): (-[WKWebView _layoutMode]): (-[WKWebView _setLayoutMode:]): (-[WKWebView _fixedLayoutSize]): (-[WKWebView _setFixedLayoutSize:]): (-[WKWebView _setBackgroundExtendsBeyondPage:]): (-[WKWebView _backgroundExtendsBeyondPage]): (-[WKWebView _viewScale]): (-[WKWebView _setViewScale:]): (-[WKWebView _setMinimumEffectiveDeviceWidth:]): (-[WKWebView _minimumEffectiveDeviceWidth]): (-[WKWebView _setScrollPerformanceDataCollectionEnabled:]): (-[WKWebView _scrollPerformanceDataCollectionEnabled]): (-[WKWebView _scrollPerformanceData]): (-[WKWebView _allowsMediaDocumentInlinePlayback]): (-[WKWebView _setAllowsMediaDocumentInlinePlayback:]): (-[WKWebView _webProcessIsResponsive]): (-[WKWebView _setFullscreenDelegate:]): (-[WKWebView _fullscreenDelegate]): (-[WKWebView _isInFullscreen]): (-[WKWebView _mediaCaptureState]): (-[WKWebView _setMediaCaptureEnabled:]): (-[WKWebView _mediaCaptureEnabled]): (-[WKWebView _setPageMuted:]): (-[WKWebView _removeDataDetectedLinks:]): (-[WKWebView _doAfterNextPresentationUpdate:]): (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForPainting:]): (-[WKWebView _doAfterNextStablePresentationUpdate:]): (-[WKWebView _detectDataWithTypes:completionHandler:]): (-[WKWebView removeFromSuperview]): (-[WKWebView _minimumLayoutSizeOverride]): (-[WKWebView _setViewLayoutSizeOverride:]): (-[WKWebView _obscuredInsets]): (-[WKWebView _setObscuredInsets:]): (-[WKWebView _obscuredInsetEdgesAffectedBySafeArea]): (-[WKWebView _setObscuredInsetEdgesAffectedBySafeArea:]): (-[WKWebView _unobscuredSafeAreaInsets]): (-[WKWebView _setUnobscuredSafeAreaInsets:]): (-[WKWebView _safeAreaShouldAffectObscuredInsets]): (-[WKWebView _setInterfaceOrientationOverride:]): (-[WKWebView _interfaceOrientationOverride]): (-[WKWebView _clearInterfaceOrientationOverride]): (-[WKWebView _maximumUnobscuredSizeOverride]): (-[WKWebView _setMaximumUnobscuredSizeOverride:]): (-[WKWebView _setAllowsViewportShrinkToFit:]): (-[WKWebView _allowsViewportShrinkToFit]): (-[WKWebView _beginInteractiveObscuredInsetsChange]): (-[WKWebView _endInteractiveObscuredInsetsChange]): (-[WKWebView _hideContentUntilNextUpdate]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _endAnimatedResize]): (-[WKWebView _resizeWhileHidingContentWithUpdates:]): (-[WKWebView _setOverlaidAccessoryViewsInset:]): (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]): (-[WKWebView _clearOverrideLayoutParameters]): (viewportArgumentsFromDictionary): (-[WKWebView _overrideViewportWithArguments:]): (-[WKWebView _viewForFindUI]): (-[WKWebView _isDisplayingPDF]): (-[WKWebView _dataForDisplayedPDF]): (-[WKWebView _suggestedFilenameForDisplayedPDF]): (-[WKWebView _webViewPrintFormatter]): (toUserInterfaceLayoutDirection): (-[WKWebView setSemanticContentAttribute:]): (-[WKWebView _drawsBackground]): (-[WKWebView _setDrawsBackground:]): (-[WKWebView _backgroundColor]): (-[WKWebView _setBackgroundColor:]): (-[WKWebView _setDrawsTransparentBackground:]): (-[WKWebView _inspectorAttachmentView]): (-[WKWebView _setInspectorAttachmentView:]): (-[WKWebView _setOverlayScrollbarStyle:]): (-[WKWebView _overlayScrollbarStyle]): (-[WKWebView _windowOcclusionDetectionEnabled]): (-[WKWebView _setWindowOcclusionDetectionEnabled:]): (-[WKWebView shareSheetDidDismiss:]): (-[WKWebView _setOverrideDeviceScaleFactor:]): (-[WKWebView _overrideDeviceScaleFactor]): (-[WKWebView _setTopContentInset:]): (-[WKWebView _topContentInset]): (-[WKWebView _pageExtendedBackgroundColor]): (-[WKWebView _pinnedState]): (-[WKWebView _rubberBandingEnabled]): (-[WKWebView _setRubberBandingEnabled:]): (-[WKWebView _immediateActionAnimationControllerForHitTestResult:withType:userData:]): (-[WKWebView _setAutomaticallyAdjustsContentInsets:]): (-[WKWebView _automaticallyAdjustsContentInsets]): (-[WKWebView _minimumLayoutWidth]): (-[WKWebView _setMinimumLayoutWidth:]): (-[WKWebView _shouldExpandContentToViewHeightForAutoLayout]): (-[WKWebView _setShouldExpandContentToViewHeightForAutoLayout:]): (-[WKWebView _alwaysShowsHorizontalScroller]): (-[WKWebView _setAlwaysShowsHorizontalScroller:]): (-[WKWebView _alwaysShowsVerticalScroller]): (-[WKWebView _setAlwaysShowsVerticalScroller:]): (-[WKWebView _printOperationWithPrintInfo:]): (-[WKWebView _printOperationWithPrintInfo:forFrame:]): (-[WKWebView setUserInterfaceLayoutDirection:]): (-[WKWebView _wantsMediaPlaybackControlsView]): (-[WKWebView _setWantsMediaPlaybackControlsView:]): (-[WKWebView _mediaPlaybackControlsView]): (-[WKWebView _addMediaPlaybackControlsView:]): (-[WKWebView _removeMediaPlaybackControlsView]): (-[WKWebView _prepareForMoveToWindow:completionHandler:]): (-[WKWebView _setThumbnailView:]): (-[WKWebView _thumbnailView]): (-[WKWebView _setIgnoresAllEvents:]): (-[WKWebView _ignoresAllEvents]): (-[WKWebView _spellCheckerDocumentTag]): (-[WKWebView _setContinuousSpellCheckingEnabledForTesting:]): Deleted. (-[WKWebView _contentsOfUserInterfaceItem:]): Deleted. (-[WKWebView _setDeviceOrientationUserPermissionHandlerForTesting:]): Deleted. (-[WKWebView keyboardAccessoryBarNext]): Deleted. (-[WKWebView keyboardAccessoryBarPrevious]): Deleted. (-[WKWebView applyAutocorrection:toString:withCompletionHandler:]): Deleted. (-[WKWebView dismissFormAccessoryView]): Deleted. (-[WKWebView _dismissFilePicker]): Deleted. (-[WKWebView setTimePickerValueToHour:minute:]): Deleted. (-[WKWebView selectFormAccessoryPickerRow:]): Deleted. (-[WKWebView selectFormPopoverTitle]): Deleted. (-[WKWebView textContentTypeForTesting]): Deleted. (-[WKWebView formInputLabel]): Deleted. (-[WKWebView _didShowContextMenu]): Deleted. (-[WKWebView _didDismissContextMenu]): Deleted. (-[WKWebView _inputViewBounds]): Deleted. (-[WKWebView _uiTextSelectionRects]): Deleted. (-[WKWebView _scrollingTreeAsText]): Deleted. (-[WKWebView _stableStateOverride]): Deleted. (-[WKWebView _propertiesOfLayerWithID:]): Deleted. (-[WKWebView _doAfterResettingSingleTapGesture:]): Deleted. (-[WKWebView _doAfterReceivingEditDragSnapshotForTesting:]): Deleted. (-[WKWebView _requestControlledElementID]): Deleted. (-[WKWebView _handleControlledElementIDResponse:]): Deleted. (-[WKWebView _handleAcceptedCandidate:]): Deleted. (-[WKWebView _didHandleAcceptedCandidate]): Deleted. (-[WKWebView _didUpdateCandidateListVisibility:]): Deleted. (-[WKWebView _forceRequestCandidates]): Deleted. (-[WKWebView _shouldRequestCandidates]): Deleted. (-[WKWebView _insertText:replacementRange:]): Deleted. (-[WKWebView _candidateRect]): Deleted. (-[WKWebView viewDidChangeEffectiveAppearance]): Deleted. (-[WKWebView _setHeaderBannerHeight:]): Deleted. (-[WKWebView _setFooterBannerHeight:]): Deleted. (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]): Deleted. (-[WKWebView _activeMenu]): Deleted. (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Deleted. (-[WKWebView _setPageScale:withOrigin:]): Deleted. (-[WKWebView _pageScale]): Deleted. (-[WKWebView _scrollingUpdatesDisabledForTesting]): Deleted. (-[WKWebView _setScrollingUpdatesDisabledForTesting:]): Deleted. (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForAnimatedResizeForTesting:]): Deleted. (-[WKWebView _doAfterNextVisibleContentRectUpdate:]): Deleted. (-[WKWebView _disableBackForwardSnapshotVolatilityForTesting]): Deleted. (-[WKWebView _dragCaretRect]): Deleted. (-[WKWebView _simulateLongPressActionAtLocation:]): Deleted. (-[WKWebView _simulateTextEntered:]): Deleted. (-[WKWebView _dynamicUserInterfaceTraitDidChange]): Deleted. (-[WKWebView _beginBackSwipeForTesting]): Deleted. (-[WKWebView _completeBackSwipeForTesting]): Deleted. (-[WKWebView _setDefersLoadingForTesting:]): Deleted. (-[WKWebView _setShareSheetCompletesImmediatelyWithResolutionForTesting:]): Deleted. (-[WKWebView _hasInspectorFrontend]): Deleted. (-[WKWebView _processWillSuspendImminentlyForTesting]): Deleted. (-[WKWebView _processDidResumeForTesting]): Deleted. (-[WKWebView _setAssertionStateForTesting:]): Deleted. (-[WKWebView _hasServiceWorkerBackgroundActivityForTesting]): Deleted. (-[WKWebView _hasServiceWorkerForegroundActivityForTesting]): Deleted. (-[WKWebView _denyNextUserMediaRequest]): Deleted. (-[WKWebView _triggerSystemPreviewActionOnElement:document:page:]): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h: Added. * UIProcess/API/Cocoa/WKWebViewTesting.mm: Added. (-[WKWebView _setPageScale:withOrigin:]): (-[WKWebView _pageScale]): (-[WKWebView _setContinuousSpellCheckingEnabledForTesting:]): (-[WKWebView _contentsOfUserInterfaceItem:]): (-[WKWebView _requestActiveNowPlayingSessionInfo:]): (-[WKWebView _scrollingUpdatesDisabledForTesting]): (-[WKWebView _setScrollingUpdatesDisabledForTesting:]): (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForAnimatedResizeForTesting:]): (-[WKWebView _doAfterNextVisibleContentRectUpdate:]): (-[WKWebView _disableBackForwardSnapshotVolatilityForTesting]): (-[WKWebView _beginBackSwipeForTesting]): (-[WKWebView _completeBackSwipeForTesting]): (-[WKWebView _setDefersLoadingForTesting:]): (-[WKWebView _setShareSheetCompletesImmediatelyWithResolutionForTesting:]): (-[WKWebView _hasInspectorFrontend]): (-[WKWebView _processWillSuspendImminentlyForTesting]): (-[WKWebView _processDidResumeForTesting]): (-[WKWebView _setAssertionStateForTesting:]): (-[WKWebView _hasServiceWorkerBackgroundActivityForTesting]): (-[WKWebView _hasServiceWorkerForegroundActivityForTesting]): (-[WKWebView _denyNextUserMediaRequest]): * UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h: Added. * UIProcess/API/ios/WKWebViewTestingIOS.mm: Added. (-[WKWebView keyboardAccessoryBarNext]): (-[WKWebView keyboardAccessoryBarPrevious]): (-[WKWebView applyAutocorrection:toString:withCompletionHandler:]): (-[WKWebView dismissFormAccessoryView]): (-[WKWebView _dismissFilePicker]): (-[WKWebView setTimePickerValueToHour:minute:]): (-[WKWebView selectFormAccessoryPickerRow:]): (-[WKWebView selectFormPopoverTitle]): (-[WKWebView textContentTypeForTesting]): (-[WKWebView formInputLabel]): (-[WKWebView _didShowContextMenu]): (-[WKWebView _didDismissContextMenu]): (-[WKWebView _inputViewBounds]): (-[WKWebView _uiTextSelectionRects]): (-[WKWebView _scrollingTreeAsText]): (-[WKWebView _stableStateOverride]): (-[WKWebView _propertiesOfLayerWithID:]): (-[WKWebView _doAfterResettingSingleTapGesture:]): (-[WKWebView _doAfterReceivingEditDragSnapshotForTesting:]): (-[WKWebView _dragCaretRect]): (-[WKWebView _simulateLongPressActionAtLocation:]): (-[WKWebView _simulateTextEntered:]): (-[WKWebView _dynamicUserInterfaceTraitDidChange]): (-[WKWebView _triggerSystemPreviewActionOnElement:document:page:]): (-[WKWebView _setDeviceOrientationUserPermissionHandlerForTesting:]): * UIProcess/API/mac/WKWebViewPrivateForTestingMac.h: Copied from Tools/TestWebKitAPI/Tests/WebKitCocoa/InteractionDeadlockAfterCrash.mm. * UIProcess/API/mac/WKWebViewTestingMac.mm: Added. (-[WKWebView _requestControlledElementID]): (-[WKWebView _handleControlledElementIDResponse:]): (-[WKWebView _handleAcceptedCandidate:]): (-[WKWebView _didHandleAcceptedCandidate]): (-[WKWebView _didUpdateCandidateListVisibility:]): (-[WKWebView _forceRequestCandidates]): (-[WKWebView _shouldRequestCandidates]): (-[WKWebView _insertText:replacementRange:]): (-[WKWebView _candidateRect]): (-[WKWebView viewDidChangeEffectiveAppearance]): (-[WKWebView _setHeaderBannerHeight:]): (-[WKWebView _setFooterBannerHeight:]): (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]): (-[WKWebView _activeMenu]): * UIProcess/Cocoa/PageClientImplCocoa.mm: * UIProcess/ios/PageClientImplIOS.mm: * UIProcess/ios/WKContentViewInteraction.mm: * UIProcess/ios/WKMouseGestureRecognizer.h: * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: * UIProcess/mac/PageClientImplMac.mm: * UIProcess/mac/WKFullScreenWindowController.h: * WebKit.xcodeproj/project.pbxproj: 2019-12-12 Per Arne Vollan [iOS] Add sandbox telemetry to mach lookup rules in the WebContent process https://bugs.webkit.org/show_bug.cgi?id=205175 Reviewed by Brent Fulgham. We have already added telemetry to many mach lookup rules, but some were missing telemetry. No new tests, no behavior change. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-12-12 Sihui Liu IndexedDB: make WebIDBServer a MessageReceiver to replace WebIDBConnection https://bugs.webkit.org/show_bug.cgi?id=205145 Reviewed by Alex Christensen. Work towards . Move message handling from WebIDBConnectionToClient to WebIDBServer. Also, WebIDBConnectionClient now is owned by WebIDBServer instead of NetworkConnectionToWebProcess. No behavior change. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient): (WebKit::WebIDBConnectionToClient::messageSenderConnection const): (WebKit::WebIDBConnectionToClient::idbServer): Deleted. (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess): Deleted. (WebKit::WebIDBConnectionToClient::deleteDatabase): Deleted. (WebKit::WebIDBConnectionToClient::openDatabase): Deleted. (WebKit::WebIDBConnectionToClient::abortTransaction): Deleted. (WebKit::WebIDBConnectionToClient::commitTransaction): Deleted. (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction): Deleted. (WebKit::WebIDBConnectionToClient::createObjectStore): Deleted. (WebKit::WebIDBConnectionToClient::deleteObjectStore): Deleted. (WebKit::WebIDBConnectionToClient::renameObjectStore): Deleted. (WebKit::WebIDBConnectionToClient::clearObjectStore): Deleted. (WebKit::WebIDBConnectionToClient::createIndex): Deleted. (WebKit::WebIDBConnectionToClient::deleteIndex): Deleted. (WebKit::WebIDBConnectionToClient::renameIndex): Deleted. (WebKit::WebIDBConnectionToClient::putOrAdd): Deleted. (WebKit::WebIDBConnectionToClient::getRecord): Deleted. (WebKit::WebIDBConnectionToClient::getAllRecords): Deleted. (WebKit::WebIDBConnectionToClient::getCount): Deleted. (WebKit::WebIDBConnectionToClient::deleteRecord): Deleted. (WebKit::WebIDBConnectionToClient::openCursor): Deleted. (WebKit::WebIDBConnectionToClient::iterateCursor): Deleted. (WebKit::WebIDBConnectionToClient::establishTransaction): Deleted. (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose): Deleted. (WebKit::WebIDBConnectionToClient::databaseConnectionClosed): Deleted. (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded): Deleted. (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent): Deleted. (WebKit::WebIDBConnectionToClient::openDBRequestCancelled): Deleted. (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer): Deleted. (WebKit::WebIDBConnectionToClient::getAllDatabaseNames): Deleted. * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h: * NetworkProcess/IndexedDB/WebIDBServer.cpp: (WebKit::WebIDBServer::getAllDatabaseNames): (WebKit::WebIDBServer::addConnection): (WebKit::WebIDBServer::removeConnection): * NetworkProcess/IndexedDB/WebIDBServer.h: * NetworkProcess/IndexedDB/WebIDBServer.messages.in: Renamed from Source/WebKit/NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didReceiveMessage): (WebKit::NetworkConnectionToWebProcess::didClose): (WebKit::NetworkConnectionToWebProcess::findNetworkActivityTracker): (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer): Deleted. NetworkConnectionToWebProcess::establishIDBConnectionToServer was used to ensure WebIDBConnectionToCilent member exists in NetworkConnectionToWebProcess. Now WebIDBConnectionToCilent is created in WebIDBServer::addConnection(when NetworkConnectionToWebProcess is created), so we don't need the message to do initialization. * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::createNetworkConnectionToWebProcess): (WebKit::NetworkProcess::connectionToWebProcessClosed): * NetworkProcess/NetworkProcess.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer): (WebKit::WebIDBConnectionToServer::deleteDatabase): (WebKit::WebIDBConnectionToServer::openDatabase): (WebKit::WebIDBConnectionToServer::abortTransaction): (WebKit::WebIDBConnectionToServer::commitTransaction): (WebKit::WebIDBConnectionToServer::didFinishHandlingVersionChangeTransaction): (WebKit::WebIDBConnectionToServer::createObjectStore): (WebKit::WebIDBConnectionToServer::deleteObjectStore): (WebKit::WebIDBConnectionToServer::renameObjectStore): (WebKit::WebIDBConnectionToServer::clearObjectStore): (WebKit::WebIDBConnectionToServer::createIndex): (WebKit::WebIDBConnectionToServer::deleteIndex): (WebKit::WebIDBConnectionToServer::renameIndex): (WebKit::WebIDBConnectionToServer::putOrAdd): (WebKit::WebIDBConnectionToServer::getRecord): (WebKit::WebIDBConnectionToServer::getAllRecords): (WebKit::WebIDBConnectionToServer::getCount): (WebKit::WebIDBConnectionToServer::deleteRecord): (WebKit::WebIDBConnectionToServer::openCursor): (WebKit::WebIDBConnectionToServer::iterateCursor): (WebKit::WebIDBConnectionToServer::establishTransaction): (WebKit::WebIDBConnectionToServer::databaseConnectionPendingClose): (WebKit::WebIDBConnectionToServer::databaseConnectionClosed): (WebKit::WebIDBConnectionToServer::abortOpenAndUpgradeNeeded): (WebKit::WebIDBConnectionToServer::didFireVersionChangeEvent): (WebKit::WebIDBConnectionToServer::openDBRequestCancelled): (WebKit::WebIDBConnectionToServer::confirmDidCloseFromServer): (WebKit::WebIDBConnectionToServer::getAllDatabaseNames): 2019-12-12 Chris Dumez Regression(r253394) swipe/basic-cached-back-swipe.html is timing out on iOS https://bugs.webkit.org/show_bug.cgi?id=205173 Reviewed by Tim Horton. Test test was calling beginSimulatedSwipeInDirectionForTesting / completeSimulatedSwipeInDirectionForTesting on the ViewGestureController. This was causing beginSwipeGesture() and endSwipeGesture() but not willEndSwipeGesture(). This was causing the timeout since willEndSwipeGesture() now actually triggers the load. This patch also gets rid of the SnapshotRemovalTracker::SwipeAnimationEnd. We don't really need it since we already wait for SnapshotRemovalTracker::RepaintAfterNavigation and we won't repaint until the swipe animation is over (due to the layer tree being frozen during the swipe animation). The SwipeAnimationEnd was causing trouble because the provisional load may not have started yet by the time endSwipeGesture() is called, which means that the call to eventOccurred(SwipeAnimationEnd) would get ignored because the SnapshotRemovalTracker is still paused (it gets unpaused when the provisional load actually starts). * UIProcess/ViewGestureController.h: * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::willEndSwipeGesture): (WebKit::ViewGestureController::endSwipeGesture): 2019-12-12 Alex Christensen NetworkDataTaskCocoa and NetworkSessionCocoa should use public methods instead of being friends https://bugs.webkit.org/show_bug.cgi?id=204242 Reviewed by Chris Dumez. This makes them stay good abstractions, and probably could make a good meme about not having any friends. * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded): * NetworkProcess/cocoa/NetworkSessionCocoa.h: 2019-12-12 Per Arne Vollan [iOS] Deny mach lookup access to content filter service in the WebContent sandbox https://bugs.webkit.org/show_bug.cgi?id=205077 Reviewed by Brent Fulgham. Mach lookup access to the content filter service in the WebContent process is only needed if [WebFilterEvaluator isManagedSession] evaluates to true. If this is the case, issue the needed mach lookup sandbox extension to the WebContent process, where it will be consumed. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2019-12-12 Carlos Garcia Campos WebDriver: tests is_element_enabled/enabled.py::test_fieldset_disabled_descendant are failing https://bugs.webkit.org/show_bug.cgi?id=204700 Reviewed by Carlos Alberto Lopez Perez. Add ElementEnabled atom to easily implement is element enabled command. * UIProcess/Automation/atoms/ElementEnabled.js: Added. (isEnabled.isDisabledAttributeSupported): (isEnabled.findParent): (isEnabled): 2019-12-11 Jiewen Tan Unreviewed, a nit after r253366 * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h: Change the parameter type of the completion handler from NSData to NSString. 2019-12-11 Daniel Bates Remove unused Frame parameter from moveByGranularityRespectingWordBoundary() and take const VisiblePosition& https://bugs.webkit.org/show_bug.cgi?id=205137 Reviewed by Wenson Hsieh. moveByGranularityRespectingWordBoundary() never makes use of the passed Frame and does not mutate the passed VisiblePosition. So, do not accept the former and take the latter as a const lvalue reference. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::moveByGranularityRespectingWordBoundary): (WebKit::WebPage::requestDocumentEditingContext): 2019-12-11 Daniel Bates UIWKDocumentContext returns 0 character rects when caret is at beginning or end of text https://bugs.webkit.org/show_bug.cgi?id=205135 Reviewed by Wenson Hsieh. When the specified position to move from is at the beginning or end of the text then return the position of the beginning or end of the nearest word based on the specified direction. Currently we always return the null position. As a result we do not compute a valid character range to convert to rectangles. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::moveByGranularityRespectingWordBoundary): 2019-12-11 Jiewen Tan [WebAuthn] Combine AuthenticatorResponse and PublicKeyCredentialData https://bugs.webkit.org/show_bug.cgi?id=190783 Reviewed by Brent Fulgham. Code in WebKit are changed to use AuthenticatorResponse and its subtypes. * UIProcess/WebAuthentication/Authenticator.h: * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManager::respondReceived): (WebKit::AuthenticatorManager::invokePendingCompletionHandler): * UIProcess/WebAuthentication/AuthenticatorManager.h: * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: (WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested): (WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented): * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp: (WebKit::WebAuthenticatorCoordinatorProxy::handleRequest): * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h: * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in: * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp: (WebKit::CtapAuthenticator::continueMakeCredentialAfterResponseReceived const): (WebKit::CtapAuthenticator::continueGetAssertionAfterResponseReceived): * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp: (WebKit::U2fAuthenticator::continueRegisterCommandAfterResponseReceived): (WebKit::U2fAuthenticator::continueSignCommandAfterResponseReceived): * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp: 2019-12-11 Truitt Savell Unreviewed, rolling out r253376. Broke internal builds Reverted changeset: "Move WKWebView code related to testing to new files, with their own headers, and stop exposing test-only functions as SPI." https://bugs.webkit.org/show_bug.cgi?id=205021 https://trac.webkit.org/changeset/253376 2019-12-11 Chris Dumez There should be no user-noticeable delay when closing a tab https://bugs.webkit.org/show_bug.cgi?id=205069 Reviewed by Ryosuke Niwa. There should be no user-noticeable delay when closing a tab. To achieve this, use a timeout of 50ms for doing the IPC handshake with the WebContent process, instead of 500ms. * UIProcess/WebPageProxy.cpp: 2019-12-11 Chris Dumez [iOS] Issue load sooner on swipe back/forward navigation https://bugs.webkit.org/show_bug.cgi?id=205127 Reviewed by Tim Horton. Issue load sooner on swipe back/forward navigation on iOS. We were waiting until the end of the swipe animation to issue the load. We now issue the load as soon as the user lifts the finger off the screen and thus commits to navigating. This results in improved perceived performance when swiping back/forward to navigate. * UIProcess/ViewGestureController.cpp: (WebKit::ViewGestureController::didStartProvisionalOrSameDocumentLoadForMainFrame): (WebKit::ViewGestureController::willEndSwipeGesture): * UIProcess/ViewGestureController.h: * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::willEndSwipeGesture): (WebKit::ViewGestureController::endSwipeGesture): 2019-12-11 Sihui Liu IndexedDB: Introduce WebIDBServer class https://bugs.webkit.org/show_bug.cgi?id=205095 Reviewed by Alex Christensen. Work towards . WebIDBServer currently is just a wrapper of WebCore::IDBServer. * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::idbServer): * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h: * NetworkProcess/IndexedDB/WebIDBServer.cpp: Added. (WebKit::WebIDBServer::create): (WebKit::WebIDBServer::WebIDBServer): (WebKit::WebIDBServer::registerConnection): (WebKit::WebIDBServer::unregisterConnection): (WebKit::WebIDBServer::closeAndDeleteDatabasesModifiedSince): (WebKit::WebIDBServer::closeAndDeleteDatabasesForOrigins): (WebKit::WebIDBServer::suspend): (WebKit::WebIDBServer::resume): (WebKit::WebIDBServer::openDatabase): (WebKit::WebIDBServer::deleteDatabase): (WebKit::WebIDBServer::abortTransaction): (WebKit::WebIDBServer::commitTransaction): (WebKit::WebIDBServer::didFinishHandlingVersionChangeTransaction): (WebKit::WebIDBServer::createObjectStore): (WebKit::WebIDBServer::deleteObjectStore): (WebKit::WebIDBServer::renameObjectStore): (WebKit::WebIDBServer::clearObjectStore): (WebKit::WebIDBServer::createIndex): (WebKit::WebIDBServer::deleteIndex): (WebKit::WebIDBServer::renameIndex): (WebKit::WebIDBServer::putOrAdd): (WebKit::WebIDBServer::getRecord): (WebKit::WebIDBServer::getAllRecords): (WebKit::WebIDBServer::getCount): (WebKit::WebIDBServer::deleteRecord): (WebKit::WebIDBServer::openCursor): (WebKit::WebIDBServer::iterateCursor): (WebKit::WebIDBServer::establishTransaction): (WebKit::WebIDBServer::databaseConnectionPendingClose): (WebKit::WebIDBServer::databaseConnectionClosed): (WebKit::WebIDBServer::abortOpenAndUpgradeNeeded): (WebKit::WebIDBServer::didFireVersionChangeEvent): (WebKit::WebIDBServer::openDBRequestCancelled): (WebKit::WebIDBServer::getAllDatabaseNames): (WebKit::WebIDBServer::confirmDidCloseFromServer): * NetworkProcess/IndexedDB/WebIDBServer.h: Added. * NetworkProcess/NetworkProcess.cpp: replace WebCore::IDBServer with WebIDBServer. (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains): (WebKit::NetworkProcess::prepareToSuspend): (WebKit::NetworkProcess::resume): (WebKit::NetworkProcess::createWebIDBServer): (WebKit::NetworkProcess::webIDBServer): (WebKit::NetworkProcess::createIDBServer): Deleted. (WebKit::NetworkProcess::idbServer): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::requestSpace): * Sources.txt: * WebKit.xcodeproj/project.pbxproj: 2019-12-11 Don Olmstead [CMake] Add HarfBuzz targets https://bugs.webkit.org/show_bug.cgi?id=205042 Reviewed by Konstantin Tokarev. Use the HarfBuzz targets directly instead of HARFBUZZ_LIBRARIES and HARFBUZZ_INCLUDE_DIRS. * PlatformGTK.cmake: * PlatformWPE.cmake: 2019-12-11 Jiewen Tan Unreviewed, a nit after r253366 * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h: Improve the naming of the new SPI a bit. 2019-12-11 Wenson Hsieh Make incremental builds faster after modifying DisplayListItems.h https://bugs.webkit.org/show_bug.cgi?id=205032 Reviewed by Tim Horton. Include DisplayListItems.h directly, since these need to know about the actual display list items (and how to encode or decode them). * GPUProcess/GPUConnectionToWebProcess.h: 2019-12-10 Simon Fraser Move WKWebView code related to testing to new files, with their own headers, and stop exposing test-only functions as SPI. https://bugs.webkit.org/show_bug.cgi?id=205021 Reviewed by Tim Horton. Stop exposing WKWebView (WKTesting) as SPI, because everyone added SPI here by mistake, and internal clients kept using testing SPI. Instead, move testing-only functions to internal headers that are not present in the built framework, and move to WKWebView (WKPrivate) properties and functions that webkit clients rely on. Add WKWebViewTesting/WKWebViewTestingMac/WKWebViewTestingIOS for test-only code. WKWebViewTesting* headers are copied to a "WebKitTestSupport" directory in the Products directory, and WTR/DRT and TestWebKitAPI get header search paths to find the headers there. * SourcesCocoa.txt: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _internalDoAfterNextPresentationUpdate:withoutWaitingForPainting:withoutWaitingForAnimatedResize:]): (-[WKWebView _prepareForImmediateActionAnimation]): (-[WKWebView _cancelImmediateActionAnimation]): (-[WKWebView _completeImmediateActionAnimation]): (-[WKWebView _useSystemAppearance]): (-[WKWebView _setUseSystemAppearance:]): (-[WKWebView _pageRefForTransitionToWKWebView]): (-[WKWebView _canChangeFrameLayout:]): (-[WKWebView _tryToSwipeWithEvent:ignoringPinnedState:]): (-[WKWebView _ignoresNonWheelEvents]): (-[WKWebView _setIgnoresNonWheelEvents:]): (-[WKWebView _hasActiveVideoForControlsManager]): (-[WKWebView _dismissContentRelativeChildWindows]): (-[WKWebView _gestureEventWasNotHandledByWebCore:]): (-[WKWebView _disableFrameSizeUpdates]): (-[WKWebView _enableFrameSizeUpdates]): (-[WKWebView _beginDeferringViewInWindowChanges]): (-[WKWebView _endDeferringViewInWindowChanges]): (-[WKWebView _endDeferringViewInWindowChangesSync]): (-[WKWebView _fullScreenPlaceholderView]): (-[WKWebView _fullScreenWindow]): (-[WKWebView _underlayColor]): (-[WKWebView _setUnderlayColor:]): (-[WKWebView _setCustomSwipeViews:]): (-[WKWebView _setCustomSwipeViewsTopContentInset:]): (-[WKWebView _setDidMoveSwipeSnapshotCallback:]): (-[WKWebView _setFrame:andScrollBy:]): (-[WKWebView _setTotalHeightOfBanners:]): (-[WKWebView _totalHeightOfBanners]): (-[WKWebView _setFont:sender:]): (-[WKWebView _setFontSize:sender:]): (-[WKWebView _setTextColor:sender:]): (-[WKWebView inputAccessoryView]): (-[WKWebView inputView]): (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]): (-[WKWebView _contentVisibleRect]): (-[WKWebView _convertPointFromContentsToView:]): (-[WKWebView _convertPointFromViewToContents:]): (-[WKWebView didStartFormControlInteraction]): (-[WKWebView didEndFormControlInteraction]): (-[WKWebView _uiTextCaretRect]): (-[WKWebView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]): (-[WKWebView _accessibilityStoreSelection]): (-[WKWebView _accessibilityClearSelection]): (-[WKWebView _contentViewIsFirstResponder]): (-[WKWebView _inspector]): (-[WKWebView _mainFrame]): (-[WKWebView _isEditable]): (-[WKWebView _setEditable:]): (-[WKWebView _executeEditCommand:argument:completion:]): (-[WKWebView _textManipulationDelegate]): (-[WKWebView _setTextManipulationDelegate:]): (-[WKWebView _startTextManipulationsWithConfiguration:completion:]): (-[WKWebView _completeTextManipulation:completion:]): (-[WKWebView _takeFindStringFromSelection:]): (+[WKWebView _stringForFind]): (+[WKWebView _setStringForFind:]): (-[WKWebView _remoteObjectRegistry]): (-[WKWebView _handle]): (-[WKWebView _observedRenderingProgressEvents]): (-[WKWebView _historyDelegate]): (-[WKWebView _setHistoryDelegate:]): (-[WKWebView _updateMediaPlaybackControlsManager]): (-[WKWebView _canTogglePictureInPicture]): (-[WKWebView _isPictureInPictureActive]): (-[WKWebView _togglePictureInPicture]): (-[WKWebView _closeAllMediaPresentations]): (-[WKWebView _stopMediaCapture]): (-[WKWebView _stopAllMediaPlayback]): (-[WKWebView _suspendAllMediaPlayback]): (-[WKWebView _resumeAllMediaPlayback]): (-[WKWebView _unreachableURL]): (-[WKWebView _mainFrameURL]): (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]): (-[WKWebView _loadData:MIMEType:characterEncodingName:baseURL:userData:]): (-[WKWebView _loadRequest:shouldOpenExternalURLs:]): (-[WKWebView _certificateChain]): (-[WKWebView _committedURL]): (-[WKWebView _MIMEType]): (-[WKWebView _userAgent]): (-[WKWebView _applicationNameForUserAgent]): (-[WKWebView _setApplicationNameForUserAgent:]): (-[WKWebView _customUserAgent]): (-[WKWebView _setCustomUserAgent:]): (-[WKWebView _setUserContentExtensionsEnabled:]): (-[WKWebView _userContentExtensionsEnabled]): (-[WKWebView _webProcessIdentifier]): (-[WKWebView _provisionalWebProcessIdentifier]): (-[WKWebView _killWebContentProcess]): (-[WKWebView _safeBrowsingWarning]): (-[WKWebView _reloadWithoutContentBlockers]): (-[WKWebView _reloadExpiredOnly]): (-[WKWebView _killWebContentProcessAndResetState]): (-[WKWebView _convertRectFromRootViewCoordinates:]): (-[WKWebView _convertRectToRootViewCoordinates:]): (-[WKWebView _requestTextInputContextsInRect:completionHandler:]): (-[WKWebView _focusTextInputContext:completionHandler:]): (-[WKWebView _takePDFSnapshotWithConfiguration:completionHandler:]): (-[WKWebView _setShouldSuppressFirstResponderChanges:]): (-[WKWebView _retainActiveFocusedState]): (-[WKWebView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]): (-[WKWebView _snapshotLayerContentsForBackForwardListItem:]): (-[WKWebView _dataDetectionResults]): (-[WKWebView _accessibilityRetrieveSpeakSelectionContent]): (-[WKWebView _accessibilityDidGetSpeakSelectionContent:]): (-[WKWebView inputAssistantItem]): (-[WKWebView _sessionStateData]): (-[WKWebView _sessionState]): (-[WKWebView _sessionStateWithFilter:]): (-[WKWebView _restoreFromSessionStateData:]): (-[WKWebView _restoreSessionState:andNavigate:]): (-[WKWebView _close]): (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]): (-[WKWebView _insertAttachmentWithFileWrapper:contentType:options:completion:]): (-[WKWebView _insertAttachmentWithFileWrapper:contentType:completion:]): (-[WKWebView _attachmentForIdentifier:]): (-[WKWebView _simulateDeviceOrientationChangeWithAlpha:beta:gamma:]): (+[WKWebView _handlesSafeBrowsing]): (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]): (-[WKWebView _showSafeBrowsingWarningWithURL:title:warning:details:completionHandler:]): (+[WKWebView _confirmMalwareSentinel]): (+[WKWebView _visitUnsafeWebsiteSentinel]): (-[WKWebView _isJITEnabled:]): (-[WKWebView _evaluateJavaScriptWithoutUserGesture:completionHandler:]): (-[WKWebView _updateWebsitePolicies:]): (-[WKWebView _allowsRemoteInspection]): (-[WKWebView _setAllowsRemoteInspection:]): (-[WKWebView _remoteInspectionNameOverride]): (-[WKWebView _setRemoteInspectionNameOverride:]): (-[WKWebView _addsVisitedLinks]): (-[WKWebView _setAddsVisitedLinks:]): (-[WKWebView _networkRequestsInProgress]): (layoutMilestones): (-[WKWebView _setObservedRenderingProgressEvents:]): (-[WKWebView _getMainResourceDataWithCompletionHandler:]): (-[WKWebView _getWebArchiveDataWithCompletionHandler:]): (-[WKWebView _getContentsAsStringWithCompletionHandler:]): (-[WKWebView _getContentsAsAttributedStringWithCompletionHandler:]): (-[WKWebView _getApplicationManifestWithCompletionHandler:]): (-[WKWebView _paginationMode]): (-[WKWebView _setPaginationMode:]): (-[WKWebView _paginationBehavesLikeColumns]): (-[WKWebView _setPaginationBehavesLikeColumns:]): (-[WKWebView _pageLength]): (-[WKWebView _setPageLength:]): (-[WKWebView _gapBetweenPages]): (-[WKWebView _setGapBetweenPages:]): (-[WKWebView _paginationLineGridEnabled]): (-[WKWebView _setPaginationLineGridEnabled:]): (-[WKWebView _pageCount]): (-[WKWebView _supportsTextZoom]): (-[WKWebView _textZoomFactor]): (-[WKWebView _setTextZoomFactor:]): (-[WKWebView setPageZoom:]): (-[WKWebView pageZoom]): (-[WKWebView _pageZoomFactor]): (-[WKWebView _setPageZoomFactor:]): (-[WKWebView _diagnosticLoggingDelegate]): (-[WKWebView _setDiagnosticLoggingDelegate:]): (-[WKWebView _findDelegate]): (-[WKWebView _setFindDelegate:]): (toFindOptions): (-[WKWebView _countStringMatches:options:maxCount:]): (-[WKWebView _findString:options:maxCount:]): (-[WKWebView _hideFindUI]): (-[WKWebView _saveBackForwardSnapshotForItem:]): (-[WKWebView _inputDelegate]): (-[WKWebView _setInputDelegate:]): (-[WKWebView _isDisplayingStandaloneImageDocument]): (-[WKWebView _isDisplayingStandaloneMediaDocument]): (-[WKWebView _isPlayingAudio]): (-[WKWebView _isShowingNavigationGestureSnapshot]): (-[WKWebView _layoutMode]): (-[WKWebView _setLayoutMode:]): (-[WKWebView _fixedLayoutSize]): (-[WKWebView _setFixedLayoutSize:]): (-[WKWebView _setBackgroundExtendsBeyondPage:]): (-[WKWebView _backgroundExtendsBeyondPage]): (-[WKWebView _viewScale]): (-[WKWebView _setViewScale:]): (-[WKWebView _setMinimumEffectiveDeviceWidth:]): (-[WKWebView _minimumEffectiveDeviceWidth]): (-[WKWebView _setScrollPerformanceDataCollectionEnabled:]): (-[WKWebView _scrollPerformanceDataCollectionEnabled]): (-[WKWebView _scrollPerformanceData]): (-[WKWebView _allowsMediaDocumentInlinePlayback]): (-[WKWebView _setAllowsMediaDocumentInlinePlayback:]): (-[WKWebView _webProcessIsResponsive]): (-[WKWebView _setFullscreenDelegate:]): (-[WKWebView _fullscreenDelegate]): (-[WKWebView _isInFullscreen]): (-[WKWebView _mediaCaptureState]): (-[WKWebView _setMediaCaptureEnabled:]): (-[WKWebView _mediaCaptureEnabled]): (-[WKWebView _setPageMuted:]): (-[WKWebView _removeDataDetectedLinks:]): (-[WKWebView _doAfterNextPresentationUpdate:]): (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForPainting:]): (-[WKWebView _doAfterNextStablePresentationUpdate:]): (-[WKWebView _detectDataWithTypes:completionHandler:]): (-[WKWebView removeFromSuperview]): (-[WKWebView _minimumLayoutSizeOverride]): (-[WKWebView _setViewLayoutSizeOverride:]): (-[WKWebView _obscuredInsets]): (-[WKWebView _setObscuredInsets:]): (-[WKWebView _obscuredInsetEdgesAffectedBySafeArea]): (-[WKWebView _setObscuredInsetEdgesAffectedBySafeArea:]): (-[WKWebView _unobscuredSafeAreaInsets]): (-[WKWebView _setUnobscuredSafeAreaInsets:]): (-[WKWebView _safeAreaShouldAffectObscuredInsets]): (-[WKWebView _setInterfaceOrientationOverride:]): (-[WKWebView _interfaceOrientationOverride]): (-[WKWebView _clearInterfaceOrientationOverride]): (-[WKWebView _maximumUnobscuredSizeOverride]): (-[WKWebView _setMaximumUnobscuredSizeOverride:]): (-[WKWebView _setAllowsViewportShrinkToFit:]): (-[WKWebView _allowsViewportShrinkToFit]): (-[WKWebView _beginInteractiveObscuredInsetsChange]): (-[WKWebView _endInteractiveObscuredInsetsChange]): (-[WKWebView _hideContentUntilNextUpdate]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _endAnimatedResize]): (-[WKWebView _resizeWhileHidingContentWithUpdates:]): (-[WKWebView _setOverlaidAccessoryViewsInset:]): (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]): (-[WKWebView _clearOverrideLayoutParameters]): (viewportArgumentsFromDictionary): (-[WKWebView _overrideViewportWithArguments:]): (-[WKWebView _viewForFindUI]): (-[WKWebView _isDisplayingPDF]): (-[WKWebView _dataForDisplayedPDF]): (-[WKWebView _suggestedFilenameForDisplayedPDF]): (-[WKWebView _webViewPrintFormatter]): (toUserInterfaceLayoutDirection): (-[WKWebView setSemanticContentAttribute:]): (-[WKWebView _drawsBackground]): (-[WKWebView _setDrawsBackground:]): (-[WKWebView _backgroundColor]): (-[WKWebView _setBackgroundColor:]): (-[WKWebView _setDrawsTransparentBackground:]): (-[WKWebView _inspectorAttachmentView]): (-[WKWebView _setInspectorAttachmentView:]): (-[WKWebView _setOverlayScrollbarStyle:]): (-[WKWebView _overlayScrollbarStyle]): (-[WKWebView _windowOcclusionDetectionEnabled]): (-[WKWebView _setWindowOcclusionDetectionEnabled:]): (-[WKWebView shareSheetDidDismiss:]): (-[WKWebView _setOverrideDeviceScaleFactor:]): (-[WKWebView _overrideDeviceScaleFactor]): (-[WKWebView _setTopContentInset:]): (-[WKWebView _topContentInset]): (-[WKWebView _pageExtendedBackgroundColor]): (-[WKWebView _pinnedState]): (-[WKWebView _rubberBandingEnabled]): (-[WKWebView _setRubberBandingEnabled:]): (-[WKWebView _immediateActionAnimationControllerForHitTestResult:withType:userData:]): (-[WKWebView _setAutomaticallyAdjustsContentInsets:]): (-[WKWebView _automaticallyAdjustsContentInsets]): (-[WKWebView _minimumLayoutWidth]): (-[WKWebView _setMinimumLayoutWidth:]): (-[WKWebView _shouldExpandContentToViewHeightForAutoLayout]): (-[WKWebView _setShouldExpandContentToViewHeightForAutoLayout:]): (-[WKWebView _alwaysShowsHorizontalScroller]): (-[WKWebView _setAlwaysShowsHorizontalScroller:]): (-[WKWebView _alwaysShowsVerticalScroller]): (-[WKWebView _setAlwaysShowsVerticalScroller:]): (-[WKWebView _printOperationWithPrintInfo:]): (-[WKWebView _printOperationWithPrintInfo:forFrame:]): (-[WKWebView setUserInterfaceLayoutDirection:]): (-[WKWebView _wantsMediaPlaybackControlsView]): (-[WKWebView _setWantsMediaPlaybackControlsView:]): (-[WKWebView _mediaPlaybackControlsView]): (-[WKWebView _addMediaPlaybackControlsView:]): (-[WKWebView _removeMediaPlaybackControlsView]): (-[WKWebView _prepareForMoveToWindow:completionHandler:]): (-[WKWebView _setThumbnailView:]): (-[WKWebView _thumbnailView]): (-[WKWebView _setIgnoresAllEvents:]): (-[WKWebView _ignoresAllEvents]): (-[WKWebView _spellCheckerDocumentTag]): (-[WKWebView _setContinuousSpellCheckingEnabledForTesting:]): Deleted. (-[WKWebView _contentsOfUserInterfaceItem:]): Deleted. (-[WKWebView keyboardAccessoryBarNext]): Deleted. (-[WKWebView keyboardAccessoryBarPrevious]): Deleted. (-[WKWebView applyAutocorrection:toString:withCompletionHandler:]): Deleted. (-[WKWebView dismissFormAccessoryView]): Deleted. (-[WKWebView _dismissFilePicker]): Deleted. (-[WKWebView setTimePickerValueToHour:minute:]): Deleted. (-[WKWebView selectFormAccessoryPickerRow:]): Deleted. (-[WKWebView selectFormPopoverTitle]): Deleted. (-[WKWebView textContentTypeForTesting]): Deleted. (-[WKWebView formInputLabel]): Deleted. (-[WKWebView _didShowContextMenu]): Deleted. (-[WKWebView _didDismissContextMenu]): Deleted. (-[WKWebView _inputViewBounds]): Deleted. (-[WKWebView _uiTextSelectionRects]): Deleted. (-[WKWebView _scrollingTreeAsText]): Deleted. (-[WKWebView _stableStateOverride]): Deleted. (-[WKWebView _propertiesOfLayerWithID:]): Deleted. (-[WKWebView _doAfterResettingSingleTapGesture:]): Deleted. (-[WKWebView _doAfterReceivingEditDragSnapshotForTesting:]): Deleted. (-[WKWebView _requestControlledElementID]): Deleted. (-[WKWebView _handleControlledElementIDResponse:]): Deleted. (-[WKWebView _handleAcceptedCandidate:]): Deleted. (-[WKWebView _didHandleAcceptedCandidate]): Deleted. (-[WKWebView _didUpdateCandidateListVisibility:]): Deleted. (-[WKWebView _forceRequestCandidates]): Deleted. (-[WKWebView _shouldRequestCandidates]): Deleted. (-[WKWebView _insertText:replacementRange:]): Deleted. (-[WKWebView _candidateRect]): Deleted. (-[WKWebView viewDidChangeEffectiveAppearance]): Deleted. (-[WKWebView _setHeaderBannerHeight:]): Deleted. (-[WKWebView _setFooterBannerHeight:]): Deleted. (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]): Deleted. (-[WKWebView _activeMenu]): Deleted. (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Deleted. (-[WKWebView _setPageScale:withOrigin:]): Deleted. (-[WKWebView _pageScale]): Deleted. (-[WKWebView _scrollingUpdatesDisabledForTesting]): Deleted. (-[WKWebView _setScrollingUpdatesDisabledForTesting:]): Deleted. (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForAnimatedResizeForTesting:]): Deleted. (-[WKWebView _doAfterNextVisibleContentRectUpdate:]): Deleted. (-[WKWebView _disableBackForwardSnapshotVolatilityForTesting]): Deleted. (-[WKWebView _dragCaretRect]): Deleted. (-[WKWebView _simulateLongPressActionAtLocation:]): Deleted. (-[WKWebView _simulateTextEntered:]): Deleted. (-[WKWebView _dynamicUserInterfaceTraitDidChange]): Deleted. (-[WKWebView _beginBackSwipeForTesting]): Deleted. (-[WKWebView _completeBackSwipeForTesting]): Deleted. (-[WKWebView _setDefersLoadingForTesting:]): Deleted. (-[WKWebView _setShareSheetCompletesImmediatelyWithResolutionForTesting:]): Deleted. (-[WKWebView _hasInspectorFrontend]): Deleted. (-[WKWebView _processWillSuspendImminentlyForTesting]): Deleted. (-[WKWebView _processDidResumeForTesting]): Deleted. (-[WKWebView _setAssertionStateForTesting:]): Deleted. (-[WKWebView _hasServiceWorkerBackgroundActivityForTesting]): Deleted. (-[WKWebView _hasServiceWorkerForegroundActivityForTesting]): Deleted. (-[WKWebView _denyNextUserMediaRequest]): Deleted. (-[WKWebView _triggerSystemPreviewActionOnElement:document:page:]): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/WKWebViewTesting.h: Added. * UIProcess/API/Cocoa/WKWebViewTesting.mm: Added. (-[WKWebView _setPageScale:withOrigin:]): (-[WKWebView _pageScale]): (-[WKWebView _setContinuousSpellCheckingEnabledForTesting:]): (-[WKWebView _contentsOfUserInterfaceItem:]): (-[WKWebView _requestActiveNowPlayingSessionInfo:]): (-[WKWebView _scrollingUpdatesDisabledForTesting]): (-[WKWebView _setScrollingUpdatesDisabledForTesting:]): (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForAnimatedResizeForTesting:]): (-[WKWebView _doAfterNextVisibleContentRectUpdate:]): (-[WKWebView _disableBackForwardSnapshotVolatilityForTesting]): (-[WKWebView _beginBackSwipeForTesting]): (-[WKWebView _completeBackSwipeForTesting]): (-[WKWebView _setDefersLoadingForTesting:]): (-[WKWebView _setShareSheetCompletesImmediatelyWithResolutionForTesting:]): (-[WKWebView _hasInspectorFrontend]): (-[WKWebView _processWillSuspendImminentlyForTesting]): (-[WKWebView _processDidResumeForTesting]): (-[WKWebView _setAssertionStateForTesting:]): (-[WKWebView _hasServiceWorkerBackgroundActivityForTesting]): (-[WKWebView _hasServiceWorkerForegroundActivityForTesting]): (-[WKWebView _denyNextUserMediaRequest]): * UIProcess/API/ios/WKWebViewTestingIOS.h: Added. * UIProcess/API/ios/WKWebViewTestingIOS.mm: Added. (-[WKWebView keyboardAccessoryBarNext]): (-[WKWebView keyboardAccessoryBarPrevious]): (-[WKWebView applyAutocorrection:toString:withCompletionHandler:]): (-[WKWebView dismissFormAccessoryView]): (-[WKWebView _dismissFilePicker]): (-[WKWebView setTimePickerValueToHour:minute:]): (-[WKWebView selectFormAccessoryPickerRow:]): (-[WKWebView selectFormPopoverTitle]): (-[WKWebView textContentTypeForTesting]): (-[WKWebView formInputLabel]): (-[WKWebView _didShowContextMenu]): (-[WKWebView _didDismissContextMenu]): (-[WKWebView _inputViewBounds]): (-[WKWebView _uiTextSelectionRects]): (-[WKWebView _scrollingTreeAsText]): (-[WKWebView _stableStateOverride]): (-[WKWebView _propertiesOfLayerWithID:]): (-[WKWebView _doAfterResettingSingleTapGesture:]): (-[WKWebView _doAfterReceivingEditDragSnapshotForTesting:]): (-[WKWebView _dragCaretRect]): (-[WKWebView _simulateLongPressActionAtLocation:]): (-[WKWebView _simulateTextEntered:]): (-[WKWebView _dynamicUserInterfaceTraitDidChange]): (-[WKWebView _triggerSystemPreviewActionOnElement:document:page:]): * UIProcess/API/mac/WKWebViewTestingMac.h: Copied from Tools/TestWebKitAPI/Tests/WebKitCocoa/InteractionDeadlockAfterCrash.mm. * UIProcess/API/mac/WKWebViewTestingMac.mm: Added. (-[WKWebView _requestControlledElementID]): (-[WKWebView _handleControlledElementIDResponse:]): (-[WKWebView _handleAcceptedCandidate:]): (-[WKWebView _didHandleAcceptedCandidate]): (-[WKWebView _didUpdateCandidateListVisibility:]): (-[WKWebView _forceRequestCandidates]): (-[WKWebView _shouldRequestCandidates]): (-[WKWebView _insertText:replacementRange:]): (-[WKWebView _candidateRect]): (-[WKWebView viewDidChangeEffectiveAppearance]): (-[WKWebView _setHeaderBannerHeight:]): (-[WKWebView _setFooterBannerHeight:]): (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]): (-[WKWebView _activeMenu]): * UIProcess/Cocoa/PageClientImplCocoa.mm: * UIProcess/ios/PageClientImplIOS.mm: * UIProcess/ios/WKContentViewInteraction.mm: * UIProcess/ios/WKMouseGestureRecognizer.h: * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: * UIProcess/mac/PageClientImplMac.mm: * UIProcess/mac/WKFullScreenWindowController.h: * WebKit.xcodeproj/project.pbxproj: 2019-12-11 Chris Dumez Unreviewed iOS build fix after r253343. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2019-12-11 Jiewen Tan [WebAuthn] Implement dummy _WKWebAuthenticationPanel SPIs for CTAP PIN support https://bugs.webkit.org/show_bug.cgi?id=205100 Reviewed by Brent Fulgham. This patch implements dummy _WKWebAuthenticationPanel SPIs for CTAP PIN support. CTAP PIN is a way for authenticators to be able to do user verification by asking clients/users for a pre-set PIN. Here is the spec: https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#authenticatorClientPIN In order to support this, WebKit needs to interacts with UIClients to ask users to enter the PINs. Therefore, a new set of SPI is needed. Here is the proposed SPI for WebKit to ask Safari for the PIN: @protocol _WKWebAuthenticationPanelDelegate @optional ... - (void)panel:(_WKWebAuthenticationPanel *)panel requestPINWithRetries:(NSUInteger)retries completionHandler:(void (^)(NSData *))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); ... @end Retries is the number of retires before the authenticator getting blocked, which is a state that only factory reset can save the authenticator. UIClients can have a threshold and WARN users loudly when the threshold is reached. A byte array that is less than or equal to 63 bytes is expected to return to the passed completion handler. Otherwise, the completion handler will bail out. For error handling: typedef NS_ENUM(NSInteger, _WKWebAuthenticationPanelUpdate) { ... _WKWebAuthenticationPanelUpdatePINBlocked, _WKWebAuthenticationPanelUpdatePINAuthBlocked, _WKWebAuthenticationPanelUpdatePINInvalid, } WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); The above three error will be passed to UIClients via updateWebAuthenticationPanel SPI. _WKWebAuthenticationPanelUpdatePINBlocked means the authenticator is dead. A factory reset is needed. _WKWebAuthenticationPanelUpdatePINAuthBlocked means 3 consecutive mismatches. The authenticator will need to be reconnected. _WKWebAuthenticationPanelUpdatePINInvalid means a wrong PIN is provided. This will often be followed with another requestPINWithRetries delegate call. Here is the spec for the error: https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#using-pinToken-in-authenticatorMakeCredential. * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h: 2019-12-10 Chris Dumez [macOS] Issue load sooner on swipe back/forward navigation https://bugs.webkit.org/show_bug.cgi?id=205087 Reviewed by Tim Horton. Issue load sooner on swipe back/forward navigation on macOS. We were waiting until the end of the swipe animation to issue the load. We now issue the load as soon as the user lifts the finger off the screen and thus commits to navigating. This results in improved perceived performance when swiping back/forward to navigate. This patch does not take care of iOS because the ViewGestureController logic is different on that platform. There is no reason we shouldn't be able to do the same optimization on iOS too though. To achieve the behavior change on macOS, the following was done: - Issue the load in ViewGestureController::willEndSwipeGesture() instead of ViewGestureController::endSwipeGesture(). - Add a new SnapshotRemovalTracker::Event::SwipeAnimationEnd event and wait for this event before taking away the snapshot. This makes sure we do not take away the swipe snapshot until the swipe animation is actually over (now that we start the navigation during the animation, instead of after). - To make sure that layer being swiped away stays the same until the end of the animation, I added a new SwipeAnimation reason for freezing the layer tree. At the beginning of the animation, the UIProcess sends a FreezeLayerTreeDueToSwipeAnimation IPC to the WebProcess to add this layer tree freeze reason. At the end of the animation, the UIProcess sends the UnfreezeLayerTreeDueToSwipeAnimation IPC to remove this freeze reason. Without this change, the layer being swiped away would sometimes start showing the destination site being loaded before the end of the animation. On cross-process navigation, not freezing the layer tree would cause the swipe animation to get interrupted when we have something to paint in the new process before the end of the swipe animation. * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::initializeWebPage): * UIProcess/ViewGestureController.cpp: (WebKit::ViewGestureController::SnapshotRemovalTracker::eventsDescription): (WebKit::ViewGestureController::willEndSwipeGesture): (WebKit::ViewGestureController::endSwipeGesture): * UIProcess/ViewGestureController.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::commitProvisionalPage): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::isLayerTreeFrozenDueToSwipeAnimation const): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::freezeLayerTreeDueToSwipeAnimation): (WebKit::WebPage::unfreezeLayerTreeDueToSwipeAnimation): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2019-12-10 Fujii Hironori [Win] Fix MSVC warning C4701: potentially uninitialized local variable 'x' used https://bugs.webkit.org/show_bug.cgi?id=205052 Reviewed by Don Olmstead. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor const): * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired const): Zero-initialized local variables. 2019-12-10 Per Arne Vollan [iOS] Calls to the device motion API should be done in the UI process https://bugs.webkit.org/show_bug.cgi?id=204770 Reviewed by Brent Fulgham. The class WebDeviceOrientationUpdateProviderProxy will handle messages to start and stop updating device motion in the UI process. Also, add a message to update the device motion in the WebContent process. In the UI process, the device motion API is called through the already existing WebCoreMotionManager class. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * UIProcess/ios/WebDeviceOrientationUpdateProviderProxy.h: * UIProcess/ios/WebDeviceOrientationUpdateProviderProxy.messages.in: * UIProcess/ios/WebDeviceOrientationUpdateProviderProxy.mm: (WebKit::WebDeviceOrientationUpdateProviderProxy::startUpdatingDeviceMotion): (WebKit::WebDeviceOrientationUpdateProviderProxy::stopUpdatingDeviceMotion): (WebKit::WebDeviceOrientationUpdateProviderProxy::motionChanged): * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.cpp: (WebKit::WebDeviceOrientationUpdateProvider::startUpdatingDeviceOrientation): (WebKit::WebDeviceOrientationUpdateProvider::stopUpdatingDeviceOrientation): (WebKit::WebDeviceOrientationUpdateProvider::startUpdatingDeviceMotion): (WebKit::WebDeviceOrientationUpdateProvider::stopUpdatingDeviceMotion): (WebKit::WebDeviceOrientationUpdateProvider::deviceOrientationChanged): (WebKit::WebDeviceOrientationUpdateProvider::deviceMotionChanged): (WebKit::WebDeviceOrientationUpdateProvider::startUpdating): Deleted. (WebKit::WebDeviceOrientationUpdateProvider::stopUpdating): Deleted. * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.h: * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.messages.in: 2019-12-10 Chris Dumez Unreviewed, drop debug assertion in InspectorTargetProxy::didCommitProvisionalTarget() that is hitting after r253337 r253337 causes the ProvisionalPageProxy to get destroyed a little bit early, before didCommitProvisionalTarget() is called. didCommitProvisionalTarget() had an assertion that isProvisional() returns true, which merely checked that the ProvisionalPageProxy is still alive before nulling out its WeakPtr. * UIProcess/InspectorTargetProxy.cpp: (WebKit::InspectorTargetProxy::didCommitProvisionalTarget): 2019-12-10 Per Arne Vollan [iOS] Deny mach lookup access to network extension services in the WebContent sandbox https://bugs.webkit.org/show_bug.cgi?id=203929 Reviewed by Brent Fulgham. Mach lookup access to network extension services in the WebContent process is only needed if NEFilterSource.filterRequired is true. If this is the case, issue the needed mach lookup sandbox extensions to the WebContent process, where they will be consumed. Eventually, all the content filtering code should be moved to the Networking process, but since this is a bigger undertaking, we can issue extensions in the meantime to strengthen the sandbox. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): * WebProcess/com.apple.WebProcess.sb.in: 2019-12-10 Chris Dumez Leverage the fact that WebPageProxy subclasses IPC::MessageSender to simplify IPC sending code https://bugs.webkit.org/show_bug.cgi?id=205065 Reviewed by Alex Christensen. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageLoaderClient): * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::switchToBrowsingContext): (WebKit::WebAutomationSession::evaluateJavaScriptFunction): (WebKit::WebAutomationSession::resolveChildFrameHandle): (WebKit::WebAutomationSession::resolveParentFrameHandle): (WebKit::WebAutomationSession::computeElementLayout): (WebKit::WebAutomationSession::selectOptionElement): (WebKit::WebAutomationSession::setFilesForInputFileUpload): (WebKit::WebAutomationSession::getAllCookies): (WebKit::WebAutomationSession::deleteSingleCookie): (WebKit::WebAutomationSession::takeScreenshot): * UIProcess/RemoteWebInspectorProxy.cpp: (WebKit::RemoteWebInspectorProxy::load): (WebKit::RemoteWebInspectorProxy::sendMessageToFrontend): * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy): * UIProcess/WebEditCommandProxy.cpp: (WebKit::WebEditCommandProxy::unapply): (WebKit::WebEditCommandProxy::reapply): * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::loadURL): (WebKit::WebFrameProxy::loadData): (WebKit::WebFrameProxy::stopLoading const): * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::sendMessageToFrontend): (WebKit::WebInspectorProxy::connect): (WebKit::WebInspectorProxy::close): (WebKit::WebInspectorProxy::updateForNewPageProcess): (WebKit::WebInspectorProxy::setFrontendConnection): (WebKit::WebInspectorProxy::showConsole): (WebKit::WebInspectorProxy::showResources): (WebKit::WebInspectorProxy::showMainResourceForFrame): (WebKit::WebInspectorProxy::attach): (WebKit::WebInspectorProxy::detach): (WebKit::WebInspectorProxy::togglePageProfiling): (WebKit::WebInspectorProxy::toggleElementSelection): (WebKit::WebInspectorProxy::openLocalInspectorFrontend): (WebKit::WebInspectorProxy::open): (WebKit::WebInspectorProxy::closeFrontendPageAndWindow): (WebKit::WebInspectorProxy::attachAvailabilityChanged): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setUIClient): (WebKit::WebPageProxy::setIconLoadingClient): (WebKit::WebPageProxy::launchProcessForReload): (WebKit::WebPageProxy::launchProcessWithItem): (WebKit::WebPageProxy::initializeWebPage): (WebKit::WebPageProxy::close): (WebKit::WebPageProxy::loadRequestWithNavigationShared): (WebKit::WebPageProxy::loadFile): (WebKit::WebPageProxy::loadAlternateHTML): (WebKit::WebPageProxy::loadWebArchiveData): (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick): (WebKit::WebPageProxy::stopLoading): (WebKit::WebPageProxy::reload): (WebKit::WebPageProxy::goToBackForwardItem): (WebKit::WebPageProxy::tryRestoreScrollPosition): (WebKit::WebPageProxy::setControlledByAutomation): (WebKit::WebPageProxy::setIndicating): (WebKit::WebPageProxy::setBackgroundColor): (WebKit::WebPageProxy::setTopContentInset): (WebKit::WebPageProxy::setUnderlayColor): (WebKit::WebPageProxy::viewWillStartLiveResize): (WebKit::WebPageProxy::viewWillEndLiveResize): (WebKit::WebPageProxy::viewDidEnterWindow): (WebKit::WebPageProxy::dispatchActivityStateChange): (WebKit::WebPageProxy::layerHostingModeDidChange): (WebKit::WebPageProxy::setInitialFocus): (WebKit::WebPageProxy::clearSelection): (WebKit::WebPageProxy::restoreSelectionInFocusedEditableElement): (WebKit::WebPageProxy::validateCommand): (WebKit::WebPageProxy::increaseListLevel): (WebKit::WebPageProxy::decreaseListLevel): (WebKit::WebPageProxy::changeListType): (WebKit::WebPageProxy::setBaseWritingDirection): (WebKit::WebPageProxy::setNeedsFontAttributes): (WebKit::WebPageProxy::scheduleFullEditorStateUpdate): (WebKit::WebPageProxy::selectAll): (WebKit::WebPageProxy::executeEditCommand): (WebKit::WebPageProxy::requestFontAttributesAtSelectionStart): (WebKit::WebPageProxy::setEditable): (WebKit::WebPageProxy::performDragControllerAction): (WebKit::WebPageProxy::dragEnded): (WebKit::WebPageProxy::didStartDrag): (WebKit::WebPageProxy::dragCancelled): (WebKit::WebPageProxy::processNextQueuedMouseEvent): (WebKit::WebPageProxy::sendWheelEvent): (WebKit::WebPageProxy::handleKeyboardEvent): (WebKit::WebPageProxy::handleGestureEvent): (WebKit::WebPageProxy::handlePreventableTouchEvent): (WebKit::WebPageProxy::resetPotentialTapSecurityOrigin): (WebKit::WebPageProxy::handleUnpreventableTouchEvent): (WebKit::WebPageProxy::handleTouchEvent): (WebKit::WebPageProxy::cancelPointer): (WebKit::WebPageProxy::touchWithIdentifierWasRemoved): (WebKit::WebPageProxy::scrollBy): (WebKit::WebPageProxy::centerSelectionInVisibleArea): (WebKit::WebPageProxy::commitProvisionalPage): (WebKit::WebPageProxy::setUserAgent): (WebKit::WebPageProxy::resumeActiveDOMObjectsAndAnimations): (WebKit::WebPageProxy::suspendActiveDOMObjectsAndAnimations): (WebKit::WebPageProxy::setCustomTextEncodingName): (WebKit::WebPageProxy::restoreFromSessionState): (WebKit::WebPageProxy::setTextZoomFactor): (WebKit::WebPageProxy::setPageZoomFactor): (WebKit::WebPageProxy::setPageAndTextZoomFactors): (WebKit::WebPageProxy::scalePage): (WebKit::WebPageProxy::scalePageInViewCoordinates): (WebKit::WebPageProxy::scaleView): (WebKit::WebPageProxy::windowScreenDidChange): (WebKit::WebPageProxy::accessibilitySettingsDidChange): (WebKit::WebPageProxy::setUseFixedLayout): (WebKit::WebPageProxy::setFixedLayoutSize): (WebKit::WebPageProxy::setAlwaysShowsHorizontalScroller): (WebKit::WebPageProxy::setAlwaysShowsVerticalScroller): (WebKit::WebPageProxy::listenForLayoutMilestones): (WebKit::WebPageProxy::setSuppressScrollbarAnimations): (WebKit::WebPageProxy::setEnableVerticalRubberBanding): (WebKit::WebPageProxy::setEnableHorizontalRubberBanding): (WebKit::WebPageProxy::setBackgroundExtendsBeyondPage): (WebKit::WebPageProxy::setPaginationMode): (WebKit::WebPageProxy::setPaginationBehavesLikeColumns): (WebKit::WebPageProxy::setPageLength): (WebKit::WebPageProxy::setGapBetweenPages): (WebKit::WebPageProxy::setPaginationLineGridEnabled): (WebKit::WebPageProxy::findStringMatches): (WebKit::WebPageProxy::findString): (WebKit::WebPageProxy::getImageForFindMatch): (WebKit::WebPageProxy::selectFindMatch): (WebKit::WebPageProxy::indicateFindMatch): (WebKit::WebPageProxy::hideFindUI): (WebKit::WebPageProxy::countStringMatches): (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::preferencesDidChange): (WebKit::WebPageProxy::decidePolicyForNewWindowAction): (WebKit::WebPageProxy::willSubmitForm): (WebKit::WebPageProxy::showShareSheet): (WebKit::WebPageProxy::setMediaVolume): (WebKit::WebPageProxy::setMuted): (WebKit::WebPageProxy::stopMediaCapture): (WebKit::WebPageProxy::stopAllMediaPlayback): (WebKit::WebPageProxy::suspendAllMediaPlayback): (WebKit::WebPageProxy::resumeAllMediaPlayback): (WebKit::WebPageProxy::handleMediaEvent): * UIProcess/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::platformSave): 2019-12-10 Chris Dumez Gyroscope (DeviceMotion related) permission cannot be requested in WKWebView unless the client app sets a WKUIDelegate https://bugs.webkit.org/show_bug.cgi?id=203287 Reviewed by Alex Christensen. Device orientation / motion events permission dialog would not be shown unless the client app set a WKUIDelegate on the WKWebView, even though we do not need this WKUIDelegate to show the prompt. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _deviceOrientationUserPermissionHandler]): (-[WKWebView _setDeviceOrientationUserPermissionHandler:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::shouldAllowDeviceOrientationAndMotionAccess): * UIProcess/Cocoa/WKOrientationAccessAlert.mm: (WebKit::presentOrientationAccessAlert): 2019-12-10 Chris Dumez Unreviewed, drop bad assertion in PreconnectTask::willSendRedirectedRequest() PreconnectTask::willSendRedirectedRequest() may get called in case of HSTS redirect, so the ASSERT_NOT_REACHED() is wrong. * NetworkProcess/PreconnectTask.cpp: (WebKit::PreconnectTask::willSendRedirectedRequest): 2019-12-10 Commit Queue Unreviewed, rolling out r253212. https://bugs.webkit.org/show_bug.cgi?id=205074 ' REGRESSION (253212): Safari does not load local html file, base system Safari does not load RecoveryInformation.html' (Requested by nham on #webkit). Reverted changeset: "Drop support for NSURLCache callbacks in NetworkProcess" https://bugs.webkit.org/show_bug.cgi?id=203344 https://trac.webkit.org/changeset/253212 2019-12-10 Chris Dumez [WK2][iOS] Visibility propagation view is not properly updated when navigating cross-process https://bugs.webkit.org/show_bug.cgi?id=205028 Reviewed by Tim Horton. Make sure we keep the contextIDForVisibilityPropagation on the ProvisionalPageProxy / SuspendedPageProxy objects and update WebPageProxy::m_contextIDForVisibilityPropagation whenever we commit a provisional page. Also update ProvisionalPageProxy to listen for the WebPageProxy::DidCreateContextForVisibilityPropagation IPC so that it can update m_contextIDForVisibilityPropagation once the WebPage is created in the provisional WebProcess (which creates the visibility propagation view). * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::ProvisionalPageProxy): (WebKit::ProvisionalPageProxy::didCreateContextForVisibilityPropagation): (WebKit::ProvisionalPageProxy::didReceiveMessage): * UIProcess/ProvisionalPageProxy.h: (WebKit::ProvisionalPageProxy::contextIDForVisibilityPropagation const): * UIProcess/SuspendedPageProxy.cpp: (WebKit::SuspendedPageProxy::SuspendedPageProxy): * UIProcess/SuspendedPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::swapToProvisionalPage): (WebKit::WebPageProxy::commitProvisionalPage): (WebKit::WebPageProxy::resetState): (WebKit::WebPageProxy::swapToWebProcess): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView _setupVisibilityPropagationView]): (-[WKContentView _removeVisibilityPropagationView]): 2019-12-10 Chris Dumez Regression(r253277) ASSERTION FAILED: !parameters.request.httpBody() in NetworkConnectionToWebProcess::preconnectTo() https://bugs.webkit.org/show_bug.cgi?id=205030 Reviewed by Antti Koivisto. Instead of using the full request as preconnect request, create a simple one that contains only the destination URL. This avoids sending a request body unnecessarily over IPC, which was the cause of the assertion. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadRequest): 2019-12-10 Chris Dumez Make preconnectTo()'s completionHandler optional https://bugs.webkit.org/show_bug.cgi?id=205011 Reviewed by Antti Koivisto. Make preconnectTo()'s completionHandler optional, so that the network process does not unnecessarily send an IPC back if the client is not interested. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::preconnectTo): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::preconnectTo): * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadRequest): 2019-12-09 Eric Carlson Rename media in the GPU process preference https://bugs.webkit.org/show_bug.cgi?id=205013 Reviewed by Tim Horton. * Shared/WebPreferences.yaml: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 2019-12-09 Truitt Savell Unreviewed, rolling out r253299. Casued 30+ imported/ test failures on Mac wk2 Reverted changeset: "Throttling requestAnimationFrame should be controlled by RenderingUpdateScheduler" https://bugs.webkit.org/show_bug.cgi?id=204713 https://trac.webkit.org/changeset/253299 2019-12-09 Chris Dumez Regression(r249329) ViewGestureController::requestRenderTreeSizeNotificationIfNeeded() sometimes uses wrong webPageID for IPC https://bugs.webkit.org/show_bug.cgi?id=205012 Reviewed by Tim Horton. * UIProcess/InspectorTargetProxy.cpp: (WebKit::InspectorTargetProxy::connect): (WebKit::InspectorTargetProxy::disconnect): (WebKit::InspectorTargetProxy::sendMessageToTargetBackend): * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy): (WebKit::ProvisionalPageProxy::initializeWebPage): (WebKit::ProvisionalPageProxy::goToBackForwardItem): (WebKit::ProvisionalPageProxy::messageSenderConnection const): (WebKit::ProvisionalPageProxy::messageSenderDestinationID const): * UIProcess/ProvisionalPageProxy.h: * UIProcess/SuspendedPageProxy.cpp: (WebKit::SuspendedPageProxy::SuspendedPageProxy): (WebKit::SuspendedPageProxy::unsuspend): (WebKit::SuspendedPageProxy::close): (WebKit::SuspendedPageProxy::messageSenderConnection const): (WebKit::SuspendedPageProxy::messageSenderDestinationID const): * UIProcess/SuspendedPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::continueNavigationInNewProcess): Have SuspendedPageProxy & ProvisionalPageProxy subclass IPC::MessageSender so that we can call send() on them without having to pass in a PageIdentifier. Passing a PageIdentifier was error-prone. * UIProcess/ViewGestureController.cpp: (WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded): When there was a provisonal page proxy, we would properly send the IPC to the provisional page's process but would use the wrong PageIdentifier for the IPC. We would use the identifier of the committed WebPage instead of the one of the provisional WebPage. 2019-12-09 Wenson Hsieh Finish encoding/decoding support for DisplayList::SetState https://bugs.webkit.org/show_bug.cgi?id=205018 Reviewed by Tim Horton. Replaces WebCore::DisplayList::ImageHandle with just WebCore::ImageHandle. See WebCore ChangeLog for more details. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * Shared/WebCoreArgumentCoders.h: 2019-12-09 Said Abou-Hallawa Throttling requestAnimationFrame should be controlled by RenderingUpdateScheduler https://bugs.webkit.org/show_bug.cgi?id=204713 Reviewed by Simon Fraser. Create an IPC message on the DrawingArea to send a message from the WebProcess to the UIProcess to setPreferredFramesPerSecond of the DisplayRefreshMonitor. * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: (-[WKOneShotDisplayLinkHandler setPreferredFramesPerSecond:]): (WebKit::RemoteLayerTreeDrawingAreaProxy::setPreferredFramesPerSecond): Set the preferredFramesPerSecond of the CADisplayLink. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm: (WebKit::RemoteLayerTreeDisplayRefreshMonitor::setPreferredFramesPerSecond): Delegate the call to RemoteLayerTreeDrawingArea. * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::setPreferredFramesPerSecond): Send the IPC message from the WebProcess to the UIProcess. 2019-12-09 youenn fablet NetworkResourceLoader should consume its sandbox extensions when starting a fetch through service worker https://bugs.webkit.org/show_bug.cgi?id=204883 Reviewed by Alex Christensen. Consume sandbox extensions in network process before sending fetch task to service worker. This makes sure network process can send proper sandbox extensions to the service worker and it also ensures it will have the necessary rights to access the file if the fetch task is not handled by service worker. Test: http/wpt/service-workers/file-upload.html * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::consumeSandboxExtensionsIfNeeded): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::startFetch): 2019-12-09 Wenson Hsieh Unreviewed, fix the macCatalyst build after r253267 * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]): 2019-12-09 Alex Christensen Re-disable TLS1.0 and TLS1.1 by default https://bugs.webkit.org/show_bug.cgi?id=204922 Reviewed by Youenn Fablet. Covered by updated API tests. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): 2019-12-09 Chris Dumez Unreviewed, fix debug assertion for ApplePay API tests on iOS after r253277. Disable server preconnect if the load will be handled by the LegacyCustomProtocolManager. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::preconnectTo): 2019-12-09 youenn fablet Add an option to capture audio in GPU process https://bugs.webkit.org/show_bug.cgi?id=205007 Reviewed by Eric Carlson. Add a flag to make audio capture in GPU process. In WebProcess, if trying to capture through GPUProcess, send back an error since this is not implemented. * Shared/WebPreferences.yaml: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetCaptureAudioInGPUProcessEnabled): (WKPreferencesGetCaptureAudioInGPUProcessEnabled): * UIProcess/API/C/WKPreferencesRef.h: * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::updateBoolValueForInternalDebugFeatureKey): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): (WebKit::WebProcessPool::createWebPage): * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::initialize): (WebKit::UserMediaCaptureManager::AudioFactory::createAudioCaptureSource): * WebProcess/cocoa/UserMediaCaptureManager.h: (WebKit::UserMediaCaptureManager::AudioFactory::setShouldCaptureInGPUProcess): 2019-12-08 Wenson Hsieh Move WebCore::Path encoders and decoders into WebCore from WebCoreArgumentCoders https://bugs.webkit.org/show_bug.cgi?id=204993 Reviewed by Tim Horton. Remove Encoder/Decoder support for WebCore::Path. * Shared/WebCoreArgumentCoders.cpp: (IPC::pathEncodeApplierFunction): Deleted. (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * Shared/WebCoreArgumentCoders.h: 2019-12-08 Chris Dumez Preconnect to server as early as possible in WebPage::LoadRequest https://bugs.webkit.org/show_bug.cgi?id=204992 Reviewed by Antti Koivisto. Preconnect to server as early as possible in WebPage::LoadRequest. This avoids delaying the connection to the server until after the policy check and is a ~1.3% progression on PLT5 on both macOS and iOS. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::preconnectTo): * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadRequest): 2019-12-08 youenn fablet Support different resolutions for video tracks captured from UIProcess https://bugs.webkit.org/show_bug.cgi?id=204945 Reviewed by Eric Carlson. Change video capture in uiprocess to an experimental flag. Add support for remote video source cloning by sending some IPC to UIProcess and cloning the source there. This triggers IPC for both cloning and cloned sources but this allows to do resizing in UIProcess instead of WebProcess. We thus disable video capture resizing in WebProcess. * Shared/WebPreferences.yaml: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::SourceProxy::start): (WebKit::UserMediaCaptureManagerProxy::SourceProxy::stop): (WebKit::UserMediaCaptureManagerProxy::SourceProxy::requestToEnd): (WebKit::UserMediaCaptureManagerProxy::SourceProxy::preventSourceFromStopping): (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): (WebKit::UserMediaCaptureManagerProxy::startProducingData): (WebKit::UserMediaCaptureManagerProxy::stopProducingData): (WebKit::UserMediaCaptureManagerProxy::clone): (WebKit::UserMediaCaptureManagerProxy::requestToEnd): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::sourceID const): (WebKit::UserMediaCaptureManager::Source::settings const): (WebKit::UserMediaCaptureManager::Source::remoteVideoSampleAvailable): (WebKit::UserMediaCaptureManager::Source::requestToEnd): (WebKit::UserMediaCaptureManager::Source::stopBeingObserved): (WebKit::UserMediaCaptureManager::cloneSource): (WebKit::UserMediaCaptureManager::cloneVideoSource): (WebKit::UserMediaCaptureManager::requestToEnd): (WebKit::UserMediaCaptureManager::VideoFactory::setVideoCapturePageState): * WebProcess/cocoa/UserMediaCaptureManager.h: 2019-12-08 youenn fablet Tighten Mac sandbox by removing microphone access https://bugs.webkit.org/show_bug.cgi?id=204939 Reviewed by Brent Fulgham. No change of behavior, we do audio capture in UIProcess. * WebProcess/com.apple.WebProcess.sb.in: 2019-12-08 youenn fablet Add logging to NetworkRTCMonitor https://bugs.webkit.org/show_bug.cgi?id=204850 Reviewed by Eric Carlson. Add logging and send IPC message back to WebProcess even if monitoring is stopped. No observable change of behavior. * NetworkProcess/webrtc/NetworkRTCMonitor.cpp: (WebKit::NetworkRTCMonitor::startUpdatingIfNeeded): (WebKit::NetworkRTCMonitor::stopUpdating): (WebKit::NetworkRTCMonitor::onNetworksChanged): 2019-12-07 Said Abou-Hallawa Make ColorSpace an enum class https://bugs.webkit.org/show_bug.cgi?id=204970 Reviewed by Sam Weinig. * Shared/WebCoreArgumentCoders.h: 2019-12-07 Wenson Hsieh [iOS] WKWebView touch event gesture recognition should not block the application process main thread when possible https://bugs.webkit.org/show_bug.cgi?id=204664 Reviewed by Tim Horton. Adds a mechanism that allows some sync touch events on iOS to be sent asynchronously. To do this, we use the deferring gesture mechanism introduced in trac.webkit.org/r253005 to defer all gestures under WKContentView (and WebKit-owned scroll views) when a touch starts, such that they will not recognize until we know that the page has either prevented default or not (assuming that the touch was over an active listener). See below for more details. Tests: fast/events/touch/ios/prevent-default-on-touch-start-with-slow-event-listener.html fast/events/touch/ios/scroll-on-touch-start-with-slow-event-listener.html * UIProcess/GenericCallback.h: * UIProcess/PageClient.h: * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm: (-[WKChildScrollView gestureRecognizer:shouldRequireFailureOfGestureRecognizer:]): (-[WKChildScrollView gestureRecognizer:shouldBeRequiredToFailByGestureRecognizer:]): Implement gesture recognizer delegate hooks to add dynamic failure requirements between a child scroll view's gestures and the new deferring gesture recognizers on WKContentView. This allows pan gestures over a scrollable container to hold off on recognizing while the deferring gesture recognizer has not failed yet. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handlePreventableTouchEvent): (WebKit::WebPageProxy::handleUnpreventableTouchEvent): Rename handleTouchEventSynchronously and handleTouchEventAsynchronously to handlePreventableTouchEvent and handleUnpreventableTouchEvent, respectively. Instead of always sending touchstart events that may prevent native gestures synchronously, we may now go through the same `EventDispatcher::TouchEvent` codepath used when dispatching touch events in passive tracking regions. However, in the case of preventable touchstarts, we additionally store a completion callback that is invoked after the touch event has been handled by the page; we then either un-defer or prevent native gestures here (depending on whether the page prevented default) by calling PageClient::doneDeferringNativeGestures. Non-touchstart events are still dispatched synchronously, to ensure that calling preventDefault() on touchmove and touchend continue to prevent default gestures from recognizing. (WebKit::WebPageProxy::boolCallback): (WebKit::WebPageProxy::handleTouchEventSynchronously): Deleted. (WebKit::WebPageProxy::handleTouchEventAsynchronously): Deleted. See above. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::isHandlingPreventableTouchStart const): This is used in WKContentView to determine whether deferring gestures need to remain active after the touch ends. See below for more detail. * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::doneDeferringNativeGestures): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[UIGestureRecognizer _wk_cancel]): (-[WKContentView setupInteraction]): (-[WKContentView cleanupInteraction]): (-[WKContentView _removeDefaultGestureRecognizers]): (-[WKContentView _addDefaultGestureRecognizers]): Add and remove the new deferring gesture recognizers here. (-[WKContentView _webTouchEventsRecognized:]): (-[WKContentView _webTouchEvent:preventsNativeGestures:]): (-[WKContentView _doneDeferringNativeGestures:]): (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): (-[WKContentView ensurePositionInformationIsUpToDate:]): Drive-by fix: add a missing hasRunningProcess check that causes a flaky assertion under `AuxiliaryProcessProxy::connection()` in layout tests. (-[WKContentView gestureRecognizer:shouldRequireFailureOfGestureRecognizer:]): (-[WKContentView gestureRecognizer:shouldBeRequiredToFailByGestureRecognizer:]): Add dynamic failure requirements between WKContentView's gestures (including all text interaction, context menu, and drag and drop gestures) and the new deferring gesture recognizers. (-[WKContentView _didStartProvisionalLoadForMainFrame]): Force the two-finger double tap gesture recognizer to reset when loading a new page. Without this, the layout test fast/events/ios/click-event-while-editing-node.html will rarely fail when run after a test that dispatches a two-finger tap, such as fast/events/ios/click-event-two-finger-single-tap-meta-key.html. This is because the new deferring gestures will temporarily unite multi-finger tap gestures with one-finger double tap gestures in the same subgraph when performing a tap gesture with more than one finger. This means that there's a 300 ms delay before a normal single tap can be recognized again, which (without forcing the two-finger double tap to reset) would cause a subsequent test that loads in under 300 ms and attempts to send a tap to fail. (-[WKContentView deferringGestureRecognizer:shouldDeferGesturesAfterBeginningTouchesWithEvent:]): Avoid deferring native gestures if the scroll view is decelerating; this matches behavior of the web touch event gesture recognizer. (-[WKContentView deferringGestureRecognizer:shouldDeferGesturesAfterEndingTouchesWithEvent:]): Normally, after -touchesEnded:withEvent:, we stop deferring native gesture recognizers by failing the deferring gestures. However, if we're still waiting for a response from the web process, then let -_doneDeferringNativeGestures: handle this instead. (-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]): (-[WKContentView deferringGestureRecognizer:shouldDeferGesturesWithEvent:]): Deleted. Renamed to -shouldDeferGesturesAfterBeginningTouchesWithEvent:. * UIProcess/ios/WKDeferringGestureRecognizer.h: * UIProcess/ios/WKDeferringGestureRecognizer.mm: (-[WKDeferringGestureRecognizer touchesBegan:withEvent:]): (-[WKDeferringGestureRecognizer touchesEnded:withEvent:]): Override this and add a new delegate hook to determine whether we want the deferring gesture recognizer to immediately fail when touches end. It's important to override this and transition to failure state in this case, since not doing so could mean that the deferring gestures stay in Possible state forever; this may lead to the gesture subgraph containing these deferring gestures being unable to reset, since it's waiting for the deferring gesture to either fail or end. * UIProcess/ios/WKScrollView.mm: (-[WKScrollView gestureRecognizer:shouldRequireFailureOfGestureRecognizer:]): (-[WKScrollView gestureRecognizer:shouldBeRequiredToFailByGestureRecognizer:]): Defer more scroll view gestures. * WebProcess/WebPage/EventDispatcher.cpp: (WebKit::EventDispatcher::touchEvent): Add an optional CallbackID parameter to this IPC message. If a callback ID is given, then we avoid coalescing the touch event. To implement this, we additionally refactor the queued touch events map to contain lists of > pairs; if a queued touch event has a corresponding CallbackID, then we fire the callback corresponding to the ID, indicating whether the touch event was handled by the page. * WebProcess/WebPage/EventDispatcher.h: * WebProcess/WebPage/EventDispatcher.messages.in: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dispatchAsynchronousTouchEvents): 2019-12-07 David Quesada REGRESSION(r253231): Debug assertion failures under ~WebDeviceOrientationUpdateProvider(Proxy) https://bugs.webkit.org/show_bug.cgi?id=204977 rdar://problem/57724251 Reviewed by Per Arne Vollan. In the UI process, have the WebPageProxy swap out its WebDeviceOrientationUpdateProviderProxy whenever it connects to a new process, instead of creating one on construction and holding onto it for the rest of the WebPageProxy lifetime. The …UpdateProviderProxy assumes that its page will have the same ID at the time of registering as a message receiver and later unregistering, but the page ID could change if the WebPageProxy swaps web processes. Using a new instance per web page ID ensures that the updater is always able to successfully remove itself as a message receiver when deallocating. In the Web process, ~WebDeviceOrientationUpdateProvider() should remove itself as a message receiver specifically for its page ID, rather than as a global message receiver. No new tests -- existing tests (at least the ProcessSwap API tests) revealed the regression. * UIProcess/WebPageProxy.cpp: (WebKit::m_tryCloseTimeoutTimer): (WebKit::WebPageProxy::didAttachToRunningProcess): (WebKit::WebPageProxy::resetState): (WebKit::m_webDeviceOrientationUpdateProviderProxy): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/ios/WebDeviceOrientationUpdateProviderProxy.h: * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.cpp: (WebKit::WebDeviceOrientationUpdateProvider::WebDeviceOrientationUpdateProvider): (WebKit::WebDeviceOrientationUpdateProvider::~WebDeviceOrientationUpdateProvider): * WebProcess/WebCoreSupport/WebDeviceOrientationUpdateProvider.h: 2019-12-07 Tim Horton Implement encoding for DrawImage and DrawRoundedRect display list items https://bugs.webkit.org/show_bug.cgi?id=204881 Reviewed by Simon Fraser. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: 2019-12-06 Commit Queue Unreviewed, rolling out r253218. https://bugs.webkit.org/show_bug.cgi?id=204968 Broke the build (Requested by ap on #webkit). Reverted changeset: "Remove various .order files." https://bugs.webkit.org/show_bug.cgi?id=204959 https://trac.webkit.org/changeset/253218 2019-12-06 Chris Dumez [IPC] MESSAGE_CHECK() parameters for AddPlugInAutoStartOriginHash / PlugInDidReceiveUserInteraction IPCs https://bugs.webkit.org/show_bug.cgi?id=204962 Reviewed by Ryosuke Niwa. MESSAGE_CHECK() parameters for AddPlugInAutoStartOriginHash / PlugInDidReceiveUserInteraction IPCs. Those parameters are used as keys in HashMaps. * UIProcess/Plugins/PlugInAutoStartProvider.cpp: (WebKit::PlugInAutoStartProvider::PlugInAutoStartProvider): (WebKit::PlugInAutoStartProvider::addAutoStartOriginHash): (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest): (WebKit::PlugInAutoStartProvider::didReceiveUserInteraction): * UIProcess/Plugins/PlugInAutoStartProvider.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::addPlugInAutoStartOriginHash): (WebKit::WebProcessProxy::plugInDidReceiveUserInteraction): 2019-12-06 Per Arne Vollan [iOS] Calls to device orientation API should be done in the UI process https://bugs.webkit.org/show_bug.cgi?id=204720 Reviewed by Alex Christensen. Add a new class, WebDeviceOrientationUpdateProviderProxy, to handle messages to start and stop updating device orientation in the UI process. Also, add a message to update the device orientation in the WebContent process. In the UI process, the device orientation API is called through the already existing WebCoreMotionManager class. * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * UIProcess/WebPageProxy.cpp: (WebKit::m_webDeviceOrientationUpdateProviderProxy): (WebKit::m_resetRecentCrashCountTimer): Deleted. * UIProcess/WebPageProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_overriddenMediaType): 2019-12-06 Chris Dumez Reduce timeout for page to handle beforeunload events when trying to close a page https://bugs.webkit.org/show_bug.cgi?id=204950 Reviewed by Ryosuke Niwa. Reduce timeout for page to handle beforeunload events when trying to close a page. It would previously take up to 3 seconds to actually close a tab after the user would click on the "X" to close it. This is because we would wait for the page to fire and handle the beforeunload events and only give up after 3 seconds. This patch reduces this timeout to something more reasonable from a user standpoint (500ms). * UIProcess/WebPageProxy.cpp: (WebKit::m_tryCloseTimeoutTimer): (WebKit::WebPageProxy::tryClose): (WebKit::WebPageProxy::tryCloseTimedOut): (WebKit::WebPageProxy::closePage): (WebKit::m_resetRecentCrashCountTimer): Deleted. * UIProcess/WebPageProxy.h: 2019-12-06 Jonathan Bedard Python 3: Add support in webkitpy.test https://bugs.webkit.org/show_bug.cgi?id=204952 Reviewed by Stephanie Lewis. Tested by test-webkitpy. * Scripts/webkit/messages_unittest.py: Use Python 2/3 compatible StringIO. 2019-12-06 Keith Miller Remove various .order files. https://bugs.webkit.org/show_bug.cgi?id=204959 Reviewed by Yusuke Suzuki. These files are all super out of date and likely don't do anything anymore. The signatures of the functions have changed thus the mangled name has changed. * mac/WebKit2.order: Removed. 2019-12-06 Dan Bernstein Address * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView valueForUndefinedKey:]): Added a newline. 2019-12-06 Benjamin Nham Drop support for NSURLCache callbacks in NetworkProcess https://bugs.webkit.org/show_bug.cgi?id=203344 Reviewed by Alex Christensen. Remove the NSURLSession caching policy callback in NetworkProcess. It's no longer necessary since we don't use NSURLCache in NetworkProcess (https://bugs.webkit.org/show_bug.cgi?id=185990). * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]): Deleted. 2019-12-05 Chris Dumez Stop using reserveCapacity() / reserveInitialCapacity() in IPC decoders https://bugs.webkit.org/show_bug.cgi?id=204930 Reviewed by Ryosuke Niwa. This is IPC hardening since the size we use to reserve the capacity is encoded over IPC and cannot be trusted in some cases. * Platform/IPC/ArgumentCoders.h: * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder>>::decode): 2019-12-06 youenn fablet Protect WebRTC network monitoring to wait forever in edge cases https://bugs.webkit.org/show_bug.cgi?id=204846 Reviewed by Eric Carlson. We were limiting the number of IPC message sent to network process by only sending the start monitoring event for the first client. The issue is that, if network process crashes for instance while having not yet given the list of networks, all clients will be hanging waiting for the completion of network list. We are now sending an IPC message for every client and the network process will ignore the ones that are not useful. In addition, in case of network process crash, we send a signal that network list has changed to make sure clients will never hang. They might still fail connecting, which is ok since network process crashed. Test: webrtc/datachannel/gather-candidates-networkprocess-crash.html * NetworkProcess/webrtc/NetworkRTCMonitor.cpp: (WebKit::NetworkRTCMonitor::startUpdatingIfNeeded): * NetworkProcess/webrtc/NetworkRTCMonitor.h: * NetworkProcess/webrtc/NetworkRTCMonitor.messages.in: * WebProcess/Network/webrtc/LibWebRTCNetwork.h: (WebKit::LibWebRTCNetwork::networkProcessCrashed): * WebProcess/Network/webrtc/WebRTCMonitor.cpp: (WebKit::WebRTCMonitor::StartUpdating): (WebKit::WebRTCMonitor::StopUpdating): (WebKit::WebRTCMonitor::networksChanged): (WebKit::WebRTCMonitor::networkProcessCrashed): * WebProcess/Network/webrtc/WebRTCMonitor.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::networkProcessConnectionClosed): 2019-12-06 youenn fablet Output libwebrtc logging from Network Process as release logging https://bugs.webkit.org/show_bug.cgi?id=204853 Reviewed by Eric Carlson. This will help debugging WebRTC networking issues. No observable change of behavior. * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::doReleaseLogging): (WebKit::NetworkRTCProvider::NetworkRTCProvider): 2019-12-05 Yousuke Kimoto [WinCairo] Improve Inspectable Target Page to adapt a long title and URL https://bugs.webkit.org/show_bug.cgi?id=204874 Reviewed by Fujii Hironori. Add some CSS atributes to make such long titles and URLs fit the width of a window size. Then "Inspector" button is shown at the visible area. No new tests, since there is no change in behavior. * UIProcess/socket/RemoteInspectorProtocolHandler.cpp: (WebKit::RemoteInspectorProtocolHandler::platformStartTask): 2019-12-05 Fujii Hironori [WebKit] Fix compilation warnings for MSVC https://bugs.webkit.org/show_bug.cgi?id=204661 Reviewed by Don Olmstead. No behavior changes. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp: (WebKit::makeDescription): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::cleanup): * NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp: (WebKit::NetworkCache::IOChannel::IOChannel): * Shared/API/c/WKSharedAPICast.h: (WebKit::toAPI): (WebKit::toDiagnosticLoggingResultType): * UIProcess/WebURLSchemeTask.cpp: (WebKit::WebURLSchemeTask::didReceiveData): * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: (WebKit::WebServiceWorkerFetchTaskClient::didReceiveData): * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::registerAttachmentIdentifier): 2019-12-05 Brian Burg [Cocoa] _WKInspector uses wrong WKWebView in -setDiagnosticLoggingDelegate: https://bugs.webkit.org/show_bug.cgi?id=204928 Reviewed by Timothy Hatcher. I feel like I've made this mistake before. To make the right thing more obvious, add a property named inspectorWebView that returns the Inspector WKWebView. * UIProcess/API/Cocoa/_WKInspector.mm: (-[_WKInspector inspectorWebView]): (-[_WKInspector _setDiagnosticLoggingDelegate:]): * UIProcess/WebInspectorProxy.h: (WebKit::WebInspectorProxy::inspectorPage const): 2019-12-05 Chris Dumez Use sendWithAsyncReply() for WebPage::TryClose IPC https://bugs.webkit.org/show_bug.cgi?id=204926 Reviewed by Alex Christensen. Use sendWithAsyncReply() for WebPage::TryClose IPC, instead of 2 separate IPCs. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::closeBrowsingContext): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::tryClose): (WebKit::WebPageProxy::closePage): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::tryClose): (WebKit::WebPage::sendClose): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2019-12-05 John Wilander Resource Load Statistics (experimental): Add fast mode for non-cookie website data deletion https://bugs.webkit.org/show_bug.cgi?id=204858 Reviewed by Alex Christensen. The purpose of this change is to allow for dedicated testing of the change in https://trac.webkit.org/changeset/253082/webkit. Waiting seven days just isn't a good starting point. This change adds two internal flags: - "Live-On Testing" with a one hour timeout instead of seven days. - "Repro Testing" with an instant timeout (bar ITP's regular delays) instead of seven days. The change also makes sure that hasHadUnexpiredRecentUserInteraction() in ResourceLoadStatisticsDatabaseStore and ResourceLoadStatisticsMemoryStore only age out the user interaction timestamp if the OperatingDatesWindow is Long so that we don't age out timestamps early with the shorter OperatingDatesWindows. This change changes the default value of IsFirstPartyWebsiteDataRemovalEnabled to true. These internal flags should be removed once testing is complete: * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const): (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor const): * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp: (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired const): * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::setFirstPartyWebsiteDataRemovalMode): * NetworkProcess/NetworkProcess.messages.in: * Shared/WebPreferences.yaml: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): 2019-12-05 Chris Dumez Optimize IPC::Connection::SyncMessageState methods https://bugs.webkit.org/show_bug.cgi?id=204890 Reviewed by Alex Christensen. Optimize IPC::Connection::SyncMessageState methods. We are seeing lock contention on some (app launch) benchmarks, resulting in the main thread yielding for 10ms. * Platform/IPC/Connection.cpp: (IPC::Connection::SyncMessageState): Make constructor private since this is a singleton class. (IPC::Connection::ConnectionAndIncomingMessage): Add convenience dispatch() method. (IPC::Connection::SyncMessageState::processIncomingMessage): Drop the lock as early as possible, *before* calling RunLoop::main().dispatch(). (IPC::Connection::SyncMessageState::dispatchMessages): Drop allowedConnection parameter and simplify the code a lot as a result. Only dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection() needed the pass an allowedConnection but having dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection() call dispatchMessages() was inefficient since it would cause us to grab the lock in dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection() to update m_didScheduleDispatchMessagesWorkSet, then release it, then grab the lock again in dispatchMessages() for m_messagesToDispatchWhileWaitingForSyncReply. (IPC::Connection::SyncMessageState::dispatchMessagesAndResetDidScheduleDispatchMessagesForConnection): Grab the lock only once to update m_didScheduleDispatchMessagesWorkSet and m_messagesToDispatchWhileWaitingForSyncReply, instead of doing it in 2 separate steps, each one taking the lock. (IPC::Connection::waitForMessage): (IPC::Connection::waitForSyncReply): (IPC::Connection::dispatchSyncMessage): stop passing a null allowedConnection when calling dispatchMessages(). 2019-12-05 Chris Dumez PageConfiguration::dragClient should use a smart pointer https://bugs.webkit.org/show_bug.cgi?id=204816 Reviewed by Alex Christensen. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_overriddenMediaType): 2019-12-05 Chris Dumez [IPC] Fail BackForwardItemIdentifier decoding if the decoded integer is not a valid ID https://bugs.webkit.org/show_bug.cgi?id=204920 Reviewed by Ryosuke Niwa. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::willGoToBackForwardListItem): (WebKit::WebPageProxy::backForwardGoToItemShared): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::updateBackForwardItem): 2019-12-05 Sihui Liu Move InProcessIDBServer to WebKitLegacy https://bugs.webkit.org/show_bug.cgi?id=204896 Reviewed by Brady Eidson. * WebProcess/Databases/WebDatabaseProvider.h: 2019-12-05 Sihui Liu Add ThreadMessageReceiver to IPC::Connection https://bugs.webkit.org/show_bug.cgi?id=204908 Reviewed by Brady Eidson. ThreadMesageReceiver is similar to WorkQueueMessageReceiver, but it should handle messages (dispatched from IPC thread) on a specific thread, while WorkQueueMessageReceiver may handle messages on different threads. * Platform/IPC/Connection.cpp: (IPC::Connection::addThreadMessageReceiver): (IPC::Connection::removeThreadMessageReceiver): (IPC::Connection::dispatchThreadMessageReceiverMessage): (IPC::Connection::processIncomingMessage): (IPC::Connection::dispatchMessageToThreadReceiver): * Platform/IPC/Connection.h: (IPC::Connection::ThreadMessageReceiver::dispatchToThread): 2019-12-05 Chris Dumez MESSAGE_CHECK BackForwardItemIdentifier on incoming IPC from the WebProcess https://bugs.webkit.org/show_bug.cgi?id=204899 Reviewed by Ryosuke Niwa. MESSAGE_CHECK BackForwardItemIdentifier on incoming IPC from the WebProcess. This is important since we use this identifier to look up the WebBackForwardListItem in a HashMap, and looking up a bad ID could corrupt said HashMap. * Shared/WebBackForwardListItem.cpp: Make sure the WebBackForwardListItem is always constructed and destroyed on the main thread, to avoid corrupting the allItems() HashMap. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::willGoToBackForwardListItem): (WebKit::WebPageProxy::backForwardGoToItemShared): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::updateBackForwardItem): 2019-12-05 Kate Cheney [MSVC] WebResourceLoadStatisticsStore.h is reporting warning C4804: '/': unsafe use of type 'bool' in operation https://bugs.webkit.org/show_bug.cgi?id=204870 Reviewed by Darin Adler. This patch converts storageAccessGranted to a char since makeString() does not explicitly accept bool types. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: (WebKit::ThirdPartyDataForSpecificFirstParty::toString const): 2019-12-05 Philippe Normand [GLib] Display GStreamer version in about:gpu page Rubber-stamped by Carlos Garcia Campos. * UIProcess/API/glib/WebKitProtocolHandler.cpp: (WebKit::WebKitProtocolHandler::handleGPU): 2019-12-05 youenn fablet inspector/page/overrideSetting-MockCaptureDevicesEnabled.html is failing after removal of internals.setMockMediaCaptureDevicesEnabled API https://bugs.webkit.org/show_bug.cgi?id=204849 Reviewed by Eric Carlson. Synchronize the center with the preferences when the value might be updated. Add API to check which center is used in UIProcess. * UIProcess/API/C/WKPage.cpp: (WKPageIsMockRealtimeMediaSourceCenterEnabled): * UIProcess/API/C/WKPagePrivate.h: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): (WebKit::UserMediaPermissionRequestManagerProxy::setMockCaptureDevicesEnabledOverride): * UIProcess/UserMediaPermissionRequestManagerProxy.h: (WebKit::UserMediaPermissionRequestManagerProxy::setMockCaptureDevicesEnabledOverride): Deleted. 2019-12-04 Joonghun Park Unreviewed. Remove build warnings below since r253025. warning: unused variable ‘iter’ [-Wunused-variable] warning: unused variable ‘isNewEntry’ [-Wunused-variable] No new tests, no new behavioral changes. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::addSessionStorageQuotaManager): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::SessionStorageQuotaManager::ensureOriginStorageQuotaManager): 2019-12-04 Chris Dumez IPC messages may get processed out of order in some cases https://bugs.webkit.org/show_bug.cgi?id=204864 Reviewed by Ryosuke Niwa. IPC messages may get processed out of order in some cases. Connection::SyncMessageState::dispatchMessages() puts messages it did not process back at the end of the queue, instead of the beginning. This means that messages added to the queue while Connection::SyncMessageState::dispatchMessages() was running will incorrectly run *before* the ones dispatchMessages() did not process. * Platform/IPC/Connection.cpp: (IPC::Connection::SyncMessageState::dispatchMessages): 2019-12-04 Chris Dumez PageConfiguration::progressTrackerClient should use a smart pointer https://bugs.webkit.org/show_bug.cgi?id=204854 Reviewed by Alex Christensen. * WebProcess/WebCoreSupport/WebProgressTrackerClient.cpp: (WebKit::WebProgressTrackerClient::progressTrackerDestroyed): Deleted. * WebProcess/WebCoreSupport/WebProgressTrackerClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_overriddenMediaType): 2019-12-04 Tim Horton Fix the iOS build * Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb: Added. * WebKit.xcodeproj/project.pbxproj: 2019-12-04 Per Arne Vollan Unreviewed fix for failure to create sandbox extension on macOS after r253011. This should be iOS only. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest): * UIProcess/UserMediaPermissionRequestManagerProxy.h: 2019-12-04 Per Arne Vollan [iOS] The UI process should issue mach sandbox extension to "com.apple.AGXCompilerService" https://bugs.webkit.org/show_bug.cgi?id=203915 Reviewed by Brent Fulgham. Only a few iPad models need access to "com.apple.AGXCompilerService” in the WebContent process. The UI process should issue this mach extension for these iPad models. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::deviceHasAGXCompilerService): (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2019-12-04 Kate Cheney Expose basic ITP data from the database for future API/SPI use https://bugs.webkit.org/show_bug.cgi?id=203432 Reviewed John Wilander. Tests: http/tests/resourceLoadStatistics/user-interface-data-no-storage-access-database.html http/tests/resourceLoadStatistics/user-interface-data-no-storage-access.html http/tests/storageAccess/user-interface-data-with-storage-access-database.html http/tests/storageAccess/user-interface-data-with-storage-access.html Adds the ability to collect sorted ITP data for displaying in a user interface. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore): (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements): Added new queries to the database store to check for storage access in the database and aggregate topFrames with the same subframe/subresource so easily create the struct for collecting data for the UI. (WebKit::ResourceLoadStatisticsDatabaseStore::relationshipExists const): Fixed an incorrect function name in the error message. (WebKit::ResourceLoadStatisticsDatabaseStore::joinSubStatisticsForSorting): Renamed unclear SQL variable names and added a bind parameter to specify whether resource is prevalent or not, which allows this function to be used to collect sorted ITP data for the UI. (WebKit::ResourceLoadStatisticsDatabaseStore::getFirstPartyDataForDomain const): (WebKit::ResourceLoadStatisticsDatabaseStore::gatherDataForUserInterface const): (WebKit::buildQueryStartAndEnd): (WebKit::getMedianOfPrevalentResourcesWithUserInteraction): (WebKit::ResourceLoadStatisticsDatabaseStore::getTopPrevelentResourceDaysSinceUI const): (WebKit::getMedianOfPrevalentResourceWithoutUserInteraction): (WebKit::getNumberOfPrevalentResourcesInTopResources): Changed sql query variable names to make them more clear and added a new bind parameter to allow for more general use of substatistic sorting query. (WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess const): (WebKit::ResourceLoadStatisticsDatabaseStore::dumpResourceLoadStatistics const): Combined UI data with dumpResourceLoadStatistics() data to keep the testing aspect of this patch simpler. (WebKit::ResourceLoadStatisticsDatabaseStore::resourceToString const): Since mostRecentUserInteractionTime changes with each test run, I updated the dumping to report only if it was in the last 24 hours as opposed to reporting an actual time. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: (WebKit::ensureFirstPartyStatistic): (WebKit::getFirstPartyDataForDomain): (WebKit::hasBeenThirdParty): (WebKit::ResourceLoadStatisticsMemoryStore::gatherDataForUserInterface const): (WebKit::ResourceLoadStatisticsMemoryStore::dumpResourceLoadStatistics): * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::gatherDataForUserInterface): * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: (WebKit::FirstPartyData::toString const): (WebKit::FirstPartyData::operator== const): (WebKit::ThirdPartyData::toString const): (WebKit::ThirdPartyData::operator< const): The toString methods allow the structs to be printed for testing purposes. The equals methods allow the return vectors to use appendIfNotContains. 2019-12-04 Simon Fraser Minor RemoteLayerTree logging cleanup https://bugs.webkit.org/show_bug.cgi?id=204865 Reviewed by Tim Horton. Have the ::description() methods return Strings like everything else does. Use LOG_WITH_STREAM() so we don't call description() unless the log channel is on. * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::dump const): (WebKit::RemoteLayerTreeTransaction::description const): * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: (WebKit::RemoteScrollingCoordinatorTransaction::description const): (WebKit::RemoteScrollingCoordinatorTransaction::dump const): * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): 2019-12-04 Louie Livon-Bemel Add exclusion rule for text manipulation SPI to exclude based on element class https://bugs.webkit.org/show_bug.cgi?id=204754 Reviewed by Ryosuke Niwa. Give clients another option for adding an exclusion for text manipulation; allow them to exclude based on an element having a certain class. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _startTextManipulationsWithConfiguration:completion:]): If the rule doesn't have an attribute but does have a class name, treat it as a ClassRule exclusion. * UIProcess/API/Cocoa/_WKTextManipulationExclusionRule.h: Add an initializer for excluding based on a class name. Also add a getter for the className. * UIProcess/API/Cocoa/_WKTextManipulationExclusionRule.mm: (-[_WKTextManipulationExclusionRule initExclusion:forClass:]): (-[_WKTextManipulationExclusionRule className]): 2019-12-04 Kenneth Russell Enable WebGL's ASTC extension all the time https://bugs.webkit.org/show_bug.cgi?id=202836 Reviewed by Dean Jackson. Remove the run-time flag - no longer necessary. * Shared/WebPreferences.yaml: 2019-12-04 youenn fablet WebProcessPool::terminateServiceWorkerProcess should be renamed terminateServiceWorkers https://bugs.webkit.org/show_bug.cgi?id=204792 Reviewed by Chris Dumez. Make use of disableServiceWorkers in terminateServiceWorkers as we might need to handle the case of a service worker in a process containing a page. Renaming API accordingly. Covered by existing tests. * UIProcess/API/C/WKContext.cpp: (WKContextTerminateServiceWorkers): * UIProcess/API/C/WKContextPrivate.h: * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _terminateServiceWorkers]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess): (WebKit::WebProcessPool::createWebPage): (WebKit::WebProcessPool::updateServiceWorkerUserAgent): (WebKit::WebProcessPool::terminateNetworkProcess): (WebKit::WebProcessPool::terminateServiceWorkers): (WebKit::WebProcessPool::updateProcessAssertions): (WebKit::WebProcessPool::isServiceWorkerPageID const): * UIProcess/WebProcessPool.h: 2019-12-04 youenn fablet Move soft update handling to network process https://bugs.webkit.org/show_bug.cgi?id=204678 Reviewed by Chris Dumez. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::swServerForSession): * NetworkProcess/NetworkSession.h: (WebKit::NetworkSession::addSoftUpdateLoader): (WebKit::NetworkSession::removeSoftUpdateLoader): * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask): (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse): (WebKit::ServiceWorkerFetchTask::didReceiveResponse): (WebKit::ServiceWorkerFetchTask::didFail): (WebKit::ServiceWorkerFetchTask::didNotHandle): (WebKit::ServiceWorkerFetchTask::continueFetchTaskWith): (WebKit::ServiceWorkerFetchTask::timeoutTimerFired): (WebKit::ServiceWorkerFetchTask::softUpdateIfNeeded): * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp: Added. (WebKit::ServiceWorkerSoftUpdateLoader::start): (WebKit::ServiceWorkerSoftUpdateLoader::ServiceWorkerSoftUpdateLoader): (WebKit::ServiceWorkerSoftUpdateLoader::~ServiceWorkerSoftUpdateLoader): (WebKit::ServiceWorkerSoftUpdateLoader::fail): (WebKit::ServiceWorkerSoftUpdateLoader::loadWithCacheEntry): (WebKit::ServiceWorkerSoftUpdateLoader::loadFromNetwork): (WebKit::ServiceWorkerSoftUpdateLoader::willSendRedirectedRequest): (WebKit::ServiceWorkerSoftUpdateLoader::didReceiveResponse): (WebKit::ServiceWorkerSoftUpdateLoader::didReceiveBuffer): (WebKit::ServiceWorkerSoftUpdateLoader::didFinishLoading): (WebKit::ServiceWorkerSoftUpdateLoader::didFailLoading): (WebKit::ServiceWorkerSoftUpdateLoader::didComplete): * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.h: Added. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::createFetchTask): * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h: * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge): * Sources.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Storage/WebSWContextManagerConnection.cpp: * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2019-12-04 Tim Horton Introduce a GPU process https://bugs.webkit.org/show_bug.cgi?id=204343 Reviewed by Simon Fraser. Add a GPU process. This process is destined to be used as a proxy between WebKit and the underlying graphics mechanisms; in the case of the Cocoa ports, it will specifically gate access to IOKit and a few media-related daemons. In this patch, the process is a UI-process singleton; the WebKit client application gets a single GPU process for all rendering, regardless of the number of Web Content processes, process pools, or web views. For now, it is just a shell of a process; functionality will be added in future patches! * Configurations/FeatureDefines.xcconfig: Add ENABLE(GPU_PROCESS). * Configurations/GPUService.xcconfig: Added. * GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-OSX.plist: Added. * GPUProcess/EntryPoint/Cocoa/XPCService/GPUService/Info-iOS.plist: Added. * GPUProcess/EntryPoint/Cocoa/XPCService/GPUServiceEntryPoint.mm: Added. * Shared/AuxiliaryProcess.h: * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h: * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm: * Platform/ExtraPrivateSymbolsForTAPI.h: * Shared/mac/AuxiliaryProcessMac.mm: * Sources.txt: * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: * Configurations/WebKit.xcconfig: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * UIProcess/AuxiliaryProcessProxy.cpp: (WebKit::AuxiliaryProcessProxy::getLaunchOptions): * UIProcess/Launcher/ProcessLauncher.h: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::serviceName): (WebKit::shouldLeakBoost): Add a new target for the XPC service, and do the paperwork to launch it. * GPUProcess/GPUConnectionToWebProcess.cpp: Added. * GPUProcess/GPUConnectionToWebProcess.h: Added. * GPUProcess/GPUConnectionToWebProcess.messages.in: Added. On the GPU process side, the incoming connection from the Web Content process. * GPUProcess/GPUProcess.cpp: Added. * GPUProcess/GPUProcess.h: Added. * GPUProcess/GPUProcess.messages.in: Added. * GPUProcess/GPUProcessCreationParameters.cpp: Added. * GPUProcess/GPUProcessCreationParameters.h: Added. * GPUProcess/cocoa/GPUProcessCocoa.mm: Added. * GPUProcess/ios/GPUProcessIOS.mm: Added. * GPUProcess/mac/GPUProcessMac.mm: Added. Add the shell of the GPU process. Mostly stolen from the Networking process. * UIProcess/GPU/GPUProcessProxy.cpp: Added. (WebKit::GPUProcessProxy::singleton): (WebKit::GPUProcessProxy::GPUProcessProxy): (WebKit::GPUProcessProxy::~GPUProcessProxy): (WebKit::GPUProcessProxy::getLaunchOptions): (WebKit::GPUProcessProxy::connectionWillOpen): (WebKit::GPUProcessProxy::processWillShutDown): (WebKit::GPUProcessProxy::getGPUProcessConnection): (WebKit::GPUProcessProxy::openGPUProcessConnection): (WebKit::GPUProcessProxy::gpuProcessCrashed): (WebKit::GPUProcessProxy::didReceiveMessage): (WebKit::GPUProcessProxy::didReceiveSyncMessage): (WebKit::GPUProcessProxy::didClose): (WebKit::GPUProcessProxy::didReceiveInvalidMessage): (WebKit::GPUProcessProxy::didFinishLaunching): (WebKit::GPUProcessProxy::updateProcessAssertion): * UIProcess/GPU/GPUProcessProxy.h: Added. * UIProcess/GPU/GPUProcessProxy.messages.in: Added. On the UI process side, the GPUProcessProxy is the singleton that owns the GPU process for the process. * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: Added. This sandbox profile is copied from the Web Content process. We will cut it down in the future, but this is a sensible starting point, since the code that is moving to the GPU process is code that currently lives in the Web Content process. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::updateProcessAssertion): Fix a logging typo I stumbled upon. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::getGPUProcessConnection): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::getGPUProcessConnection): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: Add a message from Web->UI to retrieve the GPU process connection. In the future, we should send this along with the Web Content process initialization message, but this mechanism doesn't exist yet. * WebProcess/GPU/GPUProcessConnection.cpp: Added. (WebKit::GPUProcessConnection::GPUProcessConnection): (WebKit::GPUProcessConnection::~GPUProcessConnection): (WebKit::GPUProcessConnection::didReceiveMessage): (WebKit::GPUProcessConnection::didReceiveSyncMessage): (WebKit::GPUProcessConnection::didClose): (WebKit::GPUProcessConnection::didReceiveInvalidMessage): * WebProcess/GPU/GPUProcessConnection.h: Added. (WebKit::GPUProcessConnection::create): (WebKit::GPUProcessConnection::connection): * WebProcess/GPU/GPUProcessConnection.messages.in: Added. * WebProcess/GPU/GPUProcessConnectionInfo.h: Added. (WebKit::GPUProcessConnectionInfo::identifier): (WebKit::GPUProcessConnectionInfo::releaseIdentifier): (WebKit::GPUProcessConnectionInfo::encode const): (WebKit::GPUProcessConnectionInfo::decode): In the Web Content process, GPUProcessConnection is the process-wide connection to the GPU process. All pages in a given Web Content process use the same connection to talk to the singleton GPU process. * WebProcess/WebProcess.cpp: (WebKit::getGPUProcessConnection): (WebKit::WebProcess::ensureGPUProcessConnection): (WebKit::WebProcess::gpuProcessConnectionClosed): * WebProcess/WebProcess.h: (WebKit::WebProcess::existingGPUProcessConnection): In the Web Content process, make it possible for clients to retrieve the GPU process connection. 2019-12-04 Yury Semikhatsky Web Inspector: allow inspector to pause provisional page load and restore its state https://bugs.webkit.org/show_bug.cgi?id=204170 Reviewed by Devin Rousso. Provisional page loading can be deffered if inspector front-end is connected. This allows to configure inspector backend in the provisional page before load request is sent. If inspector front-end is not connected provisional loading will conitinue exactly as before. Tests: http/tests/inspector/target/pause-on-inline-debugger-statement.html http/tests/inspector/target/provisional-load-cancels-previous-load.html * UIProcess/InspectorTargetProxy.cpp: (WebKit::InspectorTargetProxy::disconnect): * UIProcess/WebPageInspectorController.cpp: (WebKit::WebPageInspectorController::shouldPauseLoading const): (WebKit::WebPageInspectorController::setContinueLoadingCallback): * UIProcess/WebPageInspectorController.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::continueNavigationInNewProcess): 2019-12-03 Megan Gardner Add disabled highlight API skeleton https://bugs.webkit.org/show_bug.cgi?id=204809 Reviewed by Ryosuke Niwa. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetHighlightAPIEnabled): (WKPreferencesGetHighlightAPIEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: 2019-12-03 Ryosuke Niwa Replace customJavaScriptUserAgentAsSiteSpecificQuirks with customUserAgentAsSiteSpecificQuirks https://bugs.webkit.org/show_bug.cgi?id=204824 Reviewed by Brent Fulgham. This patch replaces _WKWebsitePolicies's customJavaScriptUserAgentAsSiteSpecificQuirks with customUserAgentAsSiteSpecificQuirks and makes it apply to network requests as well as JS API. * Shared/WebsitePoliciesData.cpp: (WebKit::WebsitePoliciesData::encode const): (WebKit::WebsitePoliciesData::decode): (WebKit::WebsitePoliciesData::applyToDocumentLoader): * Shared/WebsitePoliciesData.h: * UIProcess/API/APIWebsitePolicies.cpp: (API::WebsitePolicies::copy const): (API::WebsitePolicies::data): * UIProcess/API/APIWebsitePolicies.h: * UIProcess/API/Cocoa/WKWebpagePreferences.mm: (-[WKWebpagePreferences _setCustomUserAgentAsSiteSpecificQuirks:]): Renamed from _setCustomJavaScriptUserAgentAsSiteSpecificQuirks. (-[WKWebpagePreferences _customUserAgentAsSiteSpecificQuirks]): Renamed from _customJavaScriptUserAgentAsSiteSpecificQuirks. * UIProcess/API/Cocoa/WKWebpagePreferencesPrivate.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies setCustomUserAgentAsSiteSpecificQuirks:]): Renamed from setCustomJavaScriptUserAgentAsSiteSpecificQuirks. (-[_WKWebsitePolicies customUserAgentAsSiteSpecificQuirks]): Renamed from customJavaScriptUserAgentAsSiteSpecificQuirks. 2019-12-03 Andres Gonzalez Focus tracking support in the accessibility isolatedtree. https://bugs.webkit.org/show_bug.cgi?id=204535 Reviewed by Chris Fleizach. * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKAccessibilityFocusedObject): 2019-12-03 John Wilander Resource Load Statistics (experimental): Delete non-cookie website data after 7 days of no user interaction https://bugs.webkit.org/show_bug.cgi?id=204779 Reviewed by Alex Christensen. Trackers are continuing to move cross-site tracking IDs into first-party storage. This change ages out script-writable non-cookie website data in alignment with the 7-day cap on client-side cookies. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::shouldRemoveAllButCookiesFor const): Now makes use of the set WebCore::FirstPartyWebsiteDataRemovalMode. * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveAllButCookiesFor const): Now makes use of the set WebCore::FirstPartyWebsiteDataRemovalMode. * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: (WebKit::ResourceLoadStatisticsStore::setFirstPartyWebsiteDataRemovalMode): (WebKit::ResourceLoadStatisticsStore::firstPartyWebsiteDataRemovalMode const): * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::setFirstPartyWebsiteDataRemovalMode): * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::setFirstPartyWebsiteDataRemovalModeForTesting): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::setResourceLoadStatisticsEnabled): (WebKit::NetworkSession::recreateResourceLoadStatisticStore): (WebKit::NetworkSession::forwardResourceLoadStatisticsSettings): New convenience function to avoid code duplication in NetworkSession::setResourceLoadStatisticsEnabled() and NetworkSession::forwardResourceLoadStatisticsSettings(). * NetworkProcess/NetworkSession.h: * NetworkProcess/NetworkSessionCreationParameters.cpp: (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/NetworkSessionCreationParameters.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * Scripts/webkit/messages.py: Makes sure the WebCore::FirstPartyWebsiteDataRemovalMode is found in WebCore/NetworkStorageSession.h. * Shared/WebPreferences.yaml: New experimental feature, off by default. * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetResourceLoadStatisticsFirstPartyWebsiteDataRemovalModeForTesting): (WKWebsiteDataStoreStatisticsResetToConsistentState): * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::setFirstPartyWebsiteDataRemovalModeForTesting): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::setResourceLoadStatisticsFirstPartyWebsiteDataRemovalModeForTesting): * UIProcess/WebsiteData/WebsiteDataStore.h: 2019-12-03 Chris Dumez [iOS] Unable to interact with the view after a back swipe until lifting the finger off the screen https://bugs.webkit.org/show_bug.cgi?id=204821 Reviewed by Tim Horton. If you swipe back on iOS and then put your finger on the screen before the view gesture snapshot is taken down, your gestures will not be recognized, even after the snapshot is taken down, until after you lift your finger off the screen and back on. This makes MobileSafari look more unresponsive than it needs to be. To address the issue, disable user interactions for the snapshot view, so that interactions go through to the actual view underneath. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): 2019-12-03 Chris Dumez Use a 3 second timeout for the view gesture snapshot on macOS https://bugs.webkit.org/show_bug.cgi?id=204818 Reviewed by Tim Horton. Use a 3 second timeout for the view gesture snapshot on macOS, for consistency with iOS. It used to be 5 seconds on macOS. * UIProcess/ViewGestureController.cpp: 2019-12-03 Chris Dumez REGRESSION (r252778): ASSERT(!m_networkLoad); in ~SpeculativeLoad() https://bugs.webkit.org/show_bug.cgi?id=204813 Reviewed by Antti Koivisto. After r252778, SpeculativeLoadManager::revalidateSubresource() may delay the revalidation until we receive the response for the main resource. We can hit the assertion in the SpeculativeLoad destructor if a speculative revalidation for the SAME resource gets scheduled while we're waiting for the main resource response. When we eventually receive the main resource response, we would call revalidateSubresource() again, which would create a SpeculativeLoad and try to add it to m_pendingPreloads. Because m_pendingPreloads would already contain a preload for this same resource, the SpeculativeLoad would not get added to the map and it would get destroyed right away, before completing (thus hitting the assert). This unnecessary creation of the SpeculativeLoad is inefficient and it is thus best to avoid it. To address the issue, when we receive the response, we now make sure that m_pendingPreloads does not already contain a preload for this resource before calling revalidateSubresource() again, similarly to what was already done at the beginning of SpeculativeLoadManager::preloadEntry(). No new tests, unknown how to reproduce. * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::SpeculativeLoadManager::revalidateSubresource): 2019-12-03 Eric Carlson Add a runtime setting for media in the GPU process https://bugs.webkit.org/show_bug.cgi?id=204801 Reviewed by Jer Noble. * Shared/WebPreferences.yaml: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 2019-12-03 Per Arne Vollan Unreviewed assertion fix for older macOS versions after r253011. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest): * UIProcess/UserMediaPermissionRequestManagerProxy.h: 2019-12-03 Antoine Quint [Web Animations] Add a runtime flag for Web Animations composite operations https://bugs.webkit.org/show_bug.cgi?id=204718 Reviewed by Dean Jackson. * Shared/WebPreferences.yaml: 2019-12-03 Youenn Fablet UserMediaCaptureManager should have independent capture factories https://bugs.webkit.org/show_bug.cgi?id=204786 Reviewed by Eric Carlson. Refactor the code to make UserMediaCaptureManager have 3 different factories. This allows having 3 potential active sources which are used on iOS. We cannot test right now on iOS as audio capture in UIProcess is not yet ready. * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::Source): (WebKit::UserMediaCaptureManager::Source::~Source): (WebKit::UserMediaCaptureManager::UserMediaCaptureManager): (WebKit::UserMediaCaptureManager::~UserMediaCaptureManager): (WebKit::UserMediaCaptureManager::initialize): (WebKit::UserMediaCaptureManager::createCaptureSource): (WebKit::UserMediaCaptureManager::AudioFactory::setAudioCapturePageState): (WebKit::UserMediaCaptureManager::VideoFactory::setVideoCapturePageState): (WebKit::UserMediaCaptureManager::setAudioCapturePageState): Deleted. (WebKit::UserMediaCaptureManager::setVideoCapturePageState): Deleted. * WebProcess/cocoa/UserMediaCaptureManager.h: (WebKit::UserMediaCaptureManager::AudioFactory::AudioFactory): (WebKit::UserMediaCaptureManager::VideoFactory::VideoFactory): (WebKit::UserMediaCaptureManager::DisplayFactory::DisplayFactory): 2019-12-03 Chris Dumez PageConfiguration::pluginClient should use a smart pointer https://bugs.webkit.org/show_bug.cgi?id=204780 Reviewed by Anders Carlsson. * WebProcess/WebCoreSupport/WebPlugInClient.cpp: * WebProcess/WebCoreSupport/WebPlugInClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_overriddenMediaType): 2019-12-03 Chris Dumez PageConfiguration::alternativeTextClient should use a smart pointer https://bugs.webkit.org/show_bug.cgi?id=204777 Reviewed by Anders Carlsson. * WebProcess/WebCoreSupport/WebAlternativeTextClient.h: * WebProcess/WebCoreSupport/mac/WebAlternativeTextClient.cpp: (WebKit::WebAlternativeTextClient::pageDestroyed): Deleted. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_overriddenMediaType): 2019-12-03 Kate Cheney Activate the SQLite database as an on-by-default feature https://bugs.webkit.org/show_bug.cgi?id=204774 Reviewed by Brent Fulgham. The flag to use the ITP Database backend should be set to true by default. * Shared/WebPreferences.yaml: 2019-12-03 youenn fablet Add support for camera rotation when capturing in UIProcess https://bugs.webkit.org/show_bug.cgi?id=204750 Reviewed by Eric Carlson. Make UserMediaCaptureManagerProxy have an OrientationNotifier. It is updated by each web page of the web process being notified of a device orientation change. Whenever a rotation happens, UIProcess sources are now notified to correctly compute the frame rotations. Covered by existing tests. * UIProcess/API/C/WKPage.cpp: (WKPageSetMockCameraOrientation): * UIProcess/API/C/WKPagePrivate.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): (WebKit::UserMediaCaptureManagerProxy::setOrientation): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setOrientationForMediaCapture): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::userMediaCaptureManagerProxy): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::setDeviceOrientation): 2019-12-03 Antti Koivisto [LFC][Integration] Shorten feature flag name https://bugs.webkit.org/show_bug.cgi?id=204788 Reviewed by Sam Weinig. * Shared/WebPreferences.yaml: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 2019-12-03 youenn fablet Expose WKWebView API to stop ongoing capture https://bugs.webkit.org/show_bug.cgi?id=204787 Reviewed by Eric Carlson. Covered by API test. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _stopMediaCapture]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2019-12-03 youenn fablet [Cocoa] Run camera capture in UIProcess by default in layout tests https://bugs.webkit.org/show_bug.cgi?id=204512 Reviewed by Eric Carlson. * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::willCreateMediaStream): Do not send sandbox extensions in case capture happens in UIProcess. * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::~Source): (WebKit::UserMediaCaptureManager::createCaptureSource): Register/unregister sources as active/unactive sources to the factory. 2019-12-03 Carlos Garcia Campos WebDriver: handle elements of type file in send keys command https://bugs.webkit.org/show_bug.cgi?id=188514 Reviewed by Brian Burg. Add setFilesForInputFileUpload method to Automation. It's like setFilesToSelectForFileUpload, but it works differently, so I'm keeping both to not break safaridriver. The new one simply sends the file list to the web process to be set on the input element, instead of saving the file list, wait for the driver to trigger the open panel, intercept and complete the open panel request and send a dismiss open panel event to the driver. * UIProcess/Automation/Automation.json: Add setFilesForInputFileUpload. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::setFilesForInputFileUpload): Send SetFilesForInputFileUpload message to the web process. * UIProcess/Automation/WebAutomationSession.h: * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::setFilesForInputFileUpload): Create a FileList with the received paths and call HTMLInputElement::setFiles() on the given element. * WebProcess/Automation/WebAutomationSessionProxy.h: * WebProcess/Automation/WebAutomationSessionProxy.messages.in: Add SetFilesForInputFileUpload message. 2019-12-03 Carlos Garcia Campos WebDriver: most of the clear tests are failing https://bugs.webkit.org/show_bug.cgi?id=180404 Reviewed by Brian Burg. Update the FormElementClear atom to follow the spec. * UIProcess/Automation/atoms/FormElementClear.js: (isEditable): (isResettableElementEmpty): 2019-12-03 Carlos Garcia Campos [PSON] Tooltips from previous page shown on new page https://bugs.webkit.org/show_bug.cgi?id=204735 Reviewed by Chris Dumez. The problem is that WebPage (in the web process) is caching the tooltip text to avoid sending IPC messages when the tooltip didn't change. When a new web process is used for the same web view, the tooltip text doesn't really change (it's always null) until a new one is set. The setToolTip message is always sent right after the MouseDidMoveOverElement, and they both depend on the same hit test result, so we can include the tooltip text as part of the WebHitTestResultData struct passed to MouseDidMoveOverElement and remove the SetToolTip message. Since the UI process is already caching the tooltip, we can simply notify the page client when it changes. * Shared/WebHitTestResultData.cpp: (WebKit::WebHitTestResultData::WebHitTestResultData): Initialize toolTipText. (WebKit::WebHitTestResultData::encode const): Encode toolTipText. (WebKit::WebHitTestResultData::decode): Decode toolTipText. * Shared/WebHitTestResultData.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::mouseDidMoveOverElement): Call setToolTip() after notifying the UI client about the mouse move. (WebKit::WebPageProxy::setToolTip): Return early if tooltip didn't change. (WebKit::WebPageProxy::resetState): Use setToolTip() to ensure the page client is notified about the change. * UIProcess/WebPageProxy.messages.in: Remove SetToolTip message. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::mouseDidMoveOverElement): Pass tooltip text to WebHitTestResultData constructor. * WebProcess/WebCoreSupport/WebChromeClient.h: 2019-12-02 Sihui Liu Cross-thread version StorageQuotaManager https://bugs.webkit.org/show_bug.cgi?id=203971 Reviewed by Chris Dumez. * NetworkProcess/NetworkProcess.cpp: Introduce class SessionStorageQuotaManager to manage all StorageQuotaManagers of the same session. (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::addWebsiteDataStore): (WebKit::NetworkProcess::addSessionStorageQuotaManager): (WebKit::NetworkProcess::removeSessionStorageQuotaManager): (WebKit::NetworkProcess::destroySession): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): (WebKit::NetworkProcess::createIDBServer): (WebKit::NetworkProcess::addIndexedDatabaseSession): (WebKit::NetworkProcess::setSessionStorageQuotaManagerIDBRootPath): (WebKit::NetworkProcess::updateQuotaBasedOnSpaceUsageForTesting): (WebKit::NetworkProcess::resetQuota): (WebKit::NetworkProcess::storageQuotaManager): (WebKit::NetworkProcess::initializeStorageQuota): Deleted. (WebKit::NetworkProcess::clearStorageQuota): Deleted. (): Deleted. (WebKit::NetworkProcess::initializeQuotaUsers): Deleted. * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::SessionStorageQuotaManager::SessionStorageQuotaManager): (WebKit::NetworkProcess::SessionStorageQuotaManager::defaultQuota const): (WebKit::NetworkProcess::SessionStorageQuotaManager::ensureOriginStorageQuotaManager): (WebKit::NetworkProcess::SessionStorageQuotaManager::existingStorageQuotaManagers): (WebKit::NetworkProcess::SessionStorageQuotaManager::cacheRootPath const): (WebKit::NetworkProcess::SessionStorageQuotaManager::setIDBRootPath): (WebKit::NetworkProcess::SessionStorageQuotaManager::idbRootPath const): (WebKit::NetworkProcess::StorageQuotaManagers::defaultQuota const): Deleted. (WebKit::NetworkProcess::StorageQuotaManagers::setDefaultQuotas): Deleted. (WebKit::NetworkProcess::StorageQuotaManagers::managersPerOrigin): Deleted. * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::getDirectorySize): (WebKit::CacheStorage::Engine::diskUsage): static function to get the disk usage of CacheStorage given CacheStorage root directory. (WebKit::CacheStorage::Engine::requestSpace): (WebKit::CacheStorage::Engine::readCachesFromDisk): (WebKit::CacheStorage::Engine::writeSizeFile): (WebKit::CacheStorage::Engine::readSizeFile): (WebKit::CacheStorage::Engine::initializeQuotaUser): Deleted. * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::Cache::put): (WebKit::CacheStorage::Cache::remove): * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::create): (WebKit::CacheStorage::Caches::Caches): (WebKit::CacheStorage::Caches::~Caches): (WebKit::CacheStorage::Caches::updateSizeFile): (WebKit::CacheStorage::Caches::initializeSize): (WebKit::CacheStorage::Caches::clear): (WebKit::CacheStorage::Caches::requestSpace): (WebKit::CacheStorage::Caches::writeRecord): (WebKit::CacheStorage::Caches::removeRecord): (WebKit::CacheStorage::Caches::whenInitialized): Deleted. (WebKit::CacheStorage::Caches::resetSpaceUsed): Deleted. * NetworkProcess/cache/CacheStorageEngineCaches.h: * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::encode const): (WebKit::WebsiteDataStoreParameters::decode): * Shared/WebsiteDataStoreParameters.h: Add a cacheStorageDirectory parameter so we know the direcotry of CacheStorage when we start using WebsiteDataStore. * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreResetQuota): * UIProcess/API/C/WKWebsiteDataStoreRef.h: Add a C API for reseting quota in TestRunner. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::resetQuota): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::parameters): (WebKit::WebsiteDataStore::resetQuota): * UIProcess/WebsiteData/WebsiteDataStore.h: 2019-12-02 Per Arne Vollan [iOS] Create sandbox extension for "com.apple.tccd" https://bugs.webkit.org/show_bug.cgi?id=204367 Reviewed by Eric Carlson. When camera or microphone access has been granted by the user, have the UI process create a sandbox extension for "com.apple.tccd", and send it to the WebContent process. Also make sure the extension is created only once for each WebContent process. Add telemetry to the tccd rule in the sandbox. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest): * UIProcess/UserMediaPermissionRequestManagerProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::userMediaAccessWasGranted): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2019-12-02 Louie Livon-Bemel Add helper methods for description and equality to text manipulation SPI https://bugs.webkit.org/show_bug.cgi?id=204758 Reviewed by Wenson Hsieh. I originally added some category methods to _WKTextManipulationItem and _WKTextManipulationToken within Safari to make working with these classes easier. However it makes more sense to just move these methods into the main class. One method is for checking if two instances are equal (including identifiers) and optionally checking if the content itself is equal. The other methods are for debug descriptions for lldb, and a method to get a description that preserves privacy; when logging the instance, the content of the webpage should be redacted. Tests: Tests are added as API tests. * UIProcess/API/Cocoa/_WKTextManipulationItem.h: - Assume everything is non-null unless otherwise specified. - Allow the identifier to be nil, but not the array of tokens. - Add a method to check the equality to another item, optionally including a check for the content of each token being equal. - Add a -debugDescription method that includes the content of tokens for use in lldb. This NSObject declaration is marked optional, so redeclare it here. - No need to add a -description declaration since it exists on NSObject already. * UIProcess/API/Cocoa/_WKTextManipulationItem.mm: (-[_WKTextManipulationItem isEqual:]): The standard NSObject equality check should call our method with equal content. (-[_WKTextManipulationItem isEqualToTextManipulationItem:includingContentEquality:]): - If the other item is nil, the identifiers aren't equal or the number of tokens are mismatched, these items aren't equal. - Just to be safe, only iterate the smaller of the token arrays so we don't crash. - Check if each token is equal, passing along the `includingContentEquality` parameter. (-[_WKTextManipulationItem description]): The general description should not include the webpage content. (-[_WKTextManipulationItem debugDescription]): Include the webpage content, since this is for lldb. (-[_WKTextManipulationItem _descriptionPreservingPrivacy:]): Include the standard description format, and each token on its own line. If we're including the content then use `token.debugDescription`. * UIProcess/API/Cocoa/_WKTextManipulationToken.h: - Also assume everything is non-null. - Identifier and Content can be nil. - Declare a -debugDescription method. - Declare a method to check equality, with or without the content. * UIProcess/API/Cocoa/_WKTextManipulationToken.mm: (isEqualOrBothNil): Helper that checks equality but considers two nil values to be equal as well. (-[_WKTextManipulationToken isEqual:]): The standard NSObject equality check should call our method with equal content. (-[_WKTextManipulationToken isEqualToTextManipulationToken:includingContentEquality:]): Check that the exclusions are equal, the identifiers are equal (considering two nils to be equal), and the content if necessary. (-[_WKTextManipulationToken description]): (-[_WKTextManipulationToken debugDescription]): (-[_WKTextManipulationToken _descriptionPreservingPrivacy:]): If we're preserving privacy, log the content length rather than the content string itself. 2019-12-02 Wenson Hsieh [iOS] Introduce a gesture recognizer that can be used to defer recognition of other gestures https://bugs.webkit.org/show_bug.cgi?id=204748 Reviewed by Tim Horton. Introduces WKDeferringGestureRecognizer, which is similar to UIKit's _UIRelationshipGestureRecognizer. In a future patch, this will be added to WKContentView to prevent platform gestures (pinching, panning, single/double taps, etc.) from recognizing when dispatching a preventable touch event to the page. Additionally renames a member variable on WKContentView, in preparation for making touch gesture recognition asynchronous. No new tests, since there is no change in behavior yet. * SourcesCocoa.txt: Add the new file. * UIProcess/ios/WKContentViewInteraction.h: Add a couple of (currently unused) deferring gesture recognizers. These will be added to WKContentView in a future patch. There are two deferring gestures here (one for "immediately resettable" gestures and another for gestures for which the reset is "deferred" -- i.e., multi-tap gestures); this prevents a single deferring gesture from connecting the entire gesture subgraph under WKWebView through failure dependencies. This would result in various usability issues, such as being unable to perform a pan gesture to scroll WKScrollView if a tap was recognized within the last 300 ms, since all gestures would need to wait until every double and triple- tap gesture under WKWebView has failed. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView _webTouchEventsRecognized:]): Rename _canSendTouchEventsAsynchronously to _touchEventsCanPreventNativeGestures in preparation for adding a codepath for fully asynchronous touch event dispatch; we also flip the conditional in any places where _canSendTouchEventsAsynchronously was previously set or read. (-[WKContentView _webTouchEvent:preventsNativeGestures:]): (-[WKContentView scrollViewWillStartPanOrPinchGesture]): (-[WKContentView gestureRecognizer:shouldIgnoreWebTouchWithEvent:]): (-[WKContentView gestureRecognizer:isInterruptingMomentumScrollingWithEvent:]): (-[WKContentView deferringGestureRecognizer:shouldDeferGesturesWithEvent:]): (-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]): Implement WKDeferringGestureRecognizerDelegate. (-[WKContentView shouldIgnoreWebTouch]): Deleted. Drive-by fix: remove this unnecessary method implementation, and the related FIXME. * UIProcess/ios/WKDeferringGestureRecognizer.h: Added. * UIProcess/ios/WKDeferringGestureRecognizer.mm: Added. (-[WKDeferringGestureRecognizer initWithDeferringGestureDelegate:]): (-[WKDeferringGestureRecognizer deferringGestureDelegate]): (-[WKDeferringGestureRecognizer touchesBegan:withEvent:]): Unless the touch is interrupts momentum scrolling, WKDeferringGestureRecognizer should transition to Possible state when starting a touch. Later, -setDefaultPrevented: is invoked, which will either transition the deferring gesture recognizer to Failed state (thereby allowing native gestures to begin), or Ended state (preventing other native gestures). (-[WKDeferringGestureRecognizer touchesCancelled:withEvent:]): (-[WKDeferringGestureRecognizer setDefaultPrevented:]): (-[WKDeferringGestureRecognizer canBePreventedByGestureRecognizer:]): Return NO here to prevent certain platform gestures (e.g. scroll view panning) from causing the deferring gesture to Failed state, when these gestures attempt to transition from Possible to Began state. (-[WKDeferringGestureRecognizer shouldDeferGestureRecognizer:]): * WebKit.xcodeproj/project.pbxproj: 2019-12-02 Yoshiaki Jitsukawa ResponsivenessTimer mistakenly restarts immediately https://bugs.webkit.org/show_bug.cgi?id=204659 Reviewed by Chris Dumez. * UIProcess/ResponsivenessTimer.cpp: (WebKit::ResponsivenessTimer::timerFired): Give startOneShot() a positive number timeout. 2019-12-02 Carlos Garcia Campos [GTK][PSON] Crash in NetworkProcessProxy::openNetworkProcessConnection https://bugs.webkit.org/show_bug.cgi?id=204703 Reviewed by Michael Catanzaro. Stop sending a message to all web process to prefetch DNS for a hostname. All web processes then send a messaage to their network process to prefetch the DNS. Instead, send a message directly to the network process. * NetworkProcess/NetworkProcess.messages.in: * UIProcess/API/glib/WebKitWebContext.cpp: (webkit_web_context_prefetch_dns): * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp: 2019-12-01 Fujii Hironori [Win] Retrieve all following WM_CHAR events at the beginning of processing WM_KEYDOWN event https://bugs.webkit.org/show_bug.cgi?id=204694 Reviewed by Ross Kirsling. In Windows ports, WM_KEYDOWN dispatches keydown event, and WM_CHAR dispatches keypress event. If a keydown event is canceled by calling preventDefault, the following corresponding keypress events shouldn't be dispatched. WebKit1 implemented it by removing WM_CHAR events if the keydown event is consumed. However, WebKit2 can't do so because WebKit2 processes key events asynchronously. Thus, retrieve all following WM_CHAR events, and dispatch them after processing the keydown and if it is not consumed. In addition to that, retrieving following WM_CHAR events is needed to fix Bug 204672 because the events are needed for 'key' property of keydown KeyboardEvent for dead key combination. Gecko and Chromium also implements 'key' property in the same approach. Test: Covered by existing fast/events/inputText-never-fired-on-keydown-cancel.html and fast/events/keydown-keypress-preventDefault.html * Shared/NativeWebKeyboardEvent.h: Added m_pendingCharEvents as Vector. (WebKit::NativeWebKeyboardEvent::pendingCharEvents const): * Shared/win/NativeWebKeyboardEventWin.cpp: (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didReceiveEvent): * UIProcess/WebPageProxy.h: * UIProcess/win/WebPageProxyWin.cpp: (WebKit::WebPageProxy::dispatchPendingCharEvents): * UIProcess/win/WebView.cpp: (WebKit::WebView::onKeyEvent): 2019-11-30 Tim Horton Make CompositeOperator and BlendMode encodable https://bugs.webkit.org/show_bug.cgi?id=204722 Reviewed by Eric Carlson. * UIProcess/cairo/BackingStoreCairo.cpp: (WebKit::BackingStore::incorporateUpdate): * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::paint): (WebKit::PluginProxy::update): * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::drawRect): 2019-11-30 Tim Horton Reimplement some PlatformCALayer methods using GraphicsContext instead of CGContextRef https://bugs.webkit.org/show_bug.cgi?id=204698 Reviewed by Sam Weinig. * Shared/RemoteLayerTree/RemoteLayerBackingStore.h: * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::drawInContext): (WebKit::RemoteLayerBackingStore::enumerateRectsBeingDrawn): * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::enumerateRectsBeingDrawn): * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h: 2019-11-27 Antoine Quint [Web Animations] Enable WebAnimationsCSSIntegrationEnabled by default https://bugs.webkit.org/show_bug.cgi?id=204650 Reviewed by Dean Jackson. * Shared/WebPreferences.yaml: 2019-11-28 Fujii Hironori Remove ENABLE_KEYBOARD_CODE_ATTRIBUTE and ENABLE_KEYBOARD_KEY_ATTRIBUTE macros https://bugs.webkit.org/show_bug.cgi?id=204666 No behavior change. * Configurations/FeatureDefines.xcconfig: * Shared/WebEvent.h: (WebKit::WebKeyboardEvent::unmodifiedText const): (WebKit::WebKeyboardEvent::key const): (WebKit::WebKeyboardEvent::code const): * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent): * Shared/WebKeyboardEvent.cpp: (WebKit::WebKeyboardEvent::WebKeyboardEvent): (WebKit::WebKeyboardEvent::encode const): (WebKit::WebKeyboardEvent::decode): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::generateSyntheticEditingCommand): 2019-11-27 Philippe Normand [GTK][WebInspector] Use CString to store exported data https://bugs.webkit.org/show_bug.cgi?id=204623 Reviewed by Carlos Garcia Campos. * UIProcess/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::platformSave): Use a CString for copy-on-write assignment. 2019-11-27 Alejandro G. Castro Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.27.3 release * wpe/NEWS: Add release notes for 2.27.3. 2019-11-27 Carlos Garcia Campos [GTK] WebDriver: moving toplevel windows is not supported under wayland https://bugs.webkit.org/show_bug.cgi?id=204614 Reviewed by Alejandro G. Castro. So we can stop trying and simply ignore the requests to move the window. * UIProcess/API/glib/WebKitUIClient.cpp: (UIClient::windowConfigureEventCallback): Ensure we only move or resize when actually required and reduce the time we wait for configure events to 200ms (1 second was too long). 2019-11-26 Antti Koivisto [LFC][Render tree] Add LFC line layout path to RenderBlockFlow https://bugs.webkit.org/show_bug.cgi?id=204613 Reviewed by Zalan Bujtas. * Shared/WebPreferences.yaml: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 2019-11-26 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.27.3 release * gtk/NEWS: Add release notes for 2.27.3. 2019-11-26 Carlos Garcia Campos REGRESSION(2.27.2): [GTK] Incognito mode is broken under flatpak https://bugs.webkit.org/show_bug.cgi?id=203460 Reviewed by Youenn Fablet. The problem is that in ephemeral sessions the base disk cache directory is null, and Storage::open() ends up building a cache path with only the version part (/Version n). For some reason g_mkdir_with_parents() doesn't return -1 in flatpak when it fails to create the directory due to write permission, like in this case. But the network process ends up crashing later trying to open a directory that doesn't exist. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::NetworkSession): Do not create the cache if networkCacheDirectory is null. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::open): Add an ASSERT to ensure we don't receive a null baseCachePath. 2019-11-25 Yusuke Suzuki [JSC] InternalFunction should be non-destructible https://bugs.webkit.org/show_bug.cgi?id=204556 Reviewed by Mark Lam. * WebProcess/Plugins/Netscape/JSNPMethod.cpp: (WebKit::JSNPMethod::subspaceForImpl): 2019-11-25 Wenson Hsieh [macOS] Dragged images are only available as .tiff when dropping onto macCatalyst apps https://bugs.webkit.org/show_bug.cgi?id=204598 Reviewed by Tim Horton. On macOS, writing dragged images to the pasteboard only as file promises is mostly sufficient for the purposes of dropping into Finder, Photos, and other apps. However, when dropping into a macCatalyst app, the contents of NSPasteboard will only contain a file URL, which most Catalyst apps aren't able to handle. The only other valid image representation that is written to the pasteboard in this case is "public.tiff", which loses fidelity in the case of animated GIFs. Instead, if the dragged image has a corresponding UTI and corresponding decoded image data, declare the UTI when writing promised data to the pasteboard, and later provide data for the UTI, if the drop destination asks, by using the promised image's data. Test: DragAndDropTests.ProvideImageDataAsTypeIdentifiers * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setPromisedDataForImage): (WebKit::WebViewImpl::provideDataForPasteboard): 2019-11-25 Fujii Hironori [Win] Update KeyboardEvent as per the latest specification https://bugs.webkit.org/show_bug.cgi?id=202183 Reviewed by Ross Kirsling. * Shared/WebEvent.h: * Shared/WebKeyboardEvent.cpp: (WebKit::WebKeyboardEvent::WebKeyboardEvent): * Shared/win/WebEventFactory.cpp: (WebKit::windowsKeyNames): (WebKit::WebEventFactory::createWebKeyboardEvent): 2019-11-25 ChangSeok Oh [GTK] Check EGL image extension by using native gl API in AcceleratedBackingStoreWayland https://bugs.webkit.org/show_bug.cgi?id=204446 Reviewed by Carlos Garcia Campos. This change is part of efforts bringing ANGLE backend for WebGL to the gtk port. When ANGLE WebGL is enabled, we face a dilemma of choosing either Extensions3DANGLE or Extensions3DOpenGL in AcceleratedBackingStoreWayland.cpp. Since they cannot coexist, we chose Extensions3DANGLE even if what we really want is Extensions3DOepnGL. We address this problem by directly checking egl image extension availability via native GL API rather than relying on Extensions3D* classes in the file. * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp: (WebKit::isEGLImageAvailable): (WebKit::AcceleratedBackingStoreWayland::checkRequirements): 2019-11-25 Youenn Fablet Crash in WebCore::ServiceWorkerRegistrationKey::hash() const https://bugs.webkit.org/show_bug.cgi?id=204497 Reviewed by Alex Christensen. * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::scheduleJobInServer): Add a release assert to be able to further debug the crash. 2019-11-23 John Wilander Resource Load Statistics: Allow multiple third-party cookie blocking settings https://bugs.webkit.org/show_bug.cgi?id=204389 Reviewed by Brent Fulgham. This change make the third-party cookie blocking setting go from a boolean to the new enum WebCore::ThirdPartyCookieBlockingMode with three different settings. Functions and member variables are renamed accordingly. The reason for supporting three different modes is that what is now named OnlyAccordingToPerDomainPolicy is shipping, AllOnSitesWithoutUserInteraction is in beta, and All is behind an experimental flag. The change also updates the test API to map the TestRunner call to the enum. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess): (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess): (WebKit::ResourceLoadStatisticsDatabaseStore::clearUserInteraction): Now makes use of a completion handler and updates the cookie blocking state. (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction): (WebKit::ResourceLoadStatisticsDatabaseStore::areAllThirdPartyCookiesBlockedUnder): New convenience function to check the cookie blocking status per first-party domain. (WebKit::ResourceLoadStatisticsDatabaseStore::cookieAccess): Restructured the code to make it very clear that the logic is the same as the corresponding function in ResourceLoadStatisticsMemoryStore. Can no longer be const since it calls areAllThirdPartyCookiesBlockedUnder() which in turn calls hasHadUserInteraction() and that function may clear user interaction data. (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUnexpiredRecentUserInteraction): (WebKit::ResourceLoadStatisticsDatabaseStore::cookieAccess const): Deleted. See comment above on the non-const version of this function. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: (WebKit::ResourceLoadStatisticsMemoryStore::areAllThirdPartyCookiesBlockedUnder): New convenience function to check the cookie blocking status per first-party domain. (WebKit::ResourceLoadStatisticsMemoryStore::cookieAccess): Restructured the code to make it very clear that the logic is the same as the corresponding function in ResourceLoadStatisticsDatabaseStore. Can no longer be const since it calls areAllThirdPartyCookiesBlockedUnder() which in turn calls hasHadUserInteraction() and that function may clear user interaction data. (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess): (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess): (WebKit::ResourceLoadStatisticsMemoryStore::clearUserInteraction): Now makes use of a completion handler and updates the cookie blocking state. (WebKit::ResourceLoadStatisticsMemoryStore::cookieAccess const): Deleted. See comment above on the non-const version of this function. * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: (WebKit::ResourceLoadStatisticsStore::setThirdPartyCookieBlockingMode): (WebKit::ResourceLoadStatisticsStore::thirdPartyCookieBlockingMode const): (WebKit::ResourceLoadStatisticsStore::setIsThirdPartyCookieBlockingEnabled): Deleted. (WebKit::ResourceLoadStatisticsStore::isThirdPartyCookieBlockingEnabled const): Deleted. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::setThirdPartyCookieBlockingMode): (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction): Now forwards the completion handler. (WebKit::WebResourceLoadStatisticsStore::setIsThirdPartyCookieBlockingEnabled): Deleted. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::setShouldBlockThirdPartyCookiesForTesting): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: The SetShouldBlockThirdPartyCookiesForTesting message now uses an enum instead of a boolean. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::setResourceLoadStatisticsEnabled): Now forwards the enum value instead of a boolean. (WebKit::NetworkSession::recreateResourceLoadStatisticStore): Now makes sure the cookie blocking setting is forwarded to the recreated store. (WebKit::NetworkSession::setThirdPartyCookieBlockingMode): (WebKit::NetworkSession::setIsThirdPartyCookieBlockingEnabled): Deleted. * NetworkProcess/NetworkSession.h: * NetworkProcess/NetworkSessionCreationParameters.cpp: (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): Support for the new enum. * NetworkProcess/NetworkSessionCreationParameters.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * Scripts/webkit/messages.py: Tells the IPC code generator where to find WebCore::ThirdPartyCookieBlockingMode. * Shared/WebPreferences.yaml: Flipped the IsThirdPartyCookieBlockingEnabled flag to on by default. * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetResourceLoadStatisticsShouldBlockThirdPartyCookiesForTesting): (WKWebsiteDataStoreStatisticsResetToConsistentState): * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::setShouldBlockThirdPartyCookiesForTesting): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): Makes use of the enum in the NetworkSessionCreationParameters. * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::setResourceLoadStatisticsShouldBlockThirdPartyCookiesForTesting): * UIProcess/WebsiteData/WebsiteDataStore.h: 2019-11-23 Commit Queue Unreviewed, rolling out r252805. https://bugs.webkit.org/show_bug.cgi?id=204553 Caused test failures and ASan crashes (Requested by ap on #webkit). Reverted changeset: "Cross-thread version StorageQuotaManager" https://bugs.webkit.org/show_bug.cgi?id=203971 https://trac.webkit.org/changeset/252805 2019-11-22 Alex Christensen Unreviewed, rolling out r252796. Turns out my reverting earlier today wasn't so necessary after all. This is effectively re-landing r250422. Reverted changeset: "Revert r250422" https://bugs.webkit.org/show_bug.cgi?id=202285 https://trac.webkit.org/changeset/252796 2019-11-22 Alex Christensen Unreviewed, rolling out r252798. Turns out my reverting earlier today wasn't so necessary after all. This is effectively re-landing r250421. Reverted changeset: "Revert r250421" https://bugs.webkit.org/show_bug.cgi?id=202290 https://trac.webkit.org/changeset/252798 2019-11-22 Kate Cheney ITP Database crashes if table schema is not correct https://bugs.webkit.org/show_bug.cgi?id=204458 Reviewed by Brent Fulgham. ITP database was crashing if the table schema wasn't correct. This should instead be handled by re-opening a new database with a correct schema to allow for future schema updates. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::isCorrectTableSchema): (WebKit::ResourceLoadStatisticsDatabaseStore::openAndDropOldDatabaseIfNecessary): * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: 2019-11-22 Chris Dumez Simplify VisitedLinkStore process registration logic https://bugs.webkit.org/show_bug.cgi?id=204472 Reviewed by Geoffrey Garen. Simplify VisitedLinkStore process registration logic: 1. WebProcessProxy objects no longer delay their registration with the VisitedLinkStore until after they are done launching. There is no need to do this because AuxiliaxyProcessProxy::send() will correctly queue the IPC message if the process is not done launching when the VisitedLinkStore tries to send its IPC. 2. Switch VisitedLinkStore to using a WeakHashSet to store the WebProcessProxy object pointers. This is safer and this also makes it so that the WebProcessProxy no longer need to unregister themselves when shutting down. Note that AuxiliaxyProcessProxy::send() properly discards IPC messages to a terminated process anyway. * UIProcess/VisitedLinkStore.cpp: (WebKit::VisitedLinkStore::~VisitedLinkStore): (WebKit::VisitedLinkStore::addProcess): (WebKit::VisitedLinkStore::removeProcess): (WebKit::VisitedLinkStore::removeAll): (WebKit::VisitedLinkStore::didInvalidateSharedMemory): (WebKit::VisitedLinkStore::didUpdateSharedStringHashes): * UIProcess/VisitedLinkStore.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::shutDown): (WebKit::WebProcessProxy::addVisitedLinkStoreUser): (WebKit::WebProcessProxy::didFinishLaunching): 2019-11-22 Chris Dumez [iOS] Copy assertions before iterating over them in _notifyAssertionsOfImminentSuspension https://bugs.webkit.org/show_bug.cgi?id=204524 Reviewed by Alexey Proskuryakov. Copy assertions before iterating over them in _notifyAssertionsOfImminentSuspension and use WeakPtr to make sure the assertions are still alive before calling uiAssertionWillExpireImminently() on them. It is common for process assertions to get released when uiAssertionWillExpireImminently() gets called, which would remove them from the _assertionsNeedingBackgroundTask vector we were iterating on. * UIProcess/ios/ProcessAssertionIOS.mm: (-[WKProcessAssertionBackgroundTaskManager _notifyAssertionsOfImminentSuspension]): 2019-11-22 Alex Christensen Null check callback in NetworkConnectionToWebProcess::didDeliverMessagePortMessages https://bugs.webkit.org/show_bug.cgi?id=204460 Reviewed by Chris Dumez. When the network process crashes during a message port connection establishment, a web process may have an identifier that becomes stale. In this case, we should not crash again. No test because this only happens during a rare race condition after a network process crash, but the radar shows records of this happening. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didDeliverMessagePortMessages): 2019-11-22 Sihui Liu Cross-thread version StorageQuotaManager https://bugs.webkit.org/show_bug.cgi?id=203971 Reviewed by Chris Dumez. * NetworkProcess/NetworkProcess.cpp: Introduce class SessionStorageQuotaManager to manage all StorageQuotaManagers of the same session. (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::addWebsiteDataStore): (WebKit::NetworkProcess::addSessionStorageQuotaManager): (WebKit::NetworkProcess::removeSessionStorageQuotaManager): (WebKit::NetworkProcess::destroySession): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): (WebKit::NetworkProcess::createIDBServer): (WebKit::NetworkProcess::addIndexedDatabaseSession): (WebKit::NetworkProcess::setSessionStorageQuotaManagerIDBRootPath): (WebKit::NetworkProcess::updateQuotaBasedOnSpaceUsageForTesting): (WebKit::NetworkProcess::resetQuota): (WebKit::NetworkProcess::storageQuotaManager): (WebKit::NetworkProcess::initializeStorageQuota): Deleted. (WebKit::NetworkProcess::clearStorageQuota): Deleted. (): Deleted. (WebKit::NetworkProcess::initializeQuotaUsers): Deleted. * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::SessionStorageQuotaManager::SessionStorageQuotaManager): (WebKit::NetworkProcess::SessionStorageQuotaManager::defaultQuota const): (WebKit::NetworkProcess::SessionStorageQuotaManager::ensureOriginStorageQuotaManager): (WebKit::NetworkProcess::SessionStorageQuotaManager::existingStorageQuotaManagers): (WebKit::NetworkProcess::SessionStorageQuotaManager::cacheRootPath const): (WebKit::NetworkProcess::SessionStorageQuotaManager::setIDBRootPath): (WebKit::NetworkProcess::SessionStorageQuotaManager::idbRootPath const): (WebKit::NetworkProcess::StorageQuotaManagers::defaultQuota const): Deleted. (WebKit::NetworkProcess::StorageQuotaManagers::setDefaultQuotas): Deleted. (WebKit::NetworkProcess::StorageQuotaManagers::managersPerOrigin): Deleted. * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::getDirectorySize): (WebKit::CacheStorage::Engine::diskUsage): static function to get the disk usage of CacheStorage given CacheStorage root directory. (WebKit::CacheStorage::Engine::requestSpace): (WebKit::CacheStorage::Engine::readCachesFromDisk): (WebKit::CacheStorage::Engine::writeSizeFile): (WebKit::CacheStorage::Engine::readSizeFile): (WebKit::CacheStorage::Engine::initializeQuotaUser): Deleted. * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::Cache::put): (WebKit::CacheStorage::Cache::remove): * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::create): (WebKit::CacheStorage::Caches::Caches): (WebKit::CacheStorage::Caches::~Caches): (WebKit::CacheStorage::Caches::updateSizeFile): (WebKit::CacheStorage::Caches::initializeSize): (WebKit::CacheStorage::Caches::clear): (WebKit::CacheStorage::Caches::requestSpace): (WebKit::CacheStorage::Caches::writeRecord): (WebKit::CacheStorage::Caches::removeRecord): (WebKit::CacheStorage::Caches::whenInitialized): Deleted. (WebKit::CacheStorage::Caches::resetSpaceUsed): Deleted. * NetworkProcess/cache/CacheStorageEngineCaches.h: * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::encode const): (WebKit::WebsiteDataStoreParameters::decode): * Shared/WebsiteDataStoreParameters.h: Add a cacheStorageDirectory parameter so we know the direcotry of CacheStorage when we start using WebsiteDataStore. * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreResetQuota): * UIProcess/API/C/WKWebsiteDataStoreRef.h: Add a C API for reseting quota in TestRunner. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::resetQuota): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::parameters): (WebKit::WebsiteDataStore::resetQuota): * UIProcess/WebsiteData/WebsiteDataStore.h: 2019-11-22 Alex Christensen Revert r250421 https://bugs.webkit.org/show_bug.cgi?id=202290 This is needed for rdar://problem/56760896 I left the soup parts of the original change untouched, which leaves speculative validation on for soup ports. * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/C/WKContext.cpp: (WKContextSetDiskCacheSpeculativeValidationEnabled): * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration diskCacheSpeculativeValidationEnabled]): (-[_WKProcessPoolConfiguration setDiskCacheSpeculativeValidationEnabled:]): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): 2019-11-22 Alex Christensen Revert r250422 https://bugs.webkit.org/show_bug.cgi?id=202285 This is needed for rdar://problem/56760896 * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::setCanHandleHTTPSServerTrustEvaluation): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::canHandleHTTPSServerTrustEvaluation const): * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): * UIProcess/API/C/WKContext.cpp: (WKContextSetCanHandleHTTPSServerTrustEvaluation): * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _setCanHandleHTTPSServerTrustEvaluation:]): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::setCanHandleHTTPSServerTrustEvaluation): * UIProcess/WebProcessPool.h: 2019-11-22 Conrad Shultz Remove -[_WKThumbnailView usesSnapshot/setUsesSnapshot:] https://bugs.webkit.org/show_bug.cgi?id=150099 Reviewed by Tim Horton. Remove some unused, no-op SPI. While we're here, remove a couple unneeded explicit property syntheses. * UIProcess/API/Cocoa/_WKThumbnailView.h: * UIProcess/API/Cocoa/_WKThumbnailView.mm: (-[_WKThumbnailView setUsesSnapshot:]): Deleted. (-[_WKThumbnailView usesSnapshot]): Deleted. 2019-11-22 Chris Dumez Speculative loading sometimes happens too early and is missing login cookies https://bugs.webkit.org/show_bug.cgi?id=204305 Reviewed by Antti Koivisto. Speculative loads were issued before receiving the response from the main resource. However, the main resource may set important cookies that are thus missing from the speculative requests. To address the issue we now delay speculative loads for first-party subresources until we've received the response from the main resource. To avoid regressing PLT, we still warm up the first-party subresources from disk right away and preconnect to the server. No new tests, extended existing test. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didReceiveResponse): (WebKit::NetworkResourceLoader::didReceiveMainResourceResponse): (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::didReceiveMainResourceResponse const): (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::markMainResourceResponseAsReceived): (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::addPostMainResourceResponseTask): (WebKit::NetworkCache::SpeculativeLoadManager::shouldRegisterLoad): (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad): (WebKit::NetworkCache::SpeculativeLoadManager::registerMainResourceLoadResponse): (WebKit::NetworkCache::SpeculativeLoadManager::preconnectForSubresource): (WebKit::NetworkCache::SpeculativeLoadManager::revalidateSubresource): * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h: * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp: (WebKit::NetworkCache::SubresourceInfo::isFirstParty const): * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h: 2019-11-22 Carlos Garcia Campos [GTK][WPE] RemoteInspector: use sockets instead of DBus https://bugs.webkit.org/show_bug.cgi?id=204503 Reviewed by Žan Doberšek. Use GSockets API instead of DBus. * Platform/IPC/Connection.h: * SourcesGTK.txt: Remove GSocketMonitor that has been moved to WTF. * SourcesWPE.txt: Ditto. * UIProcess/glib/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::RemoteInspectorClient): (WebKit::RemoteInspectorClient::~RemoteInspectorClient): (WebKit::RemoteInspectorClient::setupConnection): (WebKit::RemoteInspectorClient::connectionDidClose): (WebKit::RemoteInspectorClient::inspect): (WebKit::RemoteInspectorClient::sendMessageToBackend): (WebKit::RemoteInspectorClient::closeFromFrontend): * UIProcess/glib/RemoteInspectorClient.h: 2019-11-21 Jer Noble Experimental support for HDR media query https://bugs.webkit.org/show_bug.cgi?id=204422 Reviewed by Eric Carlson. Notify the WebContent process of updated screen properties when the screen's color space changes. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (-[WKWindowVisibilityObserver startObserving:]): (-[WKWindowVisibilityObserver stopObserving:]): (-[WKWindowVisibilityObserver _screenDidChangeColorSpace:]): (WebKit::WebViewImpl::screenDidChangeColorSpace): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::screenPropertiesDidChange): * WebProcess/WebPage/WebPage.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::setScreenProperties): 2019-11-21 Brian Burg Unreviewed, sort WebKit's project file after changes in r252702 and r252637. * WebKit.xcodeproj/project.pbxproj: 2019-11-21 Sihui Liu Crash in com.apple.WebKit.WebContent at WebKit: WebKit::StorageAreaMap::loadValuesIfNeeded https://bugs.webkit.org/show_bug.cgi?id=204459 Reviewed by Geoffrey Garen. If m_storageMapID can be null if connect() fails. * WebProcess/WebStorage/StorageAreaMap.cpp: (WebKit::StorageAreaMap::setItem): (WebKit::StorageAreaMap::removeItem): (WebKit::StorageAreaMap::clear): (WebKit::StorageAreaMap::loadValuesIfNeeded): 2019-11-21 Peng Liu Ignore the requests to enter/exit video fullscreen/picture-in-picture if the requesting mode is the same as the current mode https://bugs.webkit.org/show_bug.cgi?id=204461 Reviewed by Jer Noble. In enterVideoFullscreenForVideoElement() and exitVideoFullscreenForVideoElement(), we can ignore the request if the targeting mode is the same as the current one. * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement): (WebKit::VideoFullscreenManager::exitVideoFullscreenForVideoElement): 2019-11-20 ChangSeok Oh [GTK] Add ANGLE backend to GTK port https://bugs.webkit.org/show_bug.cgi?id=199060 Reviewed by Žan Doberšek. * UIProcess/API/glib/WebKitProtocolHandler.cpp: Extention3DANGLE is used instead where ANGLE for WebGL is enabled. * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp: Append gl extensions for ANGLE. (WebKit::AcceleratedBackingStoreWayland::checkRequirements): 2019-11-20 Chris Dumez [iOS] Make sure WebContent process does not get suspended while it is holding a process assertion for the UIProcess https://bugs.webkit.org/show_bug.cgi?id=204418 Reviewed by Jer Noble. Make sure WebContent process does not get suspended while it is holding a process assertion for the UIProcess. We see this happening in sysdiagnoses, and it means the system ends up killing the WebContent process because it leaked a process assertion. * WebProcess/WebProcess.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::processTaskStateDidChange): (WebKit::WebProcess::releaseProcessWasResumedAssertions): 2019-11-19 Brian Burg [Cocoa] Add _WKRemoteWebInspectorViewController SPI to set diagnostic logging delegate https://bugs.webkit.org/show_bug.cgi?id=204371 Reviewed by Devin Rousso. * UIProcess/WebInspectorProxy.h: * UIProcess/RemoteWebInspectorProxy.h: * UIProcess/RemoteWebInspectorProxy.cpp: (WebKit::RemoteWebInspectorProxy::setDiagnosticLoggingAvailable): Hook up the plumbing to forward this state change to the frontend. * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewControllerPrivate.h: Added. * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm: (-[_WKRemoteWebInspectorViewController _setDiagnosticLoggingDelegate:]): Add new SPI to set the diagnostic logging delegate. This is preferable to directly setting the delegate on the inspector WKWebView (via .webView._diagnosticLoggingDelegate), because the controller can notify the frontend that diagnostic logging is now available. * WebKit.xcodeproj/project.pbxproj: Add new header file and make it private. * WebProcess/WebPage/WebInspectorUI.h: * WebProcess/WebPage/WebInspectorUI.cpp: (WebKit::WebInspectorUI::setDiagnosticLoggingAvailable): Cache this value and use it for InspectorFrontendClient::diagnosticLoggingAvailable(). * WebProcess/WebPage/RemoteWebInspectorUI.messages.in: * WebProcess/WebPage/RemoteWebInspectorUI.h: * WebProcess/WebPage/RemoteWebInspectorUI.cpp: (WebKit::RemoteWebInspectorUI::setDiagnosticLoggingAvailable): Duplicate what is done for the local case. 2019-11-20 Jer Noble HTML5 audio .ended event not fired when app in background or phone screen is off https://bugs.webkit.org/show_bug.cgi?id=173332 Reviewed by Eric Carlson. When a WebPage goes from audible to inaudible, allow a short grace period before removing the activity token, to give the page a chance to (e.g.) move to the next item in a playlist before the process is suspended when in the background. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::close): (WebKit::WebPageProxy::updateThrottleState): (WebKit::WebPageProxy::clearAudibleActivity): * UIProcess/WebPageProxy.h: 2019-11-19 Chris Dumez Unreviewed, fix webkitpy failures after r252655. * Scripts/webkit/LegacyMessageReceiver-expected.cpp: (WebKit::WebPage::didReceiveWebPageMessage): (WebKit::WebPage::didReceiveSyncWebPageMessage): * Scripts/webkit/MessageReceiver-expected.cpp: (WebKit::WebPage::didReceiveMessage): (WebKit::WebPage::didReceiveSyncMessage): * Scripts/webkit/MessageReceiverSuperclass-expected.cpp: (WebKit::WebPage::didReceiveMessage): (WebKit::WebPage::didReceiveSyncMessage): 2019-11-19 Chris Dumez Unreviewed mac catalyst build fix after r252655. * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.messages.in: 2019-11-19 Ross Kirsling Unreviewed non-unified build fixes. * WebProcess/WebPage/FindController.cpp: * WebProcess/WebPage/FindController.h: 2019-11-19 Chris Dumez Protect MessageReceivers when possible while they are processing incoming IPC messages https://bugs.webkit.org/show_bug.cgi?id=204377 Reviewed by Brady Eidson. Protect MessageReceiver while they are processing incoming IPC messages for extra safety. It is a common mistake to call client delegates as a result of an IPC, and failing to protect |this| while doing so. Client code can destroy |this| and we end up crashing. For MessageReceivers that are not RefCounted, they can use the "NotRefCounted" attribute in their messages.in file to opt out. * NetworkProcess/Cookies/WebCookieManager.messages.in: * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.messages.in: * NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in: * NetworkProcess/NetworkContentRuleListManager.messages.in: * NetworkProcess/NetworkSocketChannel.messages.in: * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.messages.in: * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: * NetworkProcess/webrtc/NetworkMDNSRegister.messages.in: * NetworkProcess/webrtc/NetworkRTCMonitor.messages.in: * NetworkProcess/webrtc/NetworkRTCSocket.messages.in: * PluginProcess/PluginControllerProxy.messages.in: * PluginProcess/PluginProcess.messages.in: * Scripts/webkit/messages.py: * Shared/API/Cocoa/RemoteObjectRegistry.messages.in: * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: * Shared/Authentication/AuthenticationManager.messages.in: * Shared/AuxiliaryProcess.messages.in: * Shared/Plugins/NPObjectMessageReceiver.messages.in: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: * UIProcess/DrawingAreaProxy.messages.in: * UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.messages.in: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in: * UIProcess/ViewGestureController.messages.in: * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in: * UIProcess/WebFullScreenManagerProxy.messages.in: * UIProcess/WebPasteboardProxy.messages.in: * UIProcess/ios/SmartMagnificationController.messages.in: * WebProcess/ApplePay/WebPaymentCoordinator.messages.in: * WebProcess/Automation/WebAutomationSessionProxy.messages.in: * WebProcess/Geolocation/WebGeolocationManager.messages.in: * WebProcess/Network/webrtc/WebMDNSRegister.messages.in: * WebProcess/Network/webrtc/WebRTCMonitor.messages.in: * WebProcess/Network/webrtc/WebRTCResolver.messages.in: * WebProcess/Network/webrtc/WebRTCSocket.messages.in: * WebProcess/Notifications/WebNotificationManager.messages.in: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: * WebProcess/WebPage/DrawingArea.messages.in: * WebProcess/WebPage/ViewGestureGeometryCollector.messages.in: * WebProcess/WebProcess.messages.in: * WebProcess/cocoa/UserMediaCaptureManager.messages.in: 2019-11-19 Per Arne Vollan [iOS] Fix sysctl-read sandbox violation https://bugs.webkit.org/show_bug.cgi?id=204358 Reviewed by Brent Fulgham. The WebContent sandbox should allow sysctl-read of "kern.hostname", "kern.osrelease", and "kern.version". * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-11-19 John Wilander Resource Load Statistics: Count third-party script loads under top frame https://bugs.webkit.org/show_bug.cgi?id=204262 Reviewed by Alex Christensen. Third-party scripts running in the first-party context are a significant privacy and security risk. This change captures the number of such script loads which will allow ITP to take action. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore): (WebKit::ResourceLoadStatisticsDatabaseStore::createUniqueIndices): (WebKit::ResourceLoadStatisticsDatabaseStore::createSchema): (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements): (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships): (WebKit::ResourceLoadStatisticsDatabaseStore::getSubStatisticStatement): Addition of the new category TopFrameLoadedThirdPartyScripts. (WebKit::ResourceLoadStatisticsDatabaseStore::resourceToString): Removed the lastSeen output since it may differ between test runs. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: Bumped statisticsModelVersion to 17. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Encoding and decoding of the new category topFrameLoadedThirdPartyScripts. * WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp: (WebKit::WebResourceLoadObserver::logSubresourceLoading): Now takes an additional enum parameter FetchDestinationIsScriptLike which is used to detect third-party script-like loads (script, worker, or service worker) from third-parties. If one is detected, it is stored in the new topFrameLoadedThirdPartyScripts category. * WebProcess/WebCoreSupport/WebResourceLoadObserver.h: 2019-11-19 Brian Burg [Cocoa] Add _WKInspector SPI to set diagnostic logging delegate for a local Web Inspector https://bugs.webkit.org/show_bug.cgi?id=204323 Reviewed by Devin Rousso. Testing this end-to-end isn't quite possible yet because WebInspectorUI does not yet send any dummy diagnostic events that we can use for testing purposes. * WebKit.xcodeproj/project.pbxproj: * UIProcess/API/Cocoa/_WKInspectorInternal.h: Fix include. * UIProcess/API/Cocoa/_WKInspectorPrivate.h: Added. * UIProcess/API/Cocoa/_WKInspector.mm: Fix include. (-[_WKInspector _setDiagnosticLoggingDelegate:]): Allow clients to set the diagnosticLoggingDelegate directly on _WKInspector. The implementation forwards this setter to the Inspector's WKWebView and notifies the frontend that diagnostic logging availability did change. * UIProcess/WebInspectorProxy.h: * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::setDiagnosticLoggingAvailable): Plumbing. * WebProcess/WebPage/WebInspectorUI.cpp: (WebKit::WebInspectorUI::setDiagnosticLoggingAvailable): * WebProcess/WebPage/WebInspectorUI.h: * WebProcess/WebPage/WebInspectorUI.messages.in: More plumbing. 2019-11-19 Chris Dumez Make sendWithAsyncReply() safe to call from any thread https://bugs.webkit.org/show_bug.cgi?id=204355 Reviewed by Alex Christensen. Make sendWithAsyncReply() safe to call from any thread, similarly to the regular send(). Also start using it in WebProcess::processTaskStateDidChange() now that it is safe. * Platform/IPC/Connection.cpp: (IPC::asyncReplyHandlerMapLock): (IPC::asyncReplyHandlerMap): (IPC::nextAsyncReplyHandlerID): (IPC::addAsyncReplyHandler): (IPC::clearAsyncReplyHandlers): (IPC::CompletionHandler const): Deleted. (WebKit::WebProcessProxy::WeakOrStrongPtr::operator* const): Deleted. (WebKit::WebProcessProxy::WeakOrStrongPtr::operator bool const): Deleted. (WebKit::WebProcessProxy::WeakOrStrongPtr::updateStrongReference): Deleted. * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::processTaskStateDidChange): (WebKit::WebProcess::parentProcessDidHandleProcessWasResumed): Deleted. 2019-11-19 Megan Gardner Unreviwed build fix for older bots. * Platform/spi/ios/UIKitSPI.h: 2019-11-19 Brian Burg [Cocoa] Add WKUIDelegate SPI to inform clients when a _WKInspector attaches to a WKWebView https://bugs.webkit.org/show_bug.cgi?id=204300 Reviewed by Devin Rousso. Add a new UI delegate method to notify clients when local Web Inspector is about to be loaded. This can be triggered by -[_WKInspector show] in the Cocoa API, or via the WebCore-controlled Inspect context menu item. The client can then configure Web Inspector using delegates or by setting _WKInspector properties. Covered by new API test WebKit.DidNotifyWhenInspectorAttached. * UIProcess/API/APIUIClient.h: (API::UIClient::didAttachInspector): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::didAttachInspector): * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::openLocalInspectorFrontend): 2019-11-18 John Wilander Check if ITP is on before applying third-party cookie blocking https://bugs.webkit.org/show_bug.cgi?id=204322 Reviewed by Chris Dumez and Alexey Proskuryakov. This change makes sure WebCore::NetworkStorageSession knows whether ITP is on or off and checks that first thing in WebCore::NetworkStorageSession::shouldBlockCookies(). This check was never needed before since if ITP was off, there would be no classified domains and thus the function would always return false. However, https://trac.webkit.org/changeset/251353/webkit introduced full third-party cookie blocking for websites without user interaction and that rule is checked before checking domain classification. The effect was unconditional third-party cookie blocking if ITP is off. This changes fixes that bug. Note that this patch already landed as branch-specific in https://trac.webkit.org/changeset/252549/webkit * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::setResourceLoadStatisticsEnabled): Now tells WebCore::NetworkStorageSession the status of ITP. 2019-11-18 David Kilzer IPC::Decoder should use nullptr as invalid value Reviewed by Brent Fulgham. Covered by existing tests. * Platform/IPC/Decoder.cpp: (IPC::alignedBufferIsLargeEnoughToContain): Add bufferStart parameter to add beginning bounds check now that m_bufferPos uses nullptr for an invalid value. (IPC::Decoder::alignBufferPosition): Update to pass m_buffer to IPC::alignedBufferIsLargeEnoughToContain(). (IPC::Decoder::bufferIsLargeEnoughToContain const): Ditto. * Platform/IPC/Decoder.h: (IPC::Decoder::isInvalid const): Add beginning bounds check now that m_bufferPos uses nullptr for an invalid value. (IPC::Decoder::markInvalid): Make nullptr the invalid value for m_bufferPos. 2019-11-18 Andres Gonzalez Run AccessibilityController::rootElement on secondary thread to simulate HIServices during LayoutTests. https://bugs.webkit.org/show_bug.cgi?id=204226 Reviewed by Chris Fleizach. Added WKAccessibilityCanUseSecondaryAXThread to support WTR::AccessibilityController spawning of a secondary thread to simulate execution of isolated tree code. * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKAccessibilityCanUseSecondaryAXThread): * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: 2019-11-18 Chris Dumez Promote main thread assertions related to sendWithAsyncReply() to be release assertions https://bugs.webkit.org/show_bug.cgi?id=204298 Reviewed by Wenson Hsieh. Promote main thread assertions related to sendWithAsyncReply() to be release assertions, to help identify threading bugs such as . * Platform/IPC/Connection.cpp: (IPC::addAsyncReplyHandler): (IPC::clearAsyncReplyHandlers): (IPC::CompletionHandler Fix assertion in layout test after r252492. https://bugs.webkit.org/show_bug.cgi?id=204199 There is still a case in a test where there is no frame identifier, so keep the status quo. This is a partial revert of r252492. This fixes layout test http/tests/navigation/window-open-redirect-and-remove-opener.html * Shared/FrameInfoData.cpp: (WebKit::FrameInfoData::decode): * Shared/FrameInfoData.h: * UIProcess/API/APIFrameInfo.cpp: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::createNewPage): 2019-11-18 Alex Christensen Use SecTrustEvaluateWithError instead of SecTrustEvaluate where available https://bugs.webkit.org/show_bug.cgi?id=204159 Reviewed by Darin Adler. * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: (-[WKFullScreenWindowController _EVOrganizationName]): 2019-11-18 Darin Adler WKWebView.mediaType is nullable, not null_resettable https://bugs.webkit.org/show_bug.cgi?id=204297 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKWebView.h: Use nullable for mediaType since this property returns a null value when the media type is not being overridden. 2019-11-18 Carlos Garcia Campos Automation: scrollIntoView should do nothing if element is visible https://bugs.webkit.org/show_bug.cgi?id=204194 Reviewed by Carlos Alberto Lopez Perez. "To scroll into view an element perform the following steps only if the element is not already in view" https://w3c.github.io/webdriver/#dfn-scrolls-into-view Fixes: imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[9] imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[8] imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[7] imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[6] imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[5] imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[4] imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[3] imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[2] imported/w3c/webdriver/tests/element_click/scroll_into_view.py::test_partially_visible_does_not_scroll[1] * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::computeElementLayout): Use scrollIntoViewIfNotVisible instead of scrollIntoViewIfNeeded. 2019-11-17 Alexey Proskuryakov Better build fix attempt after r252434. We do need this variant, it was a mistake to claim that it's "old". * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm: (WebKit::decidePolicyForGeolocationRequestFromOrigin): 2019-11-17 Alexey Proskuryakov Build fix attempt after r252434. This variant of decidePolicyForGeolocationRequestFromOrigin doesn't exist in UIKit. Removing dead code, but someone needs to take a look at what the original intent here was. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm: (WebKit::decidePolicyForGeolocationRequestFromOrigin): 2019-11-16 Wenson Hsieh REGRESSION (r243606): Interacting with date and time pickers hangs the UI process on watchOS https://bugs.webkit.org/show_bug.cgi?id=204280 Reviewed by Chris Dumez. After r243606, interacting with date and time inputs on watchOS hangs the UI process indefinitely while attempting to create an input peripheral (WKFormInputControl) for the date or time picker. This is because, in the process of setting up a new WKDateTimePicker, we call into +[UIKeyboard defaultSizeForInterfaceOrientation:] which hangs when attempting to fetch the current UIKit keyboard layout type. To address this, we simply avoid setting _inputPeripheral on watchOS, as we did prior to r243606. Covered by the existing layout test fast/forms/watchos/time-picker-value-change.html, which currently times out. * UIProcess/ios/WKContentViewInteraction.mm: (createInputPeripheralWithView): 2019-11-16 Wenson Hsieh [iOS] [UIWKDocumentContext] Add the ability to request all marked text rects https://bugs.webkit.org/show_bug.cgi?id=204278 Reviewed by Tim Horton. Add support for a new UIWKDocumentRequest option to request character rects for each character in the marked text range. Unless UIWKDocumentRequestRects is additionally specified (in which case we'll return rects for every single character in the editable root anyways), this option will ensure that all characters in the composition range (which should match -[UIWKDocumentContext markedTextRange]) will have known character rects that can be retrieved using -[UIWKDocumentContext enumerateLayoutRects:] (or one of the other helper methods that utilize -enumerateLayoutRects:). Test: WebKit.DocumentEditingContextWithMarkedText * Platform/spi/ios/UIKitSPI.h: Add a staging declaration for the new option. * Shared/DocumentEditingContext.h: * UIProcess/ios/WKContentViewInteraction.mm: (toWebDocumentRequestOptions): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::requestDocumentEditingContext): Refactor logic that uses CharacterIterator to find rects for each character range into a lambda function, and use this lambda function to handle UIWKDocumentRequestRects and the new UIWKDocumentRequestMarkedTextRects. The marked text range is relative to the start of the context before the selection. 2019-11-15 Eric Carlson Don't use AVCapture on watchOS and tvOS https://bugs.webkit.org/show_bug.cgi?id=204254 Reviewed by Youenn Fablet. * Configurations/FeatureDefines.xcconfig: 2019-11-15 Myles C. Maxfield [Apple] Enable variation fonts on all Apple platforms https://bugs.webkit.org/show_bug.cgi?id=198100 Reviewed by Simon Fraser. * Configurations/FeatureDefines.xcconfig: 2019-11-15 Chris Dumez Add more release logging for network load restarts https://bugs.webkit.org/show_bug.cgi?id=204234 Reviewed by Youenn Fablet. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::willSendRedirectedRequest): (WebKit::NetworkResourceLoader::restartNetworkLoad): (WebKit::NetworkResourceLoader::continueWillSendRequest): (WebKit::NetworkResourceLoader::serviceWorkerDidNotHandle): 2019-11-15 Per Arne Vollan [iOS] Fix sysctl-read sandbox violation https://bugs.webkit.org/show_bug.cgi?id=204238 Reviewed by Brent Fulgham. There is missing a rule for reading a specific sysctl property in the WebContent process on iOS. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-11-15 Benjamin Nham Add SPI to clear web process cache https://bugs.webkit.org/show_bug.cgi?id=204210 Reviewed by Chris Dumez. This adds an SPI to clear cached web processes. The intended use case is to add a lukewarm mode to Mac PLT5 in which web pages load in a new WebProcess and load resources from the disk cache. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _clearWebProcessCache]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: (-[WKProcessPool _clearWebProcessCache]): 2019-11-15 Per Arne Vollan [iOS] Fix sandbox violation in the WebContent process related to WebRTC audio captures https://bugs.webkit.org/show_bug.cgi?id=204240 Reviewed by Brent Fulgham. The WebContent process needs access to read a new audio related preference domain. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-11-15 Alex Christensen Reduce structure copies when creating an API::FrameInfo https://bugs.webkit.org/show_bug.cgi?id=204199 Reviewed by Brady Eidson. Use WTFMove and references where possible. This is cleanup needed for a future patch. * Shared/FrameInfoData.cpp: (WebKit::FrameInfoData::decode): * Shared/FrameInfoData.h: * UIProcess/API/APIFrameInfo.cpp: (API::FrameInfo::create): (API::FrameInfo::FrameInfo): (API::FrameInfo::~FrameInfo): Deleted. (API::FrameInfo::clearPage): Deleted. * UIProcess/API/APIFrameInfo.h: * UIProcess/API/APINavigationClient.h: (API::NavigationClient::didFailProvisionalLoadInSubframeWithError): * UIProcess/API/APIUIClient.h: (API::UIClient::runJavaScriptAlert): (API::UIClient::runJavaScriptConfirm): (API::UIClient::runJavaScriptPrompt): (API::UIClient::runBeforeUnloadConfirmPanel): (API::UIClient::runOpenPanel): (API::UIClient::runWebAuthenticationPanel): * UIProcess/API/C/WKFrame.cpp: (WKFrameCreateFrameInfo): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): (WKPageSetPageNavigationClient): * UIProcess/API/Cocoa/WKFrameInfo.mm: (-[WKFrameInfo webView]): * UIProcess/API/Cocoa/WKUserContentController.mm: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::didFailProvisionalLoadInSubframeWithError): * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::runJavaScriptAlert): (WebKit::UIDelegate::UIClient::runJavaScriptConfirm): (WebKit::UIDelegate::UIClient::runJavaScriptPrompt): (WebKit::UIDelegate::UIClient::decidePolicyForGeolocationPermissionRequest): (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel): (WebKit::UIDelegate::UIClient::runOpenPanel): (WebKit::UIDelegate::UIClient::runWebAuthenticationPanel): * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame): (WebKit::ProvisionalPageProxy::decidePolicyForResponse): * UIProcess/ProvisionalPageProxy.h: * UIProcess/UserContent/WebScriptMessageHandler.h: * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::didPostMessage): * UIProcess/UserContent/WebUserContentControllerProxy.h: * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManager::runPanel): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFailProvisionalLoadForFrame): (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared): (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::decidePolicyForNewWindowAction): (WebKit::WebPageProxy::decidePolicyForResponse): (WebKit::WebPageProxy::decidePolicyForResponseShared): (WebKit::WebPageProxy::createNewPage): (WebKit::WebPageProxy::runJavaScriptAlert): (WebKit::WebPageProxy::runJavaScriptConfirm): (WebKit::WebPageProxy::runJavaScriptPrompt): (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): (WebKit::WebPageProxy::runOpenPanel): * UIProcess/WebPageProxy.h: 2019-11-15 Chris Dumez Regression(r244361) iOS: Layout test http/tests/quicklook/rtf-document-domain-is-empty-string.html is crashing https://bugs.webkit.org/show_bug.cgi?id=204205 Reviewed by Alex Christensen. In this test, NSHTMLWriter ends up creating a WebArchive providing file:///index.html as URL. The page's script then calls document.open(), which triggers a DidExplicitOpenForFrame() IPC to the UIProcess with this URL. This trips our MESSAGE_CHECK_URL() check in the UIProcess when this path is not within the WebContent process' sandbox, and we kill the WebContent process. To address the issue, this patch replaces the MESSAGE_CHECK_URL() with an if check and an early return so that we ignore the IPC if the URL does not make sense, without actually terminating the WebContent process. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didExplicitOpenForFrame): 2019-11-12 Youenn Fablet Update libwebrtc to M78 https://bugs.webkit.org/show_bug.cgi?id=203897 Reviewed by Eric Carlson. Update include paths. Update according API change to client TCP socket creation and network monitor. * NetworkProcess/webrtc/LibWebRTCSocketClient.h: * NetworkProcess/webrtc/NetworkRTCProvider.cpp: (WebKit::NetworkRTCProvider::createClientTCPSocket): * NetworkProcess/webrtc/NetworkRTCProvider.h: * NetworkProcess/webrtc/NetworkRTCProvider.mm: * NetworkProcess/webrtc/NetworkRTCSocket.h: * Shared/RTCPacketOptions.h: * WebProcess/Network/webrtc/LibWebRTCProvider.cpp: (WebKit::RTCSocketFactory::CreateClientTcpSocket): * WebProcess/Network/webrtc/LibWebRTCResolver.h: * WebProcess/Network/webrtc/LibWebRTCSocket.h: * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp: (WebKit::LibWebRTCSocketFactory::createClientTcpSocket): * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h: * WebProcess/Network/webrtc/WebRTCMonitor.cpp: * WebProcess/Network/webrtc/WebRTCMonitor.h: 2019-11-14 Alex Christensen Make NetworkResourceLoader::didReceiveResponse more straightforward after r244700 https://bugs.webkit.org/show_bug.cgi?id=204134 Reviewed by Youenn Fablet. If m_isKeptAlive is true, we do not want to receive any HTTP body. Rather than storing the CompletionHandler and relying on the destructor to call it, just call it. No change in behavior. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didReceiveResponse): 2019-11-14 Chris Dumez [iOS] Crash under WebProcess::processTaskStateDidChange(WebKit::ProcessTaskStateObserver::TaskState) https://bugs.webkit.org/show_bug.cgi?id=204177 Reviewed by Jer Noble. Delay creating the ProcessTaskStateObserver until the WebProcess's connection to its parent had been initialized. This is necessary because ProcessTaskStateObserver may call WebProcess::processTaskStateDidChange() on a background thread, which will deference the IPC connection. * WebProcess/WebProcess.cpp: (WebKit::m_webSQLiteDatabaseTracker): (WebKit::WebProcess::~WebProcess): (WebKit::WebProcess::initializeConnection): (WebKit::m_taskStateObserver): Deleted. * WebProcess/WebProcess.h: 2019-11-14 Brady Eidson Summary: WKWebView is missing an equivalent to WebKit 1's API to set the media style. and https://bugs.webkit.org/show_bug.cgi?id=203974 Reviewed by Alex Christensen. Covered by new API test. This is basically: - Expose a read/write property on WKWebView. - Pipe the new media type to the WebProcess. - Force a style recalc. * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView setMediaType:]): (-[WKWebView mediaType]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setOverriddenMediaType): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::overriddenMediaType const): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::overrideMediaType const): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setOverriddenMediaType): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::overriddenMediaType const): * WebProcess/WebPage/WebPage.messages.in: 2019-11-14 Brady Eidson pageZoom/setPageZoom: should not be in a Mac-only part of WKWebView.mm https://bugs.webkit.org/show_bug.cgi?id=204128 Reviewed by Alex Christensen. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView setPageZoom:]): (-[WKWebView pageZoom]): 2019-11-13 Per Arne Vollan REGRESSION: WKWebView navigation fails when navigating from about:blank https://bugs.webkit.org/show_bug.cgi?id=203852 Reviewed by Brent Fulgham. Previously, WebPageProxy::loadFile would unconditionally create a sandbox extension for the resource directory URL. Currently, this method is calling WebPageProxy::maybeInitializeSandboxExtension to create a sandbox extension if needed. The sandbox extension for the resource URL is not created if the WebContent process already has assumed access to the resource URL, which is the case when loading the same file for the second time. The sandbox extension still needs to be issued in this case, since the WebContent process is revoking its extension when the load is done. This patch restore the original behaviour by adding a flag to WebPageProxy::maybeInitializeSandboxExtension to indicate whether the method should check if the process already has assumed access. API test: WKWebView.LoadRelativeFileURL * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle): (WebKit::WebPageProxy::loadRequestWithNavigationShared): (WebKit::WebPageProxy::loadFile): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::shouldSendPendingMessage): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadRequestWaitingForProcessLaunch): (WebKit::WebPage::loadRequestWaitingForPID): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2019-11-13 Myles C. Maxfield [Mac] Fix build https://bugs.webkit.org/show_bug.cgi?id=204136 Reviewed by Alex Christensen. Remove deprecation warnings. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::replacedNSWorkspace_launchApplicationAtURL_options_configuration_error): (WebKit::initializeCocoaOverrides): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView changeFont:]): (-[WKWebView changeColor:]): (-[WKWebView view:stringForToolTip:point:userData:]): (-[WKWebView pasteboardChangedOwner:]): (-[WKWebView pasteboard:provideDataForType:]): * UIProcess/API/mac/WKView.mm: (-[WKView changeFont:]): (-[WKView view:stringForToolTip:point:userData:]): (-[WKView pasteboardChangedOwner:]): (-[WKView pasteboard:provideDataForType:]): * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: (WebKit::PluginProcessProxy::launchApplicationAtURL): (WebKit::PluginProcessProxy::openFile): * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm: (-[WKDataListSuggestionView setBackgroundStyle:]): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplication): (WebKit::WebPageProxy::openPDFFromTemporaryFolderWithNativeApplication): 2019-11-13 Megan Gardner Cleanup old UIKit Staging https://bugs.webkit.org/show_bug.cgi?id=204130 Reviewed by Wenson Hsieh. Not new tests - linking only. * Platform/spi/ios/UIKitSPI.h: Removing old staging code that should be unnecessary now. 2019-11-13 Per Arne Vollan [iOS] Cannot open camera from websites https://bugs.webkit.org/show_bug.cgi?id=204168 Reviewed by Jer Noble. The sandbox is blocking a required service. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-11-13 Benjamin Nham VeryHigh priority loads are actually loading at VeryLow priority https://bugs.webkit.org/show_bug.cgi?id=203423 Reviewed by Antti Koivisto. There are two issues with the way we translate ResourceLoadPriority to CFURLRequestPriority: 1. We call _CFNetworkHTTPConnectionCacheSetLimit and set 1 too few priority levels. This means VeryHigh priority loads are actually out of bounds, which causes CFNetwork to set the priority level back to 0 in HTTPConnectionCacheEntry::_prepareNewRequest. After this patch we'll call _CFNetworkHTTPConnectionCacheSetLimit with the correct number of levels. 2. _CFNetworkHTTPConnectionCacheSetLimit doesn't work for NSURLSession right now (), so we have to map to the default number of CFURLRequestPriority levels, which is 4. Right now we have 5 ResourceLoadPriority levels, so there will be some aliasing involved. After this patch VeryLow gets a priority of -1 and Low gets a priority of 0, but due to the aforementioned clamping behavior both VeryLow and Low will effectively both have a CFURLRequestPriority of 0. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::initializeNetworkSettings): 2019-11-13 Youenn Fablet Remove timer to stop service worker process https://bugs.webkit.org/show_bug.cgi?id=204118 Reviewed by Alex Christensen. Removal of a timer that is never get activated. No change of behavior. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): * UIProcess/WebProcessPool.h: 2019-11-13 Youenn Fablet Take service worker assertions based on client processes assertion states https://bugs.webkit.org/show_bug.cgi?id=204119 Reviewed by Chris Dumez. Compute in network process which processes contain clients for service workers of a given process. WebSWServerConnection implements it and sends update to UIProcess/WebProcessProxy. WebProcessProxy keeps for each service worker process a set of client web processes. WebProcessProxy now computes the service worker process assertion based on this set. Add some private APIs to set process assertions/get service worker process assertion states. Covered by new API test. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::registerServiceWorkerClient): (WebKit::WebSWServerConnection::unregisterServiceWorkerClient): (WebKit::WebSWServerConnection::contextConnectionCreated): * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::webProcessIdentifier const): * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setAssertionStateForTesting:]): (-[WKWebView _hasServiceWorkerBackgroundActivityForTesting]): (-[WKWebView _hasServiceWorkerForegroundActivityForTesting]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::registerWebProcessToServiceWorkerProcess): (WebKit::NetworkProcessProxy::unregisterWebProcessToServiceWorkerProcess): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::updateProcessAssertions): (WebKit::WebProcessPool::hasServiceWorkerForegroundActivityForTesting const): (WebKit::WebProcessPool::hasServiceWorkerBackgroundActivityForTesting const): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::updateServiceWorkerProcessAssertion): (WebKit::WebProcessProxy::registerWebProcessToServiceWorkerProcess): (WebKit::WebProcessProxy::unregisterWebProcessToServiceWorkerProcess): (WebKit::WebProcessProxy::hasServiceWorkerForegroundActivityForTesting const): (WebKit::WebProcessProxy::hasServiceWorkerBackgroundActivityForTesting const): * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::setAssertionStateForTesting): 2019-11-13 Andres Gonzalez AXObjectCache::rootObject should generate the isolated tree. https://bugs.webkit.org/show_bug.cgi?id=204131 Reviewed by Chris Fleizach. * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h: * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]): (-[WKAccessibilityWebPageObjectBase clientSupportsIsolatedTree]): Became a member of AXObjectCache. (-[WKAccessibilityWebPageObjectBase isolatedTreeRootObject]): Deleted. * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: (-[WKAccessibilityWebPageObject accessibilityHitTest:]): 2019-11-13 Youenn Fablet [ iOS ]: Layout Test http/tests/IndexedDB/storage-limit-1.https.html is a Flaky Failure https://bugs.webkit.org/show_bug.cgi?id=203275 Reviewed by Alex Christensen. Fix flakiness by clearing the storage of each cache when the cache is being cleared. This ensures that the storage salt gets recreated if needed. To further improve repeatability, make sure that initialize based tasks happen after clear tasks are complete. For that purpose, add a clear task counter and append initialize callbacks to a Vector if counter is not zero. Increment counter at clear task creation and decrement counter at completion time. If counter is back to 0, we can safely process the pending clear tasks. Covered by unflaked test. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::~Engine): (WebKit::CacheStorage::Engine::initialize): (WebKit::CacheStorage::CompletionHandler Rollout(r251358) Causes load hangs https://bugs.webkit.org/show_bug.cgi?id=204158 Unreviewed, revert r251358 because it causes load hangs. * Platform/spi/Cocoa/SecItemSPI.h: Removed. * Shared/mac/SecItemRequestData.cpp: (WebKit::SecItemRequestData::decode): * Shared/mac/SecItemRequestData.h: * WebKit.xcodeproj/project.pbxproj: 2019-11-13 Philippe Normand Unreviewed, fix build for ServiceWorkers disabled * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::enableServiceWorkers): 2019-11-13 Rob Buis Support stale-while-revalidate cache strategy https://bugs.webkit.org/show_bug.cgi?id=201461 Reviewed by Youenn Fablet. Add a new UseDecision value AsyncRevalidate for async revalidation. This is used when the retrieved cache entry is a stale-while-revalidate response [1]. In case of AsyncRevalidate, a check is made to see if there is a current async revalidation ongoing for the entry, if not one is started. Regardless, the stale entry is returned, until either the async revalidation ends successfully or at the moment when the response expires for real. [1] https://fetch.spec.whatwg.org/#concept-stale-while-revalidate-response * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::NetworkSession): * NetworkProcess/NetworkSession.h: (WebKit::NetworkSession::isStaleWhileRevalidateEnabled const): * NetworkProcess/NetworkSessionCreationParameters.cpp: (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/NetworkSessionCreationParameters.h: * NetworkProcess/cache/AsyncRevalidation.cpp: Added. (WebKit::NetworkCache::constructRevalidationRequest): (WebKit::NetworkCache::AsyncRevalidation::staleWhileRevalidateEnding): (WebKit::NetworkCache::AsyncRevalidation::AsyncRevalidation): * NetworkProcess/cache/AsyncRevalidation.h: Added. (WebKit::NetworkCache::AsyncRevalidation::load const): * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::responseNeedsRevalidation): (WebKit::NetworkCache::makeUseDecision): (WebKit::NetworkCache::makeStoreDecision): (WebKit::NetworkCache::Cache::startAsyncRevalidationIfNeeded): (WebKit::NetworkCache::Cache::retrieve): (WebKit::NetworkCache::responseHasExpired): Deleted. * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::dumpHTTPHeadersDiff): (WebKit::NetworkCache::requestsHeadersMatch): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::dumpHTTPHeadersDiff): Deleted. (WebKit::NetworkCache::requestsHeadersMatch): Deleted. * Sources.txt: * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.cpp: (WKWebsiteDataStoreConfigurationGetStaleWhileRevalidateEnabled): (WKWebsiteDataStoreConfigurationSetStaleWhileRevalidateEnabled): * UIProcess/API/C/WKWebsiteDataStoreConfigurationRef.h: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::copy const): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: (WebKit::WebsiteDataStoreConfiguration::staleWhileRevalidateEnabled const): (WebKit::WebsiteDataStoreConfiguration::setStaleWhileRevalidateEnabled): * WebKit.xcodeproj/project.pbxproj: 2019-11-12 Simon Fraser Convert CSSPrimitiveValue::UnitType to an enum class, and cleanup https://bugs.webkit.org/show_bug.cgi?id=204101 Reviewed by Antti Koivisto. Move CSSPrimitiveValue::UnitType to a standalone enum class CSSUnitType, and CSSPrimitiveVallue::UnitCategory to CSSUnitCategory; these are going to more extensive use in calc() and in the CSS OM. * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: (WebKit::PDFPluginAnnotation::updateGeometry): * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: (WebKit::PDFPluginChoiceAnnotation::updateGeometry): * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: (WebKit::PDFPluginTextAnnotation::updateGeometry): 2019-11-12 Sihui Liu Add size file for CacheStorage https://bugs.webkit.org/show_bug.cgi?id=204027 Reviewed by Youenn Fablet. Keep the CacheStorage size in a separate file so that we can get that value without waiting for Engine to initialize and read caches from disk. No behavior change as the file is not in use now. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::writeSizeFile): (WebKit::CacheStorage::Engine::readSizeFile): (WebKit::CacheStorage::Engine::clearAllCachesFromDisk): (WebKit::CacheStorage::Engine::deleteDirectoryRecursivelyOnBackgroundThread): * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::Caches::cachesSizeFilename): (WebKit::CacheStorage::Caches::updateSizeFile): (WebKit::CacheStorage::Caches::initializeSize): (WebKit::CacheStorage::Caches::writeRecord): (WebKit::CacheStorage::Caches::removeRecord): (WebKit::CacheStorage::Caches::resetSpaceUsed): * NetworkProcess/cache/CacheStorageEngineCaches.h: 2019-11-12 Wenson Hsieh [iOS] WKWebView does not respect system spellchecking preference https://bugs.webkit.org/show_bug.cgi?id=204100 Reviewed by Tim Horton. Implements a platform hook on iOS (-setContinuousSpellCheckingEnabled:) to allow UIKit to inform us when the system spellchecking preference changes, and adds logic to propagate these changes to the web process. See below for more details. Test: editing/spelling/toggle-spellchecking.html * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setContinuousSpellCheckingEnabledForTesting:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add testing SPI to enable or disable continuous spellchecking, for both iOS and macOS. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setContinuousSpellCheckingEnabled): * UIProcess/TextChecker.h: * UIProcess/gtk/TextCheckerGtk.cpp: (WebKit::TextChecker::setContinuousSpellCheckingEnabled): * UIProcess/ios/TextCheckerIOS.mm: (WebKit::TextChecker::setContinuousSpellCheckingEnabled): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView setContinuousSpellCheckingEnabled:]): Implement this method to handle changes to the system spellchecking preference. This hook is also used by legacy WebKit on iOS to turn spellchecking on or off. If the value of the preference changed, we additionally notify the web process. In the future, we should consider refactoring TextCheckerState to be per-web view and per-page, since Cocoa platform APIs would allow for different WKWebViews to have different spell checking preferences. * UIProcess/mac/TextCheckerMac.mm: (WebKit::TextChecker::setContinuousSpellCheckingEnabled): * UIProcess/win/TextCheckerWin.cpp: (WebKit::TextChecker::setContinuousSpellCheckingEnabled): * UIProcess/wpe/TextCheckerWPE.cpp: (WebKit::TextChecker::setContinuousSpellCheckingEnabled): Adjusted setContinuousSpellCheckingEnabled to return whether or not the continuous spellchecking state changed. 2019-11-12 Truitt Savell Unreviewed, rolling out r252351. casued 50+ crashes on Mac and iOS wk2 debug Reverted changeset: "Add size file for CacheStorage" https://bugs.webkit.org/show_bug.cgi?id=204027 https://trac.webkit.org/changeset/252351 2019-11-12 Alex Christensen Revert remainder of r251676 https://bugs.webkit.org/show_bug.cgi?id=203066 * 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::globalCTDataConnectionServiceType): (WebKit::NetworkSessionCocoa::setCTDataConnectionServiceType): (WebKit::NetworkSessionCocoa::dataConnectionServiceType const): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration CTDataConnectionServiceType]): (-[_WKProcessPoolConfiguration setCTDataConnectionServiceType:]): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::paymentCoordinatorCTDataConnectionServiceType): 2019-11-12 Megan Gardner Rename _textSelectionAssistant to _textInteractionAssistant to reflect the only class it can now represent https://bugs.webkit.org/show_bug.cgi?id=204103 Reviewed by Wenson Hsieh. No new tests - rename only. Now that UIWKSelectionAssistant is no longer, the _textSelectionAssistant can only be a UIWKTextInteractionAssistant. There is enough confusion around all the selection and interaction assistants, renaming this should alleviate some of that confusion. * UIProcess/ios/WKContentView.mm: (-[WKContentView _didExitStableState]): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): (-[WKContentView becomeFirstResponderForWebView]): (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason:]): (-[WKContentView _scrollingNodeScrollingWillBegin]): (-[WKContentView _scrollingNodeScrollingDidEnd]): (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]): (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): (-[WKContentView _uiTextSelectionRects]): (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): (-[WKContentView setUpTextSelectionAssistant]): (-[WKContentView _willStartScrollingOrZooming]): (-[WKContentView _didEndScrollingOrZooming]): (-[WKContentView _lookupForWebView:]): (-[WKContentView _shareForWebView:]): (-[WKContentView _addShortcutForWebView:]): (-[WKContentView _promptForReplaceForWebView:]): (-[WKContentView _transliterateChineseForWebView:]): (-[WKContentView tintColorDidChange]): (-[WKContentView _didHideMenu:]): (-[WKContentView selectForWebView:]): (-[WKContentView selectAllForWebView:]): (-[WKContentView _showTextStyleOptionsForWebView:]): (-[WKContentView _showDictionary:]): (-[WKContentView interactionAssistant]): (-[WKContentView _showKeyboard]): (-[WKContentView _hideKeyboard]): (-[WKContentView _updateChangedSelection:]): (-[WKContentView _startSuppressingSelectionAssistantForReason:]): (-[WKContentView _stopSuppressingSelectionAssistantForReason:]): (-[WKContentView _restoreCalloutBarIfNeeded]): (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]): 2019-11-12 Carlos Alberto Lopez Perez [GTK][WPE] Support Pointer Events https://bugs.webkit.org/show_bug.cgi?id=202789 Reviewed by Carlos Garcia Campos. Covered by existing tests. * UIProcess/PageClient.h: Add a ifdef for platform COCOA on two function declarations that depend on the UIGestureRecognizer ObjC type. This is not needed for GTK/WPE code. 2019-11-12 Alex Christensen Revert part of r251676 https://bugs.webkit.org/show_bug.cgi?id=203066 * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::suppressesConnectionTerminationOnSystemChange const): * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration suppressesConnectionTerminationOnSystemChange]): (-[_WKProcessPoolConfiguration setSuppressesConnectionTerminationOnSystemChange:]): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): 2019-11-12 Carlos Alberto Lopez Perez [GTK][WPE] Enable CSS Painting API https://bugs.webkit.org/show_bug.cgi?id=190710 Reviewed by Don Olmstead. 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-11-12 Carlos Garcia Campos [GTK] WebDriver: implement new window command https://bugs.webkit.org/show_bug.cgi?id=203994 Reviewed by Carlos Alberto Lopez Perez. Add new API to support new window command. The WebKitAutomationSession::create-web-view signal can now receive a detail that can be "window" or "tab". Applications can use that to decide whether to add the new webview to a new window or tab. WebKitWebView has a new construct only property automation-presentation-type, which is an enum that can be either window or tab value. Appplications should use the new property when creating the web view for automation to indicate whether the web view was added to a new window or tab. * UIProcess/API/glib/WebKitAutomationSession.cpp: (webkit_automation_session_class_init): * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewSetProperty): (webkitWebViewGetProperty): (webkit_web_view_class_init): (webkit_web_view_get_automation_presentation_type): * UIProcess/API/gtk/WebKitAutomationSession.h: * UIProcess/API/gtk/WebKitWebView.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/wpe/WebKitWebView.h: * UIProcess/API/wpe/docs/wpe-1.0-sections.txt: 2019-11-12 Carlos Garcia Campos REGRESSION(r250707): [GTK] UIClient::setWindowFrame only works the first time https://bugs.webkit.org/show_bug.cgi?id=204068 Reviewed by Adrian Perez de Castro. This is because we are connecting to configure-event of parent window, but not returning FALSE from the callback to propagate the event. * UIProcess/API/glib/WebKitUIClient.cpp: (UIClient::windowConfigureEventCallback): Make it boolean and return FALSE. 2019-11-11 Alex Christensen Add SPI to access a WebsiteDataStore without instantiating it, and its configuration https://bugs.webkit.org/show_bug.cgi?id=204089 Reviewed by Tim Horton. Calling WKWebViewConfiguration.websiteDataStore instantiates the default data store. We need a way to query if it has been set but not instantiate anything if it hasn't. We also need a way to access the configuration used to create a WKWebsiteDataStore like we do with WKWebView. These have been requested to fix and I think they're a good idea in general. Covered by API tests. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration _websiteDataStoreIfExists]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _setDelegate:]): (-[WKWebsiteDataStore set_delegate:]): (-[WKWebsiteDataStore _configuration]): * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::copy const): (WebKit::WebsiteDataStoreConfiguration::copy): Deleted. * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: 2019-11-11 Sihui Liu Add size file for CacheStorage https://bugs.webkit.org/show_bug.cgi?id=204027 Reviewed by Youenn Fablet. Keep the CacheStorage size in a separate file so that we can get that value without waiting for Engine to initialize and read caches from disk. No behavior change as the file is not in use now. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::writeSizeFile): (WebKit::CacheStorage::Engine::readSizeFile): * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCaches.cpp: (WebKit::CacheStorage::cachesSizeFilename): (WebKit::CacheStorage::Caches::updateSizeFile): (WebKit::CacheStorage::Caches::initializeSize): (WebKit::CacheStorage::Caches::writeRecord): (WebKit::CacheStorage::Caches::removeRecord): (WebKit::CacheStorage::Caches::resetSpaceUsed): * NetworkProcess/cache/CacheStorageEngineCaches.h: 2019-11-11 Youenn Fablet Fail cross-origin redirection loads in case of CORS with redirection URLs having credentials https://bugs.webkit.org/show_bug.cgi?id=204036 Reviewed by Alex Christensen. Implement https://fetch.spec.whatwg.org/#http-redirect-fetch steps 7 and 8. Covered by updated tests. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::checkRedirection): 2019-11-11 Per Arne Vollan [iOS] Unable to view .pages files https://bugs.webkit.org/show_bug.cgi?id=204076 Reviewed by Brent Fulgham. This is caused by a syscall being blocked by the sandbox. The syscall was previously unused in the WebContent process. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-11-11 Carlos Garcia Campos WebDriver: implement proxy support https://bugs.webkit.org/show_bug.cgi?id=180408 Reviewed by Carlos Alberto Lopez Perez. * UIProcess/API/glib/WebKitAutomationSession.cpp: (parseProxyCapabilities): Parse the proxy settings from capabilities. (webkitAutomationSessionCreate): Set the proxy settings received from capabilities. 2019-11-10 David Kilzer StorageManagerSet.m_storageAreas should use weak pointers to StorageArea Reviewed by Geoffrey Garen. * NetworkProcess/WebStorage/StorageArea.h: (class WebKit::StorageArea): - Inherit from CanMakeWeakPtr. * NetworkProcess/WebStorage/StorageManagerSet.cpp: (WebKit::StorageManagerSet::removeConnection): (WebKit::StorageManagerSet::waitUntilSyncingLocalStorageFinished): (WebKit::StorageManagerSet::connectToLocalStorageArea): (WebKit::StorageManagerSet::connectToTransientLocalStorageArea): (WebKit::StorageManagerSet::connectToSessionStorageArea): (WebKit::StorageManagerSet::disconnectFromStorageArea): (WebKit::StorageManagerSet::getValues): Initialize `quotaError` stack value since it is not guaranteed to be set. (WebKit::StorageManagerSet::setItem): (WebKit::StorageManagerSet::removeItem): (WebKit::StorageManagerSet::clear): - Use makeWeakPtr() to add StorageArea pointers to m_storageAreas. - Use `const auto&` to store WeakPtr values from m_storageAreas. - Add nullptr checks before using WeakPtr values. * NetworkProcess/WebStorage/StorageManagerSet.h: (WebKit::StorageManagerSet::m_storageAreas): - Use WeakPtr. 2019-11-09 Dean Jackson Clicky Orbing support.apple.com categories shows a PNG instead of the web page preview, tapping loads image asset only instead of web page https://bugs.webkit.org/show_bug.cgi?id=204037 Reviewed by Simon Fraser. When Safari adopted the ContextMenu API they began providing a PreviewViewController that showed the image rather than the link, for the case of . This could be fixed in Safari, but I noticed that we actually tell the delegate that the type of the activated element is an image, which is why they treat it as such. It's not clear that because the image also has a link attached, a client should defer to the link. Instead, I think it makes more sense to identify this as a link, because that is the more important information in this API. While here I also changed the logic to make sure we call the API if both the API and SPI are available. New ContextMenus and WKRequestActivatedElementInfo API tests. * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm: Identify as a link if you have a link. (-[_WKActivatedElementInfo _initWithInteractionInformationAtPosition:userInfo:]): * UIProcess/ios/WKContentViewInteraction.mm: Look for the API before the SPI. (-[WKContentView continueContextMenuInteraction:]): 2019-11-08 Brady Eidson WKWebView Find-in-page API. and https://bugs.webkit.org/show_bug.cgi?id=203872 Reviewed by Tim Horton. Covered by API tests. - Promote _findString: - Add a completion handler for it. * SourcesCocoa.txt: * UIProcess/API/Cocoa/WKFindConfiguration.h: Added. * UIProcess/API/Cocoa/WKFindConfiguration.mm: Added. (-[WKFindConfiguration init]): (-[WKFindConfiguration copyWithZone:]): * UIProcess/API/Cocoa/WKFindResult.h: Added. * UIProcess/API/Cocoa/WKFindResult.mm: Added. (-[WKFindResult init]): (-[WKFindResult _initWithMatchFound:]): (-[WKFindResult copyWithZone:]): * UIProcess/API/Cocoa/WKFindResultInternal.h: Added. * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebView.mm: (toFindOptions): (-[WKWebView findString:withConfiguration:completionHandler:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: * UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.h: * UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.mm: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::findString): (WebKit::WebPageProxy::findStringCallback): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::findString): * WebProcess/WebPage/FindController.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::findString): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2019-11-08 Jiewen Tan [WebAuthn] Add quirk needed to support legacy Google NFC Titan security keys https://bugs.webkit.org/show_bug.cgi?id=204024 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 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 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 [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 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::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. (WTF::DownloadIDHash::hash): Deleted. (WTF::DownloadIDHash::equal): Deleted. (WTF::HashTraits::emptyValue): Deleted. (WTF::HashTraits::constructDeletedValue): Deleted. (WTF::HashTraits::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 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 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 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 Add WebKit Legacy SPI to retrieve editable elements in rect https://bugs.webkit.org/show_bug.cgi?id=204006 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 [WebAuthn] Return NotAllowedError immediately for UI cancellations https://bugs.webkit.org/show_bug.cgi?id=203937 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 [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 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 [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 Re-enable NSURLSession isolation after r252116 https://bugs.webkit.org/show_bug.cgi?id=203934 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 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 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 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 Update availability annotations to match the macOS 10.15 and iOS 13.0 GM SDKs https://bugs.webkit.org/show_bug.cgi?id=202243 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 REGRESSION: [ iOS ] ( r251015 ) Layout Test fast/text/whitespace/pre-wrap-overflow-selection.html is flaky https://bugs.webkit.org/show_bug.cgi?id=203366 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 Unreviewed, fix watchOS build after r252011. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::startBackgroundActivityForFullscreenInput): 2019-11-06 Fujii Hironori 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 Unreviewed, rolling out r251907. Causes white flashing in some cases 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 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 [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 [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 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 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 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 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 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 [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 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 Native text substitutions interfere with HTML options resulting in crash https://bugs.webkit.org/show_bug.cgi?id=203116 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 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 Unreviewed build fix for !ENABLE(MEDIA_STREAM) builds https://bugs.webkit.org/show_bug.cgi?id=203362 * UIProcess/UserMediaPermissionRequestProxy.h: Enclosed isUserGesturePriviledged with #if ENABLE(MEDIA_STREAM). 2019-11-05 youenn fablet mp4 video element broken with service worker https://bugs.webkit.org/show_bug.cgi?id=184447 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 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 [WebAuthn] Guard against unexpected -[_WKWebAuthenticationPanel cancel] https://bugs.webkit.org/show_bug.cgi?id=203830 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 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 Fix crash caused by syscall sandbox violation https://bugs.webkit.org/show_bug.cgi?id=203826 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 Resource Load Statistics: Flush the shared ResourceLoadObserver when the webpage is closed by JavaScript https://bugs.webkit.org/show_bug.cgi?id=203623 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 [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 [WebAuthn] CtapAuthenticator::tryDowngrade should distinguish requestData().options https://bugs.webkit.org/show_bug.cgi?id=203771 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 WKWebView can get stuck blank (Web Content process thinks the app is backgrounded) https://bugs.webkit.org/show_bug.cgi?id=203774 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 Web Inspector: Add diagnostic logging for frontend feature usage https://bugs.webkit.org/show_bug.cgi?id=203579 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 . * 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 Promote "_getWebArchive" to API. 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 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 Add experimental TextTrackCue API https://bugs.webkit.org/show_bug.cgi?id=203649 Reviewed by Jer Noble. * Shared/WebPreferences.yaml: 2019-11-01 Brian Burg REGRESSION(r248696): Element Click on Mac is adding an extra page topContentInsets to y-coordinate https://bugs.webkit.org/show_bug.cgi?id=203765 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 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 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 Take down the gesture snapshot early when the back/forward cache is not leveraged https://bugs.webkit.org/show_bug.cgi?id=203713 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 [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 Turn on IOSurface support in the iOS Simulator https://bugs.webkit.org/show_bug.cgi?id=203026 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 REGRESSION (r251215): Mail failed to build https://bugs.webkit.org/show_bug.cgi?id=203700 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 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 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 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 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 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 Expose more WKPreferences SPI https://bugs.webkit.org/show_bug.cgi?id=203631 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 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 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 Add telemetry to test a potential cause of crashes under -[WKContentView _interpretKeyEvent:isCharEvent:] https://bugs.webkit.org/show_bug.cgi?id=203630 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 [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 [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 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 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 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 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 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 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 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 WKContentRuleLists should block requests from service workers https://bugs.webkit.org/show_bug.cgi?id=201980 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 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 Unreviewed, fix reversed assertion landed in r251778. * UIProcess/ProcessThrottler.h: (WebKit::ProcessThrottler::Activity::invalidate): 2019-10-30 Chris Dumez Unreviewed, fix WatchOS build after r251778. * UIProcess/WebProcessProxy.h: 2019-10-30 Chris Dumez WKFrameIsDisplayingMarkupDocument() should return true after a window.open/document.write https://bugs.webkit.org/show_bug.cgi?id=203587 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 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 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 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 [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 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 [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 [WebAuthn] Add more information to _WKWebAuthenticationPanel https://bugs.webkit.org/show_bug.cgi?id=202561 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 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 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 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 [iOS] Clean up sandbox to group similar rules together https://bugs.webkit.org/show_bug.cgi?id=203525 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 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 Add enterkeyhint support https://bugs.webkit.org/show_bug.cgi?id=189546 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 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 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 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 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 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 Notification permissions are not remembered for origins without port https://bugs.webkit.org/show_bug.cgi?id=203537 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 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 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 [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 [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 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 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 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 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 Expose _printOperationWithPrintInfo: SPI as API 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 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 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 [iOS] 3 editing/pasteboard/smart-paste-paragraph-* tests are flaky https://bugs.webkit.org/show_bug.cgi?id=203264 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 Storage Access API: Make the API work with the experimental 3rd-party cookie blocking https://bugs.webkit.org/show_bug.cgi?id=203428 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 . 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 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 [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 [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 Unreviewed build fix for !ENABLE(MEDIA_STREAM) builds https://bugs.webkit.org/show_bug.cgi?id=203362 * UIProcess/UserMediaPermissionRequestProxy.h: Enclosed isUserGesturePriviledged with #if ENABLE(MEDIA_STREAM). 2019-10-21 Jiewen Tan [WebAuthn] Warn users when multiple NFC tags present https://bugs.webkit.org/show_bug.cgi?id=200932 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 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 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 REGRESSION(r251599): Crash in MobileSafari tests (ASSERTION FAILED: m_pendingRequestToSuspendID) https://bugs.webkit.org/show_bug.cgi?id=203437 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 Unused arguments in MESSAGE_CHECK_CONTEXTID() macros 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 [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 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 [iOS 13] fast/forms/ios/accessory-bar-navigation.html is a flaky failure https://bugs.webkit.org/show_bug.cgi?id=203294 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 Add exclusion rules to text manipulation SPI https://bugs.webkit.org/show_bug.cgi?id=203398 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 [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 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 mp4 video element broken with service worker https://bugs.webkit.org/show_bug.cgi?id=184447 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 [iOS] Regression(r251067) WebProcesses with service workers no longer keep their network process alive https://bugs.webkit.org/show_bug.cgi?id=203388 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 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 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 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 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 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 REGRESSION(r251409) Service worker connection should not be established without service worker entitlement https://bugs.webkit.org/show_bug.cgi?id=203385 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 [iOS] Mismatch in com.apple.coremedia.audiodeviceclock declarations https://bugs.webkit.org/show_bug.cgi?id=203367 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 [iOS] Mismatch in com.apple.MediaPlayer.RemotePlayerService declarations https://bugs.webkit.org/show_bug.cgi?id=203368 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 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 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 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 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 [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 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 [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 WebBackForwardCache::removeEntriesMatching() may re-enter and crash https://bugs.webkit.org/show_bug.cgi?id=203341 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 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 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 macCatalyst: Should dispatch contextmenu event on right click https://bugs.webkit.org/show_bug.cgi?id=203316 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 [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 Implement dumpResourceLoadStatistics in SQLite ITP Database https://bugs.webkit.org/show_bug.cgi?id=203224 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 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): * WebProcess/WebPage/WebPageInspectorTargetFrontendChannel.h: The channel's lifetime is managed by owning target. No need to reference count it. 2019-10-22 Jiewen Tan [WebAuthn] Supply FrameInfo in -[WKUIDelegatePrivate _webView:runWebAuthenticationPanel:initiatedByFrame:completionHandler:] https://bugs.webkit.org/show_bug.cgi?id=202563 Reviewed by Brent Fulgham. This patch makes WKFrameInfo available to clients via the above SPI. To do so, SecuirtyOrigin of the caller document is passed from WebContent Process. * UIProcess/API/APIUIClient.h: (API::UIClient::runWebAuthenticationPanel): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::runWebAuthenticationPanel): * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManager::runPanel): * UIProcess/WebAuthentication/WebAuthenticationRequestData.h: * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp: (WebKit::WebAuthenticatorCoordinatorProxy::makeCredential): (WebKit::WebAuthenticatorCoordinatorProxy::getAssertion): (WebKit::WebAuthenticatorCoordinatorProxy::handleRequest): * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h: * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in: * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp: (WebKit::WebAuthenticatorCoordinator::makeCredential): (WebKit::WebAuthenticatorCoordinator::getAssertion): * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.h: 2019-10-23 Andy Estes [Quick Look] Rename PreviewLoader{,Client} to LegacyPreviewLoader{,Client} https://bugs.webkit.org/show_bug.cgi?id=203306 Reviewed by Tim Horton. * WebProcess/Storage/WebSWContextManagerConnection.cpp: * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm: (WebKit::WebFrameLoaderClient::createPreviewLoaderClient): * WebProcess/WebCoreSupport/ios/WebPreviewLoaderClient.h: 2019-10-22 Fujii Hironori Unreviewed build fix for non-unified source builds https://bugs.webkit.org/show_bug.cgi?id=203055 * WebProcess/Storage/WebServiceWorkerProvider.cpp: Added #include . 2019-10-22 John Wilander Resource Load Statistics (experimental): Block all third-party cookies https://bugs.webkit.org/show_bug.cgi?id=203266 Reviewed by Alex Christensen. This change updates the experimental change in to block all third-party cookies, regardless of user interaction with the first-party website. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::setShouldBlockThirdPartyCookiesForTesting): * NetworkProcess/NetworkSessionCreationParameters.cpp: (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/NetworkSessionCreationParameters.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * Shared/WebPreferences.yaml: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): 2019-10-22 Tim Horton Make it possible to not include IPC Messages headers in other headers https://bugs.webkit.org/show_bug.cgi?id=203074 * Scripts/webkit/messages_unittest.py: (GeneratedFileContentsTest.assertHeaderEqual): (GeneratedFileContentsTest.assertImplementationEqual): (UnsupportedPrecompilerDirectiveTest.test_error_at_else): (UnsupportedPrecompilerDirectiveTest.test_error_at_elif): Fix the message generator unit tests. 2019-10-22 Alex Christensen Re-enable legacy TLS by default, keep runtime switch https://bugs.webkit.org/show_bug.cgi?id=203253 Reviewed by Geoffrey Garen. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): 2019-10-22 Alex Christensen Revert r243010 on pre-Catalina macOS https://bugs.webkit.org/show_bug.cgi?id=203265 Reviewed by Per Arne Vollan. * WebProcess/com.apple.WebProcess.sb.in: 2019-10-22 Tim Horton Update xcfilelists * DerivedSources-output.xcfilelist: 2019-10-22 Tim Horton Make it possible to not include IPC Messages headers in other headers https://bugs.webkit.org/show_bug.cgi?id=203074 Reviewed by Geoffrey Garen. Make the Messages generator generate a new -MessagesReplies.h file, which only includes headers for and definitions of DelayedReply/AsyncReply types, which need to be mentioned as arguments to message hander methods, and thus must be available in various headers throughout the project. In order to do this, we have to de-nest them from the primary message class, but we then 'using' them back into place inside the message class so that most of the code doesn't need to change. This helps to wildly decrease the header load of WebPage.h and WebPageProxy.h, especially, because the number of headers needed for types in their replies is much smaller than the number needed for all message receivers. Also, only invoke the Messages generator once per source file, and only parse the source file once, generating all three output files in one invocation. And then clean up all the missing indirect includes that we lost by doing this. All-in-all this is worth roughly 8% on the WebKit2 Build Time Benchmark. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources.make: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: * NetworkProcess/NetworkConnectionToWebProcess.cpp: * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkResourceLoader.cpp: * NetworkProcess/NetworkResourceLoader.h: * PluginProcess/PluginControllerProxy.cpp: * PluginProcess/PluginControllerProxy.h: * PluginProcess/WebProcessConnection.h: * Scripts/Makefile: * Scripts/generate-message-receiver.py: (main): * Scripts/generate-messages-header.py: Removed. * Scripts/webkit/LegacyMessageReceiver-expected.cpp: * Scripts/webkit/LegacyMessages-expected.h: * Scripts/webkit/LegacyMessagesReplies-expected.h: Added. * Scripts/webkit/MessageReceiver-expected.cpp: * Scripts/webkit/MessageReceiverSuperclass-expected.cpp: * Scripts/webkit/Messages-expected.h: * Scripts/webkit/MessagesReplies-expected.h: Added. * Scripts/webkit/MessagesRepliesSuperclassReplies-expected.h: Added. * Scripts/webkit/MessagesSuperclass-expected.h: * Scripts/webkit/messages.py: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/Downloads/DownloadProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Plugins/PluginProcessManager.cpp: * UIProcess/Plugins/PluginProcessManager.h: * UIProcess/Plugins/PluginProcessProxy.h: * UIProcess/ProvisionalPageProxy.h: * UIProcess/SuspendedPageProxy.h: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.h: * UIProcess/ios/WKContentView.mm: * UIProcess/ios/WKContentViewInteraction.mm: * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Storage/WebSWContextManagerConnection.cpp: * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: * WebProcess/cocoa/VideoFullscreenManager.h: * WebProcess/cocoa/VideoFullscreenManager.mm: 2019-10-22 Chris Dumez Simplify "Unexpectedly Resumed" assertion handling https://bugs.webkit.org/show_bug.cgi?id=203254 Reviewed by Geoffrey Garen. When the WebContent process gets resumed from suspension, it now unconditionally takes a process assertion on behalf on the UIProcess and sends a ProcessDidResume IPC to the UIProcess. The UIProcess then sends a DidHandleProcessWasResumed IPC back after handing the ProcessDidResume IPC allowing the WebContent process to release its assertion on behalf on the UIProcess. The previous code was racy because it relied on the m_processIsSuspended flag, which was queried and set from different threads. Also, the 'unexpectedly resumed' naming was confusing since we'd often take this assertion whenever the WebProcess got resumed, wether unexpected or not, simply because the processTaskStateDidChange IPC won the race with the ProcessDidResume IPC from the UIProcess. * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::processWasResumed): (WebKit::WebProcessProxy::processWasUnexpectedlyUnsuspended): Deleted. * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::processDidResume): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::processTaskStateDidChange): (WebKit::WebProcess::didHandleProcessWasResumed): 2019-10-22 youenn fablet Remove mayHaveServiceWorkerRegisteredForOrigin https://bugs.webkit.org/show_bug.cgi?id=203055 Reviewed by Alex Christensen. This optimization was used for ensuring we would not create a storage process when no service worker registration is stored on disk. Now that we do not have a storage process and we are doing registration matching direclty in network process, we can safely remove that optimization. We also move the throttle state handling in WK2 layer. This allows us to not create a network process connection to update throttle state until there is a network process connection. This allows continuing passing an API test checking network process connections after crashes. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess): (WebKit::WebProcessPool::updateServiceWorkerUserAgent): * UIProcess/WebProcessPool.h: * WebProcess/Network/NetworkProcessConnection.h: * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::serviceWorkerConnection): (WebKit::WebServiceWorkerProvider::updateThrottleState): * WebProcess/Storage/WebServiceWorkerProvider.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::m_textAutoSizingAdjustmentTimer): (WebKit::WebPage::updateThrottleState): 2019-10-22 Yury Semikhatsky [GTK] Web Inspector: add an option for disabling minification and concatenation of inspector UI in release build https://bugs.webkit.org/show_bug.cgi?id=203201 Reviewed by Carlos Garcia Campos. Allow passing COMBINE_INSPECTOR_RESOURCES and COMBINE_TEST_RESOURCES as cmake arguments. This enables to avoid minification of Web Inspector scripts in release binaries which is very convenient during inspector UI development. * InspectorGResources.cmake: 2019-10-22 Adrian Perez de Castro [GTK][WPE] Fix non-unified builds after r251326 https://bugs.webkit.org/show_bug.cgi?id=203244 Reviewed by Youenn Fablet. * Shared/UserData.cpp: Add missing inclusion of WebCoreArgumentCoders.h * UIProcess/Automation/SimulatedInputDispatcher.cpp: Add missing inclusion of wtf/Variant.h * UIProcess/ProvisionalPageProxy.h: Add missing inclusion of WebCore/ResourceRequest.h * UIProcess/WebTextChecker.cpp: Add missing inclusion of WebPageProxy.h * WebProcess/Databases/WebDatabaseProvider.cpp: Add missing inclusion of WebIDBConnectionToServer.h 2019-10-22 youenn fablet WebSWServerToContextConnection should not assert when failing loads at destruction time https://bugs.webkit.org/show_bug.cgi?id=203243 Reviewed by Alex Christensen. On WebSWServerToContextConnection destruction, we move the fetch task map and fail the tasks. At destruction of the tasks, which happens synchronously, they will try to unregister themselves and the assertion that the task is in the map will fail. To fix that, add a specific contextClosed method that will clear the task connection weak pointer. * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::contextClosed): * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::~WebSWServerToContextConnection): 2019-10-22 youenn fablet ServiceWorkerFetchTask can use the NetworkConnectionToWebProcess sessionID https://bugs.webkit.org/show_bug.cgi?id=202208 Reviewed by Alex Christensen. No need to store the sessionID in ServiceWorkerFetchTask since we can get it from its loader. * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask): * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::createFetchTask): 2019-10-22 youenn fablet Remove the ability to fallback to custom scheme handlers after a service worker did not handle the load https://bugs.webkit.org/show_bug.cgi?id=203239 Reviewed by Alex Christensen. We remove the ability for service workers to intercept custom scheme handlers. We can then remove the ability for loads that are not handled by service workers to go through custom scheme handlers. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::serviceWorkerDidNotHandle): 2019-10-22 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.27.2 release * gtk/NEWS: Add release notes for 2.27.2. 2019-10-21 Yusuke Suzuki [JSC] Thread JSGlobalObject* instead of ExecState* https://bugs.webkit.org/show_bug.cgi?id=202392 Reviewed by Geoffrey Garen. * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp: (webkit_frame_get_js_value_for_dom_object_in_script_world): * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::reportException): (WebKit::InjectedBundle::createWebDataFromUint8Array): * WebProcess/Plugins/Netscape/JSNPMethod.cpp: (WebKit::callMethod): * WebProcess/Plugins/Netscape/JSNPMethod.h: * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::callMethod): (WebKit::JSNPObject::callObject): (WebKit::JSNPObject::callConstructor): (WebKit::callNPJSObject): (WebKit::constructWithConstructor): (WebKit::JSNPObject::getOwnPropertySlot): (WebKit::JSNPObject::put): (WebKit::JSNPObject::deleteProperty): (WebKit::JSNPObject::deletePropertyByIndex): (WebKit::JSNPObject::getOwnPropertyNames): (WebKit::JSNPObject::propertyGetter): (WebKit::JSNPObject::methodGetter): (WebKit::JSNPObject::throwInvalidAccessError): * WebProcess/Plugins/Netscape/JSNPObject.h: * WebProcess/Plugins/Netscape/NPJSObject.cpp: (WebKit::identifierFromIdentifierRep): (WebKit::NPJSObject::hasMethod): (WebKit::NPJSObject::invoke): (WebKit::NPJSObject::invokeDefault): (WebKit::NPJSObject::hasProperty): (WebKit::NPJSObject::getProperty): (WebKit::NPJSObject::setProperty): (WebKit::NPJSObject::removeProperty): (WebKit::NPJSObject::enumerate): (WebKit::NPJSObject::construct): * WebProcess/Plugins/Netscape/NPJSObject.h: * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::convertNPVariantToJSValue): (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant): (WebKit::NPRuntimeObjectMap::evaluate): (WebKit::NPRuntimeObjectMap::moveGlobalExceptionToExecState): (WebKit::NPRuntimeObjectMap::globalExec const): Deleted. * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::performJavaScriptURLRequest): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::jsContext): (WebKit::WebFrame::jsContextForWorld): (WebKit::WebFrame::frameForContext): (WebKit::WebFrame::jsWrapperForWorld): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::freezeLayerTree): (WebKit::WebPage::unfreezeLayerTree): (WebKit::WebPage::runJavaScript): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::networkProcessConnectionClosed): 2019-10-22 Carlos Alberto Lopez Perez [GTK][WPE] Enable service workers by default https://bugs.webkit.org/show_bug.cgi?id=200815 Reviewed by Carlos Garcia Campos. Flip the run-time switch to be enabled by default and not only when building with experimental features enabled. * Shared/WebPreferencesDefaultValues.h: 2019-10-22 Carlos Garcia Campos [GTK] C++ comments used in C header files https://bugs.webkit.org/show_bug.cgi?id=203191 Reviewed by Žan Doberšek. * UIProcess/API/gtk/WebKitAutocleanups.h: * UIProcess/API/gtk/WebKitDefines.h: * UIProcess/API/gtk/WebKitForwardDeclarations.h: * UIProcess/API/gtk/WebKitWebViewBase.h: * UIProcess/API/wpe/WebKitAutocleanups.h: * UIProcess/API/wpe/WebKitDefines.h: * WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.h: * WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionAutocleanups.h: * WebProcess/InjectedBundle/API/wpe/WebKitWebEditor.h: * WebProcess/InjectedBundle/API/wpe/WebKitWebExtensionAutocleanups.h: 2019-10-22 Wenson Hsieh imported/w3c/web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https.html is flaky https://bugs.webkit.org/show_bug.cgi?id=203181 Reviewed by Ryosuke Niwa. Add a changeCount argument to informationForItemAtIndex and allPasteboardItemInfo, and also make then return optional values; also, adjust changeCount to be an `int64_t` in a few places. See WebCore ChangeLog for more details. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::pasteboardCopy): (WebKit::WebPasteboardProxy::getPasteboardChangeCount): (WebKit::WebPasteboardProxy::addPasteboardTypes): (WebKit::WebPasteboardProxy::setPasteboardTypes): (WebKit::WebPasteboardProxy::setPasteboardURL): (WebKit::WebPasteboardProxy::setPasteboardColor): (WebKit::WebPasteboardProxy::setPasteboardStringForType): (WebKit::WebPasteboardProxy::setPasteboardBufferForType): (WebKit::WebPasteboardProxy::writeCustomData): (WebKit::WebPasteboardProxy::allPasteboardItemInfo): (WebKit::WebPasteboardProxy::informationForItemAtIndex): * UIProcess/WebPasteboardProxy.cpp: (WebKit::WebPasteboardProxy::allPasteboardItemInfo): (WebKit::WebPasteboardProxy::informationForItemAtIndex): * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::writeItemsToPasteboard): * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::changeCount): (WebKit::WebPlatformStrategies::addTypes): (WebKit::WebPlatformStrategies::setTypes): (WebKit::WebPlatformStrategies::setBufferForType): (WebKit::WebPlatformStrategies::setURL): (WebKit::WebPlatformStrategies::setColor): (WebKit::WebPlatformStrategies::setStringForType): (WebKit::WebPlatformStrategies::writeCustomData): (WebKit::WebPlatformStrategies::allPasteboardItemInfo): (WebKit::WebPlatformStrategies::informationForItemAtIndex): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2019-10-21 Daniel Bates Add some PencilKit extension points https://bugs.webkit.org/show_bug.cgi?id=202962 Reviewed by Andy Estes. This is the WebKit part corresponding to . * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): Call extension point. (-[WKContentView cleanupInteraction]): Ditto. 2019-10-21 Matt Lewis Unreviewed, rolling out r251381. This broke an internal build. Reverted changeset: "Add some PencilKit extension points" https://bugs.webkit.org/show_bug.cgi?id=202962 https://trac.webkit.org/changeset/251381 2019-10-21 Myles C. Maxfield [Cocoa] Move ui-serif, ui-monospaced, and ui-rounded out from behind SPI https://bugs.webkit.org/show_bug.cgi?id=203129 Reviewed by Tim Horton. * Shared/WebPreferences.yaml: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _shouldAllowDesignSystemUIFonts]): Deleted. (-[WKPreferences _setShouldAllowDesignSystemUIFonts:]): Deleted. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2019-10-21 youenn fablet Move service worker registration matching for navigation loads to network process https://bugs.webkit.org/show_bug.cgi?id=203144 Reviewed by Chris Dumez. Create a WebSWServerConnection whenever receiving a load request in NetworkProcess. This connection is used to check for service worker registration in case of navigation loads. Similarly, we create a WebSWClientConnection whenever WebProcess needs it, including when receiving WebSWClientConnection messages from NetworkProcess. This for instance happens when service worker registration import is complete to fill the shared registration origin store. Delay loads until SWServer has finished importing its registrations. This is needed since we might otherwise not intercept loads that could be intercepted. Waiting for importing registrations was previously ensured by WebProcess getting a matching registration in DocumentLoader. NetworkResourceLoader is now checking for service worker interception in case of redirections for navigations. This is needed as redirections could end up using a new registration. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess): (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad): (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection): (WebKit::NetworkConnectionToWebProcess::swConnection): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::continueWillSendRequest): (WebKit::NetworkResourceLoader::startWithServiceWorker): (WebKit::NetworkResourceLoader::serviceWorkerDidNotHandle): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask): (WebKit::ServiceWorkerFetchTask::start): (WebKit::ServiceWorkerFetchTask::startFetch): (WebKit::ServiceWorkerFetchTask::continueFetchTaskWith): * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: (WebKit::ServiceWorkerFetchTask::takeRequest): * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::controlClient): (WebKit::WebSWServerConnection::createFetchTask): * NetworkProcess/ServiceWorker/WebSWServerConnection.h: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didReceiveMessage): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::WebSWClientConnection): (WebKit::WebSWClientConnection::registrationReady): (WebKit::WebSWClientConnection::documentIsControlled): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWClientConnection.messages.in: 2019-10-21 Sihui Liu Remove IDBBackingStoreTemporaryFileHandler https://bugs.webkit.org/show_bug.cgi?id=203128 Reviewed by Alex Christensen. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::createIDBServer): (WebKit::NetworkProcess::accessToTemporaryFileComplete): Deleted. * NetworkProcess/NetworkProcess.h: 2019-10-21 John Wilander Resource Load Statistics: Update cookie blocking in NetworkStorageSession after first user interaction https://bugs.webkit.org/show_bug.cgi?id=203195 Reviewed by Alex Christensen and Chris Dumez. This change makes sure that the state of cookie blocking in WebCore:: NetworkStorageSession is immediately updated if the logged user interaction was new for this domain. It adds a completion handler to WebResourceLoadStatisticsStore::logUserInteraction() so that the call properly waits for everything to be updated. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::CompletionHandler Dispatch AR event on the originating anchor element https://bugs.webkit.org/show_bug.cgi?id=203198 Reviewed by Simon Fraser. Use the ElementContext on SystemPreviewInfo. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _triggerSystemPreviewActionOnElement:frame:page:]): (-[WKWebView _triggerSystemPreviewActionOnFrame:page:]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: * UIProcess/SystemPreviewController.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::systemPreviewActionTriggered): 2019-10-21 Dean Jackson Move ElementContext from WebKit to WebCore https://bugs.webkit.org/show_bug.cgi?id=203210 Reviewed by Simon Fraser. * Scripts/webkit/messages.py: * Shared/DocumentEditingContext.h: * Shared/DocumentEditingContext.mm: (IPC::ArgumentCoder::decode): * Shared/ElementContext.cpp: Removed. * Shared/ElementContext.h: Removed. * Shared/WebPreferencesDefaultValues.cpp: (WebKit::defaultCSSOMViewScrollingAPIEnabled): * Shared/WebsitePoliciesData.cpp: (WebKit::WebsitePoliciesData::decode): * Shared/ios/InteractionInformationAtPosition.h: * Sources.txt: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _requestTextInputContextsInRect:completionHandler:]): * UIProcess/API/Cocoa/_WKTextInputContext.mm: (-[_WKTextInputContext _initWithTextInputContext:]): (-[_WKTextInputContext _textInputContext]): * UIProcess/API/Cocoa/_WKTextInputContextInternal.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::textInputContextsInRect): (WebKit::WebPageProxy::focusTextInputContext): * UIProcess/WebPageProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::textInputContextsInRect): (WebKit::WebPage::focusTextInputContext): (WebKit::WebPage::elementForContext const): (WebKit::WebPage::contextForElement const): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::startInteractionWithElementContextOrPosition): 2019-10-21 Alex Christensen ServiceWorker tests should use TCPServer instead of WKURLSchemeHandler https://bugs.webkit.org/show_bug.cgi?id=203141 Reviewed by Youenn Fablet. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::addWebsiteDataStore): (WebKit::NetworkProcess::swServerForSession): (WebKit::NetworkProcess::addServiceWorkerSession): * NetworkProcess/NetworkProcess.h: * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::encode const): (WebKit::WebsiteDataStoreParameters::decode): * Shared/WebsiteDataStoreParameters.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration registerURLSchemeServiceWorkersCanHandleForTesting:]): Deleted. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::copy): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: (WebKit::WebsiteDataStoreConfiguration::serviceWorkerRegisteredSchemes const): Deleted. (WebKit::WebsiteDataStoreConfiguration::registerServiceWorkerScheme): Deleted. 2019-10-21 Tim Horton macCatalyst: Swipe navigation gestures do not work https://bugs.webkit.org/show_bug.cgi?id=203205 Reviewed by Wenson Hsieh. * UIProcess/ios/ViewGestureControllerIOS.mm: (-[WKSwipeTransitionController gestureRecognizerForInteractiveTransition:WithTarget:action:]): Use a different gesture recognizer for swipe in macCatalyst that behaves more like the macOS implementation, based on scrolling instead of the gesture coming from a screen edge. 2019-10-21 Daniel Bates Add some PencilKit extension points https://bugs.webkit.org/show_bug.cgi?id=202962 Reviewed by Andy Estes. This is the WebKit part corresponding to . * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): Call extension point. (-[WKContentView cleanupInteraction]): Ditto. 2019-10-21 Chris Dumez Add more release logging for "Unexpectedly resumed" assertion https://bugs.webkit.org/show_bug.cgi?id=203196 Reviewed by Geoffrey Garen. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::processDidResume): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::processTaskStateDidChange): 2019-10-21 Carlos Garcia Campos [GTK] Objects category in emoji picker is empty https://bugs.webkit.org/show_bug.cgi?id=203189 Reviewed by Adrian Perez de Castro. There's a typo in the first emopi name of objects section. * UIProcess/API/gtk/WebKitEmojiChooser.cpp: (webkitEmojiChooserSetupEmojiSections): uted speaker -> muted speaker 2019-10-21 Carlos Garcia Campos [GTK][WPE] IconDatabase is not thread safe yet https://bugs.webkit.org/show_bug.cgi?id=202980 Reviewed by Adrian Perez de Castro. Current implementation is safer, but we still need to protect members used by both threads. * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::populatePageURLToIconURLMap): (WebKit::IconDatabase::clearLoadedIconsTimerFired): (WebKit::IconDatabase::checkIconURLAndSetPageURLIfNeeded): (WebKit::IconDatabase::loadIconForPageURL): (WebKit::IconDatabase::iconURLForPageURL): (WebKit::IconDatabase::setIconForPageURL): (WebKit::IconDatabase::clear): * UIProcess/API/glib/IconDatabase.h: 2019-10-21 Tim Horton Clean up some includes to improve WebKit2 build speed https://bugs.webkit.org/show_bug.cgi?id=203071 Reviewed by Wenson Hsieh. This is worth about 6% on WebKit2, and unlocks another 8% improvement down the line (but which is less mechanical). * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: * NetworkProcess/NetworkSocketChannel.h: * NetworkProcess/WebStorage/StorageArea.h: * NetworkProcess/WebStorage/StorageManager.cpp: * NetworkProcess/WebStorage/StorageManagerSet.cpp: * Platform/IPC/Connection.h: * Shared/API/APIURL.h: * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: * Shared/WebCoreArgumentCoders.cpp: * Shared/WebCoreArgumentCoders.h: * UIProcess/API/APIAttachment.h: * UIProcess/API/Cocoa/_WKInspector.mm: * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h: * UIProcess/TextCheckerCompletion.cpp: * UIProcess/TextCheckerCompletion.h: * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::addNetworkProcess): (WebKit::WebUserContentControllerProxy::removeNetworkProcess): * UIProcess/UserContent/WebUserContentControllerProxy.h: (WebKit::WebUserContentControllerProxy::addNetworkProcess): Deleted. (WebKit::WebUserContentControllerProxy::removeNetworkProcess): Deleted. * WebProcess/Automation/WebAutomationSessionProxy.h: * WebProcess/Network/NetworkProcessConnection.cpp: * WebProcess/Network/NetworkProcessConnection.h: * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: * WebProcess/Plugins/PDF/PDFPlugin.mm: * WebProcess/Plugins/Plugin.cpp: * WebProcess/Plugins/Plugin.h: * WebProcess/WebProcess.cpp: 2019-10-20 Brent Fulgham Improve serialization logic https://bugs.webkit.org/show_bug.cgi?id=203039 Reviewed by Alex Christensen. Check that the SecItemRequestData only contains relevant types for CFNetwork uses. * Platform/spi/Cocoa/SecItemSPI.h: Added. * Shared/mac/SecItemRequestData.cpp: (WebKit::arrayContainsInvalidType): Added. (WebKit::dictionaryContainsInvalidType): Added. (WebKit::validTypeIDs): Added. (WebKit::isValidType): Added. (WebKit::SecItemRequestData::decode): Check types during decode. * Shared/mac/SecItemRequestData.h: * WebKit.xcodeproj/project.pbxproj: 2019-10-19 Adrian Perez de Castro [GTK][WPE] Fix non-unified builds after r250857 https://bugs.webkit.org/show_bug.cgi?id=203145 Reviewed by Carlos Garcia Campos. * UIProcess/WebProcessProxy.cpp: Add missing inclusion of the WebBackForwardCache.h header. 2019-10-18 Tim Horton macCatalyst: Cursor should send mouse events, not touch events https://bugs.webkit.org/show_bug.cgi?id=203175 Reviewed by Simon Fraser. * Platform/spi/ios/UIKitSPI.h: * Shared/NativeWebMouseEvent.h: * Shared/ios/NativeWebMouseEventIOS.mm: (WebKit::NativeWebMouseEvent::NativeWebMouseEvent): Add a NativeWebMouseEvent constructor that doesn't actually wrap a native event, for creating totally-synthetic events. * UIProcess/ios/WKMouseGestureRecognizer.h: Added. * UIProcess/ios/WKMouseGestureRecognizer.mm: Added. (webEventModifiersForUIKeyModifierFlags): (-[WKMouseGestureRecognizer initWithTarget:action:]): (-[WKMouseGestureRecognizer setView:]): (-[WKMouseGestureRecognizer lastMouseEvent]): (-[WKMouseGestureRecognizer lastMouseLocation]): (-[WKMouseGestureRecognizer mouseTouch]): (-[WKMouseGestureRecognizer _wantsHoverEvents]): (-[WKMouseGestureRecognizer reset]): (-[WKMouseGestureRecognizer _shouldReceiveTouch:forEvent:recognizerView:]): (-[WKMouseGestureRecognizer _shouldReceivePress:]): (-[WKMouseGestureRecognizer createMouseEventWithType:]): (-[WKMouseGestureRecognizer touchesBegan:withEvent:]): (-[WKMouseGestureRecognizer touchesMoved:withEvent:]): (-[WKMouseGestureRecognizer touchesEnded:withEvent:]): (-[WKMouseGestureRecognizer touchesCancelled:withEvent:]): (-[WKMouseGestureRecognizer _hoverEntered:withEvent:]): (-[WKMouseGestureRecognizer _hoverMoved:withEvent:]): (-[WKMouseGestureRecognizer _hoverExited:withEvent:]): (-[WKMouseGestureRecognizer _hoverCancelled:withEvent:]): (-[WKMouseGestureRecognizer locationInView:]): (-[WKMouseGestureRecognizer canPreventGestureRecognizer:]): (-[WKMouseGestureRecognizer canBePreventedByGestureRecognizer:]): Instead of just using UIHoverGestureRecognizer, introduce a new gesture recognizer that does what it did, but also supports cases where the button is pressed (so, mousedown and mouseup instead of just mousemove), and synthesizes mouse events for all state transitions. These events should look roughly identical to what a non-macCatalyst app would get in AppKit's mouseUp/mouseDown/mouseMoved NSResponder methods. * SourcesCocoa.txt: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView cleanupInteraction]): (-[WKContentView _removeDefaultGestureRecognizers]): (-[WKContentView _addDefaultGestureRecognizers]): (-[WKContentView gestureRecognizer:shouldReceiveTouch:]): (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): (-[WKContentView _showShareSheet:inRect:completionHandler:]): (-[WKContentView _mouseGestureRecognizerChanged:]): (webEventFlagsForUIKeyModifierFlags): Deleted. (-[WKContentView _hoverGestureRecognizerChanged:]): Deleted. * WebKit.xcodeproj/project.pbxproj: Make use of WKMouseGestureRecognizer to plumb the synthesized events directly to the macOS-style "handleMouseEvent" codepath, instead of going through the touch events path (and then subsequently generating synthetic clicks). Also, ensure that other gesture recognizers ignore the mouse "touch" entirely by returning NO in shouldReceiveTouch. 2019-10-18 Jiewen Tan [WebAuthn] Warn users when no credentials are found https://bugs.webkit.org/show_bug.cgi?id=203147 Reviewed by Brent Fulgham. This patch returns _WKWebAuthenticationPanelUpdateNoCredentialsFound to client via -[_WKWebAuthenticationPanelDelegate panel:updateWebAuthenticationPanel:] when either CtapAuthenticator receives kCtap2ErrNoCredentials or U2fAuthenticator exhausts the allow list. This patch also enhances CtapAuthenticator::tryDowngrade to check if the CTAP command can be converted to U2F commands to ensure kCtap2ErrNoCredentials is returned if it is the case. Otherwise, after downgrading, U2fAuthenticator will return NotSupportedError given it can't convert the commands. * UIProcess/API/APIUIClient.h: * UIProcess/API/APIWebAuthenticationPanelClient.h: (API::WebAuthenticationPanelClient::updatePanel const): * UIProcess/WebAuthentication/Authenticator.h: * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManager::authenticatorStatusUpdated): * UIProcess/WebAuthentication/AuthenticatorManager.h: * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h: * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm: (WebKit::WebAuthenticationPanelClient::WebAuthenticationPanelClient): (WebKit::wkWebAuthenticationPanelUpdate): (WebKit::WebAuthenticationPanelClient::updatePanel const): * UIProcess/WebAuthentication/WebAuthenticationFlags.h: Renamed from Source/WebKit/UIProcess/WebAuthentication/WebAuthenticationPanelFlags.h. * UIProcess/WebAuthentication/WebAuthenticationRequestData.h: * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp: * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp: (WebKit::CtapAuthenticator::continueGetAssertionAfterResponseReceived): (WebKit::CtapAuthenticator::tryDowngrade): * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp: (WebKit::U2fAuthenticator::issueSignCommand): * WebKit.xcodeproj/project.pbxproj: 2019-10-18 Wenson Hsieh [Clipboard API] Refactor Pasteboard::read() to take an optional item index https://bugs.webkit.org/show_bug.cgi?id=203161 Reviewed by Tim Horton. * Shared/mac/PasteboardTypes.mm: (WebKit::PasteboardTypes::forEditing): (WebKit::PasteboardTypes::forSelection): Support "com.apple.webarchive" alongside the private "Apple Web Archive pasteboard type". * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setPromisedDataForImage): 2019-10-18 Ryosuke Niwa [iOS] REGRESSION(r251269): fast/events/ios/rotation/do-not-shrink-to-fit-content-after-rotation.html and fast/events/ios/rotation/layout-viewport-during-safari-type-rotation.html fail https://bugs.webkit.org/show_bug.cgi?id=203162 Reviewed by Simon Fraser. Synchronously update the rendering before the orientation change and other viewport size updates. Otherwise, resize event will be dispatched in the middle of orientation animation, and would result in non-determistic results. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): 2019-10-18 Chris Dumez [iOS] "Unexpectedly Resumed" process assertion may cause us to get terminated https://bugs.webkit.org/show_bug.cgi?id=203046 Reviewed by Geoffrey Garen. This patch implements the following to avoid getting terminated: 1. Schedule the task to release the assertion on a background thread instead of the main thread so that we end up releasing the task even if the main thread is somehow hung. 2. Add an invalidation handler to the process assertion which releases the assertion upon expiration. * UIProcess/Cocoa/WebProcessProxyCocoa.mm: (WebKit::WebProcessProxy::processWasUnexpectedlyUnsuspended): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::processDidResume): * WebProcess/WebProcess.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::processTaskStateDidChange): 2019-10-18 Jer Noble Add experimental HDR MediaCapabilities support. https://bugs.webkit.org/show_bug.cgi?id=203113 Reviewed by Eric Carlson. Add experimental hdrMediaCapabilitiesEnabled preference. * Shared/WebPreferences.yaml: 2019-10-18 Jiewen Tan [WebAuthn] Implement AuthenticatorCancel https://bugs.webkit.org/show_bug.cgi?id=191523 Reviewed by Brent Fulgham. This patch implement two ways to cancel a pending WebAuthn ceremony: 1) Via navigation activities. Activities include i) main frame navigation, ii) main frame reload, iii) main frame destruction, iv) sub frame navigation, and v) sub frame destruction. All the above activities will cancel any pending WebAuthn ceremony that is associated with the frame. To prove the association, a GlobalFrameIdentifier is bridged into WebAuthenticationRequestData. Navigation cancel is done in WebPageProxy::didStartProvisionalLoadForFrameShared, and destruction cancel is done in WebProcessProxy::didDestroyFrame and WebPageProxy::resetState. 2) Via UI. This path is simply bridged -[_WKWebAuthenticationPanel cancel] into AuthenticatorManager. Noted, this patch follows the spec to wait until time out to notify RPs. References: i) Step 20 of https://www.w3.org/TR/webauthn/#createCredential, ii) Step 18 of https://www.w3.org/TR/webauthn/#getAssertion As for what the cancel actually does, it: 1) stops any HID/NFC scanning; 2) sends CTAPHID_CANCEL to any HID authenticators that have been added. Reference: https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#usb-hid-cancel Sending CTAPHID_CANCEL, however, is not trivial. An abstract class FidoAuthenticator is crafted to do this labor for both CtapAuthenticator and U2fAuthenticator during the time of destructions. Noted: The CtapHidDriver is the only CtapDriver implements the cancel method. Since the message is sent during state reset, lifecycle of the HidConenction and HidService which manage the underlying IOHIDDeviceRef is very hard to hold. This is required for the regular async sender. Therefore, HidConnection::sendSync is crafted to send the message synchronously to get rid of the tediousness of managing those lifecycles. P.S. Vector::grow doesn't initialize POD types. Therefore, this patch also appends it with memset for FidoHidPacket. P.S.S. This patch also simplifies AuthenticatorCoordinatorClient by: i) moving code from AuthenticatorCoordinatorClient to WebAuthenticatorCoordinatorClient, and ii) using sendWithAsyncReply. The latter allows us to get rid of the complex mechanism of ensuring the right reply is returned. * DerivedSources.make: * Sources.txt: * UIProcess/API/APIWebAuthenticationPanel.cpp: (API::WebAuthenticationPanel::create): (API::WebAuthenticationPanel::WebAuthenticationPanel): (API::WebAuthenticationPanel::cancel const): * UIProcess/API/APIWebAuthenticationPanel.h: * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: (-[_WKWebAuthenticationPanel cancel]): * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManager::cancelRequest): (WebKit::AuthenticatorManager::clearState): (WebKit::AuthenticatorManager::runPanel): (WebKit::AuthenticatorManager::resetState): * UIProcess/WebAuthentication/AuthenticatorManager.h: * UIProcess/WebAuthentication/Cocoa/HidConnection.h: (WebKit::HidConnection::isInitialized const): (WebKit::HidConnection::setIsInitialized): * UIProcess/WebAuthentication/Cocoa/HidConnection.mm: (WebKit::HidConnection::~HidConnection): (WebKit::HidConnection::initialize): (WebKit::HidConnection::terminate): (WebKit::HidConnection::sendSync): (WebKit::HidConnection::send): (WebKit::HidConnection::registerDataReceivedCallback): * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp: (WebKit::MockHidConnection::initialize): (WebKit::MockHidConnection::terminate): (WebKit::MockHidConnection::sendSync): (WebKit::MockHidConnection::send): (WebKit::MockHidConnection::feedReports): * UIProcess/WebAuthentication/Mock/MockHidConnection.h: * UIProcess/WebAuthentication/WebAuthenticationRequestData.h: * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp: (WebKit::WebAuthenticatorCoordinatorProxy::makeCredential): (WebKit::WebAuthenticatorCoordinatorProxy::getAssertion): (WebKit::WebAuthenticatorCoordinatorProxy::handleRequest): (WebKit::WebAuthenticatorCoordinatorProxy::isUserVerifyingPlatformAuthenticatorAvailable): (WebKit::WebAuthenticatorCoordinatorProxy::requestReply): Deleted. * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h: * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.messages.in: * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp: (WebKit::CtapAuthenticator::CtapAuthenticator): (WebKit::CtapAuthenticator::makeCredential): (WebKit::CtapAuthenticator::getAssertion): (WebKit::CtapAuthenticator::tryDowngrade): * UIProcess/WebAuthentication/fido/CtapAuthenticator.h: * UIProcess/WebAuthentication/fido/CtapDriver.h: (WebKit::CtapDriver::cancel): * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp: (WebKit::CtapHidDriver::Worker::write): (WebKit::CtapHidDriver::Worker::read): (WebKit::CtapHidDriver::Worker::returnMessage): (WebKit::CtapHidDriver::Worker::reset): (WebKit::CtapHidDriver::Worker::cancel): (WebKit::CtapHidDriver::continueAfterChannelAllocated): (WebKit::CtapHidDriver::continueAfterResponseReceived): (WebKit::CtapHidDriver::returnResponse): (WebKit::CtapHidDriver::reset): (WebKit::CtapHidDriver::cancel): * UIProcess/WebAuthentication/fido/CtapHidDriver.h: * UIProcess/WebAuthentication/fido/FidoAuthenticator.cpp: Copied from Source/WebKit/UIProcess/API/APIWebAuthenticationPanel.cpp. (WebKit::FidoAuthenticator::FidoAuthenticator): (WebKit::FidoAuthenticator::~FidoAuthenticator): (WebKit::FidoAuthenticator::driver const): (WebKit::FidoAuthenticator::releaseDriver): * UIProcess/WebAuthentication/fido/FidoAuthenticator.h: Copied from Source/WebKit/UIProcess/API/APIWebAuthenticationPanel.cpp. * UIProcess/WebAuthentication/fido/FidoService.cpp: (WebKit::FidoService::continueAfterGetInfo): * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp: (WebKit::U2fAuthenticator::U2fAuthenticator): (WebKit::U2fAuthenticator::issueCommand): * UIProcess/WebAuthentication/fido/U2fAuthenticator.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared): (WebKit::WebPageProxy::resetState): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didDestroyFrame): * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.cpp: (WebKit::WebAuthenticatorCoordinator::WebAuthenticatorCoordinator): (WebKit::WebAuthenticatorCoordinator::makeCredential): (WebKit::WebAuthenticatorCoordinator::getAssertion): (WebKit::WebAuthenticatorCoordinator::isUserVerifyingPlatformAuthenticatorAvailable): (WebKit::WebAuthenticatorCoordinator::~WebAuthenticatorCoordinator): Deleted. * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.h: * WebProcess/WebAuthentication/WebAuthenticatorCoordinator.messages.in: Removed. * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::fromCoreFrame): * WebProcess/WebPage/WebFrame.h: 2019-10-18 Zan Dobersek Avoid crashes on GCC-compiled binaries by avoiding a use-after-move that's the result of differring call conventions. Rubber-stamped by Carlos Garcia Campos. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): Copy the SW identifier from the ServiceWorkerFetchTask before it's moved into the lambda. 2019-10-17 Mark Lam Use constexpr in more places and remove some unnecessary external linkage. https://bugs.webkit.org/show_bug.cgi?id=203115 Reviewed by Yusuke Suzuki. * UIProcess/API/APIContentRuleListStore.h: * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm: 2019-10-17 Antoine Quint [Web Animations] Enable the Web Animations JavaScript API by default https://bugs.webkit.org/show_bug.cgi?id=203075 Reviewed by Antti Koivisto. * Shared/WebPreferences.yaml: 2019-10-17 Carlos Alberto Lopez Perez [GTK][WPE] File and Directory Entries API is not enabled https://bugs.webkit.org/show_bug.cgi?id=202796 Reviewed by Adrian Perez de Castro. Enable by default the DirectoryUpload runtime setting that is used to enable the APIs of the File and Directory Entries API. Enable also the DataTransferItemsEnabled runtime setting that exposes the DataTransferItem API. This makes the manual tests available at https://w3c-test.org/entries-api mostly pass on platform GTK (those tests need also the DataTransferItem API to enable the drag-and-drop). The bug for DataTransferItem API remains open because the layout test editing/pasteboard/data-transfer-items.html is still not passing completely. However other manual tests for DataTransferItem pass after enabling it. * Shared/WebPreferencesDefaultValues.h: 2019-10-17 Devin Rousso Web Inspector: rework frontend agent construction to allow commands/events to be controlled by the related target's type https://bugs.webkit.org/show_bug.cgi?id=200384 Reviewed by Joseph Pecoraro. * WebProcess/WebPage/RemoteWebInspectorUI.h: (WebKit::WebInspectorUI::backendCommandsURL const): Added. (WebKit::WebInspectorUI::debuggableType const): Added. (WebKit::WebInspectorUI::backendCommandsURL): Deleted. (WebKit::WebInspectorUI::debuggableType): Deleted. * WebProcess/WebPage/WebInspectorUI.h: (WebKit::WebInspectorUI::backendCommandsURL const): Added. (WebKit::WebInspectorUI::debuggableType const): Added. * UIProcess/WebPageDebuggable.h: (WebKit::WebPageDebuggable::type const): * UIProcess/glib/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::RemoteInspectorClient): * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h: * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm: (debuggableTypeString): Split the `Web` debuggable type into `Page` (WebCore::Page) and `WebPage` (WebKit::WebPageProxy). 2019-10-16 Emilio Cobos Álvarez Pass network cache directory in WebsiteDataStore::parameters() for non-Cocoa platforms. https://bugs.webkit.org/show_bug.cgi?id=203043 This was causing various errors in the network process that were visible in debug builds. Reviewed by Alex Christensen. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::parameters): 2019-10-16 Chris Dumez Rename PageCache to BackForwardCache https://bugs.webkit.org/show_bug.cgi?id=203048 Reviewed by Alex Christensen. Rename PageCache to BackForwardCache for clarity and consistency with the UIProcess's WebBackForwardCache. * Shared/CacheModel.cpp: (WebKit::calculateMemoryCacheSizes): * Shared/CacheModel.h: * Shared/WebPreferences.yaml: * UIProcess/API/APINavigationClient.h: (API::NavigationClient::willGoToBackForwardListItem): * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetPageCacheEnabled): (WKPreferencesGetPageCacheEnabled): (WKPreferencesSetPageCacheSupportsPlugins): (WKPreferencesGetPageCacheSupportsPlugins): * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setUsesPageCache:]): (-[WKPreferences _usesPageCache]): (-[WKPreferences _setPageCacheSupportsPlugins:]): (-[WKPreferences _pageCacheSupportsPlugins]): * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration pageCacheEnabled]): (-[_WKProcessPoolConfiguration setPageCacheEnabled:]): * UIProcess/API/glib/WebKitSettings.cpp: (webkit_settings_get_enable_page_cache): (webkit_settings_set_enable_page_cache): * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::NavigationState::NavigationClient::willGoToBackForwardListItem): (WebKit::NavigationState::NavigationClient::didStartProvisionalNavigation): (WebKit::NavigationState::NavigationClient::didReceiveServerRedirectForProvisionalNavigation): (WebKit::NavigationState::NavigationClient::didFailProvisionalNavigationWithError): (WebKit::NavigationState::NavigationClient::didCommitNavigation): (WebKit::NavigationState::NavigationClient::didFinishDocumentLoad): (WebKit::NavigationState::NavigationClient::didFinishNavigation): (WebKit::NavigationState::NavigationClient::didFailNavigationWithError): (WebKit::NavigationState::NavigationClient::didSameDocumentNavigation): * UIProcess/ViewGestureController.cpp: (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::shouldUseBackForwardCache const): (WebKit::WebPageProxy::willGoToBackForwardListItem): (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared): (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared): (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared): (WebKit::WebPageProxy::didCommitLoadForFrame): (WebKit::WebPageProxy::didFinishDocumentLoadForFrame): (WebKit::WebPageProxy::didFinishLoadForFrame): (WebKit::WebPageProxy::didFailLoadForFrame): (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::updateBackForwardCacheCapacity): * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp: (WKBundleBackForwardListItemIsInBackForwardCache): * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h: * WebProcess/WebCoreSupport/SessionStateConversion.cpp: (WebKit::toBackForwardListItemState): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::WebFrameLoaderClient): (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem const): (WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame): (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): (WebKit::WebFrameLoaderClient::didRestoreFromBackForwardCache): (WebKit::WebFrameLoaderClient::createPlugin): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm: (WebKit::WebFrameLoaderClient::forceLayoutOnRestoreFromBackForwardCache): * WebProcess/WebPage/VisitedLinkTableController.cpp: * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::removeItem): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::suspendForProcessSwap): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): (WebKit::WebProcess::setCacheModel): (WebKit::WebProcess::deleteWebsiteData): (WebKit::WebProcess::setBackForwardCacheCapacity): (WebKit::WebProcess::clearCachedPage): * WebProcess/WebProcess.h: 2019-10-16 Per Arne Vollan [iOS] Remove ubiquity client rule from sandbox https://bugs.webkit.org/show_bug.cgi?id=201347 Reviewed by Brent Fulgham. This rule is most likely not needed, since we have already blocked all of its associated mach services, and no issues have been reported. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-10-16 Tim Horton iOS: inputmode=none is not respected with a hardware keyboard attached https://bugs.webkit.org/show_bug.cgi?id=203061 Reviewed by Daniel Bates. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView shouldShowAutomaticKeyboardUI]): We can resolve this FIXME, as the underlying bug was fixed in . This now means that we will respect inputmode=none even when a hardware keyboard is attached, significantly improving the experience on sites that use it by avoiding an intermittent input bar. 2019-10-16 Per Arne Vollan [iOS] Remove send-signal from mach-lookup rule https://bugs.webkit.org/show_bug.cgi?id=201203 Reviewed by Brent Fulgham. The send-signal can be removed, since crashes have not been reported from this rule. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-10-16 Dean Jackson Add Swift modulemap for WebKit Private APIs https://bugs.webkit.org/show_bug.cgi?id=203059 Reviewed by Tim Horton. Provide a Swift modulemap for WebKit_Private, and ensure WKPreferencesPrivate.h is exposed. Renamed OSX.modulemap to macOS.modulemap while here. * Configurations/WebKit.xcconfig: * Modules/iOS.private.modulemap: Added. * Modules/macOS.modulemap: Renamed from Source/WebKit/Modules/OSX.modulemap. * Modules/macOS.private.modulemap: Added. * Shared/API/Cocoa/WebKitPrivate.h: Include WKPreferencesPrivate.h. 2019-10-16 John Wilander Resource Load Statistics (experimental): Block all third-party cookies on websites without prior user interaction https://bugs.webkit.org/show_bug.cgi?id=203017 Reviewed by Alex Christensen. This enhancement is off by default and controlled by an internal feature flag. The functional change is in WebCore::NetworkStorageSession::shouldBlockCookies() which is called from: - NetworkDataTaskCocoa::NetworkDataTaskCocoa() - NetworkDataTaskCocoa::willPerformHTTPRedirection shouldBlockCookies() now checks if the first-party website has received user interaction and if not, blocks all third-party cookies, regardless of the status of those third-party domains (prevalent or not). The changes to ResourceLoadStatisticsDatabaseStore and ResourceLoadStatisticsMemoryStore are about communicating which domains have received user interaction (prevalent or not) to the network storage session so that it can enforce the new restriction. The C API change and piping through the WebsiteDataStore is test infrastructure. Bundled cleanup task: Remove the two month old feature flag for NSURLSession switching. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::CompletionHandler WKWebsiteDataStoreStatisticsResetToConsistentState() should call store.setUseITPDatabase(false) https://bugs.webkit.org/show_bug.cgi?id=203020 Reviewed by Chris Dumez. The resourceLoadStatisticsStore should be reset between tests to use a memory store, and any test that needs to use the database store can use the setUseITPDatabase function. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::setUseITPDatabase): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetUseITPDatabase): (WKWebsiteDataStoreStatisticsResetToConsistentState): * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::setUseITPDatabase): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::setUseITPDatabase): * UIProcess/WebsiteData/WebsiteDataStore.h: 2019-10-16 Chris Dumez [WK2] Handle back/forward cache entry expiration in the UIProcess instead of the WebProcess https://bugs.webkit.org/show_bug.cgi?id=203034 Reviewed by Antti Koivisto. Handle back/forward cache entry expiration in the UIProcess instead of the WebProcess, now that back/forward cache management is done in the UIProcess. * UIProcess/WebBackForwardCacheEntry.cpp: (WebKit::WebBackForwardCacheEntry::WebBackForwardCacheEntry): (WebKit::WebBackForwardCacheEntry::takeSuspendedPage): (WebKit::WebBackForwardCacheEntry::expirationTimerFired): * UIProcess/WebBackForwardCacheEntry.h: Add a Timer to WebBackForwardCacheEntry to make the entry expire after 30 minutes, which is what used to happen on WebContent process side. One difference in behavior is that when the entry expires we now remove it from the cache right away to free-up memory, instead of simply refusing to use it later on. * WebProcess/WebPage/WebPage.cpp: Disable back forward cache expiration in the WebContent process when using modern WebKit. 2019-10-16 Chris Dumez [iOS] Stop terminating the prewarmed process on application suspension https://bugs.webkit.org/show_bug.cgi?id=203033 Reviewed by Alex Christensen. Stop terminating the prewarmed process on application suspension. Having no prewarmed process when the application resumes means the next cross-site load will be significantly slower. If the system needs memory, this process can be jetsammed. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::applicationIsAboutToSuspend): 2019-10-16 Chris Dumez Drop unused WKPageSetResourceCachingDisabled() SPI https://bugs.webkit.org/show_bug.cgi?id=203035 Reviewed by Alex Christensen. * UIProcess/API/C/WKPage.cpp: (WKPageGetResourceCachingDisabled): Deleted. (WKPageSetResourceCachingDisabled): Deleted. * UIProcess/API/C/WKPagePrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setResourceCachingDisabled): Deleted. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::isResourceCachingDisabled const): Deleted. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setResourceCachingDisabled): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2019-10-16 Wenson Hsieh Unreviewed, fix the internal macOS 10.13 and 10.14 builds after r251171 * Platform/spi/mac/ApplicationServicesSPI.h: Guard SPI declarations that use AXClientType with HAVE(AX_CLIENT_TYPE). 2019-10-15 Carlos Garcia Campos [GTK][WPE] Add user messages API https://bugs.webkit.org/show_bug.cgi?id=202847 Reviewed by Adrian Perez de Castro. We have never exposed an API to send/receive messages to/from Web extensions, to allow applications use their own IPC. Now, with PSON enabled, it's a lot more difficult to implement the custom IPC on the application side, because applications need to keep track of all the web processes launched, and the changes of web process in the web view to send the messages to the right extension. That's already done internally by WebKit, so it would be easier to provide a simple API so that apps don't need to worry about the web process being used. This patch adds WebKitUserMessage, a simple message API consisting on a message name, parameters and file descriptors. Messages can be sent from a WebKitWebContext to all the WebKitWebExtensions, or from a WebKitWebExtension to its WebKitWebContext, or from a WebKitWebView to its WebKitWebPage (and vice versa). * PlatformGTK.cmake: * PlatformWPE.cmake: * Shared/API/glib/WebKitUserMessage.cpp: Added. (webkitUserMessageDispose): (webkitUserMessageGetProperty): (webkitUserMessageSetProperty): (webkit_user_message_class_init): (webkitUserMessageCreate): (webkitUserMessageGetMessage): (webkit_user_message_new): (webkit_user_message_new_with_fd_list): (webkit_user_message_get_name): (webkit_user_message_get_parameters): (webkit_user_message_get_fd_list): (webkit_user_message_send_reply): * Shared/API/glib/WebKitUserMessagePrivate.h: Added. * Shared/glib/ArgumentCodersGLib.cpp: Added. (IPC::encode): (IPC::decode): * Shared/glib/ArgumentCodersGLib.h: Added. * Shared/glib/UserMessage.cpp: Added. (WebKit::UserMessage::encode const): (WebKit::UserMessage::decode): * Shared/glib/UserMessage.h: Added. (WebKit::UserMessage::UserMessage): * SourcesGTK.txt: * SourcesWPE.txt: * UIProcess/API/glib/WebKitWebContext.cpp: (webkitWebContextConstructed): (webkit_web_context_class_init): (webkit_web_context_send_message_to_all_extensions): * UIProcess/API/glib/WebKitWebView.cpp: (webkit_web_view_class_init): (webkitWebViewDidReceiveUserMessage): (webkit_web_view_send_message_to_page): (webkit_web_view_send_message_to_page_finish): * UIProcess/API/glib/WebKitWebViewPrivate.h: * UIProcess/API/gtk/WebKitUserMessage.h: Added. * UIProcess/API/gtk/WebKitWebContext.h: * UIProcess/API/gtk/WebKitWebView.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: * UIProcess/API/gtk/webkit2.h: * UIProcess/API/wpe/APIViewClient.h: (API::ViewClient::didReceiveUserMessage): * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::sendMessageToWebView): * UIProcess/API/wpe/PageClientImpl.h: * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::didReceiveUserMessage): * UIProcess/API/wpe/WPEView.h: * UIProcess/API/wpe/WebKitUserMessage.h: Added. * UIProcess/API/wpe/WebKitWebContext.h: * UIProcess/API/wpe/WebKitWebView.h: * UIProcess/API/wpe/docs/wpe-1.0-sections.txt: * UIProcess/API/wpe/docs/wpe-docs.sgml: * UIProcess/API/wpe/webkit.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * UIProcess/glib/WebProcessProxyGLib.cpp: (WebKit::WebProcessProxy::sendMessageToWebContextWithReply): (WebKit::WebProcessProxy::sendMessageToWebContext): * UIProcess/gtk/WebPageProxyGtk.cpp: (WebKit::WebPageProxy::sendMessageToWebViewWithReply): (WebKit::WebPageProxy::sendMessageToWebView): * UIProcess/wpe/WebPageProxyWPE.cpp: (WebKit::WebPageProxy::sendMessageToWebViewWithReply): (WebKit::WebPageProxy::sendMessageToWebView): * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.h: (WebKit::WebKitExtensionManager::extension const): * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp: (webkitWebExtensionDidReceiveUserMessage): (webkit_web_extension_send_message_to_context): (webkit_web_extension_send_message_to_context_finish): * WebProcess/InjectedBundle/API/glib/WebKitWebExtensionPrivate.h: * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: (webkit_web_page_class_init): (webkitWebPageDidReceiveUserMessage): (webkit_web_page_send_message_to_view): (webkit_web_page_send_message_to_view_finish): * WebProcess/InjectedBundle/API/glib/WebKitWebPagePrivate.h: * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.h: * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h: * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h: * WebProcess/InjectedBundle/API/wpe/WebKitWebExtension.h: * WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h: * WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-1.0-sections.txt: * WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/glib/WebPageGLib.cpp: Added. (WebKit::WebPage::sendMessageToWebExtensionWithReply): (WebKit::WebPage::sendMessageToWebExtension): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: * WebProcess/glib/WebProcessGLib.cpp: (WebKit::WebProcess::sendMessageToWebExtension): 2019-10-15 Wenson Hsieh Fix the internal macOS build after r251171 https://bugs.webkit.org/show_bug.cgi?id=203022 Reviewed by Dan Bernstein. Attempts to include in WebKit result in: ``` fatal error: 'HIServices/AccessibilityPriv.h' file not found ``` At least on macOS 10.15, it appears that HIServices.framework exists within the ApplicationServices framework. To fix this build error, we can instead turn AccessibilityPrivSPI.h into an SPI header for ApplicationServices, ApplicationServicesSPI.h, and use it in several places where we currently directly import . * Platform/IPC/cocoa/ConnectionCocoa.mm: Bring some more constants that were defined in the !USE(APPLE_INTERNAL_SDK) case into the ApplicationServices SPI header. * Platform/spi/mac/ApplicationServicesSPI.h: Renamed from Source/WebKit/Platform/spi/mac/AccessibilityPrivSPI.h. * Shared/mac/AuxiliaryProcessMac.mm: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: 2019-10-15 Kate Cheney REGRESSION (~244100) [Mac WK2 Debug] Layout Test http/tests/resourceLoadStatistics/prune-statistics.html is a flaky failure (197285) https://bugs.webkit.org/show_bug.cgi?id=197285 Reviewed by Chris Dumez. This patch fixes a flaky failure which was being caused by other resourceLoadStatistics tests scheduling processing checks which were called during execution of prune-statistics.html. Now, any pending processing checks are cancelled between tests. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): 2019-10-15 Chris Dumez [iOS] Maintain the last Back/Forward cache entry when the application gets suspended https://bugs.webkit.org/show_bug.cgi?id=203014 Reviewed by Geoffrey Garen. Previously, we would clear all back/forward cache entries when the application is about to be suspended. This means that we would lose fast-back when coming back to the application. To be memory-friendly but maintain the fast-back when coming back to the application, we now maintain the last back/forward cache entry when the application gets suspended. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::applicationIsAboutToSuspend): (WebKit::WebProcessPool::notifyProcessPoolsApplicationIsAboutToSuspend): * UIProcess/WebBackForwardCache.cpp: (WebKit::WebBackForwardCache::pruneToSize): * UIProcess/WebBackForwardCache.h: * UIProcess/WebProcessPool.h: * UIProcess/ios/ProcessAssertionIOS.mm: (-[WKProcessAssertionBackgroundTaskManager init]): (-[WKProcessAssertionBackgroundTaskManager _releaseBackgroundTask]): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): A WebProcess no longer clears its PageCache on suspension on iOS. We let the UIProcess's back/forward cache control when PageCache entries should get destroyed. The back/forward cache will properly wake up a suspended process to clear one of its PageCache entries if needed. 2019-10-15 Andres Gonzalez AX: Make AXIsolatedTree compile again https://bugs.webkit.org/show_bug.cgi?id=202702 Reviewed by Joanmarie Diggs. Re-submitting r251045 with a fix for internal builds. * Platform/spi/mac/AccessibilityPrivSPI.h: * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: (-[WKAccessibilityWebPageObjectBase isolatedTreeRootObject]): 2019-10-15 Chris Dumez Webview's drawing area may stay frozen on cross-site back/forward navigation https://bugs.webkit.org/show_bug.cgi?id=203004 Reviewed by Tim Horton. Whenever the UIScene becomes foreground / background, the WebPageProxy notifies its currently associated WebPage in the committed WebProcess so that it can freeze / unfreeze its layer tree with the BackgroundApplication reason. The issue is that if a WebPage gets suspended on cross-site navigation (because the UIScene is in the background when the load commits), then the suspended WebPage kept its a BackgroundApplication freeze. When the UIScene becomes foreground, the WebPage only notifies its committed page so the suspended page keeps its BackgroundApplication freeze still. If the user now navigates back, it will restore the suspended WebPage and the view will stay frozen. To address the issue, we now have the WebPage drop its BackgroundApplication freeze reason, whenever it transitions from committed to suspended. * UIProcess/ios/WKApplicationStateTrackingView.mm: (-[WKApplicationStateTrackingView didMoveToWindow]): Fix logging, [self isBackground] needs to be called *after* _applicationStateTracker has been initialized, or it will return YES unconditionally. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setIsSuspended): 2019-10-15 Peng Liu [Picture-in-Picture Web API] Implement HTMLVideoElement.requestPictureInPicture() / Document.exitPictureInPicture() https://bugs.webkit.org/show_bug.cgi?id=201024 Reviewed by Eric Carlson. Add configurations for Picture-in-Picture API and add a preference option for it. * Configurations/FeatureDefines.xcconfig: * Shared/WebPreferences.yaml: 2019-10-15 youenn fablet Move headers to keep from a HTTPHeaderNameSet to an OptionSet https://bugs.webkit.org/show_bug.cgi?id=202977 Reviewed by Anders Carlsson. * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoadParameters.h: 2019-10-15 Jiewen Tan [WebAuthn] Rename -[WKUIDelegatePrivate webView:runWebAuthenticationPanel:initiatedByFrame:completionHandler:] to -[WKUIDelegatePrivate _webView:runWebAuthenticationPanel:initiatedByFrame:completionHandler:] https://bugs.webkit.org/show_bug.cgi?id=202564 Reviewed by Brent Fulgham. Rename the SPI to a proper SPI style. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::runWebAuthenticationPanel): 2019-10-15 youenn fablet Scheduling a service worker job in server should wait for finishing the registration import https://bugs.webkit.org/show_bug.cgi?id=202975 Reviewed by Chris Dumez. * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::scheduleJobInServer): We should not schedule a job until the registrations are fully imported. Covered by ServiceWorkerBasic API test flakily hitting debug asserts. 2019-10-15 Alex Christensen Unreviewed, rolling out r251138. Broke API tests Reverted changeset: "Pass CORS-enabled schemes through WebProcess instead of having them NetworkProcess-global" https://bugs.webkit.org/show_bug.cgi?id=202891 https://trac.webkit.org/changeset/251138 2019-10-15 Chris Dumez Stop using inheritance for WebBackForwardCacheEntry https://bugs.webkit.org/show_bug.cgi?id=202989 Reviewed by Alex Christensen. Stop using inheritance for WebBackForwardCacheEntry. This simplifies the code a bit. * Sources.txt: * UIProcess/WebBackForwardCache.cpp: (WebKit::WebBackForwardCache::addEntry): (): Deleted. * UIProcess/WebBackForwardCacheEntry.cpp: Copied from Source/WebKit/UIProcess/WebBackForwardCacheEntry.h. (WebKit::WebBackForwardCacheEntry::WebBackForwardCacheEntry): (WebKit::WebBackForwardCacheEntry::~WebBackForwardCacheEntry): (WebKit::WebBackForwardCacheEntry::takeSuspendedPage): (WebKit::WebBackForwardCacheEntry::process const): * UIProcess/WebBackForwardCacheEntry.h: (WebKit::WebBackForwardCacheEntry::suspendedPage const): (WebKit::WebBackForwardCacheEntry::processIdentifier const): (WebKit::WebBackForwardCacheEntry::WebBackForwardCacheEntry): Deleted. * WebKit.xcodeproj/project.pbxproj: 2019-10-15 Alex Christensen 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-15 Carlos Garcia Campos Unreviewed. Fix several GTK tests in /WebKit2Gtk/TestUIClient crashing since r241988 Show a warning message and return nullptr from WebKitWebView::create if the new web view is not related to the given one. Also make it clear in the documentation that the new web view should be related to the given one. * UIProcess/API/glib/WebKitWebView.cpp: (webkit_web_view_class_init): (webkitWebViewCreateNewPage): 2019-10-15 Carlos Garcia Campos Unreviewed. Fix GTK test /webkit/Authentication/authentication-storage after r249962 * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewHandleAuthenticationChallenge): Do not use webkit_settings_get_enable_private_browsing(). 2019-10-15 Carlos Garcia Campos Unreviewed. Fix GTK test /webkit/WebKitSettings/webkit-settings after r249962. Legacy private browsing was removed in r249962, so webkit_settings_set_enable_private_browsing() is now no-op. * UIProcess/API/glib/WebKitSettings.cpp: (webKitSettingsSetProperty): Only call webkit_settings_set_enable_private_browsing() when trying to enable it. (webkit_settings_set_enable_private_browsing): Show a warning to let users know that it does nothing now. 2019-10-15 Carlos Garcia Campos [GTK][WPE] WebKitWebContext should identify web views by their WebPageProxy identifier https://bugs.webkit.org/show_bug.cgi?id=202924 Reviewed by Adrian Perez de Castro. Instead of the WebPage identifier, since it maps WebPageProxy to WebKitWebView. * UIProcess/API/glib/WebKitWebContext.cpp: (webkitWebContextCreatePageForWebView): (webkitWebContextWebViewDestroyed): (webkitWebContextGetWebViewForPage): 2019-10-15 youenn fablet Handle service worker loads through NetworkResourceLoader https://bugs.webkit.org/show_bug.cgi?id=202309 Unreviewed. Fix !ENABLE(SERVICE_WORKER) builds. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::continueWillSendRequest): (WebKit::NetworkResourceLoader::continueDidReceiveResponse): (WebKit::NetworkResourceLoader::serviceWorkerDidNotHandle): 2019-10-14 Youenn Fablet Handle service worker loads through NetworkResourceLoader https://bugs.webkit.org/show_bug.cgi?id=202309 Reviewed by Alex Christensen. Remove ServiceWorkerFetchClient. Instead we use the normal NetworkResourceLoader/WebResourceLoader communication channel. We pass additional parameters, in particular service worker mode and registration identifier. Based on that information, network process will decide whether to load from service worker or network. The first advantage is that in case of service worker not handling the load, going to the network is faster. This will also allow us to do the registration matching in network process when receiving a navigation request. ServiceWorkerFetchTask is now beefed up to do the link between service worker and NetworkResourceLoader/WebResourceLoader. To support the same console logging, we add a new message called DidFailServiceWorkerLoad. To support API tests, we continue to go to the service worker before trying to go to URL scheme handlers. This adds some burden as we need to go to network process/service worker process and, in case load is not handled by service worker, we go back to the web process to do the load through URL scheme handlers. For that purpose we use ServiceWorkersMode::Only. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad): * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::abort): (WebKit::NetworkResourceLoader::didFailLoading): (WebKit::NetworkResourceLoader::continueWillSendRequest): (WebKit::NetworkResourceLoader::continueDidReceiveResponse): (WebKit::NetworkResourceLoader::startWithServiceWorker): (WebKit::NetworkResourceLoader::serviceWorkerDidNotHandle): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask): (WebKit::ServiceWorkerFetchTask::~ServiceWorkerFetchTask): (WebKit::ServiceWorkerFetchTask::sendToServiceWorker): (WebKit::ServiceWorkerFetchTask::sendToClient): (WebKit::ServiceWorkerFetchTask::start): (WebKit::ServiceWorkerFetchTask::startFetch): (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse): (WebKit::ServiceWorkerFetchTask::didReceiveResponse): (WebKit::ServiceWorkerFetchTask::didReceiveData): (WebKit::ServiceWorkerFetchTask::didReceiveFormData): (WebKit::ServiceWorkerFetchTask::didFinish): (WebKit::ServiceWorkerFetchTask::didFail): (WebKit::ServiceWorkerFetchTask::didNotHandle): (WebKit::ServiceWorkerFetchTask::cancelFromClient): (WebKit::ServiceWorkerFetchTask::continueDidReceiveFetchResponse): (WebKit::ServiceWorkerFetchTask::continueFetchTaskWith): (WebKit::ServiceWorkerFetchTask::timeoutTimerFired): * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: (WebKit::ServiceWorkerFetchTask::fetchIdentifier const): (WebKit::ServiceWorkerFetchTask::serviceWorkerIdentifier const): * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::cancelFetch): (WebKit::WebSWServerConnection::createFetchTask): (WebKit::WebSWServerConnection::startFetch): * NetworkProcess/ServiceWorker/WebSWServerConnection.h: * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::startFetch): (WebKit::WebSWServerToContextConnection::continueDidReceiveFetchResponse): (WebKit::WebSWServerToContextConnection::didReceiveFetchTaskMessage): (WebKit::WebSWServerToContextConnection::registerFetch): (WebKit::WebSWServerToContextConnection::unregisterFetch): (WebKit::WebSWServerToContextConnection::fetchTaskTimedOut): * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h: (WebKit::WebSWServerToContextConnection::ipcConnection const): * Sources.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didReceiveMessage): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didFailServiceWorkerLoad): (WebKit::WebResourceLoader::serviceWorkerDidNotHandle): * WebProcess/Network/WebResourceLoader.h: * WebProcess/Network/WebResourceLoader.messages.in: * WebProcess/Storage/ServiceWorkerClientFetch.cpp: Removed. * WebProcess/Storage/ServiceWorkerClientFetch.h: Removed. * WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Removed. * WebProcess/Storage/WebSWClientConnection.cpp: * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebServiceWorkerProvider.cpp: * WebProcess/Storage/WebServiceWorkerProvider.h: 2019-10-14 Carlos Garcia Campos [GTK] White pages in AC mode: Cannot get default EGL display: EGL_BAD_PARAMETER https://bugs.webkit.org/show_bug.cgi?id=202362 Reviewed by Carlos Alberto Lopez Perez. * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: (WebKit::DrawingAreaCoordinatedGraphics::updatePreferences): Disable accelerated compositing mode when we failed to reate the shared display for compositing. * WebProcess/glib/WebProcessGLib.cpp: (WebKit::WebProcess::platformInitializeWebProcess): Destroy the wpe display when initialization fails. 2019-10-14 Chris Dumez [WK2] Have WebBackForwardCache class coordinate page caching in all WebProcesses https://bugs.webkit.org/show_bug.cgi?id=202929 Reviewed by Alex Christensen. Have WebBackForwardCache class coordinate page caching in all WebProcesses. To achieve this, the following changes were made: 1. Whenever HistoryItem::m_cachedPage changes in WebCore, we notify the client that the HistoryItem has changed. I added a "hasCachedPage" boolean to the item info being passed the the UIProcess that is set based on whether or not HistoryItem::m_cachedPage is null. 2. The WebBackForwardCache now contains WebBackForwardCacheEntry objects instead of SuspendedPage objects. A WebBackForwardCacheEntry may have a SuspendedPage or not. As a result, we can now add the the back/forward cache CachedPage entries from the WebContent process, which do not have a SuspendedPageProxy in the UIProcess. 3. Now that WebBackForwardCache is aware of all CachedPages, it can properly enforce a cache capacity across call processes. Whenever a WebBackForwardCacheEntry is pruned from the cache and this entry does not have a SuspendedPageProxy, we send an IPC to the WebContent process to remove this cached page from the PageCache in WebCore. Previously, as soon as we would cache a page in the WebContent process, we would send an IPC to the UIProcess so that it would clear the PageCache in any previous WebContent process. This was a stop-gap measure to avoid blowing up memory in a multi-process model by keeping a PageCache around in all WebContent process. This would make sure only one process could have a PageCache at any point in time. This logic is now dropped since the WebBackForwardCache can keep track of all cached pages across all processes and enforce a cross-process limit on the number of cached pages. This means we can now have PageCache entries across several WebContent processes, as long as we do not exceed the maximum number of cached pages. * Platform/Logging.h: Add new BackForwardCache logging channel. * Shared/SessionState.cpp: (WebKit::BackForwardListItemState::encode const): (WebKit::BackForwardListItemState::decode): * Shared/SessionState.h: Add new bit to BackForwardListItemState to indicate whether a HistoryItem has an associated CachedPage or not. * Shared/WebBackForwardListItem.cpp: (WebKit::WebBackForwardListItem::~WebBackForwardListItem): (WebKit::WebBackForwardListItem::wasRemovedFromBackForwardList): (WebKit::WebBackForwardListItem::removeFromBackForwardCache): (WebKit::WebBackForwardListItem::setBackForwardCacheEntry): (WebKit::WebBackForwardListItem::suspendedPage const): (WebKit::WebBackForwardListItem::loggingString): * Shared/WebBackForwardListItem.h: (WebKit::WebBackForwardListItem::backForwardCacheEntry const): WebBackForwardListItem now own a WebBackForwardCacheEntry instead of simply a SuspendedPage. The WebBackForwardCacheEntry may have a SuspendedPage or not. Now, whenever a HistoryItem has a CachedPage in WebCore, its corresponding WebBackForwardListItem in the UIProcess has an associated WebBackForwardCacheEntry whether we have a SuspendedPageProxy for it in the UIProcess or not. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: Pass the PageCache capacity to the WebContent process on creation, so that it matches the capacity of the WebBackForwardCache in the UIProcess. * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::goToBackForwardItem): * UIProcess/SuspendedPageProxy.cpp: (WebKit::messageNamesToIgnoreWhileSuspended): (WebKit::SuspendedPageProxy::suspensionTimedOut): * UIProcess/SuspendedPageProxy.h: Stop storing the WebBackForwardListItem on the SuspendedPageProxy. This avoids having to keep this pointer up to date. We do not really need it as we can now ask the WebBackForwardCache to clear an entry by giving it a SuspendedPageProxy to match. Given how many entries we have at most in the cache (2), iterating over them to find the one with a given suspended page is cheap. * UIProcess/WebBackForwardCache.cpp: (WebKit::WebBackForwardCache::WebBackForwardCache): (WebKit::WebBackForwardCache::~WebBackForwardCache): (WebKit::WebBackForwardCache::setCapacity): Send an IPC of each WebProcess whenever the capacity of the WebBackForwardCache changes, in order to update the capacity of the PageCache in those processes. (WebKit::WebBackForwardCache::addEntry): (WebKit::WebBackForwardCache::removeEntry): (WebKit::WebBackForwardCache::takeSuspendedPage): (WebKit::WebBackForwardCache::removeEntriesForProcess): (WebKit::WebBackForwardCache::removeEntriesForSession): (WebKit::WebBackForwardCache::removeEntriesMatching): (WebKit::WebBackForwardCache::clear): * UIProcess/WebBackForwardCache.h: Use a Vector instead of a ListHashSet to store the entries. Given that we have at most 2 entries, using a Vector will likely be more efficient and definitely use less memory. * UIProcess/WebBackForwardCacheEntry.h: Added. (WebKit::WebBackForwardCacheEntry::backForwardCache const): (WebKit::WebBackForwardCacheEntry::WebBackForwardCacheEntry): Add new WebBackForwardCacheEntry abstraction to match the concept of WebCore::CachedPage in the UIProcess. A WebBackForwardCacheEntry may have a SuspendedPageProxy associated with it in the UIProcess or not. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedNavigationPolicyDecision): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Drop didSaveToPageCache as it is no longer necessary. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): (WebKit::WebProcessPool::disconnectProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::updateBackForwardItem): Whenever we get a BackForwardItem from the WebContent process, we now check it now has an associated CachedPage or not. If it does, we make sure we add a corresponding entry in the WebBackForwardCache so that the UIProcess knows about it. If it no longer has a CachedPage and we don't have a SuspendedPageProxy for this item in the UIProcess, then we remove the corresponding entry from the back/forward cache. Note that we don't drop SuspendedPageProxy objects in the UIProcess simply because their corresponding CachedPage in the WebProcess is gone, to maintain previous behavior. This is an optimization that is useful on iOS, where we do not have a WebProcessCache, since we can reuse processes from SuspendedPageProxies on navigation. * UIProcess/WebProcessProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/SessionStateConversion.cpp: (WebKit::toBackForwardListItemState): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): (WebKit::WebProcess::setBackForwardCacheCapacity): (WebKit::WebProcess::clearCachedPage): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2019-10-14 Wenson Hsieh [Clipboard API] Refactor custom pasteboard writing codepaths to handle multiple items https://bugs.webkit.org/show_bug.cgi?id=202916 Reviewed by Tim Horton. Change more function and method signatures from `const PasteboardCustomData&` to `const Vector&`. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::writeCustomData): * UIProcess/WebPasteboardProxy.cpp: (WebKit::WebPasteboardProxy::writeCustomData): * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::writeCustomData): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2019-10-14 Per Arne Vollan REGRESSION(251087): Several API tests are failing https://bugs.webkit.org/show_bug.cgi?id=202961 Reviewed by Brent Fulgham. WebPageProxy::maybeInitializeSandboxExtensionHandle returns early if the WebContent process is currently launching, since the audit token is needed to create the sandbox extension. The audit token will not be available until the process has finished launching. In the same way, the method should return early if the WebContent process has terminated. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle): 2019-10-14 Matt Mokary FindController::findString always updates foundStringMatchIndex even if match is the same as before https://bugs.webkit.org/show_bug.cgi?id=201775 Reviewed by Tim Horton. Allow an update to a find string without changing current match index, as is often the desired behavior when modifying a query rather than moving forward or backward through a match set. * Shared/WebFindOptions.h: * UIProcess/API/Cocoa/WKWebView.mm: (toFindOptions): * UIProcess/API/Cocoa/_WKFindOptions.h: * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::findString): Do not change match index if NoIndexChange bit is set. Otherwise, no change in behavior. 2019-10-14 David Quesada Remove WebCore::IOSApplication::isWebApp() https://bugs.webkit.org/show_bug.cgi?id=181259 Reviewed by Alex Christensen. * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::defaultApplicationCacheDirectory): Remove the wording "this is not supported as of right now", as it seems to be supported since r247686, which added SPI on _WKWebsiteDataStoreConfiguration to set the application cache directory. 2019-10-14 Wenson Hsieh [Clipboard API] Support writing multiple PasteboardCustomData with SharedBuffers to the pasteboard https://bugs.webkit.org/show_bug.cgi?id=202851 Reviewed by Darin Adler. See WebCore ChangeLog for more details. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Add helpers to encode and decode PasteboardCustomData::Entry. (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: Add support for encoding and decoding PasteboardCustomData by encoding and decoding each of its items (see above). * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::requestDOMPasteAccess): * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView canPerformActionForWebView:withSender:]): (allPasteboardItemOriginsMatchOrigin): (-[WKContentView _didHandleAdditionalDragItemsRequest:]): Tweak several methods to use the new methods on PasteboardCustomData instead of accessing the member variables directly. (-[WKContentView cleanUpDragSourceSessionState]): (-[WKContentView _prepareToDragPromisedAttachment:]): (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationLists:stagedDragSource:]): (-[WKContentView dragInteraction:itemsForBeginningSession:]): (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]): Deleted. Adjust these methods to handle multiple staged item providers (for now, it remains that iOS drag and drop codepaths will still only write a single item to the pasteboard). 2019-10-14 Per Arne Vollan [macOS] Sandbox extensions should be created with audit tokens, not PIDs https://bugs.webkit.org/show_bug.cgi?id=201828 Reviewed by Brent Fulgham. Stop issuing mach/read sandbox extensions by PID in the UI process, and use audit tokens instead. The audit tokens for the WebContent processes are retrieved from the IPC connection to the process. * Shared/Cocoa/SandboxExtensionCocoa.mm: (WebKit::SandboxExtensionImpl::create): (WebKit::SandboxExtensionImpl::sandboxExtensionForType): (WebKit::SandboxExtensionImpl::SandboxExtensionImpl): (WebKit::SandboxExtension::createHandleForMachLookupByAuditToken): (WebKit::SandboxExtension::createHandleForReadByAuditToken): (WebKit::SandboxExtension::createHandleForMachLookupByPid): Deleted. (WebKit::SandboxExtension::createHandleForReadByPid): Deleted. * Shared/SandboxExtension.h: * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle): (WebKit::WebPageProxy::loadRequestWithNavigationShared): (WebKit::WebPageProxy::loadFile): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::shouldSendPendingMessage): (WebKit::WebProcessProxy::didFinishLaunching): * UIProcess/ios/WebProcessProxyIOS.mm: (WebKit::WebProcessProxy::unblockAccessibilityServerIfNeeded): 2019-10-14 Myles C. Maxfield [Cocoa] REGRESSION (r245672): Contenteditable with optical sizing freezes Safari https://bugs.webkit.org/show_bug.cgi?id=202262 Reviewed by Tim Horton. r250640 didn't go far enough. We need to apply the same fix everywhere [NSFontDescriptor fontDescriptorWithFontAttributes:] is called. * Shared/Cocoa/ArgumentCodersCocoa.mm: (IPC::decodeFontInternal): * Shared/Cocoa/CoreTextHelpers.h: Added. * Shared/Cocoa/CoreTextHelpers.mm: Added. (fontDescriptorWithFontAttributes): * SourcesCocoa.txt: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::updateFontManagerIfNeeded): * UIProcess/mac/WebPopupMenuProxyMac.mm: (WebKit::WebPopupMenuProxyMac::showPopupMenu): * WebKit.xcodeproj/project.pbxproj: 2019-10-14 Truitt Savell Unreviewed, rolling out r251045. Broke internal builds Reverted changeset: "AX: Make AXIsolatedTree compile again" https://bugs.webkit.org/show_bug.cgi?id=202702 https://trac.webkit.org/changeset/251045 2019-10-14 youenn fablet Reuse existing web processes for running service workers https://bugs.webkit.org/show_bug.cgi?id=202195 Unreviewed. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::disableServiceWorkers): (WebKit::WebProcessProxy::enableServiceWorkers): Fix case where ENABLE_SERVICE_WORKER is not defined. 2019-10-14 Philippe Normand [GTK][WebInspector] Support for saving data https://bugs.webkit.org/show_bug.cgi?id=202894 Reviewed by Carlos Garcia Campos. Implement the WebInspectorProxy::platformSave() method. This allows users to save the inspector performance measurements, for instance. * UIProcess/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::platformSave): * WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp: (WebKit::WebInspectorUI::canSave): 2019-10-14 youenn fablet Reuse existing web processes for running service workers https://bugs.webkit.org/show_bug.cgi?id=202195 Reviewed by Chris Dumez. When network process asks for a service worker context connection, we now iterate through existing web processes and reuse one if both session and registrable domain match. We then ask the web process to create a context connection to the network process. When network process no longer needs the connection, it instructs the UIProcess that will update its state so that the web process is no longer considered as running service workers. UIProcess then instructs the web process to stop its service workers and its connection. Later on, the same web process may be reused for running service workers in which case a new connection will replace the stopped connection. Similarly, on network process crash, all web process running service workers are updated so that they are no longer considered as running service workers. Add a boolean state to WebProcessPool to control whether creating a separate service worker process. We no longer terminate the web process when stopping service workers or when network process crash. We use the enableTermination/disableTermination at context connection start/stop time. We consider that the context connection is similar to running a page in the process and creating/removing a page calls disableTermination/enableTermination. NetworkProcess is handling the management of service worker processes by checking for clients. In case there is no client, the process is terminated. This removes the need for the WebProcessPool service worker process timer. This patch removes this timer. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didReceiveMessage): (WebKit::NetworkConnectionToWebProcess::establishSWContextConnection): (WebKit::NetworkConnectionToWebProcess::closeSWContextConnection): (WebKit::NetworkConnectionToWebProcess::serverToContextConnectionNoLongerNeeded): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection): (WebKit::WebSWServerToContextConnection::~WebSWServerToContextConnection): (WebKit::WebSWServerToContextConnection::messageSenderConnection const): (WebKit::WebSWServerToContextConnection::connectionIsNoLongerNeeded): (WebKit::WebSWServerToContextConnection::startFetch): * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h: * UIProcess/API/C/WKContext.cpp: (WKContextSetUseSeparateServiceWorkerProcess): * UIProcess/API/C/WKContextPrivate.h: * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _setUseSeparateServiceWorkerProcess:]): (-[WKProcessPool _webPageContentProcessCount]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::workerContextConnectionNoLongerNeeded): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::networkProcessCrashed): (WebKit::WebProcessPool::establishWorkerContextConnectionToNetworkProcess): (WebKit::WebProcessPool::removeFromServiceWorkerProcesses): (WebKit::WebProcessPool::disconnectProcess): (WebKit::WebProcessPool::createWebPage): (WebKit::WebProcessPool::terminateNetworkProcess): (WebKit::WebProcessPool::setUseSeparateServiceWorkerProcess): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::createForServiceWorkers): (WebKit::WebProcessProxy::canTerminateAuxiliaryProcess): (WebKit::WebProcessProxy::didStartProvisionalLoadForMainFrame): (WebKit::WebProcessProxy::disableServiceWorkers): (WebKit::WebProcessProxy::enableServiceWorkers): * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::isMatchingRegistrableDomain const): * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::m_userAgent): (WebKit::WebSWContextManagerConnection::terminateWorker): (WebKit::WebSWContextManagerConnection::syncTerminateWorker): (WebKit::WebSWContextManagerConnection::close): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::networkProcessConnectionClosed): (WebKit::WebProcess::registerServiceWorkerClients): 2019-10-12 Chris Dumez Back/Forward cache does not work after doing a favorite navigation https://bugs.webkit.org/show_bug.cgi?id=202762 Reviewed by Antti Koivisto. When a process-swap was forced by the client, we would always close the page in the previous process after navigating. This would prevent leveraging the back/forward cache when navigating back after such a process-swap. The reason we were doing this is that other pages may have opener link to this page and closing the page was an easy way to break this opener link. To address the issue, we no longer close the previous page when a process-swap is forced by the client. Instead, we make sure to disconnect the frames' openees from their opener then the opener enters the page cache. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::suspendCurrentPageIfPossible): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::suspendForProcessSwap): 2019-10-12 Chris Dumez Clearing Website data for a given session should not shut down cached processes for other sessions https://bugs.webkit.org/show_bug.cgi?id=202865 Reviewed by Antti Koivisto. When clearing Website data for a given data store, we now only clear cached processes (either if BackForwardCache or WebProcessCache) if they are associated with this particular data store. It is very wasteful otherwise. * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy): * UIProcess/SuspendedPageProxy.cpp: (WebKit::SuspendedPageProxy::~SuspendedPageProxy): ProvisionalPageProxy & SuspendedPageProxy's destructors no longer call WebProcessProxy::maybeShutdown() asynchronously. We now call maybeShutdown() synchronously in WebProcessProxy::decrementSuspendedPageCount() and WebProcessProxy::removeProvisionalPageProxy() instead. This makes things a lot more predictable. * UIProcess/WebBackForwardCache.cpp: (WebKit::WebBackForwardCache::removeEntriesForSession): Add new removeEntriesForSession() method to clear only back / forward cache entries associated with a particular session. (WebKit::WebBackForwardCache::clear): Stop taking a parameter indicating if we allow the processes to enter the process cache. Now that we call maybeShutdown() synchronously when destroying a SuspendedPageProxy, we can simply allow the processes to enter the process cache unconditionally. If the caller does not want this processes in the page cache, they can clear the process cache afterwards. * UIProcess/WebBackForwardCache.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedNavigationPolicyDecision): Now that destroying a SuspendedPageProxy or a ProvisionalPageProxy may shutdown their process synchronously, add a scope here to prevent shutdown of the process for the duration of this scope, since we're about to use it for a navigation and we don't want it to get shutdown, even if there is no longer anything using it. (WebKit::WebPageProxy::continueNavigationInNewProcess): Add new assertion and rename parameter for consistency. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::handleMemoryPressureWarning): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::addProvisionalPageProxy): Add new assertion. (WebKit::WebProcessProxy::removeProvisionalPageProxy): Call maybeShutDown() if this was the last provisional page. (WebKit::WebProcessProxy::maybeShutDown): Drop parameter indicating if we want to allow the process to enter the process cache and allow caching unconditionally. (WebKit::WebProcessProxy::canTerminateAuxiliaryProcess): Prevent termination if there is a ScopePreventingShutdown. (WebKit::WebProcessProxy::decrementSuspendedPageCount): Call maybeShutDown() if this was the last suspended page. * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::ScopePreventingShutdown::ScopePreventingShutdown): (WebKit::WebProcessProxy::ScopePreventingShutdown::~ScopePreventingShutdown): (WebKit::WebProcessProxy::makeScopePreventingShutdown): Add new facility to prevent shutdown of a process for the duration of the scope. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::removeData): When removing website data, only clear cached processes if they are associated with the current data store. 2019-10-12 Chris Fleizach AX: Make AXIsolatedTree compile again https://bugs.webkit.org/show_bug.cgi?id=202702 Reviewed by Joanmarie Diggs. * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: (-[WKAccessibilityWebPageObjectBase isolatedTreeRootObject]): 2019-10-11 Rob Buis Cleanup RuntimeEnabledFeatures includes https://bugs.webkit.org/show_bug.cgi?id=202857 Reviewed by Eric Carlson. These classes must have had made use of runtime flags before but are not using them anymore. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: * UIProcess/Plugins/mac/PluginInfoStoreMac.mm: * UIProcess/WebAuthentication/Cocoa/LocalService.mm: * UIProcess/WebProcessPool.cpp: 2019-10-11 Chris Dumez Move SuspendedPage logic from WebProcessPool to new WebBackForwardCache class https://bugs.webkit.org/show_bug.cgi?id=202660 Reviewed by Antti Koivisto. Move SuspendedPage logic from WebProcessPool to new WebBackForwardCache class. This is a first step towards implementing back / forward cache handling in the UIProcess. The following changes were made: 1. SuspendedPageProxy objects are now normally owned by their associated WebBackForwardListItem (Similarly to CachedPage objects being owned by their HistoryItem in WebCore) instead of the WebProcessPool. 2. A new WebBackForwardCache class is introduced to cap the number of cached pages and clear them (similary to the PageCache in WebCore). * Shared/WebBackForwardListItem.cpp: (WebKit::WebBackForwardListItem::~WebBackForwardListItem): (WebKit::WebBackForwardListItem::wasRemovedFromBackForwardList): (WebKit::WebBackForwardListItem::setSuspendedPage): (WebKit::WebBackForwardListItem::takeSuspendedPage): (WebKit::WebBackForwardListItem::suspendedPage const): * Shared/WebBackForwardListItem.h: * Sources.txt: * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _maximumSuspendedPageCount]): * UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.cpp: * UIProcess/SuspendedPageProxy.cpp: (WebKit::SuspendedPageProxy::findReusableSuspendedPageProcess): (WebKit::SuspendedPageProxy::SuspendedPageProxy): (WebKit::SuspendedPageProxy::~SuspendedPageProxy): (WebKit::SuspendedPageProxy::setBackForwardListItem): (WebKit::SuspendedPageProxy::clearBackForwardListItem): (WebKit::SuspendedPageProxy::backForwardCache const): (WebKit::SuspendedPageProxy::suspensionTimedOut): * UIProcess/SuspendedPageProxy.h: * UIProcess/WebAuthentication/Mock/MockHidConnection.h: * UIProcess/WebAuthentication/Mock/MockHidService.h: * UIProcess/WebBackForwardCache.cpp: Added. (WebKit::WebBackForwardCache::removeOldestEntry): (WebKit::WebBackForwardCache::setCapacity): (WebKit::WebBackForwardCache::addEntry): (WebKit::WebBackForwardCache::removeEntry): (WebKit::WebBackForwardCache::takeEntry): (WebKit::WebBackForwardCache::removeEntriesForProcess): (WebKit::WebBackForwardCache::removeEntriesForPage): (WebKit::WebBackForwardCache::removeEntriesMatching): (WebKit::WebBackForwardCache::clear): * UIProcess/WebBackForwardCache.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Mock/MockHidService.h. (WebKit::WebBackForwardCache::capacity const): (WebKit::WebBackForwardCache::size const): * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::didRemoveItem): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::suspendCurrentPageIfPossible): (WebKit::WebPageProxy::backForwardCache const): (WebKit::WebPageProxy::shouldUseBackForwardCache const): (WebKit::WebPageProxy::close): (WebKit::WebPageProxy::receivedNavigationPolicyDecision): (WebKit::WebPageProxy::resetState): (WebKit::WebPageProxy::enterAcceleratedCompositingMode): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::process const): * UIProcess/WebProcessPool.cpp: (WebKit::m_webProcessCache): (WebKit::WebProcessPool::disconnectProcess): (WebKit::WebProcessPool::processForRegistrableDomain): (WebKit::WebProcessPool::handleMemoryPressureWarning): (WebKit::WebProcessPool::updateBackForwardCacheCapacity): (WebKit::WebProcessPool::setCacheModel): * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::removeData): (WebKit::WebsiteDataStore::setMockWebAuthenticationConfiguration): * WebKit.xcodeproj/project.pbxproj: 2019-10-11 Alex Christensen Only use CFNetwork SPI for metrics where needed https://bugs.webkit.org/show_bug.cgi?id=202825 Reviewed by Joseph Pecoraro. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (stringForSSLProtocolVersion): (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]): 2019-10-11 Kate Cheney Get StorageAccess API features working on SQLite database implementation (195422) https://bugs.webkit.org/show_bug.cgi?id=195422 Reviewed by Brent Fulgham. This patch migrates the http/tests/storageAccess/ Layout tests to use the ITP database and uncovered 3 bugs in the process. 1. It was previously blocking cookies to a third party domain which was not marked as prevalent. Now it ensures that the user is prompted using the storage acess API regarding that third party domain. 2. It was not requesting storage access if cookies had previously been blocked. Now it will only return early from ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener if cookie access is allowed, and request storage access otherwise. 3. hasUserGrantedStorageAccessThroughPrompt was returning true even if the result was not previously granted storage access. All of these fixes match behavior in ResourceLoadStatisticsMemoryStore. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess): (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener): (WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt): 2019-10-11 Dean Jackson REGRESSION: fast/events/touch/ios/long-press-on-image.html is failing https://bugs.webkit.org/show_bug.cgi?id=202845 Reviewed by Antoine Quint. Update _contentsOfUserInterfaceItem so that it returns more information on a context menu. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _contentsOfUserInterfaceItem:]): 2019-10-11 Alex Christensen Use sendWithAsyncReply for cookie getting/clearing functions https://bugs.webkit.org/show_bug.cgi?id=202841 Reviewed by Carlos Garcia Campos. No change in behavior. This just simplifies the message sending a bit. * NetworkProcess/Cookies/WebCookieManager.cpp: (WebKit::WebCookieManager::getHostnamesWithCookies): (WebKit::WebCookieManager::deleteAllCookies): (WebKit::WebCookieManager::deleteCookie): (WebKit::WebCookieManager::deleteAllCookiesModifiedSince): (WebKit::WebCookieManager::getAllCookies): (WebKit::WebCookieManager::getCookies): (WebKit::WebCookieManager::setCookie): (WebKit::WebCookieManager::setCookies): (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy): (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy): * NetworkProcess/Cookies/WebCookieManager.h: * NetworkProcess/Cookies/WebCookieManager.messages.in: * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm: * UIProcess/API/APIHTTPCookieStore.cpp: (API::HTTPCookieStore::cookies): (API::HTTPCookieStore::setCookies): (API::HTTPCookieStore::deleteCookie): (API::HTTPCookieStore::setHTTPCookieAcceptPolicy): * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _setCookieAcceptPolicy:]): * UIProcess/API/glib/WebKitCookieManager.cpp: (webkit_cookie_manager_set_accept_policy): (webkit_cookie_manager_get_accept_policy): (webkit_cookie_manager_add_cookie): (webkit_cookie_manager_get_cookies): (webkit_cookie_manager_delete_cookie): * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::addSingleCookie): * UIProcess/AuxiliaryProcessProxy.h: (WebKit::AuxiliaryProcessProxy::sendWithAsyncReply): * UIProcess/WebCookieManagerProxy.cpp: (WebKit::WebCookieManagerProxy::processPoolDestroyed): (WebKit::WebCookieManagerProxy::processDidClose): (WebKit::WebCookieManagerProxy::getHostnamesWithCookies): (WebKit::WebCookieManagerProxy::deleteCookie): (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince): (WebKit::WebCookieManagerProxy::setCookies): (WebKit::WebCookieManagerProxy::getAllCookies): (WebKit::WebCookieManagerProxy::getCookies): (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy): (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy): (WebKit::WebCookieManagerProxy::didGetHostnamesWithCookies): Deleted. (WebKit::WebCookieManagerProxy::didSetCookies): Deleted. (WebKit::WebCookieManagerProxy::didGetCookies): Deleted. (WebKit::WebCookieManagerProxy::didDeleteCookies): Deleted. (WebKit::WebCookieManagerProxy::didGetHTTPCookieAcceptPolicy): Deleted. (WebKit::WebCookieManagerProxy::didSetHTTPCookieAcceptPolicy): Deleted. * UIProcess/WebCookieManagerProxy.h: * UIProcess/WebCookieManagerProxy.messages.in: 2019-10-10 Alex Christensen Remove unused WebProcessPool::requestNetworkingStatistics https://bugs.webkit.org/show_bug.cgi?id=202818 Reviewed by Chris Dumez. Its only use was removed in rdar://problem/56160996 * NetworkProcess/Downloads/DownloadManager.h: (WebKit::DownloadManager::isDownloading const): (WebKit::DownloadManager::activeDownloadCount const): Deleted. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::getNetworkProcessStatistics): Deleted. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Shared/Authentication/AuthenticationManager.h: (WebKit::AuthenticationManager::outstandingAuthenticationChallengeCount const): Deleted. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::didReceiveMessage): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::getStatistics): (WebKit::WebProcessPool::requestNetworkingStatistics): Deleted. * UIProcess/WebProcessPool.h: 2019-10-10 Basuke Suzuki [WinCairo] Move remote communication handling from RemoteInspectorServer to RemoteInspector. https://bugs.webkit.org/show_bug.cgi?id=202763 Reviewed by Ross Kirsling. Remove deleted method invocations. * UIProcess/win/WebProcessPoolWin.cpp: (WebKit::initializeRemoteInspectorServer): (WebKit::WebProcessPool::platformInitialize): 2019-10-10 Youenn Fablet Do not timeout a load intercepted by service worker that receives a response https://bugs.webkit.org/show_bug.cgi?id=202787 Reviewed by Chris Dumez. Stop making ServiceWorkerFetchTask ref counted since it is not needed and can potentially make ServiceWorkerFetchTask oulive its WebSWServerToContextConnection member. Stop the ServiceWorkerFetchTask timeout timer whenever receiving a response so that the load will not timeout in that case. This ensures that a load that is starting in a service worker will not be failing. Instead the load will go to network process. Removed m_didReachTerminalState which is not needed as WebSWServerToContextConnection unregisters the ServiceWorkerFetchTask as an IPC listener for all terminating messages. * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse): (WebKit::ServiceWorkerFetchTask::didReceiveResponse): (WebKit::ServiceWorkerFetchTask::didReceiveData): (WebKit::ServiceWorkerFetchTask::didReceiveFormData): (WebKit::ServiceWorkerFetchTask::didFinish): (WebKit::ServiceWorkerFetchTask::didFail): (WebKit::ServiceWorkerFetchTask::didNotHandle): (WebKit::ServiceWorkerFetchTask::timeoutTimerFired): * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::startFetch): (WebKit::WebSWServerToContextConnection::fetchTaskTimedOut): Use a Vector instead of a HasSet for performance reasons. Update according fetch map using unique_ptr instead of Ref<>. * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h: 2019-10-10 Rob Buis SpeculativeLoad should use CompletionHandler https://bugs.webkit.org/show_bug.cgi?id=202795 Reviewed by Chris Dumez. SpeculativeLoad should use CompletionHandler, as remarked in Bug 201641 review. * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: 2019-10-10 Wenson Hsieh Support programmatic paste requests on macOS https://bugs.webkit.org/show_bug.cgi?id=202773 Reviewed by Tim Horton. Adds support for programmatic paste requests on macOS, as well as some testing SPI in WKWebView to allow WebKitTestRunner to grab the NSMenu used for the DOM paste request. This patch adopts the same strategy taken to allow programmatic paste on iOS, by allowing programmatic pastes coming from the page to show platform UI which the user must then interact with in order to proceed with the paste. See below for more details. * Shared/WebPreferencesDefaultValues.h: Make this available on both iOS and macOS (iOS family is omitted for now, since callout bar UI is not generally present on non-iOS iOS-family platforms such as Apple Watch). * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _web_grantDOMPasteAccess]): This selector is called when the user taps the Paste option in the presented NSMenu. (-[WKWebView _activeMenu]): Returns the currently active NSMenu. Only for testing purposes. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView _web_grantDOMPasteAccess]): Same exercise as above, only for WKView instead of WKWebView. * UIProcess/Cocoa/WebViewImpl.h: (WebKit::WebViewImpl::domPasteMenu const): * UIProcess/Cocoa/WebViewImpl.mm: (-[WKDOMPasteMenuDelegate initWithWebViewImpl:]): (-[WKDOMPasteMenuDelegate menuDidClose:]): (-[WKDOMPasteMenuDelegate numberOfItemsInMenu:]): (-[WKDOMPasteMenuDelegate confinementRectForMenu:onScreen:]): Adds a new object, whose purpose is to be a delegate for the NSMenu that is presented when requesting DOM paste access. This object is used instead of WKWebView, since API clients may end up making the WKWebView the delegate for a different menu, in which case some implementations (either theirs or ours) of NSMenuDelegate methods would not be called. Avoiding this would require the client to be aware that WKWebView conforms to NSMenuDelegate, which is only declared privately. (WebKit::WebViewImpl::handleProcessSwapOrExit): On process swap or exit, automatically bail out of any pending DOM paste request by denying it. (WebKit::WebViewImpl::requestDOMPasteAccess): (WebKit::WebViewImpl::handleDOMPasteRequestWithResult): Handle the DOM paste request by showing an NSMenu near the mouse cursor with a single option to paste. * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::requestDOMPasteAccess): 2019-10-10 youenn fablet Remove unified plan runtime flag https://bugs.webkit.org/show_bug.cgi?id=202721 Reviewed by Geoffrey Garen. * Shared/WebPreferences.yaml: * UIProcess/API/glib/WebKitSettings.cpp: (webKitSettingsConstructed): Remove ability to disable unified plan. 2019-10-10 Adrian Perez de Castro Remove a "The " in "The The HTTP headers of the response" https://bugs.webkit.org/show_bug.cgi?id=194851 Reviewed by Carlos Garcia Campos. * Shared/API/glib/WebKitURIResponse.cpp: (webkit_uri_response_class_init): Fix typo in description of the WebKitURIResponse::http-headers property. 2019-10-10 youenn fablet [Mac] Allow SYS___pthread_markcancel call https://bugs.webkit.org/show_bug.cgi?id=202723 Reviewed by Alex Christensen. Allow this pthread call as libwebrtc uses it on the Mac as well. * WebProcess/com.apple.WebProcess.sb.in: 2019-10-09 youenn fablet A service worker process should not be created when enqueuing a service worker job https://bugs.webkit.org/show_bug.cgi?id=202578 Reviewed by Chris Dumez. Remove the calls to create service worker context connection. They are now done at SWServer level when trying to either run a service worker or install one. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): (WebKit::WebSWServerConnection::postMessageToServiceWorker): (WebKit::WebSWServerConnection::scheduleJobInServer): 2019-10-09 Wenson Hsieh [Clipboard API] Refactor Pasteboard item reading functions to work on both iOS and macOS https://bugs.webkit.org/show_bug.cgi?id=202647 Reviewed by Tim Horton. Refactor iOS-specific pasteboard functions to be platform-agnostic. See WebCore ChangeLog for more details. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::allPasteboardItemInfo): (WebKit::WebPasteboardProxy::informationForItemAtIndex): (WebKit::WebPasteboardProxy::getPasteboardItemsCount): (WebKit::WebPasteboardProxy::readStringFromPasteboard): (WebKit::WebPasteboardProxy::readURLFromPasteboard): (WebKit::WebPasteboardProxy::readBufferFromPasteboard): (WebKit::WebPasteboardProxy::writeURLToPasteboard): (WebKit::WebPasteboardProxy::writeWebContentToPasteboard): (WebKit::WebPasteboardProxy::writeImageToPasteboard): (WebKit::WebPasteboardProxy::writeStringToPasteboard): * UIProcess/WebPasteboardProxy.cpp: (WebKit::WebPasteboardProxy::allPasteboardItemInfo): (WebKit::WebPasteboardProxy::informationForItemAtIndex): (WebKit::WebPasteboardProxy::getPasteboardItemsCount): (WebKit::WebPasteboardProxy::readStringFromPasteboard): (WebKit::WebPasteboardProxy::readURLFromPasteboard): (WebKit::WebPasteboardProxy::readBufferFromPasteboard): * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * UIProcess/wpe/WebPasteboardProxyWPE.cpp: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::informationForItemAtIndex): (WebKit::WebPlatformStrategies::readBufferFromPasteboard): (WebKit::WebPlatformStrategies::readURLFromPasteboard): (WebKit::WebPlatformStrategies::readStringFromPasteboard): (WebKit::WebPlatformStrategies::writeToPasteboard): (WebKit::WebPlatformStrategies::updateSupportedTypeIdentifiers): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2019-10-09 John Wilander IsLoggedIn: Add as experimental feature https://bugs.webkit.org/show_bug.cgi?id=202707 Reviewed by Brent Fulgham and Chris Dumez. IsLoggedIn was proposed to the WebAppSec WG at TPAC 2019. So far there is only an explainer posted to the mailing list: https://lists.w3.org/Archives/Public/public-webappsec/2019Sep/0004.html * Shared/WebPreferences.yaml: 2019-10-09 Jiewen Tan [WebAuthn] Move the mock testing entrance to Internals https://bugs.webkit.org/show_bug.cgi?id=202560 Reviewed by Chris Dumez. * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration): Deleted. * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/WebAuthentication/AuthenticatorTransportService.cpp: (WebKit::AuthenticatorTransportService::createMock): * UIProcess/WebAuthentication/AuthenticatorTransportService.h: * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp: (WebKit::MockAuthenticatorManager::MockAuthenticatorManager): * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.h: * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp: (WebKit::MockHidConnection::send): (WebKit::MockHidConnection::registerDataReceivedCallbackInternal): (WebKit::MockHidConnection::parseRequest): (WebKit::MockHidConnection::feedReports): (WebKit::MockHidConnection::shouldContinueFeedReports): * UIProcess/WebAuthentication/Mock/MockHidConnection.h: * UIProcess/WebAuthentication/Mock/MockHidService.cpp: (WebKit::MockHidService::MockHidService): * UIProcess/WebAuthentication/Mock/MockHidService.h: * UIProcess/WebAuthentication/Mock/MockLocalConnection.h: * UIProcess/WebAuthentication/Mock/MockLocalConnection.mm: (WebKit::MockLocalConnection::MockLocalConnection): * UIProcess/WebAuthentication/Mock/MockLocalService.h: * UIProcess/WebAuthentication/Mock/MockLocalService.mm: (WebKit::MockLocalService::MockLocalService): * UIProcess/WebAuthentication/Mock/MockNfcService.h: * UIProcess/WebAuthentication/Mock/MockNfcService.mm: (WebKit::MockNfcService::MockNfcService): (WebKit::MockNfcService::platformStartDiscovery): (WebKit::MockNfcService::detectTags const): * UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h: Removed. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setMockWebAuthenticationConfiguration): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebsiteData/WebsiteDataStore.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::setMockWebAuthenticationConfiguration): * WebProcess/WebCoreSupport/WebChromeClient.h: 2019-10-09 Simon Fraser Rename WheelEventTestTrigger and improve naming in related code https://bugs.webkit.org/show_bug.cgi?id=202772 Reviewed by Tim Horton. Change the "test trigger" terminology to "monitor wheel events"; after all, tests call monitorWheelEvents() and callAfterScrollingCompletes(), and this is not triggering a test. * UIProcess/API/C/WKPage.cpp: (WKPageClearWheelEventTestMonitor): (WKPageClearWheelEventTestTrigger): Deleted. * UIProcess/API/C/WKPage.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::clearWheelEventTestMonitor): (WebKit::WebPageProxy::clearWheelEventTestTrigger): Deleted. * UIProcess/WebPageProxy.h: * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageStartMonitoringScrollOperations): (WKBundlePageRegisterScrollOperationCompletionCallback): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::createScrollbar): * WebProcess/WebPage/EventDispatcher.cpp: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::clearWheelEventTestMonitor): (WebKit::WebPage::clearWheelEventTestTrigger): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2019-10-09 Andy Estes [Cocoa] IPC::decode should gracefully handle a nil allowed class https://bugs.webkit.org/show_bug.cgi?id=202753 Reviewed by Geoffrey Garen. If IPC::decode is called with a nil allowed class, an NSInvalidArgumentException will be thrown when trying to create an NSArray literal with a nil value. Depending on who calls IPC::decode, this exception might or might not be caught, leading to dropped messages or crashes. One case of this happening is tracked by rdar://problem/55839467. In this case, the nil allowed class was due to a build misconfiguration, and the exception caused the UI process to not respond to a synchronous IPC message, hanging the WebContent process. rdar://problem/55839467 was resolved by fixing the build misconfiguration, but this patch improves IPC::decode so that a nil allowed class results in a message decoding failure rather than a maybe-caught NSException. * Shared/Cocoa/ArgumentCodersCocoa.h: (IPC::decode): 2019-10-09 youenn fablet Remove testRunner.setWebRTCUnifiedPlanEnabled https://bugs.webkit.org/show_bug.cgi?id=202700 Reviewed by Eric Carlson. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 2019-10-09 Carlos Garcia Campos REGRESSION(r250597): [GTK][WPE] 2.27.1 shows HTML content as text/plain in custom protocols when passing a charset in content type https://bugs.webkit.org/show_bug.cgi?id=202633 Reviewed by Žan Doberšek. This is a regression of the switch to use the new custom protocols implementation. Before r250597, we extracted the mime type and charset from content type in the network process, but we are now sending the response directly from the UI process, so we need to do that when building our response. Rename the mime_type parameter as content_type to avoid confusion, since it's documented as the content type. * UIProcess/API/glib/WebKitURISchemeRequest.cpp: (webkitURISchemeRequestReadCallback): (webkit_uri_scheme_request_finish): * UIProcess/API/gtk/WebKitURISchemeRequest.h: * UIProcess/API/wpe/WebKitURISchemeRequest.h: 2019-10-09 Carlos Garcia Campos [GTK][WPE] about:gpu should also show the client EGL extensions https://bugs.webkit.org/show_bug.cgi?id=202690 Reviewed by Carlos Alberto Lopez Perez. We are showing the extensions supported by the display. * UIProcess/API/glib/WebKitProtocolHandler.cpp: (WebKit::WebKitProtocolHandler::handleGPU): 2019-10-09 Carlos Garcia Campos CustomProtocols: convert log messages in WebURLSchemeTaskProxy to RELEASE_LOG https://bugs.webkit.org/show_bug.cgi?id=202686 Reviewed by Alex Christensen. Instead of using WTFLogAlways, since those messages are confusing on stdout. * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp: (WebKit::WebURLSchemeTaskProxy::didPerformRedirection): (WebKit::WebURLSchemeTaskProxy::didReceiveResponse): (WebKit::WebURLSchemeTaskProxy::didReceiveData): 2019-10-09 Carlos Garcia Campos [WPE][GTK] WebKitSecurityManager should consider webkit:// to be a local URI scheme https://bugs.webkit.org/show_bug.cgi?id=202638 Reviewed by Michael Catanzaro. * UIProcess/API/glib/WebKitProtocolHandler.cpp: (WebKit::WebKitProtocolHandler::WebKitProtocolHandler): 2019-10-08 Antti Koivisto [CSS Shadow Parts] Enable by default https://bugs.webkit.org/show_bug.cgi?id=202644 Reviewed by Ryosuke Niwa. * Shared/WebPreferences.yaml: Flip the switch. 2019-10-08 Andy Estes [iOS] Add a fast path that avoids hit testing during context menu interactions on elements https://bugs.webkit.org/show_bug.cgi?id=202510 Reviewed by Tim Horton. When computing position information for an element, we can store sufficient context information in InteractionInformationAtPosition such that the same element could be retrieved again without hit testing. The existing TextInputContext can already store an element's page identifier, document identifier, and element identifier, which is sufficient context for such a task. This patch renames TextInputContext to ElementContext and uses it when populating new InteractionInformationAtPosition structs in elementPositionInformation(). When a context menu interaction occurs, WebPage::startInteractionWithElementContextOrPosition() uses this context to look up the interaction element by its identifier triplet, falling back to hit testing if this lookup fails. * Scripts/webkit/messages.py: * Shared/DocumentEditingContext.h: * Shared/DocumentEditingContext.mm: (IPC::ArgumentCoder::decode): * Shared/ElementContext.cpp: Renamed from Source/WebKit/Shared/TextInputContext.cpp. (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/ElementContext.h: Renamed from Source/WebKit/Shared/TextInputContext.h. (WebKit::operator==): * Shared/ios/InteractionInformationAtPosition.h: * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): (WebKit::InteractionInformationAtPosition::decode): * Sources.txt: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _requestTextInputContextsInRect:completionHandler:]): * UIProcess/API/Cocoa/_WKTextInputContext.mm: (-[_WKTextInputContext _initWithTextInputContext:]): (-[_WKTextInputContext _textInputContext]): * UIProcess/API/Cocoa/_WKTextInputContextInternal.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::textInputContextsInRect): (WebKit::WebPageProxy::focusTextInputContext): * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView actionSheetAssistant:willStartInteractionWithElement:]): (-[WKContentView assignLegacyDataForContextMenuInteraction]): (-[WKContentView continueContextMenuInteraction:]): (-[WKContentView continueContextMenuInteractionWithDataDetectors:]): (-[WKContentView _presentedViewControllerForPreviewItemController:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::startInteractionWithPositionInformation): (WebKit::WebPageProxy::startInteractionWithElementAtPosition): Deleted. * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::textInputContextsInRect): (WebKit::WebPage::focusTextInputContext): (WebKit::WebPage::elementForContext const): (WebKit::WebPage::contextForElement const): (WebKit::WebPage::elementForTextInputContext): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::elementPositionInformation): (WebKit::WebPage::startInteractionWithElementContextOrPosition): (WebKit::WebPage::requestDocumentEditingContext): (WebKit::WebPage::startInteractionWithElementAtPosition): Deleted. 2019-10-08 Adrian Perez de Castro Unreviewed. Update OptionsWPE.cmake and NEWS for the 2.27.1 release * wpe/NEWS: Add release notes for 2.27.1 2019-10-08 Kate Cheney Implement Telemetry and Dumping Routines for SQLite backend (195088) https://bugs.webkit.org/show_bug.cgi?id=195088 Reviewed by John Wilander. Implemented database telemetry calculating for ITP. Mimicked ResourceLoadStatisticsMemoryStore telemetry logging behavior using SQLite Queries as opposed to vector sorting/manipulation. Once fully integrated, this will simplify analysis of ITP data by transitioning ITP data storage from a plist to a SQLite database. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore): Added SQL queries to be initialized in the constructor. These queries are needed to mimic the telemetry calculations done in ResourceLoadStatisticsMemoryStore. (WebKit::resetStatement): To reduce code duplication, this function holds common code to reset a SQL query. (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements): Added SQL queries needed for telemetry calculations to be prepared. (WebKit::joinSubStatisticsForSorting): This function returns the query string for sorting resources that is shared by many queries. (WebKit::ResourceLoadStatisticsDatabaseStore::getMedianOfPrevalentResourcesWithUserInteraction const): Implemented a function to take the median days since user interaction from all prevalent resources in the database with user interaction (sorted by max count of subframes, subresources and unique redirects under the top frame domain). (WebKit::ResourceLoadStatisticsDatabaseStore::getNumberOfPrevalentResources const): Executes a SQL query to get the number of prevalent resources to log as telemetry. (WebKit::ResourceLoadStatisticsDatabaseStore::getNumberOfPrevalentResourcesWithUI const): Executes a SQL query to get the number of prevalent resources with user interaction to log as telemetry. (WebKit::ResourceLoadStatisticsDatabaseStore::getTopPrevelentResourceDaysSinceUI const): Prepares and executes a SQL query to get the days since user interaction from the top prevalent resource to be recorded as telemetry data. (WebKit::ResourceLoadStatisticsDatabaseStore::getMedianStatisticOfPrevalentResourceWithoutUserInteraction const): Implemented a function which takes a statistic and returns the value of that statistic for the median prevalent resource without user interaction to be recorded as telemetry data. (WebKit::ResourceLoadStatisticsDatabaseStore::getNumberOfPrevalentResourcesInTopResources const): Returns the count of prevalent resources in the top x resources sorted by sum of substatistics again to be logged as telemetry. (WebKit::ResourceLoadStatisticsDatabaseStore::calculateTelemetryData const): Function which executes all functions which populate the struct with telemetry data. This struct will then be passed to WebResourceLoadStatisticsTelemetry to be logged. (WebKit::ResourceLoadStatisticsDatabaseStore::calculateAndSubmitTelemetry const): Initializes the telemetry struct and calls the function to populate it, then passes it to the WebResourceLoadStatisticsTelemetry object to be recorded. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: Describe PrevalentResourceDatabaseTelemetry Struct to be passed and logged as telemetry data. * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp: (WebKit::databaseSubmitTopLists): Logging telemetry data by looping through 2D array of statistics for the top 1, 3, 10, 50, and 100 prevalent resources sorted by the sum of substatistics under the top frame domain. This matches the logging already done in ResourceLoadStatisticsMemoryStore. (WebKit::WebResourceLoadStatisticsTelemetry::submitTelemetry): Submits data to the webPageProxy logs and plists. * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.h: Added new submitTopList function to accomodate database telemetry logging. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::notifyPageStatisticsTelemetryFinished): * NetworkProcess/NetworkSession.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::notifyResourceLoadStatisticsTelemetryFinished): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: Updated the current testing for telemetry which only tested 3 statistics. With this patch it now tests 10 statistics. 2019-10-08 Adrian Perez de Castro [GTK][WPE] Fix non-unified builds after r250486 https://bugs.webkit.org/show_bug.cgi?id=202636 Reviewed by Youenn Fablet. * NetworkProcess/NetworkConnectionToWebProcess.cpp: Add missing inclusion of the Logging.h header. 2019-10-08 Brady Eidson Service Worker Fetch events should time out. https://bugs.webkit.org/show_bug.cgi?id=202188 Reviewed by Alex Christensen. When we start a fetch task in the server, we also start a timeout on that fetch task. "Time out" means the fetch task must continue to make progress at the given frequency (once every 60 seconds by default) If any given fetch task times out in a service worker instance, that instance loses the right to handle fetches. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::setServiceWorkerFetchTimeoutForTesting): (WebKit::NetworkProcess::resetServiceWorkerFetchTimeoutForTesting): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::serviceWorkerFetchTimeout const): * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask): (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse): (WebKit::ServiceWorkerFetchTask::didReceiveResponse): (WebKit::ServiceWorkerFetchTask::didReceiveData): (WebKit::ServiceWorkerFetchTask::didReceiveFormData): (WebKit::ServiceWorkerFetchTask::didFinish): (WebKit::ServiceWorkerFetchTask::didFail): (WebKit::ServiceWorkerFetchTask::didNotHandle): * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: (WebKit::ServiceWorkerFetchTask::create): (WebKit::ServiceWorkerFetchTask::serviceWorkerIdentifier const): (WebKit::ServiceWorkerFetchTask::wasHandled const): (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask): Deleted. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::startFetch): * NetworkProcess/ServiceWorker/WebSWServerConnection.h: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::startFetch): (WebKit::WebSWServerToContextConnection::fetchTaskTimedOut): * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h: * UIProcess/API/C/WKContext.cpp: (WKContextSetServiceWorkerFetchTimeoutForTesting): (WKContextResetServiceWorkerFetchTimeoutForTesting): * UIProcess/API/C/WKContext.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setServiceWorkerTimeoutForTesting): (WebKit::WebProcessPool::resetServiceWorkerTimeoutForTesting): * UIProcess/WebProcessPool.h: 2019-10-08 Ross Kirsling Unreviewed. Restabilize non-unified build. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: 2019-10-08 Dean Jackson Sort Internal and Experimental features by human readable name https://bugs.webkit.org/show_bug.cgi?id=202667 Reviewed by Zalan Bujtas. Sort the statically generated vectors of internal and experimental features by their human readable name, rather than the feature key, so that looking at them in the Settings app doesn't make people who like alphabetical order angry. * Scripts/GeneratePreferences.rb: Add an extra sort call to the list generation. 2019-10-08 Wenson Hsieh [Clipboard API] Introduce bindings for the async Clipboard API https://bugs.webkit.org/show_bug.cgi?id=202622 Reviewed by Ryosuke Niwa. Adds a new experimental feature flag. See WebCore ChangeLog for more details. * Shared/WebPreferences.yaml: 2019-10-08 Alexander Mikhaylenko [GTK] Navigation gesture improvements https://bugs.webkit.org/show_bug.cgi?id=202645 Reviewed by Carlos Garcia Campos. Measure velocity threshold in pixels per second rather than distance (range [0-1]) per second. The value is the same as it was on touchpads, since a fixed distance is used, but is now consistent on touchscreens, regardless of the webview width. Add a threshold for cancelling gesture when the page is more than halfway through, so that it's symmetric with the first half. Align the moving page to pixel grid on hidpi devices correctly. Just rounding the position doesn't work correctly, since the cairo context is pre-scaled. Multiplying by scale factor, rounding and then dividing by scale factor fixes this. * UIProcess/ViewGestureController.h: * UIProcess/gtk/ViewGestureControllerGtk.cpp: (WebKit::ViewGestureController::SwipeProgressTracker::reset): (WebKit::ViewGestureController::SwipeProgressTracker::handleEvent): (WebKit::ViewGestureController::SwipeProgressTracker::shouldCancel): (WebKit::ViewGestureController::draw): 2019-10-08 Carlos Garcia Campos Unreviewed. Remove unused WebKitSoupRequestGeneric after r250597 * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h: 2019-10-08 Adrian Perez de Castro [WPE][GTK] Build fails with ENABLE_WEBDRIVER=OFF https://bugs.webkit.org/show_bug.cgi?id=202658 Reviewed by Carlos Garcia Campos. * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: Add missing ENABLE(WEBDRIVER_MOUSE_INTERACTIONS) and ENABLE(WEBDRIVER_KEYBOARD_INTERACTIONS) preprocessor guards. * UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp: Ditto. 2019-10-07 Ryosuke Niwa Add IDL for requestIdleCallback https://bugs.webkit.org/show_bug.cgi?id=202653 Reviewed by Geoffrey Garen. * Shared/WebPreferences.yaml: 2019-10-07 Kate Cheney Domain relationships in the ITP Database should be inserted in a single query and ignore repeat insert attempts. (202604) https://bugs.webkit.org/show_bug.cgi?id=202604 Reviewed by Chris Dumez. This patch addresses two clean-ups for the ITP SQLite Database Store. First, by using INSERT OR IGNORE as opposed to INSERT, it eliminates the need to check if a relationship already exists in the database before inserting it. Second, instead of looping through domain lists and inserting each relationship as a separate query, this patch now converts lists to a string which SQLite can use to insert multiple rows into a database using a single query. Some Exists queries could not be deleted because they were being used for testing. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore): (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements): Removed old insert queries and replaced them with queries able to insert string-lists of domains in a single query. Also reorganized the queries by functionality to make them easier to find and edit. (WebKit::ResourceLoadStatisticsDatabaseStore::createUniqueIndices): (WebKit::ResourceLoadStatisticsDatabaseStore::createSchema): In order to properly take advantage of the INSERT OR IGNORE functionality, unique indices must be established so the SQLite table is aware of what patterns to look for when ignoring a new insert. (WebKit::ResourceLoadStatisticsDatabaseStore::ensureAndmakeDomainList): (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationshipList): (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships): Looping through the domain list is no longer needed with the new query changes. Additionally, ensuring a domain is in the Observed Domains table of the database must be done before utilizing any inserting of relationships because the relationship queries rely on fetching the topFrame domainID from the ObservedDomains table. (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccess): (WebKit::ResourceLoadStatisticsDatabaseStore::logFrameNavigation): (WebKit::ResourceLoadStatisticsDatabaseStore::logCrossSiteLoadWithLinkDecoration): (WebKit::ResourceLoadStatisticsDatabaseStore::setSubframeUnderTopFrameDomain): (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUnderTopFrameDomain): (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUniqueRedirectTo): (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUniqueRedirectFrom): (WebKit::ResourceLoadStatisticsDatabaseStore::setTopFrameUniqueRedirectTo): (WebKit::ResourceLoadStatisticsDatabaseStore::setTopFrameUniqueRedirectFrom): With the ensure check being done once in the ensureAndmakeDomainList function, these functions no longer have to make that check before inserting. * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::mergeStatisticForTesting): (WebKit::WebResourceLoadStatisticsStore::isRelationshipOnlyInDatabaseOnce): * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: Changes in WeResourceLoadStatisticsStore were for testing only. This patch updated the merge statistic testing to also test this change by having a topFrameDomain list with more than one domain. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::mergeStatisticForTesting): (WebKit::NetworkProcess::isRelationshipOnlyInDatabaseOnce): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetStatisticsMergeStatistic): (WKWebsiteDataStoreIsStatisticsOnlyInDatabaseOnce): * UIProcess/API/C/WKWebsiteDataStoreRef.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::mergeStatisticForTesting): (WebKit::NetworkProcessProxy::isRelationshipOnlyInDatabaseOnce): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::mergeStatisticForTesting): (WebKit::WebsiteDataStore::isRelationshipOnlyInDatabaseOnce): * UIProcess/WebsiteData/WebsiteDataStore.h: Added a new function for testing that there are no repeat inserts into the database. Updated mergeStatistics to test the list-insert functionality. 2019-10-07 Yusuke Suzuki [JSC] Change signature of HostFunction to (JSGlobalObject*, CallFrame*) https://bugs.webkit.org/show_bug.cgi?id=202569 Reviewed by Saam Barati. * WebProcess/Plugins/Netscape/JSNPMethod.cpp: (WebKit::callMethod): * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::callNPJSObject): (WebKit::constructWithConstructor): * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h: 2019-10-07 Megan Gardner Switch to WKShareSheet for WKPDFView https://bugs.webkit.org/show_bug.cgi?id=202338 Reviewed by Tim Horton. Switch to WKShareSheet from the share sheet in UIWKSelectionAssistant, since this is the only instance of UIWKSelectionAssistant any more. This will keep all our share sheet code together, and allow us to eliminate this class that will be completely unused with this change. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKPDFView.h: * UIProcess/ios/WKPDFView.mm: (-[WKPDFView dealloc]): (-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]): (-[WKPDFView shareSheetDidDismiss:]): 2019-10-07 Per Arne Vollan [macOS] Layering violation in AuxiliaryProcessProxy::didFinishLaunching https://bugs.webkit.org/show_bug.cgi?id=201617 Reviewed by Brent Fulgham. The commit introduced a layering violation in AuxiliaryProcessProxy::didFinishLaunching where we inspect the pending message queue looking for a local file load message which needs the PID to create a sandbox extension for the WebContent process. The layering violation can be fixed by creating a virtual method in AuxiliaryProcessProxy and override the method in the WebProcessProxy to do the work needed to replace the message with a load request message containing a sandbox extension created using the PID of the WebContent process. No new tests have been created, since this is covered by existing tests. * UIProcess/AuxiliaryProcessProxy.cpp: (WebKit::AuxiliaryProcessProxy::didFinishLaunching): * UIProcess/AuxiliaryProcessProxy.h: (WebKit::AuxiliaryProcessProxy::shouldSendPendingMessage): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::shouldSendPendingMessage): * UIProcess/WebProcessProxy.h: 2019-10-07 Dean Jackson Provide options for DTTZ to happen in more situations https://bugs.webkit.org/show_bug.cgi?id=202634 Reviewed by Antoine Quint. Add two options that can be enabled to trigger double tap zooming in more places. Firstly, an option to keep listening for a double-tap-to-zoom if the first tap found a click handler on the body or document element. The tap will still be dispatched. This is probably the most common case for disabling a DTTZ. Secondly, an option to always keep listening for a double-tap-to-zoom, even if there was a clickable (non-root) element under the first tap. * Shared/WebPreferences.yaml: Add ZoomOnDoubleTapWhenRoot and AlwaysZoomOnDoubleTap. * UIProcess/PageClient.h: The message from the WebProcess now tells the UIProcess if the tapped element was a root-level (document or body). * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::handleSmartMagnificationInformationForPotentialTap): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _endPotentialTapAndEnableDoubleTapGesturesIfNecessary]): (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:nodeIsRootLevel:]): Handle the two new options. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::handleSmartMagnificationInformationForPotentialTap): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::potentialTapAtPosition): Check if the tap was on a root-level element. 2019-10-07 Matt Mokary foundStringMatchIndex in FindController::findString gets reset on page scroll https://bugs.webkit.org/show_bug.cgi?id=201773 Reviewed by Tim Horton. Decouple hiding of the find indicator from resetting match index, and only reset match index when there is not an active match. * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::updateFindUIAfterPageScroll): (WebKit::FindController::hideFindUI): (WebKit::FindController::hideFindIndicator): (WebKit::FindController::resetMatchIndex): * WebProcess/WebPage/FindController.h: * WebProcess/WebPage/ios/FindControllerIOS.mm: (WebKit::FindController::hideFindIndicator): (WebKit::FindController::resetMatchIndex): 2019-10-07 youenn fablet WebPageProxy::updatePlayingMediaDidChange should protect from a null m_userMediaPermissionRequestManager https://bugs.webkit.org/show_bug.cgi?id=202628 Reviewed by Eric Carlson. On process swap on navigation or process crash, m_userMediaPermissionRequestManager is made null. At the same time, the media state is set back to not playing. Future calls of updatePlayingMediaDidChange should not have any capture state change until getUserMedia/getDisplayMedia is called, which would create m_userMediaPermissionRequestManager. But this assumption is not always true given that the media state is computed as process-wide in MediaStreamTrack::captureState on iOS. The above behavior is fixed as part of https://bugs.webkit.org/show_bug.cgi?id=202627. Since the call to updatePlayingMediaDidChange is triggered straight from IPC, it should not be trusted and a null check should be added. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updatePlayingMediaDidChange): 2019-10-04 Dean Jackson Use a better name than allowFastClicksEverywhere https://bugs.webkit.org/show_bug.cgi?id=202607 Reviewed by Tim Horton. This preference name is quite confusing. Change it to PreferFasterClickOverDoubleTap. * Shared/WebPreferences.yaml: * Shared/WebPreferencesDefaultValues.h: * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::preferFasterClickOverDoubleTap const): (WebKit::WebPageProxy::allowsFastClicksEverywhere const): Deleted. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies): 2019-10-04 Ross Kirsling Socket-based RWI should base64-encode backend commands on client, not server https://bugs.webkit.org/show_bug.cgi?id=202605 Reviewed by Don Olmstead. * UIProcess/socket/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::setBackendCommands): 2019-10-04 Jiewen Tan Unreviewed, build fix after r250729 * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: * UIProcess/API/Cocoa/_WKWebAuthenticationPanelInternal.h: 2019-10-04 Keith Rollin Fix determination of the top-level resource https://bugs.webkit.org/show_bug.cgi?id=202491 Reviewed by Youenn Fablet. When loading the resources associated with a page, the Networking process needs to know the main resource for the main frame. It uses this information to keep track of page loads and the resources that are loaded in those pages. By keeping track of this information, WebKit can track and report difficult (slow or incomplete) resource loads and their impact on the overall page. The initial determination of the top resource only looked at whether the resource was the "main" resource of a frame or not. However, this determination was insufficient, and would confuse the tracking mechanism when sub-frames also had main frames. Therefore, augment the test by also looking to see if the hosting frame is the main frame. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::startTrackingResourceLoad): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::start): 2019-10-04 Ross Kirsling Unreviewed WinCairo build fix for r250717. * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: (WebKit::LayerTreeHost::invalidate): Deleted. 2019-10-04 Alex Christensen Stop sending list of display-isolated schemes to NetworkProcess https://bugs.webkit.org/show_bug.cgi?id=202557 Reviewed by Youenn Fablet. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::registerURLSchemeAsDisplayIsolated 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::registerURLSchemeAsDisplayIsolated): 2019-10-04 Alex Christensen Rename SchemeRegistry to LegacySchemeRegistry https://bugs.webkit.org/show_bug.cgi?id=202586 Reviewed by Tim Horton. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::registerURLSchemeAsSecure const): (WebKit::NetworkProcess::registerURLSchemeAsBypassingContentSecurityPolicy const): (WebKit::NetworkProcess::registerURLSchemeAsLocal const): (WebKit::NetworkProcess::registerURLSchemeAsNoAccess const): (WebKit::NetworkProcess::registerURLSchemeAsDisplayIsolated const): (WebKit::NetworkProcess::registerURLSchemeAsCORSEnabled const): (WebKit::NetworkProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const): * Shared/AuxiliaryProcess.cpp: (WebKit::AuxiliaryProcess::registerURLSchemeServiceWorkersCanHandle const): * UIProcess/API/Cocoa/WKWebView.mm: (+[WKWebView handlesURLScheme:]): * UIProcess/API/glib/WebKitSecurityManager.cpp: (registerSecurityPolicyForURIScheme): (checkSecurityPolicyForURIScheme): * WebProcess/Plugins/WebPluginInfoProvider.cpp: (WebKit::WebPluginInfoProvider::webVisiblePluginInfo): * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::handleFetch): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::canHandleRequest): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::registerURLSchemeAsEmptyDocument): (WebKit::WebProcess::registerURLSchemeAsSecure const): (WebKit::WebProcess::registerURLSchemeAsBypassingContentSecurityPolicy const): (WebKit::WebProcess::setDomainRelaxationForbiddenForURLScheme const): (WebKit::WebProcess::registerURLSchemeAsLocal const): (WebKit::WebProcess::registerURLSchemeAsNoAccess const): (WebKit::WebProcess::registerURLSchemeAsDisplayIsolated const): (WebKit::WebProcess::registerURLSchemeAsCORSEnabled const): (WebKit::WebProcess::registerURLSchemeAsAlwaysRevalidated const): (WebKit::WebProcess::registerURLSchemeAsCachePartitioned const): (WebKit::WebProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const): * WebProcess/WebStorage/StorageAreaImpl.cpp: 2019-10-04 Jiewen Tan [WebAuthn] Implement _WKWebAuthenticationPanel SPI https://bugs.webkit.org/show_bug.cgi?id=202559 Reviewed by Brent Fulgham. This patch implements _WKWebAuthenticationPanel SPI. Here is the structure: 1) API::WebAuthenticationPanel is the APIObject of _WKWebAuthenticationPanel. It is owned by AuthenticatorManager. The lifetime of _WKWebAuthenticationPanel on the other hand is managed by clients. This binding is the surface where clients could interact with WebKit's WebAuthentication implementation. 2) API::WebAuthenticationPanelClient is a base class representing _WKWebAuthenticationPanelDelegate. Its subclass WebKit::WebAuthenticationPanelClient implements bridges to _WKWebAuthenticationPanelDelegate methods. It is owned by API::WebAuthenticationPanel. A weak pointer of WebKit::WebAuthenticationPanelClient is kept in _WKWebAuthenticationPanel to get the _WKWebAuthenticationPanelDelegate set by clients or nil otherwise. This binding is the surface where WebKit interacts with clients. 3) WebAuthenticationPanelFlags is the mirror of enums within _WKWebAuthenticationPanel. Implementation wise, this patch implements: 1) -[WKUIDelegatePrivate webView:runWebAuthenticationPanel:initiatedByFrame:completionHandler:], this is bridged from the regular UIDelegate route. Noted, WKFrameInfo is nil for now, a follow up on Bug 202563 will take care of it. This will be called from AuthenticatorManager::runPanel() which gates the start of discovery on the callback. For clients that don't implement the delegate, the callback will always be called with _WKWebAuthenticationPanelResultUnavailable to allow WebKit run on non-UI mode. A specific C API hack is added to always return _WKWebAuthenticationPanelResultPresented in WebKitTestRunner for layout tests. 2) -[_WKWebAuthenticationPanelDelegate panel:updateWebAuthenticationPanel:] will be implemented in Bug 200932. 3) -[_WKWebAuthenticationPanelDelegate panel:dismissWebAuthenticationPanelWithResult:], this is bridged from API::WebAuthenticationPanel/API::WebAuthenticationPanelClient. This will be called whenever AuthenticatorManager::m_pendingCompletionHandler is invoked. Depending on the respond, _WKWebAuthenticationResult will be returned accordingly. To facilitate that, invokePendingCompletionHandler is crafted to bundle those two operations. 4) -[_WKWebAuthenticationPanel cancel] will be implemented in Bug 191523. Besides the above, this patch also silents the NFC action sheet. * Platform/spi/Cocoa/NearFieldSPI.h: * Shared/API/APIObject.h: * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * Sources.txt: * SourcesCocoa.txt: * UIProcess/API/APIUIClient.h: (API::UIClient::runWebAuthenticationPanel): * UIProcess/API/APIWebAuthenticationPanel.cpp: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm. (API::WebAuthenticationPanel::create): (API::WebAuthenticationPanel::WebAuthenticationPanel): (API::WebAuthenticationPanel::setClient): * UIProcess/API/APIWebAuthenticationPanel.h: Copied from Source/WebKit/UIProcess/WebAuthentication/WebAuthenticationRequestData.h. * UIProcess/API/APIWebAuthenticationPanelClient.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanelInternal.h. (API::WebAuthenticationPanelClient::dismissPanel const): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/C/WKPageUIClient.h: * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: (-[_WKWebAuthenticationPanel dealloc]): (-[_WKWebAuthenticationPanel relyingPartyID]): (-[_WKWebAuthenticationPanel delegate]): (-[_WKWebAuthenticationPanel setDelegate:]): (-[_WKWebAuthenticationPanel _apiObject]): (-[_WKWebAuthenticationPanel _initWithRelayingPartyID:]): Deleted. * UIProcess/API/Cocoa/_WKWebAuthenticationPanelInternal.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::webAuthenticationPanelResult): (WebKit::UIDelegate::UIClient::runWebAuthenticationPanel): * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::WebCore::isFeatureEnabled): (WebKit::WebCore::getRpId): (WebKit::AuthenticatorManager::handleRequest): (WebKit::AuthenticatorManager::respondReceived): (WebKit::AuthenticatorManager::startDiscovery): (WebKit::AuthenticatorManager::initTimeOutTimer): (WebKit::AuthenticatorManager::timeOutTimerFired): (WebKit::AuthenticatorManager::runPanel): (WebKit::AuthenticatorManager::startRequest): (WebKit::AuthenticatorManager::invokePendingCompletionHandler): (WebKit::AuthenticatorManagerInternal::collectTransports): Deleted. (WebKit::AuthenticatorManagerInternal::processGoogleLegacyAppIdSupportExtension): Deleted. * UIProcess/WebAuthentication/AuthenticatorManager.h: (WebKit::AuthenticatorManager::pendingCompletionHandler): Deleted. * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm: (WebKit::NfcConnection::NfcConnection): * UIProcess/WebAuthentication/Cocoa/NfcService.mm: (WebKit::NfcService::platformStartDiscovery): * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h: Copied from Source/WebKit/UIProcess/WebAuthentication/WebAuthenticationRequestData.h. * UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp. (WebKit::WebAuthenticationPanelClient::WebAuthenticationPanelClient): (WebKit::wkWebAuthenticationResult): (WebKit::WebAuthenticationPanelClient::dismissPanel const): * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp: (WebKit::MockAuthenticatorManager::respondReceivedInternal): * UIProcess/WebAuthentication/WebAuthenticationPanelFlags.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanelInternal.h. * UIProcess/WebAuthentication/WebAuthenticationRequestData.h: * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.cpp: (WebKit::WebAuthenticatorCoordinatorProxy::makeCredential): (WebKit::WebAuthenticatorCoordinatorProxy::getAssertion): * WebKit.xcodeproj/project.pbxproj: 2019-10-04 Alex Christensen Move WKProcessPool._registerURLSchemeServiceWorkersCanHandle to _WKWebsiteDataStoreConfiguration https://bugs.webkit.org/show_bug.cgi?id=202553 Reviewed by Youenn Fablet. It was only used for testing, and all the tests that use it still pass with the new SPI. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::addWebsiteDataStore): (WebKit::NetworkProcess::swServerForSession): (WebKit::NetworkProcess::addServiceWorkerSession): * NetworkProcess/NetworkProcess.h: * Shared/AuxiliaryProcess.cpp: (WebKit::AuxiliaryProcess::registerURLSchemeServiceWorkersCanHandle const): Deleted. * Shared/AuxiliaryProcess.h: * Shared/AuxiliaryProcess.messages.in: * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::encode const): (WebKit::WebsiteDataStoreParameters::decode): * Shared/WebsiteDataStoreParameters.h: * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _registerURLSchemeServiceWorkersCanHandle:]): Deleted. * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration registerURLSchemeServiceWorkersCanHandleForTesting:]): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): (WebKit::WebProcessPool::initializeNewWebProcess): (WebKit::WebProcessPool::registerURLSchemeServiceWorkersCanHandle): Deleted. * UIProcess/WebProcessPool.h: * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::copy): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: (WebKit::WebsiteDataStoreConfiguration::serviceWorkerRegisteredSchemes const): (WebKit::WebsiteDataStoreConfiguration::registerServiceWorkerScheme): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): 2019-10-04 youenn fablet Allow to suspend RTCPeerConnection when not connected https://bugs.webkit.org/show_bug.cgi?id=202403 Reviewed by Chris Dumez. Implement suspend/resume of sockets by doing the following: - For UDP sockets, we simulate as if being sent data is queued when being suspended. the webrtc backend will then stop sending packets until the queue is emptied. At resume time, we do as if the queue is emptied and packets sent (even though packets are not sent). For incoming traffic, we ignore it when being suspended. - For TCP sockets, we close them at suspend time. We then notify at resume time that an error happeneded for these sockets to the webrtc backend. We cannot simulate packet dropping like in the UDP case. To manage resume/suspend, each socket now has a isSuspended state and a socket group. The socket group is per peer connection. A peer connection will notify the factory that it is suspended/resumed. The factory will iterate through all sockets and will suspend/resume each socket of the socket group. * WebProcess/Network/webrtc/LibWebRTCProvider.cpp: (WebKit::RTCSocketFactory::RTCSocketFactory): (WebKit::RTCSocketFactory::CreateUdpSocket): (WebKit::RTCSocketFactory::CreateServerTcpSocket): (WebKit::RTCSocketFactory::CreateClientTcpSocket): (WebKit::RTCSocketFactory::CreateAsyncResolver): (WebKit::RTCSocketFactory::suspend): (WebKit::RTCSocketFactory::resume): (WebKit::LibWebRTCProvider::createSocketFactory): * WebProcess/Network/webrtc/LibWebRTCProvider.h: * WebProcess/Network/webrtc/LibWebRTCSocket.cpp: (WebKit::LibWebRTCSocket::LibWebRTCSocket): (WebKit::LibWebRTCSocket::~LibWebRTCSocket): (WebKit::LibWebRTCSocket::signalReadPacket): (WebKit::LibWebRTCSocket::signalSentPacket): (WebKit::LibWebRTCSocket::SendTo): (WebKit::LibWebRTCSocket::Close): (WebKit::LibWebRTCSocket::SetOption): (WebKit::LibWebRTCSocket::resume): (WebKit::LibWebRTCSocket::suspend): * WebProcess/Network/webrtc/LibWebRTCSocket.h: * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp: (WebKit::LibWebRTCSocketFactory::createServerTcpSocket): (WebKit::LibWebRTCSocketFactory::createUdpSocket): (WebKit::LibWebRTCSocketFactory::createClientTcpSocket): (WebKit::LibWebRTCSocketFactory::createNewConnectionSocket): (WebKit::LibWebRTCSocketFactory::addSocket): (WebKit::LibWebRTCSocketFactory::removeSocket): (WebKit::LibWebRTCSocketFactory::forSocketInGroup): * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h: 2019-10-04 Alex Christensen Simplify sandbox enabling macros https://bugs.webkit.org/show_bug.cgi?id=202536 Reviewed by Brent Fulgham. ENABLE_WEB_PROCESS_SANDBOX was always on for Cocoa platforms and only used in WebProcessCocoa.mm, so it did nothing. ENABLE_MANUAL_SANDBOXING was on for sdk=macosx* which I made more explicit in the code by using PLATFORM(MAC) || PLATFORM(MAACCATALYST) ENABLE_MANUAL_NETWORK_SANDBOXING was always off and hiding dead code we do not intend to use because iOS sandboxes are always on and never manual. * Configurations/FeatureDefines.xcconfig: * NetworkProcess/ios/NetworkProcessIOS.mm: (WebKit::NetworkProcess::initializeSandbox): * Shared/ios/AuxiliaryProcessIOS.mm: (WebKit::AuxiliaryProcess::initializeSandbox): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::initializeSandbox): 2019-10-04 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.27.1 release * gtk/NEWS: Add release notes for 2.27.1. 2019-10-04 Carlos Garcia Campos [GTK] Crash in WebChromeClient::createDisplayRefreshMonitor https://bugs.webkit.org/show_bug.cgi?id=202551 Reviewed by Žan Doberšek. The crash happens when the drawing area is destroyed due to a page close. The layer tree host is invalidated causing a layer flush that ends up trying to create a display refresh monitor, which requires the drawing area. We need to null-check the drawing area in WebChromeClient::createDisplayRefreshMonitor() but we should also ensure that layer flush is not performed after layer tree host is destroyed. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::createDisplayRefreshMonitor const): Null-check drawing area before using it. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::CompositingCoordinator): Receive a WebPage instead of a WebCore::Page and create the root layer here. (WebKit::CompositingCoordinator::~CompositingCoordinator): Do not purge backing stores again, invalidate should always be called right before the object is destroyed. (WebKit::CompositingCoordinator::flushPendingLayerChanges): Get WebCore::Page from WebPage. (WebKit::CompositingCoordinator::timestamp const): Ditto. (WebKit::CompositingCoordinator::syncDisplayState): Ditto. (WebKit::CompositingCoordinator::notifyFlushRequired): Do not continue if m_rootLayer is nullptr. (WebKit::CompositingCoordinator::deviceScaleFactor const): Get WebCore::Page from WebPage. (WebKit::CompositingCoordinator::pageScaleFactor const): Ditto. (WebKit::CompositingCoordinator::createGraphicsLayer): Call attachLayer() instead of duplicating the code. (WebKit::CompositingCoordinator::setVisibleContentsRect): Get WebCore::Page from WebPage. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: (WebKit::DrawingAreaCoordinatedGraphics::discardPreviousLayerTreeHost): Do not call LayerTreeHost::invalidate() that has been removed. * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp: (WebKit::LayerTreeHost::LayerTreeHost): Construct the coordinator after the sceneIntegration. (WebKit::LayerTreeHost::~LayerTreeHost): Invalidate everything here now. We don't really need invalidate() method since LayerTreeHost is not refcounted and we always called invalidate right before deleting the object. (WebKit::LayerTreeHost::layerFlushTimerFired): This can't happen on invalid state anymore. * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: 2019-10-04 Carlos Garcia Campos [GTK][WPE] REGRESSION(r250673): connection to network process is broken after r250673 https://bugs.webkit.org/show_bug.cgi?id=202575 Reviewed by Carlos Alberto Lopez Perez. The file descriptor is now closed when the IPC::Attachment is destroyed in NetworkProcessConnectionInfo destructor. In case of unix domain sockets we need to transfer the ownership of the fd to NetworkProcessConnection, but NetworkProcessConnectionInfo is ow keeping the ownership. * WebProcess/Network/NetworkProcessConnectionInfo.h: (WebKit::NetworkProcessConnectionInfo::releaseIdentifier): Use IPC::Attachment::releaseFileDescriptor() in case of unix domain sockets. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::ensureNetworkProcessConnection): Use NetworkProcessConnectionInfo::releaseIdentifier() when passing the identifier to NetworkProcessConnection. 2019-10-04 Carlos Garcia Campos Unreviewed. Fix GTK distcheck * webkitglib-symbols.map: Remove symbols that are no longer in lib. 2019-10-03 Carlos Garcia Campos [GTK] WebAutomation: make setWindowRect synchronous https://bugs.webkit.org/show_bug.cgi?id=202530 Reviewed by Carlos Alberto Lopez Perez. Move/resize window is asynchronous in GTK, but automation expects it to be synchronous so that get window rect after setting it always returns the value set. Use a nested run loop to wait for the configure events after the move/resize. * UIProcess/API/glib/WebKitUIClient.cpp: (UIClient::windowConfigureEventCallback): (UIClient::setWindowFrameTimerFired): 2019-10-03 Carlos Garcia Campos Unreviewed. Address review comments after r250646. I forgot to include the documentation improvements suggested. * UIProcess/API/glib/WebKitWebContext.cpp: (webkit_web_context_class_init): 2019-10-03 Christopher Reid [WinCairo] Remote inspector client target list is racy https://bugs.webkit.org/show_bug.cgi?id=202169 Reviewed by Ross Kirsling. Original patch by Basuke Suzuki. Use LoaderClient to defer javascript target update calls to until after the page finished load. * UIProcess/socket/RemoteInspectorProtocolHandler.cpp: * UIProcess/socket/RemoteInspectorProtocolHandler.h: 2019-10-03 Ross Kirsling Socket RWI client should acquire backend commands from server https://bugs.webkit.org/show_bug.cgi?id=202421 Reviewed by Devin Rousso. * UIProcess/socket/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::dispatchMap): (WebKit::RemoteInspectorClient::setBackendCommands): * UIProcess/socket/RemoteInspectorClient.h: Receive "BackendCommands" message from server (which is already base64-encoded) and hand it over to RWIProxy. * UIProcess/win/WebProcessPoolWin.cpp: (WebKit::backendCommandsPath): (WebKit::initializeRemoteInspectorServer): On Windows, initialize server with the path to InspectorBackendCommands.js from the CFBundle. 2019-10-03 Alex Christensen Replace _WKProcessPoolConfiguration.suppressesConnectionTerminationOnSystemChange with SPI on _WKWebsiteDataStoreConfiguration https://bugs.webkit.org/show_bug.cgi?id=202544 Reviewed by Tim Horton. The _WKProcessPoolConfiguration SPI was originally introduced in rdar://problem/40650244 Keep both working during the transition period, but we need it to not be on the process pool. * NetworkProcess/NetworkSessionCreationParameters.cpp: (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/NetworkSessionCreationParameters.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration suppressesConnectionTerminationOnSystemChange]): (-[_WKWebsiteDataStoreConfiguration setSuppressesConnectionTerminationOnSystemChange:]): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::copy): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: (WebKit::WebsiteDataStoreConfiguration::suppressesConnectionTerminationOnSystemChange const): (WebKit::WebsiteDataStoreConfiguration::setSuppressesConnectionTerminationOnSystemChange): 2019-10-03 Per Arne Vollan REGRESSION(249649): Unable to open local files in MiniBrowser on macOS https://bugs.webkit.org/show_bug.cgi?id=201798 Reviewed by Brent Fulgham. The commit introduced a MiniBrowser regression on macOS where MiniBrowser is not able to open local files. The change set r249649 fixed a problem where the WebContent process PID was not ready to be used when creating a sandbox extension. This happened in the cases where the WebContent process had not finished launching when the load started. The WebContent process is also creating sandbox extensions for the Networking process for the files being loaded, and also needs to be passing the audit token of the Networking process when creating these. This patch implements getting the audit token for the Networking process when the WebProcess is sending a message to the UI process to establish the Networking process connection. The audit token is stored in the NetworkProcessConnection object, and passed to the NetworkLoadParameters object when the load is started. Finally, when encoding the Network resources load parameters, the audit token is used to create an extension for the Networking process. API test: WKWebView.LoadFileWithLoadRequest * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): * Platform/IPC/ArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Platform/IPC/ArgumentCoders.h: * Shared/Cocoa/SandboxExtensionCocoa.mm: (WebKit::SandboxExtensionImpl::create): (WebKit::SandboxExtensionImpl::sandboxExtensionForType): (WebKit::SandboxExtensionImpl::SandboxExtensionImpl): (WebKit::SandboxExtension::createHandleForMachLookupByPid): (WebKit::SandboxExtension::createHandleForReadByPid): (WebKit::SandboxExtension::createHandleForReadByAuditToken): * Shared/SandboxExtension.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::openNetworkProcessConnection): * UIProcess/WebProcessProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Network/NetworkProcessConnection.h: (WebKit::NetworkProcessConnection::setNetworkProcessAuditToken): (WebKit::NetworkProcessConnection::networkProcessAuditToken const): * WebProcess/Network/NetworkProcessConnectionInfo.h: Added. (WebKit::NetworkProcessConnectionInfo::identifier): (WebKit::NetworkProcessConnectionInfo::encode const): (WebKit::NetworkProcessConnectionInfo::decode): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): (WebKit::WebLoaderStrategy::loadResourceSynchronously): (WebKit::WebLoaderStrategy::startPingLoad): (WebKit::WebLoaderStrategy::preconnectTo): * WebProcess/WebProcess.cpp: (WebKit::getNetworkProcessConnection): (WebKit::WebProcess::ensureNetworkProcessConnection): 2019-10-03 Konstantin Tokarev CMake-built WebKit.framework should launch XPC services successfully https://bugs.webkit.org/show_bug.cgi?id=202490 Reviewed by Carlos Alberto Lopez Perez. target_link_options() requires CMake 3.10, however we can avoid raising required CMake version by moving it to PlatformMac.cmake, also avoid introduction of new CMake variable. * CMakeLists.txt: * PlatformMac.cmake: 2019-10-03 Jiewen Tan Support googleLegacyAppidSupport extension https://bugs.webkit.org/show_bug.cgi?id=202427 Reviewed by Brent Fulgham. * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManagerInternal::collectTransports): (WebKit::AuthenticatorManagerInternal::processGoogleLegacyAppIdSupportExtension): (WebKit::AuthenticatorManager::handleRequest): * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp: (WebKit::CtapAuthenticator::makeCredential): (WebKit::CtapAuthenticator::processGoogleLegacyAppIdSupportExtension): * UIProcess/WebAuthentication/fido/CtapAuthenticator.h: * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp: (WebKit::U2fAuthenticator::continueRegisterCommandAfterResponseReceived): 2019-10-03 Jiewen Tan [WebAuthn] Implement dummy _WKWebAuthenticationPanel SPI https://bugs.webkit.org/show_bug.cgi?id=202507 Reviewed by Brent Fulgham. This patch implements dummy _WKWebAuthenticationPanel SPI to unblock Safari. Here are the illustrations for each SPI: 1) -[WKUIDelegatePrivate webView:runWebAuthenticationPanel:initiatedByFrame:completionHandler:] is used at the beginning of any WebAuthn ceremonies. A WKFrameInfo is provided for more info of the initiating frame so clients could decide either show the RP ID or the origin of the frame which may or may not be the RP ID. A callback of _WKWebAuthenticationPanelResult is provided such that clients could inform WebKit to continue the ceremony or not. Case like rate limiting of a modular dialog could result in _WKWebAuthenticationPanelResultDidNotPresent. Then WebKit will abort the operation. _WKWebAuthenticationPanelResultUnavailable tells WebKit the client has no UI implemented and therefore WebKit will operate in a non UI mode which basically will only enable HID authenticators, and is the current behavior of macOS Safari. 2) -[_WKWebAuthenticationPanelDelegate panel:updateWebAuthenticationPanel:] is primarily to instruct users to do some actionable thing to recover from some error state. However, it could be used for pure info as well. For _WKWebAuthenticationPanelInfoMultipleNFCTagPresents, users can be instructed to only hold one NFC tag to the scanner. For _WKWebAuthenticationPanelInfoNoCredentialsFound, users can potentially switch to another security key that could hit a match. 3) -[_WKWebAuthenticationPanelDelegate panel:dismissWebAuthenticationPanelWithResult:] is to dismiss UI. _WKWebAuthenticationResult is provided such that client could show different animations as a hint to the user. The reasons for failure could either be timeout or InvalidStateError which will be reported to the page as well. InvalidStateError signals a credential matching an entry of the exclude list (excludeCredentials) is found on the authenticator. 4) -[_WKWebAuthenticationPanel cancel] is the way clients tell WebKit a user cancel. * SourcesCocoa.txt: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h: Added. * UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm: Added. (-[_WKWebAuthenticationPanel _initWithRelayingPartyID:]): (-[_WKWebAuthenticationPanel relyingPartyID]): (-[_WKWebAuthenticationPanel cancel]): * UIProcess/API/Cocoa/_WKWebAuthenticationPanelInternal.h: Added. * WebKit.xcodeproj/project.pbxproj: 2019-10-03 Zan Dobersek [GTK][WPE] Enable async scrolling https://bugs.webkit.org/show_bug.cgi?id=202449 Reviewed by Carlos Garcia Campos. For WPE, explicitly enable the threaded scrolling preference on the WebPreferences object. For GTK, the same preference is enabled in parallel with the forced-compositing preference, as the async scrolling feature depends on always-on AC mode. To help with quick evaluation of potential issues around async scrolling the feature can still be disabled via the WEBKIT_DISABLE_ASYNC_SCROLLING environment variable, though this only works in DEVELOPER_MODE builds. * Shared/WebPreferencesDefaultValues.h: Default-enable async frame and overflow scrolling on Nicosia-using ports. * UIProcess/API/glib/WebKitSettings.cpp: (webkit_settings_set_hardware_acceleration_policy): * UIProcess/API/wpe/WPEView.cpp: (WKWPE::m_backend): * UIProcess/gtk/WebPreferencesGtk.cpp: (WebKit::WebPreferences::platformInitializeStore): * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: (WebKit::DrawingAreaCoordinatedGraphics::DrawingAreaCoordinatedGraphics): (WebKit::DrawingAreaCoordinatedGraphics::updatePreferences): (WebKit::DrawingAreaCoordinatedGraphics::supportsAsyncScrolling): * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h: 2019-10-03 Zan Dobersek [Nicosia] Enable runtime checks and triggers for async non-main-frame scrolling https://bugs.webkit.org/show_bug.cgi?id=202509 Reviewed by Carlos Garcia Campos. * WebProcess/WebCoreSupport/WebChromeClient.h: Allow the non-main-frame compositing trigger for the Nicosia-using ports as well. This will enable non-main-frame compositing if the related setting is also enabled. 2019-10-03 Alexander Mikhaylenko [GTK] Don't hardcode swipe navigation gesture style https://bugs.webkit.org/show_bug.cgi?id=202447 Reviewed by Carlos Garcia Campos. Use GTK foreign drawing to draw swipe gesture dimming and shadow instead of hardcoded opacity and gradient values. Have separate elements for dimming and shadow. Additionally, add border and outline. Dimming layer opacity always matches progress, shadow opacity is 1 except when the page is almost completely retracted. Border and outline opacity is always 1. Outline is drawn above the top page. For determining shadow, border and outline width, 'min-width' property is used. Each element also has .right or .left style class depending on text direction. Creating patterns is relatively expensive, so do it once a gesture starts and clear them once it ends. Style changes are currently not handled, since it's unlikely anything would change while the gesture is done. Dimming layer is created with the same width as webview and is clipped when drawing. Translate existing dimming and shadow into css as is, add subtle border and outline. Since it's controlled via css, downstreams can override the style. Set WebKitWebView css name to 'webkitwebview', and only apply styles for elements directly preceded by it, otherwise the selectors are too generic. * PlatformGTK.cmake: Add gtk.css to gresource bundle. * Resources/gtk/gtk-theme.css: Added. (webkitwebview > dimming): (webkitwebview > shadow): (webkitwebview > shadow.right): (webkitwebview > shadow.left): (webkitwebview > border): (webkitwebview > outline): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkit_web_view_base_class_init): Set css name to 'webkitwebview'. * UIProcess/ViewGestureController.h: * UIProcess/gtk/ViewGestureControllerGtk.cpp: (WebKit::ViewGestureController::createStyleContext): (WebKit::createElementPattern): (WebKit::elementWidth): (WebKit::ViewGestureController::beginSwipeGesture): Create helper patterns. (WebKit::ViewGestureController::draw): Rework drawing to use the patterns. (WebKit::ViewGestureController::removeSwipeSnapshot): Clear the patterns. 2019-10-03 Carlos Garcia Campos [GTK] Make PSON optional https://bugs.webkit.org/show_bug.cgi?id=200967 Reviewed by Michael Catanzaro. It's not possible to enable PSON by default and keep backwards compatibility, applications might need to use new API to monitor the page ID changes in the Web view. So, this patch adds a construct only property to WebKitWebContext to enable PSON. * UIProcess/API/glib/WebKitWebContext.cpp: (webkitWebContextGetProperty): (webkitWebContextSetProperty): (webkitWebContextConstructed): (webkit_web_context_class_init): 2019-10-03 Carlos Garcia Campos [GTK][WPE] Add WebKitWebView:page-id property https://bugs.webkit.org/show_bug.cgi?id=201642 Reviewed by Michael Catanzaro. The page ID of a WebKitWebView can now change, so we need a way to get notified when it changes. * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewGetProperty): Add getter for page-id. (webkit_web_view_class_init): Add page-id property (webkitWebViewDidChangePageID): Emit notify::page-id. * UIProcess/API/glib/WebKitWebViewPrivate.h: * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::didChangeWebPageID const): Call webkitWebViewDidChangePageID(). * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: * UIProcess/API/wpe/APIViewClient.h: (API::ViewClient::didChangePageID): Added virtual method. * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::didChangeWebPageID const): Call WKWPE::View::didChangePageID(). * UIProcess/API/wpe/PageClientImpl.h: * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::didChangePageID): Call API::ViewClient::didChangePageID(). * UIProcess/API/wpe/WPEView.h: * UIProcess/PageClient.h: (WebKit::PageClient::didChangeWebPageID const): Added virtual method. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::swapToWebProcess): Call PageClient::didChangeWebPageID(). 2019-10-02 Andy Estes [iOS] When hit testing for a context menu interaction, do not consider whether the element is contenteditable https://bugs.webkit.org/show_bug.cgi?id=202498 Reviewed by Tim Horton. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::startInteractionWithElementAtPosition): Changed to call WebCore::Frame::nodeRespondingToInteraction. 2019-10-02 Myles C. Maxfield REGRESSION (r245672):