2017-05-09 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.14.7 release. * gtk/NEWS: Add release notes for 2.14.7. 2017-04-06 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.14.6 release. * gtk/NEWS: Add release notes for 2.14.6. 2017-03-21 Sergio Villar Senin [Soup] "Only from websites I visit" cookie policy is broken https://bugs.webkit.org/show_bug.cgi?id=168912 Reviewed by Carlos Garcia Campos. Do not reset the first party for cookies on redirects. That's properly done for the main resource in DocumentLoader::willSendRequest and, in the case of subresources, is absolutely wrong (which is what we were doing since r143931). The most notable effect was that subresources loaded via redirects were effectively bypassing the "no third party" policy for cookies. * NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::continueHTTPRedirection): 2017-02-23 Carlos Garcia Campos [GTK] Crash attempting to load Flash plugin in Wayland https://bugs.webkit.org/show_bug.cgi?id=163159 Reviewed by Michael Catanzaro. The problem is that we check if the current diplay is X11 or Wayland also in the plugin process, but with GTK2 plugins the display is always X11. We should early reject plugins requiring GTK2 in the UI process when the current display is Wayland. * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp: (WebKit::PluginInfoStore::getPluginInfo): * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp: (WebKit::PluginProcessProxy::scanPlugin): * UIProcess/gtk/WebPageProxyGtk.cpp: (WebKit::WebPageProxy::createPluginContainer): Add an assert to ensure this message is never received on a non-X11 display. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::createPluginContainer): Never send CreatePluginContainer message to the UI process if the display is not X11. 2017-03-09 Tomas Popela Correctly process the return value of gdk_drag_context_get_selected_action() Reviewed by Carlos Garcia Campos. It returns the action itself and not the bitmask. * UIProcess/gtk/DragAndDropHandler.cpp: (WebKit::DragAndDropHandler::drop): 2017-02-23 Tomas Popela [GTK] Drag and drop is always moving the content even if copy is requested https://bugs.webkit.org/show_bug.cgi?id=168424 Reviewed by Carlos Garcia Campos. Drag and drop is always moving the content around even if the copy is requested (i.e. by pressing the Control key). * UIProcess/gtk/DragAndDropHandler.cpp: (WebKit::DragAndDropHandler::drop): 2017-02-27 Carlos Garcia Campos [GTK] Flickering when leaving accelerated compositing mode https://bugs.webkit.org/show_bug.cgi?id=168911 Reviewed by Žan Doberšek. It doesn't always happen, and it's too fast, more noticeable in websites with a dark background, because we are drawing a single white frame. This happens when we leave AC mode during the layer flush that schedules an update on the compositor, which at that point only clears the area and renders nothing. However, CoordinatedGraphicsScene::paintToCurrentGLContext() always renders a white background when no web view color has been set. And that's the white frame we get. We could prevent that last update from happening by checking if we still have a graphics root layer after syncDisplayState() in the layer flush, the same way we check the layer tree host is still valid. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired): 2017-02-27 Carlos Garcia Campos [GTK] Rendering artifacts when resizing the window in X11 with AC mode enabled https://bugs.webkit.org/show_bug.cgi?id=168728 Reviewed by Žan Doberšek. This happens because the pixmap we create from the redirected window is uninitialized until the threaded compositor renders into it. We should always initialize the pixmap right after it's created. * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp: (WebKit::defaultVisual): Helper static method to get the default GdkVisual. (WebKit::AcceleratedSurfaceX11::AcceleratedSurfaceX11): Use createPixmap(). (WebKit::AcceleratedSurfaceX11::createPixmap): Create and initialize the pixmap. (WebKit::AcceleratedSurfaceX11::resize): Use createPixmap(). * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h: 2017-02-26 Carlos Garcia Campos [GTK] Hangs when showing Google search results https://bugs.webkit.org/show_bug.cgi?id=168699 Reviewed by Žan Doberšek. Connection::sendOutgoingMessage() can poll forever if sendmsg fails with EAGAIN or EWOULDBLOCK. For example if socket read buffers are full, poll will be blocked until we read the pending data, but we can't read because the thread is blocked in the poll. In case of EAGAIN/EWOULDBLOCK we should poll using the run loop, to allow reads to happen in thread while we wait for the socket to be writable again. In the GTK+ port we use GSocketMonitor to poll socket file descriptor without blocking, using the run loop. This patch renames the socket monitor as readSocketMonitor and adds another one for polling output. When sendmsg fails with EAGAIN/EWOULDBLOCK, the pending message is saved and the write monitor starts polling. Once the socket is writable again we send the pending message. Helper class MessageInfo and a new one UnixMessage have been moved to its own header file to be able to use std::unique_ptr member to save the pending message. * Platform/IPC/Connection.cpp: Include UnixMessage.h as required by std::unique_ptr. * Platform/IPC/Connection.h: Add write socket monitor and also keep the GSocket as a member to reuse it. * Platform/IPC/glib/GSocketMonitor.cpp: Use Function instead of std::function. (IPC::GSocketMonitor::start): * Platform/IPC/glib/GSocketMonitor.h: * Platform/IPC/unix/ConnectionUnix.cpp: (IPC::Connection::platformInitialize): Initialize the GSocket here since we rely on it to take the ownership of the descriptor. We were leaking it if the connection was invalidated without being opened. (IPC::Connection::platformInvalidate): Destroy the GSocket even when not connected. Also stop the write monitor. (IPC::Connection::processMessage): (IPC::Connection::open): (IPC::Connection::platformCanSendOutgoingMessages): Return false if we have a pending message to ensure Connection doesn't try to send more messages until the pending message is dispatched. We don't need to check m_isConnected because the caller already checks that. (IPC::Connection::sendOutgoingMessage): Split it in two. This creates and prepares a UnixMessage and then calls sendOutputMessage() to do the rest. (IPC::Connection::sendOutputMessage): Send the message, or save it if sendmsg fails with EAGAIN or EWOULDBLOCK to be sent later when the socket is writable. * Platform/IPC/unix/UnixMessage.h: Added. (IPC::MessageInfo::MessageInfo): (IPC::MessageInfo::setMessageBodyIsOutOfLine): (IPC::MessageInfo::isMessageBodyIsOutOfLine): (IPC::MessageInfo::bodySize): (IPC::MessageInfo::attachmentCount): (IPC::UnixMessage::UnixMessage): (IPC::UnixMessage::~UnixMessage): (IPC::UnixMessage::attachments): (IPC::UnixMessage::messageInfo): (IPC::UnixMessage::body): (IPC::UnixMessage::bodySize): (IPC::UnixMessage::appendAttachment): * PlatformGTK.cmake: 2017-01-17 Joseph Pecoraro Crash when closing tab with debugger paused https://bugs.webkit.org/show_bug.cgi?id=161746 Reviewed by Brian Burg and Brent Fulgham. * WebProcess/WebPage/WebPage.cpp: (WebKit::DeferredPageDestructor::createDeferredPageDestructor): (WebKit::DeferredPageDestructor::DeferredPageDestructor): (WebKit::DeferredPageDestructor::tryDestruction): (WebKit::WebPage::close): Defer destruction of the Page and WebPage if we are in a nested runloop. Also, proactively close all inspector frontends, including remote frontends. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleSyntheticClick): (WebKit::WebPage::completeSyntheticClick): Return early in some cases where a nested run loop may have closed the WebPage on us while handling JavaScript events. 2017-02-15 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.14.5 release. * gtk/NEWS: Add release notes for 2.14.5. 2017-02-10 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.14.4 release. * gtk/NEWS: Add release notes for 2.14.4. 2017-02-09 Carlos Garcia Campos Unreviewed. Fix GTK+ build with threaded compositor disabled. * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode): (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow): 2017-02-06 Miguel Gomez [GTK][EFL] Release unused UpdateAtlas when in memory pressure situation https://bugs.webkit.org/show_bug.cgi?id=167872 Reviewed by Carlos Garcia Campos. In a memory pressure situation, release all the unused UpdateAtlas as soon as possible, instead of waiting 3 seconds before releasing them. * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::releaseInactiveAtlasesTimerFired): (WebKit::CompositingCoordinator::releaseAtlases): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: 2017-01-26 Chris Dumez Crash when navigating back to a page in PacheCache when one of its frames has been removed https://bugs.webkit.org/show_bug.cgi?id=167421 Reviewed by Darin Adler. Add a new setting allowing layout tests to enable PageCache in a window that has an opener, for convenience. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetAllowsPageCacheWithWindowOpener): (WKPreferencesGetAllowsPageCacheWithWindowOpener): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2017-02-07 Carlos Garcia Campos [Soup] WebKitSoupRequestInputStream can still leave requests unfinished after r211773 https://bugs.webkit.org/show_bug.cgi?id=167929 Reviewed by Michael Catanzaro. The while loop to process the pending data requests was not a good idea, because having a new pending request doesn't mean we have more data available, but that more data was requested. * WebProcess/soup/WebKitSoupRequestInputStream.cpp: (webkitSoupRequestInputStreamPendingReadAsyncComplete): Process only one request if needed. 2017-02-06 Carlos Garcia Campos [Soup] Long resources loaded by custom protocols sometimes never finish loading https://bugs.webkit.org/show_bug.cgi?id=167890 Reviewed by Michael Catanzaro. It's another bug that has appeared in WebKitSoupRequestInputStream after moving the custom protocols handling to the main thread. The problem is that webkitSoupRequestInputStreamPendingReadAsyncComplete invalidates pendingAsyncRead after calling webkitSoupRequestInputStreamReadAsyncResultComplete, but in some cases webkitSoupRequestInputStreamReadAsyncResultComplete completes the task in the same run loop iteration. In that case webkitSoupRequestInputStreamReadAsync is called again creating a new AsyncReadData that is destroyed right after webkitSoupRequestInputStreamReadAsyncResultComplete returns. * WebProcess/soup/WebKitSoupRequestInputStream.cpp: (AsyncReadData::AsyncReadData): Use an rvalue reference for the task. (webkitSoupRequestInputStreamPendingReadAsyncComplete): Use WTFMove to ensure pendingAsyncRead is cleared before webkitSoupRequestInputStreamReadAsyncResultComplete is called, and continue processing pending requests if there are new ones after webkitSoupRequestInputStreamReadAsyncResultComplete. (webkitSoupRequestInputStreamReadAsync): Use WTFMove to transfer the task to AsyncReadData. (webkitSoupRequestInputStreamDidFailWithError): Use WTFMove to ensure pendingAsyncRead is cleared. 2017-02-06 Carlos Garcia Campos [Soup] Deadlock in NetworkProcess https://bugs.webkit.org/show_bug.cgi?id=167876 Reviewed by Michael Catanzaro. WebKitSoupRequestInputStream uses a read lock. What is happening is that webkitSoupRequestInputStreamAddData takes the lock, and it calls webkitSoupRequestInputStreamPendingReadAsyncComplete with the lock help. That causes webkitSoupRequestInputStreamReadAsync to be called again to read the next chunk, but in the same run loop operation. We don't really need the read lock because both webkitSoupRequestInputStreamAddData and webkitSoupRequestInputStreamReadAsync shoudl always be called from the main thread. * WebProcess/soup/WebKitSoupRequestInputStream.cpp: (webkitSoupRequestInputStreamReadAsync): Remove the read lock and assert if called from a secondary thread. (webkitSoupRequestInputStreamAddData): Ditto. 2017-01-04 Carlos Garcia Campos [SOUP] Network process crash in WebKit::CustomProtocolManagerImpl::didFailWithError https://bugs.webkit.org/show_bug.cgi?id=165082 CustomProtocolManager uses a Workqueue to receive the IPC messages since r149194. Then we added the Soup implementation adopting that approach, but without making our implementation thread safe. The crash happens because the CustomProtocolManager implementation is used by two threads at the same time, the main thread because of a ping load (probably caused by an image load in the unload handler, I haven't been able to reproduce the crash) and the work queue thread. I'm not sure if the reasons to make CustomProtocolManager use a WorkQueue are still valid for Mac, but I don't think they are for Soup. CustomProtocolManager is now only used in the network process and sync loads don't use any nested run loop, they are just an IPC sync message. So this patch makes CustomProtocolManager a normal message receiver again for Soup to ensure messages are handled in the main thread as expected by the Soup implementation. * NetworkProcess/CustomProtocols/CustomProtocolManager.h: (WebKit::CustomProtocolManager::childProcess): Remove WorkQueue initialization. * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp: (WebKit::CustomProtocolManager::CustomProtocolManager): Register the message receiver. (WebKit::CustomProtocolManager::initializeConnection): Deleted. 2017-01-30 Carlos Garcia Campos Unreviewed. Fix GTK+ debug build after r211365. Remove invalid assert. * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow): 2017-01-27 Carlos Garcia Campos [GTK] Stop forcing accelerated compositing by default https://bugs.webkit.org/show_bug.cgi?id=167492 Reviewed by Žan Doberšek. We are now ready to bring back the on demand accelerated compositing mode with the threaded compositor. Unfortunately, having AC always enabled brought a lot of issues for many people. Not only it requires a lot more memory but also caused rendering issues (or even nothing rendered at all) with some graphics drivers. People started to use WEBKIT_DISABLE_COMPOSITING_MODE as a workaround, but that was not expected to be used by users. So, entering/leaving AC when required by web contents is not actually the solution but a huge improvement for many people. If we are eventually ready to force AC mode again, we'll change this again. Note that we still have WEBKIT_DISABLE_COMPOSITING_MODE, but now also WEBKIT_FORCE_COMPOSITING_MODE for testing and debugging. * UIProcess/gtk/WebPreferencesGtk.cpp: (WebKit::WebPreferences::platformInitializeStore): 2017-01-30 Carlos Garcia Campos [GTK] Do not release OpenGL resource immediately when leaving accelerated compositing mode https://bugs.webkit.org/show_bug.cgi?id=167544 Reviewed by Michael Catanzaro. Sometimes the conditions to be in AC mode or not change quickly, and then we leave AC mode just enter it again after a very short period of time. In those cases we are dropping all the GL resources and the compositor thread, and creating it again. We could keep the layer tree host alive for a while when exiting AC mode, and reuse it if we enter AC mode before the previous one has been discarded. While the previous layer tree host is alive we still need to keep it up to date, for example if the web view is resized or contents size change, and synchronize with the threaded compositor when it becomes the layer tree host again. * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::~AcceleratedDrawingArea): Discard the previous layer tree host. (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea): Initialize the timer to discard the previous layer tree host. (WebKit::AcceleratedDrawingArea::pageBackgroundTransparencyChanged): Notify the previous layer tree host if needed. (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged): Ditto. (WebKit::AcceleratedDrawingArea::updateBackingStoreState): Ditto. (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode): Reuse the previous layer tree host if possible. (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow): Exit AC mode and save the layer tree host starting a timer of 5 seconds to discard it if not reused. (WebKit::AcceleratedDrawingArea::discardPreviousLayerTreeHost): Invalidate and destroy the previous layer tree host. (WebKit::AcceleratedDrawingArea::didChangeViewportAttributes): Notify the previous layer tree host if needed. (WebKit::AcceleratedDrawingArea::deviceOrPageScaleFactorChanged): Ditto. * WebProcess/WebPage/AcceleratedDrawingArea.h: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::scrollNonCompositedContents): If it's discardable add the action to be synchronized instead. (WebKit::ThreadedCoordinatedLayerTreeHost::contentsSizeChanged): Ditto. (WebKit::ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged): Ditto. (WebKit::ThreadedCoordinatedLayerTreeHost::pageBackgroundTransparencyChanged): Ditto. (WebKit::ThreadedCoordinatedLayerTreeHost::sizeDidChange): Ditto. (WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewportAttributes): Ditto. (WebKit::ThreadedCoordinatedLayerTreeHost::setIsDiscardable): When the layer tree host becomes discardable, reset the sync actions and return. When it becomes the real layer tree host again, apply all pending actions to synchronize with the threaded compositor. * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::scroll): Notify the previous layer tree host if needed. (WebKit::DrawingAreaImpl::mainFrameContentSizeChanged): Ditto. (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): Use AcceleratedDrawingArea::exitAcceleratedCompositingModeNow(). * WebProcess/WebPage/LayerTreeHost.h: (WebKit::LayerTreeHost::setIsDiscardable): Added. 2017-01-29 Carlos Garcia Campos [Coordinated Graphics] WebPage shouldn't use the layerTreeHost directly https://bugs.webkit.org/show_bug.cgi?id=167494 Reviewed by Michael Catanzaro. In Coordinated Graphics we have a couple of methods that the WebPage uses directly from the layer tree host, instead of using the drawing area interface. This patch adds DrawingArea::didChangeViewportAttributes and DrawingArea::deviceOrPageScaleFactorChanged and renames LayerTreeHost::didChangeViewportProperties as LayerTreeHost::didChangeViewportAttributes for consistency. * Shared/CoordinatedGraphics/SimpleViewportController.cpp: (WebKit::SimpleViewportController::didChangeViewportAttributes): Receive an rvalue reference to avoid copies. * Shared/CoordinatedGraphics/SimpleViewportController.h: * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::didChangeViewportAttributes): Forward it to the layer tree host if any. (WebKit::AcceleratedDrawingArea::deviceOrPageScaleFactorChanged): Ditto. * WebProcess/WebPage/AcceleratedDrawingArea.h: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewportAttributes): Renamed and updated to pass an rvalue reference. (WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewportProperties): Deleted. * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: * WebProcess/WebPage/DrawingArea.h: * WebProcess/WebPage/LayerTreeHost.h: (WebKit::LayerTreeHost::didChangeViewportAttributes): Renamed and updated to pass an rvalue reference. (WebKit::LayerTreeHost::didChangeViewportProperties): Deleted. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::sendViewportAttributesChanged): Use the drawing area. (WebKit::WebPage::scalePage): Ditto (WebKit::WebPage::setDeviceScaleFactor): Ditto. (WebKit::WebPage::viewportPropertiesDidChange): Ditto. 2017-01-29 Carlos Garcia Campos [Threaded Compositor] Crash on WebCore::GLContext::version() https://bugs.webkit.org/show_bug.cgi?id=167559 Reviewed by Michael Catanzaro. This is happening because TextureMapperPlatformLayerProxy::compositorThreadUpdateTimerFired() is fired after the threaded compositor is deleted. CoordinatedGraphicsScene::purgeGLResources() should invalidate the proxies before clearing the map. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::purgeGLResources): 2017-01-30 Miguel Gomez [GTK] Scrolling iframes, doesn't redraw their content https://bugs.webkit.org/show_bug.cgi?id=167581 Reviewed by Carlos Garcia Campos. Take into account whether we are using AC or not in order to repaint an area after scrolling. No behaviour change, no new tests. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::invalidateContentsForSlowScroll): 2017-01-28 Carlos Garcia Campos [Threaded Compositor] Crash when detaching the CoordinatedGraphicsScene https://bugs.webkit.org/show_bug.cgi?id=167547 Reviewed by Michael Catanzaro. It seems that commitSceneState() can be called after the CoordinatedGraphicsScene has been detached. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::commitSceneState): Return early if scene has been detached. (WebKit::CoordinatedGraphicsScene::detach): Take the render queue lock before clearing the render queue. 2017-01-28 Carlos Garcia Campos [Threaded Compositor] Crash when deleting the compositor run loop https://bugs.webkit.org/show_bug.cgi?id=167545 Reviewed by Michael Catanzaro. The problem is that we are releasing the WorkQueue before the update timer that keeps a reference to the run loop, destroyed by the WorkQueue. So, invalidate the WorkQueue in the next run loop iteration to ensure it happens after the CompositingRunLoop destructor. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::~CompositingRunLoop): 2017-01-28 Carlos Garcia Campos [GTK] ASSERTION FAILED: !m_layerTreeHost in DrawingAreaImpl::display() https://bugs.webkit.org/show_bug.cgi?id=167548 Reviewed by Michael Catanzaro. The problem is that non accelerated compositing forceRepaint implementation is doing a layout and then calling display. The layout makes the drawing area enter in AC mode and display asserts that we have a layer tree host. forceRepaint shouldn't do the layout because display already does that and it correctly handles the case of entering AC mode during the layout. It shouldn't call setNeedsDisplay either, because that schedules a display, but we are going to display synchronously. * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::forceRepaint): 2017-01-27 Carlos Garcia Campos [Threaded Compositor] Stop creating the GLContext on demand the first time makeContextCurrent is called https://bugs.webkit.org/show_bug.cgi?id=167496 Reviewed by Žan Doberšek. This is causing problems with animations when entering AC mode on demand. What happens is that the threaded compositor is created, then the animation is scheduled and during the first animation iteration the GLContext is created, making the first frame of the animation quite slow. In my computer creating the GLContext takes 0.8 seconds. If the animation duration is less than the time it takes to create the GLContext, the animation ends without iterating. This causing timeouts in the bots in tests like animations/animation-iteration-event-destroy-renderer.html that expect webkitAnimationIteration events that never fire. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::ThreadedCompositor): Create the GLContext right after the compositing thread is created if we already have a native surface handle. (WebKit::ThreadedCompositor::createGLContext): Helper to create the GLContext. (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): Create the GLContext when a native surface handle is given. (WebKit::ThreadedCompositor::makeContextCurrent): Deleted. (WebKit::ThreadedCompositor::renderLayerTree): Make the context cunrrent directly here. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: 2017-01-26 Carlos Garcia Campos [Threaded Compositor] Update also the contents size when creating the threaded compositor https://bugs.webkit.org/show_bug.cgi?id=167452 Reviewed by Žan Doberšek. In r210954 we ensured that the threaded compositor and the viewport controller were created with the initial web page size. If we don't update the contents size, the visible rectangle will be empty and tiles won't be created until contentsSizeDidChange is called. It's even possible, when entering AC mode on demand, that we create the layer tree host after the contents size changed, in which case nothing is rendered unless we resize the window. * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): 2017-01-25 Carlos Garcia Campos [GTK] UIProcess from WebKitGtk+ 2.15.x SIGSEGVs because of X Error BadDamage in WebKit::AcceleratedBackingStoreX11::update(WebKit::LayerTreeContext const&) () at Source/WebKit2/UIProcess/gtk/AcceleratedBackingStoreX11.cpp:145 https://bugs.webkit.org/show_bug.cgi?id=165656 Reviewed by Michael Catanzaro. We are incorrectly handling BadDamage errors because the BadDamage value we pass to the XErrorTrapper is not the actual error code used by X11. Since XDamage is an extension, it has its own errors and a base error code. We need to use the base error code we get when calling XDamageQueryExtension to pass the right error code to the XErrorTrapper. * UIProcess/gtk/AcceleratedBackingStoreX11.cpp: (WebKit::AcceleratedBackingStoreX11::create): Get also the damage base error. (WebKit::xDamageErrorCode): Helper to get the actual error code. (WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11): Use xDamageErrorCode(). (WebKit::AcceleratedBackingStoreX11::update): Ditto. 2017-01-25 Miguel Gomez [GTK] The inspector is broken when AC support is disabled https://bugs.webkit.org/show_bug.cgi?id=165237 Reviewed by Carlos Garcia Campos. WebInspector must not use PageOverlays or GraphicsLayers when AC is not avaialable. No new tests added. * WebProcess/WebCoreSupport/WebInspectorClient.cpp: (WebKit::WebInspectorClient::highlight): (WebKit::WebInspectorClient::showPaintRect): 2017-01-19 Carlos Garcia Campos [Threaded Compositor] Initialize the threaded compositor with the current size https://bugs.webkit.org/show_bug.cgi?id=167196 Reviewed by Žan Doberšek. We are always creating the threaded compositor with an empty size and then a sizeDidChange always happen when the backing store state changes. This is always happening because the threaded compositor is created before the first backing store state, but if we wanted to create it later, for example to enter/leave AC mode on demand, the threaded compositor will not have the viewport size unless the window is resized, or sizeDidChange is called manually when entering AC mode. Creating the threaded compositor is sync and changing the size too, so it's better to do both things at the same time using the same sync operation. * Shared/CoordinatedGraphics/SimpleViewportController.cpp: (WebKit::SimpleViewportController::SimpleViewportController): Pass an initial size to the constructor. * Shared/CoordinatedGraphics/SimpleViewportController.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::create): Add viewportSize and scaleFactor construction parameters, (WebKit::ThreadedCompositor::ThreadedCompositor): Ditto. Also mark as needs resize if the given size is not empty. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): Initialize the threaded compositor with an initial viewport size and scale factor. 2017-01-24 Miguel Gomez [Coordinated Graphics] Ensure that we're in AC mode before trying to create GraphicsLayers https://bugs.webkit.org/show_bug.cgi?id=167365 Reviewed by Carlos Garcia Campos. When entering AC on demand, the RenderLayerCompositor wants to create the root GraphicsLayer before the AcceleratedDrawingArea is in AC mode. This means there's no LayerTreeHost to request the GraphicsLayerFactory, so no layers are created. Ensure that we are in AC mode before requesting the GraphicsLayerFactory. No behaviour change, no new tests. * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::graphicsLayerFactory): 2017-01-19 Carlos Garcia Campos [GTK] Do not update the backing store state unnecessarily when page visibility changes https://bugs.webkit.org/show_bug.cgi?id=167195 Reviewed by Sergio Villar Senin. I've noticed that we are receiving UpdateBackingStoreState messages in the web process even when size and scale factor didn't change. That's quite unfortunate because we do a lot of work unnecessarily and we tell the threaded compositor that the size changed. This is not only a problem because it's not true, but also because changing the size is a sync operation in the threaded compositor, so we block the compositing thread for nothing. This is happening because the WebPageProxy notifies the drawing area that the backing store is discardable when the page is not visible, and that always produces a new backing store state. In accelerating compositing mode we don't even have a backing store to discard, so we should check we have something to discard and also make sure we only generate a new backing store state if we really discarded the backing store. * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::discardBackingStoreSoon): (WebKit::DrawingAreaProxyImpl::discardBackingStore): 2017-01-17 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.14.3 release. * gtk/NEWS: Add release notes for 2.14.3. 2017-01-10 Zan Dobersek ThreadedCoordinatedLayerTreeHost::renderNextFrame() should short-cut to layer flushing https://bugs.webkit.org/show_bug.cgi?id=157614 Reviewed by Carlos Garcia Campos. CoordinatedLayerTreeHost prevents any layer flushes while a previously-commited scene state is still being rendered on the composition thread. renderNextFrame() is called once that is complete, and a new layer flush is scheduled. This change improves the whole ordeal by immediately performing the layer flush only if it was requested during the time we were waiting on the renderer (i.e. when the latest scene state was being composited), instead of scheduling it unconditionally. m_scheduledWhileWaitingForRenderer member variable is added to track that occurrence. * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::scheduleLayerFlush): (WebKit::CoordinatedLayerTreeHost::renderNextFrame): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: 2016-12-27 Emanuele Aina Ensure NetworkProcess is ready before whitelisting TLS certificates https://bugs.webkit.org/show_bug.cgi?id=162962 Reviewed by Alex Christensen. If the API user tries to whitelist TLS certificates before any web view has been created, the action will be ignored because the NetworkProcess hasn't been fired up yet. For example, the snippet below using the GTK+ API does not work, unless the whitelisting is moved after the web view creation: webkit_web_context_allow_tls_certificate_for_host(webkit_web_context_get_default(), crt, host); webView = webkit_web_view_new(); * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::allowSpecificHTTPSCertificateForHost): Ensure that the NetworkProcess has been already fired up when adding certificates, so they can be whitelisted before the first web view is instantiated. 2016-10-28 Brent Fulgham Do a better job of protecting Frame objects in the context of JavaScript calls https://bugs.webkit.org/show_bug.cgi?id=164163 Reviewed by Darin Adler. * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::renderedImage): Protected the Frame. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::insertTextAsync): Ditto. (WebKit::WebPage::setComposition): Ditto. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::insertDictatedTextAsync): Ditto. 2016-10-21 David Kilzer Bug 163762: IntSize::area() should used checked arithmetic Reviewed by Darin Adler. * Shared/ShareableBitmap.cpp: (WebKit::ShareableBitmap::create): Add overflow check and return nullptr on overflow. (WebKit::ShareableBitmap::createShareable): Ditto. (WebKit::ShareableBitmap::create): Change debug assert for adequate buffer size check into release check. * Shared/ShareableBitmap.h: (WebKit::ShareableBitmap::numBytesForSize): Change to return a Checked value. (WebKit::ShareableBitmap::sizeInBytes): * Shared/cairo/ShareableBitmapCairo.cpp: (WebKit::ShareableBitmap::numBytesForSize): Ditto. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _takeViewSnapshot]): Call unsafeGet(). 2016-10-05 Daniel Bates Do not follow redirects when sending violation report https://bugs.webkit.org/show_bug.cgi?id=162520 Reviewed by Alex Christensen. Update the non-Network Session WebKit2 implementation to follow redirect responses for a ping request, if applicable. I did not update the Network Session implementation at this time. I will fix it in . * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::loadPing): Tell PingHandle whether to follow redirects. * NetworkProcess/NetworkLoadParameters.h: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode): Encode NetworkResourceLoadParameters::shouldFollowRedirects. (WebKit::NetworkResourceLoadParameters::decode): Decode NetworkResourceLoadParameters::shouldFollowRedirects. * NetworkProcess/PingLoad.h: Added FIXME comment to implement support for following redirects, if applicable (for hyperlink auditing). See for more details. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::createPingHandle): Modified to take a boolean whether to follow redirects responses and set NetworkResourceLoadParameters::shouldFollowRedirects as appropriate. * WebProcess/Network/WebLoaderStrategy.h: 2016-09-19 Anders Carlsson Suppress JavaScript prompts early on in certain cases https://bugs.webkit.org/show_bug.cgi?id=162243 rdar://problem/27661602 Reviewed by Geoffrey Garen. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::shouldSuppressJavaScriptDialogs): Add helper function. (WebKit::WebChromeClient::runJavaScriptAlert): (WebKit::WebChromeClient::runJavaScriptConfirm): (WebKit::WebChromeClient::runJavaScriptPrompt): Call helper function and return early if we should supress dialogs. 2016-12-08 Tomas Popela [GTK] Process accelerated compositing env variables only if they are really enabled https://bugs.webkit.org/show_bug.cgi?id=165300 Don't process the WEBKIT_FORCE_COMPOSITING_MODE and WEBKIT_DISABLE_COMPOSITING_MODE env variables if they are disabled (eg. WEBKIT_DISABLE_COMPOSITING_MODE=0). Reviewed by Michael Catanzaro. * UIProcess/gtk/WebPreferencesGtk.cpp: (WebKit::WebPreferences::platformInitializeStore): 2016-11-30 Carlos Garcia Campos [GTK] UI process crash in WebKit::WaylandCompositor::Surface::prepareTextureForPainting https://bugs.webkit.org/show_bug.cgi?id=164911 Reviewed by Michael Catanzaro. The problem is that m_buffer is nullptr in Surface::prepareTextureForPainting() even though we have already an image. We only use the buffer to get the image size, so we could save the image size when the image is created, and then we don't need to care about the buffer anymore. * UIProcess/gtk/WaylandCompositor.cpp: (WebKit::WaylandCompositor::Surface::prepareTextureForPainting): (WebKit::WaylandCompositor::Surface::commit): * UIProcess/gtk/WaylandCompositor.h: 2016-11-28 Carlos Garcia Campos [GTK] BadDamage X Window System error in WebKit::AcceleratedBackingStoreX11::update when called from WebPageProxy::exitAcceleratedCompositingMode https://bugs.webkit.org/show_bug.cgi?id=164303 Reviewed by Michael Catanzaro. Trap also BadDrawable and BadDamage X errors when creating the surface and damage. * UIProcess/gtk/AcceleratedBackingStoreX11.cpp: (WebKit::AcceleratedBackingStoreX11::update): 2016-11-02 Carlos Garcia Campos [GTK] BadDamage X Window System error in WebKit::AcceleratedBackingStoreX11::update when called from WebPageProxy::exitAcceleratedCompositingMode https://bugs.webkit.org/show_bug.cgi?id=164303 Reviewed by Michael Catanzaro. This can happen if the web process exits before the UI process has cleaned up the accelerated surface. Trap BadDrawable and BadDamage X errors and ignore them, while still crashing for any other X error. * UIProcess/gtk/AcceleratedBackingStoreX11.cpp: (WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11): (WebKit::AcceleratedBackingStoreX11::update): 2016-11-29 Carlos Garcia Campos [GTK] Database process should not initialize gtk https://bugs.webkit.org/show_bug.cgi?id=165138 Reviewed by Sergio Villar Senin. It doesn't use GTK+ at all. * DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp: (WebKit::DatabaseProcessMainUnix): (): Deleted. 2016-11-09 Michael Catanzaro Experimental features should not be enabled by default https://bugs.webkit.org/show_bug.cgi?id=164367 Reviewed by Darin Adler. We have two classes of experimental features: (1) Features that are unstable and should be off by default, except for the developers currently working on them. This is straightforward to handle; the default value should be false. (2) Features that are still not ready for end users, but are stable enough for testing. We want these features to be enabled in testing environments like the bots, MiniBrowser, Safari Tech Preview, and so forth, but not in stable release builds. Implement this. It is better than having all experimental features on unconditionally, and expecting them to be disabled manually on release branches, which is not something we are keen to do. An exception is Cocoa ports, which to my knowledge do not currently have any concept of development builds. These ports seem happy to continue disabling features manually in release branches, and should continue to do so at least for now. We also have features that we wish to enumerate at runtime, yet have enabled by default unconditionally. We do not currently have any infrastructure to support this and should not abuse the experimental status for this purpose; it requires future work. All settings can still be toggled at runtime by clients that know about them using the existing runtime features API. Lastly, the custom elements feature is ready to be enabled by default, so it's no longer experimental and can graduate to the list of normal boolean features. * Shared/WebPreferencesDefinitions.h: 2016-11-03 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.14.2 release. * gtk/NEWS: Add release notes for 2.14.2. 2016-10-20 Carlos Garcia Campos [GTK] Configures but fails to link with ENABLE_OPENGL=OFF https://bugs.webkit.org/show_bug.cgi?id=163449 Reviewed by Michael Catanzaro. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseRealize): Check TEXTURE_MAPPER_GL instead of TEXTURE_MAPPER and also ensure the current display is X11. (webkitWebViewBaseUnrealize): Ditto. (webkitWebViewBaseDidRelaunchWebProcess): Check TEXTURE_MAPPER_GL instead of TEXTURE_MAPPER. (webkitWebViewBasePageClosed): Ditto. * UIProcess/AcceleratedDrawingAreaProxy.cpp: (WebKit::AcceleratedDrawingAreaProxy::didUpdateBackingStoreState): Ditto. (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState): Check EGL is enabled before trying to use the WaylandCompositor. * UIProcess/AcceleratedDrawingAreaProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): Ditto. * UIProcess/gtk/AcceleratedBackingStore.cpp: (WebKit::AcceleratedBackingStore::create): Ditto. * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp: * UIProcess/gtk/WaylandCompositor.cpp: * UIProcess/gtk/WaylandCompositor.h: * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode): Check TEXTURE_MAPPER_GL instead of TEXTURE_MAPPER. * WebProcess/WebPage/AcceleratedDrawingArea.h: * WebProcess/WebPage/DrawingArea.h: * WebProcess/WebPage/DrawingArea.messages.in: * WebProcess/WebPage/LayerTreeHost.h: 2016-10-20 Carlos Garcia Campos [GTK] Avoid strstr() when checking (E)GL extensions https://bugs.webkit.org/show_bug.cgi?id=161958 Reviewed by Žan Doberšek. Use GLContext::isExtensionSupported() instead of strstr(). * UIProcess/gtk/WaylandCompositor.cpp: (WebKit::WaylandCompositor::initializeEGL): 2016-10-20 Carlos Garcia Campos Wrong use of EGL_DEPTH_SIZE https://bugs.webkit.org/show_bug.cgi?id=155536 Reviewed by Michael Catanzaro. Use XErrorTrapper class instead of the custom XErrorHandler. * PluginProcess/unix/PluginProcessMainUnix.cpp: (WebKit::PluginProcessMainUnix): 2016-10-17 Chris Dumez [WK2][NetworkCache] PendingFrameLoad objects are sometimes leaked https://bugs.webkit.org/show_bug.cgi?id=163569 Reviewed by Antti Koivisto. PendingFrameLoad objects are created to track frame loads and added to the m_pendingFrameLoads hash map. These objects are supposed to remove themselves from the hash map once they detect that the page load has finished by calling PendingFrameLoad::m_loadCompletionHandler(). PendingFrameLoad::m_loadCompletionHandler() is called from markLoadAsCompleted() when we detect that the page load has finished via the m_loadHysteresisActivity HysteresisActivity. We call impulse() on the HysteresisActivity every time a subresource is loaded in the frame. The issue is that if no subresource is ever loaded, then we never call impulse() on the HysteresisActivity, which is therefore never started. If it nevers starts, then it nevers stops and never calls markLoadAsCompleted(). To address the problem, we now call impulse() on the HysteresisActivity as soon as we construct it. * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: 2016-10-17 Manuel Rego Casasnovas [css-grid] Disable CSS Grid Layout runtime flag by default https://bugs.webkit.org/show_bug.cgi?id=163432 Reviewed by Darin Adler. It was enabled in r201042, but now Safari Technology Preview has a UI to switch runtime flags so it doesn't need to be enabled by default anymore. * Shared/WebPreferencesDefinitions.h: Disable grid layout runtime flag by default. 2016-10-16 Carlos Garcia Campos [GTK] Default WebKitWebsiteDataManager is always leaked in WebKitWebContext https://bugs.webkit.org/show_bug.cgi?id=163443 Reviewed by Michael Catanzaro. Adopt the reference returned by webkitWebsiteDataManagerCreate(). * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextConstructed): 2016-10-16 Carlos Garcia Campos [GTK] WebKitWebPage URI not updated after URI is modified by InjectedBundlePageResourceLoadClient::willSendRequestForFrame https://bugs.webkit.org/show_bug.cgi?id=163389 Reviewed by Michael Catanzaro. Update the page URI also when the load is committed. * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: (getDocumentLoaderURL): (didStartProvisionalLoadForFrame): (didReceiveServerRedirectForProvisionalLoadForFrame): (didCommitLoadForFrame): (webkitWebPageCreate): (getProvisionalURLForFrame): Deleted. 2016-10-08 Emanuele Aina [GTK] Drop redundant wl_display_flush_clients() call https://bugs.webkit.org/show_bug.cgi?id=161904 Reviewed by Michael Catanzaro. The Wayland GSource::prepare() function already calls wl_display_flush_clients() at every mainloop iteration, so there's no need to further call it on Surface::commit(). * UIProcess/gtk/WaylandCompositor.cpp: (WebKit::WaylandCompositor::Surface::commit): * UIProcess/gtk/WaylandCompositor.h: 2016-10-06 Youenn Fablet [WK2] 304 revalidation on the network process does not update the validated response https://bugs.webkit.org/show_bug.cgi?id=162973 Reviewed by Darin Adler. * NetworkProcess/NetworkResourceLoader.cpp: Updating cache entry with the revalidated one. 2016-10-06 Michael Catanzaro [GTK] Expose WebKitDOMHTMLInputElement APIs for form autofill https://bugs.webkit.org/show_bug.cgi?id=163082 Reviewed by Darin Adler. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp: (webkit_dom_html_input_element_get_auto_filled): Added. (webkit_dom_html_input_element_set_auto_filled): Added. (webkit_dom_html_input_element_set_editing_value): Added. * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.h: * WebProcess/InjectedBundle/API/gtk/DOM/docs/webkitdomgtk-4.0-sections.txt: 2016-10-11 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.14.1 release. * gtk/NEWS: Add release notes for 2.14.1. 2016-10-10 Tomas Popela [GTK] UIProcess crashes when using Japanese IM https://bugs.webkit.org/show_bug.cgi?id=163011 We have to reference the current GdkEventKey before we try process it as later when the lambda body is reached the event could be already freed. Reviewed by Carlos Garcia Campos. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseKeyPressEvent): (webkitWebViewBaseKeyReleaseEvent): * UIProcess/gtk/InputMethodFilter.h: Use non-copyable Function so we can use WTFMove to pass the event to lambda. 2016-10-10 Carlos Garcia Campos [GTK] 2.14.0 Compile Errors: GTK 3.22.1 https://bugs.webkit.org/show_bug.cgi?id=163190 Reviewed by Alex Christensen. * UIProcess/gtk/AcceleratedBackingStoreX11.cpp: Include gtk.h since we are using gtk_widget_queue_draw(). 2016-10-05 Carlos Garcia Campos Unreviewed. Fix GTK+ build with USE_REDIRECTED_XCOMPOSITE_WINDOW disabled. * UIProcess/AcceleratedDrawingAreaProxy.cpp: (WebKit::AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing): 2016-10-04 Carlos Garcia Campos [SOUP] Remove SSLPolicyFlags from SoupNetworkSession https://bugs.webkit.org/show_bug.cgi?id=162906 Reviewed by Michael Catanzaro. * NetworkProcess/soup/NetworkProcessMainSoup.cpp: (WebKit::NetworkProcessMainUnix): 2016-09-27 Michael Catanzaro [GTK] Unreviewed typo fix * UIProcess/API/gtk/WebKitWebInspector.cpp: (webkit_web_inspector_class_init): 2016-09-23 Carlos Garcia Campos [GTK] BadDamage X error in /webkit2/WebKitWebView/preferred-size https://bugs.webkit.org/show_bug.cgi?id=162489 Reviewed by Michael Catanzaro. Do a XSync right after creating/destroying the XDamage used by the redirected window in X11. * UIProcess/gtk/AcceleratedBackingStoreX11.cpp: (WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11): (WebKit::AcceleratedBackingStoreX11::update): 2016-09-23 Carlos Garcia Campos REGRESSION(r194387): Crash on github.com in IntlDateTimeFormat::resolvedOptions in C locale https://bugs.webkit.org/show_bug.cgi?id=162139 Reviewed by Michael Catanzaro. Handle the case of "C" locale passed by the user using "en-US" as default to match what WTF::platformUserPreferredLanguages() does. * UIProcess/API/gtk/WebKitWebContext.cpp: (webkit_web_context_set_preferred_languages): Remove the call to languageDidChange() because overrideUserPreferredLanguages() already calls it, so we were actually notifying the observers twice. 2016-09-23 Carlos Garcia Campos [GTK] Improve performance when resizing a window with multiple web views in X11 https://bugs.webkit.org/show_bug.cgi?id=162413 Reviewed by Michael Catanzaro. Resizing a window with a single way view performs good enough, but when adding more tabs, the performance decreases a lot. This is because resize is a sync operation, and the UI process waits for the web process to have a new update for the new size, while still draws the previous frame. This is needed for the visible web view, to avoid flickering and artifacts while resizing, but for all other hidden web views, we don't really need to block the UI process. This doesn't happen in Wayland, because in Wayland we never block the UI process while waiting for web process update after a resize. * UIProcess/AcceleratedDrawingAreaProxy.cpp: (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState): Return early if the web view is not visible. * UIProcess/gtk/AcceleratedBackingStoreX11.cpp: (WebKit::AcceleratedBackingStoreX11::update): Only schedule a redraw on a damage event when the view is visible. * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp: (WebKit::AcceleratedSurfaceX11::AcceleratedSurfaceX11): Do a XSync right after creating the new pixmap. (WebKit::AcceleratedSurfaceX11::resize): Ditto. 2016-09-22 Carlos Garcia Campos [GTK] Rename DataObjectGtk as SelectionData https://bugs.webkit.org/show_bug.cgi?id=162380 Reviewed by Žan Doberšek. * PlatformGTK.cmake: * Shared/gtk/ArgumentCodersGtk.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/gtk/ArgumentCodersGtk.h: * Shared/gtk/WebSelectionData.cpp: Renamed from Source/WebKit2/Shared/gtk/PasteboardContent.cpp. (WebKit::WebSelectionData::WebSelectionData): (WebKit::WebSelectionData::encode): (WebKit::WebSelectionData::decode): * Shared/gtk/WebSelectionData.h: Renamed from Source/WebKit2/Shared/gtk/PasteboardContent.h. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::startDrag): * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::performDragControllerAction): (WebKit::WebPageProxy::startDrag): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: * UIProcess/gtk/DragAndDropHandler.cpp: (WebKit::DragAndDropHandler::DroppingContext::DroppingContext): (WebKit::DragAndDropHandler::startDrag): (WebKit::DragAndDropHandler::fillDragData): (WebKit::DragAndDropHandler::finishDrag): (WebKit::DragAndDropHandler::dropDataSelection): (WebKit::DragAndDropHandler::dragEntered): (WebKit::DragAndDropHandler::dragDataSelection): (WebKit::DragAndDropHandler::dragMotion): (WebKit::DragAndDropHandler::dragLeave): (WebKit::DragAndDropHandler::drop): * UIProcess/gtk/DragAndDropHandler.h: * UIProcess/gtk/WebPasteboardProxyGtk.cpp: (WebKit::WebPasteboardProxy::writeToClipboard): (WebKit::WebPasteboardProxy::readFromClipboard): (WebKit::WebPasteboardProxy::setPrimarySelectionOwner): Deleted. * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::writeToClipboard): (WebKit::WebPlatformStrategies::readFromClipboard): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp: (WebKit::WebDragClient::startDrag): * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performDragControllerAction): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2016-09-20 Carlos Garcia Campos [GTK] Clean up DataObjectGtk handling https://bugs.webkit.org/show_bug.cgi?id=162267 Reviewed by Michael Catanzaro. In some cases the ownership of DataObjectGtk instances is not clear enough, and we have hacks to avoid memory leaks because of that. * Shared/gtk/ArgumentCodersGtk.cpp: (IPC::encodeImage): Use Image instead of GdkPixbuf. (IPC::decodeImage): Ditto. (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::encode): Deleted. (IPC::decode): Deleted. (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * Shared/gtk/ArgumentCodersGtk.h: * Shared/gtk/PasteboardContent.cpp: (WebKit::PasteboardContent::PasteboardContent): Add empty constructor that creates a new DataObjectGtk, a constructor that receives a const reference and another one that takes the ownership of the given DataObjectGtk. (WebKit::PasteboardContent::encode): (WebKit::PasteboardContent::decode): * Shared/gtk/PasteboardContent.h: Use Ref instead of RefPtr for the DataObjectGtk member. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::startDrag): Transfer the DataObjectGtk to the DragAndDropHandler, instead of using DragData. * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::performDragControllerAction): Instead of sending a DragData object to the web process, send the DataObjectGtk and DragData members needed as parameters. (WebKit::WebPageProxy::startDrag): Transfer the received DataObjectGtk to page client, instead of using DragData. Also notify the web process that drag started. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Update StartDrag message parameters. * UIProcess/gtk/DragAndDropHandler.cpp: (WebKit::DragAndDropHandler::DragAndDropHandler): Remove unneeded initialization. (WebKit::DragAndDropHandler::startDrag): Take ownership of the given DataObjectGtk. * UIProcess/gtk/DragAndDropHandler.h: * UIProcess/gtk/WebPasteboardProxyGtk.cpp: (WebKit::WebPasteboardProxy::writeToClipboard): (WebKit::WebPasteboardProxy::readFromClipboard): * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::writeToClipboard): (WebKit::WebPlatformStrategies::readFromClipboard): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp: (WebKit::convertCairoSurfaceToShareableBitmap): (WebKit::WebDragClient::startDrag): Do not create a DragData and pass the DataObjectGtk directly to the message. Also notify the WebPage that drag is about to start. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performDragControllerAction): Remove explicit DataObjectGtk derefs and simply create a DragData using the DataObjectGtk pointer as platform data. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Update PerformDragControllerAction message parameters. 2016-09-07 Zan Dobersek [GTK] Remove stale WebSoupRequestManager headers https://bugs.webkit.org/show_bug.cgi?id=161691 Reviewed by Sergio Villar Senin. WebSoupRequestManager, WebSoupRequestManagerProxy and WebSoupRequestManagerClient classes were used to implement custom URI scheme support for Soup. This API and the implementations of these classes were removed in r174584, but curiously the headers went unnoticed. This patch removes them, as well as the WebSoupRequestManagerProxy forwarding declaration in WKAPICastSoup.h. * UIProcess/API/C/soup/WKAPICastSoup.h: * UIProcess/soup/WebSoupRequestManagerClient.h: Removed. * UIProcess/soup/WebSoupRequestManagerProxy.h: Removed. (WebKit::WebSoupRequestManagerProxy::registeredURISchemes): Deleted. * WebProcess/soup/WebSoupRequestManager.h: Removed. 2016-09-27 Gustavo Noronha Silva [GTK] Should check whether GDK can use GL before asking it to https://bugs.webkit.org/show_bug.cgi?id=162598 Reviewed by Michael Catanzaro. gdk_cairo_draw_from_gl can fail even when WebKit itself has been able to use GL (its context creation code might be buggy, GL may have been disabled using GDK_GL=disable, …). Unfortunately it does not have any error reporting other than a warning printed to stderr, so we cannot fallback from it. We have to first check if GL can be used by GDK by trying to create a context. See https://bugzilla.redhat.com/show_bug.cgi?id=1378987 * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp: (WebKit::AcceleratedBackingStoreWayland::canGdkUseGL): decide whether GDK can use GL by trying to create a context for a GdkWindow. (WebKit::AcceleratedBackingStoreWayland::paint): fallback to glReadPixels if GDK cannot use GL. * UIProcess/gtk/AcceleratedBackingStoreWayland.h: 2016-09-21 Gustavo Noronha Silva Unreviewed, build fix. * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp: (WebKit::AcceleratedBackingStoreWayland::paint): fix usage of deviceScaleFactor variable which was removed. 2016-09-20 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.14.0 release. * gtk/NEWS: Add release notes for 2.14.0. 2016-09-18 Gustavo Noronha Silva [GTK] Stop using glReadPixels() to blit AC surfaces in the UIProcess under Wayland https://bugs.webkit.org/show_bug.cgi?id=161530 Reviewed by Carlos Garcia Campos. Use gdk_cairo_draw_from_gl when all necessary conditions exist. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::create): take TextureMapper::PaintFlags as optional argument. (WebKit::ThreadedCompositor::ThreadedCompositor): ditto. (WebKit::ThreadedCompositor::renderLayerTree): relay paint flags to TextureMapper::beginPaint. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp: (WebKit::AcceleratedBackingStoreWayland::paint): use the faster gdk_cairo_draw_from_gl when a new enough GTK+ is in use. * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): create compositor with PaintingMirrored flag if we have recent GTK+ and are running under Wayland. * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h: implement shouldPaintMirrored by always returning false. * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.h: implement shouldPaintMirrored by always returning true. * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: (WebKit::LayerTreeHostGtk::compositeLayersToContext): pass PaintingMirror flag to TextureMapper when under a recent enough GTK+ and Wayland. 2016-09-18 Michael Catanzaro [GTK] Empty referer header after WebKit session state restoration trips Bad Behavior Wordpress plugin https://bugs.webkit.org/show_bug.cgi?id=159606 Reviewed by Carlos Garcia Campos. Leave the referrer member of FrameState unset when restoring from session state, unless there is actually a nonempty referrer saved in the state. If we set it to an empty string, then an empty referrer gets sent to the server, which some servers do not accept. It triggers the Bad Behavior plugin on my WordPress blog, for instance. It also breaks vox.com. * UIProcess/API/gtk/WebKitWebViewSessionState.cpp: (decodeFrameState): 2016-09-17 Carlos Garcia Campos [GTK] Move the rendering of auth dialog shadow to the auth dialog widget https://bugs.webkit.org/show_bug.cgi?id=162061 Reviewed by Michael Catanzaro. Instead of rendering the shadow in the web view, we can let the auth dialog do it. This fixes the rendering of the shadow in Wayland when using gdk_cairo_draw_from_gl(). * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp: (webkitAuthenticationDialogDraw): Draw the shadow before rendering the child. (webkitAuthenticationDialogSizeAllocate): Center the child on the allocated space. (webkit_authentication_dialog_class_init): Add size_allocate implementation. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseDraw): Do not draw the shadow when auth dialog is present. (webkitWebViewBaseSizeAllocate): Give the whole web view allocation to the auth dialog. 2016-09-17 Carlos Garcia Campos [ThreadedCompositor] Scrolling artifacts on accelerated subframes https://bugs.webkit.org/show_bug.cgi?id=149060 Reviewed by Michael Catanzaro. The problem is that we are scrolling the main frame even when scrolling is not delegated. * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::scrollNonCompositedContents): Return early if main frame view doesn't delegate scrolling. 2016-09-15 Gustavo Noronha Silva [GTK] Surface created for glReadPixels path on Wayland is bigger than needed https://bugs.webkit.org/show_bug.cgi?id=162025 Reviewed by Carlos Garcia Campos. * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp: (WebKit::AcceleratedBackingStoreWayland::paint): the texture created by the Wayland compositor is already scaled, so scaling its size when creating the surface causes it to end up bigger than necessary. 2016-09-15 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.13.92 release. * gtk/NEWS: Add release notes for 2.13.92. 2016-09-14 Carlos Garnacho [GTK][Wayland] Implement clipboard support https://bugs.webkit.org/show_bug.cgi?id=146574 Reviewed by Carlos Garcia Campos. Add the necessary plumbing for the GTK+ backend to use the PlatformPasteboard in WebCore. All selection data is transmitted at once through the serialization of PasteboardContentGtk/DataObjectGtk. * PlatformGTK.cmake: Add PasteboardContentGtk.cpp and WebPasteboardProxyGtk.cpp * Shared/gtk/ArgumentCodersGtk.cpp: (IPC::encode): (IPC::decode): Renamed from encodeDataObject/decodeDataObject and made public. (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Update DataObjectGtk encode/decode callers. Encode the extra canSmartReplace field. * Shared/gtk/ArgumentCodersGtk.h: Expose encode/decode methods for DataObjectGtk. * Shared/gtk/PasteboardContent.cpp: Added. Wraps a DataObjectGtk so it can be serialized on WebProcess/UIProcess messaging. (WebKit::PasteboardContent::PasteboardContent): (WebKit::PasteboardContent::encode): (WebKit::PasteboardContent::decode): Methods to encode/decode a PasteboardContent. * Shared/gtk/PasteboardContent.h: Added. * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::collapseSelection): Added plumbing to allow collapsing the global selection from the UI process side. * UIProcess/WebFrameProxy.h: * UIProcess/WebPasteboardProxy.h: * UIProcess/WebPasteboardProxy.messages.in: Added plumbing for the GTK+ pasteboard proxy functions. * UIProcess/gtk/WebPageProxyGtk.cpp: (WebKit::WebPageProxy::editorStateChanged): * UIProcess/gtk/WebPasteboardProxyGtk.cpp: Added. (WebKit::WebPasteboardProxy::writeToClipboard): (WebKit::WebPasteboardProxy::readFromClipboard): Implemented functions hooking into the PlatformPasteboard. Per-selection (ie. primary/clipboard) PlatformPasteboards are kept at this level, so those are independently set and dealt with. (WebKit::WebPasteboardProxy::setPrimarySelectionOwner): (WebKit::WebPasteboardProxy::didDestroyFrame): Implemented functions to manage the frame currently being currently interacted, so we can signal back when the global selection has been replaced. * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::writeToClipboard): (WebKit::WebPlatformStrategies::readFromClipboard): Added methods to send the WebProcess->UIProcess messages. * WebProcess/WebCoreSupport/WebPlatformStrategies.h: * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: (WebKit::WebEditorClient::updateGlobalSelection): Remove GClosure to get notifications about changes in global selection ownership. This is done through a WebPage message now, as the UI process manages the clipboard. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/gtk/WebPageGtk.cpp: (WebKit::WebPage::collapseSelectionInFrame): Added methods to send the UIProcess->WebProcess notification that the global selection has been replaced. 2016-09-13 Carlos Garcia Campos [GTK] Get rid of DataObjectGtk::forClipboard and cleanup pasteboard code https://bugs.webkit.org/show_bug.cgi?id=161907 Reviewed by Michael Catanzaro. Update to DataObjectGtk and PasteboardHelper API changes. * UIProcess/gtk/DragAndDropHandler.cpp: (WebKit::DragAndDropHandler::startDrag): (WebKit::DragAndDropHandler::fillDragData): (WebKit::DragAndDropHandler::dataObjectForDropData): * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp: (WebKit::WebDragClient::startDrag): * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: (WebKit::collapseSelection): (WebKit::WebEditorClient::updateGlobalSelection): Remove wrong X11 guards, since that code is not X11 specific. 2016-09-09 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.13.91 release. * gtk/NEWS: Add release notes for 2.13.91. 2016-09-07 Konstantin Tokarev [GTK] Make inspection of Inspector conditional on DEVELOPER_MODE https://bugs.webkit.org/show_bug.cgi?id=161702 Reviewed by Michael Catanzaro. * UIProcess/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::platformCreateInspectorPage): 2016-09-07 Emanuele Aina [GTK] Clarify frame callbacks behaviour in Wayland compositor https://bugs.webkit.org/show_bug.cgi?id=161683 Reviewed by Carlos Garcia Campos. The way we fire frame callbacks in the nested Wayland compositor can be puzzling to developers expecting Wayland semantics, but since we have our own mechanism to handle synchronization we don't care much about them. Add a comment to avoid surprised Wayland developers. * UIProcess/gtk/WaylandCompositor.cpp: (WebKit::WaylandCompositor::Surface::commit): 2016-09-06 Carlos Garcia Campos [GTK][Threaded Compositor] Several flaky tests https://bugs.webkit.org/show_bug.cgi?id=161242 Reviewed by Michael Catanzaro. Reset the viewport attributes on SimpleViewportController when viewport attributes change and fixed layout is not used. We were only updating the viewport attributes when fixed layout was used, but not resetting them again when it's no longer used. That caused that reference tests run after fast/fixed-layout/fixed-layout.html or compositing/fixed-with-fixed-layout.html in the same worker thread were incorrectly rendered. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::dispatchViewportPropertiesDidChange): Remove ifdefs and call WebPage::viewportPropertiesDidChange() unconditionally. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setSize): Pass current page viewport arguments to sendViewportAttributesChanged(). (WebKit::WebPage::sendViewportAttributesChanged): It now receives the viewport arguments. (WebKit::WebPage::viewportPropertiesDidChange): Move the iOS implementation from WebPageIOS.mm and for coordinated graphics call sendViewportAttributesChanged() when fixed layout is used or reset the viewport attributes when not used in case of threaded compositor. * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::viewportPropertiesDidChange): Moved out of iOS ifdef. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::viewportPropertiesDidChange): Deleted. 2016-09-01 Simon Fraser Use TemporaryChange<> to maintain m_userIsInteracting https://bugs.webkit.org/show_bug.cgi?id=161497 Reviewed by Tim Horton. Replace some error-prone manual set/clear of m_userIsInteracting with TemporaryChange<>. No behavior change. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::mouseEvent): (WebKit::WebPage::keyEvent): (WebKit::WebPage::dispatchTouchEvent): 2016-09-06 Carlos Garcia Campos [GTK][Wayland] evince-browser-plugin prevents viewing PDFs https://bugs.webkit.org/show_bug.cgi?id=158697 Reviewed by Michael Catanzaro. Use a different cache file for plugins depending on the current platform display. Plugins can claim to work on X11 but not on Wayland, for example, if they need XEmebed to work. That's the case of the evince browser plugin. * UIProcess/Plugins/gtk/PluginInfoCache.cpp: (WebKit::cacheFilenameForCurrentDisplay): (WebKit::PluginInfoCache::PluginInfoCache): 2016-09-06 Carlos Garcia Campos [Threaded Compositor] Update timer should have lower priority than tasks scheduled in compositing thread https://bugs.webkit.org/show_bug.cgi?id=161625 Reviewed by Sergio Villar Senin. This way, if a resize is scheduled, for example, and there are pending updates, the resize will happen first, and then the updates will happen at the right size. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::CompositingRunLoop): Use G_PRIORITY_HIGH_IDLE as update timer priority. The actual priority doesn't really matter as long as it's lower than G_PRIORITY_DEFAULT, because there are only two possible sources in the compositing run loop, one for the tasks scheduled, and another one for the update timer. 2016-09-06 Emanuele Aina [GTK] glImageTargetTexture2D() is a GL function, rename accordingly https://bugs.webkit.org/show_bug.cgi?id=161622 Reviewed by Carlos Garcia Campos. glImageTargetTexture2D() is a GL function, not EGL, using the 'egl' prefix is misleading. * UIProcess/gtk/WaylandCompositor.cpp: (WebKit::WaylandCompositor::Surface::prepareTextureForPainting): (WebKit::WaylandCompositor::initializeEGL): 2016-09-06 Emanuele Aina [GTK][EFL] Make *_PROCESS_CMD_PREFIX conditional on DEVELOPER_MODE https://bugs.webkit.org/show_bug.cgi?id=161621 Reviewed by Carlos Garcia Campos. Instead of enabling support for the *_PROCESS_CMD_PREFIX set of environment valiables (eg. WEB_PROCESS_CMD_PREFIX) on debug builds only, enable it when DEVELOPER_MODE is enabled as it already guards similar features (eg. WEBKIT_EXEC_PATH). * UIProcess/ChildProcessProxy.cpp: (WebKit::ChildProcessProxy::getLaunchOptions): * UIProcess/Launcher/ProcessLauncher.h: * UIProcess/Launcher/efl/ProcessLauncherEfl.cpp: (WebKit::ProcessLauncher::launchProcess): * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp: (WebKit::ProcessLauncher::launchProcess): 2016-08-31 Filip Pizlo Butterflies should be allocated in Auxiliary MarkedSpace instead of CopiedSpace and we should rewrite as much of the GC as needed to make this not a regression https://bugs.webkit.org/show_bug.cgi?id=160125 Reviewed by Geoffrey Garen and Keith Miller. Just rewiring some #includes. * UIProcess/ViewGestureController.cpp: * UIProcess/WebPageProxy.cpp: * UIProcess/WebProcessPool.cpp: * UIProcess/WebProcessProxy.cpp: * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: * WebProcess/Plugins/Netscape/JSNPObject.cpp: 2016-09-05 Gustavo Noronha Silva [GTK] GL_PACK_ROW_LENGTH is not available in GLES2 https://bugs.webkit.org/show_bug.cgi?id=161484 Reviewed by Carlos Garcia Campos. * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp: (WebKit::AcceleratedBackingStoreWayland::paint): when under GLES2 we cannot rely on GL_PACK_ROW_LENGTH; use glReadPixel directly when stride matches width, read line by line manually otherwise. Colour conversion is also required to get the data out correctly. 2016-09-05 Carlos Garcia Campos [GTK] SetNativeSurfaceHandleForCompositing should not be compiled in for wayland build https://bugs.webkit.org/show_bug.cgi?id=161483 Reviewed by Žan Doberšek. SetNativeSurfaceHandleForCompositing and DestroyNativeSurfaceHandleForCompositing messages should only be used for GTK+ port when compiled with OpenGL and X11 enabled and redirected XComposite window disabled. So, we should use USE(TEXTURE_MAPPER) && PLATFORM(GTK) && PLATFORM(X11) && !USE(REDIRECTED_XCOMPOSITE_WINDOW) consistently. This fixes the build when building the GTK+ port with Wayland enabled and X11 disabled. * UIProcess/AcceleratedDrawingAreaProxy.cpp: (WebKit::AcceleratedDrawingAreaProxy::didUpdateBackingStoreState): * UIProcess/AcceleratedDrawingAreaProxy.h: * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode): * WebProcess/WebPage/AcceleratedDrawingArea.h: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: * WebProcess/WebPage/DrawingArea.h: * WebProcess/WebPage/DrawingArea.messages.in: * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: * WebProcess/WebPage/gtk/LayerTreeHostGtk.h: 2016-09-02 Michael Catanzaro [GTK] -Wmissing-field-initializers on WaylandCompositor.cpp:295 https://bugs.webkit.org/show_bug.cgi?id=161524 Reviewed by Carlos Garcia Campos. * UIProcess/gtk/WaylandCompositor.cpp: 2016-09-02 Carlos Garcia Campos [Threaded Compositor] Move the viewport controller off the compositing thread https://bugs.webkit.org/show_bug.cgi?id=161532 Reviewed by Michael Catanzaro. While working on bug #161242 I've realized that having the view port controller in the compositing thread makes everything more complex. The viewport controller receives changes about things like contents size, viewport size, etc. and uses that information to compute the visible contents rect and page scale factor. Then it notifies back to main thread about the computed visible contents rect and page scale. Those computations are not heave at all, so they could be done in the main thread and we would avoid communications between the main and compositing thread in both directions. The main thread needs the visible contents rect to notify the compositing coordinator and the page cale to scale the page in case of pixed layout. But the compositing thread only needs to know the effective scale and scroll position. So, instead of going to the compositing thread after every change that might update the visible contents rect and page scale factor, we could do those calculations in the main thread and only notify the compositing thread about the actual changes in the scroll position and effective scale. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::createTilesIfNeeded): Return early if backingStore is nullptr, which can happen if the layer shouldn't have a backing store and was removed by the previous call to prepareContentBackingStore(). (WebKit::CoordinatedGraphicsScene::updateTilesIfNeeded): Ditto. * Shared/CoordinatedGraphics/SimpleViewportController.cpp: (WebKit::SimpleViewportController::SimpleViewportController): Remove the client since we no longer need to notify about changes. (WebKit::SimpleViewportController::didChangeViewportSize): Remove call to syncVisibleContents(). (WebKit::SimpleViewportController::didChangeContentsSize): Ditto. (WebKit::SimpleViewportController::didChangeViewportAttributes): Ditto. (WebKit::SimpleViewportController::didScroll): Removed unused scrollBy methods and renamed scrollTo as didiScroll for consistency. Save the position without calling boundContentsPosition, because that's already donde when the position is used to compute the contents visible rectangle. (WebKit::SimpleViewportController::visibleContentsRect): No need to notify about the changes. (WebKit::SimpleViewportController::visibleContentsSize): Deleted. * Shared/CoordinatedGraphics/SimpleViewportController.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::create): Pass a reference to the client instead of a pointer. It's no longer possible to have a valid pointer when the object has been destroyed, so we can better use a reference now. (WebKit::ThreadedCompositor::ThreadedCompositor): Ditto. (WebKit::ThreadedCompositor::~ThreadedCompositor): Remove assert. (WebKit::ThreadedCompositor::invalidate): No need to invalidate the client. (WebKit::ThreadedCompositor::setScaleFactor): Set the effective scale factor that should be used for rendering. (WebKit::ThreadedCompositor::setScrollPosition): Set the current scroll position and effective scale factor. (WebKit::ThreadedCompositor::setViewportSize): Set the viewport size and effective scale factor. (WebKit::ThreadedCompositor::renderNextFrame): Update m_client use that is no longer a pointer. (WebKit::ThreadedCompositor::commitScrollOffset): Ditto. (WebKit::ThreadedCompositor::renderLayerTree): Call glViewport after a resize and use m_viewportSize, m_scrollPosition and m_scaleFactor members. (WebKit::ThreadedCompositor::didChangeVisibleRect): Deleted. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): Pass the compositor client as a reference to ThreadedCompositor constructor. (WebKit::ThreadedCoordinatedLayerTreeHost::scrollNonCompositedContents): Update the viewport and call didChangeViewport(). (WebKit::ThreadedCoordinatedLayerTreeHost::contentsSizeChanged): Ditto. (WebKit::ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged): Pass the effective scale factor to the compositor. (WebKit::ThreadedCoordinatedLayerTreeHost::sizeDidChange): Update the viewport, the compositor and call didChangeViewport(). (WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewportProperties): Update the viewport and call didChangeViewport(). (WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewport): Notify the compositing coordinator about the new visible contents rectangle, and update the threaded compositor if needed. * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: 2016-09-02 Zan Dobersek Unreviewed GTK+ build fix when compiling with Clang. * WebProcess/WebPage/gtk/AcceleratedSurface.cpp: Include WebPage.h. 2016-09-01 Jeremy Huddleston Sequoia [GTK] Fix configuration without wayland support https://bugs.webkit.org/show_bug.cgi?id=161475 WebKit2WaylandClientProtocol.c is a derived source that is created conditionally on ENABLE_WAYLAND_TARGET. It was being included in the sources list unconditionally, so configure failed whenever wayland support was unavailable. Reviewed by Žan Doberšek. * PlatformGTK.cmake: Include WebKit2WaylandClientProtocol.c in source list conditional on ENABLE_WAYLAND_TARGET 2016-08-31 Andreas Kling DOM event handling should pass Event around by reference. Reviewed by Chris Dumez. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performNonEditingBehaviorForSelector): 2016-08-30 Mark Lam Introduce the ThrowScope and force every throw site to instantiate a ThrowScope. https://bugs.webkit.org/show_bug.cgi?id=161171 Reviewed by Filip Pizlo and Geoffrey Garen. * WebProcess/Plugins/Netscape/JSNPMethod.cpp: (WebKit::callMethod): * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::callMethod): (WebKit::JSNPObject::callObject): (WebKit::JSNPObject::callConstructor): (WebKit::JSNPObject::getOwnPropertySlot): (WebKit::JSNPObject::put): (WebKit::JSNPObject::deleteProperty): (WebKit::JSNPObject::getOwnPropertyNames): (WebKit::JSNPObject::propertyGetter): (WebKit::JSNPObject::methodGetter): (WebKit::JSNPObject::throwInvalidAccessError): * WebProcess/Plugins/Netscape/JSNPObject.h: * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp: (WebKit::NPRuntimeObjectMap::moveGlobalExceptionToExecState): 2016-08-30 Carlos Garcia Campos REGRESSION(r194846): [GTK] UI process crash visiting sites protected with HTTP auth when using GTK+ < 3.14 https://bugs.webkit.org/show_bug.cgi?id=161385 Reviewed by Antonio Gomes. Since r194846, we are chaining up webkitWebViewBaseMotionNotifyEvent, but before GTK+ 3.14 GtkWidget::motion_notify_event was nullptr, so it can't be used unconditionally. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseMotionNotifyEvent): 2016-08-31 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.13.90 release. * gtk/NEWS: Add release notes for 2.13.90. 2016-08-30 Carlos Garcia Campos Unreviewed. Fix GTK+ build after r205150. * UIProcess/API/gtk/WebKitUserContentManager.cpp: 2016-08-29 Gyuyoung Kim Unreviewed EFL/GTK build fix since r205150 * CMakeLists.txt: Add Shared/FrameInfoData.cpp. 2016-08-29 Anders Carlsson Get rid of ChildProcessProxy::fromConnection https://bugs.webkit.org/show_bug.cgi?id=161357 Reviewed by Tim Horton. * UIProcess/ChildProcessProxy.cpp: (WebKit::ChildProcessProxy::fromConnection): Deleted. * UIProcess/ChildProcessProxy.h: * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::fromConnection): Deleted. 2016-08-29 Anders Carlsson Remove the last uses of WebProcessProxy::fromConnection https://bugs.webkit.org/show_bug.cgi?id=161355 Reviewed by Tim Horton. * UIProcess/WebProcessPool.cpp: (WebKit::webProcessProxyFromConnection): (WebKit::WebProcessPool::handleMessage): (WebKit::WebProcessPool::handleSynchronousMessage): (WebKit::WebProcessPool::startedUsingGamepads): (WebKit::WebProcessPool::stoppedUsingGamepads): 2016-08-29 Anders Carlsson Get rid of another use of WebProcessProxy::fromConnection https://bugs.webkit.org/show_bug.cgi?id=161331 Reviewed by Dan Bernstein. WebUserContentControllerProxy::didPostMessage uses WebProcessProxy::fromConnection to be able to find a WebFrameProxy from a given frame ID. Since the WebFrameProxy is only used to construct an API::FrameInfo object from, introduce a FrameInfoData object and fill it in on the web process side and send it over to the UI process where an API::FrameInfo object can be created. * Shared/FrameInfoData.cpp: Added. (WebKit::FrameInfoData::encode): (WebKit::FrameInfoData::decode): * Shared/FrameInfoData.h: Added. * UIProcess/API/APIFrameInfo.cpp: (API::FrameInfo::create): (API::FrameInfo::FrameInfo): * UIProcess/API/APIFrameInfo.h: * UIProcess/API/Cocoa/WKUserContentController.mm: * UIProcess/UserContent/WebScriptMessageHandler.h: * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::didPostMessage): * UIProcess/UserContent/WebUserContentControllerProxy.h: * UIProcess/UserContent/WebUserContentControllerProxy.messages.in: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/UserContent/WebUserContentController.cpp: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::info): * WebProcess/WebPage/WebFrame.h: 2016-08-29 Anders Carlsson Stop using WebProcessProxy::fromConnection in WebPageProxy https://bugs.webkit.org/show_bug.cgi?id=161322 Reviewed by Dan Bernstein. The WebPageProxy already knows its WebProcessProxy - no need to look it up from the connection. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleMessage): (WebKit::WebPageProxy::handleSynchronousMessage): 2016-08-29 Anders Carlsson Move some structs into Connection.cpp https://bugs.webkit.org/show_bug.cgi?id=161320 Reviewed by Darin Adler. * Platform/IPC/Connection.cpp: (IPC::Connection::PendingSyncReply::PendingSyncReply): * Platform/IPC/Connection.h: (IPC::Connection::PendingSyncReply::PendingSyncReply): Deleted. 2016-08-26 Anders Carlsson Remove sync message sending from secondary threads https://bugs.webkit.org/show_bug.cgi?id=161277 Reviewed by Sam Weinig. This codepath hasn't been used for some time, and removing it will make it easier to make IPC::Connection backed by libxpc. * Platform/IPC/Connection.cpp: (IPC::Connection::sendSyncMessage): (IPC::Connection::processIncomingSyncReply): (IPC::Connection::connectionDidClose): (IPC::Connection::sendSyncMessageFromSecondaryThread): Deleted. * Platform/IPC/Connection.h: 2016-08-16 Carlos Garcia Campos [GTK] Accelerated compositing does not work in Wayland https://bugs.webkit.org/show_bug.cgi?id=115803 Reviewed by Michael Catanzaro. This is the initial implementation of accelerated compositing support in Wayland for the GTK+ port. It's based on previous patches written by Iago Toral, Žan Doberšek, Emanuele Aina and Emilio Pozuelo Monfort. The existing WebKitGTK+ Wayland interface previously added for this to WebCore has been moved to the WebKit2 layer, since it's actually specific to WebKit2, and it's now actually used. The UI process runs a nested Wayland compositor that web processes connect to. Web processes create a Wayland surface in the nested compositor for the web page, and using the WebKitGTK+ Wayland protocol interface they tell the nested compositor the web page associated to the surface. A Wayland window is created for that surface that is then used as the native window handle for compositing. To communicate with the nested compositor and to ensure all GL operations happen in the nested compositor display, the web process creates a Wayland display that connects to the nested compositor, uses the WebKitGTK+ Wayland interface and it's set as the global shared display for compositing. The nested Wayland compositor creates a new display with a unique name that is sent to the web processes at start up. It implements the Wayland surface interface to handle the Wayland buffers created for every surface and scheduling redraws on the web pages when updates are available. It uses the WebKitGTK+ Wayland interface to associate the surfaces to a particular web page. A texture is created for every surface and updated with the Wayland buffer contents using an EGLImageKHR and eglImageTargetTexture2d API. To abstract the platform differences and avoid ifdefs as much as possible, new abstract classes have been added to represent the surfaces used in accelerated compositing. AcceleratedSurface is used by the web process and represents the surface where contents are rendered into. The X11 implementation is the redirected XComposite window, and the Wayland implementation is equivalent to the previous Wayland surface added to WebCore but never used. In the UI process the web view creates an abstract AcceleratedBackingStore that is used to render the AcceleratedSurface into the web view using cairo. The X11 implementation creates the cairo surface for the redirected XComposite window pixmap and uses XDamage extension to schedule redraws. The Wayland implementation asks the nested Wayland compositor for the texture associated to the web view page. Accelerated compositing is now always enabled by default in both X11 and Wayland, unless it's explicitly disabled by the user using the WEBKIT_DISABLE_COMPOSITING_MODE environment variable, or if any extension or feature required by X11 or Wayland implementations are not available. * PlatformGTK.cmake: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::glContext): Pass the shared display for compositing to GLContext::createContextForWindow() * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): Encode wayland compositor display name. (WebKit::WebProcessCreationParameters::decode): Decode wayland compositor display name. * Shared/WebProcessCreationParameters.h: Add wayland compositor display name initial parameter. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseDispose): (webkitWebViewBaseDraw): (webkitWebViewBaseCreateWebPage): (webkitWebViewBaseEnterAcceleratedCompositingMode): (webkitWebViewBaseUpdateAcceleratedCompositingMode): (webkitWebViewBaseExitAcceleratedCompositingMode): (webkitWebViewBasePageClosed): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createNewWebProcess): Initialize the wayland compositor display name initial parameter. * UIProcess/gtk/AcceleratedBackingStore.cpp: Added. (WebKit::AcceleratedBackingStore::create): (WebKit::AcceleratedBackingStore::AcceleratedBackingStore): (WebKit::AcceleratedBackingStore::~AcceleratedBackingStore): (WebKit::AcceleratedBackingStore::paint): * UIProcess/gtk/AcceleratedBackingStore.h: Added. (WebKit::AcceleratedBackingStore::update): * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp: Added. (WebKit::AcceleratedBackingStoreWayland::create): (WebKit::AcceleratedBackingStoreWayland::AcceleratedBackingStoreWayland): (WebKit::AcceleratedBackingStoreWayland::~AcceleratedBackingStoreWayland): (WebKit::AcceleratedBackingStoreWayland::paint): * UIProcess/gtk/AcceleratedBackingStoreWayland.h: Added. * UIProcess/gtk/AcceleratedBackingStoreX11.cpp: Added. (WebKit::XDamageNotifier::singleton): (WebKit::XDamageNotifier::add): (WebKit::XDamageNotifier::remove): (WebKit::XDamageNotifier::filterXDamageEvent): (WebKit::XDamageNotifier::notify): (WebKit::AcceleratedBackingStoreX11::create): (WebKit::AcceleratedBackingStoreX11::AcceleratedBackingStoreX11): (WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11): (WebKit::AcceleratedBackingStoreX11::update): (WebKit::AcceleratedBackingStoreX11::paint): * UIProcess/gtk/AcceleratedBackingStoreX11.h: Added. * UIProcess/gtk/WaylandCompositor.cpp: Added. (WebKit::WaylandCompositor::singleton): (WebKit::WaylandCompositor::Buffer::getOrCreate): (WebKit::WaylandCompositor::Buffer::Buffer): (WebKit::WaylandCompositor::Buffer::~Buffer): (WebKit::WaylandCompositor::Buffer::destroyListenerCallback): (WebKit::WaylandCompositor::Buffer::use): (WebKit::WaylandCompositor::Buffer::unuse): (WebKit::WaylandCompositor::Buffer::createImage): (WebKit::WaylandCompositor::Buffer::size): (WebKit::WaylandCompositor::Surface::Surface): (WebKit::WaylandCompositor::Surface::~Surface): (WebKit::WaylandCompositor::Surface::makePendingBufferCurrent): (WebKit::WaylandCompositor::Surface::attachBuffer): (WebKit::WaylandCompositor::Surface::requestFrame): (WebKit::WaylandCompositor::Surface::prepareTextureForPainting): (WebKit::WaylandCompositor::Surface::commit): (WebKit::WaylandCompositor::initializeEGL): (WebKit::createWaylandLoopSource): (WebKit::WaylandCompositor::WaylandCompositor): (WebKit::WaylandCompositor::getTexture): (WebKit::WaylandCompositor::bindSurfaceToWebPage): (WebKit::WaylandCompositor::registerWebPage): (WebKit::WaylandCompositor::unregisterWebPage): * UIProcess/gtk/WaylandCompositor.h: Added. (WebKit::WaylandCompositor::Buffer::createWeakPtr): (WebKit::WaylandCompositor::Surface::setWebPage): (WebKit::WaylandCompositor::isRunning): (WebKit::WaylandCompositor::displayName): * UIProcess/gtk/WebPreferencesGtk.cpp: (WebKit::WebPreferences::platformInitializeStore): * UIProcess/gtk/XDamageNotifier.cpp: Removed. * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): (WebKit::ThreadedCoordinatedLayerTreeHost::invalidate): (WebKit::ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged): (WebKit::ThreadedCoordinatedLayerTreeHost::sizeDidChange): * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: * WebProcess/WebPage/gtk/AcceleratedSurface.cpp: Added. (WebKit::AcceleratedSurface::create): (WebKit::AcceleratedSurface::AcceleratedSurface): (WebKit::AcceleratedSurface::~AcceleratedSurface): (WebKit::AcceleratedSurface::resize): * WebProcess/WebPage/gtk/AcceleratedSurface.h: Added. (WebKit::AcceleratedSurface::window): (WebKit::AcceleratedSurface::surfaceID): * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.cpp: Added. (WebKit::waylandCompositorDisplay): (WebKit::AcceleratedSurfaceWayland::create): (WebKit::AcceleratedSurfaceWayland::AcceleratedSurfaceWayland): (WebKit::AcceleratedSurfaceWayland::~AcceleratedSurfaceWayland): (WebKit::AcceleratedSurfaceWayland::resize): * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.h: Added. * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/gtk/RedirectedXCompositeWindow.cpp. (WebKit::AcceleratedSurfaceX11::create): (WebKit::AcceleratedSurfaceX11::AcceleratedSurfaceX11): (WebKit::AcceleratedSurfaceX11::~AcceleratedSurfaceX11): (WebKit::AcceleratedSurfaceX11::resize): * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h: Renamed from Source/WebKit2/WebProcess/WebPage/gtk/RedirectedXCompositeWindow.h. * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: (WebKit::LayerTreeHostGtk::LayerTreeHostGtk): (WebKit::LayerTreeHostGtk::makeContextCurrent): (WebKit::LayerTreeHostGtk::invalidate): (WebKit::LayerTreeHostGtk::sizeDidChange): (WebKit::LayerTreeHostGtk::deviceOrPageScaleFactorChanged): (WebKit::LayerTreeHostGtk::RenderFrameScheduler::RenderFrameScheduler): Deleted. * WebProcess/WebPage/gtk/LayerTreeHostGtk.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): Initialize the wayland compositor display name. * WebProcess/WebProcess.h: (WebKit::WebProcess::waylandCompositorDisplayName): Return the wayland compositor display name. 2016-08-27 Jonathan Bedard WTR needs an implementation of setAutomaticLinkDetectionEnabled https://bugs.webkit.org/show_bug.cgi?id=87162 Reviewed by Darin Adler * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleSetAutomaticLinkDetectionEnabled): Added WKBundleSetAutomaticLinkDetectionEnabled definition. * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: Added WKBundleSetAutomaticLinkDetectionEnabled declaration. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setAutomaticLinkDetectionEnabled): Added setAutomaticLinkDetectionEnabled definition. * WebProcess/InjectedBundle/InjectedBundle.h: Added setAutomaticLinkDetectionEnabled declaration. * WebProcess/WebProcess.h: Declared setTextCheckerState public. 2016-08-27 Carlos Garcia Campos [GTK][Threaded Compositor] Several flaky tests https://bugs.webkit.org/show_bug.cgi?id=161242 Reviewed by Michael Catanzaro. We still have a lot of flaky tests since we switched to the threaded compositor. The UI process might take the screenshot too early, before everything is actually painted. I can't reproduce the problem, so this is actually a speculative fix or workaround. Our implementation of DrawingArea::dispatchAfterEnsuringDrawing() is quite simple, we just dispatch the callback in the next run loop iteration, which doesn't really ensures any drawing at all. So, we can wait for draw events before dispatching the given callback. Since we don't really know if draw events were already processed before dispatchAfterEnsuringDrawing() is called, or if there will be more than one damage event in a short time, this patch waits up to 1 second for draw events, and if a draw happens it stops if there isn't another draw event in the next 100ms. This should ensure a drawing if it was really needed. * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::DrawingMonitor::DrawingMonitor): (WebKit::DrawingAreaProxyImpl::DrawingMonitor::~DrawingMonitor): (WebKit::DrawingAreaProxyImpl::DrawingMonitor::webViewDrawCallback): (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start): (WebKit::DrawingAreaProxyImpl::DrawingMonitor::stop): (WebKit::DrawingAreaProxyImpl::DrawingMonitor::didDraw): (WebKit::DrawingAreaProxyImpl::dispatchAfterEnsuringDrawing): * UIProcess/DrawingAreaProxyImpl.h: 2016-08-26 Sam Weinig Remove support for ENABLE_LEGACY_WEB_AUDIO https://bugs.webkit.org/show_bug.cgi?id=161262 Reviewed by Anders Carlsson. * Configurations/FeatureDefines.xcconfig: Remove ENABLE_LEGACY_WEB_AUDIO. 2016-08-26 Anders Carlsson Get rid of NetworkResourceLoader::sendAbortingOnFailure https://bugs.webkit.org/show_bug.cgi?id=161267 Reviewed by Dan Bernstein. NetworkResourceLoader::sendAbortingOnFailure sends an IPC message, and if IPC::Connection::send returns false, it will abort the network resource load. IPC::Connection::send will only return false if the connection is invalid, and when it becomes invalidated the connection client member function "didClose" is invoked. For the network process, this will call abort on all outstanding network loads. Auditing all the sendAbortingOnFailure call sites, shows that none of them can be called with an invalid connection, so replace sendAbortingOnFailure with send. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didReceiveResponse): This is a NetworkLoadClient function which won't be called if the load has been aborted. (WebKit::NetworkResourceLoader::didReceiveBuffer): Ditto. (WebKit::NetworkResourceLoader::didFinishLoading): Ditto. Also, update a call to sendBufferMaybeAborting to sendBuffer. (WebKit::NetworkResourceLoader::willSendRedirectedRequest): This is another NetworkLoadClient function. (WebKit::NetworkResourceLoader::bufferingTimerFired): The buffering timer is stopped when abort() is called. (WebKit::NetworkResourceLoader::sendBuffer): Rename this from sendBufferMaybeAborting. It has three call sites: - didReceiveBuffer and didFinishLoading are both NetworkLoadClient functions. - didRetrieveCacheEntry is called from didFinishLoading (a NetworkLoadClient function) and from the completion function of retrieveCacheEntry, which has an early return for when the loader has been aborted. (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): This is called from the retrieveCacheEntry completion function, which has an early return for when the loader has been aborted. (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry): Ditto. (WebKit::NetworkResourceLoader::sendAbortingOnFailure): Deleted. * NetworkProcess/NetworkResourceLoader.h: 2016-08-26 Dan Bernstein [Cocoa] Infinite recursion calling -charValue on a WKNSNumber https://bugs.webkit.org/show_bug.cgi?id=161258 Reviewed by Anders Carlsson. * Shared/Cocoa/WKNSNumber.mm: (-[WKNSNumber charValue]): Override this… (-[WKNSNumber boolValue]): …not this. 2016-08-26 Csaba Osztrogonác [EFL][GTK] REGRESSION(204877): Fix the clean build https://bugs.webkit.org/show_bug.cgi?id=161240 Reviewed by Carlos Garcia Campos. * Scripts/generate-forwarding-headers.pl: Added back multiple include-path support. (removed by r183389) 2016-08-26 Gyuyoung Kim Unreviewed EFL build fix since r204996. * UIProcess/efl/WebPageProxyEfl.cpp: (WebKit::WebPageProxy::editorStateChanged): (WebKit::WebPageProxy::setThemePath): (WebKit::WebPageProxy::confirmComposition): (WebKit::WebPageProxy::setComposition): (WebKit::WebPageProxy::cancelComposition): 2016-08-25 Carlos Garcia Campos Unreviewed. Fix GTK+ build after r204986 and r204996. * Platform/IPC/unix/ConnectionUnix.cpp: (IPC::Connection::willSendSyncMessage): (IPC::Connection::didReceiveSyncReply): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::drawPagesForPrinting): 2016-08-25 Anders Carlsson Replace all IPC message send flags with OptionSet https://bugs.webkit.org/show_bug.cgi?id=161211 Reviewed by Tim Horton. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didFailLoading): (WebKit::NetworkResourceLoader::sendAbortingOnFailure): * NetworkProcess/NetworkResourceLoader.h: * Platform/IPC/Connection.cpp: (IPC::WaitForMessageState::WaitForMessageState): (IPC::Connection::sendMessage): (IPC::Connection::sendSyncReply): (IPC::Connection::waitForMessage): (IPC::Connection::sendSyncMessage): (IPC::Connection::sendSyncMessageFromSecondaryThread): (IPC::Connection::waitForSyncReply): (IPC::Connection::processIncomingMessage): * Platform/IPC/Connection.h: (IPC::Connection::send): (IPC::Connection::sendSync): (IPC::Connection::waitForAndDispatchImmediately): * Platform/IPC/MessageSender.cpp: (IPC::MessageSender::sendMessage): * Platform/IPC/MessageSender.h: (IPC::MessageSender::send): (IPC::MessageSender::sendSync): * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::open): (IPC::Connection::willSendSyncMessage): (IPC::Connection::didReceiveSyncReply): * PluginProcess/mac/PluginControllerProxyMac.mm: (WebKit::PluginControllerProxy::setComplexTextInputState): * UIProcess/ChildProcessProxy.cpp: (WebKit::ChildProcessProxy::sendMessage): (WebKit::ChildProcessProxy::didFinishLaunching): * UIProcess/ChildProcessProxy.h: (WebKit::ChildProcessProxy::send): (WebKit::ChildProcessProxy::sendSync): * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::getDatabaseProcessConnection): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::getNetworkProcessConnection): * UIProcess/Plugins/PluginProcessProxy.cpp: (WebKit::PluginProcessProxy::getPluginProcessConnection): * UIProcess/WebEditCommandProxy.cpp: (WebKit::WebEditCommandProxy::unapply): (WebKit::WebEditCommandProxy::reapply): * UIProcess/WebPageProxy.cpp: (WebKit::printingSendOptions): (WebKit::WebPageProxy::preferencesDidChange): (WebKit::WebPageProxy::sendMessage): (WebKit::WebPageProxy::beginPrinting): (WebKit::WebPageProxy::endPrinting): (WebKit::WebPageProxy::computePagesForPrinting): (WebKit::WebPageProxy::drawRectToImage): (WebKit::WebPageProxy::drawPagesToPDF): (WebKit::WebPageProxy::drawPagesForPrinting): (WebKit::WebPageProxy::setMinimumLayoutSize): Deleted. (WebKit::WebPageProxy::setAutoSizingShouldExpandToViewHeight): Deleted. (WebKit::WebPageProxy::handleAlternativeTextUIResult): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState): * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateViewState): * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::geometryDidChange): * 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): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::createWithCoreMainFrame): (WebKit::WebFrame::createSubframe): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::sendPostLayoutEditorStateIfNeeded): (WebKit::WebPage::postSynchronousMessageForTesting): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush): 2016-08-25 Anders Carlsson Remove some more MessageRecorder gunk https://bugs.webkit.org/show_bug.cgi?id=161209 Reviewed by Tim Horton. * DatabaseProcess/DatabaseProcess.h: * DatabaseProcess/DatabaseToWebProcessConnection.h: * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkProcess.h: * Platform/IPC/Connection.h: * Platform/IPC/ProcessType.h: Removed. * PluginProcess/PluginProcess.h: * PluginProcess/WebProcessConnection.h: * UIProcess/Databases/DatabaseProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Plugins/PluginProcessProxy.h: * UIProcess/WebProcessProxy.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/Databases/WebToDatabaseProcessConnection.h: * WebProcess/Network/NetworkProcessConnection.h: * WebProcess/Plugins/PluginProcessConnection.h: * WebProcess/WebPage/WebInspector.h: * WebProcess/WebPage/WebInspectorUI.h: * WebProcess/WebProcess.h: 2016-08-25 Johan K. Jensen Don't store networkLoadTiming in the disk cache https://bugs.webkit.org/show_bug.cgi?id=161161 Reviewed by Antti Koivisto. * NetworkProcess/cache/NetworkCacheStorage.h: Updated version to 10. * NetworkProcess/cache/NetworkCacheDecoder.h: * NetworkProcess/cache/NetworkCacheEncoder.h: * Platform/IPC/Decoder.h: * Platform/IPC/Encoder.h: Added isIPCDecoder/isIPCEncoder static members. 2016-08-25 Carlos Garcia Campos [GTK][Threaded Compositor] Several flaky tests due to differences in scrollbars https://bugs.webkit.org/show_bug.cgi?id=160450 Reviewed by Michael Catanzaro. The issue is that ThreadedCompositor::didChangeVisibleRect() dispatches the setVisibleContentsRect() call that ends up in CompositingCoordinator. Since we're compositing the scrollbars as well, this visible contents rect needs to encompass the complete width of the view, but that's not happening. In case of non-overlay scrollbars, the scrollbars are clipped from this rect, but that doesn't prevent the scrollbar overlay layers to be flushed and rendered. What does happen is that during tile creation in the backing store the tiles that would normally intersect the visible rect of the view (if it were spanning over the whole actual visible area) are sorted by distance to the visible rect. The top of the two tiles used for the scrollbar is closer to the visible rect, so that gets created and filled in first. The second tile is stored as pending for creation, and does get rendered at the point of the next layer flush. * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::setVisibleContentsRect): Update the visible rect taking into account the non-overlay scrollbars before passing it to the compositor. 2016-08-24 JF Bastien cmake build broken by MessageRecorder removal https://bugs.webkit.org/show_bug.cgi?id=161175 Reviewed by Dean Jackson. * PlatformMac.cmake: 2016-08-24 Jonathan Bedard FocusController multiple dereferenced NULL pointers https://bugs.webkit.org/show_bug.cgi?id=160808 Reviewed by Darin Adler. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setInitialFocus): Should use nullptr, not 0 to initialize NULL pointer. 2016-08-23 Anders Carlsson Add enum traits and use them in the IPC::Decoder https://bugs.webkit.org/show_bug.cgi?id=161103 Reviewed by Sam Weinig. * Platform/IPC/Decoder.h: * Platform/IPC/Encoder.h: Add new encode/decode functions. * Shared/mac/ArgumentCodersMac.mm: Change NSType to be a strongly typed enum. Use encode/decode instead of encodeEnum/decodeEnum since the latter don't have the enum check. 2016-08-24 Filip Pizlo Unreviewed, roll out r204901, r204897, r204866, r204856, r204854. * UIProcess/ViewGestureController.cpp: * UIProcess/WebPageProxy.cpp: * UIProcess/WebProcessPool.cpp: * UIProcess/WebProcessProxy.cpp: * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: * WebProcess/Plugins/Netscape/JSNPObject.cpp: 2016-08-24 Anders Carlsson In some cases, an IPC::Connection won't know when the other end has gone away https://bugs.webkit.org/show_bug.cgi?id=161153 rdar://problem/27896368 Reviewed by Dan Bernstein. When being asked to invalidate a connection that isn't yet connected, make sure to release our send and receive rights so that the other end will get a failure when trying to connect. * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::platformInvalidate): 2016-08-24 Dan Bernstein Add a convenience function for creating a WKFrameHandleRef from a WKFrameRef without going through WKFrameInfoRef https://bugs.webkit.org/show_bug.cgi?id=161152 Reviewed by Anders Carlsson. * UIProcess/API/C/WKFrame.cpp: (WKFrameCreateFrameHandle): Added. Creates a handle with the frame’s frameID. * UIProcess/API/C/WKFrame.h: 2016-08-24 Dan Bernstein [Cocoa] Can’t "po" WKObject instances https://bugs.webkit.org/show_bug.cgi?id=161151 Reviewed by Anders Carlsson. * Shared/Cocoa/WKObject.mm: (-[WKObject debugDescription]): Implement and forward to the target or print a generic description. 2016-08-24 Brady Eidson Get timestamps and ids working in WK2 gamepads (and test them!) https://bugs.webkit.org/show_bug.cgi?id=161112 Reviewed by Alex Christensen. * Shared/Gamepad/GamepadData.cpp: (WebKit::GamepadData::GamepadData): (WebKit::GamepadData::encode): (WebKit::GamepadData::decode): * Shared/Gamepad/GamepadData.h: (WebKit::GamepadData::id): (WebKit::GamepadData::index): Deleted. * UIProcess/Gamepad/UIGamepad.cpp: (WebKit::UIGamepad::UIGamepad): (WebKit::UIGamepad::condensedGamepadData): (WebKit::UIGamepad::fullGamepadData): Include the ID for initial WebGamepad creation. (WebKit::UIGamepad::gamepadData): Deleted. * UIProcess/Gamepad/UIGamepad.h: * UIProcess/Gamepad/UIGamepadProvider.cpp: (WebKit::UIGamepadProvider::snapshotGamepads): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::gamepadConnected): (WebKit::WebProcessPool::setInitialConnectedGamepads): * WebProcess/Gamepad/WebGamepad.cpp: (WebKit::WebGamepad::WebGamepad): (WebKit::WebGamepad::updateValues): 2016-08-24 Hunseop Jeong [EFL] Fix test_ewk2_view https://bugs.webkit.org/show_bug.cgi?id=161131 Reviewed by Gyuyoung Kim. ewk_view_title_changed: null is treated as the string "null" after r203487. ewk_view_page_contents_get: aligned encoding labels after r204605. * UIProcess/API/efl/tests/resources/resultMHTML.mht: * UIProcess/API/efl/tests/test_ewk2_view.cpp: (TEST_F): 2016-08-23 Simon Fraser Add some logging for WKSelectionDrawingInfo https://bugs.webkit.org/show_bug.cgi?id=161055 Reviewed by Tim Horton. Add a Selection logging channel for WK2, and dump WKSelectionDrawingInfo when it changes. * Platform/Logging.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (WebKit::operator<<): (-[WKContentView _updateChangedSelection:]): 2016-08-23 Ryosuke Niwa Another CMake build fix attempt after r204852. * CMakeLists.txt: 2016-08-22 Filip Pizlo Butterflies should be allocated in Auxiliary MarkedSpace instead of CopiedSpace and we should rewrite as much of the GC as needed to make this not a regression https://bugs.webkit.org/show_bug.cgi?id=160125 Reviewed by Geoffrey Garen. Just rewiring some #includes. * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: * WebProcess/Plugins/Netscape/JSNPObject.cpp: 2016-08-23 Brady Eidson WK2 Gamepad layout test support. https://bugs.webkit.org/show_bug.cgi?id=134671 Reviewed by Alex Christensen. - Teach the UIGamepadProvider to use the default shared provider. - Especially if its the MockGamepadProvider, don't overwrite it. * Shared/Gamepad/GamepadData.cpp: (WebKit::GamepadData::GamepadData): (WebKit::GamepadData::encode): (WebKit::GamepadData::decode): (WebKit::GamepadData::loggingString): (WebKit::GamepadData::isNull): Deleted. * Shared/Gamepad/GamepadData.h: (WebKit::GamepadData::GamepadData): (WebKit::GamepadData::isNull): (WebKit::GamepadData::index): (WebKit::GamepadData::axisValues): (WebKit::GamepadData::buttonValues): * UIProcess/Gamepad/UIGamepad.h: * UIProcess/Gamepad/UIGamepadProvider.cpp: (WebKit::UIGamepadProvider::UIGamepadProvider): (WebKit::UIGamepadProvider::~UIGamepadProvider): (WebKit::UIGamepadProvider::platformGamepadInputActivity): (WebKit::UIGamepadProvider::startMonitoringGamepads): (WebKit::UIGamepadProvider::stopMonitoringGamepads): (WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider): * UIProcess/Gamepad/UIGamepadProvider.h: * UIProcess/Gamepad/mac/UIGamepadProviderHID.cpp: (WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider): (WebKit::UIGamepadProvider::platformStopMonitoringInput): (WebKit::UIGamepadProvider::platformStartMonitoringInput): (WebKit::UIGamepadProvider::platformStartMonitoringGamepads): Deleted. (WebKit::UIGamepadProvider::platformStopMonitoringGamepads): Deleted. (WebKit::UIGamepadProvider::platformGamepads): Deleted. * UIProcess/WebPageProxy.h: * WebProcess/Gamepad/WebGamepad.cpp: (WebKit::WebGamepad::WebGamepad): (WebKit::WebGamepad::updateValues): * WebProcess/Gamepad/WebGamepad.h: * WebProcess/Gamepad/WebGamepadProvider.cpp: (WebKit::WebGamepadProvider::gamepadConnected): * WebProcess/Gamepad/WebGamepadProvider.h: * WebProcess/WebPage/WebPage.h: * WebProcess/WebProcess.h: 2016-08-23 Dave Hyatt Add pref for enabling new CSS parsing and move parser files into subdirectory. https://bugs.webkit.org/show_bug.cgi?id=161095 Reviewed by Sam Weinig. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetNewCSSParserEnabled): (WKPreferencesGetNewCSSParserEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-08-23 Chris Dumez Unreviewed, rolling out r204243. Caused some layout test failures Reverted changeset: "Write API test to cover crash fix in r204135" https://bugs.webkit.org/show_bug.cgi?id=160587 http://trac.webkit.org/changeset/204243 2016-08-23 Hunseop Jeong [EFL] URTBF after r204743. * Shared/WebBatteryStatus.cpp: Remove Arguments.h. 2016-08-22 Yusuke Suzuki Use Messages::XXX...::Reply explicitly https://bugs.webkit.org/show_bug.cgi?id=161075 Reviewed by Carlos Garcia Campos. std::tuple's constructor is annotated as `explicit`. So we cannot use the implicit conversion here. This causes the build failure in EFL and GTK. Looking through code, the other places use ::Reply explicitly. So in this patch, we follow that. * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer): * WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.cpp: (WebKit::InjectedBundlePageFullScreenClient::supportsFullScreen): 2016-08-22 Anders Carlsson Remove Arguments.h https://bugs.webkit.org/show_bug.cgi?id=161060 Reviewed by Tim Horton. * Platform/IPC/Arguments.h: Removed. (IPC::Arguments::Arguments): Deleted. (IPC::Arguments::encode): Deleted. (IPC::Arguments::decode): Deleted. * Platform/IPC/Connection.h: * Platform/IPC/HandleMessage.h: * Shared/AssistedNodeInformation.cpp: * Shared/Cocoa/DataDetectionResult.mm: * Shared/EditorState.cpp: * Shared/WebContextMenuItemData.cpp: * Shared/WebMouseEvent.cpp: * Shared/WebPlatformTouchPoint.cpp: * Shared/WebPopupItem.cpp: * Shared/WebTouchEvent.cpp: * Shared/WebWheelEvent.cpp: * Shared/ios/InteractionInformationAtPosition.mm: * Shared/ios/WebPlatformTouchPointIOS.cpp: * Shared/ios/WebTouchEventIOS.cpp: * Shared/mac/WebGestureEvent.cpp: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/WebPage/WebPage.cpp: 2016-08-22 Anders Carlsson Move tuple coding to ArgumentCoders.h https://bugs.webkit.org/show_bug.cgi?id=161059 Reviewed by Tim Horton. * Platform/IPC/ArgumentCoders.h: (IPC::TupleCoder::encode): (IPC::TupleCoder::decode): * Platform/IPC/Arguments.h: (IPC::TupleCoder::encode): Deleted. (IPC::TupleCoder::decode): Deleted. * Scripts/webkit/messages.py: (forward_declarations_and_headers): 2016-08-22 Anders Carlsson Simplify the generated message structs https://bugs.webkit.org/show_bug.cgi?id=161057 Reviewed by Geoffrey Garen. Use a class template to transform the Reply and Argument tuple types for encoding/decoding instead of generating them for each message. * Platform/IPC/HandleMessage.h: (IPC::handleMessage): (IPC::handleMessageDelayed): * Scripts/webkit/messages.py: (reply_type): (message_to_struct_declaration): (decode_type): Deleted. 2016-08-19 Anders Carlsson Remove MessageRecorder https://bugs.webkit.org/show_bug.cgi?id=161022 Reviewed by Tim Horton. * Platform/IPC/ArgumentCoders.cpp: (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * Platform/IPC/ArgumentCoders.h: * Platform/IPC/Connection.cpp: (IPC::Connection::sendMessage): (IPC::Connection::sendSyncMessage): (IPC::Connection::sendSyncMessageFromSecondaryThread): (IPC::Connection::dispatchSyncMessage): Deleted. (IPC::Connection::dispatchMessage): Deleted. * Platform/IPC/Connection.h: * Platform/IPC/Encoder.cpp: (IPC::Encoder::encodeHeader): Deleted. * Platform/IPC/MessageRecorder.cpp: Removed. (IPC::MessageRecorder::isEnabled): Deleted. (IPC::MessageRecorder::recordOutgoingMessage): Deleted. (IPC::MessageRecorder::recordIncomingMessage): Deleted. (IPC::MessageRecorder::MessageProcessingToken::MessageProcessingToken): Deleted. (IPC::MessageRecorder::MessageProcessingToken::~MessageProcessingToken): Deleted. * Platform/IPC/MessageRecorder.h: Removed. (IPC::MessageRecorder::MessageRecorder): Deleted. * Platform/IPC/MessageRecorderProbes.d: Removed. * WebKit2.xcodeproj/project.pbxproj: 2016-08-22 Alex Christensen Fix Mac CMake build after r204717. * PlatformMac.cmake: 2016-08-22 Simon Fraser popovers on iPad isn't late enough, since we have no way currently to know when the dimming view behind the popover animates out, so for now the test keeps trying to tap a button. Test: fast/forms/ios/ipad/unfocus-inside-fixed-hittest.html * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _zoomToPoint:atScale:animated:]): (-[WKWebView _scrollToRect:origin:minimumScrollDistance:]): (-[WKWebView _scrollByContentOffset:]): (-[WKWebView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): (-[WKWebView didStartFormControlInteraction]): (-[WKWebView didEndFormControlInteraction]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setIsEditable:]): (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): (-[WKContentView _stopAssistingNode]): 2016-08-22 Daniel Bates [iOS] and tests time out https://bugs.webkit.org/show_bug.cgi?id=156857 Reviewed by Simon Fraser. Support single tapping on an HTML area element in WebKit2 just as we do in Legacy WebKit. WebKit2 commits to clicking a "clickable" DOM node on a single tap only if it has a renderer. An HTML area element represents a hyperlink in an image map and does not have a renderer. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::sendTapHighlightForNodeIfNecessary): Compute the tap highlight with respect to the renderer for the image map associated with the tapped HTML area element (if it has one). (WebKit::WebPage::commitPotentialTap): Allow committing a potential tap on an HTML area element. 2016-08-22 Darin Adler Move Objective-C DOM bindings from WebCore to legacy WebKit https://bugs.webkit.org/show_bug.cgi?id=160654 Reviewed by Alex Christensen. * WebProcess/WebCoreSupport/WebEditorClient.h: Updated to use RefPtr. * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm: (WebKit::WebEditorClient::documentFragmentFromDelegate): Ditto. * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: Removed unneeded includes of Objective-C DOM headers that are now part of legacy WebKit, not WebCore. But this file doesn't need to depend on those headers at all. 2016-08-22 Chris Dumez [iOS] Wait a few seconds before release network activity assertion after a load https://bugs.webkit.org/show_bug.cgi?id=160975 Reviewed by Darin Adler. Some apps do several loads one after the other in a non-visible view. This causes us to release the background assertion every time a load completes and then take one again less than a second after. Every time we release the assertion, we send a PrepareToSuspend IPC to the WebContent process, which does all the clean up to get ready to suspend, only to get a CancelPrepareReadyToSuspend later on because the next load has started. To work around this problem, we now wait a few seconds before releasing the background activity after a load. * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationState): (WebKit::NavigationState::releaseNetworkActivityToken): (WebKit::NavigationState::didChangeIsLoading): 2016-08-22 Youenn Fablet [Fetch API] Activate fetch api runtime flag by default https://bugs.webkit.org/show_bug.cgi?id=160452 Reviewed by Alex Christensen. * Shared/WebPreferencesDefinitions.h: 2016-08-22 Gyuyoung Kim [SOUP] Change MessageDecoder with Decoder https://bugs.webkit.org/show_bug.cgi?id=161040 Reviewed by Darin Adler. Clean up MessageDecoder in files of Soup. * Scripts/webkit/MessageReceiverSuperclass-expected.cpp: (WebKit::WebPage::didReceiveMessage): * UIProcess/soup/WebSoupRequestManagerProxy.h: * WebProcess/soup/WebSoupRequestManager.h: 2016-08-21 Alex Christensen Use Document& instead of Document* when getting cookies https://bugs.webkit.org/show_bug.cgi?id=161011 Reviewed by Darin Adler. * WebProcess/Automation/WebAutomationSessionProxy.cpp: (WebKit::WebAutomationSessionProxy::getCookiesForFrame): (WebKit::WebAutomationSessionProxy::deleteCookie): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::cookiesForURL): (WebKit::PluginView::setCookiesForURL): (WebKit::PluginView::getAuthenticationInfo): 2016-08-20 Gyuyoung Kim Unreviewed EFL build fix since r204668 r204668 changed MessageDecoder with Decoder though, MessageDecoder remained in EFL specific files. * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h: * UIProcess/WebVibrationProxy.h: * WebProcess/Battery/WebBatteryManager.h: * WebProcess/WebPage/AcceleratedDrawingArea.cpp: (WebKit::AcceleratedDrawingArea::didReceiveCoordinatedLayerTreeHostMessage): * WebProcess/WebPage/AcceleratedDrawingArea.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: * WebProcess/WebPage/LayerTreeHost.h: 2016-08-20 Dan Bernstein [Mac] Web Content service with a restricted entitlement may load arbitrary dylibs https://bugs.webkit.org/show_bug.cgi?id=156668 Reviewed by Sam Weinig. * Configurations/WebContentService.xcconfig: Enable library validation when the Web Content service is given the XPC domain extension entitlement. 2016-08-20 Javier Fernandez [GTK] Unreviewed GTK build fix since r204665 and 204668 https://bugs.webkit.org/show_bug.cgi?id=161020 * CMakeLists.txt: * Platform/IPC/MessageRecorder.cpp: (IPC::MessageRecorder::recordOutgoingMessage): * Platform/IPC/unix/ConnectionUnix.cpp: (IPC::Connection::processMessage): (IPC::Connection::sendOutgoingMessage): * Platform/unix/SharedMemoryUnix.cpp: (WebKit::SharedMemory::Handle::encode): (WebKit::SharedMemory::Handle::decode): * PlatformGTK.cmake: * Scripts/webkit/LegacyMessageReceiver-expected.cpp: (Messages::WebPage::GetPluginProcessConnection::DelayedReply::DelayedReply): (Messages::WebPage::TestMultipleAttributes::DelayedReply::DelayedReply): (WebKit::WebPage::didReceiveWebPageMessage): (WebKit::WebPage::didReceiveSyncWebPageMessage): * Scripts/webkit/LegacyMessages-expected.h: * Scripts/webkit/MessageReceiver-expected.cpp: (Messages::WebPage::GetPluginProcessConnection::DelayedReply::DelayedReply): (Messages::WebPage::TestMultipleAttributes::DelayedReply::DelayedReply): (WebKit::WebPage::didReceiveMessage): (WebKit::WebPage::didReceiveSyncMessage): * Scripts/webkit/Messages-expected.h: * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::encodeTimingFunction): (IPC::decodeTimingFunction): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::encodeCoordinatedSurface): (IPC::decodeCoordinatedSurface): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h: * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp: (WebKit::WebCoordinatedSurface::Handle::encode): (WebKit::WebCoordinatedSurface::Handle::decode): * Shared/CoordinatedGraphics/WebCoordinatedSurface.h: * Shared/WebBatteryStatus.cpp: (WebKit::WebBatteryStatus::Data::encode): (WebKit::WebBatteryStatus::Data::decode): * Shared/WebBatteryStatus.h: * Shared/gtk/ArgumentCodersGtk.cpp: (IPC::encodeImage): (IPC::decodeImage): (IPC::encodeDataObject): (IPC::decodeDataObject): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::encodeGKeyFile): (IPC::decodeGKeyFile): (IPC::encode): (IPC::decode): * Shared/gtk/ArgumentCodersGtk.h: * Shared/soup/WebCoreArgumentCodersSoup.cpp: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): * UIProcess/LegacySessionStateCodingNone.cpp: (WebKit::encodeLegacySessionState): (WebKit::decodeLegacySessionState): * UIProcess/WebBatteryManagerProxy.h: 2016-08-20 Yusuke Suzuki Unreviewed, build fix attempt after r204665 and r204668. * PlatformGTK.cmake: 2016-08-19 Ryosuke Niwa Another build fix attempt after r204665 and r204668. * CMakeLists.txt: 2016-08-19 Ryosuke Niwa GTK+ / EFL build fix attempt after r204665. * CMakeLists.txt: 2016-08-19 Anders Carlsson Merge MessageDecoder and ArgumentDecoder into Decoder https://bugs.webkit.org/show_bug.cgi?id=161019 Reviewed by Tim Horton. * DatabaseProcess/DatabaseProcess.cpp: * DatabaseProcess/DatabaseProcess.h: * DatabaseProcess/DatabaseToWebProcessConnection.cpp: * DatabaseProcess/DatabaseToWebProcessConnection.h: * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h: * NetworkProcess/CustomProtocols/CustomProtocolManager.h: * NetworkProcess/Downloads/DownloadID.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkProcess.cpp: * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcessCreationParameters.cpp: * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/NetworkResourceLoadParameters.cpp: * NetworkProcess/NetworkResourceLoadParameters.h: * NetworkProcess/NetworkResourceLoader.h: * Platform/IPC/ArgumentCoder.h: * Platform/IPC/ArgumentCoders.cpp: * Platform/IPC/ArgumentCoders.h: * Platform/IPC/ArgumentDecoder.cpp: * Platform/IPC/ArgumentDecoder.h: * Platform/IPC/Arguments.h: * Platform/IPC/Attachment.cpp: * Platform/IPC/Attachment.h: * Platform/IPC/Connection.cpp: * Platform/IPC/Connection.h: * Platform/IPC/DataReference.cpp: * Platform/IPC/DataReference.h: * Platform/IPC/Decoder.cpp: Renamed from Source/WebKit2/Platform/IPC/ArgumentDecoder.cpp. * Platform/IPC/Decoder.h: Renamed from Source/WebKit2/Platform/IPC/ArgumentDecoder.h. * Platform/IPC/HandleMessage.h: * Platform/IPC/MessageDecoder.cpp: Removed. * Platform/IPC/MessageDecoder.h: Removed. * Platform/IPC/MessageReceiver.h: * Platform/IPC/MessageReceiverMap.cpp: * Platform/IPC/MessageReceiverMap.h: * Platform/IPC/MessageRecorder.cpp: * Platform/IPC/MessageRecorder.h: * Platform/IPC/StringReference.cpp: * Platform/IPC/StringReference.h: * Platform/IPC/mac/ConnectionMac.mm: * Platform/IPC/mac/MachPort.h: * Platform/SharedMemory.h: * Platform/mac/SharedMemoryMac.cpp: * PluginProcess/PluginControllerProxy.h: * PluginProcess/PluginCreationParameters.cpp: * PluginProcess/PluginCreationParameters.h: * PluginProcess/PluginProcess.cpp: * PluginProcess/PluginProcess.h: * PluginProcess/WebProcessConnection.cpp: * PluginProcess/WebProcessConnection.h: * Scripts/webkit/messages.py: * Shared/API/APIData.cpp: * Shared/API/APIData.h: * Shared/API/APIError.cpp: * Shared/API/APIError.h: * Shared/API/APIFrameHandle.cpp: * Shared/API/APIFrameHandle.h: * Shared/API/APIGeometry.cpp: * Shared/API/APIGeometry.h: * Shared/API/APINumber.h: * Shared/API/APIPageGroupHandle.cpp: * Shared/API/APIPageGroupHandle.h: * Shared/API/APIPageHandle.cpp: * Shared/API/APIPageHandle.h: * Shared/API/APIURL.h: * Shared/API/APIURLRequest.cpp: * Shared/API/APIURLRequest.h: * Shared/API/APIURLResponse.cpp: * Shared/API/APIURLResponse.h: * Shared/API/Cocoa/RemoteObjectInvocation.h: * Shared/API/Cocoa/RemoteObjectInvocation.mm: * Shared/API/Cocoa/RemoteObjectRegistry.h: * Shared/AssistedNodeInformation.cpp: * Shared/AssistedNodeInformation.h: * Shared/Authentication/AuthenticationManager.h: * Shared/ChildProcess.h: * Shared/Cocoa/DataDetectionResult.h: * Shared/Cocoa/DataDetectionResult.mm: * Shared/Cocoa/LoadParametersCocoa.mm: * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: * Shared/ContextMenuContextData.cpp: * Shared/ContextMenuContextData.h: * Shared/Databases/DatabaseProcessCreationParameters.cpp: * Shared/Databases/DatabaseProcessCreationParameters.h: * Shared/Databases/IndexedDB/WebIDBResult.cpp: * Shared/Databases/IndexedDB/WebIDBResult.h: * Shared/EditorState.cpp: * Shared/EditorState.h: * Shared/FontInfo.cpp: * Shared/FontInfo.h: * Shared/Gamepad/GamepadData.cpp: * Shared/Gamepad/GamepadData.h: * Shared/LayerTreeContext.cpp: * Shared/LayerTreeContext.h: * Shared/LoadParameters.cpp: * Shared/LoadParameters.h: * Shared/NavigationActionData.cpp: * Shared/NavigationActionData.h: * Shared/PlatformPopupMenuData.cpp: * Shared/PlatformPopupMenuData.h: * Shared/Plugins/NPIdentifierData.cpp: * Shared/Plugins/NPIdentifierData.h: * Shared/Plugins/NPObjectMessageReceiver.h: * Shared/Plugins/NPRemoteObjectMap.cpp: * Shared/Plugins/NPRemoteObjectMap.h: * Shared/Plugins/NPVariantData.cpp: * Shared/Plugins/NPVariantData.h: * Shared/Plugins/PluginProcessCreationParameters.cpp: * Shared/Plugins/PluginProcessCreationParameters.h: * Shared/PrintInfo.cpp: * Shared/PrintInfo.h: * Shared/SandboxExtension.h: * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.h: * Shared/SessionState.cpp: * Shared/SessionState.h: * Shared/ShareableBitmap.cpp: * Shared/ShareableBitmap.h: * Shared/ShareableResource.cpp: * Shared/ShareableResource.h: * Shared/StatisticsData.cpp: * Shared/StatisticsData.h: * Shared/UpdateInfo.cpp: * Shared/UpdateInfo.h: * Shared/UserData.cpp: * Shared/UserData.h: * Shared/VisibleContentRectUpdateInfo.cpp: * Shared/VisibleContentRectUpdateInfo.h: * Shared/WebBackForwardListItem.h: * Shared/WebCompiledContentExtensionData.cpp: * Shared/WebCompiledContentExtensionData.h: * Shared/WebConnection.h: * Shared/WebContextMenuItemData.cpp: * Shared/WebContextMenuItemData.h: * Shared/WebCoreArgumentCoders.cpp: * Shared/WebCoreArgumentCoders.h: * Shared/WebEvent.cpp: * Shared/WebEvent.h: * Shared/WebGeolocationPosition.cpp: * Shared/WebGeolocationPosition.h: * Shared/WebHitTestResultData.cpp: * Shared/WebHitTestResultData.h: * Shared/WebKeyboardEvent.cpp: * Shared/WebMouseEvent.cpp: * Shared/WebNavigationDataStore.h: * Shared/WebPageCreationParameters.cpp: * Shared/WebPageCreationParameters.h: * Shared/WebPageGroupData.cpp: * Shared/WebPageGroupData.h: * Shared/WebPlatformTouchPoint.cpp: * Shared/WebPopupItem.cpp: * Shared/WebPopupItem.h: * Shared/WebPreferencesStore.cpp: * Shared/WebPreferencesStore.h: * Shared/WebProcessCreationParameters.cpp: * Shared/WebProcessCreationParameters.h: * Shared/WebTouchEvent.cpp: * Shared/WebUserContentControllerDataTypes.cpp: * Shared/WebUserContentControllerDataTypes.h: * Shared/WebWheelEvent.cpp: * Shared/WebsiteData/WebsiteData.cpp: * Shared/WebsiteData/WebsiteData.h: * Shared/cf/ArgumentCodersCF.cpp: * Shared/cf/ArgumentCodersCF.h: * Shared/ios/InteractionInformationAtPosition.h: * Shared/ios/InteractionInformationAtPosition.mm: * Shared/ios/QuickLookDocumentData.cpp: * Shared/ios/QuickLookDocumentData.h: * Shared/ios/WebPlatformTouchPointIOS.cpp: * Shared/ios/WebTouchEventIOS.cpp: * Shared/mac/ArgumentCodersMac.h: * Shared/mac/ArgumentCodersMac.mm: * Shared/mac/AttributedString.h: * Shared/mac/AttributedString.mm: * Shared/mac/ColorSpaceData.h: * Shared/mac/ColorSpaceData.mm: * Shared/mac/ObjCObjectGraph.h: * Shared/mac/ObjCObjectGraph.mm: * Shared/mac/RemoteLayerBackingStore.h: * Shared/mac/RemoteLayerBackingStore.mm: * Shared/mac/RemoteLayerTreeTransaction.h: * Shared/mac/RemoteLayerTreeTransaction.mm: * Shared/mac/SandboxExtensionMac.mm: * Shared/mac/SecItemRequestData.cpp: * Shared/mac/SecItemRequestData.h: * Shared/mac/SecItemResponseData.cpp: * Shared/mac/SecItemResponseData.h: * Shared/mac/SecItemShim.h: * Shared/mac/WebCoreArgumentCodersMac.mm: * Shared/mac/WebGestureEvent.cpp: * Shared/mac/WebGestureEvent.h: * Shared/mac/WebHitTestResultData.mm: * UIProcess/API/APIHitTestResult.h: * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: * UIProcess/Automation/WebAutomationSession.h: * UIProcess/ChildProcessProxy.cpp: * UIProcess/ChildProcessProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h: * UIProcess/Databases/DatabaseProcessProxy.cpp: * UIProcess/Databases/DatabaseProcessProxy.h: * UIProcess/Downloads/DownloadProxy.h: * UIProcess/DrawingAreaProxy.h: * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Plugins/PluginProcessProxy.h: * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: * UIProcess/Storage/StorageManager.h: * UIProcess/UserContent/WebUserContentControllerProxy.h: * UIProcess/VisitedLinkStore.h: * UIProcess/WebCookieManagerProxy.h: * UIProcess/WebFrameProxy.h: * UIProcess/WebFullScreenManagerProxy.h: * UIProcess/WebGeolocationManagerProxy.h: * UIProcess/WebIconDatabase.h: * UIProcess/WebInspectorProxy.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPasteboardProxy.h: * UIProcess/WebProcessPool.cpp: * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: * UIProcess/WebProcessProxy.h: * UIProcess/WebResourceLoadStatisticsStore.h: * UIProcess/ios/SmartMagnificationController.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/mac/SecItemShimProxy.h: * UIProcess/mac/ViewGestureController.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/ApplePay/WebPaymentCoordinator.h: * WebProcess/Automation/WebAutomationSessionProxy.h: * WebProcess/Cookies/WebCookieManager.h: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: * WebProcess/Databases/WebToDatabaseProcessConnection.cpp: * WebProcess/Databases/WebToDatabaseProcessConnection.h: * WebProcess/FullScreen/WebFullScreenManager.cpp: * WebProcess/FullScreen/WebFullScreenManager.h: * WebProcess/Geolocation/WebGeolocationManager.h: * WebProcess/IconDatabase/WebIconDatabaseProxy.h: * WebProcess/InjectedBundle/InjectedBundle.h: * WebProcess/Network/NetworkProcessConnection.cpp: * WebProcess/Network/NetworkProcessConnection.h: * WebProcess/Network/WebResourceLoader.h: * WebProcess/Notifications/WebNotificationManager.h: * WebProcess/Plugins/Plugin.cpp: * WebProcess/Plugins/Plugin.h: * WebProcess/Plugins/PluginProcessConnection.cpp: * WebProcess/Plugins/PluginProcessConnection.h: * WebProcess/Plugins/PluginProcessConnectionManager.cpp: * WebProcess/Plugins/PluginProcessConnectionManager.h: * WebProcess/Plugins/PluginProxy.h: * WebProcess/Scrolling/RemoteScrollingCoordinator.h: * WebProcess/Scrolling/RemoteScrollingCoordinator.mm: * WebProcess/Storage/StorageAreaMap.h: * WebProcess/UserContent/WebUserContentController.h: * WebProcess/WebPage/DrawingArea.h: * WebProcess/WebPage/EventDispatcher.h: * WebProcess/WebPage/ViewGestureGeometryCollector.h: * WebProcess/WebPage/ViewUpdateDispatcher.h: * WebProcess/WebPage/VisitedLinkTableController.h: * WebProcess/WebPage/WebInspector.h: * WebProcess/WebPage/WebInspectorUI.h: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: * WebProcess/WebProcess.cpp: * WebProcess/WebProcess.h: * WebProcess/cocoa/WebPlaybackSessionManager.h: * WebProcess/cocoa/WebVideoFullscreenManager.h: 2016-08-19 Anders Carlsson Update Xcode project. * WebKit2.xcodeproj/project.pbxproj: 2016-08-19 Anders Carlsson Merge MessageEncoder and ArgumentEncoder into Encoder https://bugs.webkit.org/show_bug.cgi?id=161016 Reviewed by Tim Horton. * DatabaseProcess/DatabaseToWebProcessConnection.cpp: (WebKit::DatabaseToWebProcessConnection::didReceiveSyncMessage): * DatabaseProcess/DatabaseToWebProcessConnection.h: * NetworkProcess/Downloads/DownloadID.h: (IPC::ArgumentCoder::encode): * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::didReceiveSyncMessage): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode): * NetworkProcess/NetworkProcessCreationParameters.h: * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode): * NetworkProcess/NetworkResourceLoadParameters.h: * Platform/IPC/ArgumentCoder.h: (IPC::ArgumentCoder::encode): * Platform/IPC/ArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): * Platform/IPC/ArgumentCoders.h: (IPC::SimpleArgumentCoder::encode): (IPC::ArgumentCoder>::encode): (IPC::ArgumentCoder>::encode): * Platform/IPC/ArgumentEncoder.cpp: (IPC::allocBuffer): Deleted. (IPC::freeBuffer): Deleted. (IPC::ArgumentEncoder::ArgumentEncoder): Deleted. (IPC::ArgumentEncoder::~ArgumentEncoder): Deleted. (IPC::roundUpToAlignment): Deleted. (IPC::ArgumentEncoder::reserve): Deleted. (IPC::ArgumentEncoder::grow): Deleted. (IPC::ArgumentEncoder::encodeFixedLengthData): Deleted. (IPC::ArgumentEncoder::encodeVariableLengthByteArray): Deleted. (IPC::copyValueToBuffer): Deleted. (IPC::ArgumentEncoder::encode): Deleted. (IPC::ArgumentEncoder::addAttachment): Deleted. (IPC::ArgumentEncoder::releaseAttachments): Deleted. * Platform/IPC/ArgumentEncoder.h: (IPC::ArgumentEncoder::encodeEnum): Deleted. (IPC::ArgumentEncoder::encode): Deleted. (IPC::ArgumentEncoder::operator<<): Deleted. (IPC::ArgumentEncoder::buffer): Deleted. (IPC::ArgumentEncoder::bufferSize): Deleted. * Platform/IPC/Arguments.h: (IPC::TupleCoder::encode): (IPC::Arguments::encode): * Platform/IPC/Attachment.cpp: (IPC::Attachment::encode): * Platform/IPC/Attachment.h: * Platform/IPC/Connection.cpp: (IPC::Connection::dispatchWorkQueueMessageReceiverMessage): (IPC::Connection::createSyncMessageEncoder): (IPC::Connection::sendMessage): (IPC::Connection::sendSyncReply): (IPC::Connection::sendSyncMessage): (IPC::Connection::sendSyncMessageFromSecondaryThread): (IPC::Connection::sendOutgoingMessages): (IPC::Connection::dispatchSyncMessage): * Platform/IPC/Connection.h: (IPC::Connection::send): (IPC::Connection::sendSync): * Platform/IPC/DataReference.cpp: (IPC::DataReference::encode): (IPC::SharedBufferDataReference::encode): * Platform/IPC/DataReference.h: * Platform/IPC/Encoder.cpp: Renamed from Source/WebKit2/Platform/IPC/ArgumentEncoder.cpp. (IPC::allocBuffer): (IPC::freeBuffer): (IPC::Encoder::Encoder): (IPC::Encoder::~Encoder): (IPC::Encoder::isSyncMessage): (IPC::Encoder::shouldDispatchMessageWhenWaitingForSyncReply): (IPC::Encoder::setIsSyncMessage): (IPC::Encoder::setShouldDispatchMessageWhenWaitingForSyncReply): (IPC::Encoder::setFullySynchronousModeForTesting): (IPC::Encoder::wrapForTesting): (IPC::roundUpToAlignment): (IPC::Encoder::reserve): (IPC::Encoder::encodeHeader): (IPC::Encoder::grow): (IPC::Encoder::encodeFixedLengthData): (IPC::Encoder::encodeVariableLengthByteArray): (IPC::copyValueToBuffer): (IPC::Encoder::encode): (IPC::Encoder::addAttachment): (IPC::Encoder::releaseAttachments): * Platform/IPC/Encoder.h: Renamed from Source/WebKit2/Platform/IPC/ArgumentEncoder.h. * Platform/IPC/HandleMessage.h: (IPC::handleMessage): (IPC::handleMessageDelayed): * Platform/IPC/MessageEncoder.cpp: Removed. (IPC::MessageEncoder::MessageEncoder): Deleted. (IPC::MessageEncoder::~MessageEncoder): Deleted. (IPC::MessageEncoder::encodeHeader): Deleted. (IPC::MessageEncoder::isSyncMessage): Deleted. (IPC::MessageEncoder::shouldDispatchMessageWhenWaitingForSyncReply): Deleted. (IPC::MessageEncoder::setIsSyncMessage): Deleted. (IPC::MessageEncoder::setShouldDispatchMessageWhenWaitingForSyncReply): Deleted. (IPC::MessageEncoder::setFullySynchronousModeForTesting): Deleted. (IPC::MessageEncoder::wrapForTesting): Deleted. * Platform/IPC/MessageEncoder.h: Removed. (IPC::MessageEncoder::messageReceiverName): Deleted. (IPC::MessageEncoder::messageName): Deleted. (IPC::MessageEncoder::destinationID): Deleted. (IPC::MessageEncoder::UUID): Deleted. * Platform/IPC/MessageReceiver.h: (IPC::MessageReceiver::didReceiveSyncMessage): * Platform/IPC/MessageReceiverMap.cpp: (IPC::MessageReceiverMap::dispatchSyncMessage): * Platform/IPC/MessageReceiverMap.h: * Platform/IPC/MessageRecorder.h: * Platform/IPC/MessageSender.cpp: (IPC::MessageSender::sendMessage): * Platform/IPC/MessageSender.h: (IPC::MessageSender::send): * Platform/IPC/StringReference.cpp: (IPC::StringReference::encode): * Platform/IPC/StringReference.h: * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::open): (IPC::Connection::sendOutgoingMessage): * Platform/IPC/mac/MachPort.h: (IPC::MachPort::encode): * Platform/SharedMemory.h: * Platform/mac/SharedMemoryMac.cpp: (WebKit::SharedMemory::Handle::encode): * PluginProcess/PluginControllerProxy.h: * PluginProcess/PluginCreationParameters.cpp: (WebKit::PluginCreationParameters::encode): * PluginProcess/PluginCreationParameters.h: * PluginProcess/WebProcessConnection.cpp: (WebKit::WebProcessConnection::didReceiveSyncMessage): * PluginProcess/WebProcessConnection.h: * Scripts/webkit/messages.py: (message_to_struct_declaration): (forward_declarations_and_headers): (generate_message_handler): (headers_for_type): Deleted. * Shared/API/APIData.cpp: (API::Data::encode): * Shared/API/APIData.h: * Shared/API/APIError.cpp: (API::Error::encode): * Shared/API/APIError.h: * Shared/API/APIFrameHandle.cpp: (API::FrameHandle::encode): * Shared/API/APIFrameHandle.h: * Shared/API/APIGeometry.cpp: (API::Point::encode): (API::Size::encode): (API::Rect::encode): * Shared/API/APIGeometry.h: * Shared/API/APINumber.h: (API::Number::encode): * Shared/API/APIPageGroupHandle.cpp: (API::PageGroupHandle::encode): * Shared/API/APIPageGroupHandle.h: * Shared/API/APIPageHandle.cpp: (API::PageHandle::encode): * Shared/API/APIPageHandle.h: * Shared/API/APIURL.h: (API::URL::encode): * Shared/API/APIURLRequest.cpp: (API::URLRequest::encode): * Shared/API/APIURLRequest.h: * Shared/API/APIURLResponse.cpp: (API::URLResponse::encode): * Shared/API/APIURLResponse.h: * Shared/API/Cocoa/RemoteObjectInvocation.h: * Shared/API/Cocoa/RemoteObjectInvocation.mm: (WebKit::RemoteObjectInvocation::encode): * Shared/AssistedNodeInformation.cpp: (WebKit::OptionItem::encode): (WebKit::AssistedNodeInformation::encode): * Shared/AssistedNodeInformation.h: * Shared/Cocoa/DataDetectionResult.h: * Shared/Cocoa/DataDetectionResult.mm: (WebKit::DataDetectionResult::encode): * Shared/Cocoa/LoadParametersCocoa.mm: (WebKit::LoadParameters::platformEncode): * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): * Shared/ContextMenuContextData.cpp: (WebKit::ContextMenuContextData::encode): * Shared/ContextMenuContextData.h: * Shared/Databases/DatabaseProcessCreationParameters.cpp: (WebKit::DatabaseProcessCreationParameters::encode): * Shared/Databases/DatabaseProcessCreationParameters.h: * Shared/Databases/IndexedDB/WebIDBResult.cpp: (WebKit::WebIDBResult::encode): * Shared/Databases/IndexedDB/WebIDBResult.h: * Shared/EditorState.cpp: (WebKit::EditorState::encode): (WebKit::EditorState::PostLayoutData::encode): * Shared/EditorState.h: * Shared/FontInfo.cpp: (WebKit::FontInfo::encode): * Shared/FontInfo.h: * Shared/Gamepad/GamepadData.cpp: (WebKit::GamepadData::encode): * Shared/Gamepad/GamepadData.h: * Shared/LayerTreeContext.cpp: (WebKit::LayerTreeContext::encode): * Shared/LayerTreeContext.h: * Shared/LoadParameters.cpp: (WebKit::LoadParameters::encode): (WebKit::LoadParameters::platformEncode): * Shared/LoadParameters.h: * Shared/NavigationActionData.cpp: (WebKit::NavigationActionData::encode): * Shared/NavigationActionData.h: * Shared/PlatformPopupMenuData.cpp: (WebKit::PlatformPopupMenuData::encode): * Shared/PlatformPopupMenuData.h: * Shared/Plugins/NPIdentifierData.cpp: (WebKit::NPIdentifierData::encode): * Shared/Plugins/NPIdentifierData.h: * Shared/Plugins/NPObjectMessageReceiver.h: * Shared/Plugins/NPRemoteObjectMap.cpp: (WebKit::NPRemoteObjectMap::didReceiveSyncMessage): * Shared/Plugins/NPRemoteObjectMap.h: * Shared/Plugins/NPVariantData.cpp: (WebKit::NPVariantData::encode): * Shared/Plugins/NPVariantData.h: * Shared/Plugins/PluginProcessCreationParameters.cpp: (WebKit::PluginProcessCreationParameters::encode): * Shared/Plugins/PluginProcessCreationParameters.h: * Shared/PrintInfo.cpp: (WebKit::PrintInfo::encode): * Shared/PrintInfo.h: * Shared/SandboxExtension.h: (WebKit::SandboxExtension::Handle::encode): (WebKit::SandboxExtension::HandleArray::encode): * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder::encode): (ArgumentCoder::encode): (ArgumentCoder::encode): (ArgumentCoder::encode): (ArgumentCoder::encode): (ArgumentCoder::encode): (WebKit::encodeNodeAndDescendants): (WebKit::RemoteScrollingCoordinatorTransaction::encode): * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.h: * Shared/SessionState.cpp: (WebKit::HTTPBody::Element::encode): (WebKit::HTTPBody::encode): (WebKit::FrameState::encode): (WebKit::PageState::encode): (WebKit::BackForwardListItemState::encode): (WebKit::BackForwardListState::encode): * Shared/SessionState.h: * Shared/ShareableBitmap.cpp: (WebKit::ShareableBitmap::Handle::encode): * Shared/ShareableBitmap.h: * Shared/ShareableResource.cpp: (WebKit::ShareableResource::Handle::encode): * Shared/ShareableResource.h: * Shared/StatisticsData.cpp: (WebKit::StatisticsData::encode): * Shared/StatisticsData.h: * Shared/UpdateInfo.cpp: (WebKit::UpdateInfo::encode): * Shared/UpdateInfo.h: * Shared/UserData.cpp: (WebKit::UserData::encode): * Shared/UserData.h: * Shared/VisibleContentRectUpdateInfo.cpp: (WebKit::VisibleContentRectUpdateInfo::encode): * Shared/VisibleContentRectUpdateInfo.h: * Shared/WebBackForwardListItem.h: * Shared/WebCompiledContentExtensionData.cpp: (WebKit::WebCompiledContentExtensionData::encode): * Shared/WebCompiledContentExtensionData.h: * Shared/WebContextMenuItemData.cpp: (WebKit::WebContextMenuItemData::encode): * Shared/WebContextMenuItemData.h: * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::pathEncodeApplierFunction): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::encodeImage): (IPC::encodeOptionalImage): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::encodeSharedBuffer): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): * Shared/WebCoreArgumentCoders.h: * Shared/WebEvent.cpp: (WebKit::WebEvent::encode): * Shared/WebEvent.h: * Shared/WebGeolocationPosition.cpp: (WebKit::WebGeolocationPosition::Data::encode): * Shared/WebGeolocationPosition.h: * Shared/WebHitTestResultData.cpp: (WebKit::WebHitTestResultData::encode): (WebKit::WebHitTestResultData::platformEncode): * Shared/WebHitTestResultData.h: * Shared/WebKeyboardEvent.cpp: (WebKit::WebKeyboardEvent::encode): * Shared/WebMouseEvent.cpp: (WebKit::WebMouseEvent::encode): * Shared/WebNavigationDataStore.h: (WebKit::WebNavigationDataStore::encode): * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): * Shared/WebPageCreationParameters.h: * Shared/WebPageGroupData.cpp: (WebKit::WebPageGroupData::encode): * Shared/WebPageGroupData.h: * Shared/WebPlatformTouchPoint.cpp: (WebKit::WebPlatformTouchPoint::encode): * Shared/WebPopupItem.cpp: (WebKit::WebPopupItem::encode): * Shared/WebPopupItem.h: * Shared/WebPreferencesStore.cpp: (WebKit::WebPreferencesStore::Value::encode): (WebKit::WebPreferencesStore::encode): * Shared/WebPreferencesStore.h: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): * Shared/WebProcessCreationParameters.h: * Shared/WebTouchEvent.cpp: (WebKit::WebTouchEvent::encode): * Shared/WebUserContentControllerDataTypes.cpp: (WebKit::WebUserScriptData::encode): (WebKit::WebUserStyleSheetData::encode): (WebKit::WebScriptMessageHandlerData::encode): * Shared/WebUserContentControllerDataTypes.h: * Shared/WebWheelEvent.cpp: (WebKit::WebWheelEvent::encode): * Shared/WebsiteData/WebsiteData.cpp: (WebKit::WebsiteData::Entry::encode): (WebKit::WebsiteData::encode): * Shared/WebsiteData/WebsiteData.h: * Shared/cf/ArgumentCodersCF.cpp: (IPC::encode): * Shared/cf/ArgumentCodersCF.h: * Shared/ios/InteractionInformationAtPosition.h: * Shared/ios/InteractionInformationAtPosition.mm: (WebKit::InteractionInformationAtPosition::encode): * Shared/ios/QuickLookDocumentData.cpp: (WebKit::QuickLookDocumentData::encode): * Shared/ios/QuickLookDocumentData.h: * Shared/ios/WebPlatformTouchPointIOS.cpp: (WebKit::WebPlatformTouchPoint::encode): * Shared/ios/WebTouchEventIOS.cpp: (WebKit::WebTouchEvent::encode): * Shared/mac/ArgumentCodersMac.h: * Shared/mac/ArgumentCodersMac.mm: (IPC::encode): * Shared/mac/AttributedString.h: * Shared/mac/AttributedString.mm: (WebKit::AttributedString::encode): * Shared/mac/ColorSpaceData.h: * Shared/mac/ColorSpaceData.mm: (WebKit::ColorSpaceData::encode): * Shared/mac/ObjCObjectGraph.h: * Shared/mac/ObjCObjectGraph.mm: (WebKit::ObjCObjectGraph::encode): * Shared/mac/RemoteLayerBackingStore.h: * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::encode): * Shared/mac/RemoteLayerTreeTransaction.h: * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode): (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode): (WebKit::RemoteLayerTreeTransaction::encode): * Shared/mac/SandboxExtensionMac.mm: (WebKit::SandboxExtension::Handle::encode): (WebKit::SandboxExtension::HandleArray::encode): * Shared/mac/SecItemRequestData.cpp: (WebKit::SecItemRequestData::encode): * Shared/mac/SecItemRequestData.h: * Shared/mac/SecItemResponseData.cpp: (WebKit::SecItemResponseData::encode): * Shared/mac/SecItemResponseData.h: * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::encode): (IPC::encodeNSError): (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::encodePlatformData): * Shared/mac/WebGestureEvent.cpp: (WebKit::WebGestureEvent::encode): * Shared/mac/WebGestureEvent.h: * Shared/mac/WebHitTestResultData.mm: (WebKit::WebHitTestResultData::platformEncode): * UIProcess/API/APIHitTestResult.h: * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: * UIProcess/ChildProcessProxy.cpp: (WebKit::ChildProcessProxy::sendMessage): (WebKit::ChildProcessProxy::dispatchSyncMessage): (WebKit::ChildProcessProxy::didFinishLaunching): * UIProcess/ChildProcessProxy.h: (WebKit::ChildProcessProxy::send): * UIProcess/Downloads/DownloadProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::didReceiveSyncMessage): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Notifications/WebNotification.cpp: * UIProcess/Notifications/WebNotification.h: * UIProcess/Plugins/PluginProcessManager.h: * UIProcess/Plugins/PluginProcessProxy.h: * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: * UIProcess/Storage/StorageManager.h: * UIProcess/WebFullScreenManagerProxy.h: * UIProcess/WebIconDatabase.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::sendMessage): * UIProcess/WebPageProxy.h: * UIProcess/WebPasteboardProxy.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::dispatchSyncMessage): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didReceiveSyncMessage): * UIProcess/WebProcessProxy.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didReceiveSyncMessage): * WebProcess/Network/NetworkProcessConnection.h: * WebProcess/Plugins/Plugin.cpp: (WebKit::Plugin::Parameters::encode): * WebProcess/Plugins/Plugin.h: * WebProcess/Plugins/PluginProcessConnection.cpp: (WebKit::PluginProcessConnection::didReceiveSyncMessage): * WebProcess/Plugins/PluginProcessConnection.h: * WebProcess/Plugins/PluginProcessConnectionManager.cpp: * WebProcess/Plugins/PluginProxy.h: * WebProcess/Scrolling/RemoteScrollingCoordinator.h: * WebProcess/Scrolling/RemoteScrollingCoordinator.mm: * WebProcess/WebPage/DrawingArea.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didReceiveSyncMessage): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: (WebKit::PlatformCAAnimationRemote::KeyframeValue::encode): (WebKit::PlatformCAAnimationRemote::Properties::encode): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::flushLayers): (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::create): (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::BackingStoreFlusher): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::didReceiveSyncMessage): * WebProcess/WebProcess.h: 2016-08-16 Simon Fraser Rename didLayout(LayoutMilestones) to didReachLayoutMilestone(), and related WK2 functions https://bugs.webkit.org/show_bug.cgi?id=160923 Reviewed by Tim Horton. didLayout(LayoutMilestones) -> didReachLayoutMilestone(LayoutMilestones) dispatchDidLayout(LayoutMilestones) -> dispatchDidReachLayoutMilestone(LayoutMilestones) Avoided changing functions that are exposed as API/SPI. * UIProcess/API/APILoaderClient.h: (API::LoaderClient::didReachLayoutMilestone): (API::LoaderClient::didLayout): Deleted. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageLoaderClient): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didLayoutForCustomContentProvider): (WebKit::WebPageProxy::didReachLayoutMilestone): (WebKit::WebPageProxy::didLayout): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::didCommitLayerTree): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (didReachLayoutMilestone): (setUpPageLoaderClient): (didLayout): Deleted. * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp: (WebKit::InjectedBundlePageLoaderClient::didReachLayoutMilestone): (WebKit::InjectedBundlePageLoaderClient::didLayout): Deleted. * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone): (WebKit::WebFrameLoaderClient::dispatchDidLayout): Deleted. * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::dispatchDidReachLayoutMilestone): (WebKit::DrawingArea::dispatchDidLayout): Deleted. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::dispatchDidReachLayoutMilestone): (WebKit::WebPage::dispatchDidLayout): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::dispatchDidReachLayoutMilestone): (WebKit::RemoteLayerTreeDrawingArea::dispatchDidLayout): Deleted. 2016-08-18 Daniel Bates Ld warns of non-existent PrivateFrameworks directory when building WebKit with the public iOS 9.3 SDK https://bugs.webkit.org/show_bug.cgi?id=160979 Rubber-stamped by Simon Fraser. Only add the SDK PrivateFrameworks directory to the FRAMEWORK_SEARCH_PATH when building for iOS Simulator, building with an iOS SDK that does not support text-based stubs, or building an Apple-internal build. * Configurations/BaseTarget.xcconfig: 2016-08-18 Hunseop Jeong Unreviewed, Fix CMake build after r204614 * PlatformMac.cmake: 2016-08-18 Chris Dumez [iOS] Network Processes & Database processes do not exit promptly https://bugs.webkit.org/show_bug.cgi?id=160978 Reviewed by Anders Carlsson. Network Processes & Database processes do not exit promptly. They hang for 10 seconds until they log the following message: > com.apple.WebKit.Networking: (WebKit) #WK: Exiting process early due to unacknowledged closed-connection Then forcefully call exit(0). To address the issue, we now call ChildProcess::stopRunLoop() instead of RunLoop::current().stop(). stopRunLoop() works as expected on iOS after r202723. There is no impact on Mac because stopRunLoop() calls RunLoop::current().stop(). * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::didClose): (WebKit::DatabaseProcess::didReceiveInvalidMessage): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::didClose): (WebKit::NetworkProcess::didReceiveInvalidMessage): 2016-08-18 Dan Bernstein [Cocoa] API::Number needs to be wrapped by an NSNumber https://bugs.webkit.org/show_bug.cgi?id=160977 Reviewed by Anders Carlsson. We introduce a single WKNSNumber class to wrap three distinct API::Number instantiations corresponding to the Boolean, UInt64 and Double types. Test: TestWebKitAPI/Tests/WebKit2Cocoa/WKNSNumber.mm * Shared/Cocoa/APIObject.mm: (API::Object::newObject): Create a WKNSNumber to contain any of the number types, and set its _type ivar accordingly. * Shared/Cocoa/WKNSNumber.h: Added. (WebKit::wrapper): * Shared/Cocoa/WKNSNumber.mm: Added. (-[WKNSNumber dealloc]): Call the appropriate destructor. (-[WKNSNumber objCType]): Implement this NSValue primitive method. (-[WKNSNumber getValue:]): Ditto. (-[WKNSNumber boolValue]): Implement this NSNumber method corresponding to one of our possible types. (-[WKNSNumber doubleValue]): Ditto. (-[WKNSNumber unsignedLongLongValue]): Ditto. (-[WKNSNumber copyWithZone:]): Implement this NSCopying method by retaining self. (-[WKNSNumber _apiObject]): Implement this WKObject method by returning the appropriate API object. * WebKit2.xcodeproj/project.pbxproj: Added references to new files. 2016-08-18 Andy Estes [Cocoa] Add SPI to WKProcessPool for enabling cookie storage partitioning https://bugs.webkit.org/show_bug.cgi?id=160964 Reviewed by Anders Carlsson. Followed the guidelines for SPI naming. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _isCookieStoragePartitioningEnabled]): Renamed from -cookieStoragePartitioningEnabled. (-[WKProcessPool _setCookieStoragePartitioningEnabled:]): Renamed from -setCookieStoragePartitioningEnabled:. (-[WKProcessPool cookieStoragePartitioningEnabled]): Renamed to -_isCookieStoragePartitioningEnabled. (-[WKProcessPool setCookieStoragePartitioningEnabled:]): Renamed to -_setCookieStoragePartitioningEnabled:. * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: 2016-08-18 Andy Estes Generated messages headers should use #pragma once https://bugs.webkit.org/show_bug.cgi?id=160965 Reviewed by Anders Carlsson. * Scripts/webkit/messages.py: (generate_messages_header): Used #pragma once instead of a header guard. 2016-08-18 Andy Estes [Cocoa] Add SPI to WKProcessPool for enabling cookie storage partitioning https://bugs.webkit.org/show_bug.cgi?id=160964 Reviewed by Brent Fulgham. * NetworkProcess/NetworkProcess.h: Declared setCookieStoragePartitioningEnabled(). * NetworkProcess/NetworkProcess.messages.in: Added message SetCookieStoragePartitioningEnabled. * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode): Encoded cookieStoragePartitioningEnabled. (WebKit::NetworkProcessCreationParameters::decode): Decoded cookieStoragePartitioningEnabled. * NetworkProcess/NetworkProcessCreationParameters.h: Declared cookieStoragePartitioningEnabled. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): Called NetworkStorageSession::setCookieStoragePartitioningEnabled() given the cookieStoragePartitioningEnabled parameter. (WebKit::NetworkProcess::setCookieStoragePartitioningEnabled): Called NetworkStorageSession::setCookieStoragePartitioningEnabled(). * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool cookieStoragePartitioningEnabled]): Returned WebProcessPool::cookieStoragePartitioningEnabled(). (-[WKProcessPool setCookieStoragePartitioningEnabled:]): Called WebProcessPool::setCookieStoragePartitioningEnabled(). * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: Declared cookieStoragePartitioningEnabled as a property. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): Set the cookieStoragePartitioningEnabled parameter from m_cookieStoragePartitioningEnabled. (WebKit::WebProcessPool::setCookieStoragePartitioningEnabled): Set m_cookieStoragePartitioningEnabled and sent the NetworkProcess::SetCookieStoragePartitioningEnabled message. * UIProcess/WebProcessPool.h: Declared cookieStoragePartitioningEnabled. 2016-08-17 Anders Carlsson Add support for additional networks https://bugs.webkit.org/show_bug.cgi?id=160951 rdar://problem/27807479 Reviewed by Sam Weinig. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. * Shared/WebCoreArgumentCoders.h: * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: (WebKit::toAdditionalSupportedNetwork): (WebKit::toSupportedNetwork): (WebKit::toSupportedNetworks): * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::supportsVersion): 2016-08-17 Anders Carlsson Remove a couple of unused WKSI function pointers https://bugs.webkit.org/show_bug.cgi?id=160946 Reviewed by Dan Bernstein. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): Deleted. 2016-08-17 Dan Bernstein [Cocoa] -[NSString isEqualToString:] returns NO for any WKNSString argument https://bugs.webkit.org/show_bug.cgi?id=160938 Reviewed by Anders Carlsson. -[NSString isEqualToString:] calls an internal NSObject method on its argument, which NSString subclasses override to return YES, but WKObject does not override and does not forward to its target NSString. To fix this issue and other similar issues, we make WKObject a root class instead of an NSObject subclass. Test: TestWebKitAPI/Tests/WebKit2Cocoa/WKObject.mm * Platform/spi/Cocoa/objcSPI.h: Added. * Shared/Cocoa/WKObject.h: Make WKObject a root class instead of inhereting from NSObject. * Shared/Cocoa/WKObject.mm: (+[WKObject class]): Return self. (-[WKObject allowsWeakReference]): Added. Called by the Objective-C runtime. (-[WKObject retainWeakReference]): Ditto. (-[WKObject hash]): If we don’t have a target, return our address. (-[WKObject superclass]): Implement this NSObject protocol method. (-[WKObject class]): Ditto. (-[WKObject self]): Ditto. (-[WKObject performSelector:]): Ditto. (-[WKObject performSelector:withObject:]): Ditto. (-[WKObject performSelector:withObject:withObject:]): Ditto. (-[WKObject isProxy]): Ditto. (-[WKObject respondsToSelector:]): Changed to not call super. (-[WKObject conformsToProtocol:]): Ditto. (-[WKObject description]): Ditto. (-[WKObject retain]): Implement this NSObject protocol method. (-[WKObject release]): Ditto. (-[WKObject autorelease]): Ditto. (-[WKObject retainCount]): Ditto. (-[WKObject zone]): Ditto. (-[WKObject dealloc]): Deleted. (-[WKObject classForCoder]): Deleted. (-[WKObject classForKeyedArchiver]): Deleted. (-[WKObject _cfTypeID]): Deleted. * WebKit2.xcodeproj/project.pbxproj: Added reference to new file. 2016-08-17 Hunseop Jeong [EFL] Fix test_ewk2_view after r203612 https://bugs.webkit.org/show_bug.cgi?id=160937 Reviewed by Gyuyoung Kim. Default parameter values for window.alert() / prompt() / confirm() was changed from "undefined" to the empty string after r203612. * UIProcess/API/efl/tests/test_ewk2_view.cpp: (TEST_F): 2016-08-16 Simon Fraser [iOS WK2] Don't throw touchMove events on the floor https://bugs.webkit.org/show_bug.cgi?id=160935 Reviewed by Tim Horton. EventDispatcher claimed to coalesce touchMove events, but actually threw away any touchMove if there was one in the queue when the next non-move event came along. Fix to strictly coalesce touchMove events, so a start/move/end stream always fires a move event. This is necessary for move-based interaction to work in testing, for example the added range slider test. Test: fast/forms/ios/drag-range-thumb.html * WebProcess/WebPage/EventDispatcher.cpp: (WebKit::EventDispatcher::touchEvent): 2016-08-16 Simon Fraser [iOS WK2] Clean up form select code https://bugs.webkit.org/show_bug.cgi?id=160915 Reviewed by Enrica Casucci. Some minor forms-related cleanup: 1. Give WKFormSelectPopover and WKFormSelectPicker their own header files, making things easier to find. 2. Remove WKContentView *_view member variables from classes which also stored the view in their base classes. Sort the project file. * UIProcess/ios/forms/WKFormPopover.h: * UIProcess/ios/forms/WKFormPopover.mm: (-[WKFormRotatingAccessoryPopover accessoryDone]): (-[WKFormRotatingAccessoryPopover initWithView:]): Deleted. * UIProcess/ios/forms/WKFormSelectControl.h: * UIProcess/ios/forms/WKFormSelectControl.mm: * UIProcess/ios/forms/WKFormSelectPicker.h: Copied from Source/WebKit2/UIProcess/ios/forms/WKFormSelectControl.h. * UIProcess/ios/forms/WKFormSelectPicker.mm: * UIProcess/ios/forms/WKFormSelectPopover.h: Copied from Source/WebKit2/UIProcess/ios/forms/WKFormSelectControl.h. * UIProcess/ios/forms/WKFormSelectPopover.mm: (-[WKSelectPopover initWithView:hasGroups:]): * WebKit2.xcodeproj/project.pbxproj: 2016-08-16 Daniel Bates WKSI static library should be named by major iOS revision, not individual updates https://bugs.webkit.org/show_bug.cgi?id=160727 Reviewed by Alexey Proskuryakov. * Configurations/Base.xcconfig: * Configurations/BaseTarget.xcconfig: * Configurations/DebugRelease.xcconfig: 2016-08-16 Simon Fraser Make it possible to test iOS select elements, and add iPhone and iPad tests for them https://bugs.webkit.org/show_bug.cgi?id=160909 Reviewed by Enrica Casucci. Hook up form-related UIScriptController functions, and plumb through the various forms are misplaced https://bugs.webkit.org/show_bug.cgi?id=158810 Reviewed by Eric Carlson. AppKit made a change in Sierra that causes popup menus to snap to a different point when the system language is RTL. We need to be more explicit about what directionality we want, and override the location of the popup based on the text direction. I also made a small tweak to the fudge offsets we use in order to make button text and menu text to be more consistent. Unfortunately since this is just about the location of the popup menu, it's unable to be tested in our current infrastructure. * UIProcess/mac/WebPopupMenuProxyMac.mm: (WebKit::WebPopupMenuProxyMac::showPopupMenu): 2016-06-15 Chris Dumez Drop some unnecessary header includes https://bugs.webkit.org/show_bug.cgi?id=158788 Reviewed by Alexey Proskuryakov. Drop some unnecessary header includes in headers to speed up build time. * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm: * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm: * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: * WebProcess/Plugins/PluginView.cpp: * WebProcess/WebPage/WebPage.cpp: 2016-06-15 Romain Bellessort Enabling Shadow DOM for all platforms https://bugs.webkit.org/show_bug.cgi?id=158738 Reviewed by Ryosuke Niwa. Removed Shadow DOM from options (enabled by default) (comprises removal of corresponding preprocessor directives) * Configurations/FeatureDefines.xcconfig: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/WebPage/WebPage.cpp: 2016-06-15 Antti Koivisto Vary:Cookie validation doesn't work in private browsing https://bugs.webkit.org/show_bug.cgi?id=158616 Reviewed by Andreas Kling. * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue): Implement SessionID version of the function. * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2016-06-14 Chris Dumez Avoid constructing a AuthenticationChallenge unnecessarily in the NetworkLoad constructor https://bugs.webkit.org/show_bug.cgi?id=158746 Reviewed by Darin Adler. Avoid constructing a AuthenticationChallenge unnecessarily in the NetworkLoad constructor by using WTF::Optional<> for this data member. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace): * NetworkProcess/NetworkLoad.h: 2016-06-14 Chris Dumez Add missing WTFMove() in NetworkResourceLoader::didReceiveResponse() https://bugs.webkit.org/show_bug.cgi?id=158745 Reviewed by Darin Adler. Add missing WTFMove() in NetworkResourceLoader::didReceiveResponse() to avoid copying the ResourceResponse. * NetworkProcess/NetworkResourceLoader.cpp: 2016-06-14 Chris Dumez Reduce copying of NetworkLoadParameters https://bugs.webkit.org/show_bug.cgi?id=158744 Reviewed by Alex Christensen. Reduce copying of NetworkLoadParameters by moving it around instead. * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::startDownload): * NetworkProcess/Downloads/PendingDownload.cpp: (WebKit::PendingDownload::PendingDownload): * NetworkProcess/Downloads/PendingDownload.h: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::NetworkLoad): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::startNetworkLoad): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad): 2016-06-14 Carlos Garcia Campos [ThreadedCompositor] Opening the inspector in a window causes a crash. https://bugs.webkit.org/show_bug.cgi?id=154444 Reviewed by Žan Doberšek. The threaded compositor doesn't handle the case of changing or removing the native surface handle. When the web view is reparented, the current native surface handle is destroyed when the view is removed from the parent, and a new one is created when added to the new parent. We need to handle this case in the threaded compositor. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::stopUpdateTimer): Allow users to stop the update timer. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): Use performTaskSync because this is called from a synchronous IPC message and right after it returns, the current native surface is destroyed by the UI process. So we need to ensure we finish all pending operations for the current native surface in the compositing thread before it's destroyed. Then we enable or disable the scene depending on whether the native surface has been created or destroyed and destroy the current context in case the new handle is 0. (WebKit::ThreadedCompositor::tryEnsureGLContext): Just renamed to make it clear that it can fail. (WebKit::ThreadedCompositor::glContext): (WebKit::ThreadedCompositor::renderLayerTree): Return early if scene is not active. * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::setNativeSurfaceHandleForCompositing): Schedule a new layer flush after the native surface handle changed. 2016-06-14 Carlos Garcia Campos [Threaded Compositor] Modernize and simplify threaded compositor code https://bugs.webkit.org/show_bug.cgi?id=158615 Reviewed by Žan Doberšek. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::performTask): Use NoncopyableFunction. (WebKit::CompositingRunLoop::performTaskSync): Ditto. (WebKit::CompositingRunLoop::startUpdateTimer): Just renamed to start instead of set. (WebKit::CompositingRunLoop::run): Expose run/stop methods instead of the internal RunLoop object. (WebKit::CompositingRunLoop::stop): Also stop the update timer instead of relying on the caller to do it. (WebKit::CompositingRunLoop::setUpdateTimer): Deleted. (WebKit::CompositingRunLoop::stopUpdateTimer): Deleted. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): Protects this directly in lambda capture. (WebKit::ThreadedCompositor::setDeviceScaleFactor): Ditto. (WebKit::ThreadedCompositor::didChangeViewportSize): Ditto. (WebKit::ThreadedCompositor::didChangeViewportAttribute): Ditto. (WebKit::ThreadedCompositor::didChangeContentsSize): Ditto. (WebKit::ThreadedCompositor::scrollTo): Ditto. (WebKit::ThreadedCompositor::scrollBy): Ditto. (WebKit::ThreadedCompositor::updateViewport): Use startUpdateTimer(). (WebKit::ThreadedCompositor::scheduleDisplayImmediately): Ditto. (WebKit::ThreadedCompositor::didChangeVisibleRect): Improve lambda captures. (WebKit::ThreadedCompositor::renderLayerTree): Use m_viewportController directly. (WebKit::ThreadedCompositor::createCompositingThread): Use createThread() version that receives a function. (WebKit::ThreadedCompositor::runCompositingThread): Use run method and don't stop the update timer when the run loop finishes. (WebKit::ThreadedCompositor::terminateCompositingThread): Use stop method. (WebKit::ThreadedCompositor::ThreadedCompositor): Deleted. (WebKit::ThreadedCompositor::compositingThreadEntry): Deleted. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: (WebKit::ThreadedCompositor::viewportController): Deleted. 2016-06-14 Carlos Garcia Campos [Threaded Compositor] Flickering and rendering artifacts when resizing the web view https://bugs.webkit.org/show_bug.cgi?id=154070 Reviewed by Žan Doberšek. Resizing the web view is expected to be a sync operation, the UI process creates a new backing store state ID, sends UpdateBackingStoreState message with the flag RespondImmediately to the web process and waits up to 500ms for the reply (DidUpdateBackingStoreState message). When using the threaded compositor, we schedule a task in the compositing thread to update the viewport size, and return immediately, so that we reply to the UI process before the compositing thread has actually updated its size. There's a moment in which sizes are out of sync causing the flickering and rendering artifacts, the UI process continues rendering at the new size, while the web process is still rendering at the previous size. We can prevent this from happening just by making the resize task synchronous in the threaded compositor. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::performTaskSync): Add sync version of performTask(). * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::didChangeViewportSize): Use performTaskSync(). 2016-06-14 Carlos Garcia Campos Unreviewed. Fix Soup downloads after r201943. This is a follow up of r201943. The DownloadClient used in DownloadSoup was not updated to the new API of the ResourceHandleClient because it was not using override on the virtual methods, so it was unnoticed. That broke the downloads soup implementation, because didReceiveResponse is no longer used in the DownloadClient. This patch updates the DownloadClient to the new ResourceHandleClient API adding also override to all the virtual methods to prevent this from happening in the future. * NetworkProcess/Downloads/soup/DownloadSoup.cpp: (WebKit::Download::start): (WebKit::Download::startWithHandle): (WebKit::DownloadClient::DownloadClient): (WebKit::DownloadClient::downloadFailed): (WebKit::DownloadClient::didReceiveResponse): (WebKit::DownloadClient::didReceiveData): (WebKit::DownloadClient::didFinishLoading): (WebKit::DownloadClient::didFail): (WebKit::DownloadClient::wasBlocked): Deleted. (WebKit::DownloadClient::cannotShowURL): Deleted. (WebKit::DownloadClient::cancel): (WebKit::DownloadClient::handleResponse): 2016-06-13 Dan Bernstein [Mac] Web Content service with a restricted entitlement may load arbitrary dylibs https://bugs.webkit.org/show_bug.cgi?id=156668 Reviewed by Anders Carlsson. * Configurations/WebContentService.xcconfig: Enable library validation when the Web Content service is given the XPC domain extension entitlement when targeting macOS Sierra or later. 2016-06-13 Alex Christensen Add WebSocketProvider stub https://bugs.webkit.org/show_bug.cgi?id=158702 Reviewed by Brady Eidson. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/Network/WebSocketProvider.h: Added. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_shouldDispatchFakeMouseMoveEvents): 2016-06-10 Ada Chan Use the video element's video box when getting the inline video rect in WebVideoFullscreenManager https://bugs.webkit.org/show_bug.cgi?id=158351 Reviewed by Darin Adler. * WebProcess/cocoa/WebVideoFullscreenManager.mm: (WebKit::inlineVideoFrame): (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): (WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement): (WebKit::WebVideoFullscreenManager::fullscreenMayReturnToInline): (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced): (WebKit::clientRectForElement): Deleted. 2016-06-10 Benjamin Poulain Add support for passive event listeners on touch events https://bugs.webkit.org/show_bug.cgi?id=158601 Reviewed by Simon Fraser. * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder::encode): (ArgumentCoder::decode): (WebKit::dump): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::eventTrackingTypeForPoint): (WebKit::RemoteScrollingCoordinatorProxy::isPointInNonFastScrollableRegion): Deleted. * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::touchEventTrackingType): The type is the most restrictive type of all the touch points. If any touch point needs synchronous tracking, everything has to be synchronous. (WebKit::WebPageProxy::handleTouchEventSynchronously): This is a very unfortunate design. The upper layer dealing with UIKit knows about gesture and when something can be dispatched asynchrnously because a gesture has started. This layer knows about tracking and can use that extra inforamtion to dispatch an event asynchrnously anyway. In the future, we should refactor this to let WebPageProxy always decide of the dispatch type. I am just concerned changing the upper layer while we are stabilizing WebKit. (WebKit::WebPageProxy::handleTouchEventAsynchronously): (WebKit::WebPageProxy::handleTouchEvent): (WebKit::WebPageProxy::resetState): (WebKit::WebPageProxy::WebPageProxy): Deleted. (WebKit::WebPageProxy::shouldStartTrackingTouchEvents): Deleted. * UIProcess/WebPageProxy.h: 2016-06-10 Beth Dakin Add requestExitFullScreen to WKFullScreenWindowController https://bugs.webkit.org/show_bug.cgi?id=158633 -and corresponding- rdar://problem/26564036 Reviewed by Tim Horton. * UIProcess/mac/WKFullScreenWindowController.h: * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController requestExitFullScreen]): 2016-06-10 Alex Christensen Reduce ResourceResponse copying https://bugs.webkit.org/show_bug.cgi?id=158232 Reviewed by Darin Adler. * NetworkProcess/Downloads/PendingDownload.h: * NetworkProcess/NetworkDataTask.h: * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::continueDidReceiveResponse): (WebKit::NetworkLoad::sharedDidReceiveResponse): (WebKit::NetworkLoad::sharedWillSendRedirectedRequest): (WebKit::NetworkLoad::didReceiveChallenge): (WebKit::NetworkLoad::didReceiveResponseNetworkSession): (WebKit::NetworkLoad::didReceiveResponseAsync): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkLoadClient.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::retrieveCacheEntry): (WebKit::NetworkResourceLoader::abort): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/PingLoad.h: * NetworkProcess/cache/NetworkCacheCoders.h: (WebKit::NetworkCache::Coder>::encode): (WebKit::NetworkCache::Coder>::decode): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTask::didCompleteWithError): (WebKit::NetworkDataTask::didReceiveResponse): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::url): (WebKit::WebFrame::certificateInfo): (WebKit::WebFrame::innerText): 2016-06-09 Ryosuke Niwa Add SPI to disable spellchecking on auto-fillable text fields https://bugs.webkit.org/show_bug.cgi?id=158611 Reviewed by Anders Carlsson. Added WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled to disable spellchecking on a text field. This is used by WebKit2 client which desires to disable spellchecking and notably autocorrection on login forms, etc... where such feature would interfere with user's actions. * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp: (WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled): Added. * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h: * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::InjectedBundleNodeHandle::setHTMLInputElementSpellcheckEnabled): Added. * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h: 2016-06-10 Alex Christensen Introduce WTF::UniqueRef https://bugs.webkit.org/show_bug.cgi?id=158596 Reviewed by Brady Eidson. * WebProcess/WebPage/WebPage.cpp: (WebKit::m_shouldDispatchFakeMouseMoveEvents): 2016-06-10 Anders Carlsson Remove CommandLine class https://bugs.webkit.org/show_bug.cgi?id=158628 Reviewed by Tim Horton. * Shared/CommandLine.h: Removed. (WebKit::CommandLine::operator[]): Deleted. * Shared/posix/CommandLinePOSIX.cpp: Removed. (WebKit::CommandLine::parse): Deleted. * WebKit2.xcodeproj/project.pbxproj: 2016-06-10 Simon Fraser [iOS WK2] Rare RELEASE_ASSERT under RemoteLayerTreeDrawingArea::flushLayers() https://bugs.webkit.org/show_bug.cgi?id=158622 rdar://problem/26609452 Reviewed by Tim Horton. It's possible for a CADisplayLink to fire after being paused sometimes, possibly when an app is running another CADisplayLink whose callback takes some time. When this happens, RemoteLayerTreeDrawingAreaProxy could erroneously send a second didUpdate() to the web process between commits, which would clear the m_waitingForBackingStoreSwap flag too early, and allow a subsequent RemoteLayerTreeDrawingArea::flushLayers() to proceed when the m_pendingBackingStoreFlusher was still flushing. Fix by preventing two didUpdates from being sent from the UI process between commits. Not easily testable. * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay): 2016-06-10 Carlos Garcia Campos [Threaded Compositor] Content and viewport sizes are mixed https://bugs.webkit.org/show_bug.cgi?id=158564 Reviewed by Žan Doberšek. Make ThreadedCoordinatedLayerTreeHost::sizeDidChange() update the viewport size for consistency with all other LayerTreeHost implementations and rename viewportSizeChanged() as contentsSizeChanged() and update the contents size. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::contentsSizeChanged): Remove ifdefed code here, the drawing area is notified two lines below. * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp: (WebKit::CoordinatedDrawingArea::mainFrameContentSizeChanged): Update the viewport size to the contents size only when using a fixed layout here instead of in cross-platform code. * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::contentsSizeChanged): (WebKit::ThreadedCoordinatedLayerTreeHost::sizeDidChange): (WebKit::ThreadedCoordinatedLayerTreeHost::viewportSizeChanged): Deleted. * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::mainFrameContentSizeChanged): Call LayerTreeHost::contentsSizeChanged(). (WebKit::DrawingAreaImpl::updateBackingStoreState): Remove ifdefed code for the threadecd compositor since it's now consistent with all other LayerTreeHost implementations. * WebProcess/WebPage/LayerTreeHost.h: 2016-06-10 Carlos Garcia Campos [Threaded Compositor] Make it clear that compositing thread operations are always scheduled from the main thread https://bugs.webkit.org/show_bug.cgi?id=158562 Reviewed by Žan Doberšek. The code is written as if the compositor thread could also call callOnCompositingRunLoop() which makes the code confusing. This patch no longer checks if the task was scheduled in the compositing thread, and instead it adds an ASSERT to ensure it's always called from the main thread as expected. It also adds some more ASSERTS to ensure and clarify the methods are called from the expected thread. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: (WebKit::CompositingRunLoop::performTask): (WebKit::CompositingRunLoop::callOnCompositingRunLoop): Deleted. * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): (WebKit::ThreadedCompositor::setDeviceScaleFactor): (WebKit::ThreadedCompositor::didChangeViewportSize): (WebKit::ThreadedCompositor::didChangeViewportAttribute): (WebKit::ThreadedCompositor::didChangeContentsSize): (WebKit::ThreadedCompositor::scrollTo): (WebKit::ThreadedCompositor::scrollBy): (WebKit::ThreadedCompositor::glContext): (WebKit::ThreadedCompositor::didChangeVisibleRect): (WebKit::ThreadedCompositor::renderLayerTree): (WebKit::ThreadedCompositor::updateSceneState): (WebKit::ThreadedCompositor::callOnCompositingThread): Deleted. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: 2016-06-10 Carlos Garcia Campos [GTK] Browser plugins crash under Wayland https://bugs.webkit.org/show_bug.cgi?id=157605 Reviewed by Michael Catanzaro. Fail the initialization of windowed plugins if we don't have a platform implementation. * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp: (WebKit::NetscapePlugin::platformPostInitialize): 2016-06-09 Antoine Quint [iOS] -webkit-overflow-scrolling: touch; ignores pointer-events: none; https://bugs.webkit.org/show_bug.cgi?id=119839 Reviewed by Simon Fraser. Propagate a "userInteractionEnabled" flag from the Web process which is used to turn off user interaction on a UIScrollView created for -webkit-overflow-scrolling: touch. * Shared/mac/RemoteLayerTreePropertyApplier.mm: (WebKit::RemoteLayerTreePropertyApplier::applyProperties): * Shared/mac/RemoteLayerTreeTransaction.h: * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties): (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode): (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode): (WebKit::dumpChangedLayers): * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::userInteractionEnabled): (WebKit::PlatformCALayerRemote::setUserInteractionEnabled): * WebProcess/WebPage/mac/PlatformCALayerRemote.h: 2016-06-09 Anders Carlsson Remove OriginAndDatabases.cpp, it's unused https://bugs.webkit.org/show_bug.cgi?id=158595 Reviewed by Sam Weinig. * CMakeLists.txt: * Shared/OriginAndDatabases.cpp: Removed. (WebKit::OriginAndDatabases::encode): Deleted. (WebKit::OriginAndDatabases::decode): Deleted. * Shared/OriginAndDatabases.h: Removed. * WebKit2.xcodeproj/project.pbxproj: 2016-06-09 Alex Christensen Clean up EditorClient lifetime https://bugs.webkit.org/show_bug.cgi?id=158588 Reviewed by Anders Carlsson. * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::generateTextCheckingRequestID): (WebKit::WebEditorClient::shouldDeleteRange): (WebKit::WebEditorClient::pageDestroyed): Deleted. * WebProcess/WebCoreSupport/WebEditorClient.h: (WebKit::WebEditorClient::WebEditorClient): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_shouldDispatchFakeMouseMoveEvents): 2016-06-09 Andy Estes WKWebView does not render PDF pages in AirPrint https://bugs.webkit.org/show_bug.cgi?id=151386 rdar://problem/22499157 Reviewed by Tim Horton. _WKWebViewPrintFormatter originally attempted to handle PDFs, but the code path was never properly tested since Safari prints PDFs by setting a printingItem on the UIPrintInteractionController instead of going through a print formatter. The existing code almost worked, if it weren't for CGContextScaleCTM() scaling each page into oblivion due to _totalScaleFactor equaling 0. This patch properly implements -[_WKWebViewPrintFormatter drawInRect:forPageAtIndex:] to handle drawing both PDFs generated by WebKit and PDFs loaded in the main frame. It also takes the opportunity to clean up a number of issues in the existing code: - Handling of -[_WKWebViewPrintFormatter startPage] is now correct. I had previously assumed this property represented the first page of output to print, but it actually represents the first page in the overall print job that the print formatter renders. In other words, regardless of -startPage, the print formatter should always print all its pages. - Code specific to webpage and PDF printing was factored out into WKContentView and WKPDFView, respectively. Each conforms to @protocol(_WKWebViewPrintProvider), and _WKWebViewPrintFormatter accesses the provider via -[WKWebView _printProvider]. - Instead of piping the printed PDF data from WebPageProxy to WKWebView via PageClient, use the GenericCallback mechanism to have WebPageProxy call a lambda specified by WKContentView when the printed PDF is available. - Removed _totalScaleFactor and used CGPDFPageGetDrawingTransform() to transform both webpages and PDFs. For webpages, _totalScaleFactor will always equal the ratio of the paper width to the PDF page width, so CGPDFPageGetDrawingTransform() will apply the same scaling as CGContextScaleCTM(_totalScaleFactor, _totalScaleFactor) would. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _printProvider]): Added. Returns _currentContentView if it conforms to @protocol(_WKWebViewPrintProvider). (-[WKWebView _computePageCountAndStartDrawingToPDFForFrame:printInfo:firstPage:computedTotalScaleFactor:]): Moved code to _wk_pageCountForPrintFormatter in WKContentView and WKPDFView. (-[WKWebView _endPrinting]): Deleted. (-[WKWebView _printedDocument]): Deleted. (-[WKWebView _setPrintedDocument:]): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: Declared the _printProvider property. * UIProcess/PageClient.h: Removed didFinishDrawingPagesToPDF(). * UIProcess/WebPageProxy.h: Declared computePagesForPrintingAndDrawToPDF() and drawToPDFCallback(). * UIProcess/WebPageProxy.messages.in: Renamed DidFinishDrawingPagesToPDF to DrawToPDFCallback. * UIProcess/_WKWebViewPrintFormatter.mm: Backed the frameToPrint property with a RetainPtr ivar so that it doesn't need to be released manually in -dealloc; removed _totalScaleFactor and _printInfo ivars and added a _printedDocument ivar; removed the property declaration for webView. (-[_WKWebViewPrintFormatter frameToPrint]): Added a custom getter for the frameToPrint property. (-[_WKWebViewPrintFormatter setFrameToPrint:]): Added a custom setter for the frameToPrint property. (-[_WKWebViewPrintFormatter _webView]): Renamed from webView; added an underscore since this is a private method. (-[_WKWebViewPrintFormatter _recalcPageCount]): Retrieved the page count from the print provider and clamped its value to NSIntegerMax. (-[_WKWebViewPrintFormatter drawInRect:forPageAtIndex:]): Retrieved the printed document from the print provider if needed; modified the CTM transformations to work for both webpages and PDFs. (-[_WKWebViewPrintFormatter dealloc]): Deleted. (-[_WKWebViewPrintFormatter webView]): Renamed to _webView. (-[_WKWebViewPrintFormatter rectForPageAtIndex:]): Deleted. * UIProcess/_WKWebViewPrintFormatterInternal.h: Added. Moved a UIPrintFormatter internal method declaration to here and defined the _WKWebViewPrintProvider protocol. * UIProcess/ios/PageClientImplIOS.h: Removed didFinishDrawingPagesToPDF(). * UIProcess/ios/PageClientImplIOS.mm: Ditto. (WebKit::PageClientImpl::didFinishDrawingPagesToPDF): Deleted. * UIProcess/ios/WKContentView.mm: Conformed to @protocol(_WKWebViewPrintProvider). (-[WKContentView _wk_pageCountForPrintFormatter:]): Moved the code to compute page count from WKWebView to here. (-[WKContentView _wk_printedDocument]): Moved the code to get the printed document from WKWebView to here. * UIProcess/ios/WKPDFView.mm: (-[WKPDFView _wk_pageCountForPrintFormatter:]): Moved the code to compute the page count from WKWebView to here; added a call to CGPDFDocumentAllowsPrinting(), returning 0 if printing is not allowed. (-[WKPDFView _wk_printedDocument]): Moved the code to get the printed document from WKWebView to here. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF): Registered the callback with m_callbacks and sent Messages::WebPage::ComputePagesForPrintingAndDrawToPDF; returned the synchronously-returned page count. (WebKit::WebPageProxy::drawToPDFCallback): Added to perform the callback when drawing to PDF is complete. (WebKit::WebPageProxy::didFinishDrawingPagesToPDF): Deleted. * WebKit2.xcodeproj/project.pbxproj: Added _WKWebViewPrintFormatterInternal.h. * WebProcess/WebPage/WebPage.h: Renamed computePagesForPrintingAndStartDrawingToPDF() to computePagesForPrintingAndDrawToPDF(). * WebProcess/WebPage/WebPage.messages.in: Renamed ComputePagesForPrintingAndStartDrawingToPDF to ComputePagesForPrintingAndDrawToPDF. Removed the startPage parameter and added a callbackID. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::computePagesForPrintingAndDrawToPDF): Renamed from computePagesForPrintingAndStartDrawingToPDF(). Added a call to endPrinting() after sending Messages::WebPageProxy::DrawToPDFCallback. (WebKit::WebPage::computePagesForPrintingAndStartDrawingToPDF): Renamed to computePagesForPrintingAndDrawToPDF. 2016-06-09 Alex Christensen Clean up WebSocket code https://bugs.webkit.org/show_bug.cgi?id=158551 Reviewed by Darin Adler. * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::registerFileBlobURL): * WebProcess/FileAPI/BlobRegistryProxy.h: 2016-06-09 David Kilzer Update properties for UIWKTextInteractionAssistant Reviewed by Darin Adler. * Platform/spi/ios/UIKitSPI.h: (UIWKTextInteractionAssistant.loupeGesture): (UIWKTextInteractionAssistant.singleTapGesture): Change from retain to assign since UIWKTextInteractionAssistant is not responsible for their lifetime. Sort alphabetically. 2016-06-09 Michael Saboff WebKitTestRunner and DumpRenderTree do not handle dangling surrogate characters https://bugs.webkit.org/show_bug.cgi?id=154863 Reviewed by Alexey Proskuryakov. Added a non-strict verions of WKStringGetUTF8CString() that will handle dangling surrogates called WKStringGetUTF8CStringNonStrict(). * Shared/API/c/WKString.cpp: (WKStringGetUTF8CStringImpl): (WKStringGetUTF8CString): (WKStringGetUTF8CStringNonStrict): * Shared/API/c/WKString.h: 2016-06-09 Carlos Garcia Campos [Threaded Compositor] Many layout tests crash when threaded compositor is enabled https://bugs.webkit.org/show_bug.cgi?id=158560 Reviewed by Žan Doberšek. This is because CoordinatedGraphicsLayer::notifyFlushRequired() assumes it has a valid compositor when it's called. But the compositor is only present when GraphicsLayer::create() is called with a GraphicsLayerFactory. When running the layout tests, layers are created without a factory because DrawingAreaImpl is not entering AC mode as expected and the layer tree host is not created, making DrawingAreaImpl::graphicsLayerFactory() always return nullptr. This happens because DrawingAreaImpl is checking acceleratedDrawingEnabled setting to decide whether to always use compositing mode or not, and WTR sets that setting to false (changing its default value). The thing is that acceleratedDrawingEnabled setting doesn't have any effect in non-Mac ports, what we really want to check there is whether acceleratedCompositingEnabled is true or false. * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::updatePreferences): 2016-06-09 Carlos Garcia Campos [Threaded Compositor] Remove ThreadedCompositor::setNeedsDisplay() https://bugs.webkit.org/show_bug.cgi?id=158523 Reviewed by Michael Catanzaro. ThreadedCompositor::setNeedsDisplay() is always called from the main thread and schedules a task to the compositing thread to schedule an immediate update. But RunLoop::Timer is thread-safe so we don't really need to schedule a task to the update the timer in the compositing thread, we can do that directly in the main thread. And that's exactly what scheduleDisplayImmediately() does, so we can use it instead of setNeedsDisplay(). * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::setNeedsDisplay(): Deleted. (WebKit::ThreadedCompositor::updateSceneState): * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: 2016-06-08 Antti Koivisto Increase disk cache capacity when there is lots of free space https://bugs.webkit.org/show_bug.cgi?id=158526 Reviewed by Chris Dumez. Our maximum disk cache capacity has been 175MB for a very long time. Meanwhile the average resource size has grown massively. 175MB is now enough for cacheable resources of a few dozen sites at most. Using bigger caches when there is room for it can reduce network traffic, reduce disk writes, save battery and speed up page loading. This patch changes cache size for PrimaryWebBrowser cache model >=16GB free: 175MB -> 500MB 8-16GB free: 150MB -> 250MB and modestly for DocumentBrowser >=16GB free: 50MB -> 75MB Note that if system (on Cocoa platforms) really needs disk space it will wipe out caches so this doesn't reduce available disk space in scenarios like software installation. * Shared/CacheModel.cpp: (WebKit::calculateCacheSizes): 2016-06-08 Youenn Fablet Introduce ResourceErrorBase::type https://bugs.webkit.org/show_bug.cgi?id=158299 Reviewed by Alex Christensen. * Shared/soup/WebCoreArgumentCodersSoup.cpp: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): 2016-06-08 Beth Dakin _web_didAddMediaControlsManager should take a controlsManager as a parameter https://bugs.webkit.org/show_bug.cgi?id=158545 Reviewed by Tim Horton. * UIProcess/Cocoa/WebViewImpl.h: 2016-06-06 Antti Koivisto WebKit memory cache doesn't respect Vary header https://bugs.webkit.org/show_bug.cgi?id=71509 Reviewed by Sam Weinig. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::makeCacheKey): (WebKit::NetworkCache::cachePolicyAllowsExpired): (WebKit::NetworkCache::makeUseDecision): (WebKit::NetworkCache::Cache::retrieve): (WebKit::NetworkCache::Cache::store): (WebKit::NetworkCache::Cache::storeRedirect): (WebKit::NetworkCache::Cache::update): (WebKit::NetworkCache::headerValueForVary): Deleted. (WebKit::NetworkCache::collectVaryingRequestHeaders): Deleted. (WebKit::NetworkCache::verifyVaryingRequestHeaders): Deleted. These move to WebCore. 2016-06-08 Carlos Garcia Campos Unreviewed. Fix GTK+ build with threaded compositor enabled after r201802. * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::create): 2016-06-08 Carlos Garcia Campos LayerTreeHost should be created with a WebPage reference instead of a pointer https://bugs.webkit.org/show_bug.cgi?id=158520 Reviewed by Žan Doberšek. We are indeed creating the LayerTreeHost always from a WebPage reference but getting its address to pass it to the LayerTreeHost create() function. * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp: (WebKit::CoordinatedDrawingArea::enterAcceleratedCompositingMode): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::create): (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost): (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer): (WebKit::CoordinatedLayerTreeHost::performScheduledLayerFlush): (WebKit::CoordinatedLayerTreeHost::commitSceneState): (WebKit::CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::create): (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): (WebKit::ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged): (WebKit::ThreadedCoordinatedLayerTreeHost::compositorDidFlushLayers): (WebKit::ThreadedCoordinatedLayerTreeHost::didScaleFactorChanged): (WebKit::ThreadedCoordinatedLayerTreeHost::setVisibleContentsRect): * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode): * WebProcess/WebPage/LayerTreeHost.cpp: (WebKit::LayerTreeHost::create): (WebKit::LayerTreeHost::LayerTreeHost): * WebProcess/WebPage/LayerTreeHost.h: * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: (WebKit::LayerTreeHostGtk::create): (WebKit::LayerTreeHostGtk::LayerTreeHostGtk): (WebKit::LayerTreeHostGtk::makeContextCurrent): (WebKit::LayerTreeHostGtk::deviceOrPageScaleFactorChanged): (WebKit::LayerTreeHostGtk::paintContents): (WebKit::LayerTreeHostGtk::deviceScaleFactor): (WebKit::LayerTreeHostGtk::pageScaleFactor): (WebKit::LayerTreeHostGtk::flushPendingLayerChanges): (WebKit::LayerTreeHostGtk::flushAndRenderLayers): (WebKit::LayerTreeHostGtk::pageBackgroundTransparencyChanged): (WebKit::LayerTreeHostGtk::initialize): Deleted. * WebProcess/WebPage/gtk/LayerTreeHostGtk.h: 2016-06-07 Sam Weinig Fix 10.10 build. * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: (WebKit::addAnimationToLayer): 2016-06-06 Alex Christensen Modernize loading code https://bugs.webkit.org/show_bug.cgi?id=158332 Reviewed by Darin Adler. * NetworkProcess/Downloads/PendingDownload.h: * NetworkProcess/NetworkDataTask.h: (WebKit::NetworkDataTask::client): * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::didReceiveResponseNetworkSession): (WebKit::NetworkLoad::didReceiveData): (WebKit::NetworkLoad::didReceiveBuffer): * NetworkProcess/NetworkLoad.h: * NetworkProcess/NetworkLoadClient.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didReceiveBuffer): (WebKit::NetworkResourceLoader::didFinishLoading): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/PingLoad.h: * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::didReceiveBuffer): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTask::didReceiveResponse): (WebKit::NetworkDataTask::didReceiveData): * Shared/WebHitTestResultData.cpp: * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveResource): 2016-06-05 Sam Weinig Add experimental support for spring based CSS animations https://bugs.webkit.org/show_bug.cgi?id=158403 Reviewed by Dean Jackson. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): * Shared/WebCoreArgumentCoders.h: * Shared/WebPreferencesDefinitions.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: (WebKit::PlatformCAAnimationRemote::Properties::encode): (WebKit::PlatformCAAnimationRemote::Properties::decode): (WebKit::addAnimationToLayer): Pipe through support for the Spring animation. 2016-06-07 Michael Catanzaro [GTK] Hide GTK+ 2 plugins if GTK+ 2 plugin process was built but is not installed https://bugs.webkit.org/show_bug.cgi?id=158419 Reviewed by Carlos Garcia Campos. Patch by Alberto Garcia * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp: (WebKit::PluginInfoStore::getPluginInfo): * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp: (WebKit::PluginProcessProxy::scanPlugin): 2016-06-06 Antoine Quint Position of WebGL on iOS is incorrect with CSS borders https://bugs.webkit.org/show_bug.cgi?id=156790 Reviewed by Simon Fraser. WebGL layers on iOS are hosted by a WKRemoteView, which applies a transform scaling its content by the inverse of the device pixel ratio, which affects how positions are applied to the WebGL layer. The container layer of the layer hosted by a WKRemoteView then has an inverse transform applied to it in the PlatformCALayerRemoteCustom constructor. However, the position of a CALayer is not affected by its transform. The fix for should be specific to video, so we only apply the scaling in the case of a LayerTypeAVPlayerLayer. * UIProcess/ios/RemoteLayerTreeHostIOS.mm: (-[WKRemoteView initWithFrame:contextID:]): (WebKit::RemoteLayerTreeHost::createLayer): (-[WKRemoteView initWithFrame:contextID:hostingDeviceScaleFactor:]): Deleted. * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm: (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom): 2016-06-06 Brady Eidson Fix build after r201717 Unreviewed. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles): * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::grantSandboxExtensionsToDatabaseProcessForBlobs): * NetworkProcess/NetworkProcess.h: 2016-06-06 Brady Eidson Modern IDB: Crash seen in IDBConnectionProxy::putOrAdd on GuardMalloc bot https://bugs.webkit.org/show_bug.cgi?id=158124 Reviewed by Darin Adler. * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles): * NetworkProcess/FileAPI/NetworkBlobRegistry.h: * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles): * WebProcess/FileAPI/BlobRegistryProxy.h: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didClose): (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles): * WebProcess/Network/NetworkProcessConnection.h: 2016-06-06 Commit Queue Unreviewed, rolling out r201706. https://bugs.webkit.org/show_bug.cgi?id=158427 This change broke the Yosemite build and its LayoutTest is failing on Mac and iOS testers (Requested by ryanhaddad on #webkit). Reverted changeset: "Add experimental support for spring based CSS animations" https://bugs.webkit.org/show_bug.cgi?id=158403 http://trac.webkit.org/changeset/201706 2016-06-06 Alex Christensen Reduce ResourceRequest copying in loading code https://bugs.webkit.org/show_bug.cgi?id=158251 Reviewed by Darin Adler. * NetworkProcess/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace): (WebKit::DownloadManager::continueWillSendRequest): (WebKit::DownloadManager::willDecidePendingDownloadDestination): * NetworkProcess/Downloads/DownloadManager.h: * NetworkProcess/Downloads/PendingDownload.cpp: (WebKit::PendingDownload::PendingDownload): (WebKit::PendingDownload::willSendRedirectedRequest): (WebKit::PendingDownload::continueWillSendRequest): (WebKit::PendingDownload::canAuthenticateAgainstProtectionSpaceAsync): * NetworkProcess/Downloads/PendingDownload.h: * NetworkProcess/NetworkDataTask.h: (WebKit::NetworkDataTask::firstRequest): * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::cancel): (WebKit::NetworkLoad::continueWillSendRequest): (WebKit::NetworkLoad::sharedDidReceiveResponse): (WebKit::NetworkLoad::sharedWillSendRedirectedRequest): (WebKit::NetworkLoad::setPendingDownload): (WebKit::NetworkLoad::willPerformHTTPRedirection): (WebKit::NetworkLoad::didReceiveChallenge): (WebKit::NetworkLoad::didFail): (WebKit::NetworkLoad::willSendRequestAsync): * NetworkProcess/NetworkLoad.h: (WebKit::NetworkLoad::currentRequest): (WebKit::NetworkLoad::clearCurrentRequest): (WebKit::NetworkLoad::pendingDownloadID): * NetworkProcess/NetworkLoadClient.h: * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace): (WebKit::NetworkProcess::continueWillSendRequest): (WebKit::NetworkProcess::pendingDownloadCanceled): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didFailLoading): (WebKit::NetworkResourceLoader::willSendRedirectedRequest): (WebKit::NetworkResourceLoader::continueWillSendRequest): (WebKit::NetworkResourceLoader::continueDidReceiveResponse): * NetworkProcess/NetworkResourceLoader.h: * NetworkProcess/PingLoad.h: (WebKit::PingLoad::PingLoad): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::~SpeculativeLoad): (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTask::didBecomeDownload): (WebKit::NetworkDataTask::willPerformHTTPRedirection): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::detachFromCoreLoader): (WebKit::WebResourceLoader::willSendRequest): * WebProcess/Network/WebResourceLoader.h: 2016-06-05 Sam Weinig Add experimental support for spring based CSS animations https://bugs.webkit.org/show_bug.cgi?id=158403 Reviewed by Dean Jackson. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): * Shared/WebCoreArgumentCoders.h: * Shared/WebPreferencesDefinitions.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: (WebKit::PlatformCAAnimationRemote::Properties::encode): (WebKit::PlatformCAAnimationRemote::Properties::decode): (WebKit::addAnimationToLayer): Pipe through support for the Spring animation. 2016-06-05 Yusuke Suzuki Change ProxyObject.[[Get]] not to use custom accessor https://bugs.webkit.org/show_bug.cgi?id=157080 Reviewed by Darin Adler. * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::propertyGetter): (WebKit::JSNPObject::methodGetter): * WebProcess/Plugins/Netscape/JSNPObject.h: 2016-06-05 Brady Eidson Unreviewed, rolling out r201694. 201693 Reverted changeset: "Fix the build after r201693." https://bugs.webkit.org/show_bug.cgi?id=158394 http://trac.webkit.org/changeset/201694 2016-06-05 Brady Eidson Fix the build after r201693. https://bugs.webkit.org/show_bug.cgi?id=158394 Reviewed by NOBODY (Build fix). r201693 landed without the Source/WebKit2 changes, and I didn't have EWS/CQ available to check myself. *sigh* * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles): * NetworkProcess/FileAPI/NetworkBlobRegistry.h: * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles): * WebProcess/FileAPI/BlobRegistryProxy.h: * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didClose): (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles): * WebProcess/Network/NetworkProcessConnection.h: 2016-06-03 Commit Queue Unreviewed, rolling out r201663. https://bugs.webkit.org/show_bug.cgi?id=158374 Broke the Windows build (Requested by andersca on #webkit). Reverted changeset: "Rename NoncopyableFunction to Function" https://bugs.webkit.org/show_bug.cgi?id=158354 http://trac.webkit.org/changeset/201663 2016-06-03 Anders Carlsson Rename NoncopyableFunction to Function https://bugs.webkit.org/show_bug.cgi?id=158354 Reviewed by Chris Dumez. * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::clearDiskCacheEntries): * NetworkProcess/NetworkProcess.h: * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::traverse): * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: (WebKit::NetworkCache::runTaskInQueue): * NetworkProcess/cache/NetworkCacheStorage.h: 2016-06-03 Chris Dumez Unreviewed, roll out r196633 as it broke PageCache on iOS for WebKit.org * WebProcess/WebPage/VisitedLinkTableController.cpp: (WebKit::VisitedLinkTableController::setVisitedLinkTable): (WebKit::VisitedLinkTableController::visitedLinkStateChanged): (WebKit::VisitedLinkTableController::allVisitedLinkStateChanged): (WebKit::VisitedLinkTableController::removeAllVisitedLinks): 2016-06-03 Csaba Osztrogonác Fix the !ENABLE(INDEXED_DATABASE) build after r201575 https://bugs.webkit.org/show_bug.cgi?id=158346 Reviewed by Brady Eidson. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::fetchWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): 2016-06-02 Chris Dumez Crash under WebProcess::registerWithStateDumper() https://bugs.webkit.org/show_bug.cgi?id=158304 Reviewed by Anders Carlsson. The issue is that the block in registerWithStateDumper() was executed in a background thread and is iterating over m_pageMap HashMap. The crash occurs when a page gets removed from the m_pageMap HashMap while the block is iterating over this same HashMap in another thread. The solution proposed is to execute the registerWithStateDumper()'s block in the main thread. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::registerWithStateDumper): 2016-06-02 Brady Eidson Overhaul cross-thread use of ResourceRequest, ResourceResponse, and ResourceError. https://bugs.webkit.org/show_bug.cgi?id=158293 Reviewed by Darin Adler. * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::Entry): 2016-06-02 Chris Dumez Modernize various lambda captures https://bugs.webkit.org/show_bug.cgi?id=158292 Reviewed by Brady Eidson. Modernize various lambda captures, especially the ones unnecessarily allocating objects on the heap and destroying them in the lambda. * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::clearDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): Deleted. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::traverse): * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::TraverseOperation::TraverseOperation): * NetworkProcess/cache/NetworkCacheStorage.h: 2016-06-02 Chris Dumez Speculative revalidated request returns 200 instead of 304 https://bugs.webkit.org/show_bug.cgi?id=158256 Reviewed by Antti Koivisto and Carlos Garcia Campos. Already conditional requests coming from WebCore should bypass the SpeculativeLoadManager. This is because the validation is requested by WebCore (usually the memory cache) and not our network cache. As a result, we need to pipe the revalidation response (e.g. 304 status code) back to WebCore instead of resolving it as disk cache level. This should fix the /webkit2/WebKitWebResource/response unit test. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::retrieve): * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::requestsHeadersMatch): 2016-06-02 Youenn Fablet Use more references in ResourceLoader related code https://bugs.webkit.org/show_bug.cgi?id=158222 Reviewed by Darin Adler. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::loadResource): (WebKit::WebLoaderStrategy::schedulePluginStreamLoad): (WebKit::WebLoaderStrategy::scheduleLoad): (WebKit::WebLoaderStrategy::scheduleInternallyFailedLoad): (WebKit::WebLoaderStrategy::startLocalLoad): (WebKit::WebLoaderStrategy::networkProcessCrashed): * WebProcess/Network/WebLoaderStrategy.h: * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::create): (WebKit::WebResourceLoader::WebResourceLoader): * WebProcess/Network/WebResourceLoader.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::Stream::start): 2016-06-01 Yongjun Zhang Notify client immediately if network session doesn't exist for a synchronous XHR load. https://bugs.webkit.org/show_bug.cgi?id=158239 Reviewed by Brady Eidson. For a synchronous XHR load, if the network session doesn't exist, we should notify NetworkLoadClient. Otherwise the Web process could hang when waiting for the synchronous load to finish. * NetworkProcess/NetworkLoad.cpp: (WebKit::NetworkLoad::NetworkLoad): 2016-05-31 Brian Burg REGRESSION(r191907): Can't enter combining diacritic marks in Web Inspector fields https://bugs.webkit.org/show_bug.cgi?id=158227 Reviewed by Darin Adler and Alexey Proskuryakov. Web Inspector uses a WKWebView subclass for the inspector frontend interface. Since r191907, WKWebView does not have an inner WKView, and instead shares a WebViewImpl to implement the same methods as WKView. So, WKView is no longer involved at all when delivering keystrokes to the Web Inspector interface. This caused a subtle regression where some keystrokes were not being interpreted in the same way by AppKit because WKWebView does not conform to NSTextInputClient but WKView does. AppKit won't automatically create a NSTextInputContext for a NSView unless the subclass is declared as conforming to NSTextInputClient. Thus, the keystroke never goes through NSTextInputContext machinery which converts the keystroke into a combining diacritic character. This regression is covered by a new API test. * UIProcess/API/Cocoa/WKWebView.mm: mark WKWebView as conforming to NSTextInputClient. 2016-06-01 Dan Bernstein Try to fix ENABLE(IOS_TOUCH_EVENTS) builds. * WebProcess/WebPage/EventDispatcher.cpp: (WebKit::EventDispatcher::touchEvent): 2016-05-31 Darin Adler Audit RenderObject casts and fix problems and style issues found https://bugs.webkit.org/show_bug.cgi?id=158221 Reviewed by Chris Dumez. * Shared/WebRenderObject.cpp: (WebKit::WebRenderObject::WebRenderObject): Tightened up the code that builds the tree of objects; fewer local variables. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::invalidateRect): Cast to RenderEmbeddedObject since that is the class used for plug-ins. (WebKit::PluginView::pluginProcessCrashed): Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::createPlugin): Ditto. (WebKit::WebPage::plugInIsPrimarySize): Check the renderer for null here. Did not change this to RenderEmbeddedObject, though, because I wasn't absolute certain this is only called with that type of renderer. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::rangeForWebSelectionAtPosition): Tweaked. 2016-06-01 Brady Eidson Modernize lambda usage for all callers of RunLoop::dispatch() (take 2). https://bugs.webkit.org/show_bug.cgi?id=158277 Reviewed by Chris Dumez. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::deleteDumpFile): * Platform/IPC/Connection.cpp: (IPC::Connection::addWorkQueueMessageReceiver): (IPC::Connection::removeWorkQueueMessageReceiver): (IPC::Connection::invalidate): (IPC::Connection::sendMessage): (IPC::Connection::processIncomingMessage): (IPC::Connection::postConnectionDidCloseOnConnectionWorkQueue): * UIProcess/Storage/LocalStorageDatabaseTracker.cpp: (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker): * UIProcess/Storage/StorageManager.cpp: (WebKit::StorageManager::createSessionStorageNamespace): (WebKit::StorageManager::destroySessionStorageNamespace): (WebKit::StorageManager::setAllowedSessionStorageNamespaceConnection): (WebKit::StorageManager::cloneSessionStorageNamespace): (WebKit::StorageManager::processDidCloseConnection): * UIProcess/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchData): (WebKit::WebsiteDataStore::removeData): 2016-06-01 Chris Dumez [iOS] Regression(r200972): Crash under WebKit::WebPage::selectTextWithGranularityAtPoint() https://bugs.webkit.org/show_bug.cgi?id=158284 Reviewed by Ryosuke Niwa. range can be null but r200972 started dereferencing it without null check. This patch adds a null check for range and uses the pre-r200972 code path if range is null. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::selectTextWithGranularityAtPoint): 2016-06-01 Brady Eidson Modernize lambda usage for all callers of RunLoop::dispatch(). https://bugs.webkit.org/show_bug.cgi?id=158265 Reviewed by Chris Dumez. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::fetchWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::remove): (WebKit::NetworkCache::retrieveFromMemory): * Platform/IPC/Connection.cpp: (IPC::Connection::SyncMessageState::processIncomingMessage): (IPC::Connection::processIncomingMessage): (IPC::Connection::connectionDidClose): (IPC::Connection::enqueueIncomingMessage): * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::receiveSourceEventHandler): * Shared/mac/CookieStorageShim.mm: (-[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:]): * UIProcess/API/APIUserContentExtensionStore.cpp: (API::UserContentExtensionStore::lookupContentExtension): (API::UserContentExtensionStore::compileContentExtension): (API::UserContentExtensionStore::removeContentExtension): * UIProcess/Launcher/ProcessLauncher.cpp: (WebKit::ProcessLauncher::ProcessLauncher): * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::connectToService): * UIProcess/Storage/StorageManager.cpp: (WebKit::StorageManager::getSessionStorageOrigins): (WebKit::StorageManager::deleteSessionStorageOrigins): (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins): (WebKit::StorageManager::getLocalStorageOrigins): (WebKit::StorageManager::getLocalStorageOriginDetails): (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin): (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince): (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::isWebProcessResponsive): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::isResponsive): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchData): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::pluginThreadAsyncCall): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::unprotectPluginFromDestruction): * WebProcess/WebPage/EventDispatcher.cpp: (WebKit::EventDispatcher::wheelEvent): (WebKit::EventDispatcher::gestureEvent): (WebKit::EventDispatcher::touchEvent): * WebProcess/WebPage/ViewUpdateDispatcher.cpp: (WebKit::ViewUpdateDispatcher::visibleContentRectUpdate): 2016-05-31 Yusuke Suzuki Unreviewed, roll out r201481, r201523: 0.3% regression in Octane code-load https://bugs.webkit.org/show_bug.cgi?id=158249 * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2016-05-31 Beth Dakin Add two optional items to WebViewImplDelegate https://bugs.webkit.org/show_bug.cgi?id=158242 -and corresponding- rdar://problem/26473095 Reviewed by Tim Horton. * UIProcess/Cocoa/WebViewImpl.h: 2016-05-31 Jer Noble REGRESSION (r201405): trailers.apple.com HUD is missing in fullscreen https://bugs.webkit.org/show_bug.cgi?id=158156 Reviewed by Darin Adler. Only increase the frame of the webView (to account for top content inset) in one dimension. * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController enterFullScreen:]): 2016-05-31 Chris Dumez [iOS] Better deal with WebProcess suspension due to screen locking https://bugs.webkit.org/show_bug.cgi?id=158229 Reviewed by Tim Horton. When locking the screen while MobileSafari is front-most, we would try keep trying to mark IOSurfaces as volatile until the 30 seconds timeout was reached. This patch deals more cleanly with this situation by only trying to mark IOSurfaces as volatile once if the suspension is due to screen locking. In such case, it is apparently expected that some IOSurfaces cannot be marked as volatile so it is enough to try once and let ourselves get suspended. This patch also reduces the timeout from 30 seconds to ~3 seconds in the other suspension cases (e.g. homing out of MobileSafari). If we fail to mark them as purgeable for 3 seconds for a reason or another, it is no use in retrying, it is simply not going to happen and there is no reason to delay process suspension any further. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::callVolatilityCompletionHandlers): (WebKit::WebPage::layerVolatilityTimerFired): (WebKit::WebPage::markLayersVolatileImmediatelyIfPossible): (WebKit::WebPage::markLayersVolatile): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::markLayersVolatile): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::applicationDidEnterBackground): (WebKit::WebPage::applicationWillEnterForeground): 2016-05-31 Brady Eidson Make createCrossThreadTask() functions return on the stack instead of the heap. https://bugs.webkit.org/show_bug.cgi?id=158215 Reviewed by Darin Adler. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::postDatabaseTask): (WebKit::DatabaseProcess::performNextDatabaseTask): (WebKit::DatabaseProcess::fetchWebsiteData): * DatabaseProcess/DatabaseProcess.h: 2016-05-31 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.13.1 release. * gtk/NEWS: Add release notes for 2.13.1. 2016-05-31 Carlos Garcia Campos Unreviewed. Fix GTK+ clean build after r201504. * DatabaseProcess/DatabaseProcess.cpp: Add missing include. 2016-05-30 Brady Eidson Move CrossThreadCopier/CrossThreadTask to WTF. https://bugs.webkit.org/show_bug.cgi?id=158207 Reviewed by Alex Christensen. * CMakeLists.txt: * WebKit2.xcodeproj/project.pbxproj: * DatabaseProcess/DatabaseProcess.cpp: * DatabaseProcess/DatabaseProcess.h: * Shared/WebCrossThreadCopier.cpp: Removed. * Shared/WebCrossThreadCopier.h: Removed. 2016-05-28 Chris Dumez Templatize NoncopyableFunction class similarly to std::function https://bugs.webkit.org/show_bug.cgi?id=158185 Reviewed by Darin Adler. Templatize NoncopyableFunction class similarly to std::function, so that it can be used as a std::function replacement in more places. Previously, NoncopyableFunction could only support "void()" lambdas. * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: (WebKit::NetworkCache::runTaskInQueue): 2016-05-28 Alexey Proskuryakov Fix the build with newer clang and other custom configuration options https://bugs.webkit.org/show_bug.cgi?id=158161 Reviewed by Dan Bernstein. * NetworkProcess/ios/NetworkProcessIOS.mm: -setAllowsSpecificHTTPSCertificate:forHost: is now in CFNetworkSPI.h * NetworkProcess/mac/NetworkProcessMac.mm: Ditto. * Shared/mac/CookieStorageShimLibrary.cpp: (WebKit::WebKitCookieStorageShimInitialize): Use more portable std::call_once. 2016-05-28 Chris Dumez Modernize lambda captures in the network disk cache implementation https://bugs.webkit.org/show_bug.cgi?id=158179 Reviewed by Darin Adler. Modernize lambda captures in the network disk cache implementation. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::retrieve): (WebKit::NetworkCache::Cache::store): (WebKit::NetworkCache::Cache::traverse): * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: (WebKit::NetworkCache::inputStreamReadReadyCallback): (WebKit::NetworkCache::outputStreamWriteReadyCallback): * NetworkProcess/cache/NetworkCacheStatistics.cpp: (WebKit::NetworkCache::Statistics::initialize): (WebKit::NetworkCache::Statistics::shrinkIfNeeded): (WebKit::NetworkCache::Statistics::queryWasEverRequested): * NetworkProcess/cache/NetworkCacheStatistics.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::updateFileModificationTime): (WebKit::NetworkCache::Storage::clear): 2016-05-27 Caitlin Potter [JSC] implement async functions proposal https://bugs.webkit.org/show_bug.cgi?id=156147 Reviewed by Yusuke Suzuki. * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2016-05-27 Chris Dumez Improve lambda capture in NetworkCache::Storage::synchronize() https://bugs.webkit.org/show_bug.cgi?id=158176 Reviewed by Brady Eidson. Improve lambda capture in NetworkCache::Storage::synchronize(). We can now capture the std::unique_ptr<> variables directly thanks to: 1. C++14's support for initializer's in lambda captures 2. RunLoop::dispatch() now takes a NoncopyableFunction in instead of a std::function, allowing us to capture non-copyable variables. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::synchronize): 2016-05-27 Jeremy Jones Decrease flicker when changing video presentation mode. https://bugs.webkit.org/show_bug.cgi?id=158148 rdar://problem/24476949 Reviewed by Tim Horton. Prevent flicker by using setVideoFullscreenLayer with a completion handler to delay enter fullscreen and cleanup fullscreen until the video layer has completely been installed or removed. * WebProcess/cocoa/WebVideoFullscreenManager.mm: (WebKit::WebVideoFullscreenManager::didSetupFullscreen): (WebKit::WebVideoFullscreenManager::didExitFullscreen): 2016-05-27 Chris Dumez WorkQueue::dispatch() / RunLoop::dispatch() should not copy captured lambda variables https://bugs.webkit.org/show_bug.cgi?id=158111 Reviewed by Darin Adler. WorkQueue::dispatch() / RunLoop::dispatch() should not copy captured lambda variables. These are often used cross-thread and copying the captured lambda variables can be dangerous (e.g. we do not want to copy a String after calling isolatedCopy() upon capture). * NetworkProcess/NetworkProcess.cpp: (WebKit::clearDiskCacheEntries): * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::clear): * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: (WebKit::NetworkCache::runTaskInQueue): * Platform/IPC/Connection.cpp: (IPC::Connection::processIncomingMessage): * UIProcess/Storage/StorageManager.cpp: (WebKit::StorageManager::getSessionStorageOrigins): (WebKit::StorageManager::deleteSessionStorageOrigins): (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins): (WebKit::StorageManager::getLocalStorageOrigins): (WebKit::StorageManager::getLocalStorageOriginDetails): (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince): (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins): * UIProcess/Storage/StorageManager.h: 2016-05-27 Alex Christensen Expose content extension failure error codes in SPI https://bugs.webkit.org/show_bug.cgi?id=158095 rdar://problem/26475651 Reviewed by Anders Carlsson. * UIProcess/API/APIUserContentExtensionStore.cpp: (API::UserContentExtensionStore::synchronousRemoveAllContentExtensions): (API::UserContentExtensionStore::invalidateContentExtensionVersion): Added for testing. (API::userContentExtensionStoreErrorCategory): * UIProcess/API/APIUserContentExtensionStore.h: * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h: Added the new enum, _WKUserContentExtensionStoreErrorCode. * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm: (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]): Sometimes the error code returned by UserContentExtensionStore::compileContentExtension has the error code from compileRuleList. When this happens, we want to get the message from the internal compiler error, but we want the NSError's code to always be CompileFailed. (-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]): (-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]): (-[_WKUserContentExtensionStore _removeAllContentExtensions]): (-[_WKUserContentExtensionStore _invalidateContentExtensionVersionForIdentifier:]): * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h: Added new invalidator for testing. 2016-05-27 Zalan Bujtas Regression(r200972): Webcore::Range::collectSelectionsRects() asserts in startContainer() while selecting text. https://bugs.webkit.org/show_bug.cgi?id=158155 Reviewed by Chris Dumez. This patch ensures that we still have a valid paragraphRange after returning from enclosingTextUnitOfGranularity(). * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::selectTextWithGranularityAtPoint): 2016-05-26 Brady Eidson Certain NetworkResourceLoader callbacks can deref a null m_networkLoad. https://bugs.webkit.org/show_bug.cgi?id=158134 Reviewed by Alex Christensen. It's legit for m_networkLoad to be null in these callbacks. We need null checks, just like we have in many other callbacks in this class. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::continueWillSendRequest): (WebKit::NetworkResourceLoader::continueCanAuthenticateAgainstProtectionSpace): 2016-05-26 Darin Adler Media queries and platform screen modernization and streamlining https://bugs.webkit.org/show_bug.cgi?id=158067 Reviewed by Alex Christensen. * Shared/mac/WebEventFactory.mm: (WebKit::screenForWindow): Deleted. (WebKit::flipScreenPoint): Deleted. (WebKit::globalPoint): Deleted. (WebKit::globalPointForEvent): Use globalPoint function from WebCore so we don't need copies of everything in here. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::windowDidChangeScreen): Removed unneeded type cast. (WebKit::WebViewImpl::draggedImage): Added type cast since globalPoint now returns an NSPoint rather than an IntPoint. * UIProcess/WebPageProxy.h: Use pragma once. Add a WebCore prefix to a use of PlatformDisplayID, since that is now inside the WebCore namespace. * WebProcess/WebCoreSupport/WebChromeClient.h: Ditto. * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.h: Ditto. * WebProcess/WebPage/DrawingArea.h: Ditto. * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: Ditto. 2016-05-26 Gyuyoung Kim Purge PassRefPtr in Modules/battery https://bugs.webkit.org/show_bug.cgi?id=157062 Reviewed by Darin Adler. Use RefPtr<>& to reduce uses of PassRefPtr in WebKit. * WebProcess/Battery/WebBatteryManager.cpp: (WebKit::WebBatteryManager::didChangeBatteryStatus): (WebKit::WebBatteryManager::updateBatteryStatus): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_shouldDispatchFakeMouseMoveEvents): 2016-05-26 Myles C. Maxfield Build fix Rubber stamped by Lucas Forschler. * Configurations/DebugRelease.xcconfig: 2016-05-25 Jer Noble Flashiness and jumpiness when entering fullscreen https://bugs.webkit.org/show_bug.cgi?id=158087 Reviewed by Beth Dakin. Multiple independant sources of jumpiness and flashiness are addressed here: - Setting the top content inset on the WKView cause a vertical jump during fullscreen transition. Instead of setting the content inset to 0, take the existing inset into account when placing the WKView in the NSWindow. - The enter fullscreen transition causes a white flash due to the NSWindow needing display before ordering onscreen. Ensure the window has a backing by calling -displayIfNeeded before entering fullscreen mode. - The exit fullscreen transition causes a white background color flash for an unknown reason, but is solved by not making the window's content view layer-backed. Rather than directly animating the contentView's background color, create a specific background view and animate it's background color instead. * UIProcess/mac/WKFullScreenWindowController.h: * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController initWithWindow:webView:page:]): (-[WKFullScreenWindowController enterFullScreen:]): (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]): (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]): * WebProcess/FullScreen/WebFullScreenManager.cpp: (WebKit::WebFullScreenManager::saveScrollPosition): Deleted. (WebKit::WebFullScreenManager::restoreScrollPosition): Deleted. 2016-05-25 Alex Christensen Fix CMake build. * PlatformMac.cmake: 2016-05-25 Chris Dumez Simplify a few lambda captures in the network cache code https://bugs.webkit.org/show_bug.cgi?id=158076 Reviewed by Antti Koivisto. Simplify a few lambda captures in the network cache code by WTFMoving upon capture. * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::SpeculativeLoadManager::retrieve): (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage): (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry): * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h: * NetworkProcess/cache/NetworkCacheStatistics.cpp: (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache): (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest): (WebKit::NetworkCache::Statistics::recordRetrievalFailure): (WebKit::NetworkCache::Statistics::writeTimerFired): (WebKit::NetworkCache::Statistics::addHashesToDatabase): (WebKit::NetworkCache::Statistics::addStoreDecisionsToDatabase): * NetworkProcess/cache/NetworkCacheStatistics.h: 2016-05-25 Fujii Hironori [Unix] Potential buffer overrun of m_fileDescriptors in readBytesFromSocket of ConnectionUnix.cpp https://bugs.webkit.org/show_bug.cgi?id=158058 Reviewed by Carlos Garcia Campos. Memcpy does not check the boundary of m_fileDescriptors in readBytesFromSocket of ConnectionUnix.cpp. This is not a problem in normal cases, but in the case when Web process is hijacked and malicious IPC packets were sent. WTF::Vector already has two members m_capacity and m_size. There is no need to have a separate member m_fileDescriptorsSize to remember the number of remaining data. * Platform/IPC/Connection.h: Remove members m_readBufferSize and m_fileDescriptorsSize. * Platform/IPC/unix/ConnectionUnix.cpp: (IPC::Connection::platformInitialize): Removed initialization of m_readBufferSize and m_fileDescriptorsSize. Reserve initial capacity for m_readBuffer and m_fileDescriptors. (IPC::Connection::processMessage): Replace m_readBufferSize and m_fileDescriptorsSize with m_readBuffer.size() and m_fileDescriptors.size(). Use Vector::shrink() to reset the number of remaining data in the buffers. (IPC::readBytesFromSocket) : Change argument types to WTF::Vector instead of pointers and sizes. (IPC::Connection::readyReadHandler): Call new readBytesFromSocket 2016-05-25 Chris Dumez Update constructRevalidationRequest() to stop returning a unique_ptr https://bugs.webkit.org/show_bug.cgi?id=158046 Reviewed by Darin Adler. Update constructRevalidationRequest() to stop returning a unique_ptr and to return a ResourceRequest instead. There is no reason for it to return a pointer. * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::constructRevalidationRequest): (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::PreloadedEntry): (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::revalidationRequest): (WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry): (WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry): * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h: 2016-05-25 Antoine Quint Elements with backdrop-filter cannot be clipped with clip-path or mask https://bugs.webkit.org/show_bug.cgi?id=142662 Reviewed by Dean Jackson. Ensure layer clones are set up with the same shape path as their original layer. * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::updateClonedLayerProperties): 2016-05-24 Chris Dumez Simplify a couple of lambda captures in the network cache code https://bugs.webkit.org/show_bug.cgi?id=158053 Reviewed by Brady Eidson. * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry): Just capture subResourceInfo instead of allocating a new copy on the heap. There is no reason we cannot simply capture subResourceInfo here. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::clear): Use new C++14 capture with initialization to make the code a bit nicer. 2016-05-24 Conrad Shultz _WKThumbnailView should expose its snapshot size https://bugs.webkit.org/show_bug.cgi?id=158049 Reviewed by Tim Horton. * UIProcess/API/Cocoa/_WKThumbnailView.h: * UIProcess/API/Cocoa/_WKThumbnailView.mm: (-[_WKThumbnailView _didTakeSnapshot:]): Update the new snapshotSize property in a KVO-compliant manner. 2016-05-24 Ryan Haddad Unreviewed, rolling out r201349. This change caused compositing tests to assert on iOS simulator Reverted changeset: "Elements with backdrop-filter cannot be clipped with clip- path or mask" https://bugs.webkit.org/show_bug.cgi?id=142662 http://trac.webkit.org/changeset/201349 2016-05-24 Ryan Haddad Unreviewed, rolling out r201341. This change may have caused LayoutTests to crash on Mac and iOS Reverted changeset: "Use lambda capture with initializer instead of StringCapture" https://bugs.webkit.org/show_bug.cgi?id=158010 http://trac.webkit.org/changeset/201341 2016-05-24 Alex Christensen Fix null pointer dereferencing in WebViewImpl::inputContext https://bugs.webkit.org/show_bug.cgi?id=158026 rdar://problem/25994093 Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView inputContext]): this was null sometimes in WebViewImpl::inputContext. 2016-05-24 Antoine Quint Elements with backdrop-filter cannot be clipped with clip-path or mask https://bugs.webkit.org/show_bug.cgi?id=142662 Reviewed by Dean Jackson. Ensure layer clones are set up with the same shape path as their original layer. * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::updateClonedLayerProperties): 2016-05-24 Chelsea Pugh [iOS] Allow clients to override the type of an input field https://bugs.webkit.org/show_bug.cgi?id=157995 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/_WKFormInputSession.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKFormInputSession textContentType]): Getter for textContentType. (-[WKFormInputSession setTextContentType:]): Set the textContentType and reload input views. (contentTypeFromFieldName): Factor out switch statement to get text content type from autofill field name into its own function. (-[WKContentView textInputTraits]): If the client has set a text content type, set the traits' content type to that. Otherwise, set the text content type if there is one based on the assisted node information's autofill field name. If neither the form input session nor the assisted node info yields a text content type, set the text content type to nil, its default value. 2016-05-24 Chris Dumez Use lambda capture with initializer instead of StringCapture https://bugs.webkit.org/show_bug.cgi?id=158010 Reviewed by Antti Koivisto. Use lambda capture with initializer instead of StringCapture now that we support C++14. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::deleteDumpFile): * NetworkProcess/cache/NetworkCacheStatistics.cpp: (WebKit::NetworkCache::Statistics::initialize): (WebKit::NetworkCache::Statistics::shrinkIfNeeded): * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::updateFileModificationTime): (WebKit::NetworkCache::Storage::clear): * UIProcess/API/APIUserContentExtensionStore.cpp: (API::UserContentExtensionStore::lookupContentExtension): (API::UserContentExtensionStore::compileContentExtension): (API::UserContentExtensionStore::removeContentExtension): * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchData): (WebKit::WebsiteDataStore::removeData): 2016-05-24 Chris Dumez Use auto for some of our lambda function parameters https://bugs.webkit.org/show_bug.cgi?id=158001 Reviewed by Darin Adler. Use auto for some of our lambda function parameters now that we build with c++14. * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::didGetRecord): * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles): * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::clearDiskCacheEntries): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::retrieveCacheEntry): (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry): * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading): * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad): (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage): (WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry): (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry): (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry): * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::removeFromPendingWriteOperations): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]): * Shared/API/Cocoa/_WKRemoteObjectInterface.mm: (-[_WKRemoteObjectInterface debugDescription]): * UIProcess/API/C/WKApplicationCacheManager.cpp: (WKApplicationCacheManagerGetApplicationCacheOrigins): * UIProcess/API/C/WKKeyValueStorageManager.cpp: (WKKeyValueStorageManagerGetKeyValueStorageOrigins): (WKKeyValueStorageManagerGetStorageDetailsByOrigin): * UIProcess/API/C/WKResourceCacheManager.cpp: (WKResourceCacheManagerGetCacheOrigins): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]): * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::removeAllUserScripts): (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets): (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers): * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::removeAnimationForKey): 2016-05-23 Yusuke Suzuki Assertion failure for Reflect.get with Proxy and primitive value as explicit receiver https://bugs.webkit.org/show_bug.cgi?id=157080 Reviewed by Saam Barati. * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::propertyGetter): (WebKit::JSNPObject::methodGetter): * WebProcess/Plugins/Netscape/JSNPObject.h: 2016-05-23 Chris Dumez Generate bindings code for EventTarget.addEventListener() / removeEventListener() https://bugs.webkit.org/show_bug.cgi?id=157882 Reviewed by Darin Adler. Generate bindings code for EventTarget.addEventListener() / removeEventListener() instead of hardcoding them in the bindings generator. * WebProcess/Plugins/PDF/PDFPluginAnnotation.h: * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: (WebKit::PDFPluginAnnotation::attach): (WebKit::PDFPluginAnnotation::~PDFPluginAnnotation): * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm: (WebKit::PDFPluginPasswordField::~PDFPluginPasswordField): (WebKit::PDFPluginPasswordField::createAnnotationElement): * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: (WebKit::PDFPluginTextAnnotation::~PDFPluginTextAnnotation): (WebKit::PDFPluginTextAnnotation::createAnnotationElement): 2016-05-23 Beth Dakin Need SPI for clients to require a user action to get an editing controls manager https://bugs.webkit.org/show_bug.cgi?id=157992 -and corresponding- rdar://problem/26379927 Reviewed by Tim Horton. New SPI _setRequiresUserActionForEditingControlsManager. The SPI defaults to False, which means that by default there is no user action requirement to have an editing controls manager. The SPI is on WKViewPrivate and WKWebViewConfigurationPrivate, and it’s implemented in WebViewImpl. * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _requiresUserActionForEditingControlsManager]): (-[WKWebViewConfiguration _setRequiresUserActionForEditingControlsManager:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView _requiresUserActionForEditingControlsManager]): (-[WKView _setRequiresUserActionForEditingControlsManager:]): * UIProcess/Cocoa/WebViewImpl.h: (WebKit::WebViewImpl::setRequiresUserActionForEditingControlsManager): (WebKit::WebViewImpl::requiresUserActionForEditingControlsManager): New message allows the WebProcess to tell the UI process whether the current web page has had any selection changes based on user interaction. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setHasHadSelectionChangesFromUserInteraction): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::hasHadSelectionChangesFromUserInteraction): * UIProcess/WebPageProxy.messages.in: m_userIsInteracting m_hasFocusedDueToUserInteraction used to be iOS only, but now we want to track them for Mac as well. * WebProcess/WebPage/WebPage.cpp: Handling mouse events and key events will toggle m_userIsInteracting. (WebKit::WebPage::mouseEvent): (WebKit::WebPage::keyEvent): m_userIsInteracting is no longer iOS-only. (WebKit::WebPage::setInitialFocus): Send a message to the UI process on page transition to re-set hasHadSelectionChangesFromUserInteraction to false. (WebKit::WebPage::didStartPageTransition): Send a message to the UI process if this is the first selection change to happen as a result of a user action. (WebKit::WebPage::didChangeSelection): * WebProcess/WebPage/WebPage.h: 2016-05-23 Alex Christensen Add logging for NSURLSession calls https://bugs.webkit.org/show_bug.cgi?id=157996 Reviewed by Brady Eidson. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTask::NetworkDataTask): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (toNSURLSessionResponseDisposition): (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]): (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]): * Platform/Logging.h: 2016-05-23 Chris Fleizach AX: iOS: when bringing focus to a text field we may zoom the page even if author wanted max scale = 1 https://bugs.webkit.org/show_bug.cgi?id=157771 Reviewed by Tim Horton. * Shared/AssistedNodeInformation.cpp: (WebKit::AssistedNodeInformation::encode): (WebKit::AssistedNodeInformation::decode): * Shared/AssistedNodeInformation.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _displayFormNodeInputView]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getAssistedNodeInformation): 2016-05-23 Miguel Gomez [ThreadedCompositor] Ensure that the BitmapTexture used by CoordinatedBackingStoreTile matches the opacity of the painted surface https://bugs.webkit.org/show_bug.cgi?id=157942 Reviewed by Žan Doberšek. * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp: (WebKit::CoordinatedBackingStoreTile::swapBuffers): Reset the BitmapTexture if it doesn't match the opacity required by the surface that's being painted. 2016-05-22 Carlos Garcia Campos [GTK] Disk cache: enable speculative revalidation https://bugs.webkit.org/show_bug.cgi?id=157125 Reviewed by Sergio Villar Senin. * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::NetworkProcess::platformInitializeNetworkProcess): * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextConstructed): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeNetworkProcess): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): * config.h: 2016-05-22 Brady Eidson Move to C++14. https://bugs.webkit.org/show_bug.cgi?id=157948 Reviewed by Michael Catanzaro. * Configurations/Base.xcconfig: Replace time literal suffixes that have underscores to the forms without (e.g. 0_ms becomes 0ms): * NetworkProcess/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters): * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::startNetworkLoad): * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::responseHasExpired): (WebKit::NetworkCache::responseNeedsRevalidation): (WebKit::NetworkCache::makeStoreDecision): * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::responseNeedsRevalidation): * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::dispatchReadOperation): (WebKit::NetworkCache::Storage::store): (WebKit::NetworkCache::computeRecordWorth): * Shared/mac/RemoteLayerBackingStoreCollection.mm: * UIProcess/ViewGestureController.cpp: * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::maximumBufferingTime): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately): (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush): 2016-05-21 Andy Estes REGRESSION (r188642): All pages are blank when printing a webpage in iOS Safari https://bugs.webkit.org/show_bug.cgi?id=157924 rdar://problem/22524550 Reviewed by Sam Weinig. When UIPrintInteractionController asks WKWebView to print a webpage, it does so in several phases. First we're asked to compute the page count, followed later by a series of messages asking us to draw each page into a provided CGContext. When asked for the page count, we send a message to the Web process instructing it to compute and return the page count synchronously and then immediately start drawing the page for printing. If the drawing has finished by the time we're asked to print the first page, then we can do so without waiting. But if it hasn't then we block by calling Connection::waitForMessage(), passing std::chromo::milliseconds::max() as the relative timeout. Prior to r188642, Connection::waitForMessage() called std::condition_variable::wait_for(), which takes a relative timeout value. r188642 replaced this with WTF::Condition::waitUntil(), which takes an absolute timeout instead. To convert from relative to absolute, this line was added to Connection::waitForMessage(): Condition::Clock::time_point absoluteTimeout = Condition::Clock::now() + timeout; std::chrono will convert both operands to a common duration type before performing the addition. When timeout equals something very large, like milliseconds::max(), this conversion results in signed integer overflow, giving absoluteTimeout a value less than Clock::now() and making waitForMessage time out immediately. To fix this, compute how many milliseconds remain on our clock, and add the smaller of that and the timeout value to Clock::now() to arrive at an absolute timeout. * Platform/IPC/Connection.cpp: (IPC::Connection::waitForMessage): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _printedDocument]): Removed an unnecessary nanoseconds-to-milliseconds conversion. 2016-05-20 Enrica Casucci Drag cannot start if no drag data or custom data is available in the Pasteboard. https://bugs.webkit.org/show_bug.cgi?id=157911 rdar://problem/24577706 Reviewed by Tim Horton. We need to make sure there is always one item in common between source and target of the drag and drop operation. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::dragImageForView): 2016-05-20 John Wilander Remove unnecessary PageOverlay client function pageOverlayDestroyed https://bugs.webkit.org/show_bug.cgi?id=157388 Reviewed by Tim Horton. Remove dead PageOverlay code. Almost all of these overrides were empty and never called. In the case of WebPageOverlay it was never called but had a function body, causing confusion. There was a fear of dangling pointers in WebPageOverlay's static hash map between PageOverlays and WebPageOverlays. Only WebPageOverlay's constructor creates its PageOverlay object and adds it to the hash map. Its client object is kept in a unique pointer member which is automatically deleted when the WebPageOverlay object itself is deleted. This explains why PageOverlayClientImpl::pageOverlayDestroyed in WKBundlePageOverlay can safely be removed. Finally, WebPageOverlay's destructor clears the hash map entry for its PageOverlay object. Thus, there is no need to call WebPageOverlay::pageOverlayDestroyed nor a need for WebPageOverlay's destructor to call pageOverlayDestroyed on its client. No new tests. I tried to come up with a WebKit API test for this but I wasn't able to test presence/absence of WebPageOverlay's map entries since the map is not exposed. * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp: (WebKit::PageOverlayClientImpl::pageOverlayDestroyed): Deleted. * WebProcess/Plugins/PDF/PDFPlugin.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::HUD::pageOverlayDestroyed): Deleted. * WebProcess/WebCoreSupport/WebInspectorClient.cpp: * WebProcess/WebCoreSupport/WebInspectorClient.h: (WebKit::WebInspectorClient::pageOverlayDestroyed): Deleted. * WebProcess/WebPage/FindController.cpp: * WebProcess/WebPage/FindController.h: (WebKit::FindController::pageOverlayDestroyed): Deleted. * WebProcess/WebPage/WebPageOverlay.cpp: * WebProcess/WebPage/WebPageOverlay.h: (WebKit::WebPageOverlay::pageOverlayDestroyed): Deleted. * WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h: (WebKit::FindIndicatorOverlayClientIOS::pageOverlayDestroyed): Deleted. 2016-05-19 Chris Dumez Improve compile-time assertions in is<>() / downcast<>() https://bugs.webkit.org/show_bug.cgi?id=157817 Reviewed by Darin Adler. Add missing includes. * WebProcess/WebPage/WebFrame.cpp: * WebProcess/WebPage/WebPage.cpp: 2016-05-19 Tim Horton Mail crashes under TiledCoreAnimationDrawingAreaProxy::createFenceForGeometryUpdate() when the Web process crashes https://bugs.webkit.org/show_bug.cgi?id=157927 Reviewed by Dean Jackson. * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence): With just the right combination of layout mechanisms and Web Content process crash timing, it is possible to get a frame change underneath WebPageProxy::processDidCrash, before the DrawingArea has been nulled out but after the Connection has. This can lead to a null dereference. I had a lot of trouble writing a API test for this, though I'm certain it's possible. 2016-05-16 Enrica Casucci No candidate punctuation when typing punctuation in WK2 text field. https://bugs.webkit.org/show_bug.cgi?id=157773 rdar://problem/23084603 Reviewed by Sam Weinig. We need to adopt the new addInputString:withFlags:withInputManagerHint function for this to work propertly. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _interpretKeyEvent:isCharEvent:]): 2016-05-19 Brady Eidson Finishing off: Modern IDB: Website data store management. https://bugs.webkit.org/show_bug.cgi?id=157626 Reviewed by Alex Christensen. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): (WebKit::removeAllDatabasesForOriginPath): Deleted. (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigins): Deleted. (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedSince): Deleted. * DatabaseProcess/DatabaseProcess.h: 2016-05-19 Brent Fulgham [OS X][WK2] Expand sandbox for new mach endpoints https://bugs.webkit.org/show_bug.cgi?id=157919 Reviewed by Alexey Proskuryakov. Grant the WebContent and Networking processes the mach lookup capability for various Security-related mach endpoints.. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2016-05-19 Brian Burg Web Inspector: CRASH when closing a page while element selection mode is enabled via Develop menu https://bugs.webkit.org/show_bug.cgi?id=157925 Reviewed by Joseph Pecoraro. * WebProcess/WebCoreSupport/WebInspectorClient.cpp: (WebKit::WebInspectorClient::elementSelectionChanged): Null-check m_page->inspector() since it will return nullptr if the page is closed but not yet destructed. This is triggered by teardown code in InspectorDOMAgent::willDestroyFrontendAndBackend. 2016-05-19 Enrica Casucci Drag cannot start if no drag data is available in the Pasteboard. https://bugs.webkit.org/show_bug.cgi?id=157911 rdar://problem/24577706 Reviewed by Tim Horton. Setting dummy data to allow drag to start. * Shared/mac/PasteboardTypes.h: * Shared/mac/PasteboardTypes.mm: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::registerDraggedTypes): (WebKit::WebViewImpl::dragImageForView): 2016-05-19 Jer Noble [IOS] Add setting to allow playback to continue inline after exiting fullscreen. https://bugs.webkit.org/show_bug.cgi?id=157912 Reviewed by Eric Carlson. Add a preference and configuration property to control whether media should be allowed to continue playing inline when exiting fullscreen. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration encodeWithCoder:]): (-[WKWebViewConfiguration initWithCoder:]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _allowsInlineMediaPlaybackAfterFullscreen]): (-[WKWebViewConfiguration _setAllowsInlineMediaPlaybackAfterFullscreen:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/mac/WKFullScreenWindowController.mm: (disableScreenUpdates): (enableScreenUpdates): (-[WKFullScreenWindowController enterFullScreen:]): (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): (-[WKFullScreenWindowController exitFullScreen]): (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]): (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]): (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-05-19 Brian Burg Web Inspector: timelines should not update via requestAnimationFrame unless Web Inspector is visible https://bugs.webkit.org/show_bug.cgi?id=157897 Reviewed by Timothy Hatcher. The UIProcess needs to notify the Inspector frontend when it is truly visible. The frontend can't use document.visibilityState because it doesn't seem to work if the inspector frontend's WKWebView is created but not attached to a window. * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::open): (WebKit::WebInspectorProxy::didClose): Send visibility updates to the inspector process when the inspector becomes "visible" or "not visible". It becomes visible if it is attached to the inspected page's window, or gets its own native window. * WebProcess/WebPage/WebInspectorUI.cpp: (WebKit::WebInspectorUI::frontendLoaded): (WebKit::WebInspectorUI::setDockingUnavailable): (WebKit::WebInspectorUI::setIsVisible): Call InspectorFrontendAPI.updateVisibilityState to let the frontend know. * WebProcess/WebPage/WebInspectorUI.h: * WebProcess/WebPage/WebInspectorUI.messages.in: Add new message. 2016-05-19 Brian Burg Web Inspector: use a consistent prefix for injected scripts https://bugs.webkit.org/show_bug.cgi?id=157715 Reviewed by Timothy Hatcher. * CMakeLists.txt: * DerivedSources.make: * WebProcess/Automation/WebAutomationSessionProxy.js: 2016-05-18 Anders Carlsson Add WKPreferencesRef getter/setter pair to set RTL mode https://bugs.webkit.org/show_bug.cgi?id=157873 rdar://problem/26329970 Reviewed by Tim Horton. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetUserInterfaceDirectionPolicy): (WKPreferencesGetUserInterfaceDirectionPolicy): * UIProcess/API/C/WKPreferencesRef.h: 2016-05-18 Alex Christensen Clean up CSS code https://bugs.webkit.org/show_bug.cgi?id=157808 Reviewed by Chris Dumez. * UIProcess/Cocoa/WebViewImpl.mm: 2016-05-18 Jer Noble Disable default user gesture requirement for audio playback on Mac https://bugs.webkit.org/show_bug.cgi?id=157820 Reviewed by Sam Weinig. Disable the WebPreferences and matching WKWebViewConfiguration.mediaTypesRequiringUserActionForPlayback settings on Mac (and other non-iOS ports). * Shared/WebPreferencesDefinitions.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): 2016-05-18 Alex Christensen Build fix when not using CredentialStorage with NetworkSession. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSession::clearCredentials): 2016-05-18 Brady Eidson Fix null-deref crash sporadically seen after http://trac.webkit.org/changeset/201098 No review. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::deleteWebsiteData): Don't access m_idbServer directly, as calling the idbServer() accessor is how you actually get your IDBServer created for you. 2016-05-18 Brian Burg Web Inspector: InspectorFrontendAPI.setTimelineProfilingEnabled should not implicitly show Timelines tab https://bugs.webkit.org/show_bug.cgi?id=157846 Reviewed by Timothy Hatcher. Add a separate ShowTimelines message to WebInspector and WebInspectorUI. Have the start/stop profiling methods in public APIs explicitly call showTimelines() rather than relying on InspectorFrontendAPI to do it. * UIProcess/API/C/WKInspector.cpp: (WKInspectorTogglePageProfiling): * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::showTimelines): * UIProcess/WebInspectorProxy.h: * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp: (WKBundleInspectorSetPageProfilingEnabled): * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::showTimelines): * WebProcess/WebPage/WebInspector.h: * WebProcess/WebPage/WebInspector.messages.in: * WebProcess/WebPage/WebInspectorUI.cpp: (WebKit::WebInspectorUI::showTimelines): * WebProcess/WebPage/WebInspectorUI.h: * WebProcess/WebPage/WebInspectorUI.messages.in: 2016-05-18 Brady Eidson Modern IDB: Add support for server side closing of open database connections. https://bugs.webkit.org/show_bug.cgi?id=157843 Reviewed by Alex Christensen. - Implement the required IDB delegate code. - Make DatabaseProcess::deleteWebsiteData call the right method in IDB server. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::deleteWebsiteData): * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::didGetRecord): (WebKit::WebIDBConnectionToClient::didCloseFromServer): (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer): * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h: * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::confirmDidCloseFromServer): (WebKit::WebIDBConnectionToServer::didStartTransaction): (WebKit::WebIDBConnectionToServer::didCloseFromServer): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in: 2016-05-18 Brady Eidson Modern IDB: Make TestRunner.clearAllDatabases also delete IndexedDB databases (once doing so is supported). https://bugs.webkit.org/show_bug.cgi?id=157823 Reviewed by Alex Christensen. * CMakeLists.txt: * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreRemoveAllIndexedDatabases): * UIProcess/API/C/WKWebsiteDataStoreRef.h: 2016-05-18 Brian Burg REGRESSION(r200959): "Start Timeline Recording" menu item doesn't start recording https://bugs.webkit.org/show_bug.cgi?id=157821 Reviewed by Timothy Hatcher. In r200959, WebInspectorProxy started sending start/stop profiling messages directly to the frontend process to avoid the inspected page process from implicitly showing the frontend. To compensate, the WebKit API layer was changed to call show() in togglePageProfiling(). Unfortunately, this fix was not quite right, because the ordering of the Show and StartPageProfiling messages is undefined. The latter has to bounce from UI to inspected to inspector processes, so the frontend may try to start profiling before the frontend is shown, causing it to be ignored. This patch takes a different approach: just remove all implicit show() calls in the inspected page processes, and bounce both the Show and StartPageProfiling messages through the inspected page process to ensure they are handled in order by the frontend process. * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::togglePageProfiling): Revert to sending to the inspected page process. * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp: (WKBundleInspectorSetPageProfilingEnabled): Add a call to show() now that the implementation doesn't do it implicitly. * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::startPageProfiling): (WebKit::WebInspector::stopPageProfiling): Don't implicitly show the inspector. These methods are only called through the WKBundleInspector API and via IPC from WebInspectorProxy. 2016-05-17 Beth Dakin Make handleAcceptedCandidate a public function https://bugs.webkit.org/show_bug.cgi?id=157763 -and corresponding- rdar://problem/26206397 Reviewed by Tim Horton. This patch makes handleAcceptedCandidate a public member of WebViewImpl instead of a private member. * UIProcess/Cocoa/WebViewImpl.h: (WebKit::WebViewImpl::createWeakPtr): 2016-05-17 Dean Jackson Remove ES6_GENERATORS flag https://bugs.webkit.org/show_bug.cgi?id=157815 Reviewed by Geoffrey Garen. This flag isn't needed. Generators are enabled everywhere and part of a stable specification. * Configurations/FeatureDefines.xcconfig: 2016-05-17 Dean Jackson Temporarily enable Experimental Features https://bugs.webkit.org/show_bug.cgi?id=157810 Reviewed by Anders Carlsson. We currently don't have good UI for enabling these features, which would mean Safari Technology Preview users would never be able to turn them on… unless we enable them by default temporarily. * Shared/WebPreferencesDefinitions.h: 2016-05-17 Filip Pizlo WTF should know about Language https://bugs.webkit.org/show_bug.cgi?id=157756 Reviewed by Geoffrey Garen and Alexey Proskuryakov. Rewires a bunch of includes/imports. * Shared/mac/RemoteLayerTreePropertyApplier.mm: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: 2016-05-17 Jer Noble Unreviewed GTK+ and EFL bulid fix; make the audio playback user gesture requirement Cocoa-only. * Shared/WebPreferencesDefinitions.h: 2016-05-16 Anders Carlsson Add a WKA extension point for WKPreferences SPI https://bugs.webkit.org/show_bug.cgi?id=157762 rdar://problem/24529203 Reviewed by Sam Weinig. * UIProcess/API/Cocoa/WKPreferences.mm: 2016-05-16 David Kilzer Action sheets don’t work in presented view controllers Reviewed by Anders Carlsson. * UIProcess/ios/WKActionSheet.mm: (-[WKActionSheet presentSheetFromRect:]): (-[WKActionSheet willRotate]): - Call SPI to get the presenting view controller, since it may not always be the root view controller. 2016-05-13 Enrica Casucci Text selection is basically impossible on plain text pages. https://bugs.webkit.org/show_bug.cgi?id=157681 rdar://problem/26065660 Reviewed by Darin Adler. When dealing with a plain text file, the rules for deciding whether a position is selectable should be different and we should never switch to block selection. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::shouldSwitchToBlockModeForHandle): (WebKit::rectIsTooBigForSelection): Added helper function. (WebKit::WebPage::selectTextWithGranularityAtPoint): (WebKit::WebPage::getPositionInformation): 2016-05-16 Chelsea Pugh [iOS] Remove dispatch_after in -[WKFormInputSession setSuggestions:] https://bugs.webkit.org/show_bug.cgi?id=157745 Reviewed by Dan Bernstein. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKFormInputSession setSuggestions:]): Remove the dispatch_after since there is no longer a chance of keyboard suggestions replacing the suggestions set here. 2016-05-16 Brian Burg Crash simulating keystrokes at WebKit::WebAutomationSession::platformSimulateKeyStroke https://bugs.webkit.org/show_bug.cgi?id=157737 Reviewed by Timothy Hatcher. * UIProcess/Cocoa/WebAutomationSessionCocoa.mm: (WebKit::WebAutomationSession::platformSimulateKeyStroke): AppKit expects characters passed to [NSEvent keyEventWithType:...] to be non-nil even if there are no characters. Initialize characters to the empty string @"". It will be overwritten if the keystroke should produce any unicode characters. 2016-05-16 Brian Burg Web Automation: Automation.inspectBrowsingContext should automatically start page profiling https://bugs.webkit.org/show_bug.cgi?id=157739 Reviewed by Timothy Hatcher. * UIProcess/API/C/WKInspector.cpp: (WKInspectorTogglePageProfiling): Implicitly show the Web Inspector in the C API command to preserve existing behavior. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::inspectorFrontendLoaded): If the frontend loaded, it was either because the user opened Web Inspector (and turning on page profiling is harmless), or it was loaded but not shown by the inspectBrowsingContext command. For the latter, we want to start page profiling before processing any additional commands so subsequent execution is captured. * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::togglePageProfiling): Send the start/stop profiling messages directly to the WebInspectorUI process instead of bouncing through the inspected page's process, which does an implicit show() we don't want. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::inspector): Make it const. * UIProcess/WebPageProxy.h: 2016-05-16 Conrad Shultz Fix some deprecation warnings. * UIProcess/mac/WKPrintingView.mm: (-[WKPrintingView _drawPDFDocument:page:atPoint:]): * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm: (WebKit::PDFPlugin::setActiveAnnotation): (WebKit::PDFPlugin::lookupTextAtLocation): * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h: * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement): * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h: * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: (WebKit::PDFPluginTextAnnotation::createAnnotationElement): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::drawPDFPage): 2016-04-06 Jer Noble [WK2] Add API to WKWebViewConfiguration to control autoplay policy. https://bugs.webkit.org/show_bug.cgi?id=156312 Reviewed by Dan Bernstein. Add a new API to WKWebViewConfiguration to allow fine-grained control over when media is allowed to play without a user gesture, and simultaneously deprecate the existing, all-or-nothing API, and deprecated the equivalent SPIs. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration encodeWithCoder:]): (-[WKWebViewConfiguration initWithCoder:]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _requiresUserActionForVideoPlayback]): (-[WKWebViewConfiguration _setRequiresUserActionForVideoPlayback:]): (-[WKWebViewConfiguration _requiresUserActionForAudioPlayback]): (-[WKWebViewConfiguration _setRequiresUserActionForAudioPlayback:]): (-[WKWebViewConfiguration requiresUserActionForMediaPlayback]): (-[WKWebViewConfiguration setRequiresUserActionForMediaPlayback:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: 2016-05-16 Brian Burg Web Automation: WebAutomationSessionProxy.js gets injected more than once sometimes https://bugs.webkit.org/show_bug.cgi?id=157716 Reviewed by Timothy Hatcher. Whenever a script was injected into a non-normal world by a WebKit client, the WebProcess's WebAutomationSessionProxy singleton would get a notification that the window was cleared from the relevant frame. This notification happens when creating the world's window shell for the first time. This code should ignore such notifications that originate from non-main world contexts. Web Inspector's instrumentation already ignored this, but the automation session notification comes in via a different WebKit2 layer. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld): 2016-05-13 Dean Jackson Fix iOS Build. * Shared/AssistedNodeInformation.h: (WebKit::OptionItem::OptionItem): 2016-05-13 Sam Weinig REGRESSION (r200463): Autofill Credit Card expected but got Autofill Contact https://bugs.webkit.org/show_bug.cgi?id=157701 Reviewed by Dan Bernstein. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm: (-[WKWebProcessPlugInFrame _certificateChain]): We need to do a retain-autorelease here now because the CertificateInfo's that contain the cached certificate chain, are being destroyed, and therefore destroying the chain, before this function returns. This used to work when the chain wasn't just a cache, because there was still a strong reference to it being held by the ResourceResponse's CertificateInfo copy, but now there is none. 2016-05-13 Dean Jackson [iOS] elements popover should render right-aligned when in RTL mode https://bugs.webkit.org/show_bug.cgi?id=157672 Reviewed by Darin Adler. Add a new isRTL field to the AssistedNodeInformation as specified by the assisted node's render style and account for it when displaying the table view shown in the popover attached to the assisted node using the UIView semanticContentAttribute property. * Shared/AssistedNodeInformation.cpp: (WebKit::AssistedNodeInformation::encode): (WebKit::AssistedNodeInformation::decode): * Shared/AssistedNodeInformation.h: (WebKit::AssistedNodeInformation::AssistedNodeInformation): * UIProcess/ios/forms/WKFormSelectPopover.mm: (-[WKSelectTableViewController initWithView:hasGroups:]): (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getAssistedNodeInformation): 2016-05-13 Tina Liu Revert r199691. https://bugs.webkit.org/show_bug.cgi?id=157645 Reviewed by Darin Adler. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): Deleted. (WebKit::WebProcessCreationParameters::decode): Deleted. * Shared/WebProcessCreationParameters.h: * UIProcess/API/C/mac/WKContextPrivateMac.h: * UIProcess/API/C/mac/WKContextPrivateMac.mm: (WKContextSetPrivateBrowsingPluginLoadClientPolicy): Deleted. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::setPluginLoadClientPolicy): (WebKit::WebProcessPool::createNewWebProcess): Deleted. (WebKit::WebProcessPool::setPluginLoadClientPolicyForPrivateBrowsing): Deleted. (WebKit::WebProcessPool::setPrivateBrowsingPluginLoadClientPolicy): Deleted. (WebKit::WebProcessPool::clearPluginClientPolicies): Deleted. * UIProcess/WebProcessPool.h: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::setPluginLoadClientPolicy): (WebKit::WebPlatformStrategies::longestMatchedWildcardHostForHost): (WebKit::WebPlatformStrategies::replaceHostWithMatchedWildcardHost): (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost): (WebKit::WebPlatformStrategies::populatePluginCache): (WebKit::WebPlatformStrategies::setPluginLoadClientPolicyForPrivateBrowsing): Deleted. (WebKit::WebPlatformStrategies::setPrivateBrowsingPluginLoadClientPolicy): Deleted. (WebKit::WebPlatformStrategies::clearPluginClientPolicies): Deleted. (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHostForPrivateBrowsing): Deleted. * WebProcess/WebCoreSupport/WebPlatformStrategies.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): (WebKit::WebProcess::setPluginLoadClientPolicies): Deleted. (WebKit::WebProcess::setPrivateBrowsingPluginLoadClientPolicy): Deleted. * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2016-05-12 Daniel Bates Use SecTask SPI to retrieve code signing identifier for user directory suffix https://bugs.webkit.org/show_bug.cgi?id=157570 Reviewed by Darin Adler. It is sufficient to make use of the SecTask SPI to retrieve the code signing identifier of the embedding client for use in the user directory suffix. This avoids the need to allow Code Signing Services to have access to the bundle of the embedding client. * Shared/mac/ChildProcessMac.mm: (WebKit::ChildProcess::initializeSandbox): Use the code signing identifier of the embedding client as part of the user directory suffix if available. * Shared/mac/CodeSigning.h: Update comment and include header wtf/spi/darwin/XPCSPI.h for the definition of xpc_connection_t. Renamed codeSigningIdentifier() to codeSigningIdentifierForCurrentProcess() to convey that it returns the code signing identifier for the current process. Repurposed the name codeSigningIdentifier for the variant of this function that takes a xpc_connection_t. * Shared/mac/CodeSigning.mm: (WebKit::codeSigningIdentifier): Added. Uses the audit token associated with the specified XPC connection to get the code signing identifier for the embedding client. (WebKit::codeSigningIdentifierForCurrentProcess): Renamed; formerly named codeSigningIdentifier. Implemented in terms of the SecTask API. (WebKit::secCodeForCurrentProcess): Deleted. (WebKit::secCodeForProcess): Deleted. (WebKit::secCodeSigningInformation): Deleted. (WebKit::appleSignedOrMacAppStoreSignedOrAppleDeveloperSignedRequirement): Deleted. (WebKit::secCodeSigningIdentifier): Deleted. (WebKit::codeSigningIdentifierForProcess): Deleted. * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::connectToService): Update code due to renaming. 2016-05-12 Konstantin Tokarev Use reference instead of pointer in FrameLoaderClient::saveViewStateToItem. https://bugs.webkit.org/show_bug.cgi?id=157624 Reviewed by Darin Adler. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::saveViewStateToItem): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2016-05-12 Csaba Osztrogonác Remove ENABLE(ES6_ARROWFUNCTION_SYNTAX) guards https://bugs.webkit.org/show_bug.cgi?id=157564 Reviewed by Darin Adler. * Configurations/FeatureDefines.xcconfig: 2016-05-11 Anders Carlsson We have two different types of contextual menus in iBooks https://bugs.webkit.org/show_bug.cgi?id=157587 rdar://problem/25904169 Reviewed by Darin Adler. Give clients the option to bypass the WebKit context menu machinery. * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::showContextMenu): 2016-05-10 Brian Burg Web Automation: add command to asynchronously load the Web Inspector frontend in the background https://bugs.webkit.org/show_bug.cgi?id=157509 Reviewed by Timothy Hatcher and Joseph Pecoraro. In order to make it easier to debug code that executes as a result of an automation command, this patch adds a new Automation command to asynchronously load the debugger and Inspector frontend. It is designed for use by automation clients to implement an auto-inspection feature to aid in debugging automation scripts. * UIProcess/Automation/Automation.json: Add new command. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::inspectBrowsingContext): Added. (WebKit::WebAutomationSession::inspectorFrontendLoaded): Added. This message is forwarded by WebInspectorProxy to the inspected page's session. * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Cocoa/WebAutomationSessionCocoa.mm: (WebKit::WebAutomationSession::sendSynthesizedEventsToPage): Force the active automation window to become key and bring to front prior to sending each NSEvent. This way, if the Inspector pauses while a command executes, the automation window will get back focus when the Inspector unpauses just before the next synthesized mouse or keyboard NSEvent is sent to its NSWindow. * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::frontendLoaded): Forward to the inspected page's session. * UIProcess/WebInspectorProxy.h: * UIProcess/WebInspectorProxy.messages.in: Add notification of the frontend's load. * WebProcess/WebPage/WebInspectorUI.cpp: (WebKit::WebInspectorUI::frontendLoaded): Kick off notifying the automation session in UIProcess that the inspector loaded. (WebKit::WebInspectorUI::closeWindow): In some circumstances, the Web Inspector can be loaded without showing the window. If this hidden page closes, make sure the frontend host gets a chance to disconnect its InspectorFrontendClient. Normally this happens when the window closes, but unshown Inspectors do not get window instances. 2016-05-11 Chris Dumez Update Node::appendChild() / replaceChild() / removeChild() / insertBefore() to take references instead of pointers https://bugs.webkit.org/show_bug.cgi?id=157556 Reviewed by Darin Adler. * WebProcess/InjectedBundle/API/mac/WKDOMNode.mm: (-[WKDOMNode insertNode:before:]): (-[WKDOMNode appendChild:]): (-[WKDOMNode removeChild:]): * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm: (WebKit::PDFPlugin::PDFPlugin): * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement): 2016-05-11 Brady Eidson Modern IDB: IDBOpenDBRequests that are stop()'ed don't notify the IDBServer of that fact. https://bugs.webkit.org/show_bug.cgi?id=157448 Reviewed by Alex Christensen. * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction): (WebKit::WebIDBConnectionToClient::openDBRequestCancelled): * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h: * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in: * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::didFinishHandlingVersionChangeTransaction): (WebKit::WebIDBConnectionToServer::openDBRequestCancelled): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: 2016-05-11 Myles C. Maxfield Fix a typo in r200330 Unreviewed. * UIProcess/API/Cocoa/WKWebViewConfiguration.h: 2016-05-10 Sam Weinig Only expose WKDataDetectorTypes and -[WKWebViewConfiguration dataDetectorTypes] on iOS for now, since we don't have it fully implemented on Mac. Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKWebView.mm: (fromWKDataDetectorTypes): (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration encodeWithCoder:]): (-[WKWebViewConfiguration initWithCoder:]): (-[WKWebViewConfiguration copyWithZone:]): 2016-05-10 Sam Weinig Add SPI for Data Detectors to get ranges of text around an existing range. Reviewed by Enrica Casucci. * WebProcess/InjectedBundle/API/mac/WKDOMRange.h: * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm: (-[WKDOMRange rangeByExpandingToWordBoundaryByCharacters:inDirection:]): 2016-05-10 Enrica Casucci Numerous block selection issues on iOS. https://bugs.webkit.org/show_bug.cgi?id=157490 rdar://problem/25717977 rdar://problem/23042215 Reviewed by Tim Horton. This patch fixes a number of issues with block selection on iOS. We no longer eagerly choose block selection vs text selection and we make sure we are capable of switching back to text selection from block under every circumstance. The patch also fixes the logic used to decide when to switch to block selection. It now computes the rectangle for the paragraph containing the initial text selection to decide when we are actually dragging outside the boundaries of the paragraph block. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/WKContentViewInteraction.mm: (selectionChangedWithGesture): (selectionChangedWithTouch): (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::gestureCallback): (WebKit::WebPageProxy::touchesCallback): (WebKit::WebPageProxy::autocorrectionDataCallback): (WebKit::WebPageProxy::selectWithGesture): (WebKit::WebPageProxy::updateSelectionWithTouches): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::selectionBoxForRange): (WebKit::canShrinkToTextSelection): (WebKit::hasCustomLineHeight): (WebKit::WebPage::rangeForWebSelectionAtPosition): (WebKit::WebPage::contractedRangeFromHandle): (WebKit::WebPage::updateBlockSelectionWithTouch): (WebKit::WebPage::clearSelection): (WebKit::WebPage::switchToBlockSelectionAtPoint): (WebKit::WebPage::shouldSwitchToBlockModeForHandle): (WebKit::WebPage::updateSelectionWithTouches): (WebKit::WebPage::selectWithTwoTouches): 2016-05-10 Alex Christensen Handle _schemeUpgraded delegate callbacks in NSURLSessionDataDelegate https://bugs.webkit.org/show_bug.cgi?id=157354 rdar://problem/25842107 Reviewed by Darin Adler. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]): When we make a request to a http url and CFNetwork determines that that url would have redirected to an HSTS site and it is going to change the request to an https request, this delegate callback is called. We need to call the redirection code to have the same behavior as the NSURLConnection-based loader. 2016-05-10 Csaba Osztrogonác Fix the !ENABLE(VIDEO) build https://bugs.webkit.org/show_bug.cgi?id=157518 Reviewed by Alex Christensen. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::WebsiteDataStore::fetchData): (WebKit::WebsiteDataStore::removeData): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): 2016-05-10 Anders Carlsson Fix more deprecation warnings. * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm: (NetworkServiceInitializer): * PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm: (PluginServiceInitializer): * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm: (WebContentServiceInitializer): 2016-05-10 Chris Dumez [SpeculativeValidation] Do not start a preload if there is already one pending https://bugs.webkit.org/show_bug.cgi?id=157522 Reviewed by Alex Christensen. Do not start a preload if there is already one pending. We failed to check in SpeculativeLoadManager::preloadEntry() if there was already a pending preload. As a result, we would sometimes cancel an already pending preload and start one from scratch which is inefficient. It would also sometimes lead to hitting an assertion in the SpeculativeLoad destructor because we could destroy the SpeculativeLoad without finishing or cancelling the load. * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry): 2016-05-10 Anders Carlsson Fix a deprecation warning. * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm: (DatabaseServiceInitializer): 2016-05-10 Tim Horton Clicks do not work in Safari after pressing the Track package button in Gmail https://bugs.webkit.org/show_bug.cgi?id=157508 Reviewed by Anders Carlsson. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::viewDidMoveToWindow): Explicitly cancel the force-click animation when we're removing the gesture recognizer due to the WK*View being unparented. This works around a bug where we don't get the cancellation callback in this situation, causing Safari to be left in an inconsistent and unexpected state. 2016-05-10 Michael Catanzaro [Linux] Remove seccomp filters support https://bugs.webkit.org/show_bug.cgi?id=157380 Reviewed by Darin Adler. * NetworkProcess/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode): Deleted. (WebKit::NetworkProcessCreationParameters::decode): Deleted. * NetworkProcess/NetworkProcessCreationParameters.h: * PlatformEfl.cmake: * PlatformGTK.cmake: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): Deleted. (WebKit::WebProcessCreationParameters::decode): Deleted. * Shared/WebProcessCreationParameters.h: * Shared/linux/SeccompFilters/OpenSyscall.cpp: Removed. * Shared/linux/SeccompFilters/OpenSyscall.h: Removed. * Shared/linux/SeccompFilters/SeccompBroker.cpp: Removed. * Shared/linux/SeccompFilters/SeccompBroker.h: Removed. * Shared/linux/SeccompFilters/SeccompFilters.cpp: Removed. * Shared/linux/SeccompFilters/SeccompFilters.h: Removed. * Shared/linux/SeccompFilters/SigactionSyscall.cpp: Removed. * Shared/linux/SeccompFilters/SigactionSyscall.h: Removed. * Shared/linux/SeccompFilters/SigprocmaskSyscall.cpp: Removed. * Shared/linux/SeccompFilters/SigprocmaskSyscall.h: Removed. * Shared/linux/SeccompFilters/Syscall.cpp: Removed. * Shared/linux/SeccompFilters/Syscall.h: Removed. * Shared/linux/SeccompFilters/SyscallPolicy.cpp: Removed. * Shared/linux/SeccompFilters/SyscallPolicy.h: Removed. * Shared/linux/SeccompFilters/XDGBaseDirectory.h: Removed. * Shared/linux/SeccompFilters/XDGBaseDirectoryGLib.cpp: Removed. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::ensureNetworkProcess): Deleted. (WebKit::WebProcessPool::createNewWebProcess): Deleted. (WebKit::WebProcessPool::cookieStorageDirectory): Deleted. * UIProcess/WebProcessPool.h: * WebProcess/efl/SeccompFiltersWebProcessEfl.cpp: Removed. * WebProcess/efl/SeccompFiltersWebProcessEfl.h: Removed. * WebProcess/gtk/SeccompFiltersWebProcessGtk.cpp: Removed. * WebProcess/gtk/SeccompFiltersWebProcessGtk.h: Removed. * WebProcess/soup/WebProcessSoup.cpp: (WebKit::WebProcess::platformInitializeWebProcess): Deleted. 2016-05-09 Tim Horton REGRESSION (r191922): Zoom in/Zoom Out is not working for PDFs https://bugs.webkit.org/show_bug.cgi?id=157503 Reviewed by Anders Carlsson. * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h: Restore a requiresUnifiedScaleFactor that was lost in r191922. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didCommitLoadForFrame): (WebKit::WebPageProxy::mainFramePluginHandlesPageScaleGestureDidChange): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::didInitializePlugin): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad): Separate mainFramePluginHandlesPageScaleGesture changes out from didCommitLoadForFrame, because the PluginView doesn't exist at this point, so it can't answer the handlesPageScaleGesture question correctly (or at all). Instead, we'll send the message when the main-frame PluginView is initialized. 2016-05-09 Simon Fraser [iOS] visibility:hidden -webkit-overflow-scrolling: touch divs can interfere with page scrolling https://bugs.webkit.org/show_bug.cgi?id=157496 rdar://problem/22963278 Reviewed by Tim Horton. UIScrollViews are constructed in the UI process for visibility:hidden scrollable elements with -webkit-overflow-scrolling: touch, and these intercept user events when they should not. Fix by propagating a "contentsHidden" flag from the web process which is used to turn off user interaction on these views. * Shared/mac/RemoteLayerTreePropertyApplier.mm: (WebKit::RemoteLayerTreePropertyApplier::applyProperties): * Shared/mac/RemoteLayerTreeTransaction.h: * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties): (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode): (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode): (WebKit::dumpChangedLayers): * UIProcess/ios/RemoteLayerTreeHostIOS.mm: (-[UIView _recursiveFindDescendantScrollViewAtPoint:withEvent:]): Our custom hit test needs to take view.isUserInteractionEnabled into account. * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::setHidden): (WebKit::PlatformCALayerRemote::contentsHidden): (WebKit::PlatformCALayerRemote::setContentsHidden): * WebProcess/WebPage/mac/PlatformCALayerRemote.h: 2016-05-09 Ada Chan Introduce WebVideoFullscreenInterfaceMac::isPlayingVideoInEnhancedFullscreen() and use it in WebVideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen() https://bugs.webkit.org/show_bug.cgi?id=157493 Reviewed by Dan Bernstein. * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen): 2016-05-06 Ada Chan Add WKPageRef SPI to tell whether there's a video playing in enhanced fullscreen https://bugs.webkit.org/show_bug.cgi?id=157434 Reviewed by Darin Adler. * UIProcess/API/C/mac/WKPagePrivateMac.h: * UIProcess/API/C/mac/WKPagePrivateMac.mm: (WKPageIsPlayingVideoInEnhancedFullscreen): * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h: * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::isPlayingVideoInEnhancedFullscreen): * UIProcess/WebPageProxy.h: 2016-05-09 Anders Carlsson Add injected bundle SPI for getting favicon and touch icon URLs https://bugs.webkit.org/show_bug.cgi?id=157435 Reviewed by Darin Adler. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm: (collectIcons): New helper function that calls into the WebCore LinkCollector. (-[WKWebProcessPlugInFrame appleTouchIconURLs]): Call collectIcons. (-[WKWebProcessPlugInFrame faviconURLs]): Ditto. 2016-05-06 Simon Fraser [iOS WK2] Font size increases on some pages after navigating then going back https://bugs.webkit.org/show_bug.cgi?id=157441 rdar://problem/22873240 Reviewed by Darin Adler. There's an ordering dependency between setting the viewport configuration and doing layouts when going back to a page from the page cache that is incorrectly handled. In FrameLoader::commitProvisionalLoad(), CachedPage::restore() triggers a layout under updateContentsSize(), but this happens before dispatchDidCommitLoad() which updates the viewport arguments via ViewportConfiguration::setViewportArguments(). This issue is not addressed by the current commit. But a second problem is: if the inputs to text autosizing change, we need to invalidate the autosizing state. The relevant input here is the fixed layout width (which is determined from the viewport configuration). The current code invalidated text autosizing when m_viewportConfiguration.minimumLayoutSize() changed, but the correct behavior is to invalidate based on fixed layout size changing. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::sendViewportAttributesChanged): (WebKit::WebPage::setFixedLayoutSize): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::resetTextAutosizing): (WebKit::WebPage::dynamicViewportSizeUpdate): (WebKit::WebPage::viewportConfigurationChanged): (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize): Deleted. (WebKit::WebPage::resetTextAutosizingBeforeLayoutIfNeeded): Deleted. 2016-05-09 Alex Christensen Don't use DiskCache for media resource loads https://bugs.webkit.org/show_bug.cgi?id=157405 Reviewed by Darin Adler. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::makeRetrieveDecision): (WebKit::NetworkCache::makeStoreDecision): * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheStatistics.cpp: (WebKit::NetworkCache::retrieveDecisionToDiagnosticKey): 2016-05-08 Myles C. Maxfield [OS X] Migrate our Font classes entirely off of NSFont https://bugs.webkit.org/show_bug.cgi?id=157464 Reviewed by Darin Adler. * WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm: (WebKit::WebPopupMenu::setUpPlatformData): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::fontAtSelection): 2016-05-06 Joseph Pecoraro Rename HitTestRequest DisallowShadowContent to DisallowUserAgentShadowContent https://bugs.webkit.org/show_bug.cgi?id=157447 Reviewed by Ryosuke Niwa. * WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp: (WebKit::WebPage::findZoomableAreaForPoint): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::hitTest): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::determinePrimarySnapshottedPlugIn): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::rangeForWebSelectionAtPosition): (WebKit::WebPage::rangeForBlockAtPoint): (WebKit::WebPage::getPositionInformation): 2016-05-06 Simon Fraser Enable IOS_TEXT_AUTOSIZING on Mac and make it testable https://bugs.webkit.org/show_bug.cgi?id=157432 rdar://problem/16406720 Reviewed by Dean Jackson. Enable IOS_TEXT_AUTOSIZING on Mac so it can be tested. Make the setTextAutosizingEnabled() Setting work, and plumb it through WK1 and WK2 preferences for WTR and DRT. Make textAutosizingWindowSizeOverride() work, for layout tests. These two settings are shared with TEXT_AUTOSIZING. Add a TextAutosizing log channel, which is useful for generated -expected.html results. Move adjustComputedFontSizesOnBlocks() and related code from RenderObject to RenderElement without changes. An implication of this set of changes is that the way clients enable text autosizing has changed. Previously, they set the "MinimumZoomFontSize" preference to 0. Settings::defaultMinimumZoomFontSize() used to do this in order to enable text autosizing on iPhone only, not iPad. Now the preferred technique is to leave minimumZoomFontSize alone, and to use textAutosizingEnabled() instead. Settings::defaultTextAutosizingEnabled() now does the check for iPhone. UIWebView calls WebKitGetMinimumZoomFontSize() to setup the default minimum font zoom size, which will now always return 15, but had no other code that toggled this. So it's safe to just rely on Settings::defaultTextAutosizingEnabled() doing the right thing for iPhone/iPad. * Configurations/FeatureDefines.xcconfig: * Shared/WebPreferencesDefinitions.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _textAutosizingEnabled]): (-[WKPreferences _setTextAutosizingEnabled:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-05-06 Dean Jackson Regions, Shapes and Tracks don't need runtime features https://bugs.webkit.org/show_bug.cgi?id=157426 Reviewed by Simon Fraser. The following RuntimeEnabledFeatures can be removed since we have no need to disable them (they are stable and have shipped for a while): - CSS Regions - CSS Shapes - Media tracks * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetCSSRegionsEnabled): Deleted. (WKPreferencesGetCSSRegionsEnabled): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Deleted. (WebKit::InjectedBundle::setCSSRegionsEnabled): Deleted. (WebKit::InjectedBundle::setCSSCompositingEnabled): Deleted. * WebProcess/InjectedBundle/InjectedBundle.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Deleted. 2016-05-05 Ada Chan Create a fence in WebVideoFullscreenManagerProxy::setVideoLayerFrame() to pass to the web process https://bugs.webkit.org/show_bug.cgi?id=157409 Reviewed by Tim Horton. * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame): Create a fence by calling DrawingAreaProxy::createFence() and pass it when sending the WebVideoFullscreenManager::SetVideoLayerFrameFenced message. * UIProcess/DrawingAreaProxy.cpp: (WebKit::DrawingAreaProxy::createFence): Stub implementation. Assert not to be reached here since it's only implemented on Mac so far. * UIProcess/DrawingAreaProxy.h: * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h: * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence): Renamed from createFenceForGeometryUpdate() since we are using it for more than just updating geometry. (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry): Update due to method rename. 2016-05-05 Brady Eidson Modern IDB (Workers): Get everything to the right threads. https://bugs.webkit.org/show_bug.cgi?id=157398 Reviewed by Alex Christensen. * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::putOrAdd): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: 2016-05-05 Manuel Rego Casasnovas [GTK] Remove "region based columns" runtime feature remainings https://bugs.webkit.org/show_bug.cgi?id=157393 The runtime feature was removed in r168978, and the usage in WebKitSettings.cpp in r168988. However it was still around in ExperimentalFeatures class. Reviewed by Michael Catanzaro. * UIProcess/gtk/ExperimentalFeatures.cpp: Remove runtime feature. * UIProcess/gtk/ExperimentalFeatures.h: Ditto. 2016-05-05 Manuel Rego Casasnovas [GTK] Add CSS Grid Layout as experimental feature https://bugs.webkit.org/show_bug.cgi?id=157391 Reviewed by Michael Catanzaro. Now that we've a runtime feature again for CSS Grid Layout (r200215), we can recover the old patch (r162215) that allows to enable/disable CSS Grid Layout through the environment variable WEBKITGTK_EXPERIMENTAL_FEATURES. Example: WEBKITGTK_EXPERIMENTAL_FEATURES="CSS_GRID_LAYOUT=1" * UIProcess/API/gtk/WebKitSettings.cpp: (webKitSettingsConstructed): Use new experimental feature to enable or disable CSS Grid Layout. * UIProcess/gtk/ExperimentalFeatures.cpp: Add new experimental feature. * UIProcess/gtk/ExperimentalFeatures.h: Ditto. 2016-05-05 Jer Noble [WK2] Media controls don't update if controller is created after the interface is created https://bugs.webkit.org/show_bug.cgi?id=157376 Reviewed by Beth Dakin. Implement the new getter methods on WebPlaybackSessionModelContext by caching the values passed through WebPlaybackSessionManagerProxy. * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: (WebKit::WebPlaybackSessionManagerProxy::setCurrentTime): (WebKit::WebPlaybackSessionManagerProxy::setBufferedTime): (WebKit::WebPlaybackSessionManagerProxy::setSeekableRangesVector): (WebKit::WebPlaybackSessionManagerProxy::setCanPlayFastReverse): (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionOptions): (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionOptions): (WebKit::WebPlaybackSessionManagerProxy::setExternalPlaybackProperties): (WebKit::WebPlaybackSessionManagerProxy::setWirelessVideoPlaybackDisabled): (WebKit::WebPlaybackSessionManagerProxy::setDuration): (WebKit::WebPlaybackSessionManagerProxy::setRate): * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h: * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenModelContext::requestFullscreenMode): Deleted. (WebKit::WebVideoFullscreenModelContext::setVideoLayerFrame): Deleted. (WebKit::WebVideoFullscreenModelContext::setVideoLayerGravity): Deleted. (WebKit::WebVideoFullscreenModelContext::fullscreenModeChanged): Deleted. (WebKit::WebVideoFullscreenModelContext::isVisible): Deleted. (WebKit::WebVideoFullscreenModelContext::didSetupFullscreen): Deleted. (WebKit::WebVideoFullscreenModelContext::didEnterFullscreen): Deleted. (WebKit::WebVideoFullscreenModelContext::didExitFullscreen): Deleted. (WebKit::WebVideoFullscreenModelContext::didCleanupFullscreen): Deleted. (WebKit::WebVideoFullscreenManagerProxy::WebVideoFullscreenManagerProxy): Deleted. (WebKit::WebVideoFullscreenManagerProxy::~WebVideoFullscreenManagerProxy): Deleted. 2016-05-05 Dean Jackson Shadow DOM should not be experimental https://bugs.webkit.org/show_bug.cgi?id=157384 Reviewed by Anders Carlsson. Shadow DOM is not an experimental feature. We want it enabled by default. This fixes the timeout in: WebKit2.InjectedBundleMakeAllShadowRootOpenTest * Shared/WebPreferencesDefinitions.h: Move the Shadow DOM preference out of Experimental. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-05-05 Simon Fraser Revert r200390, thus putting r199259 and r200161 and back. * Shared/VisibleContentRectUpdateInfo.cpp: (WebKit::VisibleContentRectUpdateInfo::encode): (WebKit::VisibleContentRectUpdateInfo::decode): * Shared/VisibleContentRectUpdateInfo.h: (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): (WebKit::VisibleContentRectUpdateInfo::enclosedInScrollableAncestorView): (WebKit::operator==): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didInvokeUIScrollViewDelegateCallback]): (-[WKWebView _didFinishScrolling]): (-[WKWebView scrollViewDidScroll:]): (-[WKWebView scrollViewDidZoom:]): (-[WKWebView scrollViewDidEndZooming:withView:atScale:]): (-[WKWebView _scrollViewDidInterruptDecelerating:]): (-[WKWebView _visibleRectInEnclosingScrollView:]): (-[WKWebView _visibleContentRect]): (-[WKWebView _didScroll]): (-[WKWebView _enclosingScrollerScrollingEnded:]): (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _updateVisibleContentRects]): (-[WKWebView _updateVisibleContentRectAfterScrollInView:]): (scrollViewCanScroll): (-[WKWebView _updateContentRectsWithState:]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::updateVisibleContentRects): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateVisibleContentRects): 2016-05-02 Sam Weinig On platforms that support it, use a SecTrustRef as the basis of CertificateInfo instead of a chain of SecCertificateRefs. https://bugs.webkit.org/show_bug.cgi?id=157220 Reviewed by Darin Adler. * Shared/Authentication/mac/AuthenticationManager.mac.mm: (WebKit::leafCertificate): (WebKit::chain): (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge): When supported, get the SecCertificateRef from the SecTrustRef rather than the stored certificate chain. * Shared/cf/ArgumentCodersCF.cpp: (IPC::typeFromCFTypeRef): (IPC::encode): (IPC::decode): * Shared/cf/ArgumentCodersCF.h: Add support for encoding/decoding SecTrustRef objects. * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Add support for encoding/decoding CertificateInfo's that contain SecTrustRef objects. (IPC::encodeNSError): (IPC::decodeNSError): Simplify error encoding/decoding by not using an addition CertificateInfo object for encoding the peerCertificateChain. Also, add the peerTrust to the userInfo that get's encoded/decoded. * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView serverTrust]): (-[WKWebView certificateChain]): Add new serverTrust API and deprecate certificateChain. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::willChangeCertificateInfo): (WebKit::NavigationState::didChangeCertificateInfo): Add support for KVO of -[WKWebView serverTrust]. 2016-05-05 Daniel Bates Remove workaround added in r200391 (rdar://problem/25992976) https://bugs.webkit.org/show_bug.cgi?id=157378 Reviewed by Anders Carlsson. Following the fix for we can remove the workaround added in r200391 (rdar://problem/25992976). * Shared/mac/CodeSigning.mm: (WebKit::secCodeSigningIdentifier): 2016-05-04 Dean Jackson Experimental Features don't need an "Experimental" prefix https://bugs.webkit.org/show_bug.cgi?id=157363 Reviewed by Anders Carlsson. Since we're not persisting the value of the experimental features, it's unlikely there will ever be the case where we move a Preference from experimental to normal and use a stored value. * Shared/WebPreferencesDefinitions.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-05-04 Dean Jackson Experimental features should toggle runtime flags https://bugs.webkit.org/show_bug.cgi?id=157353 Reviewed by Anders Carlsson. Hook up the experimental WebPreferences to RuntimeEnabledFeatures. In the process I removed the general preference for WebGL 2 (we already had an experimental feature for it) and moved Custom Elements and Shadow DOM to experimental. I also removed the C versions of the preferences, since experimental features only need the ObjC API (which is generated automatically). * Shared/WebPreferencesDefinitions.h: Move/remove some features and make the experimental section more clear. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetWebGL2Enabled): Deleted. (WKPreferencesGetWebGL2Enabled): Deleted. (WKPreferencesSetShadowDOMEnabled): Deleted. (WKPreferencesGetShadowDOMEnabled): Deleted. (WKPreferencesSetCustomElementsEnabled): Deleted. (WKPreferencesGetCustomElementsEnabled): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::updateBoolValueForExperimentalFeatureKey): A version of updateBoolValueForKey that doesn't call the platform function (e.g. doesn't save to NSUserDefaults). * UIProcess/WebPreferences.h: * UIProcess/mac/WebPreferencesMac.mm: (WebKit::WebPreferences::platformInitializeStore): Deleted. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-05-04 Dean Jackson TestRunner should always enable all the experimental features https://bugs.webkit.org/show_bug.cgi?id=157360 Reviewed by Anders Carlsson. Experimental features are disabled by default, but it is a pain to enable them in every test. Instead, have the test runner turn them all on. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesEnableAllExperimentalFeatures): * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::enableAllExperimentalFeatures): * UIProcess/WebPreferences.h: 2016-05-04 Gyuyoung Kim Add WKPreference for SelectionPaintingWithoutSelectionGaps https://bugs.webkit.org/show_bug.cgi?id=156900 Reviewed by Michael Catanzaro. Unlike other browsers WebKit has been drawing selection gaps between render blocks during the text selection. This often cause text selection screen looks messy. This patch adds a setting method to disable the functionality, and EFL port disables it by default. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetSelectionPaintingWithoutSelectionGapsEnabled): (WKPreferencesGetSelectionPaintingWithoutSelectionGapsEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-05-04 Zan Dobersek [CoordGraphics] CompositingCoordinator should hande root compositing and view overlay layers separately https://bugs.webkit.org/show_bug.cgi?id=157305 Reviewed by Carlos Garcia Campos. Update CoordinatedLayerTreeHost and ThreadCoordinatedLayerTreeHost to correctly use setRootCompositingLayer() and setViewOverlayRootLayer() methods on the CompositingCoordinator object. CoordinatedLayerTreeHost doesn't have to keep a pointer to the root compositing layer anymore. updateRootLayers() can be removed. ThreadCoordinatedLayerTreeHost doen't have to keep a pointer to both the root compositing and the view overlay layers anymore. Similarly, updateRootLayers() can be removed. * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::setViewOverlayRootLayer): (WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer): (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost): Deleted. (WebKit::CoordinatedLayerTreeHost::updateRootLayers): Deleted. * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::setRootCompositingLayer): (WebKit::ThreadedCoordinatedLayerTreeHost::setViewOverlayRootLayer): (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): Deleted. (WebKit::ThreadedCoordinatedLayerTreeHost::updateRootLayers): Deleted. * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: 2016-05-03 Beth Dakin Add VideoControlsManager tests https://bugs.webkit.org/show_bug.cgi?id=157332 -and corresponding- rdar://problem/24358431 Reviewed by Sam Weinig. Expose _hasActiveVideoForControlsManager on WKWebViewPrivate for the sake of testing. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _hasActiveVideoForControlsManager]): (-[WKWebView _doAfterNextPresentationUpdate:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2016-05-03 Jer Noble [iOS][WK2] Allow WKWebView to play local filesystem media when created with -loadFileURL:allowingReadAccessToURL: https://bugs.webkit.org/show_bug.cgi?id=156875 Reviewed by Alexey Proskuryakov. Grant AVFoundation the right to issue file read sandbox extensions from the WebContent process to the mediaserverd process, so that it can play back local media files. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2016-05-03 Jiewen Tan File Upload: Photo upload name is always generic (image.jpg) https://bugs.webkit.org/show_bug.cgi?id=157291 Reviewed by Darin Adler. Use the original filename as the name of an uploaded image instead of a generic name, i.e. image.jpg. * Platform/spi/ios/PhotosSPI.h: Added. * UIProcess/ios/forms/WKFileUploadPanel.mm: (-[WKFileUploadPanel _uploadItemForImage:withAssetURL:successBlock:failureBlock:]): * WebKit2.xcodeproj/project.pbxproj: 2016-05-03 Chris Dumez [WK2][DiskCache] Store common HTTP header names as strings https://bugs.webkit.org/show_bug.cgi?id=157326 Reviewed by Antti Koivisto. Store common HTTP header names as strings in the disk cache instead of using their value in the HTTPHeaderName enumeration. Having the disk cache rely in the HTTPHeaderName enumeration is risky becomes it means the cached data would become invalid every time someone updates HTTPHeaderNames.in in WebCore. If someone were to update HTTPHeaderNames.in without bumping the disk cache version, we would end up with wrongly recognized HTTP header names after loading responses from the cache. * NetworkProcess/cache/NetworkCacheCoders.cpp: (WebKit::NetworkCache::Coder::encode): (WebKit::NetworkCache::Coder::decode): * NetworkProcess/cache/NetworkCacheCoders.h: * NetworkProcess/cache/NetworkCacheStorage.h: 2016-05-03 Daniel Bates Temporary workaround for Apple Internal builds For Apple Internal builds treat error code errSecCSGuestInvalid as if it were error code errSecCSUnsigned. We will look to remove this workaround in the fix for . * Shared/mac/CodeSigning.mm: (WebKit::secCodeSigningIdentifier): 2016-05-03 Chris Dumez Unreviewed, rolling out r199259 and r200161. Seems to have caused a ~1.2% PLT regression on iOS Reverted changesets: "[iOS WK2] WKWebViews should consult ancestor UIScrollViews to determine tiling area" https://bugs.webkit.org/show_bug.cgi?id=156429 http://trac.webkit.org/changeset/199259 "[iOS WK2] When determining tile size, check whether ancestor UIScrollViews are actually scrollable" https://bugs.webkit.org/show_bug.cgi?id=157107 http://trac.webkit.org/changeset/200161 2016-05-03 Dean Jackson CSS Grid should be an experimental feature flag https://bugs.webkit.org/show_bug.cgi?id=157327 Reviewed by Anders Carlsson. The CSS Grid Layout runtime flag was exposed by a WebKit preference. It was in the experimental section but was missing the "Experimental" prefix. It was also missing the human readable description. Lastly, there is no need for the C API for experimental features. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetCSSGridLayoutEnabled): Deleted. (WKPreferencesGetCSSGridLayoutEnabled): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-05-03 Alex Christensen Remove firing assertion when redirecting https://bugs.webkit.org/show_bug.cgi?id=155800 rdar://25299194 Reviewed by Sam Weinig. * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]): With NSURLConnection, we stopped getting delegate callbacks once the delegate is destroyed, and everything was cancelled. With NSURLSession we continue getting delegate callbacks because the session's delegate is not destroyed after each load. As documented in NSURLSession.h: "In some cases, the task may signal other work before it acknowledges the cancelation." In the cases where we cancel a load, delete the NetworkLoad and corresponding NetworkDataTask, we want to call all completion handlers indicating that we really want to cancel instead of asserting. 2016-05-02 Darin Adler Change IDL enumerations to be nested in their C++ class instead of at WebCore namespace level https://bugs.webkit.org/show_bug.cgi?id=157257 Reviewed by Chris Dumez. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::loadResource): Updated since we changed ReferrerHeaderPolicy back to ReferrerPolicy. (WebKit::WebLoaderStrategy::schedulePluginStreamLoad): Ditto. 2016-05-02 Brady Eidson Const-ify some IDB code. https://bugs.webkit.org/show_bug.cgi?id=157287 Reviewed by Alex Christensen. * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: (WebKit::WebIDBConnectionToServer::deleteDatabase): (WebKit::WebIDBConnectionToServer::openDatabase): (WebKit::WebIDBConnectionToServer::abortTransaction): (WebKit::WebIDBConnectionToServer::commitTransaction): (WebKit::WebIDBConnectionToServer::didFinishHandlingVersionChangeTransaction): * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: 2016-05-02 Simon Fraser Sort the project file. * WebKit2.xcodeproj/project.pbxproj: 2016-05-02 Simon Fraser Fix shouldUpdateScrollLayerPositionSynchronously() for non-main frames. Remove updatesScrollLayerPositionOnMainThread() https://bugs.webkit.org/show_bug.cgi?id=157277 Reviewed by Dean Jackson, Tim Horton. Remove updatesScrollLayerPositionOnMainThread() which is unused by all ports. * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h: 2016-05-02 Alex Christensen Crash if a certificate chain has null certificates https://bugs.webkit.org/show_bug.cgi?id=157206 Reviewed by Alexey Proskuryakov. * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::certificatesMatch): SecTrustGetCertificateAtIndex can return null. If this ever happens, something has gone horribly wrong in the security code and we should crash. See rdar://problem/21723172 2016-05-02 Myles C. Maxfield Addressing post-review comments after r200116 https://bugs.webkit.org/show_bug.cgi?id=157228 Reviewed by Anders Carlsson. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _initializeWithConfiguration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration encodeWithCoder:]): (-[WKWebViewConfiguration initWithCoder:]): (-[WKWebViewConfiguration copyWithZone:]): * UIProcess/WebPageProxy.cpp: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2016-05-02 Daniel Bates DatabaseTracker::closeAllDatabases calls Database::close from the wrong thread https://bugs.webkit.org/show_bug.cgi?id=147672 Reviewed by Brady Eidson. Call DatabaseTracker::closeAllDatabases() with CurrentQueryBehavior::Interrupt so that we abort a long running query and close the database immediately to avoid holding a locked file when the process is suspended. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::processWillSuspendImminently): 2016-05-01 Darin Adler Update Fetch to use enum class instead of string for enumerations https://bugs.webkit.org/show_bug.cgi?id=157241 Reviewed by Chris Dumez. * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::loadResource): Updated for the change where I renamed ReferrerPolicy to ReferrerHeaderPolicy, at least for now. (WebKit::WebLoaderStrategy::schedulePluginStreamLoad): Ditto. 2016-05-01 Konstantin Tokarev Fixed build with !ENABLED(DATABASE_PROCESS). Unreviewed build fix. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs): 2016-04-29 Chris Dumez Drop useless check in SpeculativeLoadManager::registerLoad() https://bugs.webkit.org/show_bug.cgi?id=157204 Reviewed by Antti Koivisto. Drop useless check in SpeculativeLoadManager::registerLoad(). There is no way to end up this code path with a non-HTTP family request. * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad): 2016-04-29 Brian Burg Web Automation: add SPI to mark an existing NSEvent as synthesized for automation https://bugs.webkit.org/show_bug.cgi?id=157221 Reviewed by Timothy Hatcher. In cases where an NSEvent is duplicated, clients need to re-mark an NSEvent as synthesized for automation if the original NSEvent was marked as such. * UIProcess/API/Cocoa/_WKAutomationSession.h: * UIProcess/API/Cocoa/_WKAutomationSession.mm: (-[_WKAutomationSession markEventAsSynthesizedForAutomation:]): * UIProcess/Automation/WebAutomationSession.h: * UIProcess/Cocoa/WebAutomationSessionCocoa.mm: (WebKit::WebAutomationSession::sendSynthesizedEventsToPage): (WebKit::WebAutomationSession::markEventAsSynthesizedForAutomation): 2016-04-29 Brian Burg Web Automation: use a magic eventNumber as a fallback for detecting NSEvents synthesized for automation https://bugs.webkit.org/show_bug.cgi?id=157222 Reviewed by Timothy Hatcher. Sometimes events are copied and redelivered in a way that can't be reliably intercepted, so use eventNumber as an alternate means of detecting synthesized mouse NSEvents. * UIProcess/Cocoa/WebAutomationSessionCocoa.mm: (WebKit::WebAutomationSession::wasEventSynthesizedForAutomation): If it's a mouse-related event, check the eventNumber if the associated object was missing. (WebKit::WebAutomationSession::platformSimulateMouseInteraction): Most real events from input devices fill in eventNumber with a non-zero value. In my testing, using zero did not seem to adversely affect event delivery. 2016-04-29 Joseph Pecoraro Web Inspector: Issues inspecting the inspector, pausing on breakpoints causes content to not load https://bugs.webkit.org/show_bug.cgi?id=157198 Reviewed by Timothy Hatcher. * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.h: * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp: (WebKit::WebInspectorFrontendAPIDispatcher::reset): (WebKit::WebInspectorFrontendAPIDispatcher::frontendLoaded): (WebKit::WebInspectorFrontendAPIDispatcher::suspend): (WebKit::WebInspectorFrontendAPIDispatcher::unsuspend): (WebKit::WebInspectorFrontendAPIDispatcher::dispatchCommand): (WebKit::WebInspectorFrontendAPIDispatcher::dispatchMessageAsync): (WebKit::WebInspectorFrontendAPIDispatcher::evaluateOrQueueExpression): (WebKit::WebInspectorFrontendAPIDispatcher::evaluateQueuedExpressions): Avoid evaluating expressions when the page is paused. Generalize the message queueing and dispatching for pause/suspend that we already had for waiting for the frontend page to be loaded. * WebProcess/WebPage/WebInspectorUI.h: * WebProcess/WebPage/WebInspectorUI.cpp: (WebKit::WebInspectorUI::pagePaused): (WebKit::WebInspectorUI::pageUnpaused): When the frontend page pauses/unpauses, suspend/resume the dispatcher. 2016-04-29 Chris Dumez Remove unnecessary isolated String copying from one of NetworkCache::Key's constructor https://bugs.webkit.org/show_bug.cgi?id=157207 Reviewed by Antti Koivisto. Remove unnecessary isolated String copying from one of NetworkCache::Key's constructor. We are anyway going to create isolated copies if the Key ends up getting copied. * NetworkProcess/cache/NetworkCacheKey.cpp: (WebKit::NetworkCache::Key::Key): 2016-04-29 Brian Burg Web Automation: performMouseInteraction command computes mouse event coordinates incorrectly https://bugs.webkit.org/show_bug.cgi?id=157218 Reviewed by Timothy Hatcher. This patch fixes two issues: the min/max clamp was in the wrong order, and the y-value did not account for the window's top content inset. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::WebAutomationSession::performMouseInteraction): 2016-04-29 Dean Jackson RTL popup menu is in the wrong location" https://bugs.webkit.org/show_bug.cgi?id=157159 http://trac.webkit.org/changeset/200217 2016-04-29 Claudio Saavedra [GTK] Move WK2 shareable code out from gtk directories https://bugs.webkit.org/show_bug.cgi?id=157135 Reviewed by Darin Adler. Both NetworkProcessMain and InjectedBundle can go out from their respective gtk directories. * NetworkProcess/gtk/NetworkProcessMainGtk.cpp: (WebKit::NetworkProcessMainUnix): Deleted. * NetworkProcess/soup/NetworkProcessMainSoup.cpp: Renamed from Source/WebKit2/NetworkProcess/gtk/NetworkProcessMainGtk.cpp. (WebKit::NetworkProcessMainUnix): * PlatformGTK.cmake: Update. * WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp. (WebKit::InjectedBundle::initialize): (WebKit::InjectedBundle::setBundleParameter): (WebKit::InjectedBundle::setBundleParameters): * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp: (WebKit::InjectedBundle::initialize): Deleted. (WebKit::InjectedBundle::setBundleParameter): Deleted. (WebKit::InjectedBundle::setBundleParameters): Deleted. 2016-04-28 Dean Jackson RTL elements and