2014-07-23 Mark Hahnenberg Refactor our current implementation of for-in https://bugs.webkit.org/show_bug.cgi?id=134142 Reviewed by Filip Pizlo. * WebProcess/Plugins/Netscape/JSNPObject.cpp: (WebKit::JSNPObject::invalidate): Fixed an invalid ASSERT that was crashing in debug builds. 2014-05-08 Simon Fraser [iOS WK2] Bottom-relative position:fixed elements are misplaced on page load https://bugs.webkit.org/show_bug.cgi?id=132719 Reviewed by Benjamin Poulain. If we haven't received visible rects from the web process, compute the fixed position rect, but only after scale has been set. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::viewportConfigurationChanged): 2014-05-08 Jer Noble [Mac, iOS] Add source application accounting to AVURLAsset. https://bugs.webkit.org/show_bug.cgi?id=132637 Reviewed by Eric Carlson. Add accessor for sourceApplicationIdentifier. * NetworkProcess/RemoteNetworkingContext.h: * NetworkProcess/mac/RemoteNetworkingContext.mm: (WebKit::RemoteNetworkingContext::sourceApplicationIdentifier): * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h: * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: (WebKit::WebFrameNetworkingContext::sourceApplicationIdentifier): 2014-05-08 Tim Horton [iOS WebKit2] Flush RemoteLayerBackingStore contexts on a secondary queue ​https://bugs.webkit.org/show_bug.cgi?id=132667 Rubber-stamped by Simon Fraser. * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::flushLayers): Add a null check to fix a crash on layers which lose backing store. 2014-05-08 Beth Dakin REGRESSION (r168053): Phone number detection boxes are wrong when scrolled https://bugs.webkit.org/show_bug.cgi?id=132706 -and corresponding- Reviewed by Tim Horton. We need to paint the boxes in Document coordinates. Range::boundingRect() was giving us a point that took scroll position into account, and that’s not what we want. Here we use Range::textQuads() instead so that we can get something in Document coordinates, and then we need to convert that up to the main Document’s coordinates. * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm: (WebKit::textQuadsToBoundingRectForRange): (WebKit::TelephoneNumberOverlayController::drawRect): The telephone click function wants a point in Window coordinates. (WebKit::TelephoneNumberOverlayController::mouseEvent): 2014-05-08 Tim Horton [iOS WebKit2] Flush RemoteLayerBackingStore contexts on a secondary queue https://bugs.webkit.org/show_bug.cgi?id=132667 Reviewed by Darin Adler. * Shared/mac/RemoteLayerBackingStore.h: * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::takeFrontContextPendingFlush): (WebKit::RemoteLayerBackingStore::flush): Deleted. Add takeFrontContextPendingFlush, which returns the painted-but-not-yet-flushed front context, and drops our reference to it. This needs to be called on all backing store between paints. * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::hasFlushed): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea): (WebKit::RemoteLayerTreeDrawingArea::~RemoteLayerTreeDrawingArea): (WebKit::RemoteLayerTreeDrawingArea::flushLayers): (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::create): (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::BackingStoreFlusher): (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush): (WebKit::flushBackingStoreChangesInTransaction): Deleted. Flush backing store and send the layer tree commit to the UI process from a dispatch queue. We will only ever have a single commit in flight at a time, and there's a new RELEASE_ASSERT to ensure that is the case. We package up the commit on the main thread; the queue calls CGContextFlush on all of the newly painted contexts and then tosses the commit over to the UI process. This is a win in many cases because the Web process main thread can go ahead and do other non-painting tasks while the queue is blocked on painting. 2014-05-08 Tim Horton [wk2] Don't use the XPC-based plugin process for Adobe Reader https://bugs.webkit.org/show_bug.cgi?id=132701 Reviewed by Anders Carlsson. * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: (WebKit::shouldUseXPC): Rename the debugging default to a more modern and accurate name. Don't use XPC for Adobe Reader. (WebKit::PluginProcessProxy::platformGetLaunchOptions): Move the check for plugins that need an executable heap into shouldUseXPC. 2014-05-08 Benjamin Poulain [iOS][WK2] Remove an incorrect assertion on asynchronous touch dispatch https://bugs.webkit.org/show_bug.cgi?id=132660 Reviewed by Enrica Casucci. This assertion no longer make sense after r168393. Now the asynchronous behavior is maintained until the last finger leaves the screen. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::handleTouchEventAsynchronously): 2014-05-08 Alexey Proskuryakov Make BlobDataFileReference manage its sandbox extension https://bugs.webkit.org/show_bug.cgi?id=132689 Reviewed by Anders Carlsson. * CMakeLists.txt: * PlatformGTK.cmake: * WebKit2.xcodeproj/project.pbxproj: Added BlobDataFileReferenceWithSandboxExtension. * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: (WebKit::NetworkBlobRegistry::registerFileBlobURL): (WebKit::NetworkBlobRegistry::registerBlobURL): (WebKit::NetworkBlobRegistry::registerBlobURLForSlice): (WebKit::NetworkBlobRegistry::unregisterBlobURL): (WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose): (WebKit::NetworkBlobRegistry::filesInBlob): (WebKit::NetworkBlobRegistry::sandboxExtensions): Deleted. * NetworkProcess/FileAPI/NetworkBlobRegistry.h: We no longer track sandbox extensions here. Instead, provide a way to get files for a blob, which contain extensions and can allow access to themselves. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::NetworkResourceLoader): (WebKit::NetworkResourceLoader::consumeSandboxExtensions): (WebKit::NetworkResourceLoader::invalidateSandboxExtensions): * NetworkProcess/NetworkResourceLoader.h: Allow/revoke access to files in blob, just like we do for explicitly passed extensions. * Shared/BlobDataFileReferenceWithSandboxExtension.cpp: Added. (WebKit::BlobDataFileReferenceWithSandboxExtension::BlobDataFileReferenceWithSandboxExtension): (WebKit::BlobDataFileReferenceWithSandboxExtension::~BlobDataFileReferenceWithSandboxExtension): (WebKit::BlobDataFileReferenceWithSandboxExtension::prepareForFileAccess): (WebKit::BlobDataFileReferenceWithSandboxExtension::revokeFileAccess): * Shared/BlobDataFileReferenceWithSandboxExtension.h: Added. (WebKit::BlobDataFileReferenceWithSandboxExtension::create): A subclass of BlobDataFileReference that also contains a sandbox extension. NetworkProcess always uses it in BlobRegistryImpl. * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::registerFileBlobURL): * WebProcess/FileAPI/BlobRegistryProxy.h: Updated for BlobRegistry interface changes. BlobRegistryProxy doesn't really need a BlobDataFileReference here, as it only uses a path, but it needs to implement the same interface as BlobRegistryImpl. 2014-05-08 Brady Eidson "shouldKeepCurrentBackForwardListItemInList" API should pass clientInfo to the callback and https://bugs.webkit.org/show_bug.cgi?id=132692 Reviewed by Tim Horton. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageLoaderClient): * UIProcess/API/C/WKPageLoaderClient.h: 2014-05-08 Antti Koivisto [iOS WebKit2] Can't activate text fields on Facebook https://bugs.webkit.org/show_bug.cgi?id=132682 Reviewed by Enrica Casucci. * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: (WebKit::WebChromeClient::observedContentChange): Implement content change observer callback. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleSyntheticClick): If the event gets canceled by a potential change (a started short-duration timer) save the position and node so we can continue later. (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver): If it turns out the observed timer changed nothing continue the click event. (WebKit::WebPage::completeSyntheticClick): Factored click event dispatch part of handleSyntheticClick here. 2014-05-07 Gyuyoung Kim [CoordinatedGraphics][WK2] Scale factor and scroll position is not being restored properly in a back/forward load https://bugs.webkit.org/show_bug.cgi?id=126022 Reviewed by Benjamin Poulain. Original author : Thiago de Barros Lacerda, and finished by Gyuyoung Kim. When user is navigating back/forward to a page that has been scrolled and/or scaled, that page must be shown with its last scroll position and scale factor. However, when fixed layout was enabled with CoordinatedGraphics and TILED_BACKING_STORE, Page::setPageScaleFactor() doesn't send previous scroll position since r165652 and r165913. This patch allows the Page::setPageScaleFactor() send stored position to WK2 implementation. * UIProcess/CoordinatedGraphics/WebView.cpp: (WebKit::WebView::didCommitLoadForMainFrame): 2014-05-07 Simon Fraser Put a better version of the assertion back, and add one when we ensureBackingStore. Reviewed by Tim Horton. * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::recursiveBuildTransaction): (WebKit::PlatformCALayerRemote::ensureBackingStore): 2014-05-07 Simon Fraser This assertion was wrong and fired every time. Remove it. * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::recursiveBuildTransaction): 2014-05-07 Enrica Casucci WK2: Programatic scroll requests during scroll or zoom animation to reveal focused element are ignored. https://bugs.webkit.org/show_bug.cgi?id=132657 Reviewed by Benjamin Poulain. With the scrolling model we use on iOS, a programatic scroll request can be received while we are still animating to reveal the focused input element. Changing the scroll offset while animating leads to unpredictable results. We now cancel the animation if a programatic scroll request is received. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _scrollToContentOffset:WebCore::]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getAssistedNodeInformation): 2014-05-07 Simon Fraser [iOS WK2] Speculative fix for crash in PlatformCALayerRemote::recursiveBuildTransaction https://bugs.webkit.org/show_bug.cgi?id=132666 Reviewed by Tim Horton. Crash reports suggest that owner() can be null. Assert and protect against this. * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::recursiveBuildTransaction): 2014-05-07 Dan Bernstein [iOS] Unparenting a WKWebView that’s loading pauses it https://bugs.webkit.org/show_bug.cgi?id=132659 Reviewed by Tim Horton. * UIProcess/Cocoa/NavigationState.h: Added a member variable. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::didChangeIsLoading): When transitioning into loading state, acquire a background activity token. When transitioning out of loading state, dispose of the token. 2014-05-07 Jeremy Jones HTMLMediaElement should exitFullscreen when view is removed from the window. https://bugs.webkit.org/show_bug.cgi?id=132506 Reviewed by Tim Horton. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::viewStateDidChange): Request WebVideoFUllscreenManagerProxy to exitFullscreen when removed from the window. * UIProcess/ios/WebVideoFullscreenManagerProxy.h: Make requestExitFullscreen() public instead of private. 2014-05-07 Alexey Proskuryakov Make blob size computation lazy https://bugs.webkit.org/show_bug.cgi?id=132653 Reviewed by Anders Carlsson. * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: (WebKit::NetworkBlobRegistry::registerBlobURL): (WebKit::NetworkBlobRegistry::registerBlobURLForSlice): (WebKit::NetworkBlobRegistry::blobSize): * NetworkProcess/FileAPI/NetworkBlobRegistry.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::registerBlobURL): (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice): (WebKit::NetworkConnectionToWebProcess::blobSize): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::registerBlobURL): (WebKit::BlobRegistryProxy::registerBlobURLForSlice): (WebKit::BlobRegistryProxy::blobSize): * WebProcess/FileAPI/BlobRegistryProxy.h: 2014-05-06 Simon Fraser Add scrolling tree logging to RemoteLayerTree output https://bugs.webkit.org/show_bug.cgi?id=132640 Reviewed by Beth Dakin. Support scrolling tree logging in the RemoteLayerTree log channel output. Encode/decode ScrollingStateTree::hasChangedProperties() so we can use it to avoid logging. Log all the things. * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: (WebKit::RemoteScrollingCoordinatorTransaction::encode): (WebKit::RemoteScrollingCoordinatorTransaction::decode): (WebKit::RemoteScrollingTreeTextStream::RemoteScrollingTreeTextStream): (WebKit::RemoteScrollingTreeTextStream::increaseIndent): (WebKit::RemoteScrollingTreeTextStream::decreaseIndent): (WebKit::RemoteScrollingTreeTextStream::writeIndent): (WebKit::dumpProperty): (WebKit::RemoteScrollingTreeTextStream::operator<<): (WebKit::RemoteScrollingTreeTextStream::dump): (WebKit::RemoteScrollingTreeTextStream::recursiveDumpNodes): (WebKit::RemoteScrollingCoordinatorTransaction::description): (WebKit::RemoteScrollingCoordinatorTransaction::dump): * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): 2014-05-07 Hyowon Kim GraphicsLayer::client() should return a reference. https://bugs.webkit.org/show_bug.cgi?id=126372 Reviewed by Simon Fraser. GraphicsLayers always have a GraphicsLayerClient attached, so make client() a reference and remove some unnecessary branches. The author of the changes in the mac port is Andreas Kling . * WebProcess/WebPage/PageOverlayController.cpp: (WebKit::PageOverlayController::initialize): (WebKit::PageOverlayController::installPageOverlay): * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: (WebKit::LayerTreeHostGtk::initialize): (WebKit::LayerTreeHostGtk::createPageOverlayLayer): * WebProcess/WebPage/mac/GraphicsLayerCARemote.h: * WebProcess/WebPage/mac/RemoteLayerTreeContext.h: * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm: (WebKit::RemoteLayerTreeContext::createGraphicsLayer): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea): 2014-05-07 Shivakumar JM Cleanup the build from unused parameter in UIProcess Module https://bugs.webkit.org/show_bug.cgi?id=131969 Reviewed by Csaba Osztrogonác. Fixed unused parameter by omitting the parameter name * UIProcess/API/C/WKPage.cpp: (WKPageSetPageFindClient): * UIProcess/WebFindClient.cpp: (WebKit::WebFindClient::didFindString): 2014-05-07 Manuel Rego Casasnovas [CSS Grid Layout] Remove runtime feature https://bugs.webkit.org/show_bug.cgi?id=132382 Reviewed by Benjamin Poulain. Remove cssGridLayoutEnabled setting usage. * Shared/WebPreferencesStore.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetCSSGridLayoutEnabled): Deleted. (WKPreferencesGetCSSGridLayoutEnabled): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/gtk/WebKitSettings.cpp: (webKitSettingsConstructed): * UIProcess/gtk/ExperimentalFeatures.cpp: * UIProcess/gtk/ExperimentalFeatures.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): * mac/WebKit2.order: 2014-05-07 Csaba Osztrogonác URTBF after r168393 to fix !IOS builds. * Shared/WebEvent.h: 2014-05-06 Brady Eidson Followup to "Add WK2 SPI to prevent the previous back/forward item from remaining in the list" and https://bugs.webkit.org/show_bug.cgi?id=132636 Reviewed by NOBODY (My mistake while addressing previous review feedback) * UIProcess/API/C/WKPage.cpp: (WKPageSetPageLoaderClient): During review feedback, this client switched from default negative to default positve, so when the client isn't implemented... return true instead of false. * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::addItem): Fix nonsensical comments while I'm at it. 2014-05-06 Brady Eidson Add WK2 SPI to prevent the previous back/forward item from remaining in the list and https://bugs.webkit.org/show_bug.cgi?id=132636 Reviewed by Sam Weinig. Add new PageLoaderClient SPI to keep the current back/forward item from remaining in the list: * UIProcess/API/APILoaderClient.h: (API::LoaderClient::shouldKeepCurrentBackForwardListItemInList): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageLoaderClient): * UIProcess/API/C/WKPageLoaderClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList): * UIProcess/WebPageProxy.h: * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::addItem): Use that SPI to determine whether we should insert the new item after the previous item, or simply replace the previous item. (WebKit::WebBackForwardList::goToItem): Use that SPI to determine whether the previous item stays or goes. 2014-05-06 Dan Bernstein -[WKWebView isLoading] is NO immediately after -loadRequest: until the provisional load starts https://bugs.webkit.org/show_bug.cgi?id=132639 Reviewed by Darin Adler. * UIProcess/PageLoadState.cpp: (WebKit::PageLoadState::commitChanges): Updated for change from isLoadingState to isLoading. (WebKit::PageLoadState::isLoading): Renamed from isLoadingState, changed to take Data and check whether there is a non-null pending API request URL. If so, return true. * UIProcess/PageLoadState.h: 2014-05-06 Dean Jackson [Mac] Allow focus rings to redraw themselves if necessary https://bugs.webkit.org/show_bug.cgi?id=132593 Reviewed by Simon Fraser. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): Add DrawFocusRingAtTime and DrawCellFocusRingWithFrameAtTime. 2014-05-06 Benjamin Poulain [iOS WebKit2]: Keep the order of contentView in _scrollView after rotation https://bugs.webkit.org/show_bug.cgi?id=132634 Reviewed by Enrica Casucci. Nice idea of Yongjun. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _endAnimatedResize]): 2014-05-06 Timothy Hatcher Take WKView's topContentInset into account when docking Web Inspector to the right. https://bugs.webkit.org/show_bug.cgi?id=132631 Reviewed by Joseph Pecoraro. * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::inspectedViewFrameDidChange): Subtract topContentInset from the height of the frame for the Inspector. 2014-05-06 Benjamin Poulain [iOS][WK2] WebKit2 does not set CanPreventNativeGestures on the platform events https://bugs.webkit.org/show_bug.cgi?id=132594 Reviewed by Simon Fraser. Set CanPreventNativeGestures on the plaform event. Change the tracking of WKContentView to be similar to WebPageProxy. * Shared/WebEvent.h: (WebKit::WebTouchEvent::WebTouchEvent): (WebKit::WebTouchEvent::canPreventNativeGestures): (WebKit::WebTouchEvent::setCanPreventNativeGestures): * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent): * Shared/ios/WebTouchEventIOS.cpp: (WebKit::WebTouchEvent::encode): (WebKit::WebTouchEvent::decode): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _webTouchEventsRecognized:]): 2014-05-06 Benjamin Poulain [iOS][WK2] Add tap highlight on the simple UITapGestureRecognizer https://bugs.webkit.org/show_bug.cgi?id=132623 Reviewed by Enrica Casucci. Add a low latency highlight for tap/click. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::commitPotentialTapFailed): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView _showTapHighlightWithColor:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]): (-[WKContentView _didGetTapHighlightForRequest:color:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]): (-[WKContentView _finishInteraction]): (-[WKContentView _highlightLongPressRecognized:]): (-[WKContentView _singleTapRecognized:]): (-[WKContentView _singleTapDidReset:]): (-[WKContentView _commitPotentialTapFailed]): (-[WKContentView _singleTapCommited:]): (-[WKContentView _attemptClickAtLocation:]): * UIProcess/ios/WKSyntheticClickTapGestureRecognizer.h: Added. * UIProcess/ios/WKSyntheticClickTapGestureRecognizer.m: Added. (-[WKSyntheticClickTapGestureRecognizer setGestureRecognizedTarget:action:]): (-[WKSyntheticClickTapGestureRecognizer setResetTarget:action:]): (-[WKSyntheticClickTapGestureRecognizer setState:]): (-[WKSyntheticClickTapGestureRecognizer reset]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::potentialTapAtPosition): (WebKit::WebPageProxy::commitPotentialTap): (WebKit::WebPageProxy::cancelPotentialTap): (WebKit::WebPageProxy::tapHighlightAtPosition): (WebKit::WebPageProxy::commitPotentialTapFailed): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleSyntheticClick): (WebKit::WebPage::handleTap): (WebKit::WebPage::sendTapHighlightForNodeIfNecessary): (WebKit::WebPage::potentialTapAtPosition): (WebKit::WebPage::commitPotentialTap): (WebKit::WebPage::cancelPotentialTap): (WebKit::WebPage::tapHighlightAtPosition): 2014-05-06 Anders Carlsson Put WebArchive and WebArchiveResource in the API namespace. Rubber-stamped by Dan Bernstein. * Shared/API/c/WKSharedAPICast.h: * Shared/API/c/mac/WKWebArchive.cpp: (WKWebArchiveGetTypeID): (WKWebArchiveCreate): (WKWebArchiveCreateWithData): (WKWebArchiveCreateFromRange): (WKWebArchiveCopyMainResource): * Shared/API/c/mac/WKWebArchiveResource.cpp: (WKWebArchiveResourceGetTypeID): (WKWebArchiveResourceCreate): * Shared/APIWebArchive.cpp: Renamed from Source/WebKit2/Shared/WebArchive.cpp. (API::WebArchive::create): (API::WebArchive::WebArchive): (API::WebArchive::~WebArchive): (API::WebArchive::mainResource): (API::WebArchive::subresources): (API::WebArchive::subframeArchives): (API::releaseCFData): (API::WebArchive::data): (API::WebArchive::coreLegacyWebArchive): * Shared/APIWebArchive.h: Renamed from Source/WebKit2/Shared/WebArchive.h. * Shared/APIWebArchiveResource.cpp: Renamed from Source/WebKit2/Shared/WebArchiveResource.cpp. (API::WebArchiveResource::create): (API::WebArchiveResource::WebArchiveResource): (API::WebArchiveResource::~WebArchiveResource): (API::releaseCFData): (API::WebArchiveResource::data): (API::WebArchiveResource::URL): (API::WebArchiveResource::MIMEType): (API::WebArchiveResource::textEncoding): (API::WebArchiveResource::coreArchiveResource): * Shared/APIWebArchiveResource.h: Renamed from Source/WebKit2/Shared/WebArchiveResource.h. * WebKit2.xcodeproj/project.pbxproj: 2014-05-06 Alex Christensen Removed unnecessary notImplemented.h includes. https://bugs.webkit.org/show_bug.cgi?id=132587 Reviewed by Anders Carlsson. * UIProcess/ios/WKContentViewInteraction.mm: * UIProcess/mac/WebContextMenuProxyMac.mm: * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp: * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp: Removed notImplemented from list of includes. 2014-05-05 Jeremy Jones Implement scan backward and forward in video fullscreen. https://bugs.webkit.org/show_bug.cgi?id=132517 Reviewed by Simon Fraser. Plumb through scanning/seeking functions. * UIProcess/ios/WebVideoFullscreenManagerProxy.h: * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenManagerProxy::fastSeek): (WebKit::WebVideoFullscreenManagerProxy::beginScanningForward): (WebKit::WebVideoFullscreenManagerProxy::beginScanningBackward): (WebKit::WebVideoFullscreenManagerProxy::endScanning): * WebProcess/ios/WebVideoFullscreenManager.messages.in: 2014-05-05 Benjamin Poulain [iOS][WK2] Prefetch DNS hostnames on tap highlight https://bugs.webkit.org/show_bug.cgi?id=132509 Reviewed by Alexey Proskuryakov. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::tapHighlightAtPosition): 2014-05-05 Simon Fraser [iOS WK2] Flickery scrolling inside overflow-scrolling: touch https://bugs.webkit.org/show_bug.cgi?id=132591 Reviewed by Tim Horton. Avoid triggering layer tree commits that touch the layer's boundsOrigin while the user is scrolling in the UI process. Fix the WKOverflowScrollViewDelegate to pass along an "inUserInteration" flag to the ScrollingTree to say that we're in the middle of a user interaction (and also to send a final non-interactive update). That gets passed along to the web process, and turned into "SyncScrollingLayerPosition" update. AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll() consults this, and uses it to set a flag on the ScrollableArea to say that the scroll is a user scroll. RenderLayerBacking then makes use of this (in existing code, shared with WK1) to avoid triggering layer bounds setting. Instead, it now just calls syncBoundsOrigin(), which updates the GraphicsLayer without touching platform layers. This is necessary so that GraphicsLayer geometry is up-to-date (used for tiled layer visibility computations). Finally, a hack in GraphicsLayerCA::computeVisibleRect() is conditionalized for WebKit1 by checking the type of platform layer. * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::rootScrollingNodeID): (WebKit::RemoteScrollingCoordinatorProxy::isPointInNonFastScrollableRegion): (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling): (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll): * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: * UIProcess/Scrolling/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll): * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (-[WKOverflowScrollViewDelegate scrollViewDidScroll:]): (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll): * WebProcess/Scrolling/RemoteScrollingCoordinator.h: * WebProcess/Scrolling/RemoteScrollingCoordinator.messages.in: * WebProcess/Scrolling/RemoteScrollingCoordinator.mm: (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode): 2014-05-05 Alexey Proskuryakov Stop using BlobData on client side https://bugs.webkit.org/show_bug.cgi?id=132582 Reviewed by Sam Weinig. Update for WebCore changes. * CMakeLists.txt: * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: (WebKit::NetworkBlobRegistry::registerFileBlobURL): (WebKit::NetworkBlobRegistry::registerBlobURL): * NetworkProcess/FileAPI/NetworkBlobRegistry.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL): (WebKit::NetworkConnectionToWebProcess::registerBlobURL): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * Shared/FileAPI/BlobRegistrationData.cpp: Removed. * Shared/FileAPI/BlobRegistrationData.h: Removed. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::registerFileBlobURL): (WebKit::BlobRegistryProxy::registerBlobURL): * WebProcess/FileAPI/BlobRegistryProxy.h: 2014-05-05 Beth Dakin Need a delegate that informs the UI process when the page's pin state changes https://bugs.webkit.org/show_bug.cgi?id=132583 -and corresponding- Reviewed by Anders Carlsson. New UIClient function pinnedStateDidChange. * UIProcess/API/APIUIClient.h: (API::UIClient::pinnedStateDidChange): Create WKPageUIClientV3 to add this function. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): * UIProcess/API/C/WKPageUIClient.h: Change default initialization to true instead of false, which makes more sense for this API. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::didCommitLoadForFrame): (WebKit::WebPageProxy::resetState): (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): 2014-05-05 Anders Carlsson Add SPI to provide the WebCrypto master key https://bugs.webkit.org/show_bug.cgi?id=132586 Reviewed by Dan Bernstein. * UIProcess/API/APILoaderClient.h: (API::LoaderClient::webCryptoMasterKey): * UIProcess/API/C/WKPage.cpp: (WKPageSetPageLoaderClient): * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::NavigationState::LoaderClient::webCryptoMasterKey): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::wrapCryptoKey): 2014-05-05 Gavin Barraclough https://bugs.webkit.org/show_bug.cgi?id=132522 Clean up ProcessThrottler Unreviewed: bad build fix. Will work out what the right include is asap. * UIProcess/ios/WebProcessProxyIOS.mm: 2014-05-05 Sam Weinig [Cocoa WebKit2] Add SPI to clear all visited links in a VisitedLinkProvider https://bugs.webkit.org/show_bug.cgi?id=132573 Reviewed by Dan Bernstein. * Shared/VisitedLinkTable.cpp: (WebKit::VisitedLinkTable::VisitedLinkTable): (WebKit::VisitedLinkTable::clear): * Shared/VisitedLinkTable.h: Add functions to clear the visited link table. * UIProcess/API/Cocoa/_WKVisitedLinkProvider.h: * UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm: (-[_WKVisitedLinkProvider removeAll]): Add SPI. * UIProcess/VisitedLinkProvider.cpp: (WebKit::VisitedLinkProvider::removeAll): * UIProcess/VisitedLinkProvider.h: A remove all resets the provider and notifies all the attached processes. * WebProcess/WebPage/VisitedLinkTableController.cpp: (WebKit::VisitedLinkTableController::removeAllVisitedLinks): * WebProcess/WebPage/VisitedLinkTableController.h: * WebProcess/WebPage/VisitedLinkTableController.messages.in: Add message to clear the visited links for a process. 2014-05-05 Benjamin Poulain [iOS][WK2] Special case ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture() for image documents https://bugs.webkit.org/show_bug.cgi?id=132553 Reviewed by Tim Horton. When collecting the geometry for the smart magnification gesture, always return the image of an image document on iOS. On iOS, it does not make much sense to return the whole document rect when the gesture is not over the image. * WebProcess/WebPage/ViewGestureGeometryCollector.cpp: (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture): 2014-05-02 Gavin Barraclough https://bugs.webkit.org/show_bug.cgi?id=132522 Clean up ProcessThrottler Reviewed by Geoffrey Garen. The initial implementation of ProcessThrottler relied on the reply from the SetViewState message to ensure the page visibility notifications have a chance to be delivered. This resulted in: - unnecessarily complicated interface to ProcessThrottler (in VisibilityState class) - complexity bleeding out into WebPageProxy (handling 'hiding' state). - for cases other than view hiding, no suspension notification in the WebContent. To fix these issues add an explicit handshake from the ProcessThrottler to the WebPage. This gives us two things: - All previously posted messages (e.g. SetViewState) will be processed before suspension. - WebContent is always (bar timeout) notified before suspension. Since this interlock ensures the SetViewState message will be processed, the WKContentView no longer needs to request a reply from SetViewState, and WebPageProxy can lose all the 'hiding' state tracking. In turn, we can simplify VisibilityToken to a couple of simpler types, without the interface to change state - just acquire/release to keep the process runnable or permit suspension. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): - VisibilityToken -> BackgroundActivityToken * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): - m_visibilityToken -> m_activityToken, remove m_pendingViewStateUpdates updateVisibilityToken -> updateActivityToken (WebKit::WebPageProxy::reattachToWebProcess): - updateVisibilityToken -> updateActivityToken (WebKit::WebPageProxy::viewStateDidChange): - remove m_pendingViewStateUpdates, updateActivityToken after sending SetViewState (WebKit::WebPageProxy::updateActivityToken): - m_visibilityToken -> m_activityToken, no need to handle 'hiding' state. (WebKit::WebPageProxy::updateVisibilityToken): Deleted. - renamed to updateActivityToken (WebKit::WebPageProxy::didUpdateViewState): Deleted. - implementation moved back into header. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::didUpdateViewState): - implementation moved back into header. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::WebProcessProxy): - ProcessThrottler constructor now passed WebProcessProxy. * UIProcess/WebProcessProxy.h: - added ProcessWillSuspend/ProcessReadyToSuspend * UIProcess/WebProcessProxy.messages.in: - added ProcessWillSuspend/ProcessReadyToSuspend * UIProcess/ios/ProcessAssertion.h: (WebKit::ProcessAssertion::state): - accessor * UIProcess/ios/ProcessThrottler.h: (WebKit::ProcessThrottler::VisibilityToken::visibility): Deleted. (WebKit::ProcessThrottler::VisibilityToken::setVisibility): Deleted. - removed VisibilityToken class, replaced with ForegroundActivityToken/BackgroundActivityToken. (WebKit::ProcessThrottler::ProcessThrottler): Deleted. (WebKit::ProcessThrottler::visibilityToken): Deleted. (WebKit::ProcessThrottler::didConnnectToProcess): Deleted. (WebKit::ProcessThrottler::assertionState): Deleted. (WebKit::ProcessThrottler::updateAssertion): Deleted. - moved implementations to .mm. * UIProcess/ios/ProcessThrottler.mm: (WebKit::ProcessThrottler::ForegroundActivityToken::ForegroundActivityToken): (WebKit::ProcessThrottler::ForegroundActivityToken::~ForegroundActivityToken): (WebKit::ProcessThrottler::BackgroundActivityToken::BackgroundActivityToken): (WebKit::ProcessThrottler::BackgroundActivityToken::~BackgroundActivityToken): - new, simpler replacement for VisibilityToken. Instantiate to keep a processes running, release to suspend. (WebKit::ProcessThrottler::ProcessThrottler): - constructor, now initializes WebProcessProxy pointer & timer mechanism (WebKit::ProcessThrottler::assertionState): - select the appropriate AssertionState give current ActivityTokens. (WebKit::ProcessThrottler::updateAssertionNow): - update the current ProcessAssertion. (WebKit::ProcessThrottler::updateAssertion): - update the current ProcessAssertion, delay running->suspended transitions to give the process a chance to clean up. (WebKit::ProcessThrottler::didConnnectToProcess): - moved from header. (WebKit::ProcessThrottler::suspendTimerFired): - timeout to prevent processes from running in the background for too long. (WebKit::ProcessThrottler::processReadyToSuspend): - handshake from the WebContent process to acknowledge it is ready to suspend. (WebKit::ProcessThrottler::VisibilityToken::VisibilityToken): Deleted. (WebKit::ProcessThrottler::VisibilityToken::~VisibilityToken): Deleted. (WebKit::ProcessThrottler::VisibilityToken::hideTimerFired): Deleted. (WebKit::ProcessThrottler::VisibilityToken::setVisibilityInternal): Deleted. - removed VisibilityToken class, replaced with ForegroundActivityToken/BackgroundActivityToken. * UIProcess/ios/WKContentView.mm: (-[WKContentView didMoveToWindow]): - no longer necessary to request a response from SetViewState; this interlock is now managed by the ProcessThrottler. * UIProcess/ios/WebProcessProxyIOS.mm: (WebKit::WebProcessProxy::sendProcessWillSuspend): (WebKit::WebProcessProxy::processReadyToSuspend): - added ProcessWillSuspend/ProcessReadyToSuspend * WebProcess/WebProcess.cpp: (WebKit::WebProcess::processWillSuspend): - notification from the WebContent process that we will be suspended; for now just send back an ack. * WebProcess/WebProcess.h: - added ProcessWillSuspend/ProcessReadyToSuspend * WebProcess/WebProcess.messages.in: - added ProcessWillSuspend/ProcessReadyToSuspend 2014-05-05 Jeremy Jones Implement beginScrubbing and endScrubbing for video fullscreen. https://bugs.webkit.org/show_bug.cgi?id=132520 Reviewed by Eric Carlson. Plumb through beginScrubbing and endScrubbing. * UIProcess/ios/WebVideoFullscreenManagerProxy.h: * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenManagerProxy::beginScrubbing): (WebKit::WebVideoFullscreenManagerProxy::endScrubbing): * WebProcess/ios/WebVideoFullscreenManager.messages.in: 2014-05-05 Tim Horton Use a layer delegate instead of web_disableAllActions wherever possible https://bugs.webkit.org/show_bug.cgi?id=132560 Reviewed by Simon Fraser. * UIProcess/API/mac/WKView.mm: (-[WKView _setAcceleratedCompositingModeRootLayer:]): * UIProcess/ios/RemoteLayerTreeHostIOS.mm: (WebKit::RemoteLayerTreeHost::createLayer): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::showDebugIndicator): * UIProcess/mac/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::createLayer): * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::beginSwipeGesture): Make use of WebActionDisablingCALayerDelegate where possible. Also, UIKit disables actions for us, so don't bother doing anything on iOS. 2014-05-05 Martin Hock Session-aware plugin autostart data https://bugs.webkit.org/show_bug.cgi?id=131758 Reviewed by Alexey Proskuryakov. * Shared/WebProcessCreationParameters.cpp: * Shared/WebProcessCreationParameters.h: * UIProcess/Plugins/PlugInAutoStartProvider.cpp: (WebKit::PlugInAutoStartProvider::PlugInAutoStartProvider): (WebKit::PlugInAutoStartProvider::addAutoStartOriginHash): (WebKit::PlugInAutoStartProvider::autoStartOriginHashesCopy): (WebKit::PlugInAutoStartProvider::autoStartOriginsTableCopy): (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest): (WebKit::PlugInAutoStartProvider::setAutoStartOriginsArray): (WebKit::PlugInAutoStartProvider::didReceiveUserInteraction): * UIProcess/Plugins/PlugInAutoStartProvider.h: * UIProcess/WebContext.cpp: (WebKit::WebContext::addPlugInAutoStartOriginHash): (WebKit::WebContext::plugInDidReceiveUserInteraction): * UIProcess/WebContext.h: * UIProcess/WebContext.messages.in: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::pluginDidReceiveUserInteraction): * WebProcess/WebCoreSupport/WebPlugInClient.cpp: (WebKit::WebPlugInClient::didStartFromOrigin): * WebProcess/WebCoreSupport/WebPlugInClient.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): (WebKit::WebProcess::isPlugInAutoStartOriginHash): (WebKit::WebProcess::shouldPlugInAutoStartFromOrigin): (WebKit::WebProcess::plugInDidStartFromOrigin): (WebKit::WebProcess::didAddPlugInAutoStartOriginHash): (WebKit::WebProcess::resetPlugInAutoStartOriginDefaultHashes): (WebKit::WebProcess::resetPlugInAutoStartOriginHashes): (WebKit::WebProcess::plugInDidReceiveUserInteraction): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2014-05-05 Andy Estes Another iOS build fix after r168260. Removed an unnecessary 'using namespace WebCore'. * UIProcess/ios/WebMemoryPressureHandlerIOS.cpp: 2014-05-05 Tim Horton Fix the iOS build. * UIProcess/API/Cocoa/WKWebView.mm: 2014-05-05 Ryuan Choi [EFL][WK2] Refactor favicon database APIs https://bugs.webkit.org/show_bug.cgi?id=132519 Reviewed by Gyuyoung Kim. ewebkit2 has two options to get favicon. The first option is ewk_view_favicon_get with "favicon,changed" signal. It's simple to use but it always adds the callback to EwkView although applications does not use favicon. The other option is ewk_favicon_database_icon_get with ewk_favicon_database_icon_change_callback_add API. But the callback doesn't have information about Ewk_Favicon_Database to call ewk_favicon_database_icon_get. This patch removed ewk_view_favicon_get and "favicon,changed" signal. In addition, improved ewk_favicon_database_icon_change_callback. * UIProcess/API/efl/EwkView.cpp: Remove ewk_favicon_database related code. (EwkView::EwkView): (EwkView::~EwkView): (EwkView::informURLChange): (EwkView::handleFaviconChanged): (EwkView::createFavicon): Deleted. * UIProcess/API/efl/EwkViewCallbacks.h: * UIProcess/API/efl/ewk_favicon_database.cpp: (EwkFaviconDatabase::iconDataReadyForPageURL): (EwkFaviconDatabase::didChangeIconForPageURL): Deleted. dead code. * UIProcess/API/efl/ewk_favicon_database.h: Refactor Ewk_Favicon_Database_Icon_Change_Cb and improve doxygen. * UIProcess/API/efl/ewk_favicon_database_private.h: * UIProcess/API/efl/ewk_view.cpp: (ewk_view_favicon_get): Deleted. * UIProcess/API/efl/ewk_view.h: * UIProcess/API/efl/tests/test_ewk2_favicon_database.cpp: (EWK2FaviconDatabaseTest::requestFaviconData): (TEST_F): 2014-05-05 Tim Horton [iOS WebKit2] Swipe snapshots should be taken asynchronously https://bugs.webkit.org/show_bug.cgi?id=132417 Reviewed by Anders Carlsson. Reorganize takeViewSnapshot to return a ViewSnaphot with the image filled in (the other properties are filled in by ViewSnapshotStore). Make ViewSnapshotStore use a fixed size instead of count for the snapshot cache. iOS doesn't use purgeable snapshots, so make the cache much smaller there. Use CARenderServerCaptureLayerWithTransform to achieve async snapshotting. Rename WebKit::ViewSnapshotStore::Snapshot to WebKit::ViewSnapshot so that it can be forward-declared in a bunch of places. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _takeViewSnapshot:]): Use CARenderServerCaptureLayerWithTransform. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/mac/WKView.mm: (createIOSurfaceFromImage): (-[WKView _takeViewSnapshot:]): Adjust to the new push model. * UIProcess/API/mac/WKViewInternal.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::takeViewSnapshot): * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::takeViewSnapshot): * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::takeViewSnapshot): Plumbing. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::endSwipeGesture): Realize an object that can be used as the layer contents from the slot ID. * UIProcess/ios/WebMemoryPressureHandlerIOS.cpp: (WebKit::WebMemoryPressureHandler::sharedHandler): (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler): * UIProcess/WebMemoryPressureHandlerIOS.h: Add a memory pressure handler for the UI process. This does not use WebCore's platform independent memory pressure handler because that mechanism only allows for one handler per process, and we don't want to stomp on any handlers installed by WebKit1 in a process where the WebKits coexist. * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView _takeViewSnapshot]): Deleted. Get rid of an unnecessary bounce through WKContentView. * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::retrieveSnapshotForItem): (WebKit::ViewGestureController::endSwipeGesture): Use the new name, ViewSnapshot. * UIProcess/mac/ViewSnapshotStore.h: (WebKit::ViewSnapshot::ViewSnapshot): * UIProcess/mac/ViewSnapshotStore.mm: (WebKit::ViewSnapshotStore::ViewSnapshotStore): (WebKit::ViewSnapshotStore::~ViewSnapshotStore): (WebKit::ViewSnapshotStore::snapshottingContext): Use a custom CAContext for snapshotting so that snapshots don't disappear when the main context is destroyed on hibernation. (WebKit::ViewSnapshotStore::removeSnapshotImage): (WebKit::ViewSnapshotStore::pruneSnapshots): (WebKit::ViewSnapshotStore::recordSnapshot): (WebKit::ViewSnapshotStore::getSnapshot): (WebKit::ViewSnapshotStore::discardSnapshots): (WebKit::ViewSnapshot::clearImage): (WebKit::ViewSnapshot::hasImage): (WebKit::createIOSurfaceFromImage): Deleted. (WebKit::ViewSnapshotStore::Snapshot::clearImage): Deleted. (WebKit::ViewSnapshotStore::Snapshot::hasImage): Deleted. Cache by image size instead of counts. * WebKit2.xcodeproj/project.pbxproj: 2014-05-04 Pratik Solanki Reduce calls to CFURLCacheCopySharedURLCache https://bugs.webkit.org/show_bug.cgi?id=132464 Address review comments by collapsing multi-line code into a single ASSERT. * NetworkProcess/mac/NetworkResourceLoaderMac.mm: (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer): 2014-05-04 Pratik Solanki Shortcircuit shouldUseCredentialStorage callback https://bugs.webkit.org/show_bug.cgi?id=132308 Reviewed by Alexey Proskuryakov. If we are going to return true from the shouldUseCredentialStorage callback then we don't really need to have CFNetwork/Foundation call us. We can just disable the callback and CFNetwork will assume true. Add a separate subclass that implements this callback when we need to return false. We can also eliminate the corresponding async callbacks. This avoids pingponging between dispatch queue and main thread in the common case. No new tests because no change in functionality. * NetworkProcess/NetworkResourceLoader.cpp: Remove shouldUseCredentialStorageAsync() callbacks. * NetworkProcess/NetworkResourceLoader.h: 2014-05-04 Beth Dakin Top content inset: Margin tiles should not display in the inset area when pinned to the top of the page https://bugs.webkit.org/show_bug.cgi?id=132535 -and corresponding- Reviewed by Simon Fraser. Encode and decode the ScrollingStateScrollingNode’s m_topContentInset even though we don’t use it for anything yet. Since the headerLayer and footerLayer are not encoded or decoded yet, I did not encode/decode the insetClipLayer yet, which, like the header and footer layers, would not yet be used. * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder::encode): (ArgumentCoder::decode): 2014-05-03 Commit Queue Unreviewed, rolling out r168232. https://bugs.webkit.org/show_bug.cgi?id=132543 broke ~15 tests on WK2 debug (Requested by kling on #webkit). Reverted changeset: "Shortcircuit shouldUseCredentialStorage callback" https://bugs.webkit.org/show_bug.cgi?id=132308 http://trac.webkit.org/changeset/168232 2014-05-03 Tim Horton [iOS] REGRESSION (WebKit2): Page isn't clipped properly during back/forward swipe https://bugs.webkit.org/show_bug.cgi?id=132538 Reviewed by Simon Fraser. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::endSwipeGesture): * UIProcess/mac/ViewGestureController.h: Add a clipping layer above the live swipe layer, which explicitly clips to bounds. 2014-05-02 Pratik Solanki Shortcircuit shouldUseCredentialStorage callback https://bugs.webkit.org/show_bug.cgi?id=132308 Reviewed by Alexey Proskuryakov. If we are going to return true from the shouldUseCredentialStorage callback then we don't really need to have CFNetwork/Foundation call us. We can just disable the callback and CFNetwork will assume true. Add a separate subclass that implements this callback when we need to return false. We can also eliminate the corresponding async callbacks. This avoids pingponging between dispatch queue and main thread in the common case. No new tests because no change in functionality. * NetworkProcess/NetworkResourceLoader.cpp: Remove shouldUseCredentialStorageAsync() callbacks. * NetworkProcess/NetworkResourceLoader.h: 2014-05-02 Pratik Solanki Reduce calls to CFURLCacheCopySharedURLCache https://bugs.webkit.org/show_bug.cgi?id=132464 Reviewed by Alexey Proskuryakov. CFURLCacheCopySharedURLCache grabs a mutex and can sometimes block. Avoid that by stashing the cache reference in a static. * NetworkProcess/NetworkResourceLoader.h: Coalesce ifdef'd code. * NetworkProcess/mac/NetworkResourceLoaderMac.mm: (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer): (WebKit::NetworkResourceLoader::willCacheResponseAsync): Use more correct ifdef for Foundation based callback. 2014-05-03 Sam Weinig [Cocoa WebKit2] Add basic _WKWebsiteDataStore implementation https://bugs.webkit.org/show_bug.cgi?id=132526 Reviewed by Anders Carlsson. - Renames WKSession to _WKWebsiteDataStore to better reflect its intended use (renaming the implementation object will come later). - Makes _WKWebsiteDataStore work as a wrapped Objective-C object. - Adds the ability to set a _WKWebsiteDataStore on the WKWebViewConfiguration. * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * UIProcess/API/Cocoa/WKSession.h: * UIProcess/API/Cocoa/WKSession.mm: (-[WKSession dealloc]): Deleted. (-[WKSession ephemeral]): Deleted. (-[WKSession API::]): Deleted. * UIProcess/API/Cocoa/WKSessionInternal.h: (WebKit::wrapper): Deleted. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _websiteDataStore]): (-[WKWebViewConfiguration _setWebsiteDataStore:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: * UIProcess/API/Cocoa/_WKWebsiteDataStore.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKSession.h. * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKSession.mm. (+[_WKWebsiteDataStore nonPersistentDataStore]): (-[_WKWebsiteDataStore isNonPersistentDataStore]): (-[WKSession ephemeral]): Deleted. * UIProcess/API/Cocoa/_WKWebsiteDataStoreInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKSessionInternal.h. * WebKit2.xcodeproj/project.pbxproj: 2014-05-03 Simon Fraser [UI-side compositing] Assertion in PlatformCAFilters::setFiltersOnLayer with animated reference filter https://bugs.webkit.org/show_bug.cgi?id=132528 Reviewed by Tim Horton. Allow PASSTHROUGH filters to be encoded and sent to the UI process; they can be set on layers as the result of a filter animation using a reference filter, and just get ignored anyway, but encoding them maintains consistency of the filters list. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): Assert during encoding if we try to encode a NONE or REFERENCE filter (to match the decoding assertions). (IPC::decodeFilterOperation): Allow decoding of PASSTHROUGH filters. Have trying to decode a NONE or REFERENCE filter mark the message as invalid. (IPC::ArgumentCoder::decode): Mark the message invalid when receiving unexpected key types. * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTextStream::operator<<): Have the logging not crash if a filter is null (should never happen). 2014-05-02 Dan Bernstein [Cocoa] Remove unused WKErrorRecoveryAttempting https://bugs.webkit.org/show_bug.cgi?id=132503 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKBrowsingContextController.mm: (didFailProvisionalLoadWithErrorForFrame): (didFailLoadWithErrorForFrame): (createErrorWithRecoveryAttempter): Deleted. (-[WKBrowsingContextController attemptRecoveryFromError:]): Deleted. * UIProcess/API/Cocoa/WKErrorRecoveryAttempting.m: Removed. * UIProcess/API/Cocoa/_WKFormDelegate.h: * WebKit2.xcodeproj/project.pbxproj: 2014-05-02 Enrica Casucci REGRESSION (WebKit2) Need to support reanalyze button for Chinese Traditional. https://bugs.webkit.org/show_bug.cgi?id=132504 Reviewed by Benjamin Poulain. For traditional Chinese we support reanalyzing of the text to perform transformations on the text based on the selected language and keyboard. This is done by pressing the Reanalyze button on the system menu. This patch adds the necessary code to canPerformAction to enable the button when appropriate as well as the implementation of the action itself. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _reanalyze:]): (-[WKContentView canPerformAction:withSender:]): 2014-05-02 Enrica Casucci REGRESSION (WebKit2) Need to support transliterate chinese button (简⇄繁) for Traditional Chinese. https://bugs.webkit.org/show_bug.cgi?id=132500 Reviewed by Benjamin Poulain. For traditional Chinese we support the transliterate to simplified Chinese. This is done by pressing the 简⇄繁 button on the system menu. This patch adds the necessary code to canPerformAction to enable the button when appropriate as well as the implementation of the action itself. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _transliterateChinese:]): (-[WKContentView canPerformAction:withSender:]): 2014-05-02 Jeremy Jones Fullscreen UI does not appear after WebProcess has crashed https://bugs.webkit.org/show_bug.cgi?id=132442 Reviewed by Darin Adler. Cleanup WebVideoFullscreenManagerProxy after a WebProcess crash. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::reattachToWebProcess): recreate WebVideoFullscreenManagerProxy after a WebProcess crash. (WebKit::WebPageProxy::resetState): invalidate and release WebVideoFullscreenManagerProxy on crash. * UIProcess/ios/WebVideoFullscreenManagerProxy.h: * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenManagerProxy::~WebVideoFullscreenManagerProxy): don't assume m_page is valid. (WebKit::WebVideoFullscreenManagerProxy::invalidate): do cleanup invalidation in reponse to a WebProcess crash. 2014-05-02 Benjamin Poulain [iOS][WK2] More animation madness for when the extendedBackground is modified in an animation block https://bugs.webkit.org/show_bug.cgi?id=132497 Reviewed by Beth Dakin. * UIProcess/API/Cocoa/WKWebView.mm: (updateTopAndBottomExtendedBackgroundExclusionIfNecessary): Do not early return when _extendedBackgroundExclusionInsets.left is empty. That way, if executed in an animation block, the top of bottom view will animate from their current size to an empty width. When creating the layer, set up their height without animation. Otherwise it is possible to see the height animating while the left inset is animating. (-[WKWebView _setExtendedBackgroundExclusionInsets:]): When replacing the scrollview, make sure the frame and color are not animated. Otherwise the transition between scrollView and _mainExtendedBackgroundView can be visible if _setExtendedBackgroundExclusionInsets: is invoked in an animation block. (-[WKWebView _endAnimatedResize]): Nuke the top and bottom insets when possible. [WKWebView _endAnimatedResize] is unfrequent, so it is a good opportunity to free the memory. 2014-05-02 Alexey Proskuryakov Remove Blob contentDisposition handling https://bugs.webkit.org/show_bug.cgi?id=132490 Reviewed by Sam Weinig. * Shared/FileAPI/BlobRegistrationData.cpp: (WebKit::BlobRegistrationData::encode): (WebKit::BlobRegistrationData::decode): 2014-05-02 Benjamin Poulain [iOS][WK2] Adapt the rubberband constraints when the page get smaller than the scrollview - insets https://bugs.webkit.org/show_bug.cgi?id=132457 Reviewed by Enrica Casucci. It is quite common for us to have a WKContentView that is scalled smaller than the WKWebView, content insets included. In those cases, update the constraints to fit the content properly in the view. * UIProcess/ios/WKScrollView.mm: (valuesAreWithinOnePixel): (-[WKScrollView _rubberBandOffsetForOffset:maxOffset:minOffset:range:outside:]): 2014-05-02 Mark Rowe -[_WKThumbnailView _requestSnapshotIfNeeded] assumes that taking a snapshot will always succeed / Reviewed by Tim Horton. * UIProcess/API/Cocoa/_WKThumbnailView.mm: (-[_WKThumbnailView _requestSnapshotIfNeeded]): Don't attempt to create a CGImageRef if we failed to create a ShareableBitmap. This handles both the callback receiving a null Handle and a failure within ShareableBitmap::create. 2014-05-02 Anders Carlsson Clean up FormDataElement https://bugs.webkit.org/show_bug.cgi?id=132483 Reviewed by Sam Weinig. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::NetworkResourceLoader): * Shared/Network/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode): 2014-05-02 Anders Carlsson Add and implement KeyedDecoder::decodeBytes https://bugs.webkit.org/show_bug.cgi?id=132479 Reviewed by Tim Horton. * Shared/cf/KeyedDecoder.cpp: (WebKit::KeyedDecoder::decodeBytes): * Shared/cf/KeyedDecoder.h: 2014-05-02 Joseph Pecoraro [iOS] WebKit2 File Upload Support https://bugs.webkit.org/show_bug.cgi?id=132024 Reviewed by Enrica Casucci. * Configurations/WebKit2.xcconfig: Include MobileCoreServices on iOS for kUTTypeImage/kUTTypeMovie. * WebKit2.xcodeproj/project.pbxproj: Add new files. * UIProcess/WebOpenPanelResultListenerProxy.h: * UIProcess/WebOpenPanelResultListenerProxy.cpp: (WebKit::filePathsFromFileURLs): (WebKit::WebOpenPanelResultListenerProxy::chooseFiles): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::runOpenPanel): (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon): * WebProcess/WebPage/WebOpenPanelResultListener.h: * WebProcess/WebPage/WebOpenPanelResultListener.cpp: (WebKit::WebOpenPanelResultListener::didChooseFilesWithDisplayStringAndIcon): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didChooseFilesForOpenPanelWithDisplayStringAndIcon): Message forwarding for choosing files and providing a display string and icon, leading down to the existing WebCore FileChooser method. * UIProcess/PageClient.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::handleRunOpenPanel): Add a default handler for file open panel on iOS. Forwards to the content view. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView lastInteractionLocation]): (-[WKContentView _webTouchEventsRecognized:]): (-[WKContentView _highlightLongPressRecognized:]): (-[WKContentView _longPressRecognized:]): (-[WKContentView _singleTapRecognized:]): (-[WKContentView _doubleTapRecognized:]): (-[WKContentView _twoFingerDoubleTapRecognized:]): Keep track of the last interaction location. This matches previous behavior of showing the file upload popover where the user tapped, to handle cases where the is hidden. (-[WKContentView _showRunOpenPanel:resultListener:]): (-[WKContentView fileUploadPanelDidDismiss:]): Handle showing the cleaning up after the file upload panel. * UIProcess/ios/forms/WKFileUploadPanel.h: * UIProcess/ios/forms/WKFileUploadPanel.mm: Added. (squareCropRectForSize): (squareImage): (thumbnailSizedImageForImage): (-[_WKFileUploadItem isVideo]): (-[_WKFileUploadItem fileURL]): (-[_WKFileUploadItem displayImage]): (-[_WKImageFileUploadItem initWithFilePath:originalImage:]): (-[_WKImageFileUploadItem isVideo]): (-[_WKImageFileUploadItem fileURL]): (-[_WKImageFileUploadItem displayImage]): (-[_WKVideoFileUploadItem initWithFilePath:mediaURL:]): (-[_WKVideoFileUploadItem isVideo]): (-[_WKVideoFileUploadItem fileURL]): (-[_WKVideoFileUploadItem displayImage]): Helper class for each image picker selection. Knows how to get a file URL and thumbnail display image for the item. (-[WKFileUploadPanel initWithView:]): (-[WKFileUploadPanel dealloc]): (-[WKFileUploadPanel _dispatchDidDismiss]): (-[WKFileUploadPanel _cancel]): (-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]): Lifetime of the upload panel requires that either cancel or choose must happen as we go through the file picking process. (-[WKFileUploadPanel presentWithParameters:WebKit::resultListener:WebKit::]): (-[WKFileUploadPanel dismiss]): API to show or dismiss the panel. (-[WKFileUploadPanel _dismissDisplayAnimated:]): Helper to clean up the UI as it progresses or completes no matter the device idiom. (-[WKFileUploadPanel _presentPopoverWithContentViewController:animated:]): (-[WKFileUploadPanel _presentFullscreenViewController:animated:]): UI presentation for the appropriate idiom. (-[WKFileUploadPanel _mediaTypesForPickerSourceType:]): (-[WKFileUploadPanel _showMediaSourceSelectionSheet]): (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]): Showing the action sheet or image picker. (-[WKFileUploadPanel popoverControllerDidDismissPopover:]): (-[WKFileUploadPanel _willMultipleSelectionDelegateBeCalled]): (-[WKFileUploadPanel imagePickerController:didFinishPickingMediaWithInfo:]): (-[WKFileUploadPanel imagePickerController:didFinishPickingMultipleMediaWithInfo:]): (-[WKFileUploadPanel imagePickerControllerDidCancel:]): Action sheet or image picker handlers. (-[WKFileUploadPanel _processMediaInfoDictionaries:successBlock:failureBlock:]): (-[WKFileUploadPanel _processMediaInfoDictionaries:atIndex:processedResults:processedImageCount:processedVideoCount:successBlock:failureBlock:]): (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]): (-[WKFileUploadPanel _displayStringForPhotos:videos:]): Processing selections from the image picker to FileUploadItems. 2014-05-01 Simon Fraser [iOS WK2] Animations on vox.com look wrong https://bugs.webkit.org/show_bug.cgi?id=132462 Reviewed by Sam Weinig. PlatformCALayerRemote was managing animations incorrectly; aninations would stick around in m_properties.addedAnimations and get added a second time by mistake. Animations have to be managed a little differently to other properties, since they are not steady-state things. A given commit has to send over the added and removed animations, and then clear the layer properties. Do this by adding PlatformCALayerRemote::didCommit(), which is called after the layer properties have been encoded, and have it clear the lists of added and removed animations. removeAnimationForKey() also has to remove the animation from addedAnimations so that an add/remove in the same commit doesn't send the animation to the UI process. * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::recursiveBuildTransaction): (WebKit::PlatformCALayerRemote::didCommit): (WebKit::PlatformCALayerRemote::removeAnimationForKey): * WebProcess/WebPage/mac/PlatformCALayerRemote.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::flushLayers): 2014-05-01 Simon Fraser [iOS WK2] Can't scroll on gatesnotes.com https://bugs.webkit.org/show_bug.cgi?id=132459 Reviewed by Benjamin Poulain. The custom UIView hit-testing code was finding views that were created by the compositing code for clipping, above the UIScrollViews. We only ever need to find UIScrollViews here for touch overflow-scrolling, so constrain the hit-testing code to only return UIScrollViews. * UIProcess/ios/RemoteLayerTreeHostIOS.mm: (-[UIView _recursiveFindDescendantScrollViewAtPoint:withEvent:]): (-[UIView _findDescendantViewAtPoint:withEvent:]): (-[UIView _recursiveFindDescendantViewAtPoint:withEvent:]): Deleted. 2014-05-02 Carlos Alberto Lopez Perez REGRESSION(r168118): [GTK] build broken due to shouldTrackVisitedLinks https://bugs.webkit.org/show_bug.cgi?id=132447 Unreviewed GTK build fix. shouldTrackVisitedLinks was removed on r168118. Visited link coloring works as expected after this change. * UIProcess/gtk/WebContextGtk.cpp: (WebKit::WebContext::platformInitializeWebProcess): Remove shouldTrackVisitedLinks parameter. 2014-05-01 Enrica Casucci REGRESSION (WebKit2) Need to support Learn button. https://bugs.webkit.org/show_bug.cgi?id=132454 Reviewed by Benjamin Poulain. For traditional Chinese we support the ability to add shortcuts for typing. This is done by pressing the Learn button on the system menu. This patch adds the necessary code to canPerformAction to enable the button when appropriate as well as the implementation of the action itself. It also adds a check for the Replace button not to be shown when the selection only contains CJ characters. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _addShortcut:]): (-[WKContentView canPerformAction:withSender:]): 2014-05-01 Benjamin Poulain [iOS][WK2] Tweak the extended background exclusion for MobileSafari https://bugs.webkit.org/show_bug.cgi?id=132449 Reviewed by Beth Dakin. Some tweaks for Mobile: -Use UIViews instead of CALayers to have the same animation timing as the top views. -The left extended background insets should not exclude the top and bottom insets. Since this code is in the middle of 2 hot paths, also added some performance tweaks. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): In the normal case, we do not have extended background exclusion. To avoid creating a background view, we use the scrollview to render the background. The separate background view is created lazily if needed. (-[WKWebView _updateScrollViewBackground]): (-[WKWebView _frameOrBoundsChanged]): (updateTopAndBottomExtendedBackgroundExclusionIfNecessary): This create the top and bottom extended background view as needed and update their frames for the current insets. (-[WKWebView _setObscuredInsets:]): (-[WKWebView _setExtendedBackgroundExclusionInsets:]): When an exclusion inset is needed, create a view for it, transfer the color from the ScrollView, and reset the color of the scrollview. 2014-05-01 Alexey Proskuryakov Move size computation for Blob constructor into BlobRegistryImpl https://bugs.webkit.org/show_bug.cgi?id=132439 Reviewed by Sam Weinig. Plumbing to make this version of registerBlobURL synchronous for now. I expect to make it async again when data structures on client side are simplified. * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: (WebKit::NetworkBlobRegistry::registerBlobURL): * NetworkProcess/FileAPI/NetworkBlobRegistry.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::registerBlobURL): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::registerBlobURL): * WebProcess/FileAPI/BlobRegistryProxy.h: 2014-05-01 Beth Dakin REGRESSION(168053): Repro crash navigating to another page after selecting phone numbers on a page https://bugs.webkit.org/show_bug.cgi?id=132444 -and corresponding- Reviewed by Darin Adler. Missing null-check. * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm: (WebKit::TelephoneNumberOverlayController::drawRect): 2014-05-01 Anders Carlsson Remove WKBundleSetShouldTrackVisitedLinks and associate code https://bugs.webkit.org/show_bug.cgi?id=132441 Reviewed by Sam Weinig. * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleSetShouldTrackVisitedLinks): Deleted. * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setShouldTrackVisitedLinks): Deleted. * WebProcess/InjectedBundle/InjectedBundle.h: * WebProcess/WebPage/VisitedLinkTableController.cpp: (WebKit::VisitedLinkTableController::addVisitedLink): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): (WebKit::WebProcess::setShouldTrackVisitedLinks): Deleted. * WebProcess/WebProcess.h: (WebKit::WebProcess::shouldTrackVisitedLinks): Deleted. 2014-05-01 Anders Carlsson window.testRunner.keepWebHistory() should update the UI process state https://bugs.webkit.org/show_bug.cgi?id=132440 Reviewed by Dan Bernstein. * UIProcess/API/C/WKPage.cpp: (WKPageGetAddsVisitedLinks): (WKPageSetAddsVisitedLinks): * UIProcess/API/C/WKPagePrivate.h: 2014-05-01 Filip Pizlo Roll out r60161. Rubber stamped by Mark Hahnenberg. This breaks our debugging workflow. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::decode): * UIProcess/mac/WebContextMac.mm: (WebKit::registerUserDefaultsIfNeeded): (WebKit::WebContext::platformInitializeWebProcess): 2014-05-01 Anders Carlsson WKWebView doesn't track visited links (for visited link coloring) https://bugs.webkit.org/show_bug.cgi?id=132438 Reviewed by Dan Bernstein. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::WebProcessCreationParameters): (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/API/APIHistoryClient.h: (API::HistoryClient::addsVisitedLinks): (API::HistoryClient::shouldTrackVisitedLinks): Deleted. * UIProcess/API/C/WKContext.cpp: (WKContextSetHistoryClient): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _addsVisitedLinks]): (-[WKWebView _setAddsVisitedLinks:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView initWithFrame:context:configuration:webView:]): * UIProcess/Cocoa/HistoryClient.h: * UIProcess/Cocoa/HistoryClient.mm: (WebKit::HistoryClient::shouldTrackVisitedLinks): Deleted. * UIProcess/VisitedLinkProvider.cpp: (WebKit::VisitedLinkProvider::addVisitedLinkHashFromPage): * UIProcess/VisitedLinkProvider.h: * UIProcess/VisitedLinkProvider.messages.in: * UIProcess/WebContext.cpp: (WebKit::WebContext::setHistoryClient): (WebKit::WebContext::createNewWebProcess): * UIProcess/WebContext.h: (WebKit::WebContext::processes): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::addsVisitedLinks): (WebKit::WebPageProxy::setAddsVisitedLinks): * WebProcess/WebPage/VisitedLinkTableController.cpp: (WebKit::VisitedLinkTableController::addVisitedLink): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2014-05-01 Benjamin Poulain [iOS][WK2] The highlight view needs to be in WKWebView coordinates https://bugs.webkit.org/show_bug.cgi?id=132435 Reviewed by Tim Horton. _UIHighlightView needs to be in WKWebView coordinates so that it render unscaled for any page scale factor. The view needs to be a child of WKContentView so that it moves/scales with the page. To fix the issue, add an inverse transform root layer for the hightlight, and scale the coordinates to their inverse scaled counterpart. The scale is not updated live with the scaling of WKContentView but that should be fine since the view disappear on any scaling operation (and I would prefer not add live painting during scaling animation). * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): (-[WKContentView _didGetTapHighlightForRequest:color:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]): (-[WKContentView _cancelInteraction]): 2014-05-01 Ryuan Choi [EFL] There are many warnings with software backend https://bugs.webkit.org/show_bug.cgi?id=132422 Reviewed by Gyuyoung Kim. * UIProcess/API/efl/EwkView.cpp: (EwkView::updateCursor): (EwkView::transformToScreen): 2014-04-30 Alexey Proskuryakov Roll out fix for https://bugs.webkit.org/show_bug.cgi?id=131637: Clean up unnecessary methods in the BackForwardClient interface It broke a regression test and an API test. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp: (WebKit::InjectedBundleBackForwardList::clear): * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::WebBackForwardListProxy): (WebKit::WebBackForwardListProxy::addItem): (WebKit::WebBackForwardListProxy::goToItem): (WebKit::WebBackForwardListProxy::itemAtIndex): (WebKit::WebBackForwardListProxy::backListCount): (WebKit::WebBackForwardListProxy::forwardListCount): (WebKit::WebBackForwardListProxy::close): (WebKit::WebBackForwardListProxy::clear): * WebProcess/WebPage/WebBackForwardListProxy.h: (WebKit::WebBackForwardListProxy::create): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): * WebProcess/WebPage/ios/WebBackForwardListProxyIOS.mm: Copied from Source/WebKit2/WebProcess/WebPage/ios/WebBackForwardListProxyIOS.mm. 2014-04-30 Brady Eidson Only reveal selection service UI after a short delay. and https://bugs.webkit.org/show_bug.cgi?id=132418 Reviewed by Sam Weinig. * WebProcess/WebPage/SelectionOverlayController.cpp: (WebKit::SelectionOverlayController::SelectionOverlayController): (WebKit::SelectionOverlayController::destroyOverlay): Also stop the hover timer. (WebKit::SelectionOverlayController::selectionRectsDidChange): Mark the highlight as dirty. (WebKit::SelectionOverlayController::hoverTimerFired): If the mouse is still over the highlight, set the visible flag and setNeedsDisplay(). * WebProcess/WebPage/SelectionOverlayController.h: * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm: (WebKit::SelectionOverlayController::drawRect): Recreate the highlight if it exists but is marked as dirty. After doing that, possibly reset the hover timer. Also, only performing the actual drawing if the visible flag is set. (WebKit::SelectionOverlayController::mouseEvent): If the mouse moves on or off the highlight, start or stop the hover timer accordingly. (WebKit::SelectionOverlayController::mouseHoverStateChanged): Handle starting/stopping the hover timer. (WebKit::SelectionOverlayController::clearHighlight): Deleted. 2014-04-30 Benjamin Poulain [iOS][WK2] Animated resize incorrectly assumes the layout width is the same as the view width https://bugs.webkit.org/show_bug.cgi?id=132373 Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _beginAnimatedResizeWithUpdates:]): Fix a couple of bugs when the left/right obscured insets change, and/or when the minimum layout size is narrower than the view itself. In order: -We need to perfom and update if the insets change since the unobscuredRect will also change. -The min/max zoom scale should be based on the minimum layout size, that's the definition of minimum layout size in scrollview coordinate :) -The old web view width in content coordinate could be narrower than the old view bounds if there are left or right insets. 2014-04-30 Simon Fraser Remove ENABLE_PLUGIN_PROXY_FOR_VIDEO https://bugs.webkit.org/show_bug.cgi?id=132396 Reviewed by Eric Carlson. Remove ENABLE_PLUGIN_PROXY_FOR_VIDEO and related code. * Configurations/FeatureDefines.xcconfig: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::createMediaPlayerProxyPlugin): Deleted. (WebKit::WebFrameLoaderClient::hideMediaPlayerProxyPlugin): Deleted. (WebKit::WebFrameLoaderClient::showMediaPlayerProxyPlugin): Deleted. * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2014-04-30 Brady Eidson If there are no services available, do not show the service controls UI and https://bugs.webkit.org/show_bug.cgi?id=132410 Reviewed by Tim Horton. Add a lightweight class that lazily polls the appropriate APIs for whether or not appropriate services are installed and usable on the system: * UIProcess/mac/ServicesController.h: Added. (WebKit::ServicesController::imageServicesExist): (WebKit::ServicesController::selectionServicesExist): * UIProcess/mac/ServicesController.mm: Added. (WebKit::ServicesController::shared): (WebKit::ServicesController::ServicesController): (WebKit::ServicesController::refreshExistingServices): (WebKit::ServicesController::refreshExistingServicesTimerFired): Add "image services exist" and "selection services exist" parameters: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::WebProcessCreationParameters): (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/WebContext.cpp: (WebKit::WebContext::createNewWebProcess): (WebKit::WebContext::refreshExistingServices): Called when the context menu proxy realizes that services no longer exist. * UIProcess/WebContext.h: Each WebProcess hangs on to its own copy of the flags for whether or not the services exist: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): (WebKit::WebProcess::initializeWebProcess): (WebKit::WebProcess::setEnabledServices): * WebProcess/WebProcess.h: (WebKit::WebProcess::imageServicesExist): (WebKit::WebProcess::selectionServicesExist): * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::setupServicesMenu): If the menu creation failed, the set of services on the system must have changed. So ask the WebContext to refresh them. * WebProcess/WebPage/SelectionOverlayController.cpp: (WebKit::SelectionOverlayController::selectionRectsDidChange): If services don't exist, don't create an overlay (and destroy any existing overlay!) * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm: (WebKit::SelectionOverlayController::drawRect): If services don't exist, don't draw, and destroy the overlay. * WebProcess/WebProcess.messages.in: * WebKit2.xcodeproj/project.pbxproj: 2014-04-30 Gavin Barraclough https://bugs.webkit.org/show_bug.cgi?id=132415 Fix snapshotting on WebKit2 Reviewed by Geoff Garen * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): - Use a VisibilityToken to keep the process runnable. 2014-04-30 Gavin Barraclough Fix PageVisibility on iOS https://bugs.webkit.org/show_bug.cgi?id=132393 Rubber stamped by Tim Horton * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::isViewWindowActive): (WebKit::PageClientImpl::isViewFocused): (WebKit::PageClientImpl::isViewVisible): (WebKit::PageClientImpl::isViewVisibleOrOccluded): (WebKit::PageClientImpl::isVisuallyIdle): - m_contentView -> m_webView 2014-04-30 Benjamin Poulain [iOS][WK2] Add a SPI to exclude the extended background from some areas of WKWebView https://bugs.webkit.org/show_bug.cgi?id=132406 Reviewed by Beth Dakin. Move the extended background to a separate layer bellow the UIScrollView. The geometry of that layer is then changed based on ExtendedBackgroundExclusionInsets as needed. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): (-[WKWebView _updateScrollViewBackground]): (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _setExtendedBackgroundExclusionInsets:]): (-[WKWebView _extendedBackgroundExclusionInsets]): (-[WKWebView pageExtendedBackgroundColor]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2014-04-30 Simon Fraser Fix build error when building for iOS simulator. * UIProcess/ios/ProcessAssertion.mm: 2014-04-30 Alexey Proskuryakov Move Blob.slice() implementation into BlobRegistryImpl https://bugs.webkit.org/show_bug.cgi?id=132402 Reviewed by Anders Carlsson. * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: (WebKit::NetworkBlobRegistry::registerBlobURLForSlice): * NetworkProcess/FileAPI/NetworkBlobRegistry.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::registerBlobURLForSlice): * WebProcess/FileAPI/BlobRegistryProxy.h: 2014-04-30 Beth Dakin Phone number data detection UI is offset for iframes, pages with topContentInset https://bugs.webkit.org/show_bug.cgi?id=132372 -and corresponding- Reviewed by Tim Horton. Make the overlay an OverlayType::Document, which will keep everything relative to the main Document’s coordinates. * WebProcess/WebPage/TelephoneNumberOverlayController.cpp: (WebKit::TelephoneNumberOverlayController::createOverlayIfNeeded): Make frames work by converting to the main document’s coordinate space. * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm: (WebKit::TelephoneNumberOverlayController::drawRect): 2014-04-30 Roger Fong Unreviewed. Unnecessary explicit initialization of LayoutUnit from r167985. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::determinePrimarySnapshottedPlugIn): Darin points out that I can just use “/2” instead of “/LayoutUnit(2.0)”. 2014-04-30 David Hyatt [New Multicolumn] Enable new multi-column mode https://bugs.webkit.org/show_bug.cgi?id=131825 Reviewed by Simon Fraser. * Shared/WebPreferencesStore.h: 2014-04-30 Brian J. Burg Clean up unnecessary methods in the BackForwardClient interface https://bugs.webkit.org/show_bug.cgi?id=131637 Reviewed by Andreas Kling. Remove stubs for iOS-specific methods in the BackForwardClient interface. Construct a WebBackForwardListProxy directly, and make the WebCore page own the BackForwardClient instance. Convert uses of backForward().client() to accept references instead of raw pointers. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp: (WebKit::InjectedBundleBackForwardList::clear): * WebProcess/WebPage/WebBackForwardListProxy.cpp: Store a reference to WebCore::Page instead of a pointer. (WebKit::WebBackForwardListProxy::WebBackForwardListProxy): (WebKit::WebBackForwardListProxy::create): Deleted. (WebKit::WebBackForwardListProxy::addItem): (WebKit::WebBackForwardListProxy::goToItem): (WebKit::WebBackForwardListProxy::itemAtIndex): (WebKit::WebBackForwardListProxy::backListCount): (WebKit::WebBackForwardListProxy::forwardListCount): (WebKit::WebBackForwardListProxy::close): (WebKit::WebBackForwardListProxy::clear): (WebKit::WebBackForwardListProxy::isActive): * WebProcess/WebPage/WebBackForwardListProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): * WebProcess/WebPage/ios/WebBackForwardListProxyIOS.mm: Removed. 2014-04-30 Gavin Barraclough Fix PageVisibility on iOS https://bugs.webkit.org/show_bug.cgi?id=132393 Reviewed by Andreas Kling. Currently page visibility API doesn't work correctly on WK2 iOS for a few reasons, the most significant of which being that the moment a WKWebView leaves the window we'll suspend the content process, which removes the possibility for any notification to be delivered. This patch addresses this issue, by allowing the process to run for long enough for the notification to be delivered. 1) Introduce a new class, ProcessThrottler, to encapsulate the process suspension logic. 2) WebPageProxy uses ProcessThrottler::VisibilityToken to communicate visibility to the throttler. 3) WebPageProxy tracks pending didUpdateViewState messages to detect when the view state update in the web content process has completed. 4) Distiguish between 'Background' and 'Suspended' states in the ProcessAssertion. * Shared/ChildProcessProxy.h: - moved m_assertion to NetworkProcessProxy / WebProcessProxy. * UIProcess/Network/NetworkProcessProxy.h: - added m_assertion. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): - initialize VisibilityToken state. (WebKit::WebPageProxy::reattachToWebProcess): - reinitialize VisibilityToken state. (WebKit::WebPageProxy::viewStateDidChange): - update VisibilityToken, increment m_pendingViewStateUpdates as necessary. (WebKit::WebPageProxy::updateVisibilityToken): - update the VisibiliyToken based on page visibility, and whether an update is still pending. (WebKit::WebPageProxy::didUpdateViewState): - detect when a view state change has completed in the web process, and update throttle state as necessary. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::didUpdateViewState): Deleted. - moved to .cpp. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::WebProcessProxy): - initialize m_throttler. (WebKit::WebProcessProxy::didFinishLaunching): - notify the PageThrottler of the new connection. * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::throttler): - added accessor. (WebKit::WebProcessProxy::updateProcessState): Deleted. - moved trottling login to ProcessThrottler. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::isViewWindowActive): (WebKit::PageClientImpl::isViewFocused): (WebKit::PageClientImpl::isViewVisible): (WebKit::PageClientImpl::isViewVisibleOrOccluded): - these should only be true when the view is in a window. (WebKit::PageClientImpl::isVisuallyIdle): - this should only be true when the view is not in a window. * UIProcess/ios/ProcessAssertion.h: * UIProcess/ios/ProcessAssertion.mm: (WebKit::flagsForState): - map from enum -> BKSAssertion flags values. (WebKit::ProcessAssertion::ProcessAssertion): - use flagsForState (add support for Suspended state). (WebKit::ProcessAssertion::setState): - use flagsForState (add support for Suspended state). * UIProcess/ios/ProcessThrottler.h: Added. (WebKit::ProcessThrottler::VisibilityToken::visibility): - accessor. (WebKit::ProcessThrottler::VisibilityToken::setVisibility): - update Visibility value; update the token as necessary. (WebKit::ProcessThrottler::ProcessThrottler): - constructor; does not take an assention until didConnnectToProcess is called. (WebKit::ProcessThrottler::visibilityToken): - create a VisibilityToken. (WebKit::ProcessThrottler::didConnnectToProcess): - take an assertion. (WebKit::ProcessThrottler::weakPtr): - create a weak pointer, used for references from VisibilityToken to the throttler. (WebKit::ProcessThrottler::assertionState): - determine the correct AssertionState for the process, based on current visibility. (WebKit::ProcessThrottler::updateAssertion): - update assertion, called in response to visibility change. * UIProcess/ios/ProcessThrottler.mm: Added. (WebKit::ProcessThrottler::VisibilityToken::VisibilityToken): - constructor. (WebKit::ProcessThrottler::VisibilityToken::~VisibilityToken): - set visibility to hidden to reset. (WebKit::ProcessThrottler::VisibilityToken::hideTimerFired): - automatically decay from Hiding -> Hidden on a timeout. (WebKit::ProcessThrottler::VisibilityToken::setVisibilityInternal): - update counters tracking visibility in ProcessThrottler. * UIProcess/ios/WKContentView.mm: (-[WKContentView didMoveToWindow]): - This affects all view state flags, not just the 'InWindow' state. If the view moves out of a window request a reply from the WebContent - we use this to detect when the page visibility event has completed. * UIProcess/ios/WebProcessProxyIOS.mm: (WebKit::WebProcessProxy::updateProcessState): Deleted. - removed. * WebKit2.xcodeproj/project.pbxproj: - added new files. 2014-04-30 Anders Carlsson Preemptive header fixes for when WebKit.framework is going to provide the modern API https://bugs.webkit.org/show_bug.cgi?id=132394 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKBrowsingContextPolicyDelegate.h: (NS_ENUM): Delete WKNavigationType for now. Ultimately the entire delegate should be removed. * UIProcess/API/Cocoa/WKPreferences.h: Add a header guard so we can avoid importing WKPreferences.h more than once. * WebKit2.xcodeproj/project.pbxproj: _WKScriptWorld.h should be private, not public. WKScriptMessagePrivate.h and WKUserContentControllerPrivate.h should be private, not project. 2014-04-30 Joseph Pecoraro Web Inspector: Ensure UIProcess checks in to webinspectord after spawning a WebProcess https://bugs.webkit.org/show_bug.cgi?id=132389 Reviewed by Timothy Hatcher. We aggregate WebProcess WebView's under the UIProcess. If the UIProcess didn't connect to webinspectord these WebViews would have remained hidden. Always have the UIProcess connect to webinspectord when it spawns a WebProcess and may have a child process holding views that it ultimately owns and should display under the UIProcess name. * UIProcess/WebContext.cpp: (WebKit::WebContext::createNewWebProcess): 2014-04-30 Zalan Bujtas [iOS]Subpixel rendering: Extra line of pixels next to the YouTube loading indicator. https://bugs.webkit.org/show_bug.cgi?id=132391 Reviewed by Simon Fraser. CG and GraphicsContext clipping should use the same coordinates. Snapping either one while leaving the other unsnapped results in clipping mismatch and that may produce unpainted areas. Not testable. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::drawInContext): 2014-04-30 Alexey Proskuryakov https://bugs.webkit.org/show_bug.cgi?id=132363 Make Blob RawData immutable Reviewed by Anders Carlsson. * Shared/FileAPI/BlobRegistrationData.cpp: (WebKit::BlobRegistrationData::decode): Create RawData in one step. 2014-04-30 Brady Eidson Followup to: Handle selection services menu. and https://bugs.webkit.org/show_bug.cgi?id=132362 * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::setupServicesMenu): Remove an ASSERT from previous version of the patch that landed. I’d forgotten to add this stray change to my staging area. 2014-04-30 Manuel Rego Casasnovas [CSS Grid Layout] Enable runtime feature by default https://bugs.webkit.org/show_bug.cgi?id=132189 Reviewed by Benjamin Poulain. * Shared/WebPreferencesStore.h: Remove unneeded changes that enable/disable the runtime feature depending on the compilation flag. And set it to true by default. * UIProcess/gtk/ExperimentalFeatures.cpp: Set it to true by default. 2014-04-30 Roger Fong Unreviewed. Wrong units used in offset calculation from r167961. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::determinePrimarySnapshottedPlugIn): I accidentally mixed and matches LayoutUnits with Ints in offset calculation here. It should all just be in LayoutUnits. 2014-04-29 Benjamin Poulain [iOS][WK2] When pageScaleFactor * deviceScaleFactor = 1, the tile grid is completely messed up https://bugs.webkit.org/show_bug.cgi?id=132368 Reviewed by Simon Fraser. * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::PlatformCALayerRemote): PlatformCALayerRemote always initialized the content scale to 1. Since contentsScale is supposed to reflect zoomScale * deviceScaleFactor, the value should be 2. This was causing bugs whenever the page scale factor was 1/2 on retina device (device scale factor = 2). When the page is initialized, GraphicsLayerCA::updateContentsScale(0.5) computes a contentsScale of 1. There is an early return on if (contentsScale == m_layer->contentsScale()). Since PlatformCALayerRemote->contentsScale() was incorreclty returning one, we were leaving the tile backing unmodified. Later, when the transaction is commited, the tile backing would still be default initialized and would render everything at the wrong scale. 2014-04-29 Eric Carlson [Mac] tag the video layers with descriptive name to aid debugging https://bugs.webkit.org/show_bug.cgi?id=132371 Reviewed by Darin Adler. * WebProcess/ios/WebVideoFullscreenManager.mm: (WebKit::WebVideoFullscreenManager::enterFullscreenForNode): Set the fullscreen host layer name in a debug build. 2014-04-29 Brady Eidson Handle selection services menu. and https://bugs.webkit.org/show_bug.cgi?id=132362 Reviewed by Tim Horton. Add members for the relevant info for showing a service menu for a selection: * Shared/ContextMenuContextData.cpp: (WebKit::ContextMenuContextData::ContextMenuContextData): (WebKit::ContextMenuContextData::controlledDataIsEditable): * Shared/ContextMenuContextData.h: (WebKit::ContextMenuContextData::ContextMenuContextData): (WebKit::ContextMenuContextData::controlledSelectionData): (WebKit::ContextMenuContextData::needsServicesMenu): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::replaceSelectionWithPasteboardData): Changed to allow for multiple types on the overridden pasteboard. (WebKit::WebPageProxy::showSelectionServiceMenu): Update the services menu code to know the difference between an image service and a selection service: * UIProcess/mac/WebContextMenuProxyMac.h: * UIProcess/mac/WebContextMenuProxyMac.mm: (-[WKSharingServicePickerDelegate sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]): (-[WKSharingServicePickerDelegate sharingService:willShareItems:]): (-[WKSharingServicePickerDelegate sharingService:didShareItems:]): (WebKit::WebContextMenuProxyMac::contextMenuItemSelected): (WebKit::WebContextMenuProxyMac::setupServicesMenu): (WebKit::WebContextMenuProxyMac::clearServicesMenu): (WebKit::WebContextMenuProxyMac::populate): (WebKit::WebContextMenuProxyMac::showContextMenu): (WebKit::WebContextMenuProxyMac::setupImageServicesMenu): Deleted. (WebKit::WebContextMenuProxyMac::clearImageServicesMenu): Deleted. * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp: (WebKit::WebPasteboardOverrides::getDataForOverride): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::replaceSelectionWithPasteboardData): Changed to allow for multiple types on the overridden pasteboard. (WebKit::WebPage::handleSelectionServiceClick): Pass the relevant selection data through to the UIProcess as RTFD data. * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm: (WebKit::SelectionOverlayController::handleClick): Notify the WebPage of the click. 2014-04-29 Dan Bernstein [Cocoa] Crash when invoking a method with an unsigned parameter on a remote object https://bugs.webkit.org/show_bug.cgi?id=132366 Reviewed by Anders Carlsson. * Shared/API/Cocoa/WKRemoteObjectCoder.mm: (encodeInvocation): Handle the 'I' type code. Interpret the 'q' and 'Q' type codes in an architecture-independent manner. (decodeInvocationArguments): Ditto. 2014-04-29 Roger Fong Don't immediately snapshot plugin to allow for proper dominant plugin detection. https://bugs.webkit.org/show_bug.cgi?id=132294. Reviewed by Dean Jackson. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::didInitializePlugin): Instead of immediately setting the display state to DisplaySnapshot, put it on a timer to let the page fully layout and get hit test properly. 2014-04-28 Roger Fong Plugins hidden by images should autoplay. https://bugs.webkit.org/show_bug.cgi?id=132222. Reviewed by Jon Lee and Darin Adler. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::determinePrimarySnapshottedPlugIn): If the image on top of the plugin is similarly sized and similarly positioned as the plugin rect, set the plugin to autoplay. This is assuming that the previous snapshot checks have passed as well. 2014-04-29 Filip Pizlo Use LLVM as a backend for the fourth-tier DFG JIT (a.k.a. the FTL JIT) https://bugs.webkit.org/show_bug.cgi?id=112840 Rubber stamped by Geoffrey Garen. * Configurations/FeatureDefines.xcconfig: 2014-04-29 Brady Eidson Change Image Controls replacement to use selection and paste and https://bugs.webkit.org/show_bug.cgi?id=131992 Reviewed by Tim Horton. Add a "pasteboard override" mechanism which allows WebKit to keep pasteboard content local to the WebProcess and access it there without having to message up to the UI process: * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp: Added. (WebKit::WebPasteboardOverrides::sharedPasteboardOverrides): (WebKit::WebPasteboardOverrides::WebPasteboardOverrides): (WebKit::WebPasteboardOverrides::addOverride): (WebKit::WebPasteboardOverrides::removeOverride): (WebKit::WebPasteboardOverrides::overriddenTypes): (WebKit::WebPasteboardOverrides::getDataForOverride): * WebProcess/WebCoreSupport/WebPasteboardOverrides.h: Added. Change the pasteboard strategy to consult the pasteboard overrides before consulting the native pasteboard: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::getTypes): (WebKit::WebPlatformStrategies::bufferForType): Add "replaceSelectionWithPasteboardData" which uses the new pasteboard overrides mechanism and then has WebCore perform the replacement: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::replaceSelectionPasteboardName): (WebKit::WebPage::replaceSelectionWithPasteboardData): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::replaceSelectionWithPasteboardData): * UIProcess/mac/WebContextMenuProxyMac.h: (WebKit::WebContextMenuProxyMac::page): * UIProcess/mac/WebContextMenuProxyMac.mm: (-[WKSharingServicePickerDelegate sharingService:didShareItems:]): Use "replaceSelectionWithPasteboardData". (WebKit::WebContextMenuProxyMac::WebContextMenuProxyMac): (WebKit::WebContextMenuProxyMac::replaceControlledImage): Deleted. Remain other remnants of "replaceControlledImage": * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::replaceControlledImage): Deleted. * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebContextMenu.cpp: (WebKit::WebContextMenu::replaceControlledImage): Deleted. * WebProcess/WebPage/WebContextMenu.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::replaceControlledImage): Deleted. * WebKit2.xcodeproj/project.pbxproj: 2014-04-29 Tim Horton Build fix. * DatabaseProcess/ios/DatabaseProcessIOS.mm: 2014-04-29 Alexey Proskuryakov [WK2] DatabaseProcess should be sandboxed https://bugs.webkit.org/show_bug.cgi?id=132324 Reviewed by Darin Adler. * Configurations/WebKit2.xcconfig: Added the profile to the list of files skipped on iOS. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::initializeDatabaseProcess): Consume a sandbox extension for IndexedDB directory (which we get with initialization message after entering sandbox). * DatabaseProcess/ios: Added. * DatabaseProcess/ios/DatabaseProcessIOS.mm: Copied from Source/WebKit2/DatabaseProcess/mac/DatabaseProcessMac.mm. Separated from Mac version to match how other processes are implemented. * DatabaseProcess/mac/DatabaseProcessMac.mm: (WebKit::DatabaseProcess::initializeProcessName): Removed ifdefs. * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in: Added. * DerivedSources.make: Generate the profile from .sb.in. * Shared/Databases/DatabaseProcessCreationParameters.cpp: (WebKit::DatabaseProcessCreationParameters::encode): (WebKit::DatabaseProcessCreationParameters::decode): * Shared/Databases/DatabaseProcessCreationParameters.h: Added a sandbox extension for indexedDatabaseDirectory. * Shared/SecurityOriginData.h: Added an unrelated FIXME. * UIProcess/WebContext.cpp: (WebKit::WebContext::ensureDatabaseProcess): Create a sandbox extension for indexedDatabaseDirectory. * WebKit2.xcodeproj/project.pbxproj: Added new files. 2014-04-28 Andy Estes [iOS] Introduce -didNotHandleTapAsClickAtPoint: to WKUIDelegatePrivate https://bugs.webkit.org/show_bug.cgi?id=132316 Reviewed by Darin Adler. One WebKit2 client is interested to know if a tap was not handled by an element that responds to clicks. Introduce a new, private WKUIDelegate method telling it that a tap at a location was not handled as a click on an element. * UIProcess/API/APIUIClient.h: (API::UIClient::didNotHandleTapAsClick): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::didNotHandleTapAsClick): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::didNotHandleTapAsClick): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleTap): Sent Messages::WebPageProxy::DidNotHandleTapAsClick if the tap wasn't handled, no node responded to the click event, or the responding node wasn't an element. 2014-04-29 Zan Dobersek [GTK][WK2] Avoid Vector copies in WebViewBaseInputMethodFilter::setPreedit() https://bugs.webkit.org/show_bug.cgi?id=132323 Reviewed by Carlos Garcia Campos. * UIProcess/API/gtk/WebViewBaseInputMethodFilter.cpp: (WebKit::WebViewBaseInputMethodFilter::setPreedit): Inline the Vector object construction into the WebPageProxy::setComposition() call to avoid extra Vector copies and moves. 2014-04-28 Dan Bernstein REGRESSION (r159358): Crash in InjectedBundleHitTestResult::frame https://bugs.webkit.org/show_bug.cgi?id=132318 Reviewed by Andy Estes. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction): Fixed a typo: set the source frame, not the destination frame. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Changed to get the frame for the action not from a hit test result, because some link activation actions are not mouse events, but rather from the event’s target. 2014-04-28 Benjamin Poulain [iOS][WK2] Restore the scroll position and scale from the HistoryItem (mostly) https://bugs.webkit.org/show_bug.cgi?id=132307 Reviewed by Simon Fraser. Restore the scroll position and scale on back-forward by restoring the values from HistoryItem. This covers the common cases, see . * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:WebKit::]): (-[WKWebView _didCommitLoadForMainFrame]): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView _didCommitLoadForMainFrame]): Get rid of the old code restoring the scroll position. This is now done by the WebProcess. * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): Update the scrolling tree after invoking didCommitLayerTree() on the WebPageProxy. WKContentView and WKWebView states are updated in response to didCommitLayerTree(), the content size and scale in particular are set there. After that, the content size/scale is in the same state as the layerTree update, and we can scroll the content as needed. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm: (WebKit::WebFrameLoaderClient::restoreViewState): iOS WebKit1 uses a custom restoreViewState(), do the same for WebKit2 since the generic code is #ifdefed out. This is also necessary for the main frame's state update. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::restorePageState): Restore the scale and position of the main frame. For now, we assume m_userHasChangedPageScaleFactor is set otherwise the initial-scale would override the restored value. We will need to fix that, the value should probably be saved with the history. 2014-04-28 Benjamin Poulain [iOS][WK2] iOS fix after r167867 https://bugs.webkit.org/show_bug.cgi?id=132302 Reviewed by Simon Fraser. iOS Touch Points uses "phase" for describing the touch points state for historical reasons. This patch adds state() as a synonym for phase, and revert r167893. * Shared/WebEvent.h: (WebKit::WebPlatformTouchPoint::state): * UIProcess/WebPageProxy.cpp: (WebKit::areAllTouchPointsReleased): 2014-04-28 Andy Estes Fix a transcription error from r167901. When addressing Darin's review feedback, I moved the iteration of dataArray from QuickLookDocumentData::append() to WebQuickLookHandleClient::didReceiveDataArray(), but I forgot to update the context argument to CFArrayApplyFunction() accordingly. * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp: (WebKit::WebQuickLookHandleClient::didReceiveDataArray): 2014-04-28 Enrica Casucci [WK2 iOS] Need to show title in the action sheet for images not inside an anchor element. https://bugs.webkit.org/show_bug.cgi?id=132304 Reviewed by Benjamin Poulain. If the image in not inside an anchor tag, we must use the title attribute as title for the action sheet. * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]): 2014-04-28 Tim Horton WebKit2 View Gestures (Swipe): Discard snapshots made with a different view size/pixel density https://bugs.webkit.org/show_bug.cgi?id=132115 Reviewed by Simon Fraser. We shouldn't try to use snapshots if they no longer match the destination view size. To do this, we need an accurate understanding of the topContentInset, both for the Web view, and for any custom views, because we don't want to include the inset area in the snapshot, and we don't want to reject snapshots that differ from the current view only because they have an inset or not. * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView _takeViewSnapshot]): (-[WKView _setCustomSwipeViewsTopContentInset:]): Add and plumb through a topContentInset property to apply to the custom swipe views. For simplicitly's sake in the multi-view case, it is applied in window coordinates, so clients will have to do conversions if necessary. Don't include the top content inset in the snapshot that is taken. * UIProcess/mac/ViewGestureController.h: (WebKit::ViewGestureController::setCustomSwipeViewsTopContentInset): * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::ViewGestureController): (WebKit::ViewGestureController::windowRelativeBoundsForCustomSwipeViews): Apply the aforementioned custom swipe view top content inset. (WebKit::ViewGestureController::determineSnapshotLayerParent): (WebKit::ViewGestureController::determineLayerAdjacentToSnapshotForParent): Factor these out of beginSwipeGesture. (WebKit::ViewGestureController::retrieveSnapshotForItem): Don't return a snapshot if the current deviceScaleFactor doesn't match that at which the snapshot was taken, or if the size of the snapshot doesn't match the unobscured part of the snapshot layer (the layer's size sans top content inset). (WebKit::layerGeometryFlippedToRoot): Added. Determine whether geometry flipping occurs between a layer and the root of the tree it is in. (WebKit::ViewGestureController::applyDebuggingPropertiesToSwipeViews): Factor out debugging layer properties, and add some borders and backgrounds to our layers. I switched to invert instead of blur because blur makes the borders hard to use. (WebKit::ViewGestureController::beginSwipeGesture): Add an additional layer, the swipeLayer, which is the parent of the swipeSnapshotLayer. We use this layer to compensate for geometry flipping, since we don't necessarily know the structure of the layer tree ahead of time when inserting snapshots into the client's layer tree, in the custom swipe view case. The swipe layer is always the full size of the view, including topContentInset, and has a white background in order to fill in that space. The snapshot layer is the size of the view *excluding* the topContentInset, which should match the size of the snapshot image itself (and we reject the image and just paint white if this is not the case). (WebKit::ViewGestureController::handleSwipeGesture): (WebKit::ViewGestureController::removeSwipeSnapshot): Move and remove the new swipeLayer. * UIProcess/mac/ViewSnapshotStore.h: * UIProcess/mac/ViewSnapshotStore.mm: (WebKit::ViewSnapshotStore::recordSnapshot): Store the deviceScaleFactor at the time the snapshot was taken. Fix a bug where the count of snapshots with live images was too high because we were failing to decrement it when replacing a snapshot of an existing item with a fresh one. 2014-04-28 Enrica Casucci WK2 iOS: crash when handling a synthetic keyboard event. https://bugs.webkit.org/show_bug.cgi?id=132296 Reviewed by Benjamin Poulain. Adding a null check, since synthetic keyboard events do not have a corresponding platform event. We already do this on OS X. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleEditingKeyboardEvent): 2014-04-24 Andy Estes [iOS] Implement WebQuickLookHandleClient for WebKit2 https://bugs.webkit.org/show_bug.cgi?id=132157 Reviewed by Darin Adler. * Shared/API/Cocoa/_WKNSFileManagerExtras.h: Added. * Shared/API/Cocoa/_WKNSFileManagerExtras.mm: Added. (+[NSFileManager _web_createTemporaryFileForQuickLook:]): Called WebCore::createTemporaryFileForQuickLook(). * Shared/ios/QuickLookDocumentData.cpp: Added. (WebKit::QuickLookDocumentData::QuickLookDocumentData): (WebKit::QuickLookDocumentData::append): Appened each CFDataRef to m_data and added their sizes to m_size. (WebKit::QuickLookDocumentData::decodedData): Returned the combined CFDataRef created by decode(). Named this method 'decodedData' to indicate that it should only be called on objects populated by decode(). (WebKit::QuickLookDocumentData::clear): Cleared m_data and reset m_size to 0. (WebKit::QuickLookDocumentData::encode): Implemented a custom encoding function to avoid having to combine m_data into contiguous memory at encoding time. Encoded m_size then sequentially encoded each member of m_data. (WebKit::QuickLookDocumentData::decode): Decoded the byte stream into a single CFDataRef. Eagerly copied the decoded data rather than using a DataReference since we know this will outlive the decoder. * Shared/ios/QuickLookDocumentData.h: Added. * UIProcess/API/APILoaderClient.h: (API::LoaderClient::didStartLoadForQuickLookDocumentInMainFrame): (API::LoaderClient::didFinishLoadForQuickLookDocumentInMainFrame): * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::NavigationState::LoaderClient::didStartLoadForQuickLookDocumentInMainFrame): (WebKit::NavigationState::LoaderClient::didFinishLoadForQuickLookDocumentInMainFrame): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::didStartLoadForQuickLookDocumentInMainFrame): (WebKit::WebPageProxy::didFinishLoadForQuickLookDocumentInMainFrame): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm: (WebKit::WebFrameLoaderClient::didCreateQuickLookHandle): * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp: Added. (WebKit::WebQuickLookHandleClient::WebQuickLookHandleClient): Sent DidStartLoadForQuickLookDocumentInMainFrame to WebPageProxy. (WebKit::WebQuickLookHandleClient::didReceiveDataArray): Appended dataArray to m_data. (WebKit::WebQuickLookHandleClient::didFinishLoading): Sent DidFinishLoadForQuickLookDocumentInMainFrame to WebPageProxy and then cleared m_data. (WebKit::WebQuickLookHandleClient::didFail): Cleared m_data. * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h: Added. (WebKit::WebQuickLookHandleClient::create): 2014-04-28 Brady Eidson Hide service controls for selection behind a runtime switch and https://bugs.webkit.org/show_bug.cgi?id=132291 Reviewed by Tim Horton. * Shared/WebPreferencesStore.h: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::selectionRectsDidChange): Do nothing if the UI is disabled. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): (WebKit::WebPage::updatePreferences): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::serviceControlsEnabled): 2014-04-28 Commit Queue Unreviewed, rolling out r167853. https://bugs.webkit.org/show_bug.cgi?id=132288 caused crashes+timeouts+layout test failures described in the bug (Requested by thorton on #webkit). Reverted changeset: "Coalesce responses on network process side" https://bugs.webkit.org/show_bug.cgi?id=132229 http://trac.webkit.org/changeset/167853 2014-04-28 Simon Fraser Fix the iOS buld. * UIProcess/WebPageProxy.cpp: (WebKit::areAllTouchPointsReleased): 2014-04-24 Simon Fraser [iOS WK2] Make subview rebuilding more incremental https://bugs.webkit.org/show_bug.cgi?id=132162 Reviewed by Sam Weinig. Previously we did bulk replacement of subviews, but that triggers UIKit to send spurious will/DidMoveToWindow messages, which can interfere with UIScrollView scrolling. Make _web_setSubviews more incremental, only removing deleted subviews, adding new ones, and moving existing ones into the correct order. * Shared/mac/RemoteLayerTreePropertyApplier.mm: (-[UIView _web_setSubviews:]): 2014-04-24 Simon Fraser [iOS WK2] flickery scrolling with overflow-scrolling:touch https://bugs.webkit.org/show_bug.cgi?id=132150 Reviewed by Tim Horton. Maintain a flag that tells us if the user is interacting with the UIScrollView, and while set, don't clobber the contentOffset via scrolling tree updates. * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (-[WKOverflowScrollViewDelegate initWithScrollingTreeNode:WebKit::]): (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]): (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]): We need this one, not scrollViewDidEndScrollingAnimation:, to detect the end of decleration. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren): (-[WKOverflowScrollViewDelegate scrollViewDidEndScrollingAnimation:]): Deleted. 2014-04-28 Krzysztof Wolanski [X11] Add missing case for mime type application/x-webkit-test-netscape https://bugs.webkit.org/show_bug.cgi?id=132278 Reviewed by Darin Adler. Case for x-webkit-test-netscape has been omitted along with r167759. * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::initialize): 2014-04-28 Zan Dobersek [WK2][X11] NetscapePluginModule::scanPlugin() should write UTF-8 strings to stdout https://bugs.webkit.org/show_bug.cgi?id=132245 Reviewed by Carlos Garcia Campos. NetscapePluginModule::scanPlugin(), in the helper writeLine function, takes each character of the given string and writes it out as a UChar, doing two fputc calls for each byte of the 16-bit type. This fails badly with characters with integer value less than 256 as the most significant byte of the UChar is written out as a null character. This effectively chops the output that's gathered in the UIProcess and is parsed in PluginProcessProxy::scanPlugin(). To avoid all this, the UTF-8 encoding of the string is written out in the PluginProcess, and String::fromUTF8() is called in the UIProcess to properly decode the received string. * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp: (WebKit::writeCharacter): (WebKit::writeLine): (WebKit::writeByte): Deleted. * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp: (WebKit::PluginProcessProxy::scanPlugin): 2014-04-28 Zan Dobersek [GTK][WK2] Missing return statement in webkit_plugin_get_description() https://bugs.webkit.org/show_bug.cgi?id=132263 Reviewed by Carlos Garcia Campos. * UIProcess/API/gtk/WebKitPlugin.cpp: (webkit_plugin_get_description): Actually return the data of the cached plugin description CString. 2014-04-28 Carlos Garcia Campos [GTK] Crash in debug build with removing windowed plugin child widgets from the view https://bugs.webkit.org/show_bug.cgi?id=132252 Reviewed by Philippe Normand. It crashes due to an assert in HashTable that checks the iterators validity. The problem is that we are iterating the children map and the callback called on every iteration might modify the map, making the iterators invalid. This happens when the WebView is destroyed, GtkContainer calls gtk_container_foreach() with gtk_widget_destroy as callback. When a widget inside a container is destroyed, it's removed from the container, and in our case, the child widget is removed from the map. This fixes several crashes when running layout tests in debug bot. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseContainerForall): Use copyKeysToVector() instead of using a range iterator for the map keys and check in every iteration that the child widget from the keys vector is still present in the map before calling the callback. 2014-04-28 Carlos Garcia Campos [GTK] GObject introspection links to installed libs when using jhbuild https://bugs.webkit.org/show_bug.cgi?id=132220 Reviewed by Martin Robinson. The problem is that gobject-introspection is linking the temporary binaries adding the library paths present LDFLAGS environment variable first, taking precedence over the libraries in the build dir. Since the libraries paths of the dependencies are already correctly deduced by gobject-introspection using ldd, we can just unset the LDFLAGS variable before calling g-ir-scanner to make sure the libraries in the build dir take predence. * PlatformGTK.cmake: 2014-04-27 Tim Horton REGRESSION (r164702): Double tap doesn't stay under the new element once the animation finishes https://bugs.webkit.org/show_bug.cgi?id=132239 Reviewed by Darin Adler. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::scalePage): The change in r167864 broke iOS animated resize, because it was depending on the dynamic size update code not running if the scale wasn't going to change. So, as a band-aid we should bail from doing that work if the scales aren't different. In the long term we should try to untangle this code and make it less platform dependent. 2014-04-27 Eunmi Lee TouchEvent is not handled after releasing any point among touched points. https://bugs.webkit.org/show_bug.cgi?id=132043 Reviewed by Benjamin Poulain. Handle TouchEvent until all touched points are released by setting trackingTouchEvents variable to false when all points are released. * UIProcess/WebPageProxy.cpp: (WebKit::areAllTouchPointsReleased): (WebKit::WebPageProxy::handleTouchEventSynchronously): (WebKit::WebPageProxy::handleTouchEventAsynchronously): (WebKit::WebPageProxy::handleTouchEvent): 2014-04-27 Alexey Proskuryakov Don't use DispatchMessageEvenWhenWaitingForSyncReply for messages from NetworkProcess https://bugs.webkit.org/show_bug.cgi?id=132144 Reviewed by Darin Adler. * NetworkProcess/AsynchronousNetworkLoaderClient.cpp: (WebKit::AsynchronousNetworkLoaderClient::willSendRequest): (WebKit::AsynchronousNetworkLoaderClient::canAuthenticateAgainstProtectionSpace): Dont use the IPC::DispatchMessageEvenWhenWaitingForSyncReply flag. It's not needed, almost never works in NetworkProcess, but may cause trouble if it did. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess): Removed setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage() function call, because there are no more any messages in NetworkProcess it could affect. * Platform/IPC/Connection.cpp: (IPC::Connection::dispatchMessage): Added a FIXME for an unrelated bug Anders and myself noticed while looking into this. 2014-04-27 Dan Bernstein [Cocoa] -[WKWebProcessPlugInController parameters] returns nil if no parameters have been set yet https://bugs.webkit.org/show_bug.cgi?id=132223 Reviewed by Sam Weinig. * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm: (WebKit::InjectedBundle::bundleParameters): Create the WKWebProcessBundleParameters if needed. 2014-04-27 Tim Horton REGRESSION (r164702): Double tap doesn't stay under the new element once the animation finishes https://bugs.webkit.org/show_bug.cgi?id=132239 Reviewed by Sam Weinig. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::scalePage): The early-return added to WebPage::scalePage breaks callers who depend on being able to call scalePage() with the same scale but a different origin and having that change take effect. Page::setPageScaleFactor already has the requisite logic, so move the early return down after that call, and guard only notification of page scale changes. 2014-04-25 Andy Estes [iOS] Stop creating a WKWebResourceQuickLookDelegate for every WebResourceLoader https://bugs.webkit.org/show_bug.cgi?id=132215 Reviewed by Dan Bernstein. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo): Called QuickLookHandle::create() directly. * WebProcess/Network/WebResourceLoader.h: * WebProcess/ios/WebResourceLoaderIOS.mm: Removed. 2014-04-27 Sam Weinig [iOS WebKit2] Add support for text autosizing https://bugs.webkit.org/show_bug.cgi?id=132237 Reviewed by Tim Horton. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): * UIProcess/WebPageProxy.h: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::textAutosizingWidth): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): Pass the text autosizing width from the UIProcess to WebProcess. 2014-04-27 Tim Horton WebKit2 View Gestures (Zoom): Pages with 'background-attachment: fixed' don't behave correctly when zoomed https://bugs.webkit.org/show_bug.cgi?id=132225 Reviewed by Darin Adler. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::layerForTransientZoom): (WebKit::TiledCoreAnimationDrawingArea::shadowLayerForTransientZoom): (WebKit::TiledCoreAnimationDrawingArea::adjustTransientZoom): (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom): (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage): Factor out code to choose which layer (and shadow layer) to apply the transient zoom to. If we have a contentsContainmentLayer (because we have composited background-attachment: fixed), it applies page scale, so we should apply the transient zoom to that layer instead of the RenderView's main GraphicsLayer. 2014-04-27 Pratik Solanki Unreviewed. iOS build fix. * UIProcess/ios/SmartMagnificationController.h: 2014-04-27 Zan Dobersek Move cross-port WebKit2 code to std::unique_ptr https://bugs.webkit.org/show_bug.cgi?id=129670 Reviewed by Darin Adler. Replace uses of OwnPtr, PassOwnPtr in cross-port WebKit2 code with std::unique_ptr. * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createIndex): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::addSupplement): * NetworkProcess/SynchronousNetworkLoaderClient.cpp: (WebKit::SynchronousNetworkLoaderClient::didReceiveBuffer): * NetworkProcess/SynchronousNetworkLoaderClient.h: * Platform/IPC/Connection.cpp: (IPC::Connection::dispatchWorkQueueMessageReceiverMessage): * Platform/IPC/Connection.h: * Platform/IPC/MessageReceiver.h: * Platform/Module.h: * Platform/WorkQueue.h: * Platform/efl/ModuleEfl.cpp: (WebKit::Module::load): * Platform/mac/LayerHostingContext.mm: * Shared/APIURL.h: * Shared/Network/CustomProtocols/CustomProtocolManager.h: * Shared/Plugins/NPRemoteObjectMap.cpp: * Shared/ShareableBitmap.h: * UIProcess/DrawingAreaProxyImpl.h: * UIProcess/InspectorServer/WebSocketServer.cpp: (WebKit::WebSocketServer::didAcceptConnection): (WebKit::WebSocketServer::didCloseWebSocketServerConnection): * UIProcess/InspectorServer/WebSocketServer.h: * UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp: (WebKit::connectionCallback): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::createDownloadProxy): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Notifications/WebNotificationManagerProxy.h: * UIProcess/Plugins/WebPluginSiteDataManager.cpp: (WebKit::WebPluginSiteDataManager::getSitesWithData): (WebKit::WebPluginSiteDataManager::clearSiteData): (WebKit::WebPluginSiteDataManager::didGetSitesWithDataForAllPlugins): (WebKit::WebPluginSiteDataManager::didClearSiteDataForAllPlugins): * UIProcess/Plugins/WebPluginSiteDataManager.h: * UIProcess/Storage/StorageManager.cpp: (WebKit::callCallbackFunction): (WebKit::StorageManager::getOriginsInternal): * UIProcess/WebPageProxy.cpp: (WebKit::ExceededDatabaseQuotaRecords::areBeingProcessed): (WebKit::ExceededDatabaseQuotaRecords::createRecord): (WebKit::ExceededDatabaseQuotaRecords::add): (WebKit::ExceededDatabaseQuotaRecords::next): (WebKit::WebPageProxy::handleMouseEvent): (WebKit::WebPageProxy::handleWheelEvent): (WebKit::WebPageProxy::processNextQueuedWheelEvent): (WebKit::WebPageProxy::internalShowContextMenu): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::createDownloadProxy): * UIProcess/WebProcessProxy.h: * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::PluginDestructionProtector::PluginDestructionProtector): * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::deliverData): * WebProcess/Plugins/Netscape/NetscapePluginStream.h: * WebProcess/Plugins/PluginProcessConnectionManager.h: * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::initialize): (WebKit::PluginProxy::didCreatePluginInternal): (WebKit::PluginProxy::didFailToCreatePluginInternal): * WebProcess/Plugins/PluginProxy.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::createWebEvent): (WebKit::PluginView::handleEvent): * WebProcess/Plugins/PluginView.h: * WebProcess/WebCoreSupport/WebPopupMenu.h: * WebProcess/WebPage/EventDispatcher.cpp: (WebKit::EventDispatcher::EventDispatcher): * WebProcess/WebPage/EventDispatcher.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): (WebKit::WebPage::beginPrinting): * WebProcess/WebPage/WebPage.h: * WebProcess/WebProcess.h: (WebKit::WebProcess::addSupplement): 2014-04-27 Antti Koivisto Coalesce responses on network process side https://bugs.webkit.org/show_bug.cgi?id=132229 Reviewed by Andreas Kling. To reduce IPC we should coalesce response data in the network process and send it over with single IPC call. * NetworkProcess/AsynchronousNetworkLoaderClient.cpp: (WebKit::AsynchronousNetworkLoaderClient::AsynchronousNetworkLoaderClient): (WebKit::AsynchronousNetworkLoaderClient::didReceiveResponse): (WebKit::AsynchronousNetworkLoaderClient::didReceiveBuffer): (WebKit::AsynchronousNetworkLoaderClient::didFinishLoading): (WebKit::AsynchronousNetworkLoaderClient::didFail): (WebKit::AsynchronousNetworkLoaderClient::dispatchPartialCoalescedResponse): (WebKit::AsynchronousNetworkLoaderClient::clearCoalescedResponse): (WebKit::AsynchronousNetworkLoaderClient::responseCoalesceTimerFired): Coalesce the response. Completed response is sent on didFinishLoading. If the coalesce timer fires before that the data accumulated so far is dispatched. * NetworkProcess/AsynchronousNetworkLoaderClient.h: * NetworkProcess/NetworkResourceLoader.h: * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveCompleteResponse): * WebProcess/Network/WebResourceLoader.h: * WebProcess/Network/WebResourceLoader.messages.in: Add a new message type that covers didReceiveResponse, didReceiveBuffer and didFinishLoading in a single message. 2014-04-26 Tim Horton REGRESSION (r167775): Safari crashes in ViewSnapshotStore::pruneSnapshots after loading 20 pages https://bugs.webkit.org/show_bug.cgi?id=132204 Reviewed by Dan Bernstein and Sam Weinig. * UIProcess/mac/ViewSnapshotStore.mm: (WebKit::ViewSnapshotStore::pruneSnapshots): (WebKit::ViewSnapshotStore::recordSnapshot): Fix a bug where the count of snapshots with live images was too high because we were failing to decrement it when replacing a snapshot of an existing item with a fresh one. 2014-04-26 Dan Bernstein [Cocoa] Rename a bundle form delegate method https://bugs.webkit.org/show_bug.cgi?id=132221 Reviewed by Adele Peterson. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Renamed. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Check for the method under the old (“new”) name and under the new name. 2014-04-25 Dan Bernstein [Cocoa] Synthesized getter for WKNavigationAction's _userInitiated property has the wrong name https://bugs.webkit.org/show_bug.cgi?id=132219 Reviewed by Sam Weinig. * UIProcess/API/Cocoa/WKNavigationActionInternal.h: 2014-04-25 Simon Fraser [iOS] getAssistedNodeInformation crashes getting the bounding box if it doesn't have a renderer https://bugs.webkit.org/show_bug.cgi?id=132217 Reviewed by Dean Jackson. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getAssistedNodeInformation): Check that m_assistedNode has a renderer before asking for its bounding box. 2014-04-25 Benjamin Poulain [iOS][WK2] Add an intermediary view to do the target transform and adjustment transform https://bugs.webkit.org/show_bug.cgi?id=132175 Reviewed by Enrica Casucci. Some utility views of WKContentView account for the transforms between the content view and the utility view. Since the dynamic resize relies on setting subLayerTransforms, it is getting in the way. This patch adds a layer in between for the animation. That way the content view remains unscaled. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:WebKit::]): (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _endAnimatedResize]): 2014-04-25 Enrica Casucci REGRESSION (iOS WebKit2): Selection is not being repainted during live resize. https://bugs.webkit.org/show_bug.cgi?id=132216 Reviewed by Benjamin Poulain. Since the selection is drawn in the UIProcess on iOS, we need to update the selection rects and force a repaint during a live resize. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidLayout): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateSelectionAppearance): 2014-04-25 Brady Eidson Add a selection overlay. and https://bugs.webkit.org/show_bug.cgi?id=132200 Reviewed by David Hyatt. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::selectionRectsDidChange): Pass the new selection rects on to the selection overlay controller. * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebPage/SelectionOverlayController.cpp: Added. (WebKit::SelectionOverlayController::SelectionOverlayController): (WebKit::SelectionOverlayController::createOverlayIfNeeded): (WebKit::SelectionOverlayController::destroyOverlay): (WebKit::SelectionOverlayController::pageOverlayDestroyed): (WebKit::SelectionOverlayController::willMoveToWebPage): (WebKit::SelectionOverlayController::didMoveToWebPage): (WebKit::SelectionOverlayController::selectionRectsDidChange): (WebKit::SelectionOverlayController::drawRect): (WebKit::SelectionOverlayController::mouseEvent): * WebProcess/WebPage/SelectionOverlayController.h: Added. (WebKit::SelectionOverlayController::create): * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm: Added. (WebKit::SelectionOverlayController::drawRect): (WebKit::SelectionOverlayController::mouseEvent): (WebKit::SelectionOverlayController::handleClick): (WebKit::SelectionOverlayController::clearHighlight): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::selectionOverlayController): * WebProcess/WebPage/WebPage.h: 2014-04-25 Enrica Casucci Remove duplicate member variable in WKAutocorrectionRects and WKAutocorrectionContext. https://bugs.webkit.org/show_bug.cgi?id=132206 Reviewed by Benjamin Poulain. * UIProcess/ios/WKContentViewInteraction.mm: 2014-04-25 Dean Jackson Allow a platform-specific size enumeration to be passed into popup-menu display https://bugs.webkit.org/show_bug.cgi?id=132195 Reviewed by Brent Fulgham. With some in-person review comments from Sam Weinig. Platforms like OS X use a set of predefined sizes for built-in controls used for