2019-02-20 Carlos Garcia Campos [GTK] Epiphany searching for plugins even if plugins are disabled https://bugs.webkit.org/show_bug.cgi?id=194352 Reviewed by Michael Catanzaro. Check pluginsEnabled setting before trying to get plugins from UI process. * WebProcess/Plugins/WebPluginInfoProvider.cpp: (WebKit::WebPluginInfoProvider::populatePluginCache): 2019-02-20 Carlos Garcia Campos [WPE] Send client host fd and library name as web process creation parameters https://bugs.webkit.org/show_bug.cgi?id=194494 Reviewed by Žan Doberšek. Instead of using command line arguments. The code is simpler and we don't need wpe specific code in process launcher glib implementation. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: (WebKit::ProcessLauncher::launchProcess): * UIProcess/glib/WebProcessPoolGLib.cpp: (WebKit::WebProcessPool::platformInitializeWebProcess): * WebProcess/glib/WebProcessGLib.cpp: (WebKit::WebProcess::platformInitializeWebProcess): * WebProcess/wpe/WebProcessMainWPE.cpp: 2019-02-20 Adrian Perez de Castro [WPE][GTK] Enable support for CONTENT_EXTENSIONS https://bugs.webkit.org/show_bug.cgi?id=167941 Reviewed by Carlos Garcia Campos. Adds new API to manage a collection of content extensions on disk (including compilation of new ones) using WebKitUserContentFilterStore; the associated WebKitUserContentFilter type (which represents a compiled content extension); and the functions needed to enable and disable them for a given WebKitUserContentManager. The WebKitUserContentFilterStore public API is expressed in abstract terms of "saving" filters into the store (which involves compiling the JSON source rule set); and "loading" them back as main operations. This way we do not disclose to users of the API any detail about compilation, nor how contents are laid out on disk, and the documentation explicitly tells about only using the provided functions to manipulate the on-disk contents. This way we allow ourselves some leeway if the implementation needs changing in the future. * PlatformGTK.cmake: Added WebKitUserContentFilterStore.h to the list of public API headers. * PlatformWPE.cmake: Ditto. * SourcesGTK.txt: Added WebKitUserContentFilterStore.cpp * SourcesWPE.txt: Ditto. * UIProcess/API/glib/WebKitError.cpp: Add definition of webkit_user_content_filter_error_quark(). * UIProcess/API/glib/WebKitUserContent.cpp: Added WebKitUserContentFilter. (_WebKitUserContentFilter::_WebKitUserContentFilter): (webkit_user_content_filter_ref): (webkit_user_content_filter_unref): (webkit_user_content_filter_get_identifier): (webkitUserContentFilterCreate): (webkitUserContentFilterGetContentRuleList): * UIProcess/API/glib/WebKitUserContentFilterStore.cpp: Added. (toGError): Utility function to convert content extension error codes to GError. (webkit_user_content_filter_store_class_init): (webkit_user_content_filter_store_new): (webkit_user_content_filter_store_get_path): (webkitUserContentFilterStoreSaveBytes): Common function used as final step for all the functions which save (compile) JSON rule sets into the store, to avoid duplicating code. (webkit_user_content_filter_store_save): (webkit_user_content_filter_store_save_finish): (webkit_user_content_filter_store_save_from_file): (webkit_user_content_filter_store_save_from_file_finish): (webkit_user_content_filter_store_remove): (webkit_user_content_filter_store_remove_finish): (webkit_user_content_filter_store_load): (webkit_user_content_filter_store_lookup_finish): (webkit_user_content_filter_store_fetch_identifiers): (webkit_user_content_filter_store_fetch_identifiers_finish): * UIProcess/API/glib/WebKitUserContentManager.cpp: Added definitions for the new API functions to add and remove filters from an user content manager. (webkit_user_content_manager_add_filter): (webkit_user_content_manager_remove_filter): (webkit_user_content_manager_remove_all_filters): * UIProcess/API/glib/WebKitUserContentPrivate.h: Added declarations for webkitUserContentFilterCreate() and webkitUserContentFilterGetContentRuleList(). * UIProcess/API/gtk/WebKitAutocleanups.h: Added autocleanups for WebKitUserContentFilter and WebKitUserContentFilterStore. * UIProcess/API/gtk/WebKitError.h: Added declarations for WEBKIT_USER_CONTENT_FILTER_ERROR plus the associated webkit_user_content_filter_error_quark() function and WebKitUserContentFilterErrror enum. * UIProcess/API/gtk/WebKitUserContent.h: Added declarations for WebKitUserContentFilter and its associated functions. * UIProcess/API/gtk/WebKitUserContentFilterStore.h: Added. * UIProcess/API/gtk/WebKitUserContentManager.h: Added declarations for the functions to add and remove filters from the user content manager. * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Added new API functions and types to be included in the documentation. * UIProcess/API/gtk/webkit2.h: Added inclusion of WebKitUserContentFilterStore.h * UIProcess/API/wpe/WebKitError.h: Same as for the GTK port header. * UIProcess/API/wpe/WebKitUserContent.h: Same as for the GTK port header. * UIProcess/API/wpe/WebKitUserContentFilterStore.h: Added. * UIProcess/API/wpe/WebKitUserContentManager.h: Same as for the GTK port header. * UIProcess/API/wpe/docs/wpe-0.1-sections.txt: Added new API functions and types to be included in the documentation. * UIProcess/API/wpe/webkit.h: Added inclusion of WebKitUserContentFilterStore.h 2019-02-19 Antti Koivisto Pass rootContentsLayer to Mac remote layer tree https://bugs.webkit.org/show_bug.cgi?id=194828 Reviewed by Simon Fraser. Make this code path work again. * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder::encode): (ArgumentCoder::decode): * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): 2019-02-19 Alex Christensen Reduce use of LegacySync IPC messages https://bugs.webkit.org/show_bug.cgi?id=194783 Reviewed by Geoffrey Garen. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::handleSynchronousMessage): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessPool.messages.in: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::getPlugins): (WebKit::WebProcessProxy::shouldTerminate): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/Plugins/PluginProcessConnection.cpp: (WebKit::PluginProcessConnection::setException): * WebProcess/Plugins/PluginProcessConnection.h: * WebProcess/Plugins/PluginProcessConnection.messages.in: * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::didCreatePlugin): (WebKit::PluginProxy::didFailToCreatePlugin): (WebKit::PluginProxy::proxiesForURL): (WebKit::PluginProxy::cookiesForURL): (WebKit::PluginProxy::getAuthenticationInfo): (WebKit::PluginProxy::getPluginElementNPObject): (WebKit::PluginProxy::evaluate): (WebKit::PluginProxy::createPluginContainer): * WebProcess/Plugins/PluginProxy.h: * WebProcess/Plugins/PluginProxy.messages.in: 2019-02-19 Alex Christensen Remove assertion introduced in r229683 https://bugs.webkit.org/show_bug.cgi?id=194825 Reviewed by Geoffrey Garen. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm): If we reach this code and the form's original Document's Frame has been destroyed, we have already been told to submit the form so do so, just like we do if the WebPage has been destroyed. This is a rare edge case having to do with the timing of Frame destruction and decidePolicyForNavigationAction response, which unfortunately does not reproduce with a test case unless the timing of IPC is just right. 2019-02-19 Antoine Quint [iOS] "touch-action: none" should not prevent text selection or tapping on a link https://bugs.webkit.org/show_bug.cgi?id=194812 Reviewed by Dean Jackson. We shouldn't prevent all gestures to be disabled when "touch-action: none" is set and instead follow the same code path we would use should "pan-x", "pan-y" or "pinch-zoom" be used. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _handleTouchActionsForTouchEvent:]): 2019-02-18 Alex Christensen Revert functional part of r241451 https://bugs.webkit.org/show_bug.cgi?id=194510 * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFinishDocumentLoadForFrame): It caused crashes and assertions on Linux and Cocoa without safe browsing, which means it's fundamentally flawed in some way. The testing piping was fine. 2019-02-18 Chris Dumez REGRESSION (PSON): Can't access optumbank.com from myuhc.com https://bugs.webkit.org/show_bug.cgi?id=194797 Reviewed by Geoffrey Garen. The issue was caused by us mistakenly process-swapping for a same-site server side redirect. The reason we were getting it wrong is because the logic in WebProcessPool::processForNavigationInternal() was expecting page.process() to be the source process and page.pageLoadState().url() to be the source URL. Those assumptions are incorrect when a server-side redirect occurs in a provisional process. In such case, the source process is the ProvisionalPageProxy's process and the source URL is the provisional URL, not the committed one. * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::didPerformServerRedirect): (WebKit::ProvisionalPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame): (WebKit::ProvisionalPageProxy::didReceiveMessage): * UIProcess/ProvisionalPageProxy.h: Make sure the provisional page forwards IPC related to server-side redirects to the page so that the client gets informed. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedNavigationPolicyDecision): (WebKit::WebPageProxy::didPerformServerRedirect): (WebKit::WebPageProxy::didPerformServerRedirectShared): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigation): (WebKit::WebProcessPool::processForNavigationInternal): * UIProcess/WebProcessPool.h: 2019-02-16 Darin Adler Continue reducing use of String::format, now focusing on hex: "%p", "%x", etc. https://bugs.webkit.org/show_bug.cgi?id=194752 Reviewed by Daniel Bates. * Platform/IPC/win/ConnectionWin.cpp: (IPC::Connection::createServerAndClientIdentifiers): Use makeString instead of String::format. * Shared/win/WebEventFactory.cpp: (WebKit::keyIdentifierFromEvent): Ditto. * UIProcess/API/APINavigation.cpp: (API::Navigation::loggingString const): Use hex instead of String::format. * UIProcess/SuspendedPageProxy.cpp: (WebKit::SuspendedPageProxy::loggingString const): Ditto. * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::loggingString): Added a "0x". * UIProcess/gtk/InputMethodFilter.cpp: (WebKit::InputMethodFilter::logHandleKeyboardEventForTesting): Use makeString and hex instead of String::format and "%x". (WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting): Ditto. 2019-02-18 Wenson Hsieh [iOS] Support pasting item-provider-backed data on the pasteboard as attachment elements https://bugs.webkit.org/show_bug.cgi?id=194670 Reviewed by Tim Horton. Remove all IPC plumbing for getTypesByFidelityForItemAtIndex, now that the types in fidelity order have been rolled into PasteboardItemInfo. Additionally, remove support for subresource URL replacement. This feature was originally added with the intention that private clients (i.e. Mail) would intercept pasted or dropped images and replace their URLs. However, since , our strategy for this scenario has changed, such that WebKit now handles the drop/paste, and later delivers the image data to the client via NSFileWrappers in the UI process. At this time, there are no adopters of this SPI, and no adopters of the V2 injected bundle editing client. As such, we can simply revert all of this to its state prior to the introduction of the replacement URL SPI, with the exception to changes in WKBundlePageEditorClient.h, wherein there is a nonzero (but likely tiny) chance of completely breaking binary compatability with any third parties on macOS which may have tried to adopt subresource URL replacement. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::getPasteboardTypesByFidelityForItemAtIndex): Deleted. * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView canPerformActionForWebView:withSender:]): Return YES for -paste: in the case where: 1. The pasteboard contains items that are explicitly marked as attachments. 2. The selection is richly contenteditable. 3. Attachment elements are enabled. Among other things, this allows the callout bar on iOS to show the "Paste" action. * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h: (API::InjectedBundle::EditorClient::performTwoStepDrop): (API::InjectedBundle::EditorClient::replacementURLForResource): Deleted. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp: (WebKit::InjectedBundlePageEditorClient::replacementURLForResource): Deleted. * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::replacementURLForResource): Deleted. * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::getTypesByFidelityForItemAtIndex): Deleted. * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2019-02-18 Jeremy Jones exitFullscreen should not instantiate a new model/interface mapping. https://bugs.webkit.org/show_bug.cgi?id=191988 rdar://problem/42327939 Reviewed by Jer Noble. This change is a speculative fix for a crash that cannot be reproduced. Somehow, exitFullscreen is being requested after didCleanupFullscreen has completed. This change should allow us to prevent the crash in release, and assert in debug. * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: (WebKit::VideoFullscreenManagerProxy::exitFullscreen): 2019-02-18 John Wilander Check the existence of the frame in Document::hasFrameSpecificStorageAccess() and Document::setHasFrameSpecificStorageAccess() https://bugs.webkit.org/show_bug.cgi?id=194777 Reviewed by Geoffrey Garen and Chris Dumez. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::logUserInteraction): Now returns early if the incoming session ID is invalid. Added an ASSERT to help us find other call sites passing invalid session IDs. 2019-02-18 Per Arne Vollan It should be possible to get the mouse event modifiers for a page overlay client. https://bugs.webkit.org/show_bug.cgi?id=189621 Reviewed by Daniel Bates. When access to the WindowServer is blocked, [NSEvent modifierFlags] always returns 0. This can be fixed by swizzling the class method, and getting the cached modifiers from PlatformKeyboardEvent. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::currentModifierFlags): (WebKit::WebProcess::platformInitializeProcess): 2019-02-18 Claudio Saavedra WebPageProxy::didFinishDocumentLoadForFrame() crashing in WPE and GTK+ ports https://bugs.webkit.org/show_bug.cgi?id=194774 Reviewed by Alex Christensen. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFinishDocumentLoadForFrame): Null check navigation before using it. This is a regression from r241451. 2019-02-18 Daniel Bates [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element https://bugs.webkit.org/show_bug.cgi?id=192824 Reviewed by Wenson Hsieh. Use the same code path for key events to editable elements and non-editable elements. Currently we have different code paths for hardware key events depending on whether the active element is editable or non-editable. Historically to support dispatching DOM keyboard events for hardware key presses this differentiation was a necessary workaround for UIKit's event processing precedence of interpreting key events for system text editing commands and app commands before dispatching unhandled key events to WebKit. This workaround intercepted raw key UIEvents and manually reconstructed a WebEvent from it. However there is not enough information in an UIEvent to reconstruct a WebEvent that is identical to the WebEvent that UIKit would have dispatched. In particular, keyup UIEvents always have empty modified and unmodified input strings. The UIKit keyboard machinery maintains additional state that is necessary to manufacture the correct WebEvent corresponding to a UIEvent. As a side benefit of this change, with the exception of modifier flag changes, both hardware and software key events use the same code path. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView shouldShowAutomaticKeyboardUI]): Extracted code from _requiresKeyboardWhenFirstResponder (-[WKContentView _disableAutomaticKeyboardUI]): Implement UIKit SPI to prevent showing the keyboard UI when there is no focused element now that we are no longer intercepting key UIEvents. Formerly the keyboard UI was disabled as a side effect of not becoming first responder when there was no focused element (by returning NO in -_requiresKeyboardWhenFirstResponder). (-[WKContentView _requiresKeyboardWhenFirstResponder]): Always return YES when building with USE(UIKIT_KEYBOARD_ADDITIONS) so that we always accept key events. Instead of selectively replying to create a keyboard as a means of hiding the automatic keyboard UI we now implement _disableAutomaticKeyboardUI to selectively hide the automatic keyboard UI. (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]): If we are not in an editable element then we cannot perform the replacement. This logic was necessary now that we always require a keyboard. (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]): If we are not in an editable element then return an autocorrection object that indicates that we could not compute this data. This logic was necessary now that we always require a keyboard. (-[WKContentView textInputTraits]): Do not update traits when the keyboard is going to be dismissed now that we require a keyboard when first responder even if the focused element is non-editable. (-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Skip logic for re-sending UIEvents to UIKit as UIKit now processes the event first. This logic was necessary in order to finally allow UIKit its chance to interpret the UIEvent, we intercepted, for app key commands. (-[WKContentView _elementDidBlur]): Call [self _endEditing] so that we dismiss any open form controls (e.g. a s into the PluginDocument's DOM, but we can't do that if there is no PluginDocument, just a main document, like in the case. 2019-02-12 Jiewen Tan Further restricting webarchive loads https://bugs.webkit.org/show_bug.cgi?id=194567 Reviewed by Youenn Fablet. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadRequest): Set a flag to indicate a load is started from clients. 2019-02-13 Michael Catanzaro [WPE][GTK] Merge WebProcessPoolWPE.cpp and WebProcessPoolGtk.cpp https://bugs.webkit.org/show_bug.cgi?id=194551 Reviewed by Carlos Garcia Campos. * SourcesGTK.txt: * SourcesWPE.txt: * UIProcess/glib/WebProcessPoolGLib.cpp: Renamed from Source/WebKit/UIProcess/gtk/WebProcessPoolGtk.cpp. (WebKit::initializeRemoteInspectorServer): (WebKit::memoryPressureMonitorDisabled): (WebKit::WebProcessPool::platformInitialize): (WebKit::WebProcessPool::platformInitializeWebProcess): (WebKit::WebProcessPool::platformInvalidateContext): (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions): * UIProcess/wpe/WebProcessPoolWPE.cpp: Removed. 2019-02-13 Michael Catanzaro Fix -Wformat warning from r241401 https://bugs.webkit.org/show_bug.cgi?id=194584 * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setActivityState): 2019-02-13 Youenn Fablet Make WebRTCUnifiedPlanEnabled true by default https://bugs.webkit.org/show_bug.cgi?id=194595 Reviewed by Eric Carlson. * Shared/WebPreferences.yaml: 2019-02-13 John Wilander Store Ad Click Attribution requests in the network process https://bugs.webkit.org/show_bug.cgi?id=194510 Reviewed by Alex Christensen and Daniel Bates. With this patch, WebPageProxy::didCommitLoadForFrame() now looks for an AdClickAttribution object in its navigation state. If there is an attribution, it sends it to the network process where the WebKit::NetworkSession stores it in an object of a new class, WebKit::NetworkAdClickAttribution. This patch also covers test infrastructure to support two new TestRunner functions: - dumpAdClickAttribution() - clearAdClickAttribution() * NetworkProcess/Cookies/WebCookieManager.cpp: Added missing header include. * NetworkProcess/Downloads/DownloadManager.cpp: Added missing header include. * NetworkProcess/NetworkAdClickAttribution.cpp: Added. (WebKit::NetworkAdClickAttribution::ensureDestinationMapForSource): (WebKit::NetworkAdClickAttribution::store): (WebKit::NetworkAdClickAttribution::clear): (WebKit::NetworkAdClickAttribution::toString const): * NetworkProcess/NetworkAdClickAttribution.h: Added. Stores WebCore::AdClickAttribution objects in a map structure. * NetworkProcess/NetworkLoad.cpp: Added missing header includes. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::storeAdClickAttribution): (WebKit::NetworkProcess::dumpAdClickAttribution): (WebKit::NetworkProcess::clearAdClickAttribution): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::NetworkSession): (WebKit::NetworkSession::storeAdClickAttribution): (WebKit::NetworkSession::dumpAdClickAttribution): (WebKit::NetworkSession::clearAdClickAttribution): * NetworkProcess/NetworkSession.h: * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp: Added missing header include. * Sources.txt: Added NetworkProcess/NetworkAdClickAttribution.cpp. * UIProcess/API/APINavigation.h: (API::Navigation::adClickAttribution const): * UIProcess/API/C/WKPage.cpp: (WKPageDumpAdClickAttribution): (WKPageClearAdClickAttribution): Test infrastructure. * UIProcess/API/C/WKPagePrivate.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::dumpAdClickAttribution): (WebKit::NetworkProcessProxy::clearAdClickAttribution): Test infrastructure. * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFinishDocumentLoadForFrame): This is where pending Ad Click Attributions are forwarded to the network process. (WebKit::WebPageProxy::dumpAdClickAttribution): (WebKit::WebPageProxy::clearAdClickAttribution): Test infrastructure. * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::dumpAdClickAttribution): (WebKit::WebProcessPool::clearAdClickAttribution): Test infrastructure. * UIProcess/WebProcessPool.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Added missing data copying from navigationAction to navigationActionData. 2019-02-13 Antti Koivisto Crash in WebKit::CacheStorage::Engine::cachesRootPath https://bugs.webkit.org/show_bug.cgi?id=194588 Reviewed by Youenn Fablet. * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::cachesRootPath): Salt may have not been initialized yet when the Engine is destroyed. 2019-02-13 Alex Christensen Remove legacy sync messaging in some IPC code https://bugs.webkit.org/show_bug.cgi?id=194561 Reviewed by Geoffrey Garen. Changing some LegacySync messages to Delayed messages. We should probably rename Delayed to Sync. There are too many ways to send messages. Let's work to get rid of the old one. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::setAllowsAnySSLCertificateForWebSocket): (WebKit::NetworkProcess::processWillSuspendImminently): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::handleWheelEvent): (WebKit::PluginControllerProxy::handleMouseEnterEvent): (WebKit::PluginControllerProxy::handleMouseLeaveEvent): (WebKit::PluginControllerProxy::handleKeyboardEvent): (WebKit::PluginControllerProxy::handleEditingCommand): (WebKit::PluginControllerProxy::isEditingCommandEnabled): (WebKit::PluginControllerProxy::handlesPageScaleFactor): (WebKit::PluginControllerProxy::requiresUnifiedScaleFactor): (WebKit::PluginControllerProxy::paintEntirePlugin): (WebKit::PluginControllerProxy::supportsSnapshotting): (WebKit::PluginControllerProxy::snapshot): (WebKit::PluginControllerProxy::getPluginScriptableNPObject): (WebKit::PluginControllerProxy::getFormValue): * PluginProcess/PluginControllerProxy.h: * PluginProcess/PluginControllerProxy.messages.in: * Shared/Plugins/NPObjectMessageReceiver.cpp: (WebKit::NPObjectMessageReceiver::deallocate): (WebKit::NPObjectMessageReceiver::hasMethod): (WebKit::NPObjectMessageReceiver::invoke): (WebKit::NPObjectMessageReceiver::invokeDefault): (WebKit::NPObjectMessageReceiver::hasProperty): (WebKit::NPObjectMessageReceiver::getProperty): (WebKit::NPObjectMessageReceiver::setProperty): (WebKit::NPObjectMessageReceiver::removeProperty): (WebKit::NPObjectMessageReceiver::enumerate): (WebKit::NPObjectMessageReceiver::construct): * Shared/Plugins/NPObjectMessageReceiver.h: * Shared/Plugins/NPObjectMessageReceiver.messages.in: * UIProcess/mac/SecItemShimProxy.cpp: (WebKit::SecItemShimProxy::secItemRequest): * UIProcess/mac/SecItemShimProxy.h: * UIProcess/mac/SecItemShimProxy.messages.in: 2019-02-13 Truitt Savell Unreviewed, rolling out r241433. Broke internal builds. Reverted changeset: "Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI" https://bugs.webkit.org/show_bug.cgi?id=194531 https://trac.webkit.org/changeset/241433 2019-02-12 Antoine Quint Move UIWebTouchEventsGestureRecognizer.activeTouchesByIdentifier to SPI https://bugs.webkit.org/show_bug.cgi?id=194531 Reviewed by Dean Jackson. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cancelPointersForGestureRecognizer:]): We update the referenced Radar since we need to keep the call to respondsToSelector until the SPI has shipped for OpenSource builds to work. 2019-02-13 Antoine Quint Support simulated mouse events on iOS based on a PlatformTouchEvent https://bugs.webkit.org/show_bug.cgi?id=194501 Reviewed by Dean Jackson. Add two new internal runtime flags to control whether simulated mouse events should be dipatched along with touch events and whether simulated mousemove events dispatched should automatically trigger the behavior preventDefault() would also trigger. We also ensure that we correctly create touch tracking regions for mouse events. * Shared/WebPreferences.yaml: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateTouchEventTracking): 2019-02-13 Ryosuke Niwa Crash in Page::setActivityState because m_page is null https://bugs.webkit.org/show_bug.cgi?id=194584 Reviewed by Antti Koivisto. Add a null check to avoid the crash. Also add a debug assertion to help diagnose this in the future. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setActivityState): 2019-02-13 Ryosuke Niwa Release assert in PolicyCheckIdentifier::isValidFor via WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction https://bugs.webkit.org/show_bug.cgi?id=194582 Reviewed by Antti Koivisto. The bug was caused by WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction invoking the callback with responseIdentifier even when we had failed to send the policy check IPC. Clearly, responseIdentifier is invalid in that case, and we should be using requestIdentifier instead. Unfortunately no new tests since I'm not aware of a way to make sendSync fail in this case. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): 2019-02-13 Benjamin Poulain Responsiveness timers are too expensive for frequent events https://bugs.webkit.org/show_bug.cgi?id=194003 Reviewed by Geoffrey Garen. With each event, we set a responsivness timer to check if the WebProcess is responsive, and reset the timer when the WebProcess sends an answer. For frequent events (e.g. wheel events, mouse force events, etc), we are spamming the kernel with hundreds of timers per second. That is a bit inefficient. Another source of inefficiency comes from the timer implementation itself. Stopping a RunLoop::Timer removes the timer from every mode and invalidate the timer. It becomes costly since we do it a lot. With this patch, I tweak ResponsivenessTimer and its use to minimize how often we schedule system timers. The first change is to not stop the timer when we get the stop() calls if we expect more events to come in. Instead, we keep track if we care about the timeout or not in the attribute "m_waitingForTimer". When the next event starts, we can reschedule the timer without ever having told the kernel about the stop. If there are no next events, the timeout fires but m_waitingForTimer is false. To avoid idle wake up, the lazy stop is only used when having following events is common. The second improvements comes from not even rescheduling the timer when restarted. Instead of changing the timer, we let the original timer fire and re-shedule a new one with the missing time. For more context, also see patches r240759 and r240944. * UIProcess/ResponsivenessTimer.cpp: (WebKit::ResponsivenessTimer::ResponsivenessTimer): (WebKit::ResponsivenessTimer::invalidate): (WebKit::ResponsivenessTimer::timerFired): (WebKit::ResponsivenessTimer::start): (WebKit::ResponsivenessTimer::startWithLazyStop): (WebKit::ResponsivenessTimer::stop): (WebKit::ResponsivenessTimer::processTerminated): (WebKit::ResponsivenessTimer::~ResponsivenessTimer): Deleted. * UIProcess/ResponsivenessTimer.h: (WebKit::ResponsivenessTimer::hasActiveTimer const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::processNextQueuedMouseEvent): (WebKit::WebPageProxy::sendWheelEvent): (WebKit::WebPageProxy::handleKeyboardEvent): (WebKit::WebPageProxy::handleGestureEvent): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::isResponsiveWithLazyStop): * UIProcess/WebProcessProxy.h: 2019-02-12 Tim Horton Null deref in userInterfaceLayoutDirection under ViewGestureController::handleSwipeGesture https://bugs.webkit.org/show_bug.cgi?id=194569 Reviewed by Wenson Hsieh. * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::handleSwipeGesture): It is conceivable that we could get here if the client closes the page e.g. in the callback from willEndSwipeGesture. We already guarded against this ... one line too late! Rearrange the lines so we don't call into WebPageProxy at all if we don't have a drawing area (which is a strict subset of the time that isValid would return true). This is a speculative fix, since I can no longer reproduce the crash on demand. 2019-02-12 Youenn Fablet WebServiceWorkerProvider::handleFetch no longer needs a CachedResource parameter https://bugs.webkit.org/show_bug.cgi?id=194548 Reviewed by Alex Christensen. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): * WebProcess/Storage/WebServiceWorkerProvider.cpp: (WebKit::WebServiceWorkerProvider::handleFetch): * WebProcess/Storage/WebServiceWorkerProvider.h: 2019-02-12 Tim Horton Remove WKLegacyPDFView https://bugs.webkit.org/show_bug.cgi?id=194559 Reviewed by Andy Estes. * Platform/spi/ios/CorePDFSPI.h: Removed. * SourcesCocoa.txt: * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm: (-[WKWebViewContentProviderRegistry initWithConfiguration:]): * UIProcess/ios/WKLegacyPDFView.h: Removed. * UIProcess/ios/WKLegacyPDFView.mm: Removed. * WebKit.xcodeproj/project.pbxproj: 2019-02-12 Chris Dumez Regression(PSON) MESSAGE_CHECK() hit under WebPageProxy::didFailProvisionalLoadForFrameShared() https://bugs.webkit.org/show_bug.cgi?id=194568 Reviewed by Ryosuke Niwa. When the provisional process crashes, it is unsafe to call ProvisionalPageProxy::cancel() because the WebProcessProxy clears its frame map as soon as the process crashes. Calling cancel() after that would call WebPageProxy::didFailProvisionalLoadForFrameShared(), which would try to look up the frame by ID and MESSAGE_CHECK() that the frame is not null. We would fail this check since the frame has been removed from the WebProcessProxy at this point. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _provisionalWebProcessIdentifier]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared): (WebKit::WebPageProxy::provisionalProcessDidTerminate): 2019-02-12 Per Arne Vollan [iOS] Youtube fails to play. https://bugs.webkit.org/show_bug.cgi?id=194565 Reviewed by Geoffrey Garen. This is caused by sandbox violations and was introduced in r240500. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-02-12 Alex Christensen Remove firing assertion after r241317 https://bugs.webkit.org/show_bug.cgi?id=194506 * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::setDefersLoading): The creation of a PageGroupLoadDeferrer in Chrome.cpp tries to defer loading. See comments in Chrome::runJavaScriptAlert et al. This was necessary with WebKitLegacy, so keep it, but it doesn't need to do anything in modern WebKit. 2019-02-12 Tim Horton Find on Page shouldn't zoom in on matches https://bugs.webkit.org/show_bug.cgi?id=194557 Reviewed by Wenson Hsieh. * UIProcess/ios/SmartMagnificationController.h: * UIProcess/ios/SmartMagnificationController.messages.in: * UIProcess/ios/SmartMagnificationController.mm: (WebKit::SmartMagnificationController::scrollToRect): * WebProcess/WebPage/ios/FindControllerIOS.mm: (WebKit::FindController::updateFindIndicator): Only scroll to reveal the find result, do not zoom in. 2019-02-12 Wenson Hsieh Allow pages to trigger programmatic paste from script on iOS https://bugs.webkit.org/show_bug.cgi?id=194271 Reviewed by Tim Horton. Cancel the pending DOM paste access handler when the menu is about to hide, rather than when the hiding animation has completed. This ensures that if the page (on behalf of the user) requests DOM paste again during user interaction before the callout bar has finished fading after the previous DOM paste, we won't automatically cancel the incoming DOM paste access request because the callout bar animation finished. This scenario is exercised in the layout test editing/pasteboard/ios/dom-paste-consecutive-confirmations.html. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView _willHideMenu:]): (-[WKContentView _didHideMenu:]): 2019-02-12 Chris Fleizach AX: IsolatedTree: Implement more attributes https://bugs.webkit.org/show_bug.cgi?id=193911 Reviewed by Daniel Bates. * Platform/spi/mac/AccessibilityPrivSPI.h: Added. * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h: * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: (-[WKAccessibilityWebPageObjectBase clientSupportsIsolatedTree]): (-[WKAccessibilityWebPageObjectBase isolatedTreeRootObject]): (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]): * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: (-[WKAccessibilityWebPageObject IGNORE_WARNINGS_END]): (-[WKAccessibilityWebPageObject convertScreenPointToRootView:]): (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]): (-[WKAccessibilityWebPageObject accessibilityAttributeSizeValue]): (-[WKAccessibilityWebPageObject accessibilityAttributePositionValue]): (-[WKAccessibilityWebPageObject accessibilityDataDetectorValue:point:]): (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]): (-[WKAccessibilityWebPageObject accessibilityHitTest:]): 2019-02-12 Wenson Hsieh Allow pages to trigger programmatic paste from script on iOS https://bugs.webkit.org/show_bug.cgi?id=194271 Reviewed by Ryosuke Niwa. * Shared/WebPreferences.yaml: * Shared/WebPreferencesDefaultValues.h: Add an internal setting to enable or disable DOM paste access requests. This is on by default in iOS only (excluding watchOS and Apple TV), and is additionally disabled on macOS. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::requestDOMPasteAccess): * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::requestDOMPasteAccess): Plumb DOM paste access requests from the web process (WebEditorClient) to the view (WKContentView). As per the usual, this involves WebEditorClient, WebPage, WebPageProxy, PageClient and finally WKContentView. * UIProcess/API/wpe/PageClientImpl.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestDOMPasteAccess): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::requestDOMPasteAccess): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView cleanupInteraction]): (-[WKContentView resignFirstResponderForWebView]): (-[WKContentView _webTouchEventsRecognized:]): Bail from any pending DOM paste access handler the moment we start handling touches on the web view, or if the web view resigns first responder, or if the web process crashes. (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): Reject text selection gestures while waiting for DOM paste access. (-[WKContentView canPerformAction:withSender:]): (-[WKContentView canPerformActionForWebView:withSender:]): If we're handling a DOM paste, always return YES to allow the callout bar to show the "Paste" option. (-[WKContentView _didHideMenu:]): If the menu is programmatically hidden by the app while handling a DOM paste request, immediately reject the DOM paste request. (-[WKContentView pasteForWebView:]): Adjust -pasteForWebView: on WKContentView to first check whether there's an outstanding DOM paste completion handler to invoke, instead of telling the page to execute a paste command. (-[WKContentView _handleDOMPasteRequestWithResult:]): Add a helper to take and invoke the current DOM paste completion handler (if it exists) with the given result, and then dismiss the shared callout bar. Returns whether or not the paste completion handler exists. Invoked from various sources of user interaction or significant state changes (e.g. following a web process crash in -cleanupInteraction). (-[WKContentView _willPerformAction:sender:]): (-[WKContentView _didPerformAction:sender:]): Add hooks to detect when WKContentView is executing an editing action. This is to ensure that the page doesn't get stuck in a bad state in the case where WKWebView has been subclassed, overrides `-paste:`, and does not invoke the superclass method (which calls back into `-[WKContentView pasteForWebView:]`). There are a few possibilities here: 1. WKWebView's `-paste:` action is not overridden. In this case, we will call back into `-pasteForWebView:`, which will notice that we have a pending paste completion handler and invoke it. 2. WKWebView's `-paste:` action is overridden and does not call back into the content view. In this case, we will invoke the paste completion handler in `-_didPerformAction:sender:`. 3. WKWebView's `-canPerformAction:withSender:` is overridden to include additional actions. In this case, we may get a call to invoke a different action selector while waiting for a potential paste action. If this happens, prevent the DOM paste in `-_willPerformAction:sender:` prior to handling the other action. (-[WKContentView handleKeyWebEvent:withCompletionHandler:]): Dismiss DOM paste UI upon handling any key event. (-[WKContentView showGlobalMenuControllerInRect:]): (-[WKContentView hideGlobalMenuController]): Helper methods to present and dismiss the global UIMenuController, that accounts for available platform APIs for presenting or dismissing the menu controller on iOS. (-[WKContentView _requestDOMPasteAccessWithElementRect:completionHandler:]): Attempt to find a good target presentation rect when showing the callout menu. First, we will try to use the rect of the element the user has interacted with when triggering the paste. If such an element is too large or does not exist, we fall back to presenting the callout menu near the user's last touch location (with a small amount of margin, such that the action doesn't overlap with the user's finger, stylus, etc.). (-[WKContentView _resetShowingTextStyle:]): Deleted. Rename this to `-_didHideMenu:`. * UIProcess/mac/PageClientImplMac.h: * UIProcess/win/PageClientImpl.cpp: (WebKit::PageClientImpl::requestDOMPasteAccess): * UIProcess/win/PageClientImpl.h: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::requestDOMPasteAccess): * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::requestDOMPasteAccess): Add more plumbing and method stubs. (WebKit::WebPage::updateCurrentModifierState): (WebKit::WebPage::rectForElementAtInteractionLocation const): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::rectForElementAtInteractionLocation const): (WebKit::WebPage::rectForElementAtInteractionLocation): Deleted. Mark this method as const, add a platform-agnostic stub, and adopt it for the purposes of determining where to position the callout bar when pasting. 2019-02-12 Alex Christensen Remove setDefersLoading infrastructure from WebKit2 https://bugs.webkit.org/show_bug.cgi?id=194506 Reviewed by Brady Eidson. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::setDefersLoading): Deleted. * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkDataTask.h: * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::suspend): Deleted. * NetworkProcess/NetworkDataTaskBlob.h: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::initialize): (WebKit::NetworkLoad::setDefersLoading): Deleted. * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::start): (WebKit::NetworkResourceLoader::startNetworkLoad): (WebKit::NetworkResourceLoader::setDefersLoading): Deleted. * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::suspend): Deleted. * NetworkProcess/curl/NetworkDataTaskCurl.cpp: (WebKit::NetworkDataTaskCurl::suspend): Deleted. * NetworkProcess/curl/NetworkDataTaskCurl.h: * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::suspend): Deleted. * NetworkProcess/soup/NetworkDataTaskSoup.h: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): (WebKit::WebLoaderStrategy::setDefersLoading): 2019-02-12 Michael Catanzaro Unreviewed, fix build warnings after content extensions enablement https://bugs.webkit.org/show_bug.cgi?id=193622 * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp: (toResult): 2019-02-12 Tim Horton Switching focus from a UITextField to an editable WKWebView causes the keyboard to dance https://bugs.webkit.org/show_bug.cgi?id=194524 Reviewed by Wenson Hsieh. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/InputViewUpdateDeferrer.h: * UIProcess/ios/InputViewUpdateDeferrer.mm: (WebKit::InputViewUpdateDeferrer::InputViewUpdateDeferrer): (WebKit::InputViewUpdateDeferrer::~InputViewUpdateDeferrer): Make use of the per-responder and much safer input view pinning mechanism. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView becomeFirstResponderForWebView]): (-[WKContentView _singleTapCommited:]): (-[WKContentView _attemptClickAtLocation:modifierFlags:]): Always temporarily pin input views when becoming first responder; there are many paths (such as through the text interaction assistant) that can focus us on tap, trying to cover them all is a fool's errand. We'll just get out the big hammer and call it in becomeFirstResponder. This also means we can remove it from _singleTapCommitted and _attemptClick... (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): Don't release the input view pinning until we return from _elementDidFocus; it does the rebuilding synchronously, so we need to have actually updated all of the prerequisites of -inputView before depinning. 2019-02-12 Youenn Fablet Make use of is https://bugs.webkit.org/show_bug.cgi?id=194541 Reviewed by Alex Christensen. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): 2019-02-12 Alex Christensen WebPage::close needs to remove all message receivers associated with that WebPage, not WebPage::~WebPage https://bugs.webkit.org/show_bug.cgi?id=194522 Reviewed by Chris Dumez. The InjectedBundle SPI can retain the WebPage or wrapping objects (WKWebProcessPlugInBrowserContextController/WKBundlePageRef). This can make it so WebPage::close is called before WebPage::~WebPage, and if the SuspendedPageProxy is reused for a subsequent navigation to the same domain, the WebProcess is reused with a different WebPage instance with the same PageID, which causes problems when another WebPage registers message handlers and then the previous WebPage is destroyed, which removes both message handlers. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::~WebPage): (WebKit::WebPage::close): (WebKit::WebPage::mainFrameDidLayout): * WebProcess/WebPage/WebPage.h: * WebProcess/WebProcess.h: (WebKit::WebProcess::eventDispatcher): 2019-02-12 Michael Catanzaro [WPE][GTK] Unsafe g_unsetenv() use in WebProcessPool::platformInitialize https://bugs.webkit.org/show_bug.cgi?id=194370 Reviewed by Darin Adler. It is incorrect to use g_unsetenv() here because it is MT-Unsafe. We know that it is impossible and unreasonable to expect the application has not started other threads at this point, and threads will be calling getenv(). WebKit itself has probably already started threads of its own. Fortunately, the remote inspector in the web process is already prepared to deal with failure to connect to the inspector server, so we don't need to do anything except stop messing with the environment. Note these files are copies of each other. I'll merge them together in a follow-up patch. * UIProcess/gtk/WebProcessPoolGtk.cpp: (WebKit::initializeRemoteInspectorServer): (WebKit::WebProcessPool::platformInitialize): * UIProcess/wpe/WebProcessPoolWPE.cpp: (WebKit::initializeRemoteInspectorServer): (WebKit::WebProcessPool::platformInitialize): 2019-02-08 Beth Dakin Ensure old binaries have old snapshotting behaviors https://bugs.webkit.org/show_bug.cgi?id=194449 -and corresponding- rdar://problem/47931954 Reviewed by Darin Adler. Make sure that a nil configuration behaves the same way that it used to on apps that were linked before FirstWithSnapshotAfterScreenUpdates * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView takeSnapshotWithConfiguration:completionHandler:]): * UIProcess/Cocoa/VersionChecks.h: 2019-02-12 Andy Estes [iOSMac] Enable Parental Controls Content Filtering https://bugs.webkit.org/show_bug.cgi?id=194521 Reviewed by Tim Horton. * Configurations/FeatureDefines.xcconfig: 2019-02-11 Alex Christensen Remove noisy and unnecessary logs added in r241223 https://bugs.webkit.org/show_bug.cgi?id=194427 * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): Errors occur all the time in the XPC connection's event handler, like when a process terminates. We don't need to print an "error" every time any process terminates. 2019-02-11 Brian Burg [Cocoa] Web Automation: client callbacks are not called if delegate does not override https://bugs.webkit.org/show_bug.cgi?id=194519 Reviewed by Joseph Pecoraro. Call the completion handler directly if the delegate does not implement the relevant method. * UIProcess/Cocoa/AutomationSessionClient.mm: (WebKit::AutomationSessionClient::requestNewPageWithOptions): (WebKit::AutomationSessionClient::requestSwitchToPage): (WebKit::AutomationSessionClient::requestHideWindowOfPage): (WebKit::AutomationSessionClient::requestRestoreWindowOfPage): (WebKit::AutomationSessionClient::requestMaximizeWindowOfPage): 2019-02-11 Daniel Bates [iOS] Adopt SPI to support Emacs bindings: transpose and delete to end of paragraph https://bugs.webkit.org/show_bug.cgi?id=194505 Reviewed by Tim Horton. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _deleteToEndOfParagraph]): Added. (-[WKContentView _transpose]): Added. 2019-02-11 Adrian Perez de Castro [GTK][WPE] Add content extensions support in WKTR and unskip layout tests https://bugs.webkit.org/show_bug.cgi?id=193622 Reviewed by Michael Catanzaro. * NetworkProcess/cache/NetworkCacheData.h: Define an adoptAndMapFile() implementation for GFileIOStream objects. * NetworkProcess/cache/NetworkCacheDataSoup.cpp: (WebKit::NetworkCache::adoptAndMapFile): Added implementation, which extracts the file descriptor from a GFileIOStream, as it inherits from GFileDescriptorBased, and then reuses the version of adoptAndMapFile() which takes a file descritor for the actual work. * NetworkProcess/NetworkLoadChecker.cpp: (Webkit::NetworkLoadChecker::checkRequest): Use "this" when referring to processContentExtensionRulesForLoad() in order to avoid ambiguity. * Sources.txt: Add WKUserContentExtensionStoreRef.cpp, all ports use it now. * SourcesCocoa.txt: Remove WKUserContentExtensionStoreRef.cpp, because it is not Cocoa-specific anymore. * SourcesGTK.txt: Add APIContentRuleListStoreGLib.cpp. * SourcesWPE.txt: Ditto. * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp: (WKUserContentExtensionStoreCreate): Added. (toResult): Added. (WKUserContentExtensionStoreCompile): Added. (WKUserContentExtensionStoreLookup): Added. (WKUserContentExtensionStoreRemove): Added. * UIProcess/API/C/WKUserContentExtensionStoreRef.h: Add declarations for the new C API functions and for the WKUserContentExtensionStoreResult status enum. * UIProcess/API/glib/APIContentRuleListStoreGLib.cpp: Added. (API::ContentRuleListStore::defaultStorePath): Add a dummy implementation. The public API for the GLib based ports (GTK+ and WPE) will not allow using the default store and will always indicating a path. 2019-02-11 Daniel Bates [iOS] Mouse/Touch/Pointer events are missing modifier keys https://bugs.webkit.org/show_bug.cgi?id=191446 Reviewed by Tim Horton. Make use of UIKit SPI to retreive the modifier flags when dispatching mouse and touch events. Add new WebKit SPI for iOS, -[WKNavigationAction modifierFlags], to retrieve the the modifier flags held when a navigation action was initiated. * Platform/spi/ios/UIKitSPI.h: Expose SPI. * Shared/NativeWebTouchEvent.h: Re-arrange macro guards so that we can expose the helper function WebKit::webEventModifierFlags(). This is a bit more involved that usual since this header is included from both C++ and Objective-C source files. It only makes sense to expose this function when compiling as part of an Objective-C source file. * Shared/ios/NativeWebTouchEventIOS.mm: (WebKit::NativeWebTouchEvent::NativeWebTouchEvent): Modified to take the modifier flags held down when the platform touch event was received and pass them through to the base constructor. (WebKit::webEventModifierFlags): Added. Converts from the platform-speciifc UIKeyModifierFlags to OptionSet. * Shared/ios/WebIOSEventFactory.h: * Shared/ios/WebIOSEventFactory.mm: (WebIOSEventFactory::toUIKeyModifierFlags): Added. Converts from OptionSet to the platform-specific UIKeyModifierFlags. * UIProcess/API/Cocoa/WKNavigationAction.mm: (-[WKNavigationAction modifierFlags]): Added. * UIProcess/API/Cocoa/WKNavigationActionPrivate.h: * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (gestureRecognizerModifierFlags): Added. (-[WKContentView _webTouchEventsRecognized:]): (-[WKContentView _highlightLongPressRecognized:]): (-[WKContentView _twoFingerSingleTapGestureRecognized:]): (-[WKContentView _singleTapCommited:]): Pass modifier flags through. (-[WKContentView _attemptClickAtLocation:modifierFlags:]): Added. (-[WKContentView actionSheetAssistant:openElementAtLocation:]): This is invoked when a person opens a link via the action sheet. We don't have access to the modifier flags to pass. It also seems like an implementation detail that this action is implemented via mouse click and we should re-evaluate this decision in light of the fact tht the action sheet is browser UI and we tend to be very reserved on what UI actions are visible to the page. On Mac, opening a link via the context menu is not visible to the page, at least from a mouse event perspective. (webEventFlagsForUIKeyModifierFlags): Added. (-[WKContentView _hoverGestureRecognizerChanged:]): Pass modifier flags through. (-[WKContentView _attemptClickAtLocation:]): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::handleTwoFingerTapAtPoint): (WebKit::WebPageProxy::commitPotentialTap): (WebKit::WebPageProxy::handleTap): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleSyntheticClick): (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver): (WebKit::WebPage::completeSyntheticClick): (WebKit::WebPage::handleTap): (WebKit::WebPage::handleTwoFingerTapAtPoint): (WebKit::WebPage::commitPotentialTap): Pass modifier flags through. 2019-02-11 Jer Noble [Cocoa] Notify AVSystemController of our presenting PID before registering as a Now Playing app. https://bugs.webkit.org/show_bug.cgi?id=194504 Reviewed by Eric Carlson. * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebUserMediaClient.cpp: (WebKit::WebUserMediaClient::requestUserMediaAccess): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::prepareToSendUserMediaPermissionRequest): Deleted. * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::userMediaPermissionRequestManager): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::prepareToSendUserMediaPermissionRequest): Deleted. 2019-02-11 Commit Queue Unreviewed, rolling out r241272 and r241276. https://bugs.webkit.org/show_bug.cgi?id=194514 Broke the Apple Internal build and the fix requires human intervention :( (Requested by dydz on #webkit). Reverted changesets: "[iOS] Mouse/Touch/Pointer events are missing modifier keys" https://bugs.webkit.org/show_bug.cgi?id=191446 https://trac.webkit.org/changeset/241272 "Fix internal iOS build after r241272" https://bugs.webkit.org/show_bug.cgi?id=191446 https://trac.webkit.org/changeset/241276 2019-02-11 Alex Christensen Fix internal iOS build after r241272 https://bugs.webkit.org/show_bug.cgi?id=191446 * Platform/spi/ios/UIKitSPI.h: Declare the _modifierFlags when using the internal SDK also. 2019-02-11 Wenson Hsieh fast/forms/ios/force-gregorian-calendar-for-credit-card-expiry.html does not work on iPad https://bugs.webkit.org/show_bug.cgi?id=194313 Reviewed by Tim Horton. Make `-dateTimePickerCalendarType` work on iPad by handling the case where the date picker control is a WKDateTimePopover. This fixes UIScriptController::calendarType() returning null on iPad. * UIProcess/ios/forms/WKFormInputControl.mm: (-[WKFormInputControl dateTimePickerCalendarType]): (-[WKDateTimePopover calendarType]): 2019-02-11 Daniel Bates [iOS] Mouse/Touch/Pointer events are missing modifier keys https://bugs.webkit.org/show_bug.cgi?id=191446 Reviewed by Tim Horton. Make use of UIKit SPI to retreive the modifier flags when dispatching mouse and touch events. Add new WebKit SPI for iOS, -[WKNavigationAction modifierFlags], to retrieve the the modifier flags held when a navigation action was initiated. * Platform/spi/ios/UIKitSPI.h: Expose SPI. * Shared/NativeWebTouchEvent.h: Re-arrange macro guards so that we can expose the helper function WebKit::webEventModifierFlags(). This is a bit more involved that usual since this header is included from both C++ and Objective-C source files. It only makes sense to expose this function when compiling as part of an Objective-C source file. * Shared/ios/NativeWebTouchEventIOS.mm: (WebKit::NativeWebTouchEvent::NativeWebTouchEvent): Modified to take the modifier flags held down when the platform touch event was received and pass them through to the base constructor. (WebKit::webEventModifierFlags): Added. Converts from the platform-speciifc UIKeyModifierFlags to OptionSet. * Shared/ios/WebIOSEventFactory.h: * Shared/ios/WebIOSEventFactory.mm: (WebIOSEventFactory::toUIKeyModifierFlags): Added. Converts from OptionSet to the platform-specific UIKeyModifierFlags. * UIProcess/API/Cocoa/WKNavigationAction.mm: (-[WKNavigationAction modifierFlags]): Added. * UIProcess/API/Cocoa/WKNavigationActionPrivate.h: * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (gestureRecognizerModifierFlags): Added. (-[WKContentView _webTouchEventsRecognized:]): (-[WKContentView _highlightLongPressRecognized:]): (-[WKContentView _twoFingerSingleTapGestureRecognized:]): (-[WKContentView _singleTapCommited:]): Pass modifier flags through. (-[WKContentView _attemptClickAtLocation:modifierFlags:]): Added. (-[WKContentView actionSheetAssistant:openElementAtLocation:]): This is invoked when a person opens a link via the action sheet. We don't have access to the modifier flags to pass. It also seems like an implementation detail that this action is implemented via mouse click and we should re-evaluate this decision in light of the fact tht the action sheet is browser UI and we tend to be very reserved on what UI actions are visible to the page. On Mac, opening a link via the context menu is not visible to the page, at least from a mouse event perspective. (webEventFlagsForUIKeyModifierFlags): Added. (-[WKContentView _hoverGestureRecognizerChanged:]): Pass modifier flags through. (-[WKContentView _attemptClickAtLocation:]): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::handleTwoFingerTapAtPoint): (WebKit::WebPageProxy::commitPotentialTap): (WebKit::WebPageProxy::handleTap): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleSyntheticClick): (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver): (WebKit::WebPage::completeSyntheticClick): (WebKit::WebPage::handleTap): (WebKit::WebPage::handleTwoFingerTapAtPoint): (WebKit::WebPage::commitPotentialTap): Pass modifier flags through. 2019-02-11 Youenn Fablet Filter out Overconstrainederror.constraint when getUserMedia is not granted https://bugs.webkit.org/show_bug.cgi?id=194240 Reviewed by Eric Carlson. Make sure in UIProcess to filter out constraint if either the page was not granted gum access or it has no persistent access. Refactor UserMediaPermissionRequestManagerProxy to make the implementation easier to understand. Covered by added test. * UIProcess/UserMediaPermissionCheckProxy.cpp: (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged): (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess): (WebKit::UserMediaPermissionRequestManagerProxy::getRequestAction): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest): (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest): (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest): (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): (WebKit::UserMediaPermissionRequestManagerProxy::wasGrantedVideoOrAudioAccess): (WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList): (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): (WebKit::UserMediaPermissionRequestManagerProxy::createPermissionRequest): Deleted. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaPermissionRequestProxy.h: (WebKit::UserMediaPermissionRequestProxy::isPending const): (WebKit::UserMediaPermissionRequestProxy::setEligibleVideoDeviceUIDs): (WebKit::UserMediaPermissionRequestProxy::setEligibleAudioDeviceUIDs): (WebKit::UserMediaPermissionRequestProxy::hasAudioDevice const): (WebKit::UserMediaPermissionRequestProxy::hasVideoDevice const): (WebKit::UserMediaPermissionRequestProxy::hasPersistentAccess const): (WebKit::UserMediaPermissionRequestProxy::setHasPersistentAccess): (WebKit::UserMediaPermissionRequestProxy::userMediaID const): (WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin const): (WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin const): (WebKit::UserMediaPermissionRequestProxy::userRequest const): (WebKit::UserMediaPermissionRequestProxy::setDeviceIdentifierHashSalt): (WebKit::UserMediaPermissionRequestProxy::deviceIdentifierHashSalt const): (WebKit::UserMediaPermissionRequestProxy::audioDevice const): (WebKit::UserMediaPermissionRequestProxy::videoDevice const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestUserMediaPermissionForFrame): * UIProcess/WebPageProxy.h: 2019-02-11 Carlos Garcia Campos [WPE] Do not try to create empty egl windows https://bugs.webkit.org/show_bug.cgi?id=194497 Reviewed by Žan Doberšek. In AcceleratedSurfaceWPE we ensure the size we pass to wpe is at least 0x0, but wl_egl_window_create() returns nullptr if 0 is passed as width or height. We should use at least 1x1 instead. * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp: (WebKit::AcceleratedSurfaceWPE::initialize): (WebKit::AcceleratedSurfaceWPE::clientResize): 2019-02-10 Carlos Garcia Campos [WPE] Do not use a sync IPC message to send the host FD to the web process https://bugs.webkit.org/show_bug.cgi?id=194216 Reviewed by Darin Adler. It can be sent as a web page creation parameter instead. * PlatformWPE.cmake: * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * SourcesWPE.txt: * UIProcess/API/wpe/CompositingManagerProxy.cpp: Removed. * UIProcess/API/wpe/CompositingManagerProxy.h: Removed. * UIProcess/API/wpe/CompositingManagerProxy.messages.in: Removed. * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::hostFileDescriptor): * UIProcess/API/wpe/PageClientImpl.h: * UIProcess/API/wpe/WPEView.cpp: (WKWPE::m_backend): * UIProcess/API/wpe/WPEView.h: (WKWPE::View::create): * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_hostFileDescriptor): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::releaseHostFileDescriptor): * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp: (WebKit::AcceleratedSurfaceWPE::AcceleratedSurfaceWPE): (WebKit::AcceleratedSurfaceWPE::initialize): * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.h: * WebProcess/WebPage/wpe/CompositingManager.cpp: Removed. * WebProcess/WebPage/wpe/CompositingManager.h: Removed. 2019-02-04 Carlos Garcia Campos [GTK][WPE] Add enable-javascript-markup setting https://bugs.webkit.org/show_bug.cgi?id=193439 Reviewed by Michael Catanzaro. Expose JavaScriptMarkupEnabled setting in the GLib API. * UIProcess/API/glib/WebKitSettings.cpp: (webKitSettingsSetProperty): (webKitSettingsGetProperty): (webkit_settings_class_init): (webkit_settings_get_enable_javascript_markup): (webkit_settings_set_enable_javascript_markup): * UIProcess/API/gtk/WebKitSettings.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/wpe/WebKitSettings.h: * UIProcess/API/wpe/docs/wpe-0.1-sections.txt: 2019-02-10 Darin Adler Switch uses of StringBuilder with String::format for hex numbers to use HexNumber.h instead https://bugs.webkit.org/show_bug.cgi?id=194485 Reviewed by Daniel Bates. * UIProcess/DeviceIdHashSaltStorage.cpp: (WebKit::DeviceIdHashSaltStorage::completeDeviceIdHashSaltForOriginCall): Use appendUnsignedAsHex instead of appendUnsigned64AsHex. * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::loggingString): Use appendUnsignedAsHex and reinterpret_cast instead of String::format and "%p". 2019-02-10 Commit Queue Unreviewed, rolling out r241167. https://bugs.webkit.org/show_bug.cgi?id=194482 Broke the GTK mediastream tests (Requested by philn on #webkit). Reverted changeset: "Filter out Overconstrainederror.constraint when getUserMedia is not granted" https://bugs.webkit.org/show_bug.cgi?id=194240 https://trac.webkit.org/changeset/241167 2019-02-09 Darin Adler Eliminate unnecessary String temporaries by using StringConcatenateNumbers https://bugs.webkit.org/show_bug.cgi?id=194021 Reviewed by Geoffrey Garen. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::escapeIDForJSON): Use an ASCIILiteral to create a String. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::makeVersionedDirectoryPath): Remove String::number and let makeString do the conversion without allocating/destroying a String. * NetworkProcess/mac/RemoteNetworkingContext.mm: Removed "using namespace WebCore". (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): Remove String::number and let makeString do the conversion without allocating/destroying a String. * NetworkProcess/webrtc/NetworkMDNSRegister.cpp: Removed "using namespace WebCore". (WebKit::registerMDNSNameCallback): Added explicit WebCore prefix as needed. (WebKit::NetworkMDNSRegister::registerMDNSName): Ditto. Also remove String::number and let makeString do the conversion without allocating/destroying a String. * UIProcess/WebPageGroup.cpp: (WebKit::pageGroupData): Remove String::number and let makeString do the conversion without allocating/destroying a String. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::createInspectorTargets): Ditto. * UIProcess/ios/WKLegacyPDFView.mm: (-[WKLegacyPDFView _URLForLinkAnnotation:]): Ditto. * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp: (WebKit::uniqueWorldName): Ditto. * WebProcess/WebPage/WebPageInspectorTarget.cpp: (WebKit::WebPageInspectorTarget::identifier const): Ditto. 2019-02-09 Alexander Mikhaylenko [GTK] Fix typo in the newly added API https://bugs.webkit.org/show_bug.cgi?id=194472 Reviewed by Michael Catanzaro. Fix a typo: enableed -> enabled. * UIProcess/API/glib/WebKitSettings.cpp: (webkit_settings_set_enable_back_forward_navigation_gestures): * UIProcess/API/gtk/WebKitSettings.h: 2019-02-08 Alex Christensen Speculative fix for Mojave API test after r241223 https://bugs.webkit.org/show_bug.cgi?id=194427 * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm: (WebKit::XPCInitializationHandler): (WebKit::XPCServiceMain): Set the __APPLEEVENTSSERVICENAME environment variable before handling any xpc messages like we used to. I'll worry about making things right in the daemon later. 2019-02-08 Chris Dumez [WK2][macOS] Avoid creating new CVDisplayLink objects for each WebProcess https://bugs.webkit.org/show_bug.cgi?id=194463 Reviewed by Tim Horton. Avoid creating new CVDisplayLink objects for each WebProcess. We really only need one per display, creating such object is expensive and it is even worse in a PSON world where we swap process on navigation. This patch moves the DisplayLink storing from WebProcessProxy to WebProcessPool. Also, a DisplayLink can now be associated to several IPC connections instead of having a 1:1 mapping. When a DisplayLink no longer has any observers, we now merely stop it instead of destroying it. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::startDisplayLink): (WebKit::WebProcessPool::stopDisplayLink): (WebKit::WebProcessPool::stopDisplayLinks): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::~WebProcessProxy): (WebKit::WebProcessProxy::processWillShutDown): (WebKit::WebProcessProxy::shutDown): * UIProcess/WebProcessProxy.h: * UIProcess/mac/DisplayLink.cpp: (WebKit::DisplayLink::DisplayLink): (WebKit::DisplayLink::addObserver): (WebKit::DisplayLink::removeObserver): (WebKit::DisplayLink::removeObservers): (WebKit::DisplayLink::hasObservers const): (WebKit::DisplayLink::displayLinkCallback): * UIProcess/mac/DisplayLink.h: * UIProcess/mac/WebProcessProxyMac.mm: (WebKit::WebProcessProxy::startDisplayLink): (WebKit::WebProcessProxy::stopDisplayLink): 2019-02-08 Alexander Mikhaylenko [GTK] Implement back/forward touchpad gesture https://bugs.webkit.org/show_bug.cgi?id=193919 Reviewed by Michael Catanzaro. Move ViewSnapshotStore and ViewGestureController from Cocoa/Mac directory to UIProcess/, also move some parts of mac/ViewGestreControllerMac.mm to ViewGestureController.cpp, split up Mac- and iOS-specific parts of ViewSnapshotStore.cpp into mac/ViewSnapshotMac.mm, then implement 2-finger touchpad swipe back-forward gesture for GTK based on that. To avoid name conflict, rename existing ViewGestureController class inside UIProcess/API/gtk/WebKitWebViewBase.cpp into TouchGestureController. Since GTK gestures can only work with 3 or 4 fingers, treat horizontal scrolling events as a swipe as long as there's nowhere to scroll in that direction and web page doesn't handle the scrolling. This is only allowed for touchpads, even though it can theoretically work with touch mice and trackpoints. The gesture requires every item in back-forward list to have a snapshot. There's already an existing infrastructure for that, so the patch changes a bunch of #if PLATFORM(COCOA) statements to also check for GTK platform. The snapshots have to be taken in sync, so the implementation draws webview widget into a Cairo image surface. The gesture is disabled by default, and can be enabled by setting the newly added 'enable-back-forward-navigation-gestures' property in WebKitSettings to true. Gesture drawing is implemented via Cairo. When the gesture is active, the actual page is drawn into a Cairo group, which is then drawn together with a given snapshot, as well as dimming and a drop shadow over the "lower" layer. Also add a memory pressure handler that clears snapshot store when low on memory. * DerivedSources-input.xcfilelist: * PlatformGTK.cmake: * PlatformMac.cmake: * Shared/SessionState.h: Add snapshot to back-forward items for GTK. * Shared/WebBackForwardListItem.h: Add snapshot to back-forward items for GTK. * SourcesCocoa.txt: * SourcesGTK.txt: * UIProcess/API/glib/WebKitSettings.cpp: Added 'enable-back-forward-navigation-gestures' property for enabling the gesture. (webKitSettingsSetProperty): (webKitSettingsGetProperty): (webkit_settings_class_init): (webkit_settings_get_enable_back_forward_navigation_gestures): Added, GTK only. (webkit_settings_set_enable_back_forward_navigation_gestures): Added, GTK only. * UIProcess/API/glib/WebKitWebView.cpp: (enableBackForwardNavigationGesturesChanged): Added, GTK only. (webkitWebViewUpdateSettings): (webkitWebViewDisconnectSettingsSignalHandlers): * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::setViewNeedsDisplay): Redraw the whole screen instead of a region during the gesture. (WebKit::PageClientImpl::takeViewSnapshot): Added. (WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore): Pass unhandled events to the gesture controller. (WebKit::PageClientImpl::didRemoveNavigationGestureSnapshot): Redraw the widget immediately after removing snapshot. (WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame): Added, send a notification to the gesture controller. (WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame): Send a notification to the gesture controller. (WebKit::PageClientImpl::didFinishLoadForMainFrame): Send a notification to the gesture controller. (WebKit::PageClientImpl::didFailLoadForMainFrame): Added, send a notification to the gesture controller. (WebKit::PageClientImpl::didSameDocumentNavigationForMainFrame): Send a notification to the gesture controller. (WebKit::PageClientImpl::didRestoreScrollPosition): Added, send a notification to the gesture controller. * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/API/gtk/WebKitSettings.h: Add webkit_settings_get_enable_back_forward_navigation_gestures() and webkit_settings_get_enable_back_forward_navigation_gestures() to public API. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseDraw): Pass drawing to ViewGestureController during the gesture. (webkitWebViewBaseScrollEvent): Pass scroll events to ViewGestureController during the gesture. (webkitWebViewBaseGestureController): Renamed ViewGestureController to TouchGestureController. (webkitWebViewBaseViewGestureController): Added. (webkitWebViewBaseCreateWebPage): Create an instance of ViewGestureController. (webkitWebViewBaseTakeViewSnapshot): Added. (webkitWebViewBaseDidStartProvisionalLoadForMainFrame): Added. (webkitWebViewBaseDidFirstVisuallyNonEmptyLayoutForMainFrame): Added. (webkitWebViewBaseDidFinishLoadForMainFrame): Added. (webkitWebViewBaseDidFailLoadForMainFrame): Added. (webkitWebViewBaseDidSameDocumentNavigationForMainFrame): Added. (webkitWebViewBaseDidRestoreScrollPosition): Added. * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Mentioned the added functions in docs. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitialize): Move the check from WebMemoryPressureHandlerCocoa.mm here. * UIProcess/PageClient.h: Add takeViewSnapshot() for GTK. * UIProcess/ViewGestureController.cpp: Renamed from Source/WebKit/UIProcess/Cocoa/ViewGestureController.cpp. (WebKit::ViewGestureController::ViewGestureController): (WebKit::ViewGestureController::~ViewGestureController): (WebKit::ViewGestureController::disconnectFromProcess): (WebKit::ViewGestureController::connectToProcess): (WebKit::ViewGestureController::controllerForGesture): (WebKit::ViewGestureController::takeNextGestureID): (WebKit::ViewGestureController::willBeginGesture): (WebKit::ViewGestureController::didEndGesture): (WebKit::ViewGestureController::setAlternateBackForwardListSourcePage): (WebKit::ViewGestureController::canSwipeInDirection const): (WebKit::ViewGestureController::didStartProvisionalOrSameDocumentLoadForMainFrame): (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame): (WebKit::ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame): (WebKit::ViewGestureController::didRepaintAfterNavigation): (WebKit::ViewGestureController::didHitRenderTreeSizeThreshold): (WebKit::ViewGestureController::didRestoreScrollPosition): (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState): (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame): (WebKit::ViewGestureController::checkForActiveLoads): (WebKit::ViewGestureController::SnapshotRemovalTracker::SnapshotRemovalTracker): (WebKit::ViewGestureController::SnapshotRemovalTracker::eventsDescription): (WebKit::ViewGestureController::SnapshotRemovalTracker::log const): (WebKit::ViewGestureController::SnapshotRemovalTracker::resume): (WebKit::ViewGestureController::SnapshotRemovalTracker::start): (WebKit::ViewGestureController::SnapshotRemovalTracker::reset): (WebKit::ViewGestureController::SnapshotRemovalTracker::stopWaitingForEvent): (WebKit::ViewGestureController::SnapshotRemovalTracker::eventOccurred): (WebKit::ViewGestureController::SnapshotRemovalTracker::cancelOutstandingEvent): (WebKit::ViewGestureController::SnapshotRemovalTracker::hasOutstandingEvent): (WebKit::ViewGestureController::SnapshotRemovalTracker::fireRemovalCallbackIfPossible): (WebKit::ViewGestureController::SnapshotRemovalTracker::fireRemovalCallbackImmediately): (WebKit::ViewGestureController::SnapshotRemovalTracker::watchdogTimerFired): (WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog): (WebKit::deltaShouldCancelSwipe): (WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker): (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe): (WebKit::ViewGestureController::PendingSwipeTracker::handleEvent): (WebKit::ViewGestureController::PendingSwipeTracker::eventWasNotHandledByWebCore): (WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe): (WebKit::ViewGestureController::PendingSwipeTracker::reset): (WebKit::ViewGestureController::startSwipeGesture): (WebKit::ViewGestureController::isPhysicallySwipingLeft const): (WebKit::ViewGestureController::shouldUseSnapshotForSize): (WebKit::ViewGestureController::forceRepaintIfNeeded): (WebKit::ViewGestureController::willEndSwipeGesture): (WebKit::ViewGestureController::endSwipeGesture): (WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded): * UIProcess/ViewGestureController.h: Renamed from Source/WebKit/UIProcess/Cocoa/ViewGestureController.h. (WebKit::ViewGestureController::wheelEventWasNotHandledByWebCore): (WebKit::ViewGestureController::shouldIgnorePinnedState): (WebKit::ViewGestureController::setShouldIgnorePinnedState): (WebKit::ViewGestureController::hasActiveMagnificationGesture const): (WebKit::ViewGestureController::setCustomSwipeViews): (WebKit::ViewGestureController::setCustomSwipeViewsTopContentInset): (WebKit::ViewGestureController::setDidMoveSwipeSnapshotCallback): (WebKit::ViewGestureController::backgroundColorForCurrentSnapshot const): (WebKit::ViewGestureController::didFinishLoadForMainFrame): (WebKit::ViewGestureController::didFailLoadForMainFrame): (WebKit::ViewGestureController::setSwipeGestureEnabled): (WebKit::ViewGestureController::isSwipeGestureEnabled): (WebKit::ViewGestureController::SnapshotRemovalTracker::pause): (WebKit::ViewGestureController::SnapshotRemovalTracker::isPaused const): (WebKit::ViewGestureController::SnapshotRemovalTracker::hasRemovalCallback const): (WebKit::ViewGestureController::SnapshotRemovalTracker::renderTreeSizeThreshold const): (WebKit::ViewGestureController::SnapshotRemovalTracker::setRenderTreeSizeThreshold): (WebKit::ViewGestureController::PendingSwipeTracker::shouldIgnorePinnedState): (WebKit::ViewGestureController::PendingSwipeTracker::setShouldIgnorePinnedState): (WebKit::ViewGestureController::SwipeProgressTracker::progress const): (WebKit::ViewGestureController::SwipeProgressTracker::direction const): * UIProcess/ViewGestureController.messages.in: Renamed from Source/WebKit/UIProcess/Cocoa/ViewGestureController.messages.in. * UIProcess/ViewSnapshotStore.cpp: Copied from Source/WebKit/UIProcess/mac/ViewSnapshotStore.mm. (WebKit::ViewSnapshotStore::ViewSnapshotStore): (WebKit::ViewSnapshotStore::~ViewSnapshotStore): (WebKit::ViewSnapshotStore::singleton): (WebKit::ViewSnapshotStore::didAddImageToSnapshot): (WebKit::ViewSnapshotStore::willRemoveImageFromSnapshot): (WebKit::ViewSnapshotStore::pruneSnapshots): (WebKit::ViewSnapshotStore::recordSnapshot): (WebKit::ViewSnapshotStore::discardSnapshotImages): (WebKit::ViewSnapshot::~ViewSnapshot): * UIProcess/ViewSnapshotStore.h: Renamed from Source/WebKit/UIProcess/mac/ViewSnapshotStore.h. (WebKit::ViewSnapshot::setRenderTreeSize): (WebKit::ViewSnapshot::renderTreeSize const): (WebKit::ViewSnapshot::setBackgroundColor): (WebKit::ViewSnapshot::backgroundColor const): (WebKit::ViewSnapshot::setViewScrollPosition): (WebKit::ViewSnapshot::viewScrollPosition const): (WebKit::ViewSnapshot::setDeviceScaleFactor): (WebKit::ViewSnapshot::deviceScaleFactor const): (WebKit::ViewSnapshot::surface const): (WebKit::ViewSnapshot::imageSizeInBytes const): (WebKit::ViewSnapshot::size const): (WebKit::ViewSnapshotStore::setDisableSnapshotVolatilityForTesting): (WebKit::ViewSnapshotStore::disableSnapshotVolatilityForTesting const): * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::didRemoveItem): Unset snapshot for GTK. * UIProcess/WebMemoryPressureHandler.cpp: Copied from Source/WebKit/UIProcess/Cocoa/WebMemoryPressureHandlerCocoa.mm. (WebKit::installMemoryPressureHandler): * UIProcess/WebMemoryPressureHandler.h: Renamed from Source/WebKit/UIProcess/Cocoa/WebMemoryPressureHandlerCocoa.h. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::recordNavigationSnapshot): Take snapshots for GTK. * UIProcess/WebPageProxy.h: * UIProcess/gtk/ViewGestureControllerGtk.cpp: Added. This is a port of UIProcess/mac/ViewGestureControllerMac.mm. SwipeProgressTracker class is a re-implementation of trackSwipeEventWithOptions. (WebKit::isEventStop): (WebKit::ViewGestureController::platformTeardown): (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanStartSwipe): (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanEndSwipe): (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe): (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventGetScrollingDeltas): (WebKit::ViewGestureController::handleScrollWheelEvent): (WebKit::ViewGestureController::trackSwipeGesture): (WebKit::ViewGestureController::SwipeProgressTracker::SwipeProgressTracker): (WebKit::ViewGestureController::SwipeProgressTracker::startTracking): (WebKit::ViewGestureController::SwipeProgressTracker::reset): (WebKit::ViewGestureController::SwipeProgressTracker::handleEvent): (WebKit::ViewGestureController::SwipeProgressTracker::startAnimation): (WebKit::easeOutCubic): (WebKit::ViewGestureController::SwipeProgressTracker::onAnimationTick): (WebKit::ViewGestureController::SwipeProgressTracker::endAnimation): (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::handleSwipeGesture): (WebKit::ViewGestureController::draw): (WebKit::ViewGestureController::removeSwipeSnapshot): (WebKit::ViewGestureController::beginSimulatedSwipeInDirectionForTesting): (WebKit::ViewGestureController::completeSimulatedSwipeInDirectionForTesting): * UIProcess/gtk/ViewSnapshotStoreGtk.cpp: Renamed from Source/WebKit/UIProcess/Cocoa/WebMemoryPressureHandlerCocoa.mm. (WebKit::ViewSnapshot::create): (WebKit::ViewSnapshot::ViewSnapshot): (WebKit::ViewSnapshot::hasImage const): (WebKit::ViewSnapshot::clearImage): (WebKit::ViewSnapshot::imageSizeInBytes const): (WebKit::ViewSnapshot::size const): * UIProcess/gtk/WebProcessPoolGtk.cpp: (WebKit::memoryPressureMonitorDisabled): Added. (WebKit::WebProcessPool::platformInitialize): Install memory pressure handler. (WebKit::WebProcessPool::platformInitializeWebProcess): Use memoryPressureMonitorDisabled(). * UIProcess/mac/ViewGestureControllerMac.mm: Moved many functions into UIProcess/ViewGestureController.cpp (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanStartSwipe): (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanEndSwipe): (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanInfluenceSwipe): (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventGetScrollingDeltas): (WebKit::ViewGestureController::trackSwipeGesture): (WebKit::scrollEventCanInfluenceSwipe): Deleted. (WebKit::deltaShouldCancelSwipe): Deleted. (WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker): Deleted. (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe): Deleted. (WebKit::ViewGestureController::PendingSwipeTracker::handleEvent): Deleted. (WebKit::ViewGestureController::PendingSwipeTracker::eventWasNotHandledByWebCore): Deleted. (WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe): Deleted. (WebKit::ViewGestureController::PendingSwipeTracker::reset): Deleted. (WebKit::ViewGestureController::willEndSwipeGesture): Deleted. (WebKit::ViewGestureController::shouldUseSnapshotForSize): Deleted. (WebKit::ViewGestureController::isPhysicallySwipingLeft const): Deleted. (WebKit::ViewGestureController::endSwipeGesture): Deleted. (WebKit::ViewGestureController::forceRepaintIfNeeded): Deleted. (WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded): Deleted. * UIProcess/mac/ViewSnapshotStoreMac.mm: Renamed from Source/WebKit/UIProcess/mac/ViewSnapshotStore.mm. (WebKit::ViewSnapshotStore::snapshottingContext): (WebKit::ViewSnapshot::create): (WebKit::ViewSnapshot::ViewSnapshot): (WebKit::ViewSnapshot::setSurface): (WebKit::ViewSnapshot::hasImage const): (WebKit::ViewSnapshot::clearImage): (WebKit::ViewSnapshot::setVolatile): (WebKit::ViewSnapshot::asLayerContents): (WebKit::ViewSnapshot::asImageForTesting): * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/ViewGestureGeometryCollector.cpp: Make SetRenderTreeSizeNotificationThreshold() cross-platform. (WebKit::ViewGestureGeometryCollector::ViewGestureGeometryCollector): (WebKit::ViewGestureGeometryCollector::computeMinimumAndMaximumViewportScales const): (WebKit::ViewGestureGeometryCollector::mainFrameDidLayout): * WebProcess/WebPage/ViewGestureGeometryCollector.h: * WebProcess/WebPage/ViewGestureGeometryCollector.messages.in: * WebProcess/WebPage/WebPage.cpp: Start using ViewGestureGeometryCollector for GTK. (WebKit::WebPage::mainFrameDidLayout): * WebProcess/WebPage/WebPage.h: 2019-02-08 Alex Christensen Add SPI to use networking daemon instead of XPC service https://bugs.webkit.org/show_bug.cgi?id=194427 Reviewed by Geoffrey Garen. There is still work to be done, but with the proper plist it starts and loads webpages! * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm: (WebKit::DaemonMain): * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h: * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm: (WebKit::XPCEventHandler): (WebKit::XPCInitializationHandler): (WebKit::XPCServiceMain): (WebKit::XPCServiceEventHandler): Deleted. * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration usesNetworkingDaemon]): (-[_WKProcessPoolConfiguration setUsesNetworkingDaemon:]): * UIProcess/AuxiliaryProcessProxy.cpp: (WebKit::AuxiliaryProcessProxy::getLaunchOptions): * UIProcess/Launcher/ProcessLauncher.h: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::serviceName): (WebKit::ProcessLauncher::launchProcess): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::getLaunchOptions): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::usesNetworkingDaemon const): * UIProcess/WebProcessPool.h: 2019-02-08 Truitt Savell Unreviewed, rolling out r241197. Broke iOS Simulator Debug build and casued 1 API failure on High Sierra Reverted changeset: "Add SPI to use networking daemon instead of XPC service" https://bugs.webkit.org/show_bug.cgi?id=194427 https://trac.webkit.org/changeset/241197 2019-02-08 Beth Dakin Abstract and discussion comments needed for afterScreenUpdates https://bugs.webkit.org/show_bug.cgi?id=194442 Reviewed by Wenson Hsieh. Forgot to add these comments with https://bugs.webkit.org/show_bug.cgi?id=194362 * UIProcess/API/Cocoa/WKSnapshotConfiguration.h: 2019-02-08 Beth Dakin Add afterScreenUpdates to WKSnapshotConfiguration https://bugs.webkit.org/show_bug.cgi?id=194362 -and corresponding- Please add an "after screen updates" property to WKSnapshotConfiguration (to solve blank snapshots) Reviewed by Tim Horton. This is the WebKit equivalent of - (UIView *)snapshotViewAfterScreenUpdates:(BOOL)afterUpdates; This makes our snapshotting API more predictable and reliable on iOS devices, which is why the new configuration property defaults to YES. New property that defaults to YES. * UIProcess/API/Cocoa/WKSnapshotConfiguration.h: * UIProcess/API/Cocoa/WKSnapshotConfiguration.mm: (-[WKSnapshotConfiguration init]): (-[WKSnapshotConfiguration copyWithZone:]): When afterScreenUpdates is set, invoke the snapshot via callAfterNextPresentationUpdate. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView takeSnapshotWithConfiguration:completionHandler:]): (-[WKWebView _callCompletionHandler:withSnapshotImage:atDeviceScale:]): 2019-02-08 Alex Christensen Add SPI to use networking daemon instead of XPC service https://bugs.webkit.org/show_bug.cgi?id=194427 Reviewed by Geoffrey Garen. There is still work to be done, but with the proper plist it starts and loads webpages! * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm: (WebKit::DaemonMain): * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h: * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm: (WebKit::XPCEventHandler): (WebKit::XPCInitializationHandler): (WebKit::XPCServiceMain): (WebKit::XPCServiceEventHandler): Deleted. * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration usesNetworkingDaemon]): (-[_WKProcessPoolConfiguration setUsesNetworkingDaemon:]): * UIProcess/AuxiliaryProcessProxy.cpp: (WebKit::AuxiliaryProcessProxy::getLaunchOptions): * UIProcess/Launcher/ProcessLauncher.h: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::serviceName): (WebKit::ProcessLauncher::launchProcess): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::getLaunchOptions): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::usesNetworkingDaemon const): * UIProcess/WebProcessPool.h: 2019-02-08 Keith Rollin Unreviewed build fix. r241135 modified how entitlements were built up for the macOS. Those changes broke the iOSMac builds. Bring back some deletions in order to fix iOSMac. * Configurations/PluginService.64.xcconfig: * Configurations/PluginService.entitlements: Added. * WebKit.xcodeproj/project.pbxproj: 2019-02-07 Chris Dumez Mark more heap-allocated classes as fast allocated https://bugs.webkit.org/show_bug.cgi?id=194422 Reviewed by Ryosuke Niwa. * NetworkProcess/NetworkLoad.cpp: * NetworkProcess/NetworkLoadChecker.h: * NetworkProcess/NetworkResourceLoader.cpp: * Platform/IPC/Connection.h: * Platform/IPC/mac/ImportanceAssertion.h: * PluginProcess/PluginCreationParameters.h: * Shared/API/Cocoa/RemoteObjectRegistry.h: * Shared/WebEvent.h: * UIProcess/API/APIHTTPCookieStore.cpp: * UIProcess/API/APINotificationProvider.h: * UIProcess/API/Cocoa/PageLoadStateObserver.h: * UIProcess/API/Cocoa/WKHTTPCookieStore.mm: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setInputDelegate:]): * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/BackingStore.h: * UIProcess/Cocoa/AutomationClient.h: * UIProcess/Cocoa/DiagnosticLoggingClient.h: * UIProcess/Cocoa/DownloadClient.h: * UIProcess/Cocoa/FindClient.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/ViewGestureController.h: * UIProcess/DeviceIdHashSaltStorage.h: * UIProcess/Downloads/DownloadProxyMap.h: * UIProcess/Gamepad/UIGamepad.h: * UIProcess/Notifications/WebNotificationProvider.h: * UIProcess/ProcessAssertion.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h: * UIProcess/WebContextInjectedBundleClient.h: * UIProcess/WebFormClient.h: * UIProcess/WebGeolocationProvider.h: * UIProcess/WebPageProxy.h: * WebProcess/Automation/WebAutomationSessionProxy.h: * WebProcess/InjectedBundle/API/APIInjectedBundleBundleClient.h: * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h: * WebProcess/InjectedBundle/API/APIInjectedBundlePageContextMenuClient.h: * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h: * WebProcess/InjectedBundle/API/APIInjectedBundlePageResourceLoadClient.h: * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h: * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h: * WebProcess/Network/webrtc/LibWebRTCNetwork.h: * WebProcess/Network/webrtc/LibWebRTCSocket.h: * WebProcess/Network/webrtc/WebRTCResolver.h: * WebProcess/WebCoreSupport/WebInspectorClient.cpp: * WebProcess/WebPage/DrawingArea.h: 2019-02-07 Wenson Hsieh [iOS] [WK2] Modernize code for applying autocorrection https://bugs.webkit.org/show_bug.cgi?id=194397 Reviewed by Tim Horton. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]): (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]): Use BlockPtr instead of temporarily storing the completion handler. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Change a LegacySync to Delayed. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::applyAutocorrection): (WebKit::WebPage::syncApplyAutocorrection): (WebKit::WebPage::applyAutocorrectionInternal): 2019-02-07 Wenson Hsieh [iOS] Clicking links in Safari using Apple Pencil is much more difficult after r238475 https://bugs.webkit.org/show_bug.cgi?id=194415 Reviewed by Tim Horton. Fix the bug by not firing the Apple-pencil-exclusive tap gesture recognizer in the case where editable images are disabled. This gesture recognizer is only used for inserting editable images, and currently conflicts with the synthetic click gesture recognizer used to recognize clicks from generic digitizer inputs. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView gestureRecognizerShouldBegin:]): (-[WKContentView _stylusSingleTapRecognized:]): 2019-02-07 Per Arne Vollan [macOS] Block coreservicesd in sandbox. https://bugs.webkit.org/show_bug.cgi?id=192670 Reviewed by Alexey Proskuryakov. We should block CoreServices in newer versions of macOS. In order to achieve this we need to avoid calling _RegisterApplication before entering the sandbox, since this call will open up a connection to CoreServices. The call to _RegisterApplication is moved to ChildProcess::updateProcessName, since it is needed to successfully update the process name. The call to ChildProcess::updateProcessName is made after entering the sandbox. * Shared/AuxiliaryProcess.cpp: (WebKit::AuxiliaryProcess::initialize): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::initializeProcessName): (WebKit::WebProcess::platformInitializeProcess): * WebProcess/com.apple.WebProcess.sb.in: 2019-02-07 Youenn Fablet Filter out Overconstrainederror.constraint when getUserMedia is not granted https://bugs.webkit.org/show_bug.cgi?id=194240 Reviewed by Eric Carlson. Make sure in UIProcess to filter out constraint if either the page was not granted gum access or it has no persistent access. Refactor UserMediaPermissionRequestManagerProxy to make the implementation easier to understand. Covered by added test. * UIProcess/UserMediaPermissionCheckProxy.cpp: (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged): (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess): (WebKit::UserMediaPermissionRequestManagerProxy::getRequestAction): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionRequest): (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionInvalidRequest): (WebKit::UserMediaPermissionRequestManagerProxy::processUserMediaPermissionValidRequest): (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): (WebKit::UserMediaPermissionRequestManagerProxy::wasGrantedVideoOrAudioAccess): (WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList): (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): (WebKit::UserMediaPermissionRequestManagerProxy::createPermissionRequest): Deleted. * UIProcess/UserMediaPermissionRequestManagerProxy.h: * UIProcess/UserMediaPermissionRequestProxy.h: (WebKit::UserMediaPermissionRequestProxy::isPending const): (WebKit::UserMediaPermissionRequestProxy::setEligibleVideoDeviceUIDs): (WebKit::UserMediaPermissionRequestProxy::setEligibleAudioDeviceUIDs): (WebKit::UserMediaPermissionRequestProxy::hasAudioDevice const): (WebKit::UserMediaPermissionRequestProxy::hasVideoDevice const): (WebKit::UserMediaPermissionRequestProxy::hasPersistentAccess const): (WebKit::UserMediaPermissionRequestProxy::setHasPersistentAccess): (WebKit::UserMediaPermissionRequestProxy::userMediaID const): (WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin const): (WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin const): (WebKit::UserMediaPermissionRequestProxy::userRequest const): (WebKit::UserMediaPermissionRequestProxy::setDeviceIdentifierHashSalt): (WebKit::UserMediaPermissionRequestProxy::deviceIdentifierHashSalt const): (WebKit::UserMediaPermissionRequestProxy::audioDevice const): (WebKit::UserMediaPermissionRequestProxy::videoDevice const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::requestUserMediaPermissionForFrame): * UIProcess/WebPageProxy.h: 2019-02-07 Wenson Hsieh [iOS] [WK2] Modernize autocorrection context code https://bugs.webkit.org/show_bug.cgi?id=194373 Reviewed by Tim Horton. * Shared/ios/WebAutocorrectionContext.h: Added. (WebKit::WebAutocorrectionContext::encode const): (WebKit::WebAutocorrectionContext::decode): Introduce a WebAutocorrectionContext struct that encapsulates the individual pieces of autocorrection context. Change to use this instead of a long list of arguments when propagating autocorrection context information over IPC. * UIProcess/AutoCorrectionCallback.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]): (+[WKAutocorrectionContext autocorrectionContextWithContext:]): (+[WKAutocorrectionContext autocorrectionContextWithData:markedText:selectedText:afterText:selectedRangeInMarkedText:]): Deleted. Change this constructor to take an entire WebAutocorrectionContext. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::autocorrectionContextCallback): (WebKit::WebPageProxy::requestAutocorrectionContext): (WebKit::WebPageProxy::autocorrectionContextSync): (WebKit::WebPageProxy::getAutocorrectionContext): Deleted. * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Use Delayed instead of LegacySync. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::autocorrectionContext): Renamed from computeAutocorrectionContext. This is now a private method on WebPage that uses the focused or main frame to compute and return a WebAutocorrectionContext. (WebKit::WebPage::requestAutocorrectionContext): (WebKit::WebPage::autocorrectionContextSync): Renamed getAutocorrectionContext to autocorrectionContextSync. (WebKit::computeAutocorrectionContext): Deleted. (WebKit::WebPage::getAutocorrectionContext): Deleted. 2019-02-07 Youenn Fablet Simplify applyConstraints callbacks https://bugs.webkit.org/show_bug.cgi?id=194297 Reviewed by Eric Carlson. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::applyConstraints): * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::applyConstraintsSucceeded): (WebKit::UserMediaCaptureManager::Source::applyConstraintsFailed): (WebKit::UserMediaCaptureManager::applyConstraintsFailed): * WebProcess/cocoa/UserMediaCaptureManager.h: 2019-02-07 Brent Fulgham Permit additional IOKit Properties needed by Media PlugIns on older Mac Hardware https://bugs.webkit.org/show_bug.cgi?id=194412 Reviewed by Per Arne Vollan. * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 2019-02-07 Brent Fulgham Permit additional IOKit Properties needed by older Mac Hardware https://bugs.webkit.org/show_bug.cgi?id=194410 Reviewed by Per Arne Vollan. * WebProcess/com.apple.WebProcess.sb.in: 2019-02-07 Brady Eidson Rename the TAKE_DOWNLOAD_ASSERTION macro. Rubberstamped by Andy Estes. * NetworkProcess/Downloads/DownloadMap.cpp: * NetworkProcess/Downloads/DownloadMap.h: 2019-02-07 Keith Rollin Fix XCBuild issue related to codesigning WebContent process https://bugs.webkit.org/show_bug.cgi?id=193799 Reviewed by Brent Fulgham. Building with XCBuild enabled results in the error message "cannot read entitlement data" when trying to codesign the macOS XPC processes. The reason for this error message is that there is a build step that deletes any previous "stale" generated .xcent file before building up a new one. With XCBuild enabled, the build steps got re-ordered, such that the step that deletes this file could get executed after the steps that build up the file. The built-up set of entitlements is now gone, and the build process fails when `codesign` tries to access it. The apparent quick-fix to this problem -- of tweaking dependencies so that the build steps execute in the desired order -- wouldn't work with XCBuild. Establishing these dependencies would require both having multiple build phases produce the same .xcent file as output, as well as a build phase that has this file as an input and an output. XCBuild either forbids or frowns upon these configurations. Ultimately, the solution that worked was to take over complete control of the codesigning process. This means (a) not specifying a base .entitlements file that XCode uses to start with (and which was subsequently altered via custom build scripts), (b) not letting XCode automatically and silently inject a 'get-task-all' entitlement used to facilitate debugging (we now add that entitlement by hand), and (c) building up all of our entitlements by hand via a single custom script. Because of the addition of this custom script, many other scripts and entitlements files could now be removed. * Configurations/BaseXPCService.xcconfig: * Configurations/Databases-iOS.entitlements: Removed. * Configurations/Network-OSX-restricted.entitlements: Removed. * Configurations/Network-OSX-sandbox.entitlements: Removed. * Configurations/Network-OSX.entitlements: Removed. * Configurations/NetworkService.xcconfig: * Configurations/PluginService.64.xcconfig: * Configurations/PluginService.entitlements: Removed. * Configurations/WebContent-OSX-sandbox.entitlements: Removed. * Configurations/WebContent-OSX.entitlements: Removed. * Configurations/WebContent-or-Plugin-OSX-restricted.entitlements: Removed. * Configurations/WebContentService.xcconfig: * Scripts/copy-webcontent-resources-to-private-headers.sh: * Scripts/process-entitlements.sh: Added. * Scripts/process-network-sandbox-entitlements.sh: Removed. * Scripts/process-webcontent-or-plugin-entitlements.sh: Removed. * Scripts/process-webcontent-sandbox-entitlements.sh: Removed. * WebKit.xcodeproj/project.pbxproj: 2019-02-07 Alex Christensen Fix internal build after r241127 https://bugs.webkit.org/show_bug.cgi?id=191394 * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h: Add some (un)availability macros. 2019-02-07 Youenn Fablet Make to clear sources from UserMediaCaptureManagerProxy and UserMediaCaptureManager when no longer needed https://bugs.webkit.org/show_bug.cgi?id=194312 Reviewed by Eric Carlson. Sources in UserMediaCaptureManager and Proxy are never removed once added to their HashMap. Use the 'ended' mechanism to do the clean-up on WebProcess side. As part of this clean-up, send IPC to UIProcess to do clean-up on proxy side. On WebProcess crash case, clean-up the proxy as well. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): (WebKit::UserMediaCaptureManagerProxy::end): (WebKit::UserMediaCaptureManagerProxy::clear): * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h: * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch): * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::sourceEnded): * WebProcess/cocoa/UserMediaCaptureManager.h: 2019-02-07 Alex Christensen Print backgrounds preference should be honored instead of WKWebViewConfiguration value https://bugs.webkit.org/show_bug.cgi?id=194364 Reviewed by Tim Horton. Without this patch, changing the preference for printing the background has no effect. This patch fixes that, and I verified it manually by checking "Print backgrounds" in Safari's print menu. Unfortunately, the only way to test this is actually printing because only values from WebPageProxy::preferences or WebPageProxy::configuration's preferences are exposed to the API, but values from WebPageProxy::preferencesStore are used when printing. Actually printing verifies this change fixes the bug. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): 2019-02-07 Chris Dumez Mark DisplayLink as fast allocated https://bugs.webkit.org/show_bug.cgi?id=194400 Reviewed by Geoffrey Garen. * UIProcess/mac/DisplayLink.h: 2019-02-07 Per Arne Vollan [macOS] API test times out after r241026 https://bugs.webkit.org/show_bug.cgi?id=194372 Reviewed by Alex Christensen. The API test TestWebKitAPI.RenderingProgress.FirstMeaningfulPaint times out after r241026. A new function pointer, layoutMilestones, is added to WKBundlePageLoaderClient, in order for clients to decide which milestones they would like to listen for. * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (layoutMilestones): (setUpPageLoaderClient): * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp: (WebKit::InjectedBundlePageLoaderClient::layoutMilestones const): * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h: 2019-02-07 Alex Christensen Deprecate WKBundlePageSetDefersLoading https://bugs.webkit.org/show_bug.cgi?id=191394 Reviewed by Dean Jackson. * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageSetDefersLoading): * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _defersLoading]): (-[WKWebProcessPlugInBrowserContextController _setDefersLoading:]): * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h: 2019-02-07 Alex Christensen Digital crown should scroll safe browsing warning on watchOS https://bugs.webkit.org/show_bug.cgi?id=194363 Reviewed by Wenson Hsieh. * UIProcess/Cocoa/WKSafeBrowsingWarning.h: * UIProcess/Cocoa/WKSafeBrowsingWarning.mm: (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingWarning:completionHandler:]): (-[WKSafeBrowsingWarning addContent]): 2019-02-07 Alex Christensen Shrink and hyphenate safe browsing warning text on watchOS https://bugs.webkit.org/show_bug.cgi?id=194361 Reviewed by Geoffrey Garen. Some internationalizations use long words that didn't fit on small watches. * UIProcess/Cocoa/WKSafeBrowsingWarning.mm: (fontOfSize): (-[WKSafeBrowsingWarning addContent]): (-[WKSafeBrowsingTextView initWithAttributedString:forWarning:]): 2019-02-07 Miguel Gomez [WPE] Implement GStreamer based holepunch https://bugs.webkit.org/show_bug.cgi?id=193715 Reviewed by Xabier Rodriguez-Calvar. Add a new parameter to the calls of TextureMapper::drawSolidColor(). * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext): 2019-02-06 Benjamin Poulain Unreviewed, rolling out r240759 and r240944. Some timer uses are done off the main thread, WebCore::Timer cannot be used Reverted changesets: " Responsiveness timers are too expensive for frequent events" https://bugs.webkit.org/show_bug.cgi?id=194003 https://trac.webkit.org/changeset/240759 "Use deferrable timer to restart the Responsiveness Timer on each wheel event" https://bugs.webkit.org/show_bug.cgi?id=194135 https://trac.webkit.org/changeset/240944 2019-02-06 chris fleizach AX: com.apple.WebKit.WebContent at WebKit: -[WKAccessibilityWebPageObjectBase axObjectCache] https://bugs.webkit.org/show_bug.cgi?id=194306 Reviewed by Zalan Bujtas. Check the page reference is still valid. Modernize code in this area. * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: 2019-02-06 Daniel Bates Move toNSEventModifierFlags() and toNSButtonNumber() to WebEventFactory.mm https://bugs.webkit.org/show_bug.cgi?id=194321 Reviewed by Jer Noble. Move some code to WebEventFactory so that it can be shared by both WKNavigationAction.mm and UIDelegate.mm among other benefits. * Shared/mac/WebEventFactory.h: * Shared/mac/WebEventFactory.mm: (WebKit::WebEventFactory::toNSEventModifierFlags): (WebKit::WebEventFactory::toNSButtonNumber): * UIProcess/API/Cocoa/WKNavigationAction.mm: (-[WKNavigationAction modifierFlags]): (-[WKNavigationAction buttonNumber]): (toNSEventModifierFlags): Deleted. (toNSButtonNumber): Deleted. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::mouseDidMoveOverElement): (WebKit::toNSEventModifierFlags): Deleted. 2019-02-06 Andy Estes [Payment Request] It should be possible to require a phonetic name for shipping contacts https://bugs.webkit.org/show_bug.cgi?id=194311 Reviewed by Alex Christensen. * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::supportsVersion): Deleted. * WebProcess/ApplePay/WebPaymentCoordinator.h: 2019-02-06 Keith Rollin Really enable the automatic checking and regenerations of .xcfilelists during builds https://bugs.webkit.org/show_bug.cgi?id=194357 Reviewed by Chris Dumez. Bug 194124 was supposed to enable the automatic checking and regenerating of .xcfilelist files during the build. While related changes were included in that patch, the change to actually enable the operation somehow was omitted. This patch actually enables the operation. The check-xcfilelist.sh scripts now check WK_DISABLE_CHECK_XCFILELISTS, and if it's "1", opts-out the developer from the checking. * Scripts/check-xcfilelists.sh: 2019-02-06 John Wilander Forward Ad Click Attribution data from HTMLAnchorElement::handleClick() to WebKit::NavigationActionData https://bugs.webkit.org/show_bug.cgi?id=194325 Reviewed by Chris Dumez. * Shared/NavigationActionData.cpp: (WebKit::NavigationActionData::encode const): (WebKit::NavigationActionData::decode): * Shared/NavigationActionData.h: Now holds an optional WebCore::AdClickAttribution object. 2019-02-06 Daniel Bates Fix the Apple Internal build. See for more details. * UIProcess/ios/fullscreen/WKFullscreenStackView.mm: (-[WKFullscreenStackView init]): 2019-02-06 Daniel Bates Standardize on ControlKey instead of CtrlKey https://bugs.webkit.org/show_bug.cgi?id=194317 Reviewed by Tim Horton. * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent): (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent): (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent): * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: (WebKit::WebEditorClient::handleKeyboardEvent): * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp: (WebKit::handleKeyPress): 2019-02-06 Per Arne Vollan Roll out parts of r238819 since it is a PLT performance regression. https://bugs.webkit.org/show_bug.cgi?id=194346 Unreviewed performance fix. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (didStartProvisionalLoadForFrame): (didReceiveServerRedirectForProvisionalLoadForFrame): (didFinishLoadForFrame): (globalObjectIsAvailableForFrame): (didRemoveFrameFromHierarchy): (didCommitLoadForFrame): (didFinishDocumentLoadForFrame): (didFailProvisionalLoadWithErrorForFrame): (didFailLoadWithErrorForFrame): (didSameDocumentNavigationForFrame): (didLayoutForFrame): (didReachLayoutMilestone): (didFirstVisuallyNonEmptyLayoutForFrame): (didHandleOnloadEventsForFrame): (userAgentForURL): (setUpPageLoaderClient): (willSendRequestForFrame): (didInitiateLoadForResource): (didFinishLoadForResource): (didFailLoadForResource): (setUpResourceLoadClient): (-[WKWebProcessPlugInBrowserContextController setLoadDelegate:]): (ResourceLoadClient::ResourceLoadClient): Deleted. (ResourceLoadClient::loadDelegate const): Deleted. (ResourceLoadClient::pluginContextController const): Deleted. (PageLoaderClient::PageLoaderClient): Deleted. (PageLoaderClient::loadDelegate const): Deleted. (PageLoaderClient::pluginContextController const): Deleted. (PageLoaderClient::didStartProvisionalLoadForFrame): Deleted. (PageLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame): Deleted. (PageLoaderClient::didFinishLoadForFrame): Deleted. (PageLoaderClient::globalObjectIsAvailableForFrame): Deleted. (PageLoaderClient::didRemoveFrameFromHierarchy): Deleted. (PageLoaderClient::didCommitLoadForFrame): Deleted. (PageLoaderClient::didFinishDocumentLoadForFrame): Deleted. (PageLoaderClient::didFailProvisionalLoadWithErrorForFrame): Deleted. (PageLoaderClient::didFailLoadWithErrorForFrame): Deleted. (PageLoaderClient::didSameDocumentNavigationForFrame): Deleted. (PageLoaderClient::didLayoutForFrame): Deleted. (PageLoaderClient::didReachLayoutMilestone): Deleted. (PageLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame): Deleted. (PageLoaderClient::layoutMilestones const): Deleted. (PageLoaderClient::didHandleOnloadEventsForFrame): Deleted. (PageLoaderClient::userAgentForURL const): Deleted. (ResourceLoadClient::willSendRequestForFrame): Deleted. (ResourceLoadClient::didInitiateLoadForResource): Deleted. (ResourceLoadClient::didFinishLoadForResource): Deleted. (ResourceLoadClient::didFailLoadForResource): Deleted. 2019-02-06 Michael Catanzaro REGRESSION(r240785): [SOUP] Broke cookie persistent storage https://bugs.webkit.org/show_bug.cgi?id=194209 Reviewed by Carlos Garcia Campos. I missed a spot when moving the persistent storage parameters from NetworkProcess to NetworkSession. They have to be initialized separately for the default session. * UIProcess/soup/WebProcessPoolSoup.cpp: (WebKit::WebProcessPool::platformInitializeNetworkProcess): 2019-02-05 Alex Christensen Stop using blobRegistry in NetworkProcess https://bugs.webkit.org/show_bug.cgi?id=194027 Reviewed by Youenn Fablet. * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::startDownload): * NetworkProcess/Downloads/PendingDownload.cpp: (WebKit::PendingDownload::PendingDownload): * NetworkProcess/Downloads/PendingDownload.h: * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: (WebKit::NetworkBlobRegistry::registerFileBlobURL): (WebKit::NetworkBlobRegistry::registerBlobURL): (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked): (WebKit::NetworkBlobRegistry::registerBlobURLForSlice): (WebKit::NetworkBlobRegistry::unregisterBlobURL): (WebKit::NetworkBlobRegistry::blobSize): (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles): (WebKit::NetworkBlobRegistry::writeBlobToFilePath): (WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose): (WebKit::NetworkBlobRegistry::filesInBlob): (WebKit::NetworkBlobRegistry::singleton): Deleted. * NetworkProcess/FileAPI/NetworkBlobRegistry.h: (WebKit::NetworkBlobRegistry::blobRegistry): * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didClose): (WebKit::NetworkConnectionToWebProcess::resolveBlobReferences): (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad): (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad): (WebKit::NetworkConnectionToWebProcess::loadPing): (WebKit::NetworkConnectionToWebProcess::preconnectTo): (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL): (WebKit::NetworkConnectionToWebProcess::registerBlobURL): (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL): (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked): (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice): (WebKit::NetworkConnectionToWebProcess::unregisterBlobURL): (WebKit::NetworkConnectionToWebProcess::blobSize): (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles): (WebKit::NetworkConnectionToWebProcess::filesInBlob): (WebKit::NetworkConnectionToWebProcess::blobRegistry): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::create): * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob): * NetworkProcess/NetworkDataTaskBlob.h: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::NetworkLoad): (WebKit::NetworkLoad::initialize): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::NetworkProcess): (WebKit::NetworkProcess::removeNetworkConnectionToWebProcess): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::networkBlobRegistry): * NetworkProcess/NetworkProcessPlatformStrategies.cpp: (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::m_shouldCaptureExtraNetworkLoadMetrics): (WebKit::NetworkResourceLoader::startNetworkLoad): * NetworkProcess/PreconnectTask.cpp: * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad): 2019-02-05 Daniel Bates Fix a typo in r241006. Substitute Modifier for Modifiers. * Shared/mac/NativeWebGestureEventMac.mm: (WebKit::NativeWebGestureEvent::NativeWebGestureEvent): 2019-02-05 Daniel Bates Attempt to fix the build following r241000 (https://bugs.webkit.org/show_bug.cgi?id=194241) Substitute OptionSet for Modifiers. * Shared/mac/NativeWebGestureEventMac.mm: (WebKit::NativeWebGestureEvent::NativeWebGestureEvent): * Shared/mac/WebGestureEvent.h: (WebKit::WebGestureEvent::WebGestureEvent): 2019-02-05 Truitt Savell Unreviewed, rolling out r240984. Revision casued two API timeouts Reverted changeset: "Stop using blobRegistry in NetworkProcess" https://bugs.webkit.org/show_bug.cgi?id=194027 https://trac.webkit.org/changeset/240984 2019-02-05 Youenn Fablet UserMediaPermissionRequestManagerProxy lambdas should check for 'this' being valid https://bugs.webkit.org/show_bug.cgi?id=194246 Reviewed by Eric Carlson. With PSON enabled, the manager proxy can be destroyed. It is thus important for its callbacks to check for 'this' to be valid. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): 2019-02-05 Daniel Bates Attempt to fix the build following r241000 (https://bugs.webkit.org/show_bug.cgi?id=194241) Substitute WebEvent::Modifier::CapsLockKey for WebEvent::CapsLockKey. * Shared/gtk/WebEventFactory.cpp: (WebKit::modifiersForEvent): * Shared/mac/WebEventFactory.mm: (WebKit::modifiersForEvent): * UIProcess/API/Cocoa/WKNavigationAction.mm: (toNSEventModifierFlags): * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::protocolModifierToWebEventModifier): * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: (WebKit::modifiersToEventState): * UIProcess/Automation/mac/WebAutomationSessionMac.mm: (WebKit::WebAutomationSession::platformSimulateMouseInteraction): * UIProcess/Cocoa/UIDelegate.mm: (WebKit::toNSEventModifierFlags): 2019-02-05 Daniel Bates Make WebEvent::Modifiers an OptionSet https://bugs.webkit.org/show_bug.cgi?id=194241 Reviewed by Simon Fraser. Use an OptionSet to represent the bitmask of keyboard modifier flags. This improves type safety and makes debugging more enjoyable because our LLDB pretty-printers have built-in support for OptionSet. While I am at it, make WebEvent::Modifier an enum class. It is currently an enum. This makes this enum more closely match WebCore::PlatformEvent::Modifier. * Shared/API/c/WKSharedAPICast.h: (WebKit::toAPI): * Shared/NavigationActionData.cpp: (WebKit::NavigationActionData::encode const): (WebKit::NavigationActionData::decode): * Shared/NavigationActionData.h: * Shared/WebEvent.cpp: (WebKit::WebEvent::WebEvent): * Shared/WebEvent.h: (WebKit::WebEvent::shiftKey const): (WebKit::WebEvent::controlKey const): (WebKit::WebEvent::altKey const): (WebKit::WebEvent::metaKey const): (WebKit::WebEvent::capsLockKey const): (WebKit::WebEvent::modifiers const): (WebKit::WebTouchEvent::WebTouchEvent): * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): * Shared/WebKeyboardEvent.cpp: (WebKit::WebKeyboardEvent::WebKeyboardEvent): * Shared/WebMouseEvent.cpp: (WebKit::WebMouseEvent::WebMouseEvent): * Shared/WebTouchEvent.cpp: (WebKit::WebTouchEvent::WebTouchEvent): * Shared/WebWheelEvent.cpp: (WebKit::WebWheelEvent::WebWheelEvent): * Shared/gtk/WebEventFactory.cpp: (WebKit::modifiersForEvent): * Shared/ios/NativeWebTouchEventIOS.mm: (WebKit::NativeWebTouchEvent::NativeWebTouchEvent): * Shared/ios/WebIOSEventFactory.mm: (modifiersForEvent): (WebIOSEventFactory::createWebKeyboardEvent): (WebIOSEventFactory::createWebMouseEvent): * Shared/libwpe/WebEventFactory.cpp: (WebKit::modifiersForEventModifiers): (WebKit::WebEventFactory::createWebWheelEvent): (WebKit::WebEventFactory::createWebTouchEvent): * Shared/mac/WebEventFactory.mm: (WebKit::modifiersForEvent): (WebKit::WebEventFactory::createWebMouseEvent): (WebKit::WebEventFactory::createWebWheelEvent): (WebKit::WebEventFactory::createWebKeyboardEvent): * Shared/win/WebEventFactory.cpp: (WebKit::modifiersForEvent): (WebKit::modifiersForCurrentKeyState): (WebKit::WebEventFactory::createWebMouseEvent): (WebKit::WebEventFactory::createWebWheelEvent): (WebKit::WebEventFactory::createWebKeyboardEvent): * UIProcess/API/APINavigationAction.h: * UIProcess/API/APIUIClient.h: (API::UIClient::mouseDidMoveOverElement): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/Cocoa/WKNavigationAction.mm: (toNSEventModifierFlags): * UIProcess/API/glib/WebKitPrivate.cpp: (toPlatformModifiers): * UIProcess/API/glib/WebKitPrivate.h: * UIProcess/API/glib/WebKitUIClient.cpp: * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewMouseTargetChanged): * UIProcess/API/glib/WebKitWebViewPrivate.h: * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::simulateMouseInteraction): (WebKit::protocolModifierToWebEventModifier): (WebKit::WebAutomationSession::performMouseInteraction): * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: (WebKit::modifiersToEventState): (WebKit::WebAutomationSession::platformSimulateMouseInteraction): * UIProcess/Automation/mac/WebAutomationSessionMac.mm: (WebKit::WebAutomationSession::platformSimulateMouseInteraction): * UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp: (WebKit::modifiersToEventState): (WebKit::WebAutomationSession::platformSimulateMouseInteraction): * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::toNSEventModifierFlags): (WebKit::UIDelegate::UIClient::mouseDidMoveOverElement): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::mouseDidMoveOverElement): * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h: (API::InjectedBundle::PageUIClient::mouseDidMoveOverElement): * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp: (WebKit::InjectedBundleNavigationAction::modifiersForNavigationAction): * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h: (WebKit::InjectedBundleNavigationAction::modifiers const): * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp: (WebKit::InjectedBundlePageUIClient::mouseDidMoveOverElement): * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::showContextMenuAtPoint): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::createWebEvent const): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::mouseDidMoveOverElement): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::simulateMouseDown): (WebKit::WebPage::simulateMouseUp): (WebKit::WebPage::simulateMouseMotion): 2019-02-05 Tim Horton Reproducible crash under WKShareSheet presentWithParameters when cancelling a share https://bugs.webkit.org/show_bug.cgi?id=194301 Reviewed by Beth Dakin. * UIProcess/Cocoa/WKShareSheet.mm: (-[WKShareSheet presentWithParameters:completionHandler:]): NSSharingServicePicker's delegate callbacks can be called synchronously. We release the WKShareSheet (which holds our reference to the NSSharingServicePicker) under sharingServicePicker:didChooseSharingService:. On older versions of macOS, there was nothing keeping the NSSharingServicePicker alive inside showRelativeToRect:ofView:preferredEdge:, thus the whole chain of references would fall and result in sending a message to a released NSSharingServicePicker. To resolve this, keep an extra reference to the WKShareSheet until presentation is complete. 2019-02-05 Keith Rollin Enable the automatic checking and regenerations of .xcfilelists during builds https://bugs.webkit.org/show_bug.cgi?id=194124 Reviewed by Tim Horton. Bug 193790 add a facility for checking -- during build time -- that any needed .xcfilelist files are up-to-date and for updating them if they are not. This facility was initially opt-in by setting WK_ENABLE_CHECK_XCFILELISTS until other pieces were in place and until the process seemed robust. Its now time to enable this facility and make it opt-out. If there is a need to disable this facility, set and export WK_DISABLE_CHECK_XCFILELISTS=1 in your environment before running `make` or `build-webkit`, or before running Xcode from the command line. Additionally, remove the step that generates a list of source files going into the UnifiedSources build step. It's only necessarily to specify Sources.txt and SourcesCocoa.txt as inputs. * UnifiedSources-input.xcfilelist: Removed. * WebKit.xcodeproj/project.pbxproj: 2019-02-05 Brady Eidson Add a new DownloadMap type that manages taking an assertion automatically. https://bugs.webkit.org/show_bug.cgi?id=194294 Reviewed by Alex Christensen. If we don't need the download assertion, we use a vanilla HashMap like today. If we need the download assertion, we use the new DownloadMap class instead. The new DownloadMap is a wrapper around a HashMap that also creates/destroys the assertion as needed. * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::dataTaskBecameDownloadTask): (WebKit::DownloadManager::downloadFinished): * NetworkProcess/Downloads/DownloadManager.h: * NetworkProcess/Downloads/DownloadMap.cpp: Added. (WebKit::DownloadMap::get const): (WebKit::DownloadMap::isEmpty const): (WebKit::DownloadMap::size const): (WebKit::DownloadMap::contains const): (WebKit::DownloadMap::add): (WebKit::DownloadMap::remove): * NetworkProcess/Downloads/DownloadMap.h: Added. * Sources.txt: * UIProcess/ios/ProcessAssertionIOS.mm: (WebKit::ProcessAssertion::ProcessAssertion): * WebKit.xcodeproj/project.pbxproj: 2019-02-05 Brady Eidson Fix iOS simulator build after r240954 Unreviewed. * UIProcess/ios/ProcessAssertionIOS.mm: (WebKit::ProcessAssertion::ProcessAssertion): Implement the new constructor. 2019-02-05 Alex Christensen Stop using blobRegistry in NetworkProcess https://bugs.webkit.org/show_bug.cgi?id=194027 Reviewed by Youenn Fablet. * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::startDownload): * NetworkProcess/Downloads/PendingDownload.cpp: (WebKit::PendingDownload::PendingDownload): * NetworkProcess/Downloads/PendingDownload.h: * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: (WebKit::NetworkBlobRegistry::registerFileBlobURL): (WebKit::NetworkBlobRegistry::registerBlobURL): (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked): (WebKit::NetworkBlobRegistry::registerBlobURLForSlice): (WebKit::NetworkBlobRegistry::unregisterBlobURL): (WebKit::NetworkBlobRegistry::blobSize): (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles): (WebKit::NetworkBlobRegistry::writeBlobToFilePath): (WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose): (WebKit::NetworkBlobRegistry::filesInBlob): (WebKit::NetworkBlobRegistry::singleton): Deleted. * NetworkProcess/FileAPI/NetworkBlobRegistry.h: (WebKit::NetworkBlobRegistry::blobRegistry): * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didClose): (WebKit::NetworkConnectionToWebProcess::resolveBlobReferences): (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad): (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad): (WebKit::NetworkConnectionToWebProcess::loadPing): (WebKit::NetworkConnectionToWebProcess::preconnectTo): (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL): (WebKit::NetworkConnectionToWebProcess::registerBlobURL): (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL): (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked): (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice): (WebKit::NetworkConnectionToWebProcess::unregisterBlobURL): (WebKit::NetworkConnectionToWebProcess::blobSize): (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles): (WebKit::NetworkConnectionToWebProcess::filesInBlob): (WebKit::NetworkConnectionToWebProcess::blobRegistry): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::create): * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob): * NetworkProcess/NetworkDataTaskBlob.h: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::NetworkLoad): (WebKit::NetworkLoad::initialize): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::NetworkProcess): (WebKit::NetworkProcess::removeNetworkConnectionToWebProcess): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::networkBlobRegistry): * NetworkProcess/NetworkProcessPlatformStrategies.cpp: (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::m_shouldCaptureExtraNetworkLoadMetrics): (WebKit::NetworkResourceLoader::startNetworkLoad): * NetworkProcess/PreconnectTask.cpp: * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad): 2019-02-05 Ryan Haddad Unreviewed, rolling out r240742. Causes crashes on iOS simulator. Reverted changeset: "[iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element" https://bugs.webkit.org/show_bug.cgi?id=192824 https://trac.webkit.org/changeset/240742 2019-02-05 Alex Christensen Protect globalWebSocketStreamMap with a Lock https://bugs.webkit.org/show_bug.cgi?id=194224 Reviewed by Ryosuke Niwa. * WebProcess/Network/WebSocketStream.cpp: (WebKit::WebSocketStream::streamWithIdentifier): (WebKit::WebSocketStream::networkProcessCrashed): (WebKit::WebSocketStream::WebSocketStream): (WebKit::WebSocketStream::~WebSocketStream): 2019-02-04 Alex Christensen Add Networking Daemon skeleton https://bugs.webkit.org/show_bug.cgi?id=194278 Reviewed by Zalan Bujtas. Daemon skeletons? This is spooky stuff. * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.h: Added. * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm: Added. (WebKit::DaemonMain): * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::restrictRequestReferrerToOriginIfNeeded): * Shared/API/Cocoa/WKMain.h: * Shared/API/Cocoa/WKMain.mm: (WKDaemonMain): * Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp: (main): * SourcesCocoa.txt: * UnifiedSources-input.xcfilelist: * WebKit.xcodeproj/project.pbxproj: 2019-02-04 Yusuke Suzuki [JSC] Shrink size of VM by lazily allocating IsoSubspaces for non-common types https://bugs.webkit.org/show_bug.cgi?id=193993 Reviewed by Keith Miller. * WebProcess/Plugins/Netscape/JSNPMethod.h: * WebProcess/Plugins/Netscape/JSNPObject.h: 2019-02-04 Simon Fraser Move some macOS/iOS scrolling code into the scrolling/cocoa directory https://bugs.webkit.org/show_bug.cgi?id=194245 Reviewed by Zalan Bujtas. Use PLATFORM(MAC), not !PLATFORM(IOS_FAMILY). * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: 2019-02-04 Ms2ger [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI https://bugs.webkit.org/show_bug.cgi?id=174816 Reviewed by Michael Catanzaro. Add webkit_uri_for_display for GTK and WPE. * PlatformGTK.cmake: * PlatformWPE.cmake: * SourcesGTK.txt: * SourcesWPE.txt: * UIProcess/API/glib/WebKitURIUtilities.cpp: Added. (webkit_uri_for_display): * UIProcess/API/gtk/WebKitURIUtilities.h: Added. * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: * UIProcess/API/gtk/webkit2.h: * UIProcess/API/wpe/WebKitURIUtilities.h: Added. * UIProcess/API/wpe/docs/wpe-0.1-sections.txt: * UIProcess/API/wpe/docs/wpe-docs.sgml: * UIProcess/API/wpe/webkit.h: 2019-02-04 Alex Christensen Move XPCService main to a shared file calling a C function https://bugs.webkit.org/show_bug.cgi?id=194256 Reviewed by Brady Eidson. This not only reduces a few kilobytes of duplicated binary from the XPCService executables, It will allow me to introduce a new kind of executable which will need to parse argv and call a different C function. This is similar to r236075 but more general. * Shared/API/Cocoa/WKMain.h: Added. * Shared/API/Cocoa/WKMain.mm: Added. (WKXPCServiceMain): * Shared/EntryPointUtilities/Cocoa/AuxiliaryProcessMain.cpp: Added. (main): * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm: (main): Deleted. * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: 2019-02-04 Alex Christensen Make MessageSender functions const https://bugs.webkit.org/show_bug.cgi?id=194247 Reviewed by Brady Eidson. * NetworkProcess/Downloads/Download.cpp: (WebKit::Download::messageSenderConnection const): (WebKit::Download::messageSenderDestinationID const): (WebKit::Download::messageSenderConnection): Deleted. (WebKit::Download::messageSenderDestinationID): Deleted. * NetworkProcess/Downloads/Download.h: * NetworkProcess/Downloads/PendingDownload.cpp: (WebKit::PendingDownload::messageSenderConnection const): (WebKit::PendingDownload::messageSenderDestinationID const): (WebKit::PendingDownload::messageSenderConnection): Deleted. (WebKit::PendingDownload::messageSenderDestinationID): Deleted. * NetworkProcess/Downloads/PendingDownload.h: * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::messageSenderConnection const): (WebKit::WebIDBConnectionToClient::messageSenderConnection): Deleted. * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::messageSenderConnection const): (WebKit::NetworkResourceLoader::messageSenderConnection): Deleted. * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/NetworkSocketStream.cpp: (WebKit::NetworkSocketStream::messageSenderConnection const): (WebKit::NetworkSocketStream::messageSenderDestinationID const): (WebKit::NetworkSocketStream::messageSenderConnection): Deleted. (WebKit::NetworkSocketStream::messageSenderDestinationID): Deleted. * NetworkProcess/NetworkSocketStream.h: * NetworkProcess/ServiceWorker/WebSWServerConnection.h: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::messageSenderConnection const): (WebKit::WebSWServerToContextConnection::messageSenderDestinationID const): (WebKit::WebSWServerToContextConnection::messageSenderConnection): Deleted. (WebKit::WebSWServerToContextConnection::messageSenderDestinationID): Deleted. * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h: * Platform/IPC/MessageSender.h: * Shared/AuxiliaryProcess.cpp: (WebKit::AuxiliaryProcess::messageSenderConnection const): (WebKit::AuxiliaryProcess::messageSenderDestinationID const): (WebKit::AuxiliaryProcess::messageSenderConnection): Deleted. (WebKit::AuxiliaryProcess::messageSenderDestinationID): Deleted. * Shared/AuxiliaryProcess.h: * UIProcess/WebConnectionToWebProcess.cpp: (WebKit::WebConnectionToWebProcess::messageSenderConnection const): (WebKit::WebConnectionToWebProcess::messageSenderDestinationID const): (WebKit::WebConnectionToWebProcess::messageSenderConnection): Deleted. (WebKit::WebConnectionToWebProcess::messageSenderDestinationID): Deleted. * UIProcess/WebConnectionToWebProcess.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::messageSenderConnection const): (WebKit::WebPageProxy::messageSenderDestinationID const): (WebKit::WebPageProxy::messageSenderConnection): Deleted. (WebKit::WebPageProxy::messageSenderDestinationID): Deleted. * UIProcess/WebPageProxy.h: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::messageSenderConnection const): (WebKit::WebIDBConnectionToServer::messageSenderConnection): Deleted. * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::messageSenderConnection const): (WebKit::WebResourceLoader::messageSenderDestinationID const): (WebKit::WebResourceLoader::messageSenderConnection): Deleted. (WebKit::WebResourceLoader::messageSenderDestinationID): Deleted. * WebProcess/Network/WebResourceLoader.h: * WebProcess/Network/WebSocketStream.cpp: (WebKit::WebSocketStream::messageSenderConnection const): (WebKit::WebSocketStream::messageSenderDestinationID const): (WebKit::WebSocketStream::messageSenderConnection): Deleted. (WebKit::WebSocketStream::messageSenderDestinationID): Deleted. * WebProcess/Network/WebSocketStream.h: * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/WebConnectionToUIProcess.cpp: (WebKit::WebConnectionToUIProcess::messageSenderConnection const): (WebKit::WebConnectionToUIProcess::messageSenderDestinationID const): (WebKit::WebConnectionToUIProcess::messageSenderConnection): Deleted. (WebKit::WebConnectionToUIProcess::messageSenderDestinationID): Deleted. * WebProcess/WebConnectionToUIProcess.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::messageSenderConnection const): (WebKit::WebPage::messageSenderDestinationID const): (WebKit::WebPage::messageSenderConnection): Deleted. (WebKit::WebPage::messageSenderDestinationID): Deleted. * WebProcess/WebPage/WebPage.h: 2019-02-04 Brady Eidson Take additional process assertion while downloading. and https://bugs.webkit.org/show_bug.cgi?id=194239 Reviewed by Chris Dumez. When the first download starts, grab this new assertion. When the last download ends, release it. * Configurations/Network-iOS.entitlements: * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::dataTaskBecameDownloadTask): (WebKit::DownloadManager::downloadFinished): * NetworkProcess/Downloads/DownloadManager.h: * Platform/spi/ios/AssertionServicesSPI.h: * UIProcess/ProcessAssertion.cpp: (WebKit::ProcessAssertion::ProcessAssertion): * UIProcess/ProcessAssertion.h: (WebKit::ProcessAssertion::ProcessAssertion): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didSetAssertionState): * UIProcess/ios/ProcessAssertionIOS.mm: (WebKit::flagsForState): (WebKit::reasonForState): (WebKit::ProcessAssertion::ProcessAssertion): 2019-02-04 Said Abou-Hallawa [CG] Enable setAdditionalSupportedImageTypes for WK1 https://bugs.webkit.org/show_bug.cgi?id=194190 Reviewed by Tim Horton. Move the function webCoreStringVectorFromNSStringArray from WebKit to WebCore so it can be used by both WebKit and WebKitLegacy. * Platform/mac/StringUtilities.h: * Platform/mac/StringUtilities.mm: (WebKit::webCoreStringVectorFromNSStringArray): Deleted. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): 2019-02-04 Benjamin Poulain Use deferrable timer to restart the Responsiveness Timer on each wheel event https://bugs.webkit.org/show_bug.cgi?id=194135 Reviewed by Simon Fraser. Simon Fraser suggested a neat improvement over my previous optimization of ResponsivenessTimer. Instead of reseting the deadline with every event, we can let the timer fire and add the missing time from the last start. I implemented that behavior in the new Deferrable Timer class and use it from ResponsivenessTimer. * NetworkProcess/watchos/NetworkProximityAssertion.h: * UIProcess/ResponsivenessTimer.h: * WebProcess/Plugins/PluginView.h: 2019-02-04 Simon Fraser PageOverlayController's layers should be created lazily https://bugs.webkit.org/show_bug.cgi?id=194199 rdar://problem/46571593 Reviewed by Tim Horton. Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays() and use them to only parent the overlay-hosting layers when necessary. For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(), which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer compositing updates that parents the layerWithDocumentOverlays(). View overlays are added to the layer tree via the DrawingArea. When we go between having none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer() on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a compositing flush (this has to be done manually because view overlay layers are outside the subtree managed by RenderLayerCompositor). Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer; there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer(). * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::attachViewOverlayGraphicsLayer): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::attachViewOverlayGraphicsLayer): * WebProcess/WebPage/AcceleratedDrawingArea.h: * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::attachViewOverlayGraphicsLayer): * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer): * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer): (WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged): 2019-02-04 Michael Catanzaro Unreviewed, improve preprocessor guard https://bugs.webkit.org/show_bug.cgi?id=194166 AC mode is only optional in GTK port. Requested by Zan. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2019-02-04 Sihui Liu IndexedDB: leak WebIDBConnectionToServer in layout tests https://bugs.webkit.org/show_bug.cgi?id=193688 Reviewed by Geoffrey Garen. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didClose): (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer): (WebKit::NetworkConnectionToWebProcess::removeIDBConnectionToServer): Deleted. * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer): 2019-02-04 Antoine Quint Unreviewed build fix. * Platform/spi/ios/UIKitSPI.h: 2019-02-04 Youenn Fablet Capture state should be managed consistently when doing process swapping https://bugs.webkit.org/show_bug.cgi?id=194122 Reviewed by Eric Carlson. When doing PSON, WebPageProxy::resetState is called. It resets the media state, but does not call the client delegates. Instead of directly updating the media state, call the routine used to update it so that client delegates are called. Covered by new API test and layout test. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _mediaCaptureState]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::resetState): (WebKit::WebPageProxy::isPlayingMediaDidChange): (WebKit::WebPageProxy::updatePlayingMediaDidChange): * UIProcess/WebPageProxy.h: 2019-02-04 Antoine Quint Use a dedicated type instead of int32_t for pointer identifiers https://bugs.webkit.org/show_bug.cgi?id=194217 Reviewed by Antti Koivisto. * Scripts/webkit/messages.py: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::cancelPointer): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::cancelPointer): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2019-02-04 Michael Catanzaro Unreviewed, avoid -Wswitch warnings introduced in r240880 https://bugs.webkit.org/show_bug.cgi?id=193740 * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): 2019-02-04 Alexander Mikhaylenko [GTK] Allow pinch zoom on touchpad https://bugs.webkit.org/show_bug.cgi?id=194201 Reviewed by Michael Catanzaro. Enable touchpad events for WebkitWebViewBase, then feed touchpad pinch events to GestureController. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseRealize): Added GDK_TOUCHPAD_GESTURE_MASK to event mask. (webkitWebViewBaseEvent): Added. (webkit_web_view_base_class_init): Override event vfunc. 2019-02-04 Michael Catanzaro Unreviewed, only force settings.acceleratedCompositingEnabled() to true for Cocoa ports https://bugs.webkit.org/show_bug.cgi?id=194166 Accelerated compositing is broken for me at least. We're a long way from being able to force it. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2019-02-04 Abderrahim Kitouni [GTK] Remove last python2 dependency from CMake build process https://bugs.webkit.org/show_bug.cgi?id=194218 Reviewed by Michael Catanzaro. * InspectorGResources.cmake: 2019-02-04 Antti Koivisto Rename GraphicsLayer and PlatformCALayer type enum values to match "scroll container layer" convention https://bugs.webkit.org/show_bug.cgi?id=194215 Reviewed by Frédéric Wang. * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::drawInContext): * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::makeNode): * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: (WebKit::RemoteLayerTreeHost::makeNode): 2019-02-03 Antti Koivisto [iOS] Tiles not created in large scrollable iframes https://bugs.webkit.org/show_bug.cgi?id=193665 Reviewed by Simon Fraser. * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm: (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren): * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren): We now use scrollContainerLayer consistently so remove the special cases. 2019-02-03 Fujii Hironori [curl] [WebKit] Assertion failures of missing networkStorageSession for storage/indexeddb tests https://bugs.webkit.org/show_bug.cgi?id=194141 Reviewed by Ross Kirsling. Implemented WebKit::NetworkProcess::switchToNewTestingSession and WebKit::NetworkProcess::ensureSession for curl port. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::switchToNewTestingSession): (WebKit::NetworkProcess::ensureSession): 2019-02-03 Simon Fraser Make setNeedsLayout on the root more explicitly about triggering its side-effects https://bugs.webkit.org/show_bug.cgi?id=194198 Reviewed by Antti Koivisto. Call the newly named functions. * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::updateScrollbars): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::didInitializePlugin): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setHeaderBannerHeightForTesting): (WebKit::WebPage::setFooterBannerHeightForTesting): * WebProcess/WebPage/mac/PageBannerMac.mm: (WebKit::PageBanner::addToPage): (WebKit::PageBanner::detachFromPage): (WebKit::PageBanner::hide): 2019-02-03 Ryosuke Niwa Validate navigation policy decisions to avoid crashes in continueLoadAfterNavigationPolicy https://bugs.webkit.org/show_bug.cgi?id=194189 Reviewed by Geoffrey Garen. Pass the policy check identifier around functions and store it in PolicyDecisionSender so that we can send it back to WebCore with the navigation policy decision. We also store it in WebFrame in the case the policy decision had to be invalidated before the decision was received (via WebFrame::invalidatePolicyListener). * Scripts/webkit/messages.py: * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync): (WebKit::ProvisionalPageProxy::decidePolicyForResponse): * UIProcess/ProvisionalPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::PolicyDecisionSender): Added PolicyCheckIdentifier as a member. (WebKit::WebPageProxy::PolicyDecisionSender::create): (WebKit::WebPageProxy::PolicyDecisionSender::send): (WebKit::WebPageProxy::PolicyDecisionSender::PolicyDecisionSender): (WebKit::WebPageProxy::receivedNavigationPolicyDecision): (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync): (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared): (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::decidePolicyForNavigationActionSync): (WebKit::WebPageProxy::decidePolicyForNewWindowAction): (WebKit::WebPageProxy::decidePolicyForResponse): (WebKit::WebPageProxy::decidePolicyForResponseShared): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::setUpPolicyListener): (WebKit::WebFrame::invalidatePolicyListener): (WebKit::WebFrame::didReceivePolicyDecision): * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didReceivePolicyDecision): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2019-02-03 Megan Gardner Turn on Smart Paste https://bugs.webkit.org/show_bug.cgi?id=193786 Reviewed by Ryosuke Niwa. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/TextCheckerIOS.mm: (WebKit::TextChecker::isSmartInsertDeleteEnabled): Use the flag from UIKit to determine if smart copy paste should be turned on. 2019-02-02 Simon Fraser Tidy up data memebers of FrameView and related classes to shrink class sizes https://bugs.webkit.org/show_bug.cgi?id=194197 Reviewed by Zalan Bujtas. * UIProcess/PageClient.h: Declare enum size. 2018-12-16 Darin Adler Convert additional String::format clients to alternative approaches https://bugs.webkit.org/show_bug.cgi?id=192746 Reviewed by Alexey Proskuryakov. * UIProcess/Cocoa/ViewGestureController.cpp: (WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog): Use makeString and FormattedNumber. * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: (WebKit::LocalAuthenticator::getAssertion): Added a comment about an incorrect format specifier and left this code as is for now. 2019-02-01 David Kilzer Move soft-linking of TelephonyUtilities.framework out of TUCallSPI.h Reviewed by Alex Christensen. * Platform/mac/MenuUtilities.mm: - Update for rename of TUCallSPI.h to TelephonyUtilitiesSPI.h. - Add soft-linking code formerly in TUCallSPI.h. 2019-02-01 Alex Christensen Move XPCService entry points from mac directory to new Cocoa directory https://bugs.webkit.org/show_bug.cgi?id=194129 Reviewed by Chris Dumez. * Configurations/NetworkService.xcconfig: * Configurations/PluginService.64.xcconfig: * Configurations/WebContentService.xcconfig: * NetworkProcess/EntryPoint/Cocoa: Copied from Source/WebKit/NetworkProcess/EntryPoint/mac. * NetworkProcess/EntryPoint/mac: Removed. * PluginProcess/EntryPoint/Cocoa: Copied from Source/WebKit/PluginProcess/EntryPoint/mac. * PluginProcess/EntryPoint/mac: Removed. * Shared/EntryPointUtilities/Cocoa: Copied from Source/WebKit/Shared/EntryPointUtilities/mac. * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h: * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm: * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm: * Shared/EntryPointUtilities/mac: Removed. * SourcesCocoa.txt: * WebKit.xcodeproj/project.pbxproj: * WebProcess/EntryPoint/Cocoa: Copied from Source/WebKit/WebProcess/EntryPoint/mac. * WebProcess/EntryPoint/mac: Removed. 2019-02-01 Wenson Hsieh [iOS] Consistent 1 sec hang when triggering modal alerts while handling synchronous touch events https://bugs.webkit.org/show_bug.cgi?id=194140 Reviewed by Tim Horton. Currently, the UI process hangs when attempting to synchronously present modal UI from the web process while the UI process is waiting for sync IPC in the web process. While we have logic to generally mitigate IPC deadlock in this scenario by dispatching the web process' sync IPC immediately with the intention of allowing the web process to finish processing sync IPC (and consequently unblock the UI process), this fails in the case where the sync IPC message from the web process to the UI process requires main thread execution for an arbitrary amount of time (for instance, modal alert dialogs). In this case, we'll end up in a state where we've handled the web process' sync IPC in the UI process, yet we can't resume execution since the web process is still blocked. By far the most egregious scenario in which this manifests is during synchronous gesture recognizer IPC, i.e. grabbing position information from the UI process, and handling touch events synchronously. Luckily, these are also cases where (1) we know sync IPC may safely time out, and (2) the presentation of modal UI from the web process should cause the gesture recognizers to fail anyways. As such, we can mitigate these scenarios in the web process by responding to the these pending sync IPC messages *before* sending our own sync IPC to the UI process. Test: fast/events/touch/ios/show-modal-alert-during-touch-start.html * Shared/ios/InteractionInformationAtPosition.h: (WebKit::InteractionInformationAtPosition::invalidInformation): * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): (WebKit::InteractionInformationAtPosition::decode): Add a new flag to indicate whether an interaction information response can be valid. Interaction information cannot be valid in the case where the interaction information request was interrupted by certain sync IPC messages from the web process. * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationIgnoreSynchronousMessagingTimeoutsForTesting): (WKContextConfigurationSetIgnoreSynchronousMessagingTimeoutsForTesting): Add some testing SPI to ignore sync IPC timeouts, for the purposes of testing. Rather than use the existing Objective-C SPI in WKWebProcessPoolConfiguration, I decided to add C API plumbing for this flag, so that other non-Cocoa ports may also support the new layout test option to ignore sync IPC timeouts. * UIProcess/API/C/WKContextConfigurationRef.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView ensurePositionInformationIsUpToDate:]): (-[WKContentView _positionInformationDidChange:]): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel): (WebKit::WebChromeClient::runJavaScriptAlert): (WebKit::WebChromeClient::runJavaScriptConfirm): (WebKit::WebChromeClient::runJavaScriptPrompt): (WebKit::WebChromeClient::print): (WebKit::WebChromeClient::exceededDatabaseQuota): (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota): Cancel any pending sync IPC replies prior to sending sync IPC messages to the UI process which may result in sync IPC deadlock, by using the new helper method, sendSyncWithDelayedReply, instead of just sendSync. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::cancelGesturesBlockedOnSynchronousReplies): Add a helper to cancel pending sync messages coming in from the UI process that are being called from within gesture recognizer delegate hooks. (WebKit::WebPage::touchEventSync): * WebProcess/WebPage/WebPage.h: Add a new helper, sendSyncWithDelayedReply, to be used when sending a sync IPC message to the UI process that cannot be immediately completed upon arrival. Importantly, this cancels pending sync replies, and also passes IPC::SendSyncOption::InformPlatformProcessWillSuspend. * WebProcess/WebPage/WebPage.messages.in: Change these from LegacySync to Delayed messages. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getPositionInformation): Make this sync IPC handler (as well as WebPage::touchEventSync) store the IPC reply during the scope of the method, and invoke the stored reply at the end of the method if it wasn't interrupted due to something calling cancelGesturesBlockedOnSynchronousReplies(). (WebKit::WebPage::positionInformation): Refactor getPositionInformation by pulling out the logic for building an InteractionInformationAtPosition into a separate helper. (WebKit::WebPage::requestPositionInformation): 2019-02-01 David Quesada Network Process crash when resuming downloads: '-[__NSDictionaryI setObject:forKey:]: unrecognized selector sent to instance %p' https://bugs.webkit.org/show_bug.cgi?id=194144 rdar://problem/47553456 Reviewed by Geoffrey Garen. * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm: (WebKit::Download::resume): Make a mutable copy of the root object decoded from the resume data. It might have been originally encoded as an immutable dictionary. 2019-02-01 Chris Dumez REGRESSION: Flaky ASSERTION FAILED: m_uncommittedState.state == State::Committed on http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html https://bugs.webkit.org/show_bug.cgi?id=193740 Reviewed by Alex Christensen. The issue was happening when the page is triggering a cross-site navigation while in the middle of parsing. This would cause us to start a new provisional load in a new process before the previous process sends the DidFinishLoadForFrame() IPC to the UIProcess. Getting such IPC after a provisional load has started would mess up our state machine and trip assertions. This patch restores non-PSON behavior which is that the previous load in the old process now gets stopped so that no DidFinishLoadForFrame() / DidFailLoadForFrame() gets sent. To achieve this behavior, I introduced a new "StopAllLoads" PolicyAction that we now send the old process when the load is continuing in a new process, instead of sending it "Ignore". * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (toNSURLSessionResponseDisposition): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedNavigationPolicyDecision): 2019-02-01 Jer Noble Unreviewed build fix; Respect the 'condition:' field in the WebPreferences.yaml when generating WebPreferencesStoreDefaultsMap.cpp. * page/SettingsBase.h: 2019-02-01 Antoine Quint Dispatch pointercancel events when content is panned or zoomed on iOS https://bugs.webkit.org/show_bug.cgi?id=193962 Reviewed by Dean Jackson. When a user-agent-provided interaction, such as panning or zooming on iOS, uses a set of touches, we should dispatch a pointercancel event for the pointer ids of the touches involved. To facilitate this, we add a new method on WKContentView to cancel all the pointers matching active touches for a provided UIGestureRecognizer through an async IPC call into the Web process using the new method PointerCaptureController::cancelPointer(). * Platform/spi/ios/UIKitSPI.h: Add the necessary forward declaration for a necessary UIKit SPI allowing us to get the set of last-seen UITouches by the identifier generated for the matching WebKit touch. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView scrollViewWillBeginZooming:withView:]): Dispatch touchcancel events for all pointers involved in a pinch gesture on the top-level UIScrollView. (-[WKWebView _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]): Dispatch touchcancel events for all pointers involved in a pan gesture on the top-level UIScrollView. We can infer this by looking at whether the adjusted content offset, after accounting for the permitted touch actions, is different from the original content offset. * UIProcess/PageClient.h: Expose a new virtual cancelPointersForGestureRecognizer() method which will allow the iOS implementation to forward the call to WKContentViewInteraction. (WebKit::PageClient::cancelPointersForGestureRecognizer): * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: Expose the WebPageProxy such that we may access it to cancel pointers for a given gesture recognizer from within ScrollingTreeScrollingNodeDelegateIOS. (WebKit::RemoteScrollingCoordinatorProxy::webPageProxy const): * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h: * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: (-[WKScrollingNodeScrollViewDelegate _scrollView:adjustedOffsetForOffset:translation:startPoint:locationInView:horizontalVelocity:verticalVelocity:]): Dispatch touchcancel events for all pointers involved in a pan gesture on a nested UIScrollView. We can infer this by looking at whether the adjusted content offset, after accounting for the permitted touch actions, is different from the original content offset. (-[WKScrollingNodeScrollViewDelegate scrollViewWillBeginZooming:withView:]): Dispatch touchcancel events for all pointers involved in a pinch gesture on a nested UIScrollView. (-[WKScrollingNodeScrollViewDelegate cancelPointersForGestureRecognizer:]): (WebKit::ScrollingTreeScrollingNodeDelegateIOS::cancelPointersForGestureRecognizer): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::cancelPointer): * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::cancelPointersForGestureRecognizer): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cancelPointersForGestureRecognizer:]): Obtain all active UITouch objects for the view and dispatch a pointercancel event, through the WebPageProxy, for all touches associated with the provided gesture recognizer. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::cancelPointer): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2019-02-01 Jer Noble Make the WebKit default for media source based on the WebCore default. https://bugs.webkit.org/show_bug.cgi?id=194172 Reviewed by Eric Carlson. * Shared/WebPreferences.yaml: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setMediaSourceEnabled:]): (-[WKPreferences _mediaSourceEnabled]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2019-02-01 Simon Fraser Force settings.acceleratedCompositingEnabled() to true for WebKit https://bugs.webkit.org/show_bug.cgi?id=194166 rdar://problem/47694328 Reviewed by Tim Horton. WebKit relies on accelerated compositing for its drawing areas to function correctly, and sometimes clients (*cough* Safari *cough*) have bugs where they clobber the settings, so force this setting to be always on (and release log if this happens). * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2019-02-01 Antti Koivisto Don't use base layer() as the scroll layer in scrolling tree. https://bugs.webkit.org/show_bug.cgi?id=194160 Reviewed by Simon Fraser. * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder::encode): (ArgumentCoder::decode): (ArgumentCoder::encode): (ArgumentCoder::decode): (WebKit::dump): * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm: (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren): * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren): * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren): (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren): 2019-02-01 Michael Catanzaro [SOUP] Improve use of SoupCookiePersistentStorageType https://bugs.webkit.org/show_bug.cgi?id=194103 Reviewed by Carlos Garcia Campos. Turn it into an enum class, and stop casting it to and from uint32_t. * NetworkProcess/Cookies/WebCookieManager.h: * NetworkProcess/Cookies/WebCookieManager.messages.in: * NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp: (WebKit::WebCookieManager::setCookiePersistentStorage): * NetworkProcess/NetworkSessionCreationParameters.cpp: (WebKit::NetworkSessionCreationParameters::privateSessionParameters): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/NetworkSessionCreationParameters.h: * Shared/soup/SoupCookiePersistentStorageType.h: (): Deleted. * UIProcess/API/glib/WebKitCookieManager.cpp: * UIProcess/WebCookieManagerProxy.h: * UIProcess/soup/WebCookieManagerProxySoup.cpp: (WebKit::WebCookieManagerProxy::setCookiePersistentStorage): (WebKit::WebCookieManagerProxy::getCookiePersistentStorage const): 2019-02-01 Per Arne Vollan [macOS] Revert parts of r240811, since it causes kernel panics. https://bugs.webkit.org/show_bug.cgi?id=194061 Unreviewed crash fix. * WebProcess/com.apple.WebProcess.sb.in: 2019-02-01 Michael Catanzaro [SOUP] Improve use of PAL::SessionID in WebKitCookieManager https://bugs.webkit.org/show_bug.cgi?id=194092 Reviewed by Carlos Garcia Campos. Always get it from the data store instead of assuming the default session ID, and add a helper function for this. * UIProcess/API/glib/WebKitCookieManager.cpp: (_WebKitCookieManagerPrivate::sessionID const): (_WebKitCookieManagerPrivate::~_WebKitCookieManagerPrivate): (webkitCookieManagerCreate): (webkit_cookie_manager_set_persistent_storage): (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): 2019-01-31 Takashi Komori [Curl] Remove unnecessary member from NetworkStorageSession. https://bugs.webkit.org/show_bug.cgi?id=194137 Reviewed by Don Olmstead. * NetworkProcess/curl/NetworkProcessCurl.cpp: (WebKit::NetworkProcess::platformCreateDefaultStorageSession const): 2019-01-31 Jiewen Tan Unreviewed, build fix after r240805 This patch reverts the BlockPtr change since it breaks iOS builds. * UIProcess/Cocoa/NavigationState.mm: (WebKit::tryInterceptNavigation): 2019-01-31 Chris Dumez Page zoom level is lost after a process swap or a crash https://bugs.webkit.org/show_bug.cgi?id=194105 Reviewed by Alex Christensen. Previously, when the client would call setPageAndTextZoomFactors() on the WebPageProxy, we would update the WebPageProxy's corresponding data members and send an IPC to the WebProcess to apply the zoom factors. The issue is that on process crash or process-swap, we never communicate those zoom factors to the new WebProcess. Even if the client were to call setPageAndTextZoomFactors() with the same factors again, it would be a no-op since the WebPageProxy's data members already reflect the expected values. To address the issue, pass both the page zoom and the text zoom factors to the WebProcess via WebPageCreationParameters. This way, there is no need to send an extra IPC and we're sure the WebPageProxy's factors are properly applied to the WebPage on WebContent process side upon creation (whether after a crash or a process swap). * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): * WebProcess/WebPage/WebPage.cpp: 2019-01-31 Per Arne Vollan [macOS] Disable permissive call logging in sandbox https://bugs.webkit.org/show_bug.cgi?id=194061 Reviewed by Alexey Proskuryakov. Strict call filtering should be reenabled. * WebProcess/com.apple.WebProcess.sb.in: 2019-01-31 Per Arne Vollan [macOS] Crash when control-clicking or copying text rendered with a web font https://bugs.webkit.org/show_bug.cgi?id=193913 Reviewed by Brent Fulgham. On older versions of macOS, allowing mach lookup to com.apple.FontObjectsServer is needed. * WebProcess/com.apple.WebProcess.sb.in: 2019-01-31 Benjamin Poulain Remove WKPageIsWebProcessResponsive https://bugs.webkit.org/show_bug.cgi?id=194096 Reviewed by Alex Christensen. It is not used by any client. It is also bad API. It is better to let WebKit track responsiveness and tell the client with processDidBecomeResponsive. * UIProcess/API/C/WKPage.cpp: (WKPageIsWebProcessResponsive): Deleted. * UIProcess/API/C/WKPagePrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::isWebProcessResponsive): Deleted. * UIProcess/WebPageProxy.h: 2019-01-31 Alex Christensen Revert r238819 which is unneeded and caused a performance regression. https://bugs.webkit.org/show_bug.cgi?id=192272 * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h: (API::InjectedBundle::PageLoaderClient::didStartProvisionalLoadForFrame): * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h: * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (PageLoaderClient::didStartProvisionalLoadForFrame): * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp: (WebKit::InjectedBundlePageLoaderClient::didStartProvisionalLoadForFrame): * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2019-01-31 Jiewen Tan Formalize WebKitAdditions mechanism of LoadOptimizer https://bugs.webkit.org/show_bug.cgi?id=193886 Reviewed by Brent Fulgham. This patch does the following few things: 1) formalizes WebKitAdditions mechanism of LoadOptimizer; 2) modernizes AppLinks code in tryInterceptNavigation to use BlockPtr; 3) lets AppLinks have higher precedence than LoadOptimizer. * SourcesCocoa.txt: * UIProcess/Cocoa/LoadOptimizer.h: Removed. * UIProcess/Cocoa/LoadOptimizer.mm: Removed. * UIProcess/Cocoa/NavigationState.mm: (WebKit::tryOptimizingLoad): (WebKit::tryInterceptNavigation): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::WebsiteDataStore): * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::loadOptimizer): Deleted. * WebKit.xcodeproj/project.pbxproj: 2019-01-31 Chris Dumez Regression(PSON) Crash under WebProcessProxy::canTerminateChildProcess() https://bugs.webkit.org/show_bug.cgi?id=194094 Reviewed by Ryosuke Niwa. If a SuspendedPageProxy gets destroyed while a WebPageProxy is waiting for its to finish to suspend, call the "failure to suspend" completion handler asynchronously instead of synchronouly to make sure the completion handler cannot try and use the suspended page proxy while it is being destroyed. * UIProcess/SuspendedPageProxy.cpp: (WebKit::SuspendedPageProxy::~SuspendedPageProxy): 2019-01-31 Timothy Hatcher Fix LSAppLink deprecation warnings. https://bugs.webkit.org/show_bug.cgi?id=194097 Unreviewed build fix. * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant _appendOpenActionsForURL:actions:elementInfo:]): 2019-01-30 Simon Fraser [Mac] Implement basic hit testing in the scrolling tree https://bugs.webkit.org/show_bug.cgi?id=172917 Reviewed by Antti Koivisto. Changed return types, "using namespace WebCore" in ScrollingTreeFrameScrollingNodeRemoteMac.cpp. * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder::encode): * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h: * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.h: * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm: (WebKit::ScrollerPairMac::handleWheelEvent): (WebKit::ScrollerPairMac::handleMouseEvent): * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp: (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleWheelEvent): (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleMouseEvent): * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h: 2019-01-31 Michael Catanzaro [SOUP] Move cookiePersistentStoragePath and cookiePersistentStorageType from NetworkProcess to NetworkSession https://bugs.webkit.org/show_bug.cgi?id=194075 Reviewed by Alex Christensen. Move cookiePersistentStoragePath and cookiePersistentStorageType from NetworkProcess to NetworkSession to reduce globals. This removes two of the six soup-specific variables in NetworkProcessCreationParameters * NetworkProcess/Cookies/WebCookieManager.h: * NetworkProcess/Cookies/WebCookieManager.messages.in: * NetworkProcess/Cookies/soup/WebCookieManagerSoup.cpp: (WebKit::WebCookieManager::setCookiePersistentStorage): * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/NetworkSessionCreationParameters.cpp: (WebKit::NetworkSessionCreationParameters::privateSessionParameters): (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/NetworkSessionCreationParameters.h: * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::NetworkProcess::platformInitializeNetworkProcess): * NetworkProcess/soup/NetworkSessionSoup.cpp: (WebKit::NetworkSessionSoup::NetworkSessionSoup): * SourcesGTK.txt: * SourcesWPE.txt: * UIProcess/API/glib/WebKitCookieManager.cpp: (webkit_cookie_manager_set_persistent_storage): * UIProcess/WebCookieManagerProxy.cpp: (WebKit::WebCookieManagerProxy::WebCookieManagerProxy): * UIProcess/WebCookieManagerProxy.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.h: * UIProcess/WebsiteData/curl/WebsiteDataStoreCurl.cpp: (WebKit::WebsiteDataStore::platformSetNetworkParameters): (WebKit::WebsiteDataStore::platformSetParameters): Deleted. * UIProcess/soup/WebCookieManagerProxySoup.cpp: (WebKit::WebCookieManagerProxy::setCookiePersistentStorage): (WebKit::WebCookieManagerProxy::getCookiePersistentStorage const): * UIProcess/soup/WebProcessPoolSoup.cpp: (WebKit::WebProcessPool::platformInitializeNetworkProcess): 2019-01-31 Ryosuke Niwa iOS: Crash in InteractiveUpdateHandler set by ViewGestureController::beginSwipeGesture https://bugs.webkit.org/show_bug.cgi?id=194083 Reviewed by Tim Horton. We think this crash is a regression from r236966. Prior to r236966, we could only called removeSwipeSnapshot() only when m_provisionalOrSameDocumentLoadCallback was set but now we can call it either when m_snapshotRemovalTracker::start was called, or it had been reset. This can result in m_webPageProxyForBackForwardListForCurrentSwipe getting cleared before InteractiveUpdateHandler is called by UIGestureRecognizer, resulting in the crash. This patch tries to restore the behavior prior to r236966 by only invoking removeSwipeSnapshot() when SnapshotRemovalTracker has a valid removal callback set. Unfortunately no new tests since there is no reproducible test case, and neither API tests nor layout tests seem to have the capability to trigger swipe gestures via UIGestureRecognizer, which is required for this crash to occur. Notably, back-forward swipe tests I enabled in r240765 bypass UIKit and emulates the action instead. * UIProcess/Cocoa/ViewGestureController.cpp: (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState): * UIProcess/Cocoa/ViewGestureController.h: (WebKit::ViewGestureController::SnapshotRemovalTracker::hasRemovalCallback const): 2019-01-30 Benjamin Poulain Responsiveness timers are too expensive for frequent events https://bugs.webkit.org/show_bug.cgi?id=194003 Reviewed by Geoffrey Garen. The problem here is specific to wheel events. For every wheel event, we start a responsiveness timer and send a ping to the WebProcess. When the WebProcess respond, we stop the timer. The cost of setting up the timers adds up since we get many events. The first step to improve the situation was to switch ResponsivenessTimer to WebCore::Timer. Since WebCore::Timer reuse the same CFRunLoopTimerRef, we save the allocation/deallocation, insertion in the event loop, etc. Using WebCore::Timer saves some instructions but we were still hitting the kernel at 120hz to set up then kill each timer. The second improvement of the patch is to avoid that by not killing the timer when we hear back from the WebProcess. Instead of killing the timer, we let it run and ignore the result. When the next event comes, we reschedule the existing timer. This brings down the timers to 60Hz, the same rate as the events. The very last event does time out. In that case, we have a bad idle wake up: we wake up a sleeping CPU do do nothing. In the case of wheel events, this is fine since we saved a bunch of CPU already. For all the other cases, I kept the normal operating mode to avoid the idle wake. * UIProcess/ResponsivenessTimer.cpp: (WebKit::ResponsivenessTimer::ResponsivenessTimer): (WebKit::ResponsivenessTimer::invalidate): (WebKit::ResponsivenessTimer::timerFired): (WebKit::ResponsivenessTimer::start): (WebKit::ResponsivenessTimer::startWithLazyStop): (WebKit::ResponsivenessTimer::stop): (WebKit::ResponsivenessTimer::processTerminated): (WebKit::ResponsivenessTimer::~ResponsivenessTimer): Deleted. * UIProcess/ResponsivenessTimer.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::sendWheelEvent): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::isResponsiveWithLazyStop): * UIProcess/WebProcessProxy.h: 2019-01-30 Daniel Bates [iOS] REGRESSION (r238635): Text area fails to re-focus after dismissal of keyboard on support.apple.com https://bugs.webkit.org/show_bug.cgi?id=193987 Reviewed by Tim Horton. It is unnecessary to relinquish first responder status when a user explicitly dismissing the keyboard. Moreover, doing so prevents key commands from being intercepted when a hardware keyboard is subsequently attached. Following r238635 a page becomes focused (accepting of keyboard input) and defocused when the WKContentView becomes first responder and resigns first responder, respectively. When a user explicitly dismisses the keyboard by tapping Done (iPhone) or the hide keyboard button (iPad) then UIKit tells WKContentView to resign its first responder status only to make its superview, WKWebView, first responder. When a person subsequently taps on the page again, the WKContentView requests to become the first responder. However changes to page focus are not guaranteed to be sent to the WebProcess immediately (WebPageProxy::activityStateDidChange() will schedule an update). In particular, they are not guaranteed to be sent before the WebProcess is told about a tap. Therefore, the WebProcess has out-of-date information on focus state of the page. Instead we should detect when WKWebView is being asked to resign as a result of the keyboard dismissal and refuse the request, taking care to end the current editing session, blur the focused element, and dismiss the on-screen keyboard. * Platform/spi/ios/UIKitSPI.h: Expose some SPI. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): Register to receive notifications whenever a user explicitly dismisses the keyboard. (-[WKContentView resignFirstResponderForWebView]): If we are being asked to resign as a result of a user explicitly dismissing the keyboard then refuse to resign. (-[WKContentView _keyboardDidRequestDismissal:]): Update state, if applicable. 2019-01-30 Keith Rollin Add default constructor for NetworkActivityTracker https://bugs.webkit.org/show_bug.cgi?id=194058 Reviewed by Chris Dumez. ResourceNetworkActivityTracker has a default constructor. It also has a NetworkActivityTracker data member, which does not have a default constructor. This will cause some compilers to complain -- they can't default-create a ResourceNetworkActivityTracker because they can't default-create its data members. Address this by adding a default constructor for NetworkActivityTracker. * NetworkProcess/NetworkActivityTracker.h: 2019-01-30 Daniel Steffen Safari should switch from the legacy denap SPI to handling vouchers https://bugs.webkit.org/show_bug.cgi?id=193992 Reviewed by Geoffrey Garen. The denap SPI is deprecated. The new way of staying out of AppNap is through a voucher. * Platform/IPC/mac/ConnectionMac.mm: (IPC::readFromMachPort): * Platform/IPC/mac/ImportanceAssertion.h: (IPC::ImportanceAssertion::ImportanceAssertion): (IPC::ImportanceAssertion::~ImportanceAssertion): 2019-01-30 Chris Dumez Fix crashes when trying to ref the CallbackAggregator in NetworkProcess https://bugs.webkit.org/show_bug.cgi?id=194054 Reviewed by Brent Fulgham. The callback aggregators should be ThreadSafeRefCounted since they are passed to other threads. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): (WebKit::NetworkProcess::topPrivatelyControlledDomainsWithWebsiteData): 2019-01-30 Daniel Bates [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element https://bugs.webkit.org/show_bug.cgi?id=192824 Reviewed by Wenson Hsieh. Use the same code path for key events to editable elements and non-editable elements. Currently we have different code paths for hardware key events depending on whether the active element is editable or non-editable. Historically to support dispatching DOM keyboard events for hardware key presses this differentiation was a necessary workaround for UIKit's event processing precedence of interpreting key events for system text editing commands and app commands before dispatching unhandled key events to WebKit. This workaround intercepted raw key UIEvents and manually reconstructed a WebEvent from it. However there is not enough information in an UIEvent to reconstruct a WebEvent that is identical to the WebEvent that UIKit would have dispatched. In particular, keyup UIEvents always have empty modified and unmodified input strings. The UIKit keyboard machinery maintains additional state that is necessary to manufacture the correct WebEvent corresponding to a UIEvent. As a side benefit of this change, with the exception of modifier flag changes, both hardware and software key events use the same code path. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView shouldShowAutomaticKeyboardUI]): Extracted code from _requiresKeyboardWhenFirstResponder (-[WKContentView _disableAutomaticKeyboardUI]): Implement UIKit SPI to prevent showing the keyboard UI when there is no focused element now that we are no longer intercepting key UIEvents. Formerly the keyboard UI was disabled as a side effect of not becoming first responder when there was no focused element (by returning NO in -_requiresKeyboardWhenFirstResponder). (-[WKContentView _requiresKeyboardWhenFirstResponder]): Always return YES when building with USE(UIKIT_KEYBOARD_ADDITIONS) so that we always accept key events. Instead of selectively replying to create a keyboard as a means of hiding the automatic keyboard UI we now implement _disableAutomaticKeyboardUI to selectively hide the automatic keyboard UI. (-[WKContentView textInputTraits]): Do not update traits when the keyboard is going to be dismissed now that we require a keyboard when first responder even if the focused element is non-editable. (-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Skip logic for re-sending UIEvents to UIKit as UIKit now processes the event first. This logic was necessary in order to finally allow UIKit its chance to interpret the UIEvent, we intercepted, for app key commands. (-[WKContentView _elementDidBlur]): Call [self _endEditing] so that we dismiss any open form controls (e.g. a may not scroll it into view https://bugs.webkit.org/show_bug.cgi?id=193084 Reviewed by Simon Fraser. In `WKWebView.mm`, `-_zoomToFocusRect:` will ignore the given selection rect if it is of size `{ 0, 0 }` and at the origin. Prior to r239441, when using the tab key to move focus between non-editable form controls (or any other method that doesn't involve tapping on the focused select element, with the exception of the next and previous buttons in the input accessory view), we would compute a selection rect of `{{ 0, 0 }, { 0, 0 }}`, and subsequently try to scroll the focused element to the center of the visible area, without taking the selection rect into account. However, after r239441, the web process sends the element interaction location to the UI process, which then computes the selection rect by taking this location and adding a size of `{ 1, 1 }` (before r239441, this was done in `WebPage::getAssistedNodeInformation`). However, our new implementation doesn't take into account the case where the element interaction rect is null, which happens when the last interaction location is outside of the bounding rect of the element. In this case, we set the element interaction location to { 0, 0 } and end up computing a selection rect of `{{ 0, 0 }, { 1, 1 }}` instead of `{{ 0, 0 }, { 0, 0 }}` as we would have previously done. This causes us to scroll up to the origin, instead of revealing the focused element. To fix this, we restore the pre-r239441 behavior. See additional comments below for details. Test: fast/forms/ios/scroll-to-reveal-focused-select.html * Shared/FocusedElementInformation.cpp: (WebKit::FocusedElementInformation::encode const): (WebKit::FocusedElementInformation::decode): * Shared/FocusedElementInformation.h: Rename `elementInteractionLocation` to `lastInteractionLocation`. This was previously `elementInteractionLocation` due to existing logic that tries to move the interaction location into the bounding rect of the element in the case where visual viewports are disabled; however, since this feature has long been enabled by default for all modern WebKit clients (internal and external), it's simpler to just use always send the last interaction location over to the UI process, and have the UI process use `{{ 0, 0 }, { 0, 0 }}` if the interaction location is outside of the element rect. In the very unlikely event that any modern WebKit client disables visual viewports, this will still behave reasonably, since we'll just use `{{ 0, 0 }, { 0, 0 }}` as the target rect and scroll to reveal the entire element rather than the top left corner of the element. * UIProcess/ios/WKContentViewInteraction.mm: (rectToRevealWhenZoomingToFocusedElement): * WebProcess/WebPage/ios/WebPageIOS.mm: Move the check for whether the interaction location is inside the element's bounding rect from the web process to the UI process. This relocates the logic to determine whether the selection rect should be a 1 by 1 fallback interaction rect or the zero rect (`{{ 0, 0 }, { 0, 0 }}`) closer to the code that actually uses this rect. (WebKit::WebPage::getFocusedElementInformation): 2019-01-03 Wenson Hsieh WebUndoStep's monotonically increasing identifier should be a WebUndoStepID instead of uint64_t https://bugs.webkit.org/show_bug.cgi?id=193100 Reviewed by Simon Fraser. Add a type alias, WebUndoStepID, to represent the monotonically increasing undo step ID for each undoable editing command, and use this type alias in lieu of `uint64_t`. No change in behavior. * UIProcess/WebEditCommandProxy.cpp: (WebKit::WebEditCommandProxy::WebEditCommandProxy): * UIProcess/WebEditCommandProxy.h: (WebKit::WebEditCommandProxy::create): (WebKit::WebEditCommandProxy::commandID const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::registerEditCommandForUndo): * UIProcess/WebPageProxy.h: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::registerUndoStep): Store the step ID in a temporary variable, since `webUndoStep` is now moved when calling `addWebUndoStep`. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::webUndoStep): (WebKit::WebPage::addWebUndoStep): Make this take a `Ref&&` instead of a `WebUndoStep*`, and use move semantics to transfer the given `Ref` to the table. (WebKit::WebPage::removeWebEditCommand): (WebKit::WebPage::unapplyEditCommand): (WebKit::WebPage::reapplyEditCommand): Use `auto*` in a couple of places. (WebKit::WebPage::didRemoveEditCommand): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebUndoStep.cpp: (WebKit::generateUndoStep): * WebProcess/WebPage/WebUndoStep.h: (WebKit::WebUndoStep::stepID const): (WebKit::WebUndoStep::WebUndoStep): * WebProcess/WebPage/WebUndoStepID.h: Copied from Source/WebKit/WebProcess/WebPage/WebUndoStep.cpp. 2019-01-02 Wenson Hsieh Add support for using the current text selection as the find string on iOS https://bugs.webkit.org/show_bug.cgi?id=193034 Reviewed by Tim Horton. * SourcesCocoa.txt: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _takeFindStringFromSelection:]): Provides a way to set the find string on iOS and macOS (an aside: takeFindStringFromSelection: already exists on macOS, but there is no equivalent protocol method on iOS, so this new SPI acts as a cross-platform way for WebKit clients to take the find string from the selection across all Cocoa platforms). (+[WKWebView _stringForFind]): (+[WKWebView _setStringForFind:]): Call into find-in-page helper functions. (-[WKWebView _findString:options:maxCount:]): On iOS, additionally update the find-in-page string when exercising the _findString:options:maxCount: SPI. This mirrors macOS behavior of updating the find pasteboard every time the find string changes; however, on macOS, this is implemented by the platform (in AppKit), whereas there's no platform find pasteboard on iOS, let alone logic to update it in UIKit. As such, we directly drive updates to the find string within WebKit. * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add some new cross-platform find-in-page SPI. See above for more details. * UIProcess/Cocoa/GlobalFindInPageState.h: Added. * UIProcess/Cocoa/GlobalFindInPageState.mm: Added. (WebKit::findPasteboard): (WebKit::globalStringForFind): Fetch the string to use when finding text in the page. On macOS, this accesses the AppKit find pasteboard; on iOS, this instead returns the current global find string. (WebKit::updateStringForFind): Sets the global find string. Uses the find pasteboard on macOS, and sets the global find string on iOS. (WebKit::stringForFind): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Add plumbing to allow WebEditorClient to deliver the update the global find string in the UI process. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::updateStringForFind): * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm: (WebKit::WebEditorClient::updateStringForFind): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateStringForFind): 2019-01-02 Brent Fulgham Allow WebContent process access to some drawing-related IOKit properties https://bugs.webkit.org/show_bug.cgi?id=193086 Reviewed by Eric Carlson. Update the iOS WebContent process sandbox to allow access to some IOKit properties that are needed for drawing and media playback operations. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * WebProcess/com.apple.WebKit.WebContent.sb.in: 2019-01-02 Brent Fulgham Remove unused logging service https://bugs.webkit.org/show_bug.cgi?id=193081 Reviewed by Alexey Proskuryakov. We don't use this logging service, so don't open an exception for it. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2019-01-02 Brent Fulgham Remove temporary workaround for CVMS code signing objects https://bugs.webkit.org/show_bug.cgi?id=193079 Reviewed by Alexey Proskuryakov. * WebProcess/com.apple.WebProcess.sb.in: 2019-01-02 Wenson Hsieh REGRESSION (r239441): [iOS] Selection UI sometimes doesn't change after tapping "select all" in the callout bar https://bugs.webkit.org/show_bug.cgi?id=193070 Reviewed by Tim Horton. r239441 added logic to include an EditorState in the next layer tree commit when refocusing an element; this was done to ensure that after tapping an element that has already been programmatically focused, we still send up- to-date editor information to the UI process for the purposes of zooming to the selection rect, even if the selection in the DOM is unchanged, since other aspects of the editor state may have changed since the element was initially focused. We currently try to flag the next layer tree commit by setting `m_hasPendingEditorStateUpdate` to `true`. However, this is problematic since we aren't guaranteed in all cases that a compositing flush has been scheduled. In the case where it hasn't, we'll end up in a state where the editor state update flag has been set, yet the update will not make it over to the UI process until something happens that forces a layer tree commit (e.g. scrolling, pinch zooming). Worse still, if the selection is then programmatically changed from the web process, we will bail from sending a subsequent editor state update to the UI process because `WebPage` thinks that a pending editor state has already been scheduled. This manifests in selection UI not updating after tapping "Select All" in the callout bar, if the callout bar was brought up by tapping near the selection (since this refocuses the element). To fix this, we adjust this logic in `WebPage::elementDidRefocus` so that it sets the flag and then schedules a compositing flush, but only if the user is actually interacting with the focused element (i.e., if the page calls `focus` repeatedly, we won't continue to schedule compositing flushes). Test: editing/selection/ios/change-selection-after-tapping-focused-element.html * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::elementDidRefocus): (WebKit::WebPage::sendEditorStateUpdate): (WebKit::WebPage::scheduleFullEditorStateUpdate): Add a private helper method to schedule an editor state update by setting `m_hasPendingEditorStateUpdate` to `true` and then scheduling a compositing layer flush. Also, add a FIXME aluding to the fact that scheduling an entire compositing layer flush to send an editor state update is somewhat wasteful, and should be replaced by just scheduling this work to be done before the next frame (see: for more detail). We also use this helper method in a few places where we currently turn on the editor state flag and schedule a subsequent compositing flush. (WebKit::WebPage::sendPartialEditorStateAndSchedulePostLayoutUpdate): * WebProcess/WebPage/WebPage.h: 2019-01-02 Commit Queue Unreviewed, rolling out r239524. https://bugs.webkit.org/show_bug.cgi?id=193083 basic browsing seems not to work (Requested by thorton on #webkit). Reverted changeset: "Expand use of sourceApplicationAuditData" https://bugs.webkit.org/show_bug.cgi?id=192995 https://trac.webkit.org/changeset/239524 2019-01-01 Jeff Miller Update user-visible copyright strings to include 2019 https://bugs.webkit.org/show_bug.cgi?id=192811 Reviewed by Mark Lam. * Info.plist: * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist: * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist: * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist: * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist: * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist: 2018-12-28 Wenson Hsieh Move WKEditCommandObjC and WKEditorUndoTargetObjC into a separate file https://bugs.webkit.org/show_bug.cgi?id=193049 Reviewed by Sam Weinig. Pull common code (WKEditCommandObjC and WKEditorUndoTargetObjC) on iOS and macOS out into a separate file. No change in behavior. * SourcesCocoa.txt: * UIProcess/Cocoa/WKEditCommand.h: Added. * UIProcess/Cocoa/WKEditCommand.mm: Added. Rename WKEditCommandObjC to WKEditCommand, and WKEditorUndoTargetObjC to WKEditorUndoTarget. The ObjC suffix in the name seems to diverge from the common naming scheme in other parts of WebKit, where most WK- and _WK- prefixed names already refer to Objective-C objects. Additionally, mark -[WKEditCommand init] as unavailable. (-[WKEditCommand initWithWebEditCommandProxy:]): Make the return type instancetype instead of id, and also make this take a Ref&& instead of a RefPtr. (-[WKEditCommand command]): Make this return a reference to the WebEditCommandProxy, rather than a pointer, since the WebEditCommandProxy should always be non-null. (-[WKEditorUndoTarget undoEditing:]): (-[WKEditorUndoTarget redoEditing:]): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::WebViewImpl): (WebKit::WebViewImpl::registerEditCommand): Use WTFMove instead of copying the Ref when creating a WKEditCommand. (-[WKEditCommandObjC initWithWebEditCommandProxy:]): Deleted. (-[WKEditCommandObjC command]): Deleted. (-[WKEditorUndoTargetObjC undoEditing:]): Deleted. (-[WKEditorUndoTargetObjC redoEditing:]): Deleted. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::PageClientImpl): (WebKit::PageClientImpl::registerEditCommand): Use WTFMove instead of creating a new RefPtr when creating a WKEditCommand. (-[WKEditCommandObjC initWithWebEditCommandProxy:]): Deleted. (-[WKEditCommandObjC command]): Deleted. (-[WKEditorUndoTargetObjC undoEditing:]): Deleted. (-[WKEditorUndoTargetObjC redoEditing:]): Deleted. * UIProcess/mac/PageClientImplMac.h: * WebKit.xcodeproj/project.pbxproj: 2018-12-27 Alex Christensen Resurrect Mac CMake build https://bugs.webkit.org/show_bug.cgi?id=192658 Reviewed by Yusuke Suzuki. * PlatformMac.cmake: 2018-12-26 Fujii Hironori [MSVC] error C2381: 'WebKit::NetworkHTTPSUpgradeChecker::~NetworkHTTPSUpgradeChecker': redefinition; '__declspec(noreturn)' or '[[noreturn]]' differs https://bugs.webkit.org/show_bug.cgi?id=193030 Reviewed by Ross Kirsling. Windows Debug builds are failing to compile due to NO_RETURN_DUE_TO_ASSERT inconsistency of NetworkHTTPSUpgradeChecker destructor's definition and declaration. * NetworkProcess/NetworkHTTPSUpgradeChecker.h: Added NO_RETURN_DUE_TO_ASSERT to NetworkHTTPSUpgradeChecker destructor declaration. * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp: Removed NO_RETURN_DUE_TO_ASSERT from the definition. 2018-12-24 Fujii Hironori [WebKit][Win] Remove using namespace in the global scope https://bugs.webkit.org/show_bug.cgi?id=192968 Reviewed by Alex Christensen. Moved using namespace statements in the global scope to inside namespaces. * NetworkProcess/Cookies/curl/WebCookieManagerCurl.cpp: * NetworkProcess/curl/NetworkDataTaskCurl.cpp: * NetworkProcess/curl/NetworkProcessCurl.cpp: * NetworkProcess/curl/NetworkSessionCurl.cpp: * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp: * Shared/Plugins/Netscape/NetscapePluginModuleNone.cpp: * Shared/WebWheelEvent.cpp: * Shared/curl/WebCoreArgumentCodersCurl.cpp: * Shared/win/NativeWebKeyboardEventWin.cpp: * Shared/win/WebEventFactory.cpp: * UIProcess/Automation/WebAutomationSession.cpp: 2018-12-24 Fujii Hironori Remove "using namespace std;" https://bugs.webkit.org/show_bug.cgi?id=192973 Reviewed by Alex Christensen. * Platform/IPC/win/ConnectionWin.cpp: 2018-12-24 Simon Fraser Change ScrollingNodeType to an enum class https://bugs.webkit.org/show_bug.cgi?id=193009 Reviewed by Zalan Bujtas. Change the ScrollingNodeType enum to an enum class. No behavior change. * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: (WebKit::encodeNodeAndDescendants): (WebKit::RemoteScrollingCoordinatorTransaction::decode): (WebKit::dump): * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::createScrollingTreeNode): * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll): 2018-12-23 Wenson Hsieh [iOS] Remove some unnecessary editing SPI after https://bugs.webkit.org/show_bug.cgi?id=193019 Reviewed by Dan Bernstein. Remove these SPI method declarations, as well as method forwarding in WKContentView. Mail was the only adoptee of these methods; after , they have moved to the underscore-prefixed versions, so we we have no need for these erroneously-named SPI methods anymore. There is no change in behavior; verified this through existing API tests (WKWebViewEditActions), as well as building iOS Mail against WebKit with these changes to WKWebViewPrivate.h. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView canPerformAction:withSender:]): (-[WKWebView targetForAction:withSender:]): (-[WKWebView _setFont:sender:]): (-[WKWebView _setFontSize:sender:]): (-[WKWebView _setTextColor:sender:]): (-[WKWebView setFont:sender:]): Deleted. (-[WKWebView setTextColor:sender:]): Deleted. (-[WKWebView setFontSize:sender:]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView canPerformActionForWebView:withSender:]): (-[WKContentView setFontForWebView:sender:]): Deleted. (-[WKContentView setFontSizeForWebView:sender:]): Deleted. (-[WKContentView setTextColorForWebView:sender:]): Deleted. 2018-12-23 Wenson Hsieh Fix fast/ruby/ruby-base-merge-block-children-crash-2.html after r239543 https://bugs.webkit.org/show_bug.cgi?id=193015 Reviewed by Tim Horton. Fix the crash by gracefully handling integer overflow when computing the area of a very large editable element. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): (-[WKContentView _updateChangedSelection:]): 2018-12-22 Wenson Hsieh [iOS] Suppress native selection behaviors when focusing a very small editable element https://bugs.webkit.org/show_bug.cgi?id=193005 Reviewed by Tim Horton. In r238146, I added a mechanism to detect when the selection is hidden within transparent editable elements, and used this to suppress native selection on iOS (such as selection handles, highlight, callout bar, etc.) to avoid conflicts between the page's editing UI and the platform. However, one additional technique observed on some websites involves hiding the selection by moving it into a tiny (1x1) editable element. Here, we currently still present a callout bar with editing actions, as well as show a selection caret or handles on iOS. To fix this, we extend the mechanism added in r238146 by also suppressing the selection assistant in the case where the editable element's area is beneath a tiny minimum threshold. Test: editing/selection/ios/hide-selection-in-tiny-contenteditable.html * Shared/EditorState.cpp: (WebKit::EditorState::PostLayoutData::encode const): (WebKit::EditorState::PostLayoutData::decode): (WebKit::operator<<): * Shared/EditorState.h: Rename selectionClipRect to focusedElementRect. We currently propagate the bounds of the focused element to the UI process through EditorState updates, but only for the purpose of returning it in the computed selection clip rect; instead, rename this member to something more general-purpose, so we can also use it when determining whether to suppress the selection assistant. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _candidateRect]): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::handleRequestedCandidates): * UIProcess/ios/WKContentViewInteraction.h: Add a new SuppressSelectionAssistantReason that corresponds to focusing tiny editable elements. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _zoomToRevealFocusedElement]): (-[WKContentView _selectionClipRect]): (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): (-[WKContentView _updateChangedSelection:]): Check the size of the focused element, and begin or stop suppressing the selection assistant accordingly. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::platformEditorState const): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::platformEditorState const): 2018-12-20 Yusuke Suzuki Use Ref<> as much as possible https://bugs.webkit.org/show_bug.cgi?id=192808 Reviewed by Alex Christensen. * PluginProcess/WebProcessConnection.cpp: (WebKit::WebProcessConnection::create): * PluginProcess/WebProcessConnection.h: * UIProcess/API/Cocoa/WKConnection.mm: (-[WKConnection sendMessageWithName:body:]): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView takeSnapshotWithConfiguration:completionHandler:]): (-[WKWebView _takeViewSnapshot]): (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): * UIProcess/API/glib/WebKitGeolocationProvider.cpp: (WebKit::WebKitGeolocationProvider::notifyPositionChanged): * UIProcess/API/glib/WebKitWebContext.cpp: (webkit_web_context_allow_tls_certificate_for_host): * UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp: (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData): * UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm: (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData): * UIProcess/BackingStore.cpp: (WebKit::BackingStore::incorporateUpdate): * UIProcess/Cocoa/NavigationState.mm: (WebKit::createErrorWithRecoveryAttempter): * UIProcess/Cocoa/PlaybackSessionManagerProxy.h: * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm: (WebKit::PlaybackSessionManagerProxy::create): * UIProcess/Cocoa/VideoFullscreenManagerProxy.h: * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: (WebKit::VideoFullscreenManagerProxy::create): * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::setPasteboardBufferForType): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::takeViewSnapshot): * UIProcess/Downloads/DownloadProxyMap.cpp: (WebKit::DownloadProxyMap::createDownloadProxy): * UIProcess/Notifications/WebNotificationManagerProxy.cpp: (WebKit::WebNotificationManagerProxy::show): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didCreateSubframe): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::getStatistics): (WebKit::WebProcessPool::requestWebContentStatistics): (WebKit::WebProcessPool::requestNetworkingStatistics): * UIProcess/WebProcessPool.h: * UIProcess/gstreamer/WebPageProxyGStreamer.cpp: (WebKit::WebPageProxy::requestInstallMissingMediaPlugins): * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp: (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow): * UIProcess/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::platformCreateFrontendPage): * UIProcess/ios/WKGeolocationProviderIOS.mm: (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]): * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::setPromisedDataForImage): * UIProcess/win/WebInspectorProxyWin.cpp: (WebKit::WebInspectorProxy::platformCreateFrontendPage): * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm: (-[WKDOMRange initWithDocument:]): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::renderedImage): * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp: (WebKit::InjectedBundlePageEditorClient::getPasteboardDataForRange): * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp: (WebKit::InjectedBundlePageUIClient::mouseDidMoveOverElement): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::snapshot): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::addArchiveResource): (WebKit::PDFPlugin::snapshot): (WebKit::PDFPlugin::writeItemsToPasteboard): * WebProcess/Plugins/PluginProcessConnectionManager.cpp: (WebKit::PluginProcessConnectionManager::getPluginProcessConnection): * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::snapshot): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::performURLRequest): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::exceededDatabaseQuota): (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::getPathnamesForType): * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp: (WebKit::convertCairoSurfaceToShareableBitmap): * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::WebDragClient::declareAndWriteDragImage): * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: (WebKit::WebPage::dictionaryPopupInfoForRange): * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::display): * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::updateFindIndicator): * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::flushLayers): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::webArchiveData): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick): (WebKit::WebPage::performDragControllerAction): * WebProcess/WebPage/ios/FindControllerIOS.mm: (WebKit::FindController::updateFindIndicator): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::replaceDictatedText): (WebKit::WebPage::getPositionInformation): * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom): * WebProcess/WebStorage/StorageNamespaceImpl.cpp: (WebKit::StorageNamespaceImpl::createSessionStorageNamespace): (WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace): (WebKit::StorageNamespaceImpl::createLocalStorageNamespace): (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace): (WebKit::StorageNamespaceImpl::storageArea): (WebKit::StorageNamespaceImpl::ephemeralLocalStorageArea): (WebKit::StorageNamespaceImpl::copy): * WebProcess/WebStorage/StorageNamespaceImpl.h: * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp: (WebKit::WebStorageNamespaceProvider::getOrCreate): (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace): (WebKit::WebStorageNamespaceProvider::createEphemeralLocalStorageNamespace): (WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace): (WebKit::WebStorageNamespaceProvider::createTransientLocalStorageNamespace): * WebProcess/WebStorage/WebStorageNamespaceProvider.h: * WebProcess/cocoa/PlaybackSessionManager.mm: (WebKit::PlaybackSessionManager::createModelAndInterface): * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::VideoFullscreenManager::createModelAndInterface): 2018-12-21 Chris Dumez navigator.userAgent in service workers does not reflect customUserAgent set by client https://bugs.webkit.org/show_bug.cgi?id=192951 Reviewed by Youenn Fablet. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::registerServiceWorkerClient): * NetworkProcess/ServiceWorker/WebSWServerConnection.h: * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: (WebKit::WebSWServerToContextConnection::installServiceWorkerContext): * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h: * WebProcess/Storage/WebSWClientConnection.cpp: (WebKit::WebSWClientConnection::registerServiceWorkerClient): * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::installServiceWorker): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.messages.in: 2018-12-21 Alex Christensen Expand use of sourceApplicationAuditData https://bugs.webkit.org/show_bug.cgi?id=192995 Reviewed by Brady Eidson. sourceApplicationAuditData has been used for a long time on iOS, but it's needed on more platforms. I also made it return an Optional instead of a bool and returning by reference. Ahhh. So much nicer. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::sourceApplicationAuditData const): * Platform/IPC/Connection.h: * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::getAuditToken): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::sourceApplicationAuditData const): 2018-12-21 Jiewen Tan [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky https://bugs.webkit.org/show_bug.cgi?id=192061 Reviewed by Dewei Zhu. Part 5. Add some additional temporary logging info to determine if the time out value passed to the timer is respected. Once the bug is determined and fixed, we should remove all logging added in this patch. Reviewed by Dewei Zhu. * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManager::initTimeOutTimer): (WebKit::AuthenticatorManager::timeOutTimerFired): 2018-12-21 Keith Rollin Crash in com.apple.WebKit: WebKit::WebResourceLoader::willSendRequest + 223 https://bugs.webkit.org/show_bug.cgi?id=192989 Reviewed by Chris Dumez. willSendRequest is calling maybeLoadFallbackForRedirect, which can delete “this”. After that, some new logging code tries to access “this” and causes the crash. Fix this by adjusting the scope of a "protectedThis". * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::willSendRequest): 2018-12-21 Alejandro G. Castro [GTK][WPE] Add DeviceIdHashSaltStorage disk persistence https://bugs.webkit.org/show_bug.cgi?id=190466 Reviewed by Youenn Fablet. Added persistency to the DeviceIdHashSaltStorage. Implemented a decoder and an encoder for the HashSaltForOrigin struct to store it in a file, this allows us to save the lastTimeUsed, the origin and the hash salt. It uses a new directory where it creates a file per hash salt, the name of the file is the hash salt to avoid leaking information in the system. The last time used and the origin are stored inside the file, it also adds a version directory used to change the structure of the file in the future, if we need to do it. In the DeviceIdHashSaltStorage class the disk operations happen in a WorkQueue, but all interactions go in the main thread. We added code to handle the operations when the load still did not finish. * Platform/Logging.h: Added channel DiskPersistency.. * Sources.txt: Added new files. * UIProcess/API/APIProcessPoolConfiguration.cpp: Added code to set the directory for the deviceIdHashSalts. That way we can use the configuration when creating the DeviceIdHashSaltStorage. (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration): (API::ProcessPoolConfiguration::ProcessPoolConfiguration): (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/APIWebsiteDataStore.cpp: (API::WebsiteDataStore::legacyDefaultDataStoreConfiguration): Added code to set the directory in the disk used to store the information. * UIProcess/API/APIWebsiteDataStore.h: Ditto. * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm: Added dummy implementation to get the directory in cocoa. (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): (API::WebsiteDataStore::legacyDefaultDeviceIdHashSaltsStorageDirectory): * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: Defined the default directories used to store the information in the disk. (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): (API::WebsiteDataStore::legacyDefaultDeviceIdHashSaltsStorageDirectory): (API::WebsiteDataStore::defaultDataStoreConfiguration): * UIProcess/API/glib/WebKitWebsiteDataManager.cpp: (webkitWebsiteDataManagerGetDataStore): Added the directory used to store the information. (webkit_website_data_manager_remove): Modified the way we use to make sure when we remove the cookies we also remove the hash salts. * UIProcess/API/win/APIWebsiteDataStoreWin.cpp: Added dummy implementations to get the directory in windows platform. (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): (API::WebsiteDataStore::legacyDefaultDeviceIdHashSaltsStorageDirectory): * UIProcess/API/C/WKBackForwardListItemRef.cpp: Add namespace, it seems some unified build compilation issue. * UIProcess/DeviceIdHashSaltStorage.cpp: (WebKit::DeviceIdHashSaltStorage::create): Added a create method used to pass the directory and the persistency status of the websitedatastore. (WebKit::DeviceIdHashSaltStorage::completeHandler): Added to share the code copying the origins to complete the get handler. (WebKit::DeviceIdHashSaltStorage::completeDeviceIdHashSaltForOriginCall): Added to share the code when completing the task of getting a new hash salt. (WebKit::DeviceIdHashSaltStorage::DeviceIdHashSaltStorage): Added a new constructor for the create method. (WebKit::getSecurityOriginData): Added to get the SecurityOriginData from a field in the decoder and do all the checks. (WebKit::DeviceIdHashSaltStorage::loadStorageFromDisk): Open the directory and restore all the hash salts from disk to the memory structure. (WebKit::DeviceIdHashSaltStorage::createEncoderFromData const): Creates the decoder to store the HashSaltForOrigin structure. (WebKit::DeviceIdHashSaltStorage::storeHashSaltToDisk): Write to disk a decoder object created from a HashSaltForOrigin structure. It uses the writeEncoderToDisk function. (WebKit::DeviceIdHashSaltStorage::deviceIdHashSaltForOrigin): Make sure we store in disk a new hash salt when it is generated and the WebsiteDataStore is persistent. Add a completionHandler to return the value found or generated, this way we can control if the HashMap is already loaded from disk. (WebKit::DeviceIdHashSaltStorage::getDeviceIdHashSaltOrigins): Make sure we run the get in a queue now that we store information in disk. (WebKit::DeviceIdHashSaltStorage::deleteHashSaltFromDiskIfNeeded): Added code to make sure we remove the files in disk. (WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltForOrigins): Added code to use the deleteHashSaltFromDiskIfNeeded and remove the files in disk. (WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltOriginsModifiedSince): Added code to use the deleteHashSaltFromDiskIfNeeded and remove the files in disk. * UIProcess/DeviceIdHashSaltStorage.h: Ditto. * UIProcess/PersistencyUtils.cpp: Added file to share the persistency code with the ResourceLoadStatisticsPersistentStorage class. (WebKit::createDecoderForFile): Ditto. (WebKit::writeEncoderToDisk): Ditto. * UIProcess/PersistencyUtils.h: Ditto. * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp: Use the new PersistencyUtils functions shared with the DeviceIdHashSaltStorage class. (WebKit::ResourceLoadStatisticsPersistentStorage::refreshMemoryStoreFromDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk): (WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk): * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: After changing the API of the deviceIdHashSaltForOrigin we now use a completionHandler because it could happen the HashMap is not still loaded and we would have to wait for it. We refactored the calls to the method to use this new completionHandler. (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::WebsiteDataStore): Create the DeviceIdHashSaltStorage class with the persistency information. (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): Make sure we have the directory to store the information. * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: Add get and set functions for the deviceHashSaltStorageDirectory. * WebKit.xcodeproj/project.pbxproj: Added PersistencyUtils file to the xcode compilation. 2018-12-20 Alex Christensen Remove unused NetworkProcessCreationParameters https://bugs.webkit.org/show_bug.cgi?id=192961 Reviewed by Andy Estes. loadThrottleLatency isn't used since I replaced it with NetworkSessionCreationParameters.loadThrottleLatency in r238654 presentingApplicationPID has no effect because that value is only used in the WebProcess in NetworkExtensionContentFilter::initialize * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): 2018-12-20 Chris Dumez Use Optional::hasValue() instead of Optional::has_value() https://bugs.webkit.org/show_bug.cgi?id=192948 Reviewed by Tim Horton. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::AutomationCommandError::toProtocolString): (WebKit::WebAutomationSession::willClosePage): * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::computeElementLayout): 2018-12-20 Jeremy Jones Flicker when exiting element fullscreen. https://bugs.webkit.org/show_bug.cgi?id=192774 rdar://problem/33088878 Reviewed by Jer Noble. Fixes an issue where the web page would flicker upon exiting element fullscreen. Replace WebView with a snapshot while the WebView is restyled and resized for inline. * UIProcess/mac/WKFullScreenWindowController.h: * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController initWithWindow:webView:page:]): (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]): 2018-12-20 Chris Dumez Move HTTPS_UPGRADE code behind a runtime flag, off by default https://bugs.webkit.org/show_bug.cgi?id=192937 Reviewed by Youenn Fablet. Move HTTPS_UPGRADE code behind a runtime flag, off by default and drop the build time flag. * Configurations/WebKit.xcconfig: * DerivedSources.make: * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp: * NetworkProcess/NetworkHTTPSUpgradeChecker.h: * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::NetworkLoadChecker): (WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded const): (WebKit::NetworkLoadChecker::checkRequest): * NetworkProcess/NetworkLoadChecker.h: * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::networkHTTPSUpgradeChecker): * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/NetworkResourceLoader.cpp: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::PingLoad): * Shared/WebPreferences.yaml: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): * config.h: 2018-12-20 Jiewen Tan [WebAuthN] Add a runtime flag for local authenticator https://bugs.webkit.org/show_bug.cgi?id=192792 Reviewed by Brent Fulgham. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetWebAuthenticationLocalAuthenticatorEnabled): (WKPreferencesGetWebAuthenticationLocalAuthenticatorEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/WebAuthentication/Cocoa/LocalService.mm: (WebKit::LocalService::isAvailable): 2018-12-20 Chris Dumez Use Optional::valueOr() instead of Optional::value_or() https://bugs.webkit.org/show_bug.cgi?id=192933 Reviewed by Geoffrey Garen. * Shared/API/c/WKSecurityOriginRef.cpp: (WKSecurityOriginGetPort): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/WKSecurityOrigin.mm: (-[WKSecurityOrigin port]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration _cpuLimit]): * UIProcess/API/glib/WebKitSecurityOrigin.cpp: (webkit_security_origin_get_port): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseHandleWheelEvent): * UIProcess/Automation/SimulatedInputDispatcher.cpp: (WebKit::SimulatedInputKeyFrame::maximumDuration const): (WebKit::SimulatedInputDispatcher::transitionInputSourceToState): * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext): (WebKit::WebAutomationSession::performInteractionSequence): * UIProcess/Automation/WebAutomationSessionMacros.h: * UIProcess/ServiceWorkerProcessProxy.cpp: (WebKit::ServiceWorkerProcessProxy::start): * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManager::initTimeOutTimer): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::deviceScaleFactor const): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::viewportSizeForCSSViewportUnits const): * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: (WebKit::WebPopupMenuProxyGtk::activateItem): * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::encodeFormDataElement): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::convertFromPDFViewToRootView const): (WebKit::PDFPlugin::boundsOnScreen const): (WebKit::PDFPlugin::geometryDidChange): * WebProcess/WebCoreSupport/SessionStateConversion.cpp: (WebKit::toFormData): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateVisibleContentRects): * WebProcess/WebPage/wpe/CompositingManager.cpp: (WebKit::CompositingManager::releaseConnectionFd): 2018-12-20 Keith Rollin Improve release-level page-load logging https://bugs.webkit.org/show_bug.cgi?id=192872 Reviewed by Chris Dumez. There are a number of reported bugs that are difficult or impossible to track down with our current level of logging. Additionally, some software groups lower in the page-loading stack have requested logging sufficient for tracking a user-visible error message down to the requested resource that caused the message. Add more-comprehensive logging to address these issues/requests. * UIProcess/WebPageProxy.cpp: (WebKit::m_editableImageController): (WebKit::WebPageProxy::~WebPageProxy): (WebKit::WebPageProxy::reattachToWebProcess): (WebKit::WebPageProxy::swapToWebProcess): (WebKit::WebPageProxy::reattachToWebProcessForReload): (WebKit::WebPageProxy::reattachToWebProcessWithItem): (WebKit::WebPageProxy::close): (WebKit::WebPageProxy::tryClose): (WebKit::WebPageProxy::loadRequest): (WebKit::WebPageProxy::loadRequestWithNavigation): (WebKit::WebPageProxy::loadFile): (WebKit::WebPageProxy::loadData): (WebKit::WebPageProxy::loadDataWithNavigation): (WebKit::WebPageProxy::loadAlternateHTML): (WebKit::WebPageProxy::loadWebArchiveData): (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick): (WebKit::WebPageProxy::stopLoading): (WebKit::WebPageProxy::reload): (WebKit::WebPageProxy::goToBackForwardItem): (WebKit::WebPageProxy::tryRestoreScrollPosition): (WebKit::WebPageProxy::updateThrottleState): (WebKit::WebPageProxy::receivedNavigationPolicyDecision): (WebKit::WebPageProxy::continueNavigationInNewProcess): (WebKit::WebPageProxy::restoreFromSessionState): (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame): (WebKit::WebPageProxy::willPerformClientRedirectForFrame): (WebKit::WebPageProxy::didCancelClientRedirectForFrame): (WebKit::WebPageProxy::didFailProvisionalLoadForFrame): (WebKit::WebPageProxy::didCommitLoadForFrame): (WebKit::WebPageProxy::didFinishDocumentLoadForFrame): (WebKit::WebPageProxy::didFinishLoadForFrame): (WebKit::WebPageProxy::didFailLoadForFrame): (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): (WebKit::WebPageProxy::didNavigateWithNavigationData): (WebKit::WebPageProxy::didPerformClientRedirect): (WebKit::WebPageProxy::didPerformServerRedirect): (WebKit::WebPageProxy::processDidBecomeUnresponsive): (WebKit::WebPageProxy::processDidBecomeResponsive): (WebKit::WebPageProxy::processDidTerminate): (WebKit::WebPageProxy::dispatchProcessDidTerminate): (WebKit::WebPageProxy::tryReloadAfterProcessTermination): (WebKit::WebPageProxy::didExceedInactiveMemoryLimitWhileActive): (WebKit::WebPageProxy::didExceedBackgroundCPULimitWhileInForeground): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoad): (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): (WebKit::WebLoaderStrategy::loadResourceSynchronously): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::willSendRequest): (WebKit::WebResourceLoader::didReceiveResponse): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad): (WebKit::WebFrameLoaderClient::dispatchDidFailLoad): 2018-12-20 Wenson Hsieh [iOS] Replace "node assistance" terminology in WebKit with "focused element" https://bugs.webkit.org/show_bug.cgi?id=192936 Reviewed by Tim Horton. Renames a few methods and data structures in WebKit, to refer to "focused elements" rather than "assisted nodes"; see below for more details. No new tests, because there should be no change in behavior. * Shared/FocusedElementInformation.cpp: Renamed from Source/WebKit/Shared/AssistedNodeInformation.cpp. (WebKit::OptionItem::encode const): (WebKit::OptionItem::decode): (WebKit::FocusedElementInformation::encode const): (WebKit::FocusedElementInformation::decode): * Shared/FocusedElementInformation.h: Renamed from Source/WebKit/Shared/AssistedNodeInformation.h. Rename AssistedNodeInformation to FocusedElementInformation. Additionally, introduce a named type for the focusedElementIdentifier (which is currently just a `uint64_t`). (WebKit::OptionItem::OptionItem): * Shared/ios/InteractionInformationAtPosition.h: * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): (WebKit::InteractionInformationAtPosition::decode): * SourcesCocoa.txt: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _shouldUpdateKeyboardWithInfo:]): * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::resetStateAfterProcessExited): * UIProcess/WebPageProxy.h: Rename NodeAssistanceArguments to ElementDidFocusArguments (and also add a FIXME for removing this mechanism eventually). (WebKit::WebPageProxy::focusNextFocusedElement): (WebKit::WebPageProxy::focusNextAssistedNode): Deleted. * UIProcess/WebPageProxy.messages.in: Rename StartAssistingNode to ElementDidFocus, and StopAssistingNode to ElementDidBlur. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::elementDidFocus): (WebKit::PageClientImpl::isFocusingElement): (WebKit::PageClientImpl::elementDidBlur): (WebKit::PageClientImpl::startAssistingNode): Deleted. (WebKit::PageClientImpl::isAssistingNode): Deleted. (WebKit::PageClientImpl::stopAssistingNode): Deleted. * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView isFocusingElement]): (-[WKContentView _didCommitLoadForMainFrame]): (-[WKContentView isAssistingNode]): Deleted. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKFocusedElementInfo initWithFocusedElementInformation:isUserInitiated:userObject:]): (hasFocusedElement): (-[WKContentView cleanupInteraction]): (-[WKContentView shouldHideSelectionWhenScrolling]): (-[WKContentView resignFirstResponderForWebView]): (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]): (-[WKContentView _requiresKeyboardWhenFirstResponder]): (-[WKContentView _zoomToRevealFocusedElement]): (-[WKContentView inputView]): (-[WKContentView _selectionClipRect]): (-[WKContentView gestureRecognizerShouldBegin:]): (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): (-[WKContentView clearSelection]): (-[WKContentView requiresAccessoryView]): (-[WKContentView canPerformActionForWebView:withSender:]): (-[WKContentView _isInteractingWithFocusedElement]): (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]): (-[WKContentView selectPositionAtPoint:completionHandler:]): (-[WKContentView selectPositionAtBoundary:inDirection:fromPoint:completionHandler:]): (-[WKContentView selectTextWithGranularity:atPoint:completionHandler:]): (-[WKContentView updateSelectionWithExtentPoint:completionHandler:]): (-[WKContentView updateSelectionWithExtentPoint:withBoundary:completionHandler:]): (-[WKContentView accessoryTab:]): (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]): (-[WKContentView accessoryClear]): (-[WKContentView _updateAccessory]): (-[WKContentView insertTextSuggestion:]): (-[WKContentView setSelectedTextRange:]): (-[WKContentView textInputTraits]): (-[WKContentView isScrollableForKeyboardScrollViewAnimator:]): (-[WKContentView focusedElementInformation]): (-[WKContentView focusedSelectElementOptions]): (rectToRevealWhenZoomingToFocusedElement): (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): (-[WKContentView _elementDidBlur]): (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]): (-[WKContentView updateCurrentFocusedElementInformation:]): (-[WKContentView presentViewControllerForCurrentFocusedElement]): (-[WKContentView focusedFormControlViewDidSubmit:]): (-[WKContentView focusedFormControlViewDidCancel:]): (-[WKContentView focusedFormControlViewDidBeginEditing:]): (-[WKContentView rectForFocusedFormControlView:]): (-[WKContentView nextRectForFocusedFormControlView:]): (-[WKContentView previousRectForFocusedFormControlView:]): (-[WKContentView actionNameForFocusedFormControlView:]): (-[WKContentView focusedFormControlViewDidRequestNextNode:]): (-[WKContentView focusedFormControlViewDidRequestPreviousNode:]): (-[WKContentView hasNextNodeForFocusedFormControlView:]): (-[WKContentView hasPreviousNodeForFocusedFormControlView:]): (-[WKContentView selectMenu:didSelectItemAtIndex:]): (-[WKContentView numberOfItemsInSelectMenu:]): (-[WKContentView selectMenu:displayTextForItemAtIndex:]): (-[WKContentView selectMenu:didCheckItemAtIndex:checked:]): (-[WKContentView selectMenuUsesMultipleSelection:]): (-[WKContentView selectMenu:hasSelectedOptionAtIndex:]): (-[WKContentView _updateChangedSelection:]): (-[WKContentView _autofillContext]): (-[WKContentView dismissQuickboardViewControllerAndRevealFocusedFormOverlayIfNecessary:]): (-[WKContentView allowsLanguageSelectionMenuForListViewController:]): (-[WKContentView inputLabelTextForViewController:]): (-[WKContentView initialValueForViewController:]): (-[WKContentView shouldDisplayInputContextViewForListViewController:]): (-[WKContentView numericInputModeForListViewController:]): (-[WKContentView textContentTypeForListViewController:]): (-[WKContentView allowsDictationInputForListViewController:]): (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]): Deleted. (hasAssistedNode): Deleted. Replaced with hasFocusedElement. (-[WKContentView _isInteractingWithAssistedNode]): Deleted. (-[WKContentView assistedNodeInformation]): Deleted. (-[WKContentView assistedNodeSelectOptions]): Deleted. (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): Deleted. (-[WKContentView _stopAssistingNode]): Deleted. (-[WKContentView updateCurrentAssistedNodeInformation:]): Deleted. (-[WKContentView presentViewControllerForCurrentAssistedNode]): Deleted. * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm: (-[WKDataListSuggestionsControl textAlignment]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::focusedElementInformationCallback): (WebKit::WebPageProxy::requestFocusedElementInformation): (WebKit::WebPageProxy::computeCustomFixedPositionRect const): (WebKit::WebPageProxy::didCommitLayerTree): (WebKit::WebPageProxy::selectWithGesture): (WebKit::WebPageProxy::selectTextWithGranularityAtPoint): (WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection): (WebKit::WebPageProxy::selectPositionAtPoint): (WebKit::WebPageProxy::updateSelectionWithExtentPoint): (WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary): (WebKit::WebPageProxy::blurFocusedElement): (WebKit::WebPageProxy::elementDidFocus): (WebKit::WebPageProxy::elementDidBlur): (WebKit::WebPageProxy::focusNextFocusedElement): (WebKit::WebPageProxy::setFocusedElementValue): (WebKit::WebPageProxy::setFocusedElementValueAsNumber): (WebKit::WebPageProxy::setFocusedElementSelectedIndex): (WebKit::WebPageProxy::assistedNodeInformationCallback): Deleted. (WebKit::WebPageProxy::requestAssistedNodeInformation): Deleted. (WebKit::WebPageProxy::blurAssistedNode): Deleted. (WebKit::WebPageProxy::startAssistingNode): Deleted. (WebKit::WebPageProxy::stopAssistingNode): Deleted. (WebKit::WebPageProxy::focusNextAssistedNode): Deleted. (WebKit::WebPageProxy::setAssistedNodeValue): Deleted. (WebKit::WebPageProxy::setAssistedNodeValueAsNumber): Deleted. (WebKit::WebPageProxy::setAssistedNodeSelectedIndex): Deleted. * UIProcess/ios/forms/WKFormColorPicker.mm: (-[WKColorPicker initWithView:]): (-[WKColorPicker setControlValueFromUIColor:]): * UIProcess/ios/forms/WKFormInputControl.mm: (-[WKDateTimePicker initWithView:datePickerMode:]): (-[WKDateTimePicker shouldPresentGregorianCalendar:]): (-[WKDateTimePicker _dateChangedSetAsNumber]): (-[WKDateTimePicker _dateChangedSetAsString]): (-[WKDateTimePicker controlBeginEditing]): (-[WKFormInputControl initWithView:]): (-[WKDateTimePopover clear:]): (-[WKDateTimePopover initWithView:datePickerMode:]): * UIProcess/ios/forms/WKFormPopover.mm: (-[WKRotatingPopover presentPopoverAnimated:]): * UIProcess/ios/forms/WKFormSelectControl.h: * UIProcess/ios/forms/WKFormSelectControl.mm: (-[WKFormSelectControl initWithView:]): * UIProcess/ios/forms/WKFormSelectPicker.mm: (-[WKMultipleSelectPicker initWithView:]): (-[WKMultipleSelectPicker pickerView:viewForRow:forComponent:reusingView:]): (-[WKMultipleSelectPicker pickerView:numberOfRowsInComponent:]): (-[WKMultipleSelectPicker findItemIndexAt:]): (-[WKMultipleSelectPicker pickerView:row:column:checked:]): (-[WKSelectSinglePicker initWithView:]): (-[WKSelectSinglePicker controlEndEditing]): (-[WKSelectSinglePicker pickerView:numberOfRowsInComponent:]): (-[WKSelectSinglePicker pickerView:attributedTitleForRow:forComponent:]): (-[WKSelectSinglePicker pickerView:didSelectRow:inComponent:]): * UIProcess/ios/forms/WKFormSelectPopover.mm: (-[WKSelectTableViewController initWithView:hasGroups:]): (-[WKSelectTableViewController tableView:numberOfRowsInSection:]): (-[WKSelectTableViewController tableView:titleForHeaderInSection:]): (-[WKSelectTableViewController findItemIndexAt:]): (-[WKSelectTableViewController findItemAt:]): (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]): (-[WKSelectTableViewController tableView:didSelectRowAtIndexPath:]): (-[WKSelectPopover initWithView:hasGroups:]): * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::elementDidFocus): (WebKit::WebChromeClient::elementDidRefocus): (WebKit::WebChromeClient::elementDidBlur): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didStartPageTransition): (WebKit::WebPage::setTextAsync): (WebKit::WebPage::resetFocusedElementForFrame): (WebKit::WebPage::elementDidRefocus): (WebKit::WebPage::elementDidFocus): (WebKit::WebPage::elementDidBlur): (WebKit::WebPage::didCommitLoad): (WebKit::WebPage::resetAssistedNodeForFrame): Deleted. * WebProcess/WebPage/WebPage.h: Refactor elementDid{Refocus|Focus|Blur} to take `Element&` rather than `Node*`. * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: Replace m_assistedNode (a `RefPtr`) with m_focusedElement (a `RefPtr`). (WebKit::WebPage::platformEditorState const): (WebKit::WebPage::completeSyntheticClick): (WebKit::WebPage::requestFocusedElementInformation): (WebKit::WebPage::blurFocusedElement): (WebKit::WebPage::setFocusedElementValue): (WebKit::WebPage::setFocusedElementValueAsNumber): (WebKit::WebPage::setFocusedElementSelectedIndex): (WebKit::innerFrameQuad): (WebKit::constrainPoint): (WebKit::WebPage::selectWithGesture): (WebKit::WebPage::startAutoscrollAtPosition): (WebKit::WebPage::visiblePositionInFocusedNodeForPoint): (WebKit::WebPage::selectPositionAtPoint): (WebKit::WebPage::selectPositionAtBoundaryWithDirection): (WebKit::WebPage::rangeForGranularityAtPoint): (WebKit::WebPage::selectTextWithGranularityAtPoint): (WebKit::WebPage::updateSelectionWithExtentPointAndBoundary): (WebKit::WebPage::updateSelectionWithExtentPoint): (WebKit::WebPage::getPositionInformation): (WebKit::WebPage::focusNextFocusedElement): (WebKit::WebPage::getFocusedElementInformation): (WebKit::WebPage::autofillLoginCredentials): (WebKit::WebPage::requestAssistedNodeInformation): Deleted. (WebKit::WebPage::blurAssistedNode): Deleted. (WebKit::WebPage::setAssistedNodeValue): Deleted. (WebKit::WebPage::setAssistedNodeValueAsNumber): Deleted. (WebKit::WebPage::setAssistedNodeSelectedIndex): Deleted. (WebKit::WebPage::focusNextAssistedNode): Deleted. (WebKit::WebPage::getAssistedNodeInformation): Deleted. 2018-12-20 Brent Fulgham WKWebView default UA doesn't freeze the build number https://bugs.webkit.org/show_bug.cgi?id=192809 Reviewed by Andy Estes. Always reports the frozen build number. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (defaultApplicationNameForUserAgent): Do not expose the actual build number through this API. 2018-12-20 Jer Noble Enable MediaCapabilities by default. https://bugs.webkit.org/show_bug.cgi?id=192340 Reviewed by Dean Jackson. * Shared/WebPreferences.yaml: 2018-12-20 Carlos Garcia Campos [GTK] WebDriver: tests in imported/w3c/webdriver/tests/element_clear/user_prompts.py are failing https://bugs.webkit.org/show_bug.cgi?id=192927 Reviewed by Michael Catanzaro. Give the focus back to the web view when a dialog is dismissed. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseContainerRemove): 2018-12-20 Tim Horton Unparented WKWebView can't retrieve main resource data for a main frame plugin https://bugs.webkit.org/show_bug.cgi?id=192923 Reviewed by Wenson Hsieh. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::liveResourceData const): If the WKWebView is unparented, we may not immediately initialize the plugin. In that case, PluginView holds on to the backing data until the plugin is initialized. If a WKWebView API client asks for the backing data for the plugin during this time, we should return it, instead of bailing. 2018-12-20 Wenson Hsieh [iOS] Focusing an editable element should scroll to reveal the selection https://bugs.webkit.org/show_bug.cgi?id=192802 Reviewed by Tim Horton. Currently, when tapping on an editable element, logic in -[WKWebView _zoomToFocusRect:…:] attempts to adjust the visible viewport such that the rect containing the selection is visible. However, AssistedNodeInformation's selectionRect is used here, which (as the FIXME in WebPage::getAssistedNodeInformation notes) is either the last touch location, or the top left of the element if the touch location is outside of the element's bounding rect. This leads to confusing and undesirable behavior when tapping near the bottom of a large contenteditable element to focus it, since the actual selection will end up near the top of the element, yet we'll try to scroll to reveal the bottom of the element, which causes the visible selection to scroll offscreen. Notably, this affects scenarios involving editable web views embedded in apps, such as Mail compose. Right now, we use the last touch location as an approximation for the selection rect because the selection may have not yet been updated at the moment when focus moves into an editable element. To fix this, we defer the process of zooming to the focused element rect until after the selection changes and the UI process is updated with information about the new selection rects. Test: editing/selection/ios/selection-is-visible-after-focusing-editable-area.html * Shared/AssistedNodeInformation.cpp: (WebKit::AssistedNodeInformation::encode const): (WebKit::AssistedNodeInformation::decode): * Shared/AssistedNodeInformation.h: Rename selectionRect to elementInteractionLocation, to more accurately reflect its value and purpose. This isn't strictly always the last touch location, since we may default to the focused element location instead if the last touch location is outside of the element rect. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Tweak a constant that determines the minimum amount of margin to leave between the selection rect and the edge of the window when scrolling to reveal the focused element. Previously, this was larger than necessary to accomodate for the fact that the "selection rect" used when zooming to the focused element did not take the actual selection into account at all, and was simply a 1 by 1 rect; this meant that the margin needed to be large enough to exceed the usual height of a text caret in editable content. Since we now use the real selection rect, we can be much less generous with this margin. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): (-[WKContentView observeValueForKeyPath:ofObject:change:context:]): Don't additionally update the selection in the middle of triggering zooming to the focused element; on particular versions of iOS, this now attempts to scroll the selection rect on-screen, which then conflicts with zooming to reveal the focused element. (-[WKContentView _zoomToRevealFocusedElement]): Renamed from _displayFormNodeInputView to _zoomToRevealFocusedElement, to make the purpose of this function more clear. Additionally, pull logic to update the accessory view out of this method, so that it's strictly concerned with zooming to the focused element. (-[WKContentView inputView]): Add a FIXME describing the implications of zooming to the focused element in the implementation of -inputView. See also: . (-[WKContentView accessoryTab:]): Fix a subtle issue when keeping track of _didAccessoryTabInitiateFocus. Currently, this is set to YES in -accessoryTab: and unset in _displayFormNodeInputView, but since _displayFormNodeInputView may be invoked multiple times for the same focused element (see: -inputView), we might end up zooming to the focused element with _didAccessoryTabInitiateFocus set to NO, even though we initiated focus with the previous/next buttons. Instead, temporarily set a different ivar, _isChangingFocusUsingAccessoryTab, to YES in -accessoryTab:, and unset it in the completion handler after the focused element has changed. Then, when we _startAssistingNode:, set _didAccessoryTabInitiateFocus to _isChangingFocusUsingAccessoryTab. This ensures that the correctness of _didAccessoryTabInitiateFocus isn't tied to the number of times -[WKContentView inputView] is invoked when focusing an element. (shouldZoomToRevealSelectionRect): (rectToRevealWhenZoomingToFocusedElement): Add a helper method to determine the selection rect to use when zooming to reveal the focused element. ASSERTs that we have post-layout data in the EditorState. (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): When "assisting" a focused element, immediately zoom to it if we don't need selection information to compute the rect to zoom to; otherwise, defer zooming until we receive the first editor state update in the UI process that contains information about our selection rects. (-[WKContentView _stopAssistingNode]): (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]): If necessary, reveal the focused element by zooming. (-[WKContentView _updateInitialWritingDirectionIfNecessary]): Pull this initial writing direction update logic out into a separate helper method. (-[WKContentView _displayFormNodeInputView]): Deleted. Replaced by _zoomToRevealFocusedElement. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::elementDidRefocus): This currently calls WebChromeClient::elementDidFocus; instead, call the new WebPage::elementDidRefocus; additionally, make this available on all PLATFORM(COCOA), rather than just IOS_FAMILY. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: (WebKit::WebChromeClient::elementDidRefocus): Deleted. Replaced by the PLATFORM(COCOA) version. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::elementDidRefocus): When refocusing an element, ensure that post-layout editor state data is sent to the UI process by including a full EditorState in the next layer tree transaction. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::completeSyntheticClick): Call elementDidRefocus instead of elementDidFocus, in the case where the existing focused element is clicked. (WebKit::WebPage::getAssistedNodeInformation): Adjust for the change from selectionRect to elementInteractionLocation. 2018-12-20 Patrick Griffis [GTK][WPE] Grant the sandbox read access to XDG_DATA_HOME/prgname https://bugs.webkit.org/show_bug.cgi?id=192929 Reviewed by Michael Catanzaro. * UIProcess/API/glib/WebKitWebContext.cpp: * UIProcess/Launcher/glib/BubblewrapLauncher.cpp: (WebKit::bubblewrapSpawn): 2018-12-20 Chris Dumez [PSON] SuspendedPageProxy fails to release its process assertion if the WebPage fails to enter PageCache https://bugs.webkit.org/show_bug.cgi?id=192873 Reviewed by Antti Koivisto. SuspendedPageProxy fails to release its process assertion if the WebPage fails to enter PageCache, preventing the process from suspending on iOS. * UIProcess/SuspendedPageProxy.cpp: (WebKit::SuspendedPageProxy::didProcessRequestToSuspend): (WebKit::SuspendedPageProxy::didReceiveMessage): (WebKit::SuspendedPageProxy::didSuspend): Deleted. (WebKit::SuspendedPageProxy::didFailToSuspend): Deleted. * UIProcess/SuspendedPageProxy.h: 2018-12-19 Chris Dumez wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from https://bugs.webkit.org/show_bug.cgi?id=192728 Reviewed by Geoff Garen. * NetworkProcess/*: * Platform/*: * Scripts/*: * Shared/*: * UIProcess/*: * WebProcess/*: 2018-12-19 Michael Catanzaro Unreviewed, silence -Wpragmas warning * WebProcess/WebCoreSupport/WebAlternativeTextClient.h: 2018-12-19 Vivek Seth HTTPS Upgrade: Use full sqlite upgrade list https://bugs.webkit.org/show_bug.cgi?id=192736 Reviewed by Chris Dumez. * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp: Added. (WebKit::NetworkHTTPSUpgradeCheckerDatabasePath): (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker): (WebKit::NetworkHTTPSUpgradeChecker::~NetworkHTTPSUpgradeChecker): (WebKit::NetworkHTTPSUpgradeChecker::query): (WebKit::NetworkHTTPSUpgradeChecker::isAlwaysOnLoggingAllowed const): * NetworkProcess/NetworkHTTPSUpgradeChecker.h: Added. (WebKit::NetworkHTTPSUpgradeChecker::didSetupCompleteSuccessfully const): * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded const): (WebKit::NetworkLoadChecker::checkRequest): * NetworkProcess/NetworkLoadChecker.h: * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::networkHTTPSUpgradeChecker): * Sources.txt: * WebKit.xcodeproj/project.pbxproj: 2018-12-19 Tim Horton Use delegate instead of drawingDelegate in WKDrawingView https://bugs.webkit.org/show_bug.cgi?id=192899 Reviewed by Wenson Hsieh. * UIProcess/ios/WKDrawingView.mm: (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]): Do the dance. 2018-12-19 Alex Christensen Navigations away from the SafeBrowsing interstitial show a flash of old content https://bugs.webkit.org/show_bug.cgi?id=192676 Reviewed by Chris Dumez. When a user clicks through a safe browsing warning, do not remove the warning until content is drawn for the destination. Otherwise, the user will confusingly see the page before the warning while the navigation happens. We can only do this for warnings caused by main frame navigations, though. Other warnings (such as those caused by iframes) need to be cleared immediately, and we still need to clear the warning immediately if the user has said to go back. This change is reflected in an updated API test. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _showSafeBrowsingWarning:completionHandler:]): * UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm: (WebKit::SafeBrowsingWarning::SafeBrowsingWarning): * UIProcess/Cocoa/WKSafeBrowsingWarning.h: * UIProcess/Cocoa/WKSafeBrowsingWarning.mm: (-[WKSafeBrowsingWarning forMainFrameNavigation]): * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::beginSafeBrowsingCheck): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::showSafeBrowsingWarning): (WebKit::WebViewImpl::clearSafeBrowsingWarningIfForMainFrameNavigation): * UIProcess/PageClient.h: (WebKit::PageClient::clearSafeBrowsingWarningIfForMainFrameNavigation): * UIProcess/SafeBrowsingWarning.h: (WebKit::SafeBrowsingWarning::create): (WebKit::SafeBrowsingWarning::forMainFrameNavigation const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didReachLayoutMilestone): (WebKit::WebPageProxy::beginSafeBrowsingCheck): (WebKit::WebPageProxy::decidePolicyForNavigationAction): * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::clearSafeBrowsingWarningIfForMainFrameNavigation): 2018-12-19 Tim Horton UI process crash when focusing an editable image https://bugs.webkit.org/show_bug.cgi?id=192839 Reviewed by Wenson Hsieh. * SourcesCocoa.txt: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _requiresKeyboardWhenFirstResponder]): (-[WKContentView inputView]): (-[WKContentView requiresAccessoryView]): (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): (-[WKContentView _stopAssistingNode]): (-[WKContentView _installInkPickerForDrawingViewWithID:]): (-[WKContentView _uninstallInkPicker]): * UIProcess/ios/WKInkPickerView.h: Renamed from Source/WebKit/UIProcess/ios/WKInkPickerControl.h. * UIProcess/ios/WKInkPickerView.mm: Renamed from Source/WebKit/UIProcess/ios/WKInkPickerControl.mm. (-[WKInkPickerView initWithDrawingView:]): (-[WKInkPickerView didPickInk]): (-[WKInkPickerView inlineInkPickerDidToggleRuler:]): (-[WKInkPickerView inlineInkPicker:didSelectTool:]): (-[WKInkPickerView inlineInkPicker:didSelectColor:]): (-[WKInkPickerView inkPickerSize]): (-[WKInkPickerView layoutSubviews]): (-[WKInkPickerView sizeThatFits:]): (-[WKInkPickerView viewControllerForPopoverPresentationFromInlineInkPicker:]): * WebKit.xcodeproj/project.pbxproj: Make WKInkPickerView a WKWebView subview instead of an inputView. Also, don't force the keyboard to be visible when an editable image is focused. 2018-12-19 Eric Carlson [MediaStream] Force system camera/microphone TCC prompt if necessary https://bugs.webkit.org/show_bug.cgi?id=192820 Reviewed by Jer Noble. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Enable TCC check and prompt on Mojave. 2018-12-19 Megan Gardner Allow clients to set the navigator platform https://bugs.webkit.org/show_bug.cgi?id=192735 Reviewed by Tim Horton. Add private API to allow clients to override the default navigator platform. Some websites check for the platform, which interfears with our request desktop site feature. This should help more sites function as expected. * Shared/WebsitePoliciesData.cpp: (WebKit::WebsitePoliciesData::encode const): (WebKit::WebsitePoliciesData::decode): (WebKit::WebsitePoliciesData::applyToDocumentLoader): * Shared/WebsitePoliciesData.h: * UIProcess/API/APIWebsitePolicies.cpp: (API::WebsitePolicies::data): * UIProcess/API/APIWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies setCustomNavigatorPlatform:]): (-[_WKWebsitePolicies customNavigatorPlatform]): * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): 2018-12-19 Truitt Savell Unreviewed, rolling out r239358. Revision caused imported/w3c/web-platform-tests/IndexedDB/ to crash on Debug bots Reverted changeset: "Clean up IndexedDB files between tests" https://bugs.webkit.org/show_bug.cgi?id=192796 https://trac.webkit.org/changeset/239358 2018-12-18 Alex Christensen REGRESSION(r239134) iOS safe browsing warning unable to show details https://bugs.webkit.org/show_bug.cgi?id=192837 Reviewed by Tim Horton. * UIProcess/Cocoa/WKSafeBrowsingWarning.mm: (-[WKSafeBrowsingWarning addContent]): I had a fragile design that relied on the internal view heirarchy structure of UIScrollView, which I changed in r239134 by introducing a layout which changed where its scrollbars were in the view heirarchy. I now have a more robust design that saves a WeakObjCPtr to the view I need to traverse to. Testing is problematic because this had to do with scrollbars and UIScrollView internals which seem to behave differently in TestWebKitAPI, but I verified manually that this fixes the issue. 2018-12-18 Fujii Hironori [Win][Clang] Fix compilation warnings under Source/WebKit directory https://bugs.webkit.org/show_bug.cgi?id=192695 Reviewed by Alex Christensen. * NetworkProcess/cache/NetworkCacheData.cpp: (makeSalt): Enclosed by #if !OS(WINDOWS). * NetworkProcess/cache/NetworkCacheFileSystem.cpp: (WebKit::NetworkCache::directoryEntryType): Ditto. * Platform/win/ModuleWin.cpp: (WebKit::Module::platformFunctionPointer const): Cast a function pointer with reinterpret_cast(). * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::DrawingMonitor::DrawingMonitor): Moved the initializer of m_webPage in order to be encluded by #if PLATFORM(GTK). * UIProcess/DrawingAreaProxyImpl.h: Ditto. * UIProcess/Launcher/win/ProcessLauncherWin.cpp: (WebKit::processName): Removed the duplicated 'const' type qualifier. * UIProcess/win/WebInspectorProxyWin.cpp: (WebKit::WebInspectorProxy::platformAttach): Removed an unused variable. (WebKit::WebInspectorProxy::platformDetach): Ditto. * UIProcess/win/WebPopupMenuProxyWin.cpp: Ditto. * UIProcess/win/WebView.cpp: (WebKit::WebView::paint): Ditto. (WebKit::WebPopupMenu::setUpPlatformData): Ditto. * UIProcess/win/WebPopupMenuProxyWin.h: Marked override methods with 'override'. * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.h: Ditto. * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp: Removed an unused variable. 2018-12-18 Wenson Hsieh [macOS] fast/forms/datalist/datalist-textinput-suggestions-order.html sometimes crashes after r239337 https://bugs.webkit.org/show_bug.cgi?id=192836 Reviewed by Tim Horton. r239337 exposed a subtle issue in the implementation of `-[WKDataListSuggestionsView updateWithInformation:]`, wherein we might end up recomputing information for table view cells at rows that no longer exist. This currently happens because we first set the datalist's `_suggestions`, then change the table view's frame, and then finally reload the table view; however, in the case where the number of suggestions decreased and the frame changed (which prompts AppKit to ask us again for table cell views), we'll attempt to access an out-of-bounds index in the `_suggestions` vector. To address this, we change our suggestions and immediately reload the table view before updating `NSTableView`'s frame, so that we only provide table view cells for rows that actually correspond to items in `_suggestions`. * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm: (-[WKDataListSuggestionsView updateWithInformation:]): 2018-12-18 Jiewen Tan [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky https://bugs.webkit.org/show_bug.cgi?id=192061 Reviewed by Dewei Zhu. Part 4. Add some additional temporary logging info to determine if the time out value passed to the timer is right. Once the bug is determined and fixed, we should remove all logging added in this patch. * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManager::initTimeOutTimer): 2018-12-18 Sihui Liu Clean up IndexedDB files between tests https://bugs.webkit.org/show_bug.cgi?id=192796 Reviewed by Geoffrey Garen. * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreRemoveAllIndexedDatabasesSync): * UIProcess/API/C/WKWebsiteDataStoreRef.h: 2018-12-18 Vivek Seth HTTPS Upgrade: Scripts / preprocessing necessary to create new database in future https://bugs.webkit.org/show_bug.cgi?id=192612 Reviewed by Andy Estes. * Configurations/WebKit.xcconfig: * DerivedSources.make: * Scripts/generate-https-upgrade-database.sh: Added. * WebKit.xcodeproj/project.pbxproj: 2018-12-18 Wenson Hsieh Unreviewed, fix the 32-bit watchOS build after r239314 * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): 2018-12-18 Alex Christensen WKWebView has old URL while displaying SafeBrowsing interstitial, for link-click navigations https://bugs.webkit.org/show_bug.cgi?id=192675 Reviewed by Geoffrey Garen. When a safe browsing warning is being shown, WKWebView.URL should be the unsafe website, not the safe website before it. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]): (-[WKWebView _showSafeBrowsingWarningWithURL:title:warning:details:completionHandler:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm: (WebKit::SafeBrowsingWarning::SafeBrowsingWarning): * UIProcess/SafeBrowsingWarning.h: (WebKit::SafeBrowsingWarning::create): (WebKit::SafeBrowsingWarning::url const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationAction): 2018-12-18 Chris Dumez Regression(r239182) SuspendedPage's process reuse for link navigation optimization sometimes broken https://bugs.webkit.org/show_bug.cgi?id=192772 Reviewed by Antti Koivisto. With r239182, if the page in the previous process would fail to enter PageCache, we would destroy the corresponding SuspendedPageProxy, which would potentially terminate the process. This would regress performance when trying to navigate back in history to that page. This would also regress performance when link-navigating to the same domain as we would have previously reused the suspended page's process for such navigation. Address the issue by keeping the SuspendedPageProxy alive even if the WebPage fails to suspend. When trying to reuse a SuspendedPageProxy, if the page failed to suspend, reuse its process but not the suspended page itself. * UIProcess/SuspendedPageProxy.cpp: (WebKit::SuspendedPageProxy::~SuspendedPageProxy): (WebKit::SuspendedPageProxy::waitUntilReadyToUnsuspend): (WebKit::SuspendedPageProxy::unsuspend): (WebKit::SuspendedPageProxy::didSuspend): (WebKit::SuspendedPageProxy::didFailToSuspend): (WebKit::SuspendedPageProxy::loggingString const): * UIProcess/SuspendedPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::swapToWebProcess): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigationInternal): 2018-12-17 Jiewen Tan [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky https://bugs.webkit.org/show_bug.cgi?id=192061 Reviewed by Dewei Zhu. Part 3. Add some additional temporary logging info to determine if the timer is working as expected. Once the bug is determined and fixed, we should remove all logging added in this patch. * UIProcess/WebAuthentication/AuthenticatorManager.cpp: (WebKit::AuthenticatorManager::respondReceived): (WebKit::AuthenticatorManager::initTimeOutTimer): (WebKit::AuthenticatorManager::timeOutTimerFired): * UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp: (WebKit::MockAuthenticatorManager::respondReceivedInternal): 2018-12-17 Saam barati Enable HTTP and HTTPS proxies on iOS and make it a property of the NSURLSession https://bugs.webkit.org/show_bug.cgi?id=192374 Reviewed by Alex Christensen. This patch makes it so that we can use HTTP/HTTPS proxies on iOS as well. To enable on iOS, you can do something like: $ defaults write -g WebKit2HTTPProxy -string "http://localhost:8080" $ defaults write -g WebKit2HTTPSProxy -string "http://localhost:8080" This patch also changes the Proxy to be enabled on a per NSURLSession basis instead of a per process basis. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/NetworkSessionCreationParameters.cpp: (WebKit::NetworkSessionCreationParameters::privateSessionParameters): (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/NetworkSessionCreationParameters.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::proxyDictionary): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * NetworkProcess/mac/NetworkProcessMac.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcess): (WebKit::overrideSystemProxies): Deleted. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _initWithConfiguration:]): * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration httpProxy]): (-[_WKWebsiteDataStoreConfiguration setHTTPProxy:]): (-[_WKWebsiteDataStoreConfiguration httpsProxy]): (-[_WKWebsiteDataStoreConfiguration setHTTPSProxy:]): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::copy): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: (WebKit::WebsiteDataStoreConfiguration::httpProxy const): (WebKit::WebsiteDataStoreConfiguration::setHTTPProxy): (WebKit::WebsiteDataStoreConfiguration::httpsProxy const): (WebKit::WebsiteDataStoreConfiguration::setHTTPSProxy): 2018-12-17 Wenson Hsieh Tap highlights should not be shown on iOSMac https://bugs.webkit.org/show_bug.cgi?id=192797 Reviewed by Tim Horton. WKWebViews in iOSMac should avoid painting tap highlights, since tap highlights are not present in the rest of the macOS platform. Simply disable this functionality by bailing in `-[WKContentView _showTapHighlight]`. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _showTapHighlight]): 2018-12-17 Wenson Hsieh Unreviewed, fix the iOSMac engineering build again After r239311, `WebProcessProxy::fullKeyboardAccessEnabled` in `WebProcessProxyIOS.mm` attempts to use `WKFullKeyboardAccessWatcher`, which is guarded by `ENABLE(FULL_KEYBOARD_ACCESS)`. However, on iOSMac, `ENABLE(FULL_KEYBOARD_ACCESS)` is 0. Fix the build by putting access to `WKFullKeyboardAccessWatcher` behind `ENABLE(FULL_KEYBOARD_ACCESS)`. * UIProcess/ios/WebProcessProxyIOS.mm: (WebKit::WebProcessProxy::fullKeyboardAccessEnabled): 2018-12-17 Wenson Hsieh Unreviewed, fix the iOSMac engineering build `generateRequestID()` is only invoked from code under `ENABLE(MEDIA_STREAM)`; move it under this guard to avoid an unused function warning. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: 2018-12-17 David Kilzer clang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit() Reviewed by Daniel Bates. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::updateCPUMonitorState): - Pass m_cpuLimit directly since getting its value causes an identical std::optional to be created unnecessarily. 2018-12-17 Wenson Hsieh [iOS] Focusing a large editable element always scrolls to the top of the element https://bugs.webkit.org/show_bug.cgi?id=192745 Reviewed by Tim Horton. Currently, when focusing form controls or editable elements, we try to scroll such that the focused element rect is centered within the visible area. In the case of very large focusable elements whose dimensions exceed the width or height of the visible area, we instead scroll such that the top left point of the element is at the top left corner of the visible area. However, this results in unnecessary scrolling if the top of the element is already near the top of the visible area. For WebKit2-based rich text editors that have an editable body element with a top content inset that contains additional content, this means we will always scroll the additional content away when focusing the editable body. To avoid this behavior, adjust focused element zooming logic for editable elements that are too large to be centered in the visible area, such that we only scroll the top left position of the focused element to the top half or top right of the visible area, respectively. This reduces the amount of scrolling when focusing large editable elements, while still making it clear which element is being focused. * Platform/spi/ios/UIKitSPI.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Make some small adjustments to improve the readability of this method by using `clampTo` instead of clamping values by comparing and setting values. Also, fix an existing bug wherein focusable elements that are meant to be centered within the visible area are currently offset by half the difference between the bottom inset amount and the top inset amount, in the case where the `_obscuredInsets` SPI is used to specify content insets for the web view (i.e., MobileSafari). * UIProcess/API/Cocoa/WKWebViewInternal.h: Make a couple of arguments `const FloatRect&` instead of just `FloatRect`. 2018-12-17 Ryosuke Niwa offsetLeft and offsetParent should adjust across shadow boundaries https://bugs.webkit.org/show_bug.cgi?id=157437 Reviewed by Simon Fraser. Use *forBindings variants of offsetLeft, offsetTop, and offsetParent. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementGtk.cpp: (webkit_dom_element_get_offset_left): (webkit_dom_element_get_offset_top): (webkit_dom_element_get_offset_parent): 2018-12-17 Chris Fleizach Some builds are broken after r239262 https://bugs.webkit.org/show_bug.cgi?id=192777 Reviewed by Simon Fraser. * Platform/spi/ios/AccessibilitySupportSPI.h: * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.h: * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm: (platformIsFullKeyboardAccessEnabled): (-[WKFullKeyboardAccessWatcher init]): Fix the build by being more clear about when it's OK to use AccessibilitySupport. 2018-12-17 Chris Dumez Allow passing nil as session state to [WKWebView _restoreSessionState:] https://bugs.webkit.org/show_bug.cgi?id=192789 Reviewed by Alex Christensen. Allow passing nil as session state to [WKWebView _restoreSessionState:] instead of crashing. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _restoreSessionState:andNavigate:]): 2018-12-17 Alex Christensen Fix occasional null-dereference crash in WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame https://bugs.webkit.org/show_bug.cgi?id=192744 Reviewed by Chris Dumez. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame): Things happen. Navigations can be null. If they are, we shouldn't dereference pointers to them. 2018-12-17 Chris Dumez Unreviewed, revert recent CrashReporterClient build fixes as they are no longer needed. * Platform/cocoa/WKCrashReporter.mm: 2018-12-17 Suresh Koppisetty Rollout r235411 https://bugs.webkit.org/show_bug.cgi?id=192778 Disabling access to CoreServices is causing a performance regression in process launch time. See Reviewed by Alex Christensen. * WebProcess/com.apple.WebProcess.sb.in: 2018-12-17 Zan Dobersek Unreviewed WPE build fix after r239277. * UIProcess/API/C/WKContext.cpp: (WKContextClearCurrentModifierStateForTesting): Use the WebKit:: namespace specifier as it is used across this file. 2018-12-17 Commit Queue Unreviewed, rolling out r239265 and r239274. https://bugs.webkit.org/show_bug.cgi?id=192765 unorm_normalize is deprecated, and broke an internal build (Requested by Truitt on #webkit). Reverted changesets: "[GTK][WPE] Need a function to convert internal URI to display ("pretty") URI" https://bugs.webkit.org/show_bug.cgi?id=174816 https://trac.webkit.org/changeset/239265 "Fix the Apple Internal Mac build with a newer SDK" https://trac.webkit.org/changeset/239274 2018-12-17 Daniel Bates Implement UIScriptController::toggleCapsLock() for iOS https://bugs.webkit.org/show_bug.cgi?id=191815 Reviewed by Andy Estes. Add test infrastructure to clear the current modifier state. We will use this to ensure that the caps lock state does not persist between tests. * UIProcess/API/C/WKContext.cpp: (WKContextClearCurrentModifierStateForTesting): Added. * UIProcess/API/C/WKContextPrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::clearCurrentModifierStateForTesting): Added. * UIProcess/WebProcessPool.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::clearCurrentModifierStateForTesting): Added. * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2018-12-17 David Kilzer REGRESSION (r239262): Fix broken builds prior to Mojave * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm: Wrap header in ENABLE(ACCESSIBILITY_EVENTS) to fix the build. 2018-12-17 Daniel Bates [iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:] https://bugs.webkit.org/show_bug.cgi?id=192633 Reviewed by Wenson Hsieh. Update code to use the modern initializer. * UIProcess/ios/WKWebEvent.mm: (-[WKWebEvent initWithEvent:]): 2018-12-17 Matt Lewis Unreviewed, rolling out r239254. This broke the Windows 10 Debug build Reverted changeset: "Replace many uses of String::format with more type-safe alternatives" https://bugs.webkit.org/show_bug.cgi?id=192742 https://trac.webkit.org/changeset/239254 2018-12-17 David Kilzer clang-tidy: loop variable is copied but only used as const reference in WebCore, WebKit, Tools Reviewed by Daniel Bates. Change loop variables to const references to avoid unnecessary copies. * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: (WebKit::WebSWServerConnection::~WebSWServerConnection): * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::encode const): * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toNSErrors): * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::setFilesToSelectForFileUpload): (WebKit::WebAutomationSession::performKeyboardInteractions): (WebKit::WebAutomationSession::performInteractionSequence): * UIProcess/Plugins/PluginProcessManager.cpp: (WebKit::PluginProcessManager::getPluginProcess): * UIProcess/ResourceLoadStatisticsMemoryStore.cpp: (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords): (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveDataRecords const): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::serializedAttachmentDataForIdentifiers): * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp: (WebKit::LocalStorageDatabaseTracker::deleteAllDatabases): (WebKit::LocalStorageDatabaseTracker::origins const): (WebKit::LocalStorageDatabaseTracker::originDetails): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_shouldAttachDrawingAreaOnPageTransition): * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired): 2018-12-17 Ms2ger [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI https://bugs.webkit.org/show_bug.cgi?id=174816 Reviewed by Michael Catanzaro. Add webkit_uri_for_display for GTK and WPE. * PlatformGTK.cmake: * PlatformWPE.cmake: * SourcesGTK.txt: * SourcesWPE.txt: * UIProcess/API/glib/WebKitURIUtilities.cpp: Added. (webkit_uri_for_display): * UIProcess/API/gtk/WebKitURIUtilities.h: Added. * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: * UIProcess/API/gtk/webkit2.h: * UIProcess/API/wpe/WebKitURIUtilities.h: Added. * UIProcess/API/wpe/docs/wpe-0.1-sections.txt: * UIProcess/API/wpe/docs/wpe-docs.sgml: * UIProcess/API/wpe/webkit.h: 2018-12-17 Carlos Garcia Campos [WPE] Add API to notify about frame displayed view backend callback https://bugs.webkit.org/show_bug.cgi?id=192224 Reviewed by Michael Catanzaro. Add API to add a callback to the view to be called when the view backend notifies that a frame has been displayed. * UIProcess/API/glib/WebKitWebView.cpp: (FrameDisplayedCallback::FrameDisplayedCallback): (FrameDisplayedCallback::~FrameDisplayedCallback): (webkit_web_view_add_frame_displayed_callback): (webkit_web_view_remove_frame_displayed_callback): * UIProcess/API/wpe/WebKitWebView.h: * UIProcess/API/wpe/docs/wpe-0.1-sections.txt: 2018-12-16 Chris Fleizach AX: Support keyboard access preference for iOS in WebKit https://bugs.webkit.org/show_bug.cgi?id=192373 Reviewed by Tim Horton. * Platform/spi/ios/AccessibilitySupportSPI.h: * PlatformMac.cmake: * SourcesCocoa.txt: * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.h: Added. * UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm: Added. (platformIsFullKeyboardAccessEnabled): (-[WKFullKeyboardAccessWatcher notifyAllProcessPools]): (-[WKFullKeyboardAccessWatcher retrieveKeyboardUIModeFromPreferences:]): (-[WKFullKeyboardAccessWatcher init]): (+[WKFullKeyboardAccessWatcher fullKeyboardAccessEnabled]): * UIProcess/ios/WebProcessProxyIOS.mm: (WebKit::WebProcessProxy::fullKeyboardAccessEnabled): * UIProcess/mac/WKFullKeyboardAccessWatcher.h: Removed. * UIProcess/mac/WKFullKeyboardAccessWatcher.mm: Removed. * WebKit.xcodeproj/project.pbxproj: 2018-12-16 Adrian Perez de Castro Unreviewed follow up after r239260 https://bugs.webkit.org/show_bug.cgi?id=192714 * Platform/win/SharedMemoryWin.cpp: (WebKit::SharedMemory::allocate): Use PAGE_READWRITE directly instead of going through the protectAttribute() function, which is removed because it is now unused. 2018-12-16 Adrian Perez de Castro Unify SharedMemory factory functions https://bugs.webkit.org/show_bug.cgi?id=192714 Reviewed by Darin Adler. This unifies SharedMemory so in the following way, across platforms: - SharedMemory::create() is removed, to avoid ambiguity. - SharedMemory::allocate() always allocates a new block of shared memory. - SharedMemory::wrapMap() always creates a SharedMemory object which refers to an existing region of memory resulting from memory-mapping a file. * NetworkProcess/cache/NetworkCacheDataCocoa.mm: (WebKit::NetworkCache::Data::tryCreateSharedMemory const): Use SharedMemory::wrapMap(). * Platform/SharedMemory.h: Remove the definition of SharedMemory::create(), and make SharedMemory::wrapMap() available on OS(DARWIN) as well. * Platform/cocoa/SharedMemoryCocoa.cpp: (WebKit::SharedMemory::wrapMap): Renamed from ::create(). * Platform/unix/SharedMemoryUnix.cpp: (WebKit::SharedMemory::allocate): Renamed from ::create(). * Platform/win/SharedMemoryWin.cpp: (WebKit::SharedMemory::allocate): Renamed from ::create() * UIProcess/API/APIContentRuleListStore.cpp: (API::createExtension): Use NetworkCache::Data::tryCreateSharedMemory() instead of SharedMemory::create(). 2018-12-15 Chris Fleizach [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds https://bugs.webkit.org/show_bug.cgi?id=192449 Reviewed by Darin Adler. Part 7: Files in UIProcess/API * UIProcess/API/APIContentRuleListStore.cpp: * UIProcess/API/APIHitTestResult.cpp: * UIProcess/API/APINavigation.cpp: * UIProcess/API/APIOpenPanelParameters.cpp: * UIProcess/API/APIPageConfiguration.cpp: * UIProcess/API/C/WKApplicationCacheManager.cpp: (WKApplicationCacheManagerGetTypeID): (WKApplicationCacheManagerGetApplicationCacheOrigins): (WKApplicationCacheManagerDeleteEntriesForOrigin): (WKApplicationCacheManagerDeleteAllEntries): * UIProcess/API/C/WKAuthenticationDecisionListener.cpp: (WKAuthenticationDecisionListenerGetTypeID): (WKAuthenticationDecisionListenerUseCredential): (WKAuthenticationDecisionListenerCancel): (WKAuthenticationDecisionListenerRejectProtectionSpaceAndContinue): * UIProcess/API/C/WKBackForwardListItemRef.cpp: (WKBackForwardListItemGetTypeID): (WKBackForwardListItemCopyURL): (WKBackForwardListItemCopyTitle): (WKBackForwardListItemCopyOriginalURL): * UIProcess/API/C/WKContext.cpp: (WKContextGetTypeID): (WKContextCreate): (WKContextCreateWithInjectedBundlePath): (WKContextCreateWithConfiguration): (WKContextSetClient): (WKContextSetInjectedBundleClient): (WKContextSetHistoryClient): (WKContextSetDownloadClient): (WKContextSetConnectionClient): (WKContextDownloadURLRequest): (WKContextResumeDownload): (WKContextSetInitializationUserDataForInjectedBundle): (WKContextPostMessageToInjectedBundle): (WKContextGetGlobalStatistics): (WKContextAddVisitedLink): (WKContextClearVisitedLinks): (WKContextSetCacheModel): (WKContextGetCacheModel): (WKContextSetMaximumNumberOfProcesses): (WKContextGetMaximumNumberOfProcesses): (WKContextSetAlwaysUsesComplexTextCodePath): (WKContextSetShouldUseFontSmoothing): (WKContextSetAdditionalPluginsDirectory): (WKContextRefreshPlugIns): (WKContextRegisterURLSchemeAsEmptyDocument): (WKContextRegisterURLSchemeAsSecure): (WKContextRegisterURLSchemeAsBypassingContentSecurityPolicy): (WKContextRegisterURLSchemeAsCachePartitioned): (WKContextRegisterURLSchemeAsCanDisplayOnlyIfCanRequest): (WKContextSetDomainRelaxationForbiddenForURLScheme): (WKContextSetCanHandleHTTPSServerTrustEvaluation): (WKContextSetPrewarmsProcessesAutomatically): (WKContextSetCustomWebContentServiceBundleIdentifier): (WKContextSetDiskCacheSpeculativeValidationEnabled): (WKContextPreconnectToServer): (WKContextGetCookieManager): (WKContextGetWebsiteDataStore): (WKContextGetGeolocationManager): (WKContextGetMediaSessionFocusManager): (WKContextGetNotificationManager): (WKContextStartMemorySampler): (WKContextStopMemorySampler): (WKContextAllowSpecificHTTPSCertificateForHost): (WKContextDisableProcessTermination): (WKContextEnableProcessTermination): (WKContextSetHTTPPipeliningEnabled): (WKContextWarmInitialProcess): (WKContextGetStatistics): (WKContextGetStatisticsWithOptions): (WKContextJavaScriptConfigurationFileEnabled): (WKContextSetJavaScriptConfigurationFileEnabled): (WKContextGarbageCollectJavaScriptObjects): (WKContextSetJavaScriptGarbageCollectorTimerEnabled): (WKContextUseTestingNetworkSession): (WKContextSetAllowsAnySSLCertificateForWebSocketTesting): (WKContextSetAllowsAnySSLCertificateForServiceWorkerTesting): (WKContextClearCachedCredentials): (WKContextCopyPlugInAutoStartOriginHashes): (WKContextSetPlugInAutoStartOriginHashes): (WKContextSetPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime): (WKContextSetPlugInAutoStartOrigins): (WKContextSetInvalidMessageFunction): (WKContextSetMemoryCacheDisabled): (WKContextSetFontWhitelist): (WKContextTerminateNetworkProcess): (WKContextTerminateServiceWorkerProcess): (WKContextGetNetworkProcessIdentifier): (WKContextAddSupportedPlugin): (WKContextClearSupportedPlugins): (WKContextSetIDBPerOriginQuota): * UIProcess/API/C/WKPage.cpp: (WKPageLoadURLWithShouldOpenExternalURLsPolicy): (WKPageLoadURLWithUserData): (WKPageLoadURLRequestWithUserData): (WKPageSetPaginationMode): (WKPageGetPaginationMode): (WKPageSetPageLoaderClient): (WKPageSetPagePolicyClient): * UIProcess/API/C/cg/WKIconDatabaseCG.cpp: 2018-12-15 Darin Adler Use warning-ignoring macros more consistently and simply https://bugs.webkit.org/show_bug.cgi?id=192743 Reviewed by Mark Lam. * UIProcess/ios/WKDrawingView.mm: (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]): Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END. * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: (-[WKFullScreenWindowController _EVOrganizationName]): Ditto. * WebProcess/WebCoreSupport/WebAlternativeTextClient.h: Use IGNORE_WARNINGS_BEGIN/END instead of IGNORE_CLANG_WARNINGS_BEGIN/END because there is no need to accomodate non-clang compilers here. Also use #pragma once, add a missing "explicit", and fix conditionals. 2018-12-15 Darin Adler Replace many uses of String::format with more type-safe alternatives https://bugs.webkit.org/show_bug.cgi?id=192742 Reviewed by Mark Lam. * Shared/WebMemorySampler.cpp: (WebKit::WebMemorySampler::writeHeaders): Use makeString. * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm: (WebKit::LocalAuthenticator::makeCredential): Use string concatentation. * UIProcess/WebInspectorUtilities.cpp: (WebKit::inspectorPageGroupIdentifierForPage): Use makeString. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processDidFinishLaunching): Ditto. (WebKit::WebProcessPool::startMemorySampler): Ditto. 2018-12-14 Ryan Haddad Unreviewed, fix the build with recent SDKs. * UIProcess/ios/WKDrawingView.mm: (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]): 2018-12-14 Jiewen Tan [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky https://bugs.webkit.org/show_bug.cgi?id=192061 Reviewed by Dewei Zhu. Part 2. Add some additional temporary logging info. Since the failure cannot be reproduced easily by human, we have to rely on the test infrastructure to reporoduce it. Once the bug is determined and fixed, we should remove all logging added in this patch. * UIProcess/WebAuthentication/Cocoa/HidService.mm: (WebKit::HidService::deviceAdded): * UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp: (WebKit::CtapHidAuthenticator::makeCredential): (WebKit::CtapHidAuthenticator::getAssertion): * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp: (WebKit::CtapHidDriver::Worker::write): (WebKit::CtapHidDriver::Worker::read): (WebKit::CtapHidDriver::Worker::returnMessage): (WebKit::CtapHidDriver::transact): (WebKit::CtapHidDriver::continueAfterChannelAllocated): (WebKit::CtapHidDriver::continueAfterResponseReceived): 2018-12-14 Adrian Perez de Castro [GTK] Unreviewed build fix. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: Add missing WebPolicyAction.h include. 2018-12-14 Chris Dumez Unreviewed, fix assertion failure in API test after r239210. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::createDocumentLoader): 2018-12-14 Adrian Perez de Castro [SOUP] Unreviewed build fix after r239219 * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Remove handling of PolicyAction::Suspend, which is no longer available. 2018-12-14 Joseph Pecoraro Unreviewed, apply post-landing review comments after r239221. * UIProcess/WebPageDebuggable.cpp: (WebKit::WebPageDebuggable::url const): Switch to WTF::blankURL() instead of using "about:blank" directly. 2018-12-14 Chris Dumez [PSON] Process-swapping on a loadHTMLString causes duplicate decidePolicyForNavigationAction delegate calls https://bugs.webkit.org/show_bug.cgi?id=192704 Reviewed by Geoffrey Garen. Process-swapping on a loadHTMLString causes duplicate decidePolicyForNavigationAction delegate calls. This is because we were failing to pass the ShouldTreatAsContinuingLoad flag to the WebContent process when doing a LoadData. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadData): (WebKit::WebPageProxy::loadDataWithNavigation): (WebKit::WebPageProxy::continueNavigationInNewProcess): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadDataImpl): (WebKit::WebPage::loadData): (WebKit::WebPage::loadAlternateHTML): * WebProcess/WebPage/WebPage.h: 2018-12-14 Joseph Pecoraro Web Inspector: Prefer "about:blank" instead of an empty string for WebPageDebuggable url https://bugs.webkit.org/show_bug.cgi?id=192691 Reviewed by Darin Adler. * UIProcess/WebPageDebuggable.cpp: (WebKit::WebPageDebuggable::url const): Instead of an empty string, return "about:blank" in bail cases. When inspecting the page that matches the contents. 2018-12-14 Chris Dumez [PSON] Stop exposing PolicyAction::Suspend to WebCore https://bugs.webkit.org/show_bug.cgi?id=192701 Reviewed by Brady Eidson. Introduce a new WebPolicyAction enum that is used at WebKit2 layer and augments WebCore::PolicyAction with a "Suspend" value. * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (toNSURLSessionResponseDisposition): * Shared/WebPolicyAction.h: Added. * UIProcess/WebFramePolicyListenerProxy.cpp: (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults): (WebKit::WebFramePolicyListenerProxy::use): (WebKit::WebFramePolicyListenerProxy::download): (WebKit::WebFramePolicyListenerProxy::ignore): * UIProcess/WebFramePolicyListenerProxy.h: * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::setUpPolicyListenerProxy): * UIProcess/WebFrameProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedNavigationPolicyDecision): (WebKit::WebPageProxy::receivedPolicyDecision): (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::decidePolicyForNavigationActionSync): (WebKit::WebPageProxy::decidePolicyForNewWindowAction): (WebKit::WebPageProxy::decidePolicyForResponse): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * WebProcess/WebPage/WebFrame.cpp: (WebKit::toPolicyAction): (WebKit::WebFrame::didReceivePolicyDecision): * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didReceivePolicyDecision): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2018-12-14 David Quesada Remove a global 'using namespace WebKit' in WebViewImpl.mm https://bugs.webkit.org/show_bug.cgi?id=192690 Reviewed by Tim Horton. * UIProcess/Cocoa/WebViewImpl.mm: (-[WKTextListTouchBarViewController initWithWebViewImpl:]): (-[WKTextListTouchBarViewController _selectList:]): (-[WKTextListTouchBarViewController setCurrentListType:]): (-[WKTextTouchBarItemController initWithWebViewImpl:]): 2018-12-14 Chris Dumez [PSON] WebsitePolicies are lost on process-swap https://bugs.webkit.org/show_bug.cgi?id=192694 Reviewed by Brady Eidson. In case of process-swap on navigation, instead of sending the websitePolicies to the old process, send them to the new process as we trigger the navigation. We tell the new process that it is continuing a load and it will therefore not re-trigger a decidePolicyForNavigationAction. * Shared/LoadParameters.cpp: (WebKit::LoadParameters::encode const): (WebKit::LoadParameters::decode): * Shared/LoadParameters.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::reattachToWebProcessForReload): (WebKit::WebPageProxy::reattachToWebProcessWithItem): (WebKit::WebPageProxy::loadRequestWithNavigation): (WebKit::WebPageProxy::loadDataWithNavigation): (WebKit::WebPageProxy::goToBackForwardItem): (WebKit::WebPageProxy::receivedNavigationPolicyDecision): (WebKit::WebPageProxy::continueNavigationInNewProcess): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadRequest): (WebKit::WebPage::loadDataImpl): (WebKit::WebPage::loadData): (WebKit::WebPage::loadAlternateHTML): (WebKit::WebPage::goToBackForwardItem): (WebKit::WebPage::createDocumentLoader): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2018-12-14 Patrick Griffis [GTK][WPE] Fix forwarding webkit socket to flatpak sandbox https://bugs.webkit.org/show_bug.cgi?id=192622 Reviewed by Michael Catanzaro. This fixes running with the sandbox enabled in Flatpak. * UIProcess/Launcher/glib/FlatpakLauncher.cpp: (WebKit::flatpakSpawn): * UIProcess/Launcher/glib/FlatpakLauncher.h: * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: (WebKit::ProcessLauncher::launchProcess): 2018-12-14 Carlos Garcia Campos [WPE] Use new view state API from libwpe https://bugs.webkit.org/show_bug.cgi?id=191906 Reviewed by Žan Doberšek. Remove WKViewSetViewState from the C API. * UIProcess/API/C/wpe/WKAPICastWPE.h: * UIProcess/API/C/wpe/WKView.cpp: * UIProcess/API/C/wpe/WKView.h: * UIProcess/API/wpe/WPEView.cpp: (WKWPE::View::View): Add implementation for activity_state_changed vfunc of the view backend client.): (WKWPE::View::setViewState): Remove the default flags. * UIProcess/API/wpe/WPEView.h: (WKWPE::View::setViewState const): Make it private. 2018-12-13 Joseph Pecoraro [iOS] Web Inspector: Occasional UIProcess crashes under WebPageProxy::showInspectorIndication https://bugs.webkit.org/show_bug.cgi?id=192689 Reviewed by Simon Fraser. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::close): * UIProcess/WebPageProxy.h: Don't wait until ~WebPageProxy to destroy the WebPageProxyDebuggable which broadcasts it as a remote inspector target. Terminate this as soon as the WebPageProxy closes and becomes invalid. 2018-12-13 Chris Dumez Unreviewed build fix for tvOS. * Platform/cocoa/WKCrashReporter.mm: 2018-12-13 Chris Dumez Unreviewed build fix for tvOS. * Platform/cocoa/WKCrashReporter.mm: 2018-12-13 Chris Dumez [PSON] We should not need to navigate to 'about:blank' to suspend pages https://bugs.webkit.org/show_bug.cgi?id=192668 Reviewed by Alex Christensen. To support PageCache when process-swap on cross-site navigation is enabled, we've been navigating the previous process to 'about:blank' when swapping. This would trigger PageCaching of the page in the old process. While convenient, this design has led to a lot of bugs because we did not really want a navigation to happen in the old process. To address the issue, when a WebPage is asked to suspend (for process-swap), we now attempt to add it to PageCache and save it on the current HistoryItem, *without* triggering any navigation. Any pending navigation gets cancelled and we just suspend in place. Later on, when we want to go back to this HistoryItem, we simply leverage the existing WebPage::goToBackForwardItem() code path. The only subtlety is that we're actually asking the WebPage to load a HistoryItem that is the current one in the History. I had to tweak a some logic / assertions to support this as this is not something we usually do. However, it actually works with very little changes and successfully restores the PageCache entry on the current HistoryItem. There is no expected overall behavior change and ProcessSwap API tests (which cover PageCache) still pass. This is merely a simpler design because it avoids navigating to about:blank. * UIProcess/SuspendedPageProxy.cpp: (WebKit::SuspendedPageProxy::didSuspend): (WebKit::SuspendedPageProxy::didReceiveMessage): * UIProcess/SuspendedPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didSuspendAfterProcessSwap): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): * WebProcess/WebPage/WebDocumentLoader.cpp: (WebKit::WebDocumentLoader::setNavigationID): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::didReceivePolicyDecision): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::suspendForProcessSwap): * WebProcess/WebPage/WebPage.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::origin): 2018-12-13 Per Arne Vollan [macOS] Remove with-report from 3 services that are currently needed on macOS https://bugs.webkit.org/show_bug.cgi?id=192593 Reviewed by Brent Fulgham. * WebProcess/com.apple.WebProcess.sb.in: 2018-12-13 Youenn Fablet On page close, WebPage::m_userMediaPermissionRequestManager is nullified too early https://bugs.webkit.org/show_bug.cgi?id=192657 Reviewed by Eric Carlson. Instead of nullifying the manager, make it a UniqueRef and clear it on closing the page. This ensures we revoke the sandbox extensions as early as possible and keep the manager lifetime simple. * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): (WebKit::UserMediaPermissionRequestManager::clear): * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::close): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::userMediaPermissionRequestManager): 2018-12-13 Chris Fleizach [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds https://bugs.webkit.org/show_bug.cgi?id=192449 Reviewed by Darin Adler. Part 6: Files in plugin process and UI process. * PluginProcess/PluginControllerProxy.cpp: * PluginProcess/PluginProcess.cpp: * PluginProcess/WebProcessConnection.cpp: * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: * UIProcess/WebStorage/LocalStorageDatabase.cpp: * UIProcess/mac/WebPageProxyMac.mm: 2018-12-13 Eric Carlson [MediaStream] Calculate width or height when constraints contain only the other https://bugs.webkit.org/show_bug.cgi?id=192632 Reviewed by Youenn Fablet. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::SourceProxy::remoteVideoSampleAvailable): Deleted, replaced with videoSampleAvailable. * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::Source::remoteVideoSampleAvailable): Use original frame size if necessary when calculating new frame size. 2018-12-12 Chris Fleizach [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds https://bugs.webkit.org/show_bug.cgi?id=192449 Reviewed by Darin Adler. Part 5: Files in WebProcess folder. * WebProcess/Cache/WebCacheStorageConnection.cpp: * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm: (mediaTimeToCurrentTime): (-[WKAnimationDelegate initWithLayerID:layerTreeHost:]): * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: (-[WKAccessibilityWebPageObject accessibilityHitTest:]): 2018-12-12 Ross Kirsling [MSVC] Unreviewed build fix for r239080. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap): 2018-12-12 Chris Fleizach [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds https://bugs.webkit.org/show_bug.cgi?id=192449 Reviewed by Darin Adler. Part 4: Handling NetworkProcess folder. * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm: * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: * NetworkProcess/ios/NetworkProcessIOS.mm: * NetworkProcess/mac/NetworkProcessMac.mm: * NetworkProcess/mac/RemoteNetworkingContext.mm: 2018-12-12 Chris Fleizach [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds https://bugs.webkit.org/show_bug.cgi?id=192449 Reviewed by Tim Horton. Fix iosmac build. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _hoverGestureRecognizerChanged:]): 2018-12-12 Alex Christensen Implement safe browsing in WebKit on WatchOS https://bugs.webkit.org/show_bug.cgi?id=192641 Reviewed by Geoff Garen. WatchOS has a few special requirements: 1. The margin size needs to be smaller and the title font smaller to fit on the screen. 2. The exclamation point cannot be beside the title or it won't fit on the screen. I put it above the title. 3. The application must be told when the safe browsing warning has been shown. I added a new delegate callback. 4. The UIScrollView's contentSize must be set even before the details are shown to be able to scroll down to the buttons. This was already an issue on small WKWebViews on iOS, so this fixes both operating systems. * Configurations/WebKit.xcconfig: * UIProcess/API/APIUIClient.h: (API::UIClient::didShowSafeBrowsingWarning): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::didShowSafeBrowsingWarning): * UIProcess/Cocoa/WKSafeBrowsingWarning.mm: (fontOfSize): (buttonSize): (-[WKSafeBrowsingWarning addContent]): (-[WKSafeBrowsingWarning showDetailsClicked]): (-[WKSafeBrowsingWarning updateContentSize]): (buttonWidth): Deleted. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationAction): 2018-12-12 Commit Queue Unreviewed, rolling out r239129 and r239131. https://bugs.webkit.org/show_bug.cgi?id=192646 Casued macOS and iOS Debug testing to fail early (Requested by Truitt on #webkit). Reverted changesets: "Unreviewed build fix for WinCairo Debug after r239080(?)." https://trac.webkit.org/changeset/239129 "Unreviewed fix for Cocoa Debug test instability following r239129." https://trac.webkit.org/changeset/239131 2018-12-12 Vivek Seth HTTPS Upgrade: Figure out if/how to tell clients that the HTTPS upgrade happened https://bugs.webkit.org/show_bug.cgi?id=192375 Reviewed by Chris Dumez. Use simulated redirect to tell clients that HTTPS Upgrade happened. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::NetworkLoadChecker): (WebKit::NetworkLoadChecker::checkRedirection): (WebKit::NetworkLoadChecker::accessControlErrorForValidationHandler): (WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded const): (WebKit::NetworkLoadChecker::checkRequest): (WebKit::NetworkLoadChecker::continueCheckingRequestOrDoSyntheticRedirect): (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight): (WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded): Deleted. * NetworkProcess/NetworkLoadChecker.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::start): * NetworkProcess/PingLoad.cpp: 2018-12-12 Ross Kirsling Unreviewed fix for Cocoa Debug test instability following r239129. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap): Deleted. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap): Move the whole assertion to the declaration site. 2018-12-12 Chris Dumez Add a preference to enable / disable devicemotion and deviceorientation events https://bugs.webkit.org/show_bug.cgi?id=192631 Reviewed by Geoffrey Garen. Add setting to toggle support for the deviceorientation / devicemotion events: - https://w3c.github.io/deviceorientation/ * Shared/WebPreferences.yaml: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setDeviceOrientationEventEnabled:]): (-[WKPreferences _deviceOrientationEventEnabled]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2018-12-12 Ross Kirsling Unreviewed build fix for WinCairo Debug after r239080(?). MSVC gives a redefinition error if noreturn is specified on the definition instead of the declaration. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap): * UIProcess/WebPageProxy.h: Move NO_RETURN_DUE_TO_ASSERT to the declaration site. 2018-12-12 Chris Fleizach [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds https://bugs.webkit.org/show_bug.cgi?id=192449 Reviewed by Darin Adler. Part 2: UIProcess/Cocoa and UIProcess/ios folders. * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: * UIProcess/ios/WKContentView.mm: (-[WKContentView _commonInitializationWithProcessPool:configuration:]): (-[WKContentView initWithFrame:processPool:configuration:webView:]): (-[WKContentView dealloc]): (-[WKContentView page]): (-[WKContentView updateFixedClippingView:]): (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): (-[WKContentView _updateForScreen:]): (-[WKContentView _accessibilityRegisterUIProcessTokens]): (-[WKContentView _createDrawingAreaProxy]): (-[WKContentView _didCommitLayerTree:]): (-[WKContentView _wk_pageCountForPrintFormatter:]): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]): (hasAssistedNode): (-[WKContentView setupInteraction]): (-[WKContentView positionInformation]): (-[WKContentView _webTouchEventsRecognized:]): (inflateQuad): (-[WKContentView _updateTapHighlight]): (-[WKContentView _showTapHighlight]): (-[WKContentView _requiresKeyboardWhenFirstResponder]): (-[WKContentView _displayFormNodeInputView]): (-[WKContentView inputView]): (-[WKContentView _actionForLongPressFromPositionInformation:]): (-[WKContentView currentPositionInformation]): (-[WKContentView doAfterPositionInformationUpdate:forRequest:]): (-[WKContentView _currentPositionInformationIsValidForRequest:]): (-[WKContentView _hasValidOutstandingPositionInformationRequest:]): (-[WKContentView _currentPositionInformationIsApproximatelyValidForRequest:]): (-[WKContentView gestureRecognizerShouldBegin:]): (-[WKContentView hasSelectablePositionAtPoint:]): (-[WKContentView pointIsNearMarkedText:]): (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): (-[WKContentView webSelectionRectsForSelectionRects:]): (-[WKContentView _twoFingerSingleTapGestureRecognized:]): (-[WKContentView _stylusSingleTapRecognized:]): (-[WKContentView _singleTapCommited:]): (-[WKContentView _attemptClickAtLocation:]): (-[WKContentView _positionInformationDidChange:]): (-[WKContentView requiresAccessoryView]): (-[WKContentView supportedPasteboardTypesForCurrentSelection]): (-[WKContentView _lookupForWebView:]): (-[WKContentView _shareForWebView:]): (-[WKContentView textStylingAtPosition:inDirection:]): (-[WKContentView canPerformActionForWebView:withSender:]): (-[WKContentView selectForWebView:]): (-[WKContentView _accessibilityRetrieveRectsEnclosingSelectionOffset:withGranularity:]): (-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]): (toGestureType): (toUIWKGestureType): (toSelectionTouch): (toUIWKSelectionTouch): (toGestureRecognizerState): (toUIGestureRecognizerState): (toUIWKSelectionFlags): (toWKTextGranularity): (toWKSelectionDirection): (selectionChangedWithGesture): (selectionChangedWithTouch): (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]): (-[WKContentView autocorrectionData]): (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]): (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]): (-[WKContentView _updateAccessory]): (-[WKContentView selectedTextRange]): (-[WKContentView setMarkedText:selectedRange:]): (coreWritingDirection): (-[WKContentView closestPositionToPoint:]): (-[WKContentView insertText:]): (-[WKContentView textInputTraits]): (-[WKContentView handleKeyWebEvent:]): (-[WKContentView handleKeyWebEvent:withCompletionHandler:]): (-[WKContentView isScrollableForKeyboardScrollViewAnimator:]): (-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:]): (-[WKContentView assistedNodeInformation]): (-[WKContentView assistedNodeSelectOptions]): (isAssistableInputType): (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): (-[WKContentView _stopAssistingNode]): (-[WKContentView updateCurrentAssistedNodeInformation:]): (-[WKContentView presentViewControllerForCurrentAssistedNode]): (-[WKContentView actionNameForFocusedFormControlView:]): (-[WKContentView selectWordForReplacement]): (-[WKContentView _updateChangedSelection:]): (-[WKContentView _beginSuppressingSelectionAssistantForReason:]): (-[WKContentView _stopSuppressingSelectionAssistantForReason:]): (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]): (-[WKContentView _showRunOpenPanel:resultListener:]): (-[WKContentView _showShareSheet:completionHandler:]): (-[WKContentView positionInformationForActionSheetAssistant:]): (-[WKContentView updatePositionInformationForActionSheetAssistant:]): (-[WKContentView _startDrag:item:]): (-[WKContentView _didHandleAdditionalDragItemsRequest:]): (-[WKContentView _didHandleStartDataInteractionRequest:]): (dropOperationForWebCoreDragOperation): (-[WKContentView dragDataForDropSession:dragDestinationAction:]): (-[WKContentView _didConcludeEditDataInteraction:]): (-[WKContentView _didPerformDragOperation:]): (-[WKContentView _prepareToDragPromisedAttachment:]): (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]): (-[WKContentView _autofillContext]): (-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]): (-[WKContentView _dragInteraction:prepareForSession:completion:]): (-[WKContentView dragInteraction:itemsForBeginningSession:]): (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]): (-[WKContentView dragInteraction:session:didEndWithOperation:]): (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]): (-[WKContentView dropInteraction:performDrop:]): (-[WKContentView dropInteraction:sessionDidEnd:]): (-[WKContentView allowsLanguageSelectionMenuForListViewController:]): (-[WKContentView shouldDisplayInputContextViewForListViewController:]): (-[WKContentView numericInputModeForListViewController:]): (-[WKContentView textContentTypeForListViewController:]): (-[WKContentView allowsDictationInputForListViewController:]): (-[WKContentView _simulateLongPressActionAtLocation:]): (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]): (-[WKContentView _presentationRectsForPreviewItemController:]): * UIProcess/ios/fullscreen/WKFullScreenViewController.mm: (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface): (WKFullScreenViewControllerVideoFullscreenModelClient::setInterface): (WKFullScreenViewControllerVideoFullscreenModelClient::interface const): (-[WKFullScreenViewController videoControlsManagerDidChange]): (-[WKFullScreenViewController _manager]): (-[WKFullScreenViewController _togglePiPAction:]): * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: (-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]): (-[WKFullScreenWindowController isFullScreen]): (-[WKFullScreenWindowController enterFullScreen]): (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController exitFullScreen]): (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController _completedExitFullScreen]): (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]): (-[WKFullScreenWindowController _exitFullscreenImmediately]): (-[WKFullScreenWindowController _manager]): 2018-12-12 Chris Fleizach [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds https://bugs.webkit.org/show_bug.cgi?id=192449 Reviewed by Darin Adler. Part 1: Files in Shared folder. * Shared/API/c/WKRenderLayer.cpp: (WKRenderLayerGetFrameContentsLayer): * Shared/API/c/cf/WKErrorCF.cpp: (WKErrorCreateWithCFError): (WKErrorCopyCFError): * Shared/API/c/cg/WKImageCG.cpp: (WKImageCreateCGImage): (WKImageCreateFromCGImage): * Shared/API/c/mac/WKWebArchive.cpp: (WKWebArchiveGetTypeID): (WKWebArchiveCreate): (WKWebArchiveCreateWithData): (WKWebArchiveCreateFromRange): (WKWebArchiveCopyMainResource): (WKWebArchiveCopySubresources): (WKWebArchiveCopySubframeArchives): (WKWebArchiveCopyData): * Shared/API/c/mac/WKWebArchiveResource.cpp: (WKWebArchiveResourceGetTypeID): (WKWebArchiveResourceCreate): (WKWebArchiveResourceCopyData): (WKWebArchiveResourceCopyURL): (WKWebArchiveResourceCopyMIMEType): (WKWebArchiveResourceCopyTextEncoding): * Shared/ChildProcess.cpp: * Shared/ContextMenuContextData.cpp: * Shared/EditorState.cpp: * Shared/Plugins/NPIdentifierData.cpp: * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm: * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: * Shared/SessionState.cpp: * Shared/SessionTracker.cpp: * Shared/ShareableBitmap.cpp: * Shared/ShareableResource.cpp: * Shared/VisibleContentRectUpdateInfo.cpp: * Shared/WebBackForwardListItem.cpp: * Shared/WebContextMenuItemData.cpp: * Shared/WebCoreArgumentCoders.cpp: * Shared/WebHitTestResultData.cpp: * Shared/WebImage.cpp: * Shared/WebMediaSessionMetadata.cpp: * Shared/WebMemorySampler.cpp: * Shared/WebMouseEvent.cpp: * Shared/WebRenderObject.cpp: * Shared/WebSQLiteDatabaseTracker.cpp: * Shared/WebWheelEvent.cpp: * Shared/cf/ArgumentCodersCF.cpp: * Shared/ios/WebPlatformTouchPointIOS.cpp: 2018-12-12 Chris Fleizach [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds https://bugs.webkit.org/show_bug.cgi?id=192449 Reviewed by Darin Adler. Part 1: Files in NetworkProcess. * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm: * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: * NetworkProcess/ios/NetworkProcessIOS.mm: * NetworkProcess/mac/NetworkProcessMac.mm: * NetworkProcess/mac/RemoteNetworkingContext.mm: 2018-12-12 Chris Dumez Unreviewed build with with recent macOS SDKs. * Platform/cocoa/WKCrashReporter.mm: 2018-12-12 Chris Dumez Unreviewed attempt to fix GTK build after r239104. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::performDragControllerAction): 2018-12-12 Chris Dumez Unreviewed attempt to fix build with older SDKs after r239110. * Platform/cocoa/WKCrashReporter.mm: 2018-12-12 Chris Dumez Unreviewed, fix build with recent SDKs. * Platform/cocoa/WKCrashReporter.mm: 2018-12-09 Darin Adler [iOS] Zero memory containing the password for PDF documents when a WKPDFView is deallocated https://bugs.webkit.org/show_bug.cgi?id=192536 rdar://problem/41174451 Reviewed by Tim Horton. * UIProcess/ios/WKPDFView.mm: Took out PLATFORM(IOSMAC) since this class is not compiled on that platform at this time. Can always add it back later. (-[WKPDFView dealloc]): Zero out characters of _passwordForPrinting. (-[WKPDFView pdfHostViewController:documentDidUnlockWithPassword:]): Initialize _passwordForPrinting; use a CString instead of retaining an NSString since we can zero that out easily. (-[WKPDFView _ensureDocumentForPrinting]): Use _passwordForPrinting. 2018-12-12 Commit Queue Unreviewed, rolling out r239103. https://bugs.webkit.org/show_bug.cgi?id=192627 It broke the built because it depends on another patch that didn't land yet (Requested by KaL on #webkit). Reverted changeset: "[WPE] Add API to notify about frame displayed view backend callback" https://bugs.webkit.org/show_bug.cgi?id=192224 https://trac.webkit.org/changeset/239103 2018-12-12 Chris Dumez Restore MESSAGE_CHECK_URL() security check on sourceURL in didPerformClientRedirect() https://bugs.webkit.org/show_bug.cgi?id=191982 Reviewed by Alex Christensen. Have the WebPageProxy remember the local paths it previously visited so that the MESSAGE_CHECK_URL() checks still work when process-swap on navigation is enabled. Add back MESSAGE_CHECK_URL() on sourceURL in didPerformClientRedirect(). * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded): * UIProcess/RemoteWebInspectorProxy.cpp: (WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow): * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::createFrontendPage): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadRequestWithNavigation): (WebKit::WebPageProxy::loadFile): (WebKit::WebPageProxy::loadDataWithNavigation): (WebKit::WebPageProxy::loadAlternateHTML): (WebKit::WebPageProxy::reload): (WebKit::WebPageProxy::didPerformClientRedirect): (WebKit::WebPageProxy::backForwardGoToItem): (WebKit::WebPageProxy::checkURLReceivedFromCurrentOrPreviousWebProcess): (WebKit::WebPageProxy::addPreviouslyVisitedPath): (WebKit::WebPageProxy::willAcquireUniversalFileReadSandboxExtension): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::assumeReadAccessToBaseURL): * UIProcess/WebProcessProxy.h: * UIProcess/mac/WebPageProxyMac.mm: 2018-11-30 Carlos Garcia Campos [WPE] Add API to notify about frame displayed view backend callback https://bugs.webkit.org/show_bug.cgi?id=192224 Reviewed by Michael Catanzaro. Add API to add a callback to the view to be called when the view backend notifies that a frame has been displayed. * UIProcess/API/glib/WebKitWebView.cpp: (FrameDisplayedCallback::FrameDisplayedCallback): (FrameDisplayedCallback::~FrameDisplayedCallback): (webkit_web_view_add_frame_displayed_callback): (webkit_web_view_remove_frame_displayed_callback): * UIProcess/API/wpe/WebKitWebView.h: 2018-12-11 Justin Michaud Implement feature flag for CSS Typed OM https://bugs.webkit.org/show_bug.cgi?id=192610 Reviewed by Ryosuke Niwa. * Configurations/FeatureDefines.xcconfig: * Shared/WebPreferences.yaml: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 2018-12-11 Fujii Hironori [Win][Clang] Fix warning -Wmissing-field-initializers https://bugs.webkit.org/show_bug.cgi?id=192584 Reviewed by Yusuke Suzuki. Initialize a struct with '{ }' instead of '= {0}'. * UIProcess/Launcher/win/ProcessLauncherWin.cpp: (WebKit::ProcessLauncher::launchProcess): * UIProcess/win/WebPopupMenuProxyWin.cpp: (WebKit::WebPopupMenuProxyWin::showPopupMenu): * UIProcess/win/WebView.cpp: (WebKit::WebView::initializeToolTipWindow): (WebKit::WebView::setToolTip): 2018-12-11 Chris Dumez PSON logic gets confused by concurrent decidePolicyForNavigationAction requests https://bugs.webkit.org/show_bug.cgi?id=192482 Reviewed by Antti Koivisto. It is possible to get 2 parallel decidePolicyForNavigationAction() requests from the WebProcess when a new load is started before responding to the existing policy decision. This would lead to several issues with regards to PSON: - We would decide to swap for the first policy decision and tell the WebProcess to suspend. However, because the WebProcess issued a new decidePolicyForNavigationAction since for the same frame, the previous one is invalidated and the WebProcess would ignore our request to suspend. - We would hit assertions later on because the navigation has been destroyed and yet we're getting a didStartProvisionalLoad for it. - swapToWebProcess() was asynchronous so that it would wait for the destination SuspendedPage to finish suspending before asking it to unsuspend. This led to various problems because anything can happen in the UIProcess while we're waiting for the suspension (e.g. another load). Also, we may create the SuspendedPageProxy for the current page too late and start getting IPC from the previous process about the suspension load to about:blank. To address these issues, the following design is now implemented: - swapToWebProcess() is no longer asynchronous - instead, WebProcessPool::processForNavigation() is now asynchronous. This is better because at this point we have not yet told the WebProcess about the policy decision. We already properly deal with the policy decision being made asynchronously. This also allows us to choose another process if the SuspendedPage we'd like to use failed to suspend. - If the WebProcess receives a PolicyAction::Suspend but ignores it, have it send an IPC to the UIProcess so that the SuspendedPageProxy knows about it. We then destroy the SuspendedPageProxy and make sure it is not used. - After the asynchronous process selection, if the navigation has been destroy, abort the process-swap to avoid hitting assertions later on due to doing a load for a destroyed navigation. * UIProcess/SuspendedPageProxy.cpp: (WebKit::SuspendedPageProxy::~SuspendedPageProxy): Make sure m_whenReadyToConsume completion handler gets called if necessary if the SuspendedPageProxy gets destroyed. We pass null so that the SuspendedPage is not used. (WebKit::SuspendedPageProxy::whenReadyToConsume): Add whenReadyToConsume() utility method to get a completion handler called when the SuspendedPageProxy is ready to be used. This basically means we have to wait for the page to finish its about:blank suspension load. If the suspension fails then we call the completion handler with null to indicate that the suspended page is not usable. (WebKit::SuspendedPageProxy::unsuspendAndConsume): Rename unsuspend() to unsuspendAndConsume() and make it synchronous. This only gets called after whenReadyToConsume()'s completion handler has been called and if we do decide to use the SuspendedPageProxy. It tells the WebProcess to unsuspend and removes the SuspendedPageProxy from the WebProcessPool. (WebKit::SuspendedPageProxy::didFinishLoad): rename m_finishedSuspendingHandler to m_whenReadyToConsume. (WebKit::SuspendedPageProxy::didFailToSuspend): Add new didFailToSuspend() that gets called when the WebProcess sends us an IPC telling us it ignored our request to suspend. We then call m_whenReadyToConsume completion handler with null and destroy the SuspendedPageProxy. (WebKit::SuspendedPageProxy::didReceiveMessage): * UIProcess/SuspendedPageProxy.h: * UIProcess/WebNavigationState.h: (WebKit::WebNavigationState::hasNavigation const): Add utility function to query if a navigation is still valid. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::swapToWebProcess): Update method so that it is no longer asynchronous. Some of its code was also moved to continueNavigationInNewProcess() for clarity. (WebKit::WebPageProxy::receivedNavigationPolicyDecision): Deal with WebProcessPool::processForNavigation() now being asynchronous. (WebKit::WebPageProxy::continueNavigationInNewProcess): Update code now that swapToWebProcess() is no longer asynchronous. Some of the swapToWebProcess() code was also moved here for clarity. (WebKit::WebPageProxy::didFailToSuspendAfterProcessSwap): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Add new DidFailToSuspendAfterProcessSwap IPC message. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigation): (WebKit::WebProcessPool::processForNavigationInternal): * UIProcess/WebProcessPool.h: Make asynchronous. If we decide to use a SuspendedPageProxy's process, then call whenReadyToConsume() on it to wait for it to suspend. If the SuspendedPageProxy fails to suspend use a new process instead. * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::didReceivePolicyDecision): If we ignore the policy decision and the decision was "Suspend", send the DidFailToSuspendAfterProcessSwap IPC to the UIProcess so that the SuspendedPageProxy knows about it. 2018-12-11 Andy Estes Introduce makeBlockPtr for lambdas https://bugs.webkit.org/show_bug.cgi?id=192594 Reviewed by Alex Christensen. Adopted makeBlockPtr. * NetworkProcess/Downloads/cocoa/WKDownloadProgress.mm: (-[WKDownloadProgress initWithDownloadTask:download:URL:sandboxExtension:]): * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm: (WebKit::NetworkCache::IOChannel::read): (WebKit::NetworkCache::IOChannel::write): * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::clearDiskCache): (WebKit::saveCookies): * NetworkProcess/watchos/NetworkProximityAssertion.mm: (WebKit::BluetoothProximityAssertion::suspend): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setInputDelegate:]): * UIProcess/API/mac/WKView.mm: (-[WKView maybeInstallIconLoadingClient]): * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): (WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup): * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): * UIProcess/Cocoa/AutomationSessionClient.mm: (WebKit::AutomationSessionClient::requestNewPageWithOptions): (WebKit::AutomationSessionClient::requestSwitchToPage): (WebKit::AutomationSessionClient::requestHideWindowOfPage): (WebKit::AutomationSessionClient::requestRestoreWindowOfPage): (WebKit::AutomationSessionClient::requestMaximizeWindowOfPage): * UIProcess/Cocoa/DownloadClient.mm: (WebKit::DownloadClient::didReceiveAuthenticationChallenge): (WebKit::DownloadClient::decideDestinationWithSuggestedFilename): * UIProcess/Cocoa/IconLoadingDelegate.mm: (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon): * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForPluginLoad): (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const): (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const): (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse): (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge): * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu): (WebKit::UIDelegate::UIClient::createNewPage): (WebKit::UIDelegate::UIClient::runJavaScriptAlert): (WebKit::UIDelegate::UIClient::runJavaScriptConfirm): (WebKit::UIDelegate::UIClient::runJavaScriptPrompt): (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm): (WebKit::UIDelegate::UIClient::decidePolicyForGeolocationPermissionRequest): (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel): (WebKit::UIDelegate::UIClient::exceededDatabaseQuota): (WebKit::UIDelegate::UIClient::windowFrame): (WebKit::UIDelegate::UIClient::toolbarsAreVisible): (WebKit::UIDelegate::UIClient::decidePolicyForNotificationPermissionRequest): (WebKit::UIDelegate::UIClient::runOpenPanel): (WebKit::requestUserMediaAuthorizationForDevices): (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin): (WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota): (WebKit::UIDelegate::UIClient::requestPointerLock): * UIProcess/Cocoa/WKSafeBrowsingWarning.mm: (-[WKSafeBrowsingWarning clickedOnLink:]): * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::beginSafeBrowsingCheck): * UIProcess/WebAuthentication/Cocoa/HidConnection.mm: (WebKit::HidConnection::send): * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm: (WebKit::LocalConnection::getUserConsent const): (WebKit::LocalConnection::getAttestation const): * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp: (WebKit::MockHidConnection::send): * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::requestPasswordForQuickLookDocument): * UIProcess/ios/WKGeolocationProviderIOS.mm: (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]): * UIProcess/mac/ServicesController.mm: (WebKit::hasCompatibleServicesForItems): (WebKit::ServicesController::refreshExistingServices): * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (PageLoaderClient::didStartProvisionalLoadForFrame): 2018-12-11 Alex Christensen Fix an internal build failure after r239014 https://bugs.webkit.org/show_bug.cgi?id=192205 * UIProcess/Cocoa/WKSafeBrowsingWarning.mm: (fontOfSize): There's a system that doesn't have safe browsing or UIFontTextStyleLargeTitle. 2018-12-11 Brian Burg SimulatedInputDispatcher::transitionInputSourceToState() can reuse a moved-from completion handler https://bugs.webkit.org/show_bug.cgi?id=191155 Reviewed by Joseph Pecoraro. * UIProcess/Automation/SimulatedInputDispatcher.cpp: (WebKit::SimulatedInputDispatcher::transitionInputSourceToState): Add an ASSERT to guard against unexpected inputs where >1 VirtualKey changes per state. webkitdriver needs to be updated to not produce such states in this scenario, but this will avoid a runtime crash caused by trying to call a moved-out completion handler a second time. 2018-12-11 Commit Queue Unreviewed, rolling out r239071. https://bugs.webkit.org/show_bug.cgi?id=192588 Broke WPE build due to undefined references to toAPI() and toImpl() inside the C API (Requested by magomez on #webkit). Reverted changeset: "[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds" https://bugs.webkit.org/show_bug.cgi?id=192449 https://trac.webkit.org/changeset/239071 2018-12-10 Chris Fleizach [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds https://bugs.webkit.org/show_bug.cgi?id=192449 Reviewed by Darin Adler. * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm: * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: * NetworkProcess/ios/NetworkProcessIOS.mm: * NetworkProcess/mac/NetworkProcessMac.mm: * NetworkProcess/mac/RemoteNetworkingContext.mm: * Platform/spi/ios/AccessibilitySupportSPI.h: * PlatformMac.cmake: * PluginProcess/PluginControllerProxy.cpp: * PluginProcess/PluginProcess.cpp: * PluginProcess/WebProcessConnection.cpp: * Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb: * Shared/API/c/cf/WKErrorCF.cpp: (WKErrorCreateWithCFError): (WKErrorCopyCFError): * Shared/API/c/cg/WKImageCG.cpp: (WKImageCreateCGImage): (WKImageCreateFromCGImage): * Shared/ChildProcess.cpp: * Shared/ContextMenuContextData.cpp: * Shared/EditorState.cpp: * Shared/Plugins/NPIdentifierData.cpp: * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm: * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: * Shared/SessionState.cpp: * Shared/SessionTracker.cpp: * Shared/ShareableBitmap.cpp: * Shared/ShareableResource.cpp: * Shared/VisibleContentRectUpdateInfo.cpp: * Shared/WebBackForwardListItem.cpp: * Shared/WebContextMenuItemData.cpp: * Shared/WebCoreArgumentCoders.cpp: * Shared/WebHitTestResultData.cpp: * Shared/WebImage.cpp: * Shared/WebMediaSessionMetadata.cpp: * Shared/WebMemorySampler.cpp: * Shared/WebMouseEvent.cpp: * Shared/WebRenderObject.cpp: * Shared/WebSQLiteDatabaseTracker.cpp: * Shared/WebWheelEvent.cpp: * Shared/cf/ArgumentCodersCF.cpp: * Shared/ios/WebPlatformTouchPointIOS.cpp: * SourcesCocoa.txt: * UIProcess/API/APIContentRuleListStore.cpp: * UIProcess/API/APIHitTestResult.cpp: * UIProcess/API/APINavigation.cpp: * UIProcess/API/APIOpenPanelParameters.cpp: * UIProcess/API/APIPageConfiguration.cpp: * UIProcess/API/C/WKPage.cpp: (WKPageLoadURLWithShouldOpenExternalURLsPolicy): (WKPageLoadURLWithUserData): (WKPageLoadURLRequestWithUserData): (WKPageSetPaginationMode): (WKPageGetPaginationMode): (WKPageSetPageLoaderClient): (WKPageSetPagePolicyClient): * UIProcess/API/C/cg/WKIconDatabaseCG.cpp: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: * UIProcess/WebStorage/LocalStorageDatabase.cpp: * UIProcess/ios/WKContentView.mm: (-[WKContentView _commonInitializationWithProcessPool:configuration:]): (-[WKContentView initWithFrame:processPool:configuration:webView:]): (-[WKContentView dealloc]): (-[WKContentView page]): (-[WKContentView updateFixedClippingView:]): (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): (-[WKContentView _updateForScreen:]): (-[WKContentView _accessibilityRegisterUIProcessTokens]): (-[WKContentView _createDrawingAreaProxy]): (-[WKContentView _didCommitLayerTree:]): (-[WKContentView _wk_pageCountForPrintFormatter:]): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]): (hasAssistedNode): (-[WKContentView setupInteraction]): (-[WKContentView positionInformation]): (-[WKContentView _webTouchEventsRecognized:]): (inflateQuad): (-[WKContentView _updateTapHighlight]): (-[WKContentView _showTapHighlight]): (-[WKContentView _requiresKeyboardWhenFirstResponder]): (-[WKContentView _displayFormNodeInputView]): (-[WKContentView inputView]): (-[WKContentView _actionForLongPressFromPositionInformation:]): (-[WKContentView currentPositionInformation]): (-[WKContentView doAfterPositionInformationUpdate:forRequest:]): (-[WKContentView _currentPositionInformationIsValidForRequest:]): (-[WKContentView _hasValidOutstandingPositionInformationRequest:]): (-[WKContentView _currentPositionInformationIsApproximatelyValidForRequest:]): (-[WKContentView gestureRecognizerShouldBegin:]): (-[WKContentView hasSelectablePositionAtPoint:]): (-[WKContentView pointIsNearMarkedText:]): (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): (-[WKContentView webSelectionRectsForSelectionRects:]): (-[WKContentView _twoFingerSingleTapGestureRecognized:]): (-[WKContentView _stylusSingleTapRecognized:]): (-[WKContentView _singleTapCommited:]): (-[WKContentView _attemptClickAtLocation:]): (-[WKContentView _positionInformationDidChange:]): (-[WKContentView requiresAccessoryView]): (-[WKContentView supportedPasteboardTypesForCurrentSelection]): (-[WKContentView _lookupForWebView:]): (-[WKContentView _shareForWebView:]): (-[WKContentView textStylingAtPosition:inDirection:]): (-[WKContentView canPerformActionForWebView:withSender:]): (-[WKContentView selectForWebView:]): (-[WKContentView _accessibilityRetrieveRectsEnclosingSelectionOffset:withGranularity:]): (-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]): (toGestureType): (toUIWKGestureType): (toSelectionTouch): (toUIWKSelectionTouch): (toGestureRecognizerState): (toUIGestureRecognizerState): (toUIWKSelectionFlags): (toWKTextGranularity): (toWKSelectionDirection): (selectionChangedWithGesture): (selectionChangedWithTouch): (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]): (-[WKContentView autocorrectionData]): (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]): (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]): (-[WKContentView _updateAccessory]): (-[WKContentView selectedTextRange]): (-[WKContentView setMarkedText:selectedRange:]): (coreWritingDirection): (-[WKContentView closestPositionToPoint:]): (-[WKContentView insertText:]): (-[WKContentView textInputTraits]): (-[WKContentView handleKeyWebEvent:]): (-[WKContentView handleKeyWebEvent:withCompletionHandler:]): (-[WKContentView isScrollableForKeyboardScrollViewAnimator:]): (-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:]): (-[WKContentView assistedNodeInformation]): (-[WKContentView assistedNodeSelectOptions]): (isAssistableInputType): (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): (-[WKContentView _stopAssistingNode]): (-[WKContentView updateCurrentAssistedNodeInformation:]): (-[WKContentView presentViewControllerForCurrentAssistedNode]): (-[WKContentView actionNameForFocusedFormControlView:]): (-[WKContentView selectWordForReplacement]): (-[WKContentView _updateChangedSelection:]): (-[WKContentView _beginSuppressingSelectionAssistantForReason:]): (-[WKContentView _stopSuppressingSelectionAssistantForReason:]): (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]): (-[WKContentView _showRunOpenPanel:resultListener:]): (-[WKContentView _showShareSheet:completionHandler:]): (-[WKContentView positionInformationForActionSheetAssistant:]): (-[WKContentView updatePositionInformationForActionSheetAssistant:]): (-[WKContentView _startDrag:item:]): (-[WKContentView _didHandleAdditionalDragItemsRequest:]): (-[WKContentView _didHandleStartDataInteractionRequest:]): (dropOperationForWebCoreDragOperation): (-[WKContentView dragDataForDropSession:dragDestinationAction:]): (-[WKContentView _didConcludeEditDataInteraction:]): (-[WKContentView _didPerformDragOperation:]): (-[WKContentView _prepareToDragPromisedAttachment:]): (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]): (-[WKContentView _autofillContext]): (-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]): (-[WKContentView _dragInteraction:prepareForSession:completion:]): (-[WKContentView dragInteraction:itemsForBeginningSession:]): (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]): (-[WKContentView dragInteraction:session:didEndWithOperation:]): (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]): (-[WKContentView dropInteraction:performDrop:]): (-[WKContentView dropInteraction:sessionDidEnd:]): (-[WKContentView allowsLanguageSelectionMenuForListViewController:]): (-[WKContentView shouldDisplayInputContextViewForListViewController:]): (-[WKContentView numericInputModeForListViewController:]): (-[WKContentView textContentTypeForListViewController:]): (-[WKContentView allowsDictationInputForListViewController:]): (-[WKContentView _simulateLongPressActionAtLocation:]): (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]): (-[WKContentView _presentationRectsForPreviewItemController:]): * UIProcess/ios/fullscreen/WKFullScreenViewController.mm: (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface): (WKFullScreenViewControllerVideoFullscreenModelClient::setInterface): (WKFullScreenViewControllerVideoFullscreenModelClient::interface const): (-[WKFullScreenViewController videoControlsManagerDidChange]): (-[WKFullScreenViewController _manager]): (-[WKFullScreenViewController _togglePiPAction:]): * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: (-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]): (-[WKFullScreenWindowController isFullScreen]): (-[WKFullScreenWindowController enterFullScreen]): (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController exitFullScreen]): (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController _completedExitFullScreen]): (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]): (-[WKFullScreenWindowController _exitFullscreenImmediately]): (-[WKFullScreenWindowController _manager]): * UIProcess/mac/WebPageProxyMac.mm: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Cache/WebCacheStorageConnection.cpp: * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm: (mediaTimeToCurrentTime): (-[WKAnimationDelegate initWithLayerID:layerTreeHost:]): * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]): 2018-12-10 Don Olmstead Move ENABLE_RESOURCE_LOAD_STATISTICS to FeatureDefines.xcconfig https://bugs.webkit.org/show_bug.cgi?id=192573 Reviewed by Simon Fraser. * Configurations/FeatureDefines.xcconfig: 2018-12-10 Youenn Fablet Remove derived classes of RealtimeMediaSourceCenter https://bugs.webkit.org/show_bug.cgi?id=192546 Reviewed by Eric Carlson. pdate code according WebCore changes. * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp: (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints): * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::~UserMediaCaptureManager): (WebKit::UserMediaCaptureManager::initialize): 2018-12-10 Tim Horton Animated scrolling on Google Maps scrolls the page in addition to moving the map https://bugs.webkit.org/show_bug.cgi?id=192521 Reviewed by Sam Weinig. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKKeyboardScrollingAnimator.mm: (-[WKKeyboardScrollViewAnimator rubberbandableDirections]): Only do keyboard-based rubber-banding in directions that we can actually scroll, not directions we can only finger-rubber-band in. This effectively means keyboard scrolling will ignore "alwaysBounce{Vertical, Horizontal}". 2018-12-10 Commit Queue Unreviewed, rolling out r239023. https://bugs.webkit.org/show_bug.cgi?id=192571 Speculative rollout due to broken perf test (Requested by deanj on #webkit). Reverted changeset: "Enable HTTP and HTTPS proxies on iOS and make it a property of the NSURLSession" https://bugs.webkit.org/show_bug.cgi?id=192374 https://trac.webkit.org/changeset/239023 2018-12-10 Wenson Hsieh Unreviewed, fix the iOS build after r239039. https://bugs.webkit.org/show_bug.cgi?id=192568 * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView dropInteraction:sessionDidUpdate:]): 2018-12-10 Alex Christensen Fix WatchOS build. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView actionNameForFocusedFormControlView:]): 2018-12-10 Matt Lewis Unreviewed, rolling out r239029. This patch caused internal build failures. Reverted changeset: "[meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds" https://bugs.webkit.org/show_bug.cgi?id=192449 https://trac.webkit.org/changeset/239029 2018-12-10 Chris Dumez Add SPI to allow the client to set the user-agent at main frame level, from the UIProcess https://bugs.webkit.org/show_bug.cgi?id=192509 Reviewed by Alex Christensen. Add SPI to allow the client to set the user-agent at main frame level, from the UIProcess instead of doing it at resource-level from the injected bundle. The custom user-agent string can now be set on _WKWebsitePolicies during the decidePolicyForNavigationAction for the main feame, and will impact this main resource load as well as its future subresource loads. * Shared/WebsitePoliciesData.cpp: (WebKit::WebsitePoliciesData::encode const): (WebKit::WebsitePoliciesData::decode): (WebKit::WebsitePoliciesData::applyToDocumentLoader): * Shared/WebsitePoliciesData.h: * UIProcess/API/APIWebsitePolicies.cpp: (API::WebsitePolicies::data): * UIProcess/API/APIWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.h: * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies setCustomUserAgent:]): (-[_WKWebsitePolicies customUserAgent]): * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): 2018-12-10 Alex Christensen Safe browsing warning should layout buttons vertically in narrow WKWebViews https://bugs.webkit.org/show_bug.cgi?id=192535 Reviewed by Tim Horton. They're usually next to each other, but in narrow WKWebViews they currently get clipped. In order to make it more likely that both buttons are completely visible, put one above the other if the WKWebView is too narrow to completely show both. This also helps with languages where the translations of "Go Back" or "Show Details" are rendered wider than English. * UIProcess/Cocoa/WKSafeBrowsingWarning.mm: (buttonWidth): (-[WKSafeBrowsingWarning addContent]): 2018-12-10 Simon Fraser Allow control over child order when adding nodes to the scrolling tree https://bugs.webkit.org/show_bug.cgi?id=176914 Re-land r239010 after over-zealous rollout. * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: (WebKit::RemoteScrollingCoordinatorTransaction::decode): 2018-12-10 Wenson Hsieh [iOS] Caret is obscured by finger when dragging over an editable element https://bugs.webkit.org/show_bug.cgi?id=192499 Reviewed by Tim Horton. Add support for setting the `precise` property of `UIDropProposal` to YES when dragging over an editable area. When enabled, this property shifts the drop location up by a small amount, allowing the user to see the drop caret (currently, this is not the case, and it's difficult to drop text at a precise location on iOS). Changes are covered by adding to existing API tests. * Scripts/webkit/messages.py: * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Add a new version of `-_webView:willUpdateDataInteractionOperationToOperation:forSession:` that receives and returns a UIDropProposal, so that Mail can more easily port over existing logic in its legacy-WebKit-based compose implementation. iOS Safari is currently the only client of this private delegate, so the old version can be easily removed once Safari adopts this new version. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didPerformDragControllerAction): Add plumbing to send the latest drag handling method from WebPage to WebPageProxy. (WebKit::WebPageProxy::resetCurrentDragInformation): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::currentDragHandlingMethod const): * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView dropInteraction:sessionDidUpdate:]): Call the new UI delegate hook when determining the drop proposal to return to UIKit. Additionally set the `precise` bit on the drop proposal in the case where the drop handling method is either "editing rich text" or "editing plain text". * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performDragControllerAction): * WebProcess/WebPage/WebPage.h: 2018-12-10 Youenn Fablet Make mock capture happen in the process used for real capture https://bugs.webkit.org/show_bug.cgi?id=192544 Reviewed by Eric Carlson. Make mock capture happen in the right process by only overriding factories by mock factories for source types that UserMediaCaptureManager will not override. That way, UserMediaCaptureManager will be used to go to UIProcess, where mock will be used as if it was the real capture. * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::initialize): 2018-12-10 Alexey Proskuryakov Move ENABLE_SEC_ITEM_SHIM out of WebKit's config.h https://bugs.webkit.org/show_bug.cgi?id=192428 Reviewed by Tim Horton. * config.h: 2018-12-10 Alexey Proskuryakov Move more macros out of WebKit's config.h https://bugs.webkit.org/show_bug.cgi?id=192430 Reviewed by Tim Horton. * config.h: 2018-12-10 Chris Fleizach [meta][WebKit] Remove using namespace WebCore and WebKit in the global scope for unified source builds https://bugs.webkit.org/show_bug.cgi?id=192449 Reviewed by Darin Adler. * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm: * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp: * NetworkProcess/ios/NetworkProcessIOS.mm: * NetworkProcess/mac/NetworkProcessMac.mm: * NetworkProcess/mac/RemoteNetworkingContext.mm: * Platform/spi/ios/AccessibilitySupportSPI.h: * PlatformMac.cmake: * PluginProcess/PluginControllerProxy.cpp: * PluginProcess/PluginProcess.cpp: * PluginProcess/WebProcessConnection.cpp: * Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb: * Shared/API/c/cf/WKErrorCF.cpp: (WKErrorCreateWithCFError): (WKErrorCopyCFError): * Shared/API/c/cg/WKImageCG.cpp: (WKImageCreateCGImage): (WKImageCreateFromCGImage): * Shared/ChildProcess.cpp: * Shared/ContextMenuContextData.cpp: * Shared/EditorState.cpp: * Shared/Plugins/NPIdentifierData.cpp: * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm: * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: * Shared/SessionState.cpp: * Shared/SessionTracker.cpp: * Shared/ShareableBitmap.cpp: * Shared/ShareableResource.cpp: * Shared/VisibleContentRectUpdateInfo.cpp: * Shared/WebBackForwardListItem.cpp: * Shared/WebContextMenuItemData.cpp: * Shared/WebCoreArgumentCoders.cpp: * Shared/WebHitTestResultData.cpp: * Shared/WebImage.cpp: * Shared/WebMediaSessionMetadata.cpp: * Shared/WebMemorySampler.cpp: * Shared/WebMouseEvent.cpp: * Shared/WebRenderObject.cpp: * Shared/WebSQLiteDatabaseTracker.cpp: * Shared/WebWheelEvent.cpp: * Shared/cf/ArgumentCodersCF.cpp: * Shared/ios/WebPlatformTouchPointIOS.cpp: * SourcesCocoa.txt: * UIProcess/API/APIContentRuleListStore.cpp: * UIProcess/API/APIHitTestResult.cpp: * UIProcess/API/APINavigation.cpp: * UIProcess/API/APIOpenPanelParameters.cpp: * UIProcess/API/APIPageConfiguration.cpp: * UIProcess/API/C/WKPage.cpp: (WKPageLoadURLWithShouldOpenExternalURLsPolicy): (WKPageLoadURLWithUserData): (WKPageLoadURLRequestWithUserData): (WKPageSetPaginationMode): (WKPageGetPaginationMode): (WKPageSetPageLoaderClient): (WKPageSetPagePolicyClient): * UIProcess/API/C/cg/WKIconDatabaseCG.cpp: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: * UIProcess/WebStorage/LocalStorageDatabase.cpp: * UIProcess/ios/WKContentView.mm: (-[WKContentView _commonInitializationWithProcessPool:configuration:]): (-[WKContentView initWithFrame:processPool:configuration:webView:]): (-[WKContentView dealloc]): (-[WKContentView page]): (-[WKContentView updateFixedClippingView:]): (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): (-[WKContentView _updateForScreen:]): (-[WKContentView _accessibilityRegisterUIProcessTokens]): (-[WKContentView _createDrawingAreaProxy]): (-[WKContentView _didCommitLayerTree:]): (-[WKContentView _wk_pageCountForPrintFormatter:]): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]): (hasAssistedNode): (-[WKContentView setupInteraction]): (-[WKContentView positionInformation]): (-[WKContentView _webTouchEventsRecognized:]): (inflateQuad): (-[WKContentView _updateTapHighlight]): (-[WKContentView _showTapHighlight]): (-[WKContentView _requiresKeyboardWhenFirstResponder]): (-[WKContentView _displayFormNodeInputView]): (-[WKContentView inputView]): (-[WKContentView _actionForLongPressFromPositionInformation:]): (-[WKContentView currentPositionInformation]): (-[WKContentView doAfterPositionInformationUpdate:forRequest:]): (-[WKContentView _currentPositionInformationIsValidForRequest:]): (-[WKContentView _hasValidOutstandingPositionInformationRequest:]): (-[WKContentView _currentPositionInformationIsApproximatelyValidForRequest:]): (-[WKContentView gestureRecognizerShouldBegin:]): (-[WKContentView hasSelectablePositionAtPoint:]): (-[WKContentView pointIsNearMarkedText:]): (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]): (-[WKContentView webSelectionRectsForSelectionRects:]): (-[WKContentView _twoFingerSingleTapGestureRecognized:]): (-[WKContentView _stylusSingleTapRecognized:]): (-[WKContentView _singleTapCommited:]): (-[WKContentView _attemptClickAtLocation:]): (-[WKContentView _positionInformationDidChange:]): (-[WKContentView requiresAccessoryView]): (-[WKContentView supportedPasteboardTypesForCurrentSelection]): (-[WKContentView _lookupForWebView:]): (-[WKContentView _shareForWebView:]): (-[WKContentView textStylingAtPosition:inDirection:]): (-[WKContentView canPerformActionForWebView:withSender:]): (-[WKContentView selectForWebView:]): (-[WKContentView _accessibilityRetrieveRectsEnclosingSelectionOffset:withGranularity:]): (-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]): (toGestureType): (toUIWKGestureType): (toSelectionTouch): (toUIWKSelectionTouch): (toGestureRecognizerState): (toUIGestureRecognizerState): (toUIWKSelectionFlags): (toWKTextGranularity): (toWKSelectionDirection): (selectionChangedWithGesture): (selectionChangedWithTouch): (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]): (-[WKContentView autocorrectionData]): (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]): (-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]): (-[WKContentView _updateAccessory]): (-[WKContentView selectedTextRange]): (-[WKContentView setMarkedText:selectedRange:]): (coreWritingDirection): (-[WKContentView closestPositionToPoint:]): (-[WKContentView insertText:]): (-[WKContentView textInputTraits]): (-[WKContentView handleKeyWebEvent:]): (-[WKContentView handleKeyWebEvent:withCompletionHandler:]): (-[WKContentView isScrollableForKeyboardScrollViewAnimator:]): (-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:]): (-[WKContentView assistedNodeInformation]): (-[WKContentView assistedNodeSelectOptions]): (isAssistableInputType): (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): (-[WKContentView _stopAssistingNode]): (-[WKContentView updateCurrentAssistedNodeInformation:]): (-[WKContentView presentViewControllerForCurrentAssistedNode]): (-[WKContentView actionNameForFocusedFormControlView:]): (-[WKContentView selectWordForReplacement]): (-[WKContentView _updateChangedSelection:]): (-[WKContentView _beginSuppressingSelectionAssistantForReason:]): (-[WKContentView _stopSuppressingSelectionAssistantForReason:]): (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]): (-[WKContentView _showRunOpenPanel:resultListener:]): (-[WKContentView _showShareSheet:completionHandler:]): (-[WKContentView positionInformationForActionSheetAssistant:]): (-[WKContentView updatePositionInformationForActionSheetAssistant:]): (-[WKContentView _startDrag:item:]): (-[WKContentView _didHandleAdditionalDragItemsRequest:]): (-[WKContentView _didHandleStartDataInteractionRequest:]): (dropOperationForWebCoreDragOperation): (-[WKContentView dragDataForDropSession:dragDestinationAction:]): (-[WKContentView _didConcludeEditDataInteraction:]): (-[WKContentView _didPerformDragOperation:]): (-[WKContentView _prepareToDragPromisedAttachment:]): (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]): (-[WKContentView _autofillContext]): (-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]): (-[WKContentView _dragInteraction:prepareForSession:completion:]): (-[WKContentView dragInteraction:itemsForBeginningSession:]): (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]): (-[WKContentView dragInteraction:session:didEndWithOperation:]): (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]): (-[WKContentView dropInteraction:performDrop:]): (-[WKContentView dropInteraction:sessionDidEnd:]): (-[WKContentView allowsLanguageSelectionMenuForListViewController:]): (-[WKContentView shouldDisplayInputContextViewForListViewController:]): (-[WKContentView numericInputModeForListViewController:]): (-[WKContentView textContentTypeForListViewController:]): (-[WKContentView allowsDictationInputForListViewController:]): (-[WKContentView _simulateLongPressActionAtLocation:]): (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]): (-[WKContentView _presentationRectsForPreviewItemController:]): * UIProcess/ios/fullscreen/WKFullScreenViewController.mm: (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface): (WKFullScreenViewControllerVideoFullscreenModelClient::setInterface): (WKFullScreenViewControllerVideoFullscreenModelClient::interface const): (-[WKFullScreenViewController videoControlsManagerDidChange]): (-[WKFullScreenViewController _manager]): (-[WKFullScreenViewController _togglePiPAction:]): * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: (-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]): (-[WKFullScreenWindowController isFullScreen]): (-[WKFullScreenWindowController enterFullScreen]): (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController exitFullScreen]): (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController _completedExitFullScreen]): (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]): (-[WKFullScreenWindowController _exitFullscreenImmediately]): (-[WKFullScreenWindowController _manager]): * UIProcess/mac/WebPageProxyMac.mm: * WebKit.xcodeproj/project.pbxproj: * WebProcess/Cache/WebCacheStorageConnection.cpp: * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm: (mediaTimeToCurrentTime): (-[WKAnimationDelegate initWithLayerID:layerTreeHost:]): * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]): 2018-12-10 Tim Horton WKWebView should support custom tintColor https://bugs.webkit.org/show_bug.cgi?id=192518 Reviewed by Wenson Hsieh. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView insertionPointColor]): (-[WKContentView selectionBarColor]): (-[WKContentView selectionHighlightColor]): Grab insertion point and selection colors from UITextInputTraits. (-[WKContentView _updateInteractionTintColor]): Determine our effective tint color: - transparent if interaction is disabled - a CSS-derived color if caret-color style is applied - the _inheritedInteractionTintColor, which climbs up to the tintColor API Apply it to our UITextInputTraits. (-[WKContentView tintColorDidChange]): (-[WKContentView textInputTraits]): Call _updateInteractionTintColor whenever we create a new UITextInputTraits or when the tint color changes. 2018-12-09 Youenn Fablet Move capture manager from RealtimeMediaSourceCenter to capture factory https://bugs.webkit.org/show_bug.cgi?id=192542 Reviewed by Eric Carlson. Make sure to unregister for video capture as done for other capture types. Implement manager which should be doing nothing as the manager is used for enumeration of devices which should only happen in UIProcess. Given that mock capture is interfering with UserMediaCaptureManager, switching on/off mock capture will require creating a new process. This shortcoming should be fixed once mock capture will be fully happening in the same process as regular capture. * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::~UserMediaCaptureManager): * WebProcess/cocoa/UserMediaCaptureManager.h: 2018-12-09 Saam barati Enable HTTP and HTTPS proxies on iOS and make it a property of the NSURLSession https://bugs.webkit.org/show_bug.cgi?id=192374 Reviewed by Alex Christensen. This patch makes it so that we can use HTTP/HTTPS proxies on iOS as well. To enable on iOS, you can do something like: $ defaults write -g WebKit2HTTPProxy -string "http://localhost:8080" $ defaults write -g WebKit2HTTPSProxy -string "http://localhost:8080" This patch also changes the Proxy to be enabled on a per NSURLSession basis instead of a per process basis. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/NetworkSessionCreationParameters.cpp: (WebKit::NetworkSessionCreationParameters::privateSessionParameters): (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/NetworkSessionCreationParameters.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::proxyDictionary): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * NetworkProcess/mac/NetworkProcessMac.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcess): (WebKit::overrideSystemProxies): Deleted. * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _initWithConfiguration:]): * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration httpProxy]): (-[_WKWebsiteDataStoreConfiguration setHTTPProxy:]): (-[_WKWebsiteDataStoreConfiguration httpsProxy]): (-[_WKWebsiteDataStoreConfiguration setHTTPSProxy:]): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: (WebKit::WebsiteDataStoreConfiguration::copy): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: (WebKit::WebsiteDataStoreConfiguration::httpProxy const): (WebKit::WebsiteDataStoreConfiguration::setHTTPProxy): (WebKit::WebsiteDataStoreConfiguration::httpsProxy const): (WebKit::WebsiteDataStoreConfiguration::setHTTPSProxy): 2018-12-09 Adrian Perez de Castro Build failure due to missing include of APIWebsiteDataStore.h https://bugs.webkit.org/show_bug.cgi?id=192541 Reviewed by Youenn Fablet. * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: Add missing include of APIWebsiteDataStore.h 2018-12-09 Wenson Hsieh [iOS device] Crash when attempting to call -[_WKAttachment info] for an editable image https://bugs.webkit.org/show_bug.cgi?id=192538 Reviewed by Tim Horton. Fix the crash by ensuring that the result of `-renderedDrawing` survives long enough to be wrapped by a `RetainPtr` in `-PNGRepresentation`. This isn't currently testable, since this codepath isn't supported on the iOS simulator; instead, I manually verified using MobileAttachments.app. * UIProcess/ios/WKDrawingView.mm: (-[WKDrawingView renderedDrawing]): 2018-12-09 Commit Queue Unreviewed, rolling out r239010. https://bugs.webkit.org/show_bug.cgi?id=192537 Breaks fast/visual-viewport/tiled-drawing/zoomed-fixed- scrolling-layers-state.html again (Requested by ap on #webkit). Reverted changeset: "Allow control over child order when adding nodes to the scrolling tree" https://bugs.webkit.org/show_bug.cgi?id=176914 https://trac.webkit.org/changeset/239010 2018-12-08 Alex Christensen Don't programmatically capitalize safe browsing warning buttons https://bugs.webkit.org/show_bug.cgi?id=192531 Reviewed by Darin Adler. * UIProcess/Cocoa/WKSafeBrowsingWarning.mm: (makeButton): 2018-12-08 Alex Christensen Safe browsing warning should respect text size from settings https://bugs.webkit.org/show_bug.cgi?id=192205 Reviewed by Tim Horton. * UIProcess/Cocoa/WKSafeBrowsingWarning.mm: (fontWithSize): (makeButton): (-[WKSafeBrowsingWarning addContent]): (-[WKSafeBrowsingWarning showDetailsClicked]): 2018-12-08 Frederic Wang Allow control over child order when adding nodes to the scrolling tree https://bugs.webkit.org/show_bug.cgi?id=176914 Reviewed by Simon Fraser. Based on an earlier patch by Simon Fraser. * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: (WebKit::RemoteScrollingCoordinatorTransaction::decode): 2018-12-07 Rob Buis Remove unused API in NetworkProcess https://bugs.webkit.org/show_bug.cgi?id=192415 Reviewed by Alex Christensen. This patch removed some unused API and headers in NetworkProcess. * NetworkProcess/NetworkCORSPreflightChecker.cpp: (WebKit::NetworkCORSPreflightChecker::startPreflight): * NetworkProcess/NetworkCORSPreflightChecker.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkContentRuleListManager.h: * NetworkProcess/NetworkDataTask.cpp: * NetworkProcess/NetworkDataTask.h: * NetworkProcess/NetworkDataTaskBlob.cpp: * NetworkProcess/NetworkLoad.cpp: * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkLoadChecker.cpp: * NetworkProcess/NetworkLoadChecker.h: * NetworkProcess/NetworkLoadClient.h: * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkProcess.cpp: * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didReceiveBuffer): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/NetworkSession.cpp: * NetworkProcess/NetworkSession.h: * NetworkProcess/NetworkSocketStream.cpp: * NetworkProcess/NetworkSocketStream.h: * NetworkProcess/PingLoad.cpp: (WebKit::PingLoad::PingLoad): * NetworkProcess/PingLoad.h: * NetworkProcess/PreconnectTask.cpp: (WebKit::PreconnectTask::PreconnectTask): (WebKit::PreconnectTask::frameID const): Deleted. (WebKit::PreconnectTask::pageID const): Deleted. * NetworkProcess/PreconnectTask.h: 2018-12-07 Eric Carlson [MediaStream] 'devicechange' event should not fire in frames that can't access capture devices https://bugs.webkit.org/show_bug.cgi?id=192511 Reviewed by Youenn Fablet. * UIProcess/UserMediaPermissionCheckProxy.cpp: (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): Remove userMediaID parameter. (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): ID not passed to callback. * UIProcess/UserMediaPermissionCheckProxy.h: (WebKit::UserMediaPermissionCheckProxy::create): (WebKit::UserMediaPermissionCheckProxy::completionHandler): Deleted. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::generateRequestID): New. (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged): Don't notify if the page does not have a granted request and does not have persistent access. (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Use generateRequestID. (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Change variable name. (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Use generateRequestID. * UIProcess/UserMediaPermissionRequestManagerProxy.h: 2018-12-07 Saam Barati WKWebProcessPlugInLoadDelegate should have API for saying which rendering events it wants to listen for https://bugs.webkit.org/show_bug.cgi?id=192473 Reviewed by Andy Estes. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (PageLoaderClient::layoutMilestones const): 2018-12-07 Youenn Fablet Update libwebrtc up to 0d007d7c4f https://bugs.webkit.org/show_bug.cgi?id=192316 Reviewed by Eric Carlson. Update code base according new libwebrtc backend In particular, use directly int64_t for packet time. * Configurations/WebKit.xcconfig: * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp: (WebKit::LibWebRTCSocketClient::signalReadPacket): * NetworkProcess/webrtc/LibWebRTCSocketClient.h: * NetworkProcess/webrtc/NetworkRTCProvider.cpp: * NetworkProcess/webrtc/NetworkRTCSocket.h: * WebProcess/Network/webrtc/LibWebRTCSocket.cpp: (WebKit::LibWebRTCSocket::signalReadPacket): 2018-12-07 Truitt Savell Unreviewed, rolling out r238947. Revision caused fast/visual-viewport/tiled-drawing/zoomed- fixed-scrolling-layers-state.html to constantly fail Reverted changeset: "Allow control over child order when adding nodes to the scrolling tree" https://bugs.webkit.org/show_bug.cgi?id=176914 https://trac.webkit.org/changeset/238947 2018-12-06 David Kilzer Injected bundle for WebKitTestRunner leaks WKTypeRef objects Reviewed by Simon Fraser. Change function parameter name from `returnData[Ref]` to `returnRetainedData[Ref]` to document that the value returned is a +1 retained WKTypeRef object. * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundlePostSynchronousMessage): * WebProcess/InjectedBundle/API/c/WKBundle.h: * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePagePostSynchronousMessageForTesting): * WebProcess/InjectedBundle/API/c/WKBundlePage.h: 2018-12-06 Frederic Wang Allow control over child order when adding nodes to the scrolling tree https://bugs.webkit.org/show_bug.cgi?id=176914 Reviewed by Simon Fraser. Based on an earlier patch by Simon Fraser. * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: (WebKit::RemoteScrollingCoordinatorTransaction::decode): Make explicit that we want to append the new node at the end of child list. 2018-12-06 Yongjun Zhang We should ignore minimumEffectiveDeviceWidth if the page specifies device-width in viewport meta-tag. https://bugs.webkit.org/show_bug.cgi?id=192377 Reviewed by Tim Horton. Since we are using page's viewport arguments to decide the default viewport parameters and whether we can use mininum effective device width, we should always call setViewportArguments() regardless of shouldIgnoreMetaViewport settings. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::viewportPropertiesDidChange): Always call setViewportArguments(). (WebKit::WebPage::didCommitLoad): Ditto. 2018-12-06 Tim Horton Web Share API: share overlay does not stick to the Safari window https://bugs.webkit.org/show_bug.cgi?id=192469 Reviewed by Wenson Hsieh. * UIProcess/Cocoa/WKShareSheet.mm: (-[WKShareSheet sharingServicePicker:didChooseSharingService:]): (-[WKShareSheet sharingServicePicker:delegateForSharingService:]): (-[WKShareSheet sharingService:sourceWindowForShareItems:sharingContentScope:]): (-[WKShareSheet sharingService:didFailToShareItems:error:]): (-[WKShareSheet sharingService:didShareItems:]): Implement another NSSharingServicePickerDelegate method to return an *NSSharingService* delegate when needed. Implement an NSSharingServiceDelegate method to return the window that the service's UI should attach to. Also, instead of notifying the Web Content process when a service is picked (or not) in the NSSharingServicePicker, wait until the share has completed (or failed) to send didComplete. This both makes the return completion value more accurate (matching iOS, if you cancel the share during the recipient choice step, it will now fail), and avoids explicitly tearing down the NSSharingServicePicker too early, which breaks the UI attaching mechanism. 2018-12-06 Wenson Hsieh [iOS] WKWebView should match UITextView behavior when editing text with an RTL keyboard https://bugs.webkit.org/show_bug.cgi?id=187554 Reviewed by Tim Horton. Add support for automatically switching the base writing direction to the default writing direction with respect to the current keyboard in an editable WKWebView by implementing `-setBaseWritingDirection:forRange:`. On iOS 12 and earlier, UIKit invokes this protocol method whenever the keyboard is changed to one with a different writing direction, although in some other versions of iOS, this only happens when first focusing an editable area. Test: editing/input/ios/rtl-keyboard-input-on-focus.html * Platform/spi/ios/UIKitSPI.h: Declare UIKeyboardImpl IPI methods mostly for use in WebKitTestRunner (with the exception of `-setInitialDirection`, which we may invoke when we receive the first post-layout EditorState update after focusing an editable element). * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::increaseListLevel): (WebKit::WebPageProxy::decreaseListLevel): (WebKit::WebPageProxy::changeListType): (WebKit::WebPageProxy::setBaseWritingDirection): Drive-by style fixes: make these bail and return early if `!isValid()`. (WebKit::WebPageProxy::resetStateAfterProcessExited): Reset assisted node state in the UI process upon web process termination. * UIProcess/WebPageProxy.h: Add plumbing for `setBaseWritingDirection`, from `WebPageProxy` to `WebPage` to `Editor`. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didReceiveEditorStateUpdateAfterFocus): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView baseWritingDirectionForPosition:inDirection:]): (coreWritingDirection): (-[WKContentView setBaseWritingDirection:forRange:]): Support `-setBaseWritingDirectionForPosition:forRange:`, but only in the case where the given range is the selected range. This is all that's currently needed to fulfill the requirements in , though we could potentially add full support for this in the future by mapping the given text range to a DOM range and moving the selection prior to setting the base writing direction. (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]): Add a hook to notify WKContentView when the first post-layout EditorState has been received in the UI process. When this is invoked, if the web view is editable and the selection is not a range, we call into `UIKeyboardImpl` to change the initial writing direction if necessary. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::startAssistingNode): (WebKit::WebPageProxy::stopAssistingNode): (WebKit::WebPageProxy::editorStateChanged): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setBaseWritingDirection): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2018-12-06 David Quesada -[WKProcessPool _resumeDownloadFromData:path:] should allow specifying the originating web view https://bugs.webkit.org/show_bug.cgi?id=192411 rdar://problem/46492487 Reviewed by Alex Christensen. * UIProcess/API/C/WKContext.cpp: (WKContextResumeDownload): * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _resumeDownloadFromData:path:originatingWebView:]): (-[WKProcessPool _resumeDownloadFromData:path:]): Deleted. * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::resumeDownload): - Set the originating page of the DownloadProxy. - If the originating page is non-null, use its session ID for the download. - Remove a FIXME. It's possible to do this now by providing the web view whose session should be used for the download. * UIProcess/WebProcessPool.h: 2018-12-06 Jiewen Tan Unreviewed, a quick fix after r238919 Add an early return such that the error message is actually meaningful. * UIProcess/WebAuthentication/Mock/MockHidService.cpp: (WebKit::MockHidService::platformStartDiscovery): 2018-12-06 Alex Christensen Remove unused LoaderStrategy::storeDerivedDataToCache and associated dead code https://bugs.webkit.org/show_bug.cgi?id=192452 Reviewed by Anders Carlsson. This was introduced in r210835 but never used. It's preventing me from making the disk cache associated with a SessionID/NetworkSession. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache): Deleted. * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode const): (WebKit::NetworkResourceLoadParameters::decode): * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::continueDidReceiveResponse): (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): (WebKit::NetworkResourceLoader::continueProcessingCachedEntryAfterDidReceiveResponse): Deleted. * NetworkProcess/NetworkResourceLoader.h: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): (WebKit::WebLoaderStrategy::storeDerivedDataToCache): Deleted. * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didRetrieveDerivedData): Deleted. * WebProcess/Network/WebResourceLoader.messages.in: 2018-12-06 Carlos Eduardo Ramalho REGRESSION(r231043): [GTK] Undefined references to WebCore::LayerRepresentation::* with -DENABLE_OPENGL=OFF builds https://bugs.webkit.org/show_bug.cgi?id=191997 Reviewed by Philippe Normand. Fix build with -DENABLE_OPENGL=OFF and -DENABLE_VIDEO=OFF. * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): add required #if ENABLE(ASYNC_SCROLLING) 2018-12-05 Ryosuke Niwa REGRESSION(PSON): Process swapping code doesn't set DisplayID in WebContent process https://bugs.webkit.org/show_bug.cgi?id=192290 Reviewed by Simon Fraser. Fixed the bug by updating the DisplayID upon attaching to a WebContent process after a process swap as well as after the previous WebContent process had crashed. Unfortunately no new tests since WebKitTestRunner / DumpRenderTree should use 0 as DisplayID as they have an off-screen NSWindow. The issue that this results in no fallback for the animation timer is tracked by webkit.org/b/192448. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::didRelaunchProcess): 2018-12-05 Youenn Fablet Remove a document entry from NetworkMDNSRegister::m_services when document goes away https://bugs.webkit.org/show_bug.cgi?id=192429 Reviewed by Eric Carlson. * NetworkProcess/webrtc/NetworkMDNSRegister.cpp: (WebKit::NetworkMDNSRegister::unregisterMDNSNames): We should remove the entry to limit the size of the map. 2018-12-05 Jiewen Tan [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky https://bugs.webkit.org/show_bug.cgi?id=192061 Reviewed by Dewei Zhu. Part 1. Add some loggings to determine possible causes for the flakiness. * UIProcess/WebAuthentication/Cocoa/HidService.mm: (WebKit::HidService::continueAddDeviceAfterGetInfo): * UIProcess/WebAuthentication/Mock/MockHidService.cpp: (WebKit::MockHidService::platformStartDiscovery): 2018-12-05 Chris Dumez Simplify logic inside WebPageProxy::continueNavigationInNewProcess() https://bugs.webkit.org/show_bug.cgi?id=192404 Reviewed by Alex Christensen. Simplify get the item state from the current back/forward list item, instead of relying on WebBackForwardList::filteredItemStates(). * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::continueNavigationInNewProcess): 2018-12-05 Youenn Fablet Enable the possibility to do video capture in UIProcess https://bugs.webkit.org/show_bug.cgi?id=192394 Reviewed by Eric Carlson. Add two web preferences to toggle audio/video capture in UIProcess or WebProcess. Add mechanism for video capture that was not implemented yet. * Shared/WebPreferences.yaml: * Shared/WebPreferencesDefaultValues.h: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetCaptureAudioInUIProcessEnabled): (WKPreferencesGetCaptureAudioInUIProcessEnabled): (WKPreferencesSetCaptureVideoInUIProcessEnabled): (WKPreferencesGetCaptureVideoInUIProcessEnabled): * UIProcess/API/C/WKPreferencesRef.h: * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::updateBoolValueForInternalDebugFeatureKey): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::initializeNewWebProcess): (WebKit::WebProcessPool::createWebPage): * WebProcess/cocoa/UserMediaCaptureManager.cpp: (WebKit::UserMediaCaptureManager::initialize): 2018-12-05 Alex Christensen Make WebsiteDataStoreConfiguration a proper API object https://bugs.webkit.org/show_bug.cgi?id=192380 Reviewed by Youenn Fablet. In the immediate future I'll need to add things to _WKWebsiteDataStoreConfiguration. Instead of making ivars, setting them, copying them to a local object, make this a wrapper of an API::Object like all our other ObjC API objects are. * Shared/API/APIObject.h: (API::Object::wrapper const): (API::Object::wrapper): Deleted. * Shared/Cocoa/APIObject.mm: (API::Object::ref const): (API::Object::deref const): (API::Object::newObject): (API::Object::ref): Deleted. (API::Object::deref): Deleted. * Sources.txt: * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/APIWebsiteDataStore.cpp: (API::WebsiteDataStore::createLegacy): (API::WebsiteDataStore::WebsiteDataStore): (API::WebsiteDataStore::legacyDefaultDataStoreConfiguration): * UIProcess/API/APIWebsiteDataStore.h: * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm: (API::WebsiteDataStore::defaultDataStoreConfiguration): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _initWithConfiguration:]): * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: (-[_WKWebsiteDataStoreConfiguration _webStorageDirectory]): (-[_WKWebsiteDataStoreConfiguration _setWebStorageDirectory:]): (-[_WKWebsiteDataStoreConfiguration _indexedDBDatabaseDirectory]): (-[_WKWebsiteDataStoreConfiguration _setIndexedDBDatabaseDirectory:]): (-[_WKWebsiteDataStoreConfiguration _webSQLDatabaseDirectory]): (-[_WKWebsiteDataStoreConfiguration _setWebSQLDatabaseDirectory:]): (-[_WKWebsiteDataStoreConfiguration _cookieStorageFile]): (-[_WKWebsiteDataStoreConfiguration _setCookieStorageFile:]): (-[_WKWebsiteDataStoreConfiguration _resourceLoadStatisticsDirectory]): (-[_WKWebsiteDataStoreConfiguration _setResourceLoadStatisticsDirectory:]): (-[_WKWebsiteDataStoreConfiguration _cacheStorageDirectory]): (-[_WKWebsiteDataStoreConfiguration _setCacheStorageDirectory:]): (-[_WKWebsiteDataStoreConfiguration _serviceWorkerRegistrationDirectory]): (-[_WKWebsiteDataStoreConfiguration _setServiceWorkerRegistrationDirectory:]): (-[_WKWebsiteDataStoreConfiguration setSourceApplicationBundleIdentifier:]): (-[_WKWebsiteDataStoreConfiguration sourceApplicationBundleIdentifier]): (-[_WKWebsiteDataStoreConfiguration sourceApplicationSecondaryIdentifier]): (-[_WKWebsiteDataStoreConfiguration setSourceApplicationSecondaryIdentifier:]): (-[_WKWebsiteDataStoreConfiguration _apiObject]): * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfigurationInternal.h: Added. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters): * UIProcess/WebProcessPool.cpp: (WebKit::legacyWebsiteDataStoreConfiguration): (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::create): (WebKit::WebsiteDataStore::WebsiteDataStore): (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): (WebKit::WebsiteDataStore::fetchDataAndApply): (WebKit::WebsiteDataStore::removeData): (WebKit::WebsiteDataStore::parameters): (WebKit::WebsiteDataStore::Configuration::Configuration): Deleted. * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const): (WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota): (WebKit::WebsiteDataStore::cacheStorageDirectory const): (WebKit::WebsiteDataStore::setCacheStorageDirectory): (WebKit::WebsiteDataStore::serviceWorkerRegistrationDirectory const): (WebKit::WebsiteDataStore::setServiceWorkerRegistrationDirectory): (WebKit::WebsiteDataStore::resolvedApplicationCacheDirectory const): (WebKit::WebsiteDataStore::resolvedMediaCacheDirectory const): (WebKit::WebsiteDataStore::resolvedMediaKeysDirectory const): (WebKit::WebsiteDataStore::resolvedDatabaseDirectory const): (WebKit::WebsiteDataStore::resolvedJavaScriptConfigurationDirectory const): (WebKit::WebsiteDataStore::resolvedCookieStorageFile const): (WebKit::WebsiteDataStore::resolvedIndexedDatabaseDirectory const): (WebKit::WebsiteDataStore::resolvedServiceWorkerRegistrationDirectory const): (WebKit::WebsiteDataStore::resolvedResourceLoadStatisticsDirectory const): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: Added. (WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration): * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: Added. (WebKit::WebsiteDataStoreConfiguration::create): (WebKit::WebsiteDataStoreConfiguration::cacheStoragePerOriginQuota): (WebKit::WebsiteDataStoreConfiguration::setCacheStoragePerOriginQuota): (WebKit::WebsiteDataStoreConfiguration::applicationCacheDirectory const): (WebKit::WebsiteDataStoreConfiguration::setApplicationCacheDirectory): (WebKit::WebsiteDataStoreConfiguration::mediaCacheDirectory const): (WebKit::WebsiteDataStoreConfiguration::setMediaCacheDirectory): (WebKit::WebsiteDataStoreConfiguration::mediaKeysStorageDirectory const): (WebKit::WebsiteDataStoreConfiguration::setMediaKeysStorageDirectory): (WebKit::WebsiteDataStoreConfiguration::javaScriptConfigurationDirectory const): (WebKit::WebsiteDataStoreConfiguration::setJavaScriptConfigurationDirectory): (WebKit::WebsiteDataStoreConfiguration::webStorageDirectory const): (WebKit::WebsiteDataStoreConfiguration::setWebStorageDirectory): (WebKit::WebsiteDataStoreConfiguration::indexedDBDatabaseDirectory const): (WebKit::WebsiteDataStoreConfiguration::setIndexedDBDatabaseDirectory): (WebKit::WebsiteDataStoreConfiguration::webSQLDatabaseDirectory const): (WebKit::WebsiteDataStoreConfiguration::setWebSQLDatabaseDirectory): (WebKit::WebsiteDataStoreConfiguration::localStorageDirectory const): (WebKit::WebsiteDataStoreConfiguration::setLocalStorageDirectory): (WebKit::WebsiteDataStoreConfiguration::cookieStorageFile const): (WebKit::WebsiteDataStoreConfiguration::setCookieStorageFile): (WebKit::WebsiteDataStoreConfiguration::resourceLoadStatisticsDirectory const): (WebKit::WebsiteDataStoreConfiguration::setResourceLoadStatisticsDirectory): (WebKit::WebsiteDataStoreConfiguration::networkCacheDirectory const): (WebKit::WebsiteDataStoreConfiguration::setNetworkCacheDirectory): (WebKit::WebsiteDataStoreConfiguration::cacheStorageDirectory const): (WebKit::WebsiteDataStoreConfiguration::setCacheStorageDirectory): (WebKit::WebsiteDataStoreConfiguration::applicationCacheFlatFileSubdirectoryName const): (WebKit::WebsiteDataStoreConfiguration::setApplicationCacheFlatFileSubdirectoryName): (WebKit::WebsiteDataStoreConfiguration::serviceWorkerRegistrationDirectory const): (WebKit::WebsiteDataStoreConfiguration::setServiceWorkerRegistrationDirectory): (WebKit::WebsiteDataStoreConfiguration::sourceApplicationBundleIdentifier const): (WebKit::WebsiteDataStoreConfiguration::setSourceApplicationBundleIdentifier): (WebKit::WebsiteDataStoreConfiguration::sourceApplicationSecondaryIdentifier const): (WebKit::WebsiteDataStoreConfiguration::setSourceApplicationSecondaryIdentifier): * WebKit.xcodeproj/project.pbxproj: 2018-12-05 Wenson Hsieh Turn WritingDirection into an enum class https://bugs.webkit.org/show_bug.cgi?id=192401 Work towards Reviewed by Dan Bernstein. Change WritingDirection from an enum to an enum class. No change in behavior. * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::setTextDirection): 2018-12-05 Rob Buis [Mac] HEAD requests changed to GET after 301, 302, and 303 redirections (http/tests/xmlhttprequest/head-redirection.html) https://bugs.webkit.org/show_bug.cgi?id=114965 Reviewed by Frédéric Wang. HEAD requests should not be changed to GET after 303 redirects, see [1]. This was fixed earlier for GTK [2]. Behavior matches Firefox and Chrome. [1] http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-21#section-7.4 [2] https://bugs.webkit.org/show_bug.cgi?id=110127 Tests: web-platform-tests/fetch/api/redirect/redirect-method.html web-platform-tests/fetch/api/redirect/redirect-method-worker.html http/tests/xmlhttprequest/head-redirection.html * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): 2018-12-04 Fujii Hironori Remove using namespace WebCore and WebKit under WebKit/Shared/API https://bugs.webkit.org/show_bug.cgi?id=192352 Reviewed by Alex Christensen. Removed using namespace statements, and use namespace prefix instead. * Shared/API/APIURLRequest.cpp: * Shared/API/APIURLResponse.cpp: * Shared/API/c/WKArray.cpp: * Shared/API/c/WKCertificateInfo.cpp: * Shared/API/c/WKConnectionRef.cpp: * Shared/API/c/WKContextMenuItem.cpp: * Shared/API/c/WKData.cpp: * Shared/API/c/WKDictionary.cpp: * Shared/API/c/WKErrorRef.cpp: * Shared/API/c/WKGeometry.cpp: * Shared/API/c/WKImage.cpp: * Shared/API/c/WKMutableArray.cpp: * Shared/API/c/WKMutableDictionary.cpp: * Shared/API/c/WKNumber.cpp: * Shared/API/c/WKPluginInformation.cpp: * Shared/API/c/WKRenderLayer.cpp: * Shared/API/c/WKRenderObject.cpp: * Shared/API/c/WKSecurityOriginRef.cpp: * Shared/API/c/WKSerializedScriptValue.cpp: * Shared/API/c/WKString.cpp: * Shared/API/c/WKType.cpp: * Shared/API/c/WKURL.cpp: * Shared/API/c/WKURLRequest.cpp: * Shared/API/c/WKURLResponse.cpp: * Shared/API/c/WKUserContentURLPattern.cpp: * Shared/API/c/cairo/WKImageCairo.cpp: * Shared/API/c/curl/WKCertificateInfoCurl.cpp: 2018-12-04 Alex Christensen Remove source application identifiers from NetworkProcessCreationParameters https://bugs.webkit.org/show_bug.cgi?id=192372 Reviewed by Brady Eidson. The _WKWebProcessPoolConfiguration way of setting these was deprecated in http://trac.webkit.org/r235127 The replacement was adopted in The transition process is done! Time to remove the old code. * 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::globalSourceApplicationAuditTokenData): Deleted. (WebKit::globalSourceApplicationBundleIdentifier): Deleted. (WebKit::globalSourceApplicationSecondaryIdentifier): Deleted. (WebKit::NetworkSessionCocoa::setSourceApplicationAuditTokenData): Deleted. (WebKit::NetworkSessionCocoa::setSourceApplicationBundleIdentifier): Deleted. (WebKit::NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier): Deleted. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration sourceApplicationBundleIdentifier]): (-[_WKProcessPoolConfiguration setSourceApplicationBundleIdentifier:]): (-[_WKProcessPoolConfiguration sourceApplicationSecondaryIdentifier]): (-[_WKProcessPoolConfiguration setSourceApplicationSecondaryIdentifier:]): * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): (WebKit::toPKPaymentRequest): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/WebsiteData/WebsiteDataStore.h: (WebKit::WebsiteDataStore::configuration): 2018-12-04 Youenn Fablet Calling getUserMedia in a link that was opened with target="_blank" does not work the second time https://bugs.webkit.org/show_bug.cgi?id=188088 Reviewed by Eric Carlson. On closing a page, we need to make sure to consider that the capture is ended, as otherwise WebPageProxy will not get noticed from WebPage, since WebPageProxy is no longer an IPC receiver. * UIProcess/UserMediaProcessManager.cpp: (WebKit::UserMediaProcessManager::endedCaptureSession): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::close): 2018-12-04 Chris Dumez Regression(r238817) PSON Page Cache API tests are failing https://bugs.webkit.org/show_bug.cgi?id=192348 Reviewed by Alex Christensen. Before suspending a WebProcess on iOS, we normally fake a memory pressure signal so that the suspended process uses as little memory as possible while suspended. Among other things, this will clear the page cache. This is an issue in the case of process-swap on navigation because we keep suspended web processes around to keep Page Cache functional. To address the issue, when a WebProcess is about to get suspended, we check if the process has any suspended WebPage (WebPage used for PSON PageCache support) and we bypass the PageCache clearing if it does. Our API tests did not catch this before r238817 because the NavigationState's assertion was preventing the old WebProcesses from suspending for 3 seconds, which was enough for those tests to complete. * UIProcess/SuspendedPageProxy.cpp: (WebKit::SuspendedPageProxy::SuspendedPageProxy): (WebKit::SuspendedPageProxy::didFinishLoad): * UIProcess/SuspendedPageProxy.h: Take a background assertion until the suspension load is complete, to make sure the suspension load has a chance to complete before the process gets suspended. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): (WebKit::WebProcess::hasPageRequiringPageCacheWhileSuspended const): (WebKit::WebProcess::actualPrepareToSuspend): * WebProcess/WebProcess.h: 2018-12-04 Youenn Fablet Device orientation may be wrong on page reload after crash https://bugs.webkit.org/show_bug.cgi?id=192349 Reviewed by Eric Carlson. On page crash, the process is relaunched and the page is reloaded. At that point, the orientation information of the page is not reset until the next device orientation change. To fix that, add the device orientation to the page creation parameters so that we pass it everytime we create a page. Covered by manual testing. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): * WebProcess/WebPage/WebPage.cpp: 2018-12-04 Carlos Eduardo Ramalho [WPE] Add gtk-doc https://bugs.webkit.org/show_bug.cgi?id=178900 Reviewed by Michael Catanzaro. Add gtk-doc to WPE port. This patch tries to reuse as much code from WebKitGTK+ as possible. * PlatformWPE.cmake: Write variables to gtkdoc-wpe.cfg and gtkdoc-webextensions that is used by python script later. * UIProcess/API/wpe/WebKitWebContext.h: Placed sandbox functions in the same location as in the WebKitGTK+ for consistency. * UIProcess/API/wpe/docs/wpe-0.1-sections.txt: Added. * UIProcess/API/wpe/docs/wpe-docs.sgml: Added. * WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h: Placed webkit_web_page_get_dom_document in the same position as in the WebKitGTK+ for consistency. * WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-0.1-sections.txt: Added. * WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-docs.sgml: Added. 2018-12-04 Carlos Garcia Campos [SOUP] Move URLSoup back to WebCore after r238771 https://bugs.webkit.org/show_bug.cgi?id=192306 Reviewed by Michael Catanzaro. Include GUniquePtrSoup from WebCore again and fix several build failures that showed up after removing the soup includes from URL header. * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::tlsConnectionAcceptCertificate): * PluginProcess/PluginProcess.cpp: * Shared/API/glib/WebKitURIRequest.cpp: * Shared/API/glib/WebKitURIResponse.cpp: * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: * UIProcess/API/glib/WebKitURISchemeRequest.cpp: (webkit_uri_scheme_request_finish_error): Use soupURIToURL(). * UIProcess/API/glib/WebKitWebView.cpp: (webkit_web_view_load_uri): Use soupURIToURL(). * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp: * UIProcess/Launcher/glib/BubblewrapLauncher.h: * UIProcess/Launcher/glib/FlatpakLauncher.cpp: * UIProcess/Launcher/glib/FlatpakLauncher.h: 2018-12-04 Tim Horton Fix the watchOS build; stop unnecessarily linking CorePDF https://bugs.webkit.org/show_bug.cgi?id=192356 Reviewed by Wenson Hsieh. * Configurations/WebKit.xcconfig: * Platform/spi/ios/CorePDFSPI.h: 2018-12-03 Tim Horton Make it possible to disable animated keyboard scrolling behavior https://bugs.webkit.org/show_bug.cgi?id=192331 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKWebView.mm: * UIProcess/ios/WKKeyboardScrollingAnimator.mm: (-[WKKeyboardScrollingAnimator invalidate]): (-[WKKeyboardScrollingAnimator beginWithEvent:]): (-[WKKeyboardScrollingAnimator stopAnimatedScroll]): (-[WKKeyboardScrollingAnimator willStartInteractiveScroll]): (-[WKKeyboardScrollingAnimator startRepeatTimerIfNeeded]): (-[WKKeyboardScrollingAnimator stopRepeatTimer]): (-[WKKeyboardScrollingAnimator performDiscreteScroll]): (-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]): (-[WKKeyboardScrollViewAnimator scrollWithScrollToExtentAnimationTo:]): * WebKit.xcodeproj/project.pbxproj: 2018-12-03 Fujii Hironori Remove "using namespace WebKit" under Source/WebKit/WebProcess/InjectedBundle/API https://bugs.webkit.org/show_bug.cgi?id=192301 Reviewed by Alex Christensen. Removed "using namespace WebKit" statement, and use "WebKit::" namespace prefix instead. * WebProcess/InjectedBundle/API/c/WKBundle.cpp: * WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.cpp: * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp: * WebProcess/InjectedBundle/API/c/WKBundleDOMWindowExtension.cpp: * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp: * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp: * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp: * WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp: * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePageBanner.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePageGroup.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp: * WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp: * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp: 2018-12-03 Chris Dumez Regression(PSON) Google OAuth is broken in private sessions https://bugs.webkit.org/show_bug.cgi?id=192337 Reviewed by Alex Christensen. In WebPageProxy::swapToWebProcess(), we would call removeWebPage() on the old WebProcessProxy and then addExistingWebPage() on the new WebProcessProxy, as you would expect in case of process swap. The issue is that WebProcessProxy::removeWebPage() calls WebProcessPool::pageEndUsingWebsiteDataStore() which would cause the session to get destroyed assuming this was the last page using it. We would therefore lose session cookies after a process-swap in private session. To address the issue, a parameter to WebProcessPool::pageEndUsingWebsiteDataStore() and WebProcessPool::pageBeginUsingWebsiteDataStore() to control if we want to tell the WebProcessPool about the page beginning / ending its use of the session. In the case of a process-swap, we make sure the process pool is not notified. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::reattachToWebProcess): (WebKit::WebPageProxy::swapToWebProcess): (WebKit::WebPageProxy::finishAttachingToWebProcess): (WebKit::WebPageProxy::close): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::createWebPage): (WebKit::WebProcessProxy::addExistingWebPage): (WebKit::WebProcessProxy::removeWebPage): * UIProcess/WebProcessProxy.h: 2018-12-03 Chris Dumez [PSON] Request by the client to process-swap is ignored if the window has an opener https://bugs.webkit.org/show_bug.cgi?id=192267 Reviewed by Brady Eidson. If the client forces a process-swap, we should process-swap, even if the browsing context has an opener (or openees). Previously, we would only bypass the cross-site check, not the openee / openees checks. The issue when doing so is that the openee still has a opener link to the window in the old process. They would see that the window is still there and navigated to 'about:blank' due to our page suspension logic. To address the issue, we no longer suspend the old WebPage if the process swap was forced by the client and we make sure that the old WebPage gets closed. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::suspendCurrentPageIfPossible): (WebKit::WebPageProxy::swapToWebProcess): (WebKit::WebPageProxy::receivedNavigationPolicyDecision): (WebKit::WebPageProxy::continueNavigationInNewProcess): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigationInternal): 2018-12-03 Keith Rollin Add .xcfilelist files https://bugs.webkit.org/show_bug.cgi?id=192082 Reviewed by Brent Fulgham. Add .xcfilelist files for Generate Derived Sources and Generate Unified Sources build phases in Xcode. These are just being staged for now; they'll be added to the Xcode projects later. * DerivedSources-input.xcfilelist: Added. * DerivedSources-output.xcfilelist: Added. * UnifiedSources-input.xcfilelist: Added. * UnifiedSources-output.xcfilelist: Added. 2018-12-03 Zalan Bujtas [iOS] Unreviewed build fix. * Platform/Logging.h: 2018-12-03 Alex Christensen Remove unused NetworkProcessCreationParameters.diskCacheSizeOverride https://bugs.webkit.org/show_bug.cgi?id=192246 Reviewed by Chris Dumez. The last use of this functionality was removed in rdar://problem/46344871 * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::setCacheModel): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationDiskCacheSizeOverride): (WKContextConfigurationSetDiskCacheSizeOverride): * UIProcess/API/C/WKContextConfigurationRef.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration diskCacheSizeOverride]): (-[_WKProcessPoolConfiguration setDiskCacheSizeOverride:]): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): 2018-12-03 Alex Christensen Add WKWebProcessPlugInLoadDelegate SPI willStartProvisionalLoadForFrame with a completion handler https://bugs.webkit.org/show_bug.cgi?id=192272 Reviewed by Brady Eidson. * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h: (API::InjectedBundle::PageLoaderClient::didStartProvisionalLoadForFrame): * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h: * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (ResourceLoadClient::ResourceLoadClient): (ResourceLoadClient::loadDelegate const): (ResourceLoadClient::pluginContextController const): (PageLoaderClient::PageLoaderClient): (PageLoaderClient::loadDelegate const): (PageLoaderClient::pluginContextController const): (PageLoaderClient::didStartProvisionalLoadForFrame): (PageLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame): (PageLoaderClient::didFinishLoadForFrame): (PageLoaderClient::globalObjectIsAvailableForFrame): (PageLoaderClient::didRemoveFrameFromHierarchy): (PageLoaderClient::didCommitLoadForFrame): (PageLoaderClient::didFinishDocumentLoadForFrame): (PageLoaderClient::didFailProvisionalLoadWithErrorForFrame): (PageLoaderClient::didFailLoadWithErrorForFrame): (PageLoaderClient::didSameDocumentNavigationForFrame): (PageLoaderClient::didLayoutForFrame): (PageLoaderClient::didReachLayoutMilestone): (PageLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame): (PageLoaderClient::didHandleOnloadEventsForFrame): (PageLoaderClient::userAgentForURL const): (ResourceLoadClient::willSendRequestForFrame): (ResourceLoadClient::didInitiateLoadForResource): (ResourceLoadClient::didFinishLoadForResource): (ResourceLoadClient::didFailLoadForResource): (-[WKWebProcessPlugInBrowserContextController setLoadDelegate:]): (didStartProvisionalLoadForFrame): Deleted. (didReceiveServerRedirectForProvisionalLoadForFrame): Deleted. (didFinishLoadForFrame): Deleted. (globalObjectIsAvailableForFrame): Deleted. (didRemoveFrameFromHierarchy): Deleted. (didCommitLoadForFrame): Deleted. (didFinishDocumentLoadForFrame): Deleted. (didFailProvisionalLoadWithErrorForFrame): Deleted. (didFailLoadWithErrorForFrame): Deleted. (didSameDocumentNavigationForFrame): Deleted. (didLayoutForFrame): Deleted. (didReachLayoutMilestone): Deleted. (didFirstVisuallyNonEmptyLayoutForFrame): Deleted. (didHandleOnloadEventsForFrame): Deleted. (userAgentForURL): Deleted. (setUpPageLoaderClient): Deleted. (willSendRequestForFrame): Deleted. (didInitiateLoadForResource): Deleted. (didFinishLoadForResource): Deleted. (didFailLoadForResource): Deleted. (setUpResourceLoadClient): Deleted. * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp: (WebKit::InjectedBundlePageLoaderClient::didStartProvisionalLoadForFrame): * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2018-12-03 Tim Horton Swipe snapshot stays up too long swiping around on apple.com (waiting for first paint) https://bugs.webkit.org/show_bug.cgi?id=192319 Reviewed by Simon Fraser. * UIProcess/Cocoa/ViewGestureController.cpp: (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame): * UIProcess/Cocoa/ViewGestureController.h: * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::endSwipeGesture): In r236966, I reverted slightly too much of r232416. We still need to defer requesting a presentation update callback until after the provisional load starts. Otherwise, we could get the callback while we're in the 'paused' state, and drop it on the floor. That would then mean that we time out instead of promptly removing the snapshot. 2018-12-03 Alex Christensen Update process assertions after swapping processes https://bugs.webkit.org/show_bug.cgi?id=192318 Reviewed by Chris Dumez. If the previous WebProcess had a ProcessAssertion to prevent it from being suspended, after navigation and process swapping we need the new WebProcess to update its process assertions. * UIProcess/API/Cocoa/PageLoadStateObserver.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::didSwapWebProcesses): * UIProcess/PageLoadState.cpp: (WebKit::PageLoadState::didSwapWebProcesses): * UIProcess/PageLoadState.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::finishAttachingToWebProcess): 2018-12-03 Daniel Bates [iOS] Do not handle key events that are key commands https://bugs.webkit.org/show_bug.cgi?id=191608 Reviewed by Ryosuke Niwa. A key down event may be associated with a key command. If it is then we want to execute the key command instead of inserting or deleting text. We need to ask UIKit to handle the current event as a key command to find out. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _interpretKeyEvent:isCharEvent:]): Ask UIKit to handle the current event as a key command. If it handles it then we're done. Otherwise, do what we do now. 2018-12-03 Zalan Bujtas [iOS] Add logging channel for hover related content observation https://bugs.webkit.org/show_bug.cgi?id=192312 Reviewed by Simon Fraser. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleSyntheticClick): (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver): 2018-12-03 Tim Horton Enable swipe snapshot removal logging in release builds https://bugs.webkit.org/show_bug.cgi?id=192313 Reviewed by Dean Jackson. * UIProcess/Cocoa/ViewGestureController.cpp: (WebKit::ViewGestureController::SnapshotRemovalTracker::log const): This is super-low-traffic and super-helpful logging. Turn it on all the time. 2018-12-03 Yusuke Suzuki Use WallTime for file time https://bugs.webkit.org/show_bug.cgi?id=192287 Reviewed by Darin Adler. * Shared/SessionState.h: * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::decode): * UIProcess/API/C/WKKeyValueStorageManager.cpp: (WKKeyValueStorageManagerGetStorageDetailsByOrigin): * UIProcess/API/glib/WebKitWebViewSessionState.cpp: (decodeHTTPBody): * UIProcess/Plugins/gtk/PluginInfoCache.cpp: (WebKit::PluginInfoCache::getPluginInfo): (WebKit::PluginInfoCache::updatePluginInfo): * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp: (WebKit::hasFileChangedSince): * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp: (WebKit::LocalStorageDatabaseTracker::databasesModifiedSince): (WebKit::LocalStorageDatabaseTracker::originDetails): * UIProcess/WebStorage/LocalStorageDatabaseTracker.h: * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::encodeFormDataElement): (WebKit::decodeFormDataElement): * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp: (WebKit::removeAllMediaKeyStorageForOriginPath): (WebKit::WebMediaKeyStorageManager::deleteMediaKeyEntriesForOrigin): (WebKit::WebMediaKeyStorageManager::deleteMediaKeyEntriesModifiedBetweenDates): (WebKit::WebMediaKeyStorageManager::deleteAllMediaKeyEntries): * WebProcess/MediaCache/WebMediaKeyStorageManager.h: * WebProcess/WebCoreSupport/SessionStateConversion.cpp: (WebKit::toHTTPBody): (WebKit::toFormData): 2018-12-03 Darin Adler [Cocoa] Check message IDs when decoding Mach messages in IPC::Connection https://bugs.webkit.org/show_bug.cgi?id=192300 rdar://problem/46215523 Reviewed by Chris Dumez. * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::sendOutgoingMessage): Use message IDs other than 0 and 1 for the messages, as suggested by an expert at Apple. (IPC::createMessageDecoder): Update for the new message IDs. (IPC::Connection::receiveSourceEventHandler): Ignore messages with unexpected message IDs. 2018-12-03 Darin Adler [Cocoa] Check descriptor types in createMessageDecoder https://bugs.webkit.org/show_bug.cgi?id=192302 Reviewed by Chris Dumez. Not sure how to construct a test case for Connection, so not adding any tests at this time. * Platform/IPC/mac/ConnectionMac.mm: (IPC::createMessageDecoder): Check descriptor types and return nullptr if they are incorrect. Retained the assertions to help with debugging. (IPC::Connection::receiveSourceEventHandler): Ignore the message if no decoder is created, which means the message is invalid. 2018-12-03 Darin Adler Alignment padding needs to be zeroed out in IPC::Encoder https://bugs.webkit.org/show_bug.cgi?id=192304 Reviewed by Chris Dumez. Might be useful to make a regression test for this, but I couldn't find any other tests for this code. * Platform/IPC/Encoder.cpp: (IPC::Encoder::grow): Use std::memset to zero-fill padding bytes. * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::HistoryEntryDataEncoder::grow): Ditto. 2018-12-03 Darin Adler [Cocoa] Streamline sandbox code a tiny bit https://bugs.webkit.org/show_bug.cgi?id=192299 Reviewed by Anders Carlsson. * Shared/mac/SandboxUtilities.mm: (WebKit::processHasContainer): Removed separate function, just use the pathForProcessContainer instead of repeating logic. This costs a tiny bit of memory allocation overhead the first time this function is called, but in return we can eliminate a second copy of the code to call sandbox_container_path_for_pid. 2018-12-03 Eric Carlson [MediaStream] 'devicechange' event when more capture device information are revealed. https://bugs.webkit.org/show_bug.cgi?id=192268 Reviewed by Youenn Fablet. * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Call captureDevicesChanged if a filtered device list was returned previously. (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess): Clear m_hasFilteredDeviceList. (WebKit::UserMediaPermissionRequestManagerProxy::wasGrantedVideoOrAudioAccess): New. (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Filter device list and strip device IDs if gUM permission hasn't been given. (WebKit::UserMediaPermissionRequestManagerProxy::watchdogTimerFired): Clear m_hasFilteredDeviceList. * UIProcess/UserMediaPermissionRequestManagerProxy.h: 2018-12-03 Keith Rollin Remove Network Capture https://bugs.webkit.org/show_bug.cgi?id=192296 Reviewed by Daniel Bates. r209498 introduced an embedded record and replay facility for network resource loading. This facility was added in order to support a new implementation of the PLT and related performance tests. The PLT is currenty taking a different direction, and so this record/replace facility is no longer needed. Removing it as unused code. * CMakeLists.txt: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::NetworkLoad): (WebKit::NetworkLoad::setDefersLoading): (WebKit::NetworkLoad::continueWillSendRequest): (WebKit::NetworkLoad::willPerformHTTPRedirection): (WebKit::NetworkLoad::notifyDidReceiveResponse): (WebKit::NetworkLoad::didReceiveData): (WebKit::NetworkLoad::didCompleteWithError): (WebKit::NetworkLoad::initializeForRecord): Deleted. (WebKit::NetworkLoad::initializeForReplay): Deleted. * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): (WebKit::NetworkProcess::terminate): * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/capture/NetworkCaptureEvent.cpp: Removed. * NetworkProcess/capture/NetworkCaptureEvent.h: Removed. * NetworkProcess/capture/NetworkCaptureLogging.h: Removed. * NetworkProcess/capture/NetworkCaptureManager.cpp: Removed. * NetworkProcess/capture/NetworkCaptureManager.h: Removed. * NetworkProcess/capture/NetworkCaptureRecorder.cpp: Removed. * NetworkProcess/capture/NetworkCaptureRecorder.h: Removed. * NetworkProcess/capture/NetworkCaptureReplayer.cpp: Removed. * NetworkProcess/capture/NetworkCaptureReplayer.h: Removed. * NetworkProcess/capture/NetworkCaptureResource.cpp: Removed. * NetworkProcess/capture/NetworkCaptureResource.h: Removed. * NetworkProcess/capture/NetworkDataTaskReplay.cpp: Removed. * NetworkProcess/capture/NetworkDataTaskReplay.h: Removed. * NetworkProcess/capture/json.hpp: Removed. * Sources.txt: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * WebKit.xcodeproj/project.pbxproj: * config.h: 2018-12-02 Zalan Bujtas Add a runtime feature flag for LayoutFormattingContext. https://bugs.webkit.org/show_bug.cgi?id=192280 Reviewed by Simon Fraser. * Configurations/FeatureDefines.xcconfig: * Shared/WebPreferences.yaml: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): 2018-12-01 Chris Dumez [PSON] process-swapping may occur even though opener has handle to openee https://bugs.webkit.org/show_bug.cgi?id=192277 Reviewed by Antti Koivisto. * Shared/NavigationActionData.cpp: (WebKit::NavigationActionData::encode const): (WebKit::NavigationActionData::decode): * Shared/NavigationActionData.h: * UIProcess/API/APINavigation.h: (API::Navigation::openedByDOMWithOpener const): (API::Navigation::openedViaWindowOpenWithOpener const): Deleted. (API::Navigation::opener const): Deleted. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigationInternal): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): 2018-12-01 Alexey Proskuryakov Modernize version check for _suppressedAutoAddedHTTPHeaders https://bugs.webkit.org/show_bug.cgi?id=192175 Reviewed by Tim Horton. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Also removed selector check - we only need to support running on 10.13.0 when building with 10.13.0 SDK. 2018-11-30 Alex Christensen Fix Windows build. * UIProcess/API/C/curl/WKWebsiteDataStoreRefCurl.cpp: (WKWebsiteDataStoreEnableCustomNetworkProxySettings): 2018-11-30 Alex Christensen Move URL from WebCore to WTF https://bugs.webkit.org/show_bug.cgi?id=190234 Reviewed by Keith Miller. * NetworkProcess/Cookies/WebCookieManager.cpp: * NetworkProcess/Cookies/WebCookieManager.h: * NetworkProcess/Cookies/WebCookieManager.messages.in: * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm: * NetworkProcess/Downloads/Download.h: * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::publishDownloadProgress): * NetworkProcess/Downloads/DownloadManager.h: * NetworkProcess/Downloads/PendingDownload.cpp: (WebKit::PendingDownload::publishProgress): * NetworkProcess/Downloads/PendingDownload.h: * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm: (WebKit::Download::publishProgress): * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: (WebKit::NetworkBlobRegistry::registerBlobURL): (WebKit::NetworkBlobRegistry::registerBlobURLForSlice): (WebKit::NetworkBlobRegistry::unregisterBlobURL): (WebKit::NetworkBlobRegistry::blobSize): (WebKit::NetworkBlobRegistry::filesInBlob): * NetworkProcess/FileAPI/NetworkBlobRegistry.h: * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkDataTask.cpp: (WebKit::NetworkDataTask::didReceiveResponse): * NetworkProcess/NetworkDataTaskBlob.cpp: * NetworkProcess/NetworkLoadChecker.h: (WebKit::NetworkLoadChecker::setContentExtensionController): (WebKit::NetworkLoadChecker::url const): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::writeBlobToFilePath): (WebKit::NetworkProcess::publishDownloadProgress): (WebKit::NetworkProcess::preconnectTo): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::logBlockedCookieInformation): (WebKit::logCookieInformationInternal): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/NetworkSocketStream.cpp: (WebKit::NetworkSocketStream::create): * NetworkProcess/NetworkSocketStream.h: * NetworkProcess/PingLoad.h: * NetworkProcess/ServiceWorker/WebSWServerConnection.h: * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in: * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: * NetworkProcess/cache/CacheStorageEngine.cpp: (WebKit::CacheStorage::Engine::retrieveRecords): * NetworkProcess/cache/CacheStorageEngine.h: * NetworkProcess/cache/CacheStorageEngineCache.h: * NetworkProcess/cache/CacheStorageEngineConnection.cpp: (WebKit::CacheStorageEngineConnection::retrieveRecords): * NetworkProcess/cache/CacheStorageEngineConnection.h: * NetworkProcess/cache/CacheStorageEngineConnection.messages.in: * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheStatistics.cpp: (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry): (WebKit::NetworkCache::Statistics::recordRevalidationSuccess): * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h: (WebKit::NetworkCache::SubresourceInfo::firstPartyForCookies const): * NetworkProcess/capture/NetworkCaptureEvent.cpp: (WebKit::NetworkCapture::Request::operator WebCore::ResourceRequest const): (WebKit::NetworkCapture::Response::operator WebCore::ResourceResponse const): (WebKit::NetworkCapture::Error::operator WebCore::ResourceError const): * NetworkProcess/capture/NetworkCaptureManager.cpp: (WebKit::NetworkCapture::Manager::findBestFuzzyMatch): (WebKit::NetworkCapture::Manager::fuzzyMatchURLs): (WebKit::NetworkCapture::Manager::urlIdentifyingCommonDomain): * NetworkProcess/capture/NetworkCaptureManager.h: * NetworkProcess/capture/NetworkCaptureResource.cpp: (WebKit::NetworkCapture::Resource::url): (WebKit::NetworkCapture::Resource::queryParameters): * NetworkProcess/capture/NetworkCaptureResource.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::deleteHSTSCacheForHostNames): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): * PluginProcess/mac/PluginProcessMac.mm: (WebKit::openCFURLRef): (WebKit::replacedNSWorkspace_launchApplicationAtURL_options_configuration_error): * Shared/API/APIURL.h: (API::URL::create): (API::URL::equals): (API::URL::URL): (API::URL::url const): (API::URL::parseURLIfNecessary const): * Shared/API/APIUserContentURLPattern.h: (API::UserContentURLPattern::matchesURL const): * Shared/API/c/WKURLRequest.cpp: * Shared/API/c/WKURLResponse.cpp: * Shared/API/c/cf/WKURLCF.mm: (WKURLCreateWithCFURL): (WKURLCopyCFURL): * Shared/API/glib/WebKitURIRequest.cpp: * Shared/API/glib/WebKitURIResponse.cpp: * Shared/APIWebArchiveResource.mm: (API::WebArchiveResource::WebArchiveResource): * Shared/AssistedNodeInformation.h: * Shared/Cocoa/WKNSURLExtras.mm: (-[NSURL _web_originalDataAsWTFString]): (): Deleted. * Shared/SessionState.h: * Shared/WebBackForwardListItem.cpp: (WebKit::WebBackForwardListItem::itemIsInSameDocument const): * Shared/WebCoreArgumentCoders.cpp: * Shared/WebCoreArgumentCoders.h: * Shared/WebErrors.h: * Shared/WebHitTestResultData.cpp: * Shared/cf/ArgumentCodersCF.cpp: (IPC::encode): (IPC::decode): * Shared/gtk/WebErrorsGtk.cpp: * Shared/ios/InteractionInformationAtPosition.h: * UIProcess/API/APIHTTPCookieStore.h: * UIProcess/API/APINavigation.cpp: (API::Navigation::appendRedirectionURL): * UIProcess/API/APINavigation.h: (API::Navigation::takeRedirectChain): * UIProcess/API/APINavigationAction.h: * UIProcess/API/APINavigationClient.h: (API::NavigationClient::signedPublicKeyAndChallengeString): (API::NavigationClient::contentRuleListNotification): (API::NavigationClient::webGLLoadPolicy const): (API::NavigationClient::resolveWebGLLoadPolicy const): * UIProcess/API/APIUIClient.h: (API::UIClient::saveDataToFileInDownloadsFolder): * UIProcess/API/APIUserScript.cpp: (API::UserScript::generateUniqueURL): * UIProcess/API/APIUserScript.h: * UIProcess/API/APIUserStyleSheet.cpp: (API::UserStyleSheet::generateUniqueURL): * UIProcess/API/APIUserStyleSheet.h: * UIProcess/API/C/WKOpenPanelResultListener.cpp: (filePathsFromFileURLs): * UIProcess/API/C/WKPage.cpp: (WKPageLoadPlainTextStringWithUserData): (WKPageSetPageUIClient): (WKPageSetPageNavigationClient): * UIProcess/API/C/WKPageGroup.cpp: (WKPageGroupAddUserStyleSheet): (WKPageGroupAddUserScript): * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetResourceLoadStatisticsPrevalentResourceForDebugMode): (WKWebsiteDataStoreSetStatisticsLastSeen): (WKWebsiteDataStoreSetStatisticsPrevalentResource): (WKWebsiteDataStoreSetStatisticsVeryPrevalentResource): (WKWebsiteDataStoreIsStatisticsPrevalentResource): (WKWebsiteDataStoreIsStatisticsVeryPrevalentResource): (WKWebsiteDataStoreIsStatisticsRegisteredAsSubresourceUnder): (WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder): (WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo): (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction): (WKWebsiteDataStoreIsStatisticsHasHadUserInteraction): (WKWebsiteDataStoreSetStatisticsGrandfathered): (WKWebsiteDataStoreIsStatisticsGrandfathered): (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin): (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin): (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo): (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom): (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo): (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom): * UIProcess/API/Cocoa/WKHTTPCookieStore.mm: * UIProcess/API/Cocoa/WKUserScript.mm: (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:associatedURL:userContentWorld:]): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _showSafeBrowsingWarning:completionHandler:]): (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration setURLSchemeHandler:forURLScheme:]): (-[WKWebViewConfiguration urlSchemeHandlerForURLScheme:]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: * UIProcess/API/Cocoa/_WKApplicationManifest.mm: (-[_WKApplicationManifest initWithCoder:]): (+[_WKApplicationManifest applicationManifestFromJSON:manifestURL:documentURL:]): * UIProcess/API/Cocoa/_WKUserStyleSheet.mm: (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]): * UIProcess/API/glib/IconDatabase.cpp: * UIProcess/API/glib/WebKitCookieManager.cpp: (webkit_cookie_manager_get_cookies): * UIProcess/API/glib/WebKitFileChooserRequest.cpp: * UIProcess/API/glib/WebKitSecurityOrigin.cpp: (webkit_security_origin_new_for_uri): * UIProcess/API/glib/WebKitUIClient.cpp: * UIProcess/API/glib/WebKitURISchemeRequest.cpp: * UIProcess/API/glib/WebKitWebView.cpp: (webkit_web_view_load_plain_text): * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp: * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::showPaymentUI): (WebKit::WebPaymentCoordinatorProxy::validateMerchant): * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toPKPaymentRequest): * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::navigateBrowsingContext): (WebKit::domainByAddingDotPrefixIfNeeded): (WebKit::WebAutomationSession::addSingleCookie): (WebKit::WebAutomationSession::deleteAllCookies): * UIProcess/Cocoa/DownloadClient.mm: (WebKit::DownloadClient::didFinish): * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const): (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const): (WebKit::NavigationState::NavigationClient::contentRuleListNotification): (WebKit::NavigationState::NavigationClient::willPerformClientRedirect): (WebKit::NavigationState::NavigationClient::didPerformClientRedirect): (WebKit::NavigationState::NavigationClient::signedPublicKeyAndChallengeString): * UIProcess/Cocoa/SafeBrowsingResultCocoa.mm: Copied from Source/WebKit/WebProcess/Network/WebSocketProvider.h. (WebKit::SafeBrowsingResult::SafeBrowsingResult): * UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm: (WebKit::reportAnErrorURL): (WebKit::malwareDetailsURL): (WebKit::safeBrowsingDetailsText): (WebKit::SafeBrowsingWarning::SafeBrowsingWarning): * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: (-[_WKPreviewControllerDataSource finish:]): (WebKit::SystemPreviewController::finish): * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::createNewPage): (WebKit::UIDelegate::UIClient::saveDataToFileInDownloadsFolder): (WebKit::requestUserMediaAuthorizationForDevices): (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin): * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm: (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]): * UIProcess/Cocoa/WKSafeBrowsingWarning.h: * UIProcess/Cocoa/WKSafeBrowsingWarning.mm: (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingWarning:completionHandler:]): * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::showSafeBrowsingWarning): (WebKit::WebViewImpl::writeToURLForFilePromiseProvider): * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::publishProgress): * UIProcess/Downloads/DownloadProxy.h: (WebKit::DownloadProxy::setRedirectChain): (WebKit::DownloadProxy::redirectChain const): * UIProcess/FrameLoadState.cpp: (WebKit::FrameLoadState::didStartProvisionalLoad): (WebKit::FrameLoadState::didReceiveServerRedirectForProvisionalLoad): (WebKit::FrameLoadState::didSameDocumentNotification): (WebKit::FrameLoadState::setUnreachableURL): * UIProcess/FrameLoadState.h: (WebKit::FrameLoadState::url const): (WebKit::FrameLoadState::setURL): (WebKit::FrameLoadState::provisionalURL const): (WebKit::FrameLoadState::unreachableURL const): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::writeBlobToFilePath): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/PageClient.h: (WebKit::PageClient::showSafeBrowsingWarning): * UIProcess/PageLoadState.cpp: (WebKit::PageLoadState::hasOnlySecureContent): * UIProcess/Plugins/PluginInfoStore.cpp: * UIProcess/Plugins/PluginInfoStore.h: * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: * UIProcess/SafeBrowsingResult.h: Copied from Source/WebKit/UIProcess/SystemPreviewController.h. (WebKit::SafeBrowsingResult::create): (WebKit::SafeBrowsingResult::url const): (WebKit::SafeBrowsingResult::provider const): (WebKit::SafeBrowsingResult::isPhishing const): (WebKit::SafeBrowsingResult::isMalware const): (WebKit::SafeBrowsingResult::isUnwantedSoftware const): (WebKit::SafeBrowsingResult::isKnownToBeUnsafe const): * UIProcess/SafeBrowsingWarning.h: (WebKit::SafeBrowsingWarning::create): * UIProcess/SuspendedPageProxy.cpp: * UIProcess/SystemPreviewController.h: * UIProcess/WebCookieManagerProxy.h: * UIProcess/WebFrameProxy.h: (WebKit::WebFrameProxy::url const): (WebKit::WebFrameProxy::provisionalURL const): (WebKit::WebFrameProxy::unreachableURL const): * UIProcess/WebInspectorProxy.h: * UIProcess/WebOpenPanelResultListenerProxy.cpp: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadDataWithNavigation): (WebKit::WebPageProxy::loadAlternateHTML): (WebKit::WebPageProxy::loadWebArchiveData): (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick): (WebKit::WebPageProxy::continueNavigationInNewProcess): (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): (WebKit::WebPageProxy::didChangeProvisionalURLForFrame): (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): (WebKit::WebPageProxy::contentRuleListNotification): (WebKit::WebPageProxy::processDidTerminate): (WebKit::WebPageProxy::signedPublicKeyAndChallengeString): (WebKit::WebPageProxy::setURLSchemeHandlerForScheme): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::tryPrewarmWithDomainInformation): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch): * UIProcess/WebProcessProxy.h: * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode): (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation): * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/ios/DragDropInteractionState.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::showSafeBrowsingWarning): * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]): (-[WKContentView _presentedViewControllerForPreviewItemController:]): * UIProcess/ios/WKGeolocationProviderIOS.mm: (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]): * UIProcess/ios/WKLegacyPDFView.mm: (-[WKLegacyPDFView actionSheetAssistant:shareElementWithURL:rect:]): * UIProcess/ios/WKPDFView.mm: (-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]): * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: (-[WKFullScreenWindowController _updateLocationInfo]): * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::decodeLegacySessionState): * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::showSafeBrowsingWarning): * UIProcess/mac/WKImmediateActionController.mm: (-[WKImmediateActionController _defaultAnimationController]): * UIProcess/win/WebInspectorProxyWin.cpp: * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::showPaymentUI): (WebKit::WebPaymentCoordinator::validateMerchant): * WebProcess/ApplePay/WebPaymentCoordinator.h: * WebProcess/Cache/WebCacheStorageConnection.cpp: (WebKit::WebCacheStorageConnection::doRetrieveRecords): * WebProcess/Cache/WebCacheStorageConnection.h: * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::registerFileBlobURL): * WebProcess/FileAPI/BlobRegistryProxy.h: * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h: (API::InjectedBundle::PageLoaderClient::willLoadDataRequest): (API::InjectedBundle::PageLoaderClient::userAgentForURL const): * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp: (WKBundleFrameAllowsFollowingLink): (WKBundleFrameCopySuggestedFilenameForResourceWithURL): (WKBundleFrameCopyMIMETypeForResourceWithURL): * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageHasLocalDataForURL): * WebProcess/InjectedBundle/API/gtk/DOM/ConvertToUTF8String.cpp: (convertToUTF8String): * WebProcess/InjectedBundle/API/gtk/DOM/ConvertToUTF8String.h: * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp: * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h: * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::preconnectTo): * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/Network/WebSocketProvider.h: * WebProcess/Network/WebSocketStream.cpp: (WebKit::WebSocketStream::WebSocketStream): * WebProcess/Network/WebSocketStream.h: * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: * WebProcess/Plugins/Netscape/NetscapePlugin.h: * WebProcess/Plugins/Netscape/NetscapePluginStream.h: * WebProcess/Plugins/PDF/PDFPlugin.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::clickedLink): * WebProcess/Plugins/Plugin.h: * WebProcess/Plugins/PluginController.h: * WebProcess/Plugins/PluginProxy.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::performURLRequest): (WebKit::PluginView::performJavaScriptURLRequest): * WebProcess/Plugins/WebPluginInfoProvider.cpp: (WebKit::WebPluginInfoProvider::webVisiblePluginInfo): * WebProcess/Plugins/WebPluginInfoProvider.h: * WebProcess/Storage/WebSWClientConnection.h: * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/UserContent/WebUserContentController.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::signedPublicKeyAndChallengeString const): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/WebContextMenuClient.h: * WebProcess/WebCoreSupport/WebDragClient.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): (WebKit::WebFrameLoaderClient::shouldForceUniversalAccessFromLocalURL): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::readURLFromPasteboard): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::WebDragClient::declareAndWriteDragImage): * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm: * WebProcess/WebPage/VisitedLinkTableController.h: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::allowsFollowingLink const): * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadURLInFrame): (WebKit::WebPage::loadData): (WebKit::WebPage::loadAlternateHTML): (WebKit::WebPage::dumpHistoryForTesting): (WebKit::WebPage::sendCSPViolationReport): (WebKit::WebPage::addUserScript): (WebKit::WebPage::addUserStyleSheet): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp: (WebKit::WebPrintOperationGtk::frameURL const): * WebProcess/WebPage/gtk/WebPrintOperationGtk.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::sendPrewarmInformation): * WebProcess/WebProcess.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::activePagesOrigins): 2018-11-30 Per Arne Vollan [macOS] Add more logging of sandbox call entries. https://bugs.webkit.org/show_bug.cgi?id=192261 rdar://problem/45772445 Reviewed by Dean Jackson. * WebProcess/com.apple.WebProcess.sb.in: 2018-11-30 Tim Horton Editable images should always return some data, even if the canvas doesn't have a size yet https://bugs.webkit.org/show_bug.cgi?id=192265 Reviewed by Wenson Hsieh. * UIProcess/ios/WKDrawingView.mm: (-[WKDrawingView layoutSubviews]): (emptyImage): (-[WKDrawingView renderedDrawing]): (-[WKDrawingView PNGRepresentation]): Some clients strongly depend on there being some data in an image, even if it's not of a usable size yet. We'll invalidate the attachment when the canvas size changes, so it will eventually settle at a usable size (after the first layer tree commit that includes the editable image). 2018-11-30 Don Olmstead Rename ENABLE_SUBTLE_CRYPTO to ENABLE_WEB_CRYPTO https://bugs.webkit.org/show_bug.cgi?id=192197 Reviewed by Jiewen Tan. * Configurations/FeatureDefines.xcconfig: * UIProcess/API/C/WKPage.cpp: (WKPageSetPageNavigationClient): * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebChromeClient.cpp: * WebProcess/WebCoreSupport/WebChromeClient.h: 2018-11-30 Alexey Proskuryakov Move USE_CFNETWORK_IGNORE_HSTS to its proper place https://bugs.webkit.org/show_bug.cgi?id=192173 Reviewed by Tim Horton. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (updateIgnoreStrictTransportSecuritySettingIfNecessary): (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]): 2018-11-30 Alex Christensen Remove unused WebProcessCreationParameters.uiProcessCookieStorageIdentifier https://bugs.webkit.org/show_bug.cgi?id=192157 Reviewed by Chris Dumez. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): 2018-11-30 Alex Christensen Remove privateBrowsingEnabled from NetworkProcessCreationParameters https://bugs.webkit.org/show_bug.cgi?id=192156 Reviewed by Chris Dumez. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): 2018-11-30 Basuke Suzuki [Curl] Add API for ProtectionSpace. https://bugs.webkit.org/show_bug.cgi?id=191648 Reviewed by Alex Christensen. Added API to get certificate information from protection space. * PlatformWin.cmake: * Shared/curl/WebCoreArgumentCodersCurl.cpp: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): * UIProcess/API/C/curl/WKProtectionSpaceCurl.cpp: Added. (WKProtectionSpaceCopyCertificateInfo): * UIProcess/API/C/curl/WKProtectionSpaceCurl.h: Added. 2018-11-30 David Quesada -[WKProcessPool _downloadURLRequest:] should allow specifying the initiating web view https://bugs.webkit.org/show_bug.cgi?id=192212 rdar://problem/46363706 Reviewed by Alex Christensen. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _downloadURLRequest:originatingWebView:]): (-[WKProcessPool _downloadURLRequest:]): Deleted. * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: 2018-11-30 Per Arne Vollan Remove invalid character in sandbox introduced in r238703. Unreviewed sandbox fix. * WebProcess/com.apple.WebProcess.sb.in: 2018-11-30 Andy Estes [Cocoa] Add some WKA extension points https://bugs.webkit.org/show_bug.cgi?id=192131 Reviewed by Tim Horton. * DerivedSources.make: Added an extension point for WebPreferences.yaml. * Platform/IPC/MessageSender.h: (IPC::MessageSender::sendWithAsyncReply): Send async messages via IPC::MessageSender. * Platform/cocoa/WebKitAdditions.mm: A an extension point for additional WebKit sources. * SourcesCocoa.txt: Added WebKitAdditions.mm as non-unified source. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Called finishConstruction. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Added an extension point for WebPaymentCoordinatorProxy. * WebKit.xcodeproj/project.pbxproj: Added WebKitAdditions.mm. * WebProcess/ApplePay/WebPaymentCoordinator.h: Added an extension point for WebPaymentCoordinator. 2018-11-30 Frederic Wang [WebAuthN] Support CTAP HID authenticators on macOS https://bugs.webkit.org/show_bug.cgi?id=188623 Unreviewed build fix. * UIProcess/WebAuthentication/Cocoa/HidConnection.mm: Add missing header. 2018-11-29 Wenson Hsieh REGRESSION (r238635): Dragging a text selection within WKWebView causes the selection highlight to get into a bad state https://bugs.webkit.org/show_bug.cgi?id=192165 Reviewed by Daniel Bates. Fixes a bug in PageClientImpl::isViewFocused. Consider the following scenario: 1. WKWebView is hosted within the view hierarchy 2. First responder is *not* WKContentView 3. The active focus retain count is nonzero Before r238635, we would return true, due to condition (3). However, after r238635, we only consider whether the first responder is WKContentView, since the web view is in the view hierarchy. This breaks scenarios where WebKit or UIKit attempts to retain focus and later restore the content view to be the first responder (an example of this is dragging a text selection between editable elements in the same web view). To fix this, simply bail early and return true if focus is being retained. * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::isViewFocused): 2018-11-29 Tim Horton Inform clients when editable image attachment backing data changes https://bugs.webkit.org/show_bug.cgi?id=192206 Reviewed by Wenson Hsieh. * UIProcess/API/Cocoa/APIAttachmentCocoa.mm: (API::Attachment::invalidateGeneratedFileWrapper): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didInvalidateDataForAttachment:]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/Cocoa/PageClientImplCocoa.h: * UIProcess/Cocoa/PageClientImplCocoa.mm: (WebKit::PageClientImplCocoa::didInvalidateDataForAttachment): * UIProcess/PageClient.h: (WebKit::PageClient::didInvalidateDataForAttachment): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didInvalidateDataForAttachment): * UIProcess/WebPageProxy.h: Plumb file-wrapper-invalidation through from APIAttachment to WKUIDelegate. 2018-11-29 Eric Carlson [MediaStream] DeviceIdHashSaltStorage should use iframe and top level documents https://bugs.webkit.org/show_bug.cgi?id=192182 Reviewed by Youenn Fablet. * UIProcess/DeviceIdHashSaltStorage.cpp: (WebKit::DeviceIdHashSaltStorage::deviceIdHashSaltForOrigin): Key off of request and top level documents. (WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltForOrigins): Ditto. * UIProcess/DeviceIdHashSaltStorage.h: (WebKit::DeviceIdHashSaltStorage::HashSaltForOrigin::HashSaltForOrigin): * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Pass both documents. (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Ditto. (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Ditto. 2018-11-29 Ryan Haddad Unreviewed, rolling out r238713. Breaks internal builds. Reverted changeset: "[Cocoa] Add some WKA extension points" https://bugs.webkit.org/show_bug.cgi?id=192131 https://trac.webkit.org/changeset/238713 2018-11-29 Simon Fraser Add an internal feature flag to enable async overflow scrolling https://bugs.webkit.org/show_bug.cgi?id=192184 Reviewed by Tim Horton. Add a new internal feature flag that will enable async overflow-scrolling for most overflow:scroll elements. Defaults to off. * Shared/WebPreferences.yaml: 2018-11-29 Andy Estes [Cocoa] Add some WKA extension points https://bugs.webkit.org/show_bug.cgi?id=192131 Reviewed by Tim Horton. * DerivedSources.make: Added an extension point for WebPreferences.yaml. * Platform/IPC/MessageSender.h: (IPC::MessageSender::sendWithAsyncReply): Send async messages via IPC::MessageSender. * Platform/cocoa/WebKitAdditions.mm: A an extension point for additional WebKit sources. * SourcesCocoa.txt: Added WebKitAdditions.mm as non-unified source. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Called finishConstruction. * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Added an extension point for WebPaymentCoordinatorProxy. * WebKit.xcodeproj/project.pbxproj: Added WebKitAdditions.mm. * WebProcess/ApplePay/WebPaymentCoordinator.h: Added an extension point for WebPaymentCoordinator. 2018-11-29 Tim Horton Try to fix the build. * Platform/spi/ios/PencilKitSPI.h: 2018-11-29 David Quesada Add SPI to publish NSProgress on active downloads https://bugs.webkit.org/show_bug.cgi?id=192021 rdar://problem/44405661 Reviewed by Alex Christensen. Make it possible for clients to allow other processes to monitor the state of active downloads. On Cocoa platforms, this can be done by creating an NSProgress, publishing it on an appropriate file URL (potentially a different file URL than where the download data is being written), updating properties on it as the download makes progress, and wiring up a cancellation handler that allows it to be remotely canceled. Interested clients can then subscribe to progress on that URL and receive a proxy to the progress that WebKit publishes. * NetworkProcess/Downloads/Download.cpp: (WebKit::Download::~Download): (WebKit::Download::platformDestroyDownload): Add a platform-customizable hook for destructing the Download. DownloadCocoa.mm will interact with its Objective-C NSProgress instance at this point. * NetworkProcess/Downloads/Download.h: * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::dataTaskBecameDownloadTask): See comments for publishDownloadProgress(). (WebKit::DownloadManager::publishDownloadProgress): If the provided downloadID corresponds to a non-Pending Download, hand the URL and a matching sandbox extension to the Download so it can create its progress. Otherwise, store the URL and sandbox extension on the PendingDownload to be used later when the full Download is created. When this happens, dataTaskBecameDownloadTask() will tell the PendingDownload about the Download it has become. The PendingDownload will then relay the progress URL and sandbox extension to the Download. * NetworkProcess/Downloads/DownloadManager.h: * NetworkProcess/Downloads/PendingDownload.cpp: (WebKit::PendingDownload::publishProgress): Store the progress info for later use, when the proper Download is created. (WebKit::PendingDownload::didBecomeDownload): If there was a progress URL provided earlier, tell the Download corresponding to this PendingDownload to publish its progress using that URL. * NetworkProcess/Downloads/PendingDownload.h: * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm: (WebKit::Download::platformDestroyDownload): When the Download is destroyed (i.e. when the download succeeds, fails, or is canceled), unpublish the progress, since there is no longer any activity to report. (WebKit::Download::publishProgress): Resolve the sandbox extension, create a progress configured to reflect the progress of this Download's NSURLSessionDownloadTask, and publish it at the given file URL. * NetworkProcess/Downloads/cocoa/WKDownloadProgress.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKDownload.h. * NetworkProcess/Downloads/cocoa/WKDownloadProgress.mm: Added. (-[WKDownloadProgress initWithDownloadTask:download:URL:sandboxExtension:]): Configure this progress, start observing properties on the download task that this progress will reflect, and connect the cancellation handler of the progress to cancel the corresponding Download. (-[WKDownloadProgress publish]): (-[WKDownloadProgress unpublish]): Override these methods to consume and revoke the sandbox extension to make sure the process has access to the progress file while the progress will be published. (-[WKDownloadProgress dealloc]): (-[WKDownloadProgress observeValueForKeyPath:ofObject:change:context:]): When either byte count (number received, or number expected to receive) of the download task changes, update this progress to reflect that. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::publishDownloadProgress): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Allow looking up the services that manages published NSProgresses. * UIProcess/API/Cocoa/_WKDownload.h: * UIProcess/API/Cocoa/_WKDownload.mm: (-[_WKDownload publishProgressAtURL:]): * UIProcess/Downloads/DownloadProxy.cpp: (WebKit::DownloadProxy::publishProgress): * UIProcess/Downloads/DownloadProxy.h: * WebKit.xcodeproj/project.pbxproj: 2018-11-29 Tim Horton Make drawing tools available when an editable image is focused https://bugs.webkit.org/show_bug.cgi?id=192172 Reviewed by Dean Jackson. * Platform/spi/ios/PencilKitSPI.h: Add some more SPI. * Shared/AssistedNodeInformation.cpp: (WebKit::AssistedNodeInformation::encode const): (WebKit::AssistedNodeInformation::decode): * Shared/AssistedNodeInformation.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleStylusSingleTapAtPoint): (WebKit::isAssistableElement): (WebKit::WebPage::getAssistedNodeInformation): Plumb the assisted node's embedded view ID, if available. Also add a new input type for drawings, and use it when appropriate. * SourcesCocoa.txt: * UIProcess/API/Cocoa/_WKFocusedElementInfo.h: Add WKInputTypeDrawing. * UIProcess/ios/PencilKitSoftLink.h: Added. * UIProcess/ios/PencilKitSoftLink.mm: Added. Pull soft-linking out into its own file, to fix unified sources. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]): (-[WKContentView _requiresKeyboardWhenFirstResponder]): (-[WKContentView requiresAccessoryView]): Install a keyboard when a drawing is focused. Also, deduplicate one "curretUserInterfaceIdiomIsPad"; just fall through. (-[WKContentView inputView]): Make a WKInkPickerControl when a drawing is focused. (-[WKContentView textInputTraits]): (isAssistableInputType): * UIProcess/ios/WKDrawingView.h: * UIProcess/ios/WKDrawingView.mm: (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]): (-[WKDrawingView PNGRepresentation]): (-[WKDrawingView loadDrawingFromPNGRepresentation:]): Adopt PencilKitSoftLink. (-[WKDrawingView canvasView]): Expose the internal canvas view for use by WKInkPickerControl. * UIProcess/ios/WKInkPickerControl.h: Copied from Source/WebKit/Platform/spi/ios/PencilKitSPI.h. * UIProcess/ios/WKInkPickerControl.mm: Added. (-[WKInkPickerView initWithFrame:drawingView:]): (-[WKInkPickerView didPickInk]): (-[WKInkPickerView inlineInkPickerDidToggleRuler:]): (-[WKInkPickerView inlineInkPicker:didSelectTool:]): (-[WKInkPickerView inlineInkPicker:didSelectColor:]): (-[WKInkPickerView inkPickerSize]): (-[WKInkPickerView layoutSubviews]): (-[WKInkPickerView sizeThatFits:]): (-[WKInkPickerView viewControllerForPopoverPresentationFromInlineInkPicker:]): (-[WKInkPickerControl initWithDrawingView:]): (-[WKInkPickerControl beginEditing]): (-[WKInkPickerControl endEditing]): (-[WKInkPickerControl assistantView]): Install and hook up a PKInlineInkPicker. Center it in the keyboard. Plumb changes through to the canvas view. * WebKit.xcodeproj/project.pbxproj: 2018-11-29 Per Arne Vollan [macOS] Add logging for some sandbox entries. https://bugs.webkit.org/show_bug.cgi?id=192126 Reviewed by Brent Fulgham. Add logging for sandbox entries which are possibly not needed. * WebProcess/com.apple.WebProcess.sb.in: 2018-11-29 Alex Christensen Fix _WKWebsiteDataStoreConfiguration. sourceApplicationBundleIdentifier and sourceApplicationSecondaryIdentifier SPI introduced in r235127 https://bugs.webkit.org/show_bug.cgi?id=192191 Reviewed by Andy Estes. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): When trying to adopt the new SPI and verify it worked, I found that the strings are not copied in one place where they should be. 2018-11-29 Megan Gardner Move Lookup Code for better cross platform usage https://bugs.webkit.org/show_bug.cgi?id=191732 Reviewed by Alex Christensen. Lookup is being replaced by Reveal. This framework should work on all platforms. The patch moves the code that we expect will be needed for all platforms to the more general cocoa area. This patch changes no funcationality, and should not change anything currently. This work will be build on later when Reveal is ready to support multiple platforms. * Platform/spi/ios/UIKitSPI.h: * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::performDictionaryLookupAtLocation): (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView cleanupInteraction]): (-[WKContentView _removeDefaultGestureRecognizers]): (-[WKContentView _addDefaultGestureRecognizers]): (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): (-[WKContentView _lookupGestureRecognized:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted. (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): Deleted. * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: (WebKit::WebPage::performDictionaryLookupAtLocation): (WebKit::WebPage::performDictionaryLookupForSelection): (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): (WebKit::WebPage::performDictionaryLookupForRange): (WebKit::WebPage::dictionaryPopupInfoForRange): * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted. (WebKit::WebPage::performDictionaryLookupForSelection): Deleted. (WebKit::WebPage::performDictionaryLookupForRange): Deleted. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted. (WebKit::WebPage::performDictionaryLookupForSelection): Deleted. (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Deleted. (WebKit::WebPage::dictionaryPopupInfoForRange): Deleted. (WebKit::WebPage::performDictionaryLookupForRange): Deleted. 2018-11-29 Zalan Bujtas [ContentObservation] Decouple content change and DOM timer scheduling observation https://bugs.webkit.org/show_bug.cgi?id=192170 Reviewed by Simon Fraser. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleSyntheticClick): 2018-11-29 Eric Carlson [iOS] Tell AirPlay picker when a file has video https://bugs.webkit.org/show_bug.cgi?id=192155 Reviewed by Jer Noble. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]): Add hasVideo parameter. * UIProcess/ios/forms/WKAirPlayRoutePicker.h: * UIProcess/ios/forms/WKAirPlayRoutePicker.mm: (-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:hasVideo:]): Add hasVideo parameter, pass info to MPMediaControlsViewController. (-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:]): Deleted. 2018-11-29 Alexey Proskuryakov Modernize the check for kCFURLRequestContentDecoderSkipURLCheck existence https://bugs.webkit.org/show_bug.cgi?id=192041 Reviewed by Tim Horton. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded): 2018-11-29 Ryan Haddad Unreviewed, rolling out r238678. Breaks internal builds. Reverted changeset: "Move Lookup Code for better cross platform usage" https://bugs.webkit.org/show_bug.cgi?id=191732 https://trac.webkit.org/changeset/238678 2018-11-29 Suresh Koppisetty Addressed a FIXME by removing an unnecessary call to [NSApplication sharedApplication]. https://bugs.webkit.org/show_bug.cgi?id=192099 Reviewed by Geoffrey Garen. [NSApplication sharedApplication] call is no longer needed in platformInitializeWebProcess as [NSApplication _accessibilityInitialize] calls [NSApplication sharedApplication]. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2018-11-29 Megan Gardner Move Lookup Code for better cross platform usage https://bugs.webkit.org/show_bug.cgi?id=191732 Reviewed by Alex Christensen. Lookup is being replaced by Reveal. This framework should work on all platforms. The patch moves the code that we expect will be needed for all platforms to the more general cocoa area. This patch changes no funcationality, and should not change anything currently. This work will be build on later when Reveal is ready to support multiple platforms. * Platform/spi/ios/UIKitSPI.h: * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::performDictionaryLookupAtLocation): (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView cleanupInteraction]): (-[WKContentView _removeDefaultGestureRecognizers]): (-[WKContentView _addDefaultGestureRecognizers]): (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): (-[WKContentView _lookupGestureRecognized:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted. (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): Deleted. * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: (WebKit::WebPage::performDictionaryLookupAtLocation): (WebKit::WebPage::performDictionaryLookupForSelection): (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): (WebKit::WebPage::performDictionaryLookupForRange): (WebKit::WebPage::dictionaryPopupInfoForRange): * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted. (WebKit::WebPage::performDictionaryLookupForSelection): Deleted. (WebKit::WebPage::performDictionaryLookupForRange): Deleted. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted. (WebKit::WebPage::performDictionaryLookupForSelection): Deleted. (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Deleted. (WebKit::WebPage::dictionaryPopupInfoForRange): Deleted. (WebKit::WebPage::performDictionaryLookupForRange): Deleted. 2018-11-29 Conrad Shultz Factor out configuration of the file upload image picker https://bugs.webkit.org/show_bug.cgi?id=192138 Reviewed by Tim Horton. By factoring configuration of the picker into its own method, it makes it easier to apply custom configuration in subclasses in the future. * UIProcess/ios/forms/WKFileUploadPanel.mm: (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]): (-[WKFileUploadPanel _configureImagePicker:]): 2018-11-29 Tomas Popela [GTK][WPE] Fix BubblewrapLauncher clang warnings https://bugs.webkit.org/show_bug.cgi?id=192086 Reviewed by Michael Catanzaro. * UIProcess/Launcher/glib/BubblewrapLauncher.cpp: (WebKit::bindPathVar): Initialize the i variable to 0. (WebKit::setupSeccomp): Initialize the optional datum_b member. 2018-11-28 Joseph Pecoraro Web Inspector: REGRESSION(?): all "Show *" develop menu items cause the page to crash https://bugs.webkit.org/show_bug.cgi?id=192016 Reviewed by Devin Rousso. Previously calling the Page's inspectorController.show() would create a frontend connection on the WebProcess side. However now the frontend connection is handed to the WebProcess once the UIProcess creates it. So queue actions that take place immediately after showing the inspector until we have a frontend to send the actions to. * WebProcess/WebPage/WebInspector.h: * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::setFrontendConnection): (WebKit::WebInspector::closeFrontendConnection): (WebKit::WebInspector::whenFrontendConnectionEstablished): (WebKit::WebInspector::showConsole): (WebKit::WebInspector::showResources): (WebKit::WebInspector::showTimelines): (WebKit::WebInspector::showMainResourceForFrame): (WebKit::WebInspector::startPageProfiling): (WebKit::WebInspector::stopPageProfiling): (WebKit::WebInspector::startElementSelection): (WebKit::WebInspector::stopElementSelection): 2018-11-28 Vivek Seth Consult dummy storage for HTTPS Upgrade, Apply If Appropriate https://bugs.webkit.org/show_bug.cgi?id=192094 HTTPS Upgrade: Consult dummy storage for HTTPS Upgrade, Apply If Appropriate Reviewed by Chris Dumez. For main page loads upgrade HTTP requests to HTTPS if the hostname belongs to a set of upgradable hostnames. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded): (WebKit::NetworkLoadChecker::checkRequest): * NetworkProcess/NetworkLoadChecker.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::start): 2018-11-28 Simon Fraser REGRESSION (r234980): Crash in -[WKWebView _restorePageStateToUnobscuredCenter:scale:] https://bugs.webkit.org/show_bug.cgi?id=192127 rdar://problem/44194179 Reviewed by Tim Horton. _restorePageStateToUnobscuredCenter: could receive an Optional from the web process, and unconditionally called .value() even though it may not be engaged. No repro steps known, so no testcase. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]): 2018-11-28 Commit Queue Unreviewed, rolling out r238653 and r238656. https://bugs.webkit.org/show_bug.cgi?id=192130 Breaks iOS build (Requested by smfr on #webkit). Reverted changesets: "Move Lookup Code for better cross platform usage" https://bugs.webkit.org/show_bug.cgi?id=191732 https://trac.webkit.org/changeset/238653 "Attempt to fix the iOS build by only including RevealSPI.h when it's needed." https://trac.webkit.org/changeset/238656 2018-11-28 Alex Christensen Modernize BlobRegistry::writeBlobsToTemporaryFiles https://bugs.webkit.org/show_bug.cgi?id=192117 Reviewed by Dean Jackson. * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles): (WebKit::NetworkBlobRegistry::writeBlobToFilePath): * NetworkProcess/FileAPI/NetworkBlobRegistry.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::writeBlobToFilePath): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * UIProcess/ChildProcessProxy.h: (WebKit::ChildProcessProxy::sendWithAsyncReply): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::didClose): (WebKit::NetworkProcessProxy::writeBlobToFilePath): (WebKit::NetworkProcessProxy::didWriteBlobToFilePath): Deleted. * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.messages.in: * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles): * WebProcess/FileAPI/BlobRegistryProxy.h: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didClose): (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles): (WebKit::NetworkProcessConnection::didWriteBlobsToTemporaryFiles): Deleted. * WebProcess/Network/NetworkProcessConnection.h: * WebProcess/Network/NetworkProcessConnection.messages.in: 2018-11-28 Alex Christensen Move loadThrottleLatency from NetworkProcessCreationParameters to NetworkSessionCreationParameters https://bugs.webkit.org/show_bug.cgi?id=192122 Reviewed by Dean Jackson. This is part of an effort to reduce global variables in the NetworkProcess. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::NetworkLoad): (WebKit::NetworkLoad::didReceiveResponse): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::loadThrottleLatency const): Deleted. * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkSession.h: (WebKit::NetworkSession::loadThrottleLatency const): * NetworkProcess/NetworkSessionCreationParameters.cpp: Added. (WebKit::NetworkSessionCreationParameters::privateSessionParameters): (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/NetworkSessionCreationParameters.h: (WebKit::NetworkSessionCreationParameters::encode const): Deleted. (WebKit::NetworkSessionCreationParameters::decode): Deleted. * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::privateSessionParameters): * Sources.txt: * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): * WebKit.xcodeproj/project.pbxproj: 2018-11-15 Megan Gardner Move Lookup Code for better cross platform usage https://bugs.webkit.org/show_bug.cgi?id=191732 Reviewed by Alex Christensen. Lookup is being replaced by Reveal. This framework should work on all platforms. The patch moves the code that we expect will be needed for all platforms to the more general cocoa area. This patch changes no funcationality, and should not change anything currently. This work will be build on later when Reveal is ready to support multiple platforms. * Platform/spi/ios/UIKitSPI.h: * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::performDictionaryLookupAtLocation): (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView cleanupInteraction]): (-[WKContentView _removeDefaultGestureRecognizers]): (-[WKContentView _addDefaultGestureRecognizers]): (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): (-[WKContentView _lookupGestureRecognized:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted. (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): Deleted. * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: (WebKit::WebPage::performDictionaryLookupAtLocation): (WebKit::WebPage::performDictionaryLookupForSelection): (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): (WebKit::WebPage::performDictionaryLookupForRange): (WebKit::WebPage::dictionaryPopupInfoForRange): * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted. (WebKit::WebPage::performDictionaryLookupForSelection): Deleted. (WebKit::WebPage::performDictionaryLookupForRange): Deleted. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted. (WebKit::WebPage::performDictionaryLookupForSelection): Deleted. (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Deleted. (WebKit::WebPage::dictionaryPopupInfoForRange): Deleted. (WebKit::WebPage::performDictionaryLookupForRange): Deleted. 2018-11-28 Keith Rollin Update generate-{derived,unified}-sources scripts to support generating .xcfilelist files https://bugs.webkit.org/show_bug.cgi?id=192031 Reviewed by Alex Christensen. The Generate Derived Sources and Generate Unified Sources build phases in Xcode need to have their inputs and outputs specified. This specification will come in the form of .xcfilelist files that will be attached to these build phases. There is one .xcfilelist file that lists the input file and one that lists the output files. As part of this work, the various generate-{derived,unified}-sources scripts that are executed in these Generate build phases are modified to help in the creation of these .xcfilelist files. In particular, they can now be invoked with command-line parameters. These parameters are then used to alter the normal execution of these scripts, causing them to produce the .xcfilelist files as opposed to actually generating the files that are listed in those files. * Scripts/generate-derived-sources.sh: * Scripts/generate-unified-sources.sh: 2018-11-28 Keith Rollin Revert print_all_generated_files work in r238008; tighten up target specifications https://bugs.webkit.org/show_bug.cgi?id=192025 Reviewed by Alex Christensen. In r238008, I added a facility for DerivedSources.make makefiles to print out the list of files that they generate. This output was used in the generation of .xcfilelist files used to specify the output of the associated Generate Derived Sources build phases in Xcode. This approach worked, but it meant that people would need to follow a specific convention to keep this mechanism working. Instead of continuing this approach, I'm going to implement a new facility based on the output of `make` when passed the -d flag (which prints dependency information). This new mechanism is completely automatic and doesn't need maintainers to follow a convention. To that end, remove most of the work performed in r238008 that supports the print_all_generated_files target. At the same time, it's important for the sets of targets and their dependencies to be complete and correct. Therefore, also include changes to bring those up-to-date. As part of that, you'll see prevalent use of a particular technique. Here's an example: BYTECODE_FILES = \ Bytecodes.h \ BytecodeIndices.h \ BytecodeStructs.h \ InitBytecodes.asm \ # BYTECODE_FILES_PATTERNS = $(subst .,%,$(BYTECODE_FILES)) all : $(BYTECODE_FILES) $(BYTECODE_FILES_PATTERNS): $(wildcard $(JavaScriptCore)/generator/*.rb) $(JavaScriptCore)/bytecode/BytecodeList.rb ... These lines indicate a set of generated files (those specified in BYTECODE_FILES). These files are generated by the BytecodeList.rb tool. But, as opposed to the normal rule where a single foo.output is generated by foo.input plus some additional dependencies, this rule produces multiple output files from a tool whose connection to the output files is not immediately clear. A special approach is needed where a single rule produces multiple output files. The normal way to implement this is to use an .INTERMEDIATE target. However, we used this approach in the past and ran into a problem with it, addressing it with an alternate approach in r210507. The above example shows this approach. The .'s in the list of target files are replaced with %'s, and the result is used as the left side of the dependency rule. * DerivedSources.make: 2018-11-28 Daniel Bates [iOS] Page not defocused when Find-in-page becomes first responder https://bugs.webkit.org/show_bug.cgi?id=192084 Reviewed by Tim Horton. When -becomeFirstResponder and -resignFirstResponder is called the page should become focused and defocused, respectively. WebKit adjusts it behavior depending on whether it knows it has focus. This includes decisions about whether to allow an element to be focused. We need to ensure that WebKit knows whether the web view is focused for it to make good decisions. * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::isViewFocused): Check if the content view is the first responder and hence is accepting keyboard input. Note that picture-in-picture views do not accept keyboard input. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView becomeFirstResponderForWebView]): Update activity state when the view becomes focused. (-[WKContentView resignFirstResponderForWebView]): Update activity state when the view becomes defocused. 2018-11-28 Alex Christensen Remove dead code from an earlier attempt at implementing safe browsing https://bugs.webkit.org/show_bug.cgi?id=192067 Reviewed by Chris Dumez. * Shared/LoadParameters.cpp: (WebKit::LoadParameters::encode const): (WebKit::LoadParameters::decode): * Shared/LoadParameters.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadAlternateHTML): (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync): (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::decidePolicyForNavigationActionSync): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2018-11-28 Alex Christensen Move logCookieInformation bool from NetworkProcess to NetworkSession https://bugs.webkit.org/show_bug.cgi?id=192049 Reviewed by Chris Dumez. Part of an effort to remove globals in the NetworkProcess. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::shouldLogCookieInformation const): Deleted. * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode const): (WebKit::NetworkProcessCreationParameters::decode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didFinishLoading): (WebKit::NetworkResourceLoader::sendResultForCacheEntry): (WebKit::NetworkResourceLoader::shouldLogCookieInformation): (WebKit::NetworkResourceLoader::logCookieInformation const): (WebKit::logBlockedCookieInformation): (WebKit::logCookieInformationInternal): (WebKit::NetworkResourceLoader::logCookieInformation): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/NetworkSession.h: (WebKit::NetworkSession::logCookieInformation const): * NetworkProcess/NetworkSessionCreationParameters.h: (WebKit::NetworkSessionCreationParameters::encode const): (WebKit::NetworkSessionCreationParameters::decode): * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): * NetworkProcess/cocoa/NetworkSessionCocoa.h: * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::parameters): 2018-11-28 Ryan Haddad Unreviewed, rolling out r238620. Broke internal builds again. Reverted changeset: "Remove @no-unify of InjectedBundleRangeHandle.cpp and InjectedBundleNodeHandle.cpp" https://bugs.webkit.org/show_bug.cgi?id=191853 https://trac.webkit.org/changeset/238620 2018-11-28 Yongjun Zhang Allow WebKit clients to specify a minimum effective width for layout. https://bugs.webkit.org/show_bug.cgi?id=191499 Reviewed by Wenson Hsieh. If we ignore the meta viewport (_shouldIgnoreMetaViewport is true), the default layout width will be device width. For clients that wish to lay out the content with a different width value, we would need to add a way to specify the effective width for layout. * UIProcess/API/Cocoa/WKWebView.mm: Add an iVar _minimumEffectiveDeviceWidth. (-[WKWebView _dispatchSetViewLayoutSize:]): Call the new setViewportConfigurationViewLayoutSize method. (-[WKWebView _setViewScale:]): Ditto. (-[WKWebView _setMinimumEffectiveWidth:]): The setter for _minimumEffectiveDeviceWidth. (-[WKWebView _minimumEffectiveWidth]): Getter for _minimumEffectiveDeviceWidth * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add a property _minimumEffectiveDeviceWidth to WKWebView. * UIProcess/WebPageProxy.h: Change setViewportConfigurationViewLayoutSize to take another argument minimumEffectiveDeviceWidth. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize): Also send effectiveWidth to WebContent process. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): Set the initial effective width to 0 when creating a web page, this tells ViewportConfiguration to ignore the minimum effective width value. * WebProcess/WebPage/WebPage.h: Change setViewportConfigurationViewLayoutSize to take another argument effectiveWidth. * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::setViewportConfigurationViewLayoutSize): Also pass effectiveWidth value to ViewportConfiguration. 2018-11-28 Fujii Hironori Remove @no-unify of InjectedBundleRangeHandle.cpp and InjectedBundleNodeHandle.cpp https://bugs.webkit.org/show_bug.cgi?id=191853 Reviewed by Michael Catanzaro. In r235845, I excluded InjectedBundleRangeHandle.cpp and InjectedBundleNodeHandle.cpp from unify source builds in order to work around a MSVC bug. Then, I commited a different workaround for the MSVC bug in r238386. Now, we can include InjectedBundleRangeHandle.cpp and InjectedBundleNodeHandle.cpp in unified source builds. Revert r235845. * Sources.txt: Removed @no-unify of InjectedBundleRangeHandle.cpp and InjectedBundleNodeHandle.cpp * WebKit.xcodeproj/project.pbxproj: Unchecked Target Membership not to be compiled by XCode. 2018-11-28 Joseph Pecoraro Web Inspector: REGRESSION(r238378): reloading WebInspector after a settings change doesn't re-show WebInspector https://bugs.webkit.org/show_bug.cgi?id=191971 Reviewed by Matt Baker. * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::reopen): Deleted. * WebProcess/WebPage/WebInspector.h: * WebProcess/WebPage/WebInspector.messages.in: Move reopen out of the WebProcess... * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::reopen): * UIProcess/WebInspectorProxy.h: * UIProcess/WebInspectorProxy.messages.in: And into the UIProcess where the order of messages won't be as problematic. * WebProcess/WebPage/WebInspectorUI.cpp: (WebKit::WebInspectorUI::reopen): Send a message to the WebInspectorProxy instead. 2018-11-28 Alexey Proskuryakov Remove another OS version check from NetworkDataTaskCocoa.mm https://bugs.webkit.org/show_bug.cgi?id=192046 Reviewed by Alex Christensen. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::statelessCookieStorage): 2018-11-28 Alexey Proskuryakov Modernize version checks for same site cookie support https://bugs.webkit.org/show_bug.cgi?id=192054 Reviewed by Tim Horton. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::updateTaskWithFirstPartyForSameSiteCookies): Also removed runtime checks, which are no longer relevant. 2018-11-27 Mark Lam ENABLE_FAST_JIT_PERMISSIONS should be false for iosmac. https://bugs.webkit.org/show_bug.cgi?id=192055 Reviewed by Saam Barati. * Configurations/FeatureDefines.xcconfig: 2018-11-27 Alex Christensen Make synchronous IPC introduced in r237267 asynchronous https://bugs.webkit.org/show_bug.cgi?id=190757 Reviewed by Chris Dumez. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _getActivePagesOriginsInWebProcessForTesting:completionHandler:]): (-[WKProcessPool _getActivePagesOriginsInWebProcessForTesting:]): Deleted. * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::activePagesOriginsInWebProcessForTesting): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::activePagesDomainsForTesting): * UIProcess/WebProcessProxy.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::getActivePagesOriginsForTesting): * WebProcess/WebProcess.messages.in: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::getActivePagesOriginsForTesting): 2018-11-27 Alex Christensen Safe browsing warning text needs to be visible on High Sierra https://bugs.webkit.org/show_bug.cgi?id=192022 Reviewed by Tim Horton. Something about AppKit, autolayout, view insertion order, and NSTextView makes the text lay out with initial size of {0, 0} on High Sierra. Using an NSTextField instead makes the details visible. Covered by an API test. * UIProcess/Cocoa/WKSafeBrowsingWarning.h: * UIProcess/Cocoa/WKSafeBrowsingWarning.mm: (makeLabel): (-[WKSafeBrowsingWarning addContent]): (-[WKSafeBrowsingWarning showDetailsClicked]): (-[WKSafeBrowsingWarning layoutText]): (makeTitleLabel): Deleted. 2018-11-27 Tim Horton WKNavigation.AutomaticViewReloadAfterWebProcessCrash asserts after r238538 https://bugs.webkit.org/show_bug.cgi?id=192038 Reviewed by Wenson Hsieh. * UIProcess/WebPageProxy.cpp: (WebKit::m_resetRecentCrashCountTimer): (WebKit::WebPageProxy::finishAttachingToWebProcess): (WebKit::WebPageProxy::resetState): (WebKit::m_editableImageController): Deleted. Properly invalidate m_editableImageController when resetting WebPageProxy. Otherwise, the MessageReceiverMaps get invalidated, then later when EditableImageController goes away we assert trying to remove the receiver. 2018-11-27 Jiewen Tan (r238246) [ MacOS Debug ] Layout Test http/wpt/webauthn/ctap-hid-failure.https.html is Crashing https://bugs.webkit.org/show_bug.cgi?id=191757 Reviewed by Chris Dumez. Wrong nonce error causes retransmission, which then trigger wrong nonce error. This is expected behavior for mock testing. However, the main thread could time out when MockHidConnection::send is excuting the block on another thread. The block will then return without invoking the callback, which triggers this WTFCrash. The solution is always invoking the callback before return in the block. * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp: (WebKit::MockHidConnection::send): 2018-11-27 Keith Rollin Better parsing of comments in generate-message*.py https://bugs.webkit.org/show_bug.cgi?id=191866 Reviewed by Chris Dumez. The script parsing the *.messages.in files would treat a line starting with '#' as a comment, but not a line starting with '#'. This means that jamming a '#' right in front of the first character of a message definition (as opposed to the beginning of a line) will have no effect and the line will get treated just the same as a non-commented line. Fix this by trimming all white space from the beginning and ending of the line before processing it. * Scripts/webkit/parser.py: (parse): * Scripts/webkit/test-messages.in: 2018-11-27 Thibault Saunier [GTK|WPE] Allow disabling WebRTC unified plan SDP through an env var https://bugs.webkit.org/show_bug.cgi?id=192024 Reviewed by Michael Catanzaro. * UIProcess/API/glib/WebKitSettings.cpp: (webKitSettingsConstructed): 2018-11-27 Alexey Proskuryakov Modernize the check for async _saveCookies existence https://bugs.webkit.org/show_bug.cgi?id=191987 Reviewed by Dean Jackson. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformSyncAllCookies): 2018-11-27 Tim Horton Serialize and deserialize editable image strokes https://bugs.webkit.org/show_bug.cgi?id=192002 Reviewed by Dean Jackson. * UIProcess/API/APIAttachment.cpp: (API::Attachment::updateAttributes): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::willUpdateAttachmentAttributes): * UIProcess/WebPageProxy.h: When an attachment would update its DOM attributes, plumb a notification to EditableImageController, and allow it to block the update (because we don't really want to set src for editable image attachments, we just want the UI process to fully own the data). * Platform/spi/ios/PencilKitSPI.h: Add some SPI. * UIProcess/ios/EditableImageController.h: * UIProcess/ios/EditableImageController.mm: (WebKit::EditableImageController::loadStrokesFromAttachment): Add a helper to load strokes from an attachment. (WebKit::EditableImageController::associateWithAttachment): Try to load strokes from the attachment when initially associated. Don't create a file wrapper around a null image, so it will be regenerated later. (WebKit::EditableImageController::willUpdateAttachmentAttributes): The aforementioned plumbing at update time. * UIProcess/ios/WKDrawingView.h: * UIProcess/ios/WKDrawingView.mm: (-[WKDrawingView layoutSubviews]): Invalidate the attachment (so it will be regenerated upon request) if the canvas size changes. (-[WKDrawingView PNGRepresentation]): Serialize strokes into the EXIF User Comment field. We will find a different field to use (ideally a custom vendor-specific field that nobody else will use for anything), but this works for now. Don't try to render an image if we don't have a size or scale; PKImageRenderer will just fail anyway, so bail early. In the iOS Simulator, PKImageRenderer currently returns an unusable image. Instead, so that we have a image on which to serialize the strokes, create a transparent 1x1 image. This makes it possible to serialize strokes even though we don't have a usable rendered image, so that we can still test this change (and future changes). (-[WKDrawingView loadDrawingFromPNGRepresentation:]): If available, deserialize strokes from the EXIF User Comment field. (-[WKDrawingView drawingDidChange:]): (-[WKDrawingView invalidateAttachment]): Factor invalidateAttachment out of drawingDidChange so we can call it from layoutSubviews too! 2018-11-27 Chris Dumez Regression(PSON) crash under WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame() https://bugs.webkit.org/show_bug.cgi?id=191983 Reviewed by Geoffrey Garen. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::continueNavigationInNewProcess): Make sure the navigation still exists in m_mainFrameCreationHandler and return early if it does not. (WebKit::WebPageProxy::resetState): Clear out m_mainFrameCreationHandler / m_mainFrameWindowCreationHandler if we resetting the state after a crash. At this point, there is no chance the WebProcess will send us the IPC that will cause these to get called and we do not want old state to remain for future navigations. 2018-11-16 Jiewen Tan Disallow loading webarchives as iframes https://bugs.webkit.org/show_bug.cgi?id=191728 Reviewed by Youenn Fablet. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::unableToImplementPolicy): Add a check to prevent null pointer dereference. 2018-11-27 Wenson Hsieh WebKit.AddAndRemoveDataDetectors hits a debug assertion after r238515 https://bugs.webkit.org/show_bug.cgi?id=191996 Reviewed by Tim Horton. This assertion is hit because `decode(Decoder& decoder, NSArray *allowedClasses)` expects the decoded object (of class `_NSArrayM`) to be equal to `NSArray.class`. We fix the crash by relaxing the debug assertion when decoding securely-codable objects over IPC. Instead of checking that the class of the decoded object is equal to one of the allowed classes, check that the object is a kind of any of the allowed classes. * Shared/Cocoa/ArgumentCodersCocoa.h: (IPC::isObjectClassAllowed): (IPC::decode): 2018-11-27 Tomas Popela [GTK][WPE] Remove temporary workaround in Source/WebKit/Platform*.cmake https://bugs.webkit.org/show_bug.cgi?id=192008 Reviewed by Michael Catanzaro. Looks like it's not needed anymore as the code compiles fine without it. * PlatformGTK.cmake: * PlatformWPE.cmake: 2018-11-27 Antti Koivisto Factor mask layer applying in RemoteLayerTreePropertyApplier into a shared function https://bugs.webkit.org/show_bug.cgi?id=192001 Reviewed by Tim Horton. * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h: * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm: (WebKit::RemoteLayerTreePropertyApplier::applyProperties): (WebKit::RemoteLayerTreePropertyApplier::updateMask): Shared function, with some special tricks for iOS backdrop layers. (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToUIView): 2018-11-27 Antti Koivisto Stop collecting related layers in RemoteLayerTreeHost::updateLayerTree https://bugs.webkit.org/show_bug.cgi?id=192003 Reviewed by Tim Horton. We can pass the node hash directly to RemoteLayerTreePropertyApplier. The collection step doesn't seem to add anything except an extra hash lookup. * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::updateLayerTree): Pass m_nodes directly. Some random cleanups. 2018-11-27 Antti Koivisto Remote tile layers shouldn't be UIViews https://bugs.webkit.org/show_bug.cgi?id=191953 Reviewed by Tim Horton. They don't need any UIView functionality, nor do they ever have UIView descendants. We can use lighter weight objects. * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h: * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm: (WebKit::RemoteLayerTreePropertyApplier::applyProperties): (WebKit::RemoteLayerTreePropertyApplier::updateChildren): Factor to a function shared between platforms. Support having both views and plain layers in the same tree. Assert that all siblings are of the same type and that we don't attempt to add views to layers. (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToUIView): * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::makeNode): Use new plain layer on Mac too. * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm: (-[WKPlainRemoteLayer description]): Add a CALayer subclass so we can have a description, similar to WKCompositingView and pals. (WebKit::RemoteLayerTreeNode::createWithPlainLayer): (WebKit::RemoteLayerTreeNode::detachFromParent): Support having null view. (WebKit::RemoteLayerTreeNode::appendLayerDescription): Helper for layer descriptions. * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: (WebKit::RemoteLayerTreeHost::makeNode): Construct plain layers for tiles. * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm: (-[WKCompositingView description]): (-[WKUIRemoteView description]): (-[WKBackdropView description]): 2018-11-27 Fujii Hironori Remove "using namespace WebCore" under Source/WebKit/WebProcess/InjectedBundle/API https://bugs.webkit.org/show_bug.cgi?id=191995 Reviewed by Alex Christensen. The statement "using namespace WebCore" should be placed inside namespace WebKit for unified source builds. But, source files defining WebKit API can't be enclosed by namespace WebKit { } becuase they are defined in the global scope. "using namespace WebCore" in global scope and unified source builds may cause build breaks (Bug 191853). Remove "using namespace WebCore" in the global scope. Use "WebCore::" prefix instead. * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleClearAllDatabases): (WKBundleSetDatabaseQuota): (WKBundleClearResourceLoadStatistics): (WKBundleResourceLoadStatisticsNotifyObserver): * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp: (WKBundleFrameGetFrameLoadState): (WKBundleFrameClearOpener): (WKBundleFrameCallShouldCloseOnWebView): (WKBundleFrameCopySecurityOrigin): (WKBundleFrameFocus): * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp: 2018-11-26 Wenson Hsieh [Cocoa] No way for clients to tell whether the content view is in the responder chain when the web view is https://bugs.webkit.org/show_bug.cgi?id=169212 Reviewed by Tim Horton. Add an SPI hook to allow internal WKWebView clients to determine whether the WKWebView's content view is the first responder. Intended for use by clients, such as Mail, that embed native text input views and other views that may become first responder within the view hierarchy of the WKWebView. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _contentViewIsFirstResponder]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2018-11-26 Tim Horton Insert elements under editable images to make their backing data accessible https://bugs.webkit.org/show_bug.cgi?id=191844 Reviewed by Simon Fraser. * DerivedSources.make: * SourcesCocoa.txt: * UIProcess/API/APIAttachment.h: fileWrapper() is no longer a trivial getter; it can now construct the file wrapper from a file wrapper generator if necessary. Add setFileWrapperGenerator() and invalidateGeneratedFileWrapper(). Make m_fileWrapper mutable so it can be adjusted inside its own getter. * UIProcess/API/Cocoa/APIAttachmentCocoa.mm: (API::Attachment::fileWrapper const): If we have a fileWrapperGenerator and don't have a cached file wrapper, create one before returning it. (API::Attachment::invalidateGeneratedFileWrapper): Invalidate the currently-cached file wrapper. The next time a client requests the file wrapper it will be regenerated. (API::Attachment::fileName const): (API::Attachment::fileSizeForDisplay const): (API::Attachment::enclosingImageData const): (API::Attachment::isEmpty const): (API::Attachment::createSerializedRepresentation const): Make use of fileWrapper() instead of m_fileWrapper directly, to ensure that it is created lazily if necessary. (API::Attachment::setFileWrapperGenerator): * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: (WebKit::RemoteLayerTreeHost::createEmbeddedView): * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h: * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm: (-[WKEmbeddedView initWithEmbeddedViewID:]): Defer to EditableImageController for creating WKDrawingViews for editable images. This is done primarily so we don't have to pollute Remote Layer Tree and DrawingArea interfaces with editable-image-specific messages. * UIProcess/WebPageProxy.cpp: (WebKit::m_editableImageController): (WebKit::m_resetRecentCrashCountTimer): Deleted. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::editableImageController): Keep an EditableImageController on the WebPageProxy. * UIProcess/ios/EditableImageController.h: Added. * UIProcess/ios/EditableImageController.messages.in: Added. * UIProcess/ios/EditableImageController.mm: Added. (WebKit::EditableImageController::EditableImageController): (WebKit::EditableImageController::~EditableImageController): (WebKit::EditableImageController::ensureEditableImage): (WebKit::EditableImageController::editableImage): (WebKit::EditableImageController::didCreateEditableImage): (WebKit::EditableImageController::didDestroyEditableImage): (WebKit::EditableImageController::associateWithAttachment): (WebKit::EditableImageController::invalidateAttachmentForEditableImage): Add EditableImageController, which keeps track of EditableImages. It can be messaged directly to create or destroy the UI-side state of an editable image, and also to associate a WKDrawingView with a particular attachment. * UIProcess/ios/WKDrawingView.h: * UIProcess/ios/WKDrawingView.mm: (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]): Store the WebPageProxy (weakly) so that we can get to the EditableImageController. (-[WKDrawingView layoutSubviews]): (-[WKDrawingView PNGRepresentation]): Synchronously render the PKCanvasView to PNG. (-[WKDrawingView drawingDidChange:]): If the drawing changes, inform the APIAttachment that it needs to discard its NSFileWrapper; a new one will be generated lazily. (-[WKDrawingView init]): Deleted. * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: (WebKit::WebChromeClient::associateEditableImageWithAttachment): (WebKit::WebChromeClient::didCreateEditableImage): (WebKit::WebChromeClient::didDestroyEditableImage): 2018-11-26 Jer Noble Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI https://bugs.webkit.org/show_bug.cgi?id=190951 Reviewed by Alex Christensen. Add an asyncronous reply request to VideoFullscreenManager. * Platform/IPC/MessageSender.h: (IPC::MessageSender::sendWithAsyncReply): * UIProcess/Cocoa/VideoFullscreenManagerProxy.h: * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: (WebKit::VideoFullscreenModelContext::requestRouteSharingPolicyAndContextUID): * WebProcess/cocoa/VideoFullscreenManager.h: * WebProcess/cocoa/VideoFullscreenManager.messages.in: * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::VideoFullscreenManager::requestRouteSharingPolicyAndContextUID): 2018-11-26 Alex Christensen Rename WKWebView._safeBrowsingWarningForTesting to _safeBrowsingWarning to use it for more than testing https://bugs.webkit.org/show_bug.cgi?id=191981 Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _safeBrowsingWarning]): (-[WKWebView _safeBrowsingWarningForTesting]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2018-11-26 Daniel Bates REGRESSION (r237738): Command Down Arrow doesn't scroll to the end of a page anymore https://bugs.webkit.org/show_bug.cgi?id=191967 Reviewed by Tim Horton. Fixes an issue where pressing Command + Down Arrow does not scroll the view to the end of the page. Following r237738 the value of the enumerations used to identify modifier keys (e.g. Shift) changed to match the values of the corresponding enumerations in GraphicsServices, which are the enumerations UIKit uses to computes the modifier flags bitmask when instantiating a WebEvent to pass to WebKit. Before r237738 WebKit was using enumerations whose values matched the values of the corresponding UIKit public API UIKeyModifier* enumerations. For non-content editable elements, WebKit intercepts UIKit events in -_handleKeyUIEvent, synthesizes and dispatches its own WebEvent. However it was creating WebEvents with a modifier flags bitmask built from the UIKeyModifier* enumerations, -_modifierFlags, as opposed to a bitmask from the GraphicsServices enumerations, -_gsModifierFlags. Instead WebKit should call -_gsModifierFlags to compute the GraphicsServices-compatible modifier flags bitmask when instantiating a WebEvent. * Platform/spi/ios/UIKitSPI.h: Expose -_gsModifierFlags and remove -_modifierFlags. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _handleKeyUIEvent:]): Remove unnecessary code to update the current modifier state. This will be done by the WebProcess when it receives the keyboard event. (-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Do not pass modifier flags changed events to the scrolling animator as it does not know how to handle these kinds of events and triggers an assertion failure when it tries to read the input string from the event (calls -charactersIgnoringModifiers). FlagsChanged WebEvents events do not have an input string just like a FlagsChanged NSEvent that they model on Mac. * UIProcess/ios/WKWebEvent.mm: (-[WKWebEvent initWithEvent:]): Pass the value of -_gsModifierFlags for the modifier flags bitmask instead of the value of -_modifierFlags. 2018-11-26 Chris Dumez [PSON] process pre-warming should not be on for everyone https://bugs.webkit.org/show_bug.cgi?id=191966 Reviewed by Ryosuke Niwa. If automatic process-prewarming is not explicitly turned on/off by the client, then we now only turn it on automatically after the first process swap. Previously, it was always enabled if process-swap on cross-site navigation was enabled (which is the case by default for all apps). This is important because some apps do not actually browse (only display static content) or never browse cross-site, and thus would not benefit from process prewarming and yet pay a memory cost. * UIProcess/API/APIProcessPoolConfiguration.h: Add m_clientWouldBenefitFromAutomaticProcessPrewarming flag which is false by default and is used as a fallback if the client did not call setIsAutomaticProcessWarmingEnabled(). * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationPrewarmsProcessesAutomatically): (WKContextConfigurationSetPrewarmsProcessesAutomatically): Add C API to toggle automatic process prewarming. It is needed for Safari to turn on this feature by default for browsing. This way Safari does not have to wait for the first process swap to start prewarming. * UIProcess/API/C/WKContextConfigurationRef.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::didReachGoodTimeToPrewarm): Only do automatic process prewarming if process-swap on cross-site navigation is also enabled. This is needed for clients like Safari that explicitly enable automatic process prewarming but only want to have it enabled if PSON is also enabled via experimental features. (WebKit::WebProcessPool::processForNavigation): On first process swap, if the client did not explicitly turn on or off automatic process prewarming then we enable it then. This avoids paying the cost of process prewarming in apps that would not benefit from it. 2018-11-26 Andy Estes [Cocoa] Make it easier to encode NSObjects https://bugs.webkit.org/show_bug.cgi?id=191948 Reviewed by Dean Jackson. It should be easier to encode objects that conform to NSSecureCoding for WebKit IPC. Right now, several argument coders duplicate the logic for encoding and decoding objects using NSKeyedArchiver and NSKeyedUnarchiver. This patch adds encodeObject() and decodeObject() primitives for encoding and decoding using Foundation keyed archiving. It then partially specializes ArgumentCoder for raw pointers and RetainPtrs whose pointee conforms to NSSecureCoding to call these new primitives. This allows us to use Encoder::operator<< to encode raw pointers or RetainPtrs and use Decoder::operator>> to decode to an optional RetainPtr. By default, IPC::decode infers the allowed class for decoding by calling `[T class]`. We can also specify the allowed classes explicitly for containers and classes that are loaded at runtime. * Shared/Cocoa/ArgumentCodersCocoa.h: Added. * Shared/Cocoa/ArgumentCodersCocoa.mm: Added. * Shared/Cocoa/DataDetectionResult.mm: (WebKit::DataDetectionResult::encode const): Removed custom encoding code and used ArgumentCodersCocoa instead. (WebKit::DataDetectionResult::decode): Ditto. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::encode): Ditto. (IPC::ArgumentCoder::decode): Ditto. (IPC::ArgumentCoder::decode): Ditto. * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::description const): Added some needed namespaces due to unified source shuffling. * Shared/WebCoreArgumentCoders.h: Modernized several decoders. * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode const): Removed custom encoding code and used ArgumentCodersCocoa instead. (WebKit::InteractionInformationAtPosition::decode): Ditto. * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encodePlatformData): Ditto. (IPC::ArgumentCoder::decodePlatformData): Ditto. (IPC::ArgumentCoder::encodePlatformData): Ditto. (IPC::ArgumentCoder::decodePlatformData): Ditto. (IPC::ArgumentCoder::encodePlatformData): Ditto. (IPC::ArgumentCoder::decodePlatformData): Ditto. (IPC::deviceContextKey): Deleted. * Shared/mac/WebHitTestResultData.mm: (WebKit::WebHitTestResultData::platformEncode const): Ditto. (WebKit::WebHitTestResultData::platformDecode): Ditto. * SourcesCocoa.txt: Added ArgumentCodersCocoa.mm. * WebKit.xcodeproj/project.pbxproj: Ditto. 2018-11-26 Wenson Hsieh CompletionHandler-based async IPC messages only work when the completion handler takes a single argument https://bugs.webkit.org/show_bug.cgi?id=191965 Reviewed by Tim Horton. Teach `messages.py` to handle the case where an async IPC completion handler takes no arguments, or takes more than a single argument. Currently, the generated code attempts to wrap all arguments in a `WTFMove(*~)`, but this either results in `WTFMove(*)` in the case where there are no arguments, or `WTFMove(*foo, *bar, *baz)` in the case where there are several arguments. Both of these results fail to compile. Instead, emit `completionHandler()` when there are no arguments, and `completionHandler(WTFMove(*foo), WTFMove(*bar), WTFMove(*baz))` when there are multiple arguments. Tests: TestAsyncMessageWithNoArguments TestAsyncMessageWithMultipleArguments * Scripts/webkit/MessageReceiverSuperclass-expected.cpp: (Messages::WebPage::TestAsyncMessageWithNoArguments::callReply): (Messages::WebPage::TestAsyncMessageWithNoArguments::cancelReply): (Messages::WebPage::TestAsyncMessageWithNoArguments::send): (Messages::WebPage::TestAsyncMessageWithMultipleArguments::callReply): (Messages::WebPage::TestAsyncMessageWithMultipleArguments::cancelReply): (Messages::WebPage::TestAsyncMessageWithMultipleArguments::send): (WebKit::WebPage::didReceiveMessage): * Scripts/webkit/MessagesSuperclass-expected.h: (Messages::WebPage::TestAsyncMessageWithNoArguments::receiverName): (Messages::WebPage::TestAsyncMessageWithNoArguments::name): (Messages::WebPage::TestAsyncMessageWithNoArguments::asyncMessageReplyName): (Messages::WebPage::TestAsyncMessageWithNoArguments::arguments const): (Messages::WebPage::TestAsyncMessageWithMultipleArguments::receiverName): (Messages::WebPage::TestAsyncMessageWithMultipleArguments::name): (Messages::WebPage::TestAsyncMessageWithMultipleArguments::asyncMessageReplyName): (Messages::WebPage::TestAsyncMessageWithMultipleArguments::arguments const): * Scripts/webkit/messages.py: * Scripts/webkit/messages_unittest.py: Add new `messages.py` unit tests to cover these cases. * Scripts/webkit/test-superclass-messages.in: 2018-11-26 Jeremy Jones Use Full Screen consistently in localizable strings. https://bugs.webkit.org/show_bug.cgi?id=190363 rdar://problem/43882333 Reviewed by Jon Lee. Rename "Fullscreen" to "Full Screen" in localizable strings for consistency. * UIProcess/ios/fullscreen/WKFullScreenViewController.mm: (-[WKFullScreenViewController _showPhishingAlert]): 2018-11-26 Daniel Bates Wire up ChromeClient::takeFocus() on iOS https://bugs.webkit.org/show_bug.cgi?id=191763 Reviewed by Dan Bernstein. Expose existing Mac SPI for use on iOS. This will allow Safari to be notified when the engine has cycled through all the tab focusable elements on the page. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): 2018-11-26 Wenson Hsieh Unreviewed, fix the internal 32-bit macOS 10.13 build after r238471 r238471 added an `#include WebPageMessages.h` in `WebPage.h`, which causes the 32-bit macOS build using an internal macOS SDK ≤ 10.13 to fail. To address this, move the `#include` back under `PLATFORM(IOS_FAMILY)` by changing the parameters of `WebPage::removeDataDetectedLinks` and `WebPage::detectDataInAllFrames` to completion handlers rather than async IPC replies. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::removeDataDetectedLinks): (WebKit::WebPage::detectDataInAllFrames): * WebProcess/WebPage/WebPage.h: 2018-11-26 Antti Koivisto Clean up layer tree freezing logic in WebPage https://bugs.webkit.org/show_bug.cgi?id=191826 Reviewed by Dean Jackson. Use OptionSet to track various reasons that can cause layer tree to get frozen. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::reinitializeWebPage): (WebKit::WebPage::freezeLayerTree): (WebKit::WebPage::unfreezeLayerTree): (WebKit::WebPage::updateDrawingAreaLayerTreeFreezeState): Layer tree is unfrozen when there there are no reasons to freeze it. (WebKit::WebPage::didStartPageTransition): (WebKit::WebPage::didCompletePageTransition): (WebKit::WebPage::beginPrinting): (WebKit::WebPage::endPrinting): (WebKit::WebPage::setIsSuspended): (WebKit::WebPage::setLayerTreeStateIsFrozen): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::applicationDidEnterBackground): (WebKit::WebPage::applicationWillEnterForeground): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::actualPrepareToSuspend): (WebKit::WebProcess::cancelPrepareToSuspend): (WebKit::WebProcess::freezeAllLayerTrees): (WebKit::WebProcess::unfreezeAllLayerTrees): (WebKit::WebProcess::processDidResume): (WebKit::WebProcess::setAllLayerTreeStatesFrozen): Deleted. * WebProcess/WebProcess.h: 2018-11-25 Antti Koivisto RemoteLayerTreeNode construction cleanups https://bugs.webkit.org/show_bug.cgi?id=191951 Reviewed by Tim Horton. * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::updateLayerTree): Drop unused LayerProperties argument. (WebKit::RemoteLayerTreeHost::createLayer): Split the actual construction out to makeNode. Map updating is shared between platforms. Move setting of layerID and clearing default actions to RemoteLayerTreeNode. (WebKit::RemoteLayerTreeHost::makeNode): Returns RemoteLayerTreeNode. (WebKit::RemoteLayerTreeHost::setLayerID): Deleted. (WebKit::RemoteLayerTreeHost::layerID): Deleted. Move to RemoteLayerTreeNode. * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm: (WebKit::RemoteLayerTreeNode::RemoteLayerTreeNode): (WebKit::RemoteLayerTreeNode::setLayerID): (WebKit::RemoteLayerTreeNode::layerID): * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: (WebKit::RemoteLayerTreeHost::makeNode): (WebKit::RemoteLayerTreeHost::createEmbeddedView): (WebKit::RemoteLayerTreeHost::createLayer): Deleted. * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm: (-[WKCompositingView description]): (-[WKUIRemoteView description]): (-[WKBackdropView description]): * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm: (WebKit::addAnimationToLayer): 2018-11-25 Tim Horton Make it possible to insert editable images with a gesture https://bugs.webkit.org/show_bug.cgi?id=191937 Reviewed by Wenson Hsieh. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _stylusTapGestureShouldCreateEditableImage]): * UIProcess/API/Cocoa/WKWebViewInternal.h: Add a internal getter for a WKWebViewConfiguration property. * UIProcess/WebEditCommandProxy.cpp: (WebKit::WebEditCommandProxy::nameForEditAction): Add a undo name. * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView cleanupInteraction]): (-[WKContentView _removeDefaultGestureRecognizers]): (-[WKContentView _addDefaultGestureRecognizers]): Add a single-stylus-tap gesture recognizer. (-[WKContentView _stylusSingleTapRecognized:]): If allowed, request to insert an editable image when a stylus tap occurs. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::handleStylusSingleTapAtPoint): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleStylusSingleTapAtPoint): Do a hit test, select the hit position, insert an editable image, and then de-assist any assisted node (to make the keyboard go away). For now, we'll only insert if we hit non-replaced elements, though this heuristic will need to be enhanced significantly once we decide on a design. 2018-11-25 Tim Horton Scrolling and drawing compete for incoming gestures https://bugs.webkit.org/show_bug.cgi?id=191940 Reviewed by Wenson Hsieh. * Platform/spi/ios/PencilKitSPI.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/ios/WKDrawingView.mm: (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]): Make scrolling and drawing mutually exclusive if editable images are enabled. 2018-11-24 Wenson Hsieh [Cocoa] Fix a few localizable string descriptions in WebEditCommandProxy.cpp and WebEditorClient.mm https://bugs.webkit.org/show_bug.cgi?id=191945 Reviewed by Anders Carlsson. Replace some a couple of command undo action name descriptions with "Undo action name", to match all other edit commands. * UIProcess/WebEditCommandProxy.cpp: (WebKit::WebEditCommandProxy::nameForEditAction): 2018-11-24 Wenson Hsieh [Cocoa] Add WKWebView SPI to trigger and remove data detection https://bugs.webkit.org/show_bug.cgi?id=191918 Reviewed by Tim Horton. Adds support for two new WKWebView SPI methods, `-_detectDataWithTypes:completionHandler:` and `-_removeAllDataDetectedLinks:`, to allow internal WebKit clients to run data detection and add links to data detected content, or remove all data detected links from the document. Test: WebKit.AddAndRemoveDataDetectors * Shared/Cocoa/DataDetectionResult.h: * Shared/Cocoa/DataDetectionResult.mm: (WebKit::DataDetectionResult::decode): Modernize DataDetectionResult's IPC decoding, so that it can be used with reply-based async IPC. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _removeDataDetectedLinks:]): (-[WKWebView _detectDataWithTypes:completionHandler:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::detectDataInAllFrames): (WebKit::WebPageProxy::removeDataDetectedLinks): Add or remove data detected links from each frame in the page, and then propagate the new data detector results of the main frame to the UI process (this matches current behavior, where the results of -[WKWebView _dataDetectionResults] only reflects data detection results in the main frame of the page). * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::removeDataDetectedLinks): (WebKit::WebPage::detectDataInAllFrames): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2018-11-24 Andy Estes [Cocoa] SOFT_LINK_CLASS_FOR_{HEADER,SOURCE} should generate a more concise getter function https://bugs.webkit.org/show_bug.cgi?id=191899 Reviewed by Dean Jackson. * Shared/cocoa/WebCoreArgumentCodersCocoa.mm: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: 2018-11-23 Antti Koivisto Replace LayerOrView typedef with a class https://bugs.webkit.org/show_bug.cgi?id=191927 Reviewed by Tim Horton. This typedef restricts remote layer representation to be either a CA layer or a view. We might want have more flexibility, for example tiles don't really need to be UIViews. It will also make it easier to unify Mac and iOS code, and hopefully make it less confusing too. This patch introduces RemoteLayerTreeNode class that replaces most uses of LayerOrView typedef (the rest are converted to pure CALayer). It also does a bunch of related cleanup. * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h: * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm: (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer): (WebKit::RemoteLayerTreePropertyApplier::applyProperties): (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToUIView): (WebKit::applyPropertiesToLayer): Deleted. * SourcesCocoa.txt: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _propertiesOfLayerWithID:]): * UIProcess/Cocoa/LayerRepresentation.h: Removed. * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID): * UIProcess/PageClient.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): (WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator): (WebKit::RemoteLayerTreeDrawingAreaProxy::layerWithIDForTesting const): * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h: (WebKit::RemoteLayerTreeHost::rootNode const): (WebKit::RemoteLayerTreeHost::rootLayer const): Deleted. * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::updateLayerTree): (WebKit::RemoteLayerTreeHost::nodeForID const): (WebKit::RemoteLayerTreeHost::layerWillBeRemoved): (WebKit::RemoteLayerTreeHost::animationDidStart): (WebKit::RemoteLayerTreeHost::animationDidEnd): (WebKit::RemoteLayerTreeHost::clearLayers): (WebKit::RemoteLayerTreeHost::layerWithIDForTesting const): (WebKit::RemoteLayerTreeHost::layerForID const): (WebKit::RemoteLayerTreeHost::rootLayer const): (WebKit::RemoteLayerTreeHost::createLayer): (WebKit::RemoteLayerTreeHost::detachRootLayer): (WebKit::RemoteLayerTreeHost::mapAllIOSurfaceBackingStore): (WebKit::RemoteLayerTreeHost::getLayer const): Deleted. * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h: Added. (WebKit::RemoteLayerTreeNode::layer const): (WebKit::RemoteLayerTreeNode::uiView const): * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm: Added. (WebKit::RemoteLayerTreeNode::RemoteLayerTreeNode): (WebKit::RemoteLayerTreeNode::detachFromParent): * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.mm: (WebKit::RemoteLayerTreeScrollingPerformanceData::blankPixelCount const): * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: (WebKit::RemoteLayerTreeHost::createLayer): * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): (WebKit::layerRepresentationFromLayerOrView): Deleted. * UIProcess/WebAuthentication/Cocoa/HidService.h: * UIProcess/WebAuthentication/Cocoa/HidService.mm: * UIProcess/WebPageProxy.h: * UIProcess/ios/LayerRepresentation.mm: Removed. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::setRemoteLayerTreeRootNode): (WebKit::PageClientImpl::acceleratedCompositingRootLayer const): (WebKit::PageClientImpl::setAcceleratedCompositingRootLayer): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::setRemoteLayerTreeRootNode): (WebKit::WebPageProxy::setAcceleratedC