2014-06-06 Matthew Hanson Roll out r169655. 2014-06-06 Dan Bernstein [iOS] Client-certificate authentication isn’t working https://bugs.webkit.org/show_bug.cgi?id=133527 Reviewed by Darin Adler. * Configurations/Network-iOS.entitlements: Enabled the Network process to access the keys needed to create identities to authenticate with. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): Encode the credential type, and if it is a client certificate, encode the identity and the certificates. (IPC::ArgumentCoder::decode): Decode the credential type. If it is a client certificate, decode the identity and the certificates and use the proper Credential constructor. * Shared/cf/ArgumentCodersCF.cpp: (IPC::typeFromCFTypeRef): Handle SecIdentityRef. (IPC::encode): Encode an identity by encoding its certificate and a persistent reference to its key. (IPC::decode): Decode a certificate and a persistent reference to a key, find the key, and create an identity. * Shared/cf/ArgumentCodersCF.h: 2014-06-06 Matthew Hanson Merge r169655. 2014-06-06 Dan Bernstein [iOS] Client-certificate authentication isn’t working https://bugs.webkit.org/show_bug.cgi?id=133527 Reviewed by Darin Adler. * Configurations/Network-iOS.entitlements: Enabled the Network process to access the keys needed to create identities to authenticate with. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): Encode the credential type, and if it is a client certificate, encode the identity and the certificates. (IPC::ArgumentCoder::decode): Decode the credential type. If it is a client certificate, decode the identity and the certificates and use the proper Credential constructor. * Shared/cf/ArgumentCodersCF.cpp: (IPC::typeFromCFTypeRef): Handle SecIdentityRef. (IPC::encode): Encode an identity by encoding its certificate and a persistent reference to its key. (IPC::decode): Decode a certificate and a persistent reference to a key, find the key, and create an identity. * Shared/cf/ArgumentCodersCF.h: 2014-06-05 Dean Jackson Disable some features on a Safari branch. Reviewed originally by Simon Fraser. Disable: - CSS_EXCLUSIONS - CSS_GRID_LAYOUT - INPUT_TYPE_COLOR - INPUT_TYPE_COLOR_POPUP - CANVAS_PATH - CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED - INDIE_UI - SHARED_WORKERS - WEB_TIMING - NAVIGATOR_HWCONCURRENCY * Configurations/FeatureDefines.xcconfig: 2014-06-05 Benjamin Poulain [iOS][WK2] WebPage sometimes forces two resize events on animated resize https://bugs.webkit.org/show_bug.cgi?id=133534 Reviewed by Enrica Casucci. When I updated the patch for resize events (r168556) to use the unobscured rect in scrollview coordinates, I forgot to update a snippet of code in dynamicViewportSizeUpdate(). Since that code was still using the scaled unobscured rect, there was sometimes a difference of 1 pixel between the size set by that call site and the others. This path nukes the bad code and use the unobscured rect in scrollview coordinates given by the UIProcess. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): 2014-06-05 Benjamin Poulain [iOS][WK2] Add device orientation https://bugs.webkit.org/show_bug.cgi?id=133530 Reviewed by Tim Horton. Add device orientation for WebKit2. For the public API, WKWebView get the updates through the notification UIWindowDidRotateNotification. We do not have any control over how the API is used, but we can expect the size will be updated before the end of rotation in most cases and the events should be sent in the right order. For Safari, we use an override to support animated resize (and some tabs corner cases). On the WebProcess side, we just get the new orientation directly or on DynamicViewportSizeUpdate. * UIProcess/API/Cocoa/WKWebView.mm: (deviceOrientationForUIInterfaceOrientation): (deviceOrientation): (-[WKWebView initWithFrame:configuration:]): (-[WKWebView _windowDidRotate:]): (-[WKWebView _setInterfaceOrientationOverride:]): (-[WKWebView _interfaceOrientationOverride]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::deviceOrientation): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::dynamicViewportSizeUpdate): (WebKit::WebPageProxy::setDeviceOrientation): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: (WebKit::WebChromeClient::deviceOrientation): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::deviceOrientation): * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::setDeviceOrientation): (WebKit::WebPage::dynamicViewportSizeUpdate): 2014-06-05 Oliver Hunt Enable SANDBOX_EXTENSIONS build flag universally on cocoa https://bugs.webkit.org/show_bug.cgi?id=133556 Reviewed by Alexey Proskuryakov. Remove unnecessary iOS exception. * WebKit2Prefix.h: 2014-06-05 Alexey Proskuryakov [Mac] Tweak plug-in sandbox profiles https://bugs.webkit.org/show_bug.cgi?id=133549 Fix and . Reviewed by Sam Weinig and Simon Cooper. * Resources/PlugInSandboxProfiles/com.apple.ist.ds.appleconnect.webplugin.sb: * Resources/PlugInSandboxProfiles/com.microsoft.SilverlightPlugin.sb: 2014-06-05 Tanay C Resolve compiler error (call of overloaded 'schedule' function is ambiguous) https://bugs.webkit.org/show_bug.cgi?id=133467 Reviewed by Carlos Garcia Campos. * Shared/Downloads/soup/DownloadSoup.cpp: (WebKit::DownloadClient::handleResponseLater): Explicitly casting second parameter to std::function 2014-06-04 Benjamin Poulain [iOS][WK2] Restore the visual scroll position instead of the dom scroll position when restoring states from the history https://bugs.webkit.org/show_bug.cgi?id=133490 Reviewed by Tim Horton. Instead of restoring the scroll position, restore the visual position. This makes pages appear at the same position on screen ignoring changes in the obscured top inset. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm: (WebKit::WebFrameLoaderClient::saveViewStateToItem): (WebKit::WebFrameLoaderClient::restoreViewState): Save and restore userHasChangedPageScaleFactor to handle rescaling correctly. Limit the scale into valid viewport limits in case the viewport meta tag has changed or the device has rotated. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::userHasChangedPageScaleFactor): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::restorePageState): (WebKit::WebPage::updateVisibleContentRects): In updateVisibleContentRects, we keep track or the current difference between the exposed rect and the unobscured rect. When restoring the page position, we use the current top inset and the saved exposed rect to restore the visual scroll position. It is not very robust as it does not resolve races between the two processes, but that is not worse than what we is there now. 2014-06-03 Timothy Horton WebKit2 View Gestures (Zoom): Can show unpainted regions when zoom-pinching-out https://bugs.webkit.org/show_bug.cgi?id=133472 Reviewed by Simon Fraser. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::flushLayers): (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToLayers): (WebKit::TiledCoreAnimationDrawingArea::adjustTransientZoom): Use prepopulateRect() when zooming out to ensure that we have tiles for the current exposed area. Factor applyTransientZoomToLayers out of adjustTransientZoom, so that flushLayers can call applyTransientZoomToLayers without ending up calling prepopulateRect() during layer flushing, which causes trouble. It is OK to populate layers at the current scale even when zooming out, because the overdraw already covers most of the zoomed out area, and we're only adding a few more tiles at worst. 2014-06-03 Benjamin Poulain [iOS][WK2] Align the highlight rects with device pixels https://bugs.webkit.org/show_bug.cgi?id=133464 Reviewed by Enrica Casucci. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _showTapHighlightWithColor:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]): 2014-06-02 Enrica Casucci REGRESSION (iOS WebKit2): Single tap in pages with focus on load will clear the selection after the keyboard appears. https://bugs.webkit.org/show_bug.cgi?id=133465 Reviewed by Benjamin Poulain. If a page focuses an input field on load we don't bring the keyboard on screen since the keyboard is only shown when the user interacts with the page with gestures. Still the WebProcess sets the focus and the selection according to the rules. We need to make sure the UI process doesn't accidentally clear this selection when the user starts the interaction with the page. This patch also improves the function that retrieves the autocorrection data to be returned to the keyboard, making sure that we always send back a reply even when we don't have a valid selection. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _singleTapCommited:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::requestAutocorrectionData): 2014-05-31 Anders Carlsson Change DeferrableOneShotTimer to use std::function instead of being a class template https://bugs.webkit.org/show_bug.cgi?id=133423 Reviewed by Antti Koivisto. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformSetCacheModel): * Shared/CacheModel.cpp: (WebKit::calculateCacheSizes): * Shared/CacheModel.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::pluginSnapshotTimerFired): * WebProcess/Plugins/PluginView.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformSetCacheModel): 2014-06-02 Benjamin Poulain [iOS][WK2] Round the UIScrollView content size to device pixel https://bugs.webkit.org/show_bug.cgi?id=133417 Reviewed by Simon Fraser. We should really have the scaled content size floored to device pixels, but that will be for another time. This patch ensure the content size as seen by the API is rounded to device pixels. The value is floored to avoid showing partial pixels when the content is stable. * UIProcess/API/Cocoa/WKWebView.mm: (floorFloatToPixels): (roundScrollViewCountentSize): (-[WKWebView _setHasCustomContentView:loadedMIMEType:WTF::]): (-[WKWebView _didCommitLayerTree:WebKit::]): (-[WKWebView scrollView:contentSizeForZoomScale:withProposedSize:]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _endAnimatedResize]): 2014-06-02 Oliver Hunt Move ifdef to the right place. RS=Enrica * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::initializeSandbox): 2014-06-02 Gavin Barraclough Set default voucher for XPC client processes https://bugs.webkit.org/show_bug.cgi?id=133458 Reviewed by Geoff Garen. * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h: (WebKit::XPCServiceInitializer): - add voucher_replace_default_voucher. * config.h: - add HAVE_VOUCHERS. 2014-06-02 Jeremy Jones Send external playback properties to fullscreen. https://bugs.webkit.org/show_bug.cgi?id=133366 Reviewed by Simon Fraser. Forward setExternalPlayback. * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: add setExternalPlaybackProperties * WebProcess/ios/WebVideoFullscreenManager.h: add setExternalPlaybackProperties * WebProcess/ios/WebVideoFullscreenManager.mm: add setExternalPlaybackProperties (WebKit::WebVideoFullscreenManager::setExternalPlaybackProperties): added 2014-06-02 Enrica Casucci Remove unintentional changes to WKContentViewInteraction.mm introduced in r169500. Unreviewed. * UIProcess/ios/WKContentViewInteraction.mm: (+[WKAutocorrectionContext autocorrectionContextWithData:markedText:selectedText:afterText:selectedRangeInMarkedText:]): 2014-06-02 Geoffrey Garen Address some review comments on bug 133408 https://bugs.webkit.org/show_bug.cgi?id=133410 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKBackForwardListItem.h: * UIProcess/API/Cocoa/WKUIDelegate.h: 2014-06-02 Dan Bernstein [Cocoa] -[WKWebView activeURL] is unused https://bugs.webkit.org/show_bug.cgi?id=133440 Reviewed by Mark Rowe. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView activeURL]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: Removed the property declaration. 2014-05-31 Oliver Hunt Restructure initial distinct sandbox profiles https://bugs.webkit.org/show_bug.cgi?id=133415 Reviewed by Alexey Proskuryakov. Add support for manually instantiating the network and content process sandboxes, and add initial profiles. These profiles are completely generic so we can make sure nothing is broken by enabling them. This also adds a target to the WebKit2 project to correctly process the profiles. * DatabaseProcess/ios/DatabaseProcessIOS.mm: (WebKit::DatabaseProcess::initializeSandbox): * DatabaseProcess/ios/com.apple.WebKit.DatabasesIOS.sb: Removed. * NetworkProcess/ios/NetworkProcessIOS.mm: (WebKit::NetworkProcess::initializeSandbox): * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb: Added. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Added. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Added. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::initializeSandbox): 2014-06-01 Sam Weinig [Cocoa] Add SPI to get a WebArchive of the WKWebView https://bugs.webkit.org/show_bug.cgi?id=133439 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _getWebArchiveDataWithCompletionHandler:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2014-05-31 Anders Carlsson Add a LazyNeverDestroyed class template and use it https://bugs.webkit.org/show_bug.cgi?id=133425 Reviewed by Darin Adler. * Shared/mac/SecItemShim.cpp: (WebKit::responseMap): 2014-05-31 Timothy Horton View snapshots are sometimes taken at the wrong scale https://bugs.webkit.org/show_bug.cgi?id=133419 Reviewed by Sam Weinig. * UIProcess/API/mac/WKView.mm: (-[WKView _takeViewSnapshot]): Work around by re-requesting the snapshot at kCGWindowImageNominalResolution if it was captured at the wrong scale. 2014-05-31 Dan Bernstein [iOS] WebKit2.framework is unused https://bugs.webkit.org/show_bug.cgi?id=133424 Reviewed by Anders Carlsson. * Configurations/WebKit2.xcconfig: Set SKIP_INSTALL to YES when targeting iOS. 2014-05-30 Benjamin Poulain [iOS][WK2] When a page does not finish rotation before the end of the animation, synchronize explicitely https://bugs.webkit.org/show_bug.cgi?id=133364 Reviewed by Sam Weinig. When a page that does layout on rotation does not respond before the end of the animation, we end up with a completely inconsistent state on the UIProcess (because it is unware of the new states). The perfect way to fix this would be to make animated resize transactional and have the WebProcess resolve conflicts. That is very complicated and the issue is uncommon, so this patch does not do that. This patch force the synchronization whenever we finish the animation before we heard back from the WebProcess. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _endAnimatedResize]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::resetState): * UIProcess/WebPageProxy.h: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::dynamicViewportSizeUpdate): (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate): (WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): (WebKit::WebPage::synchronizeDynamicViewportUpdate): 2014-05-30 Enrica Casucci REGRESSION (WebKit2): space space to insert period doesn't work in web forms. https://bugs.webkit.org/show_bug.cgi?id=133413 Reviewed by Benjamin Poulain. iOS TextInput needs to know about content surrounding the current position while editing. Since we don't want to query this information synchronously when asked, we cache it as part of the EditorState. EditorState now contains a vector of three characters representing the content after, before and two position before the caret position. The patch also replaces all calls to plainText with plainTextReplacingNoBreakSpace to work well with iOS text input. * Shared/EditorState.cpp: (WebKit::EditorState::encode): (WebKit::EditorState::decode): * Shared/EditorState.h: (WebKit::EditorState::EditorState): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _characterInRelationToCaretSelection:]): (+[WKAutocorrectionContext autocorrectionContextWithData:markedText:selectedText:afterText:selectedRangeInMarkedText:]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::editorState): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::requestDictationContext): (WebKit::WebPage::replaceSelectedText): (WebKit::WebPage::replaceDictatedText): (WebKit::WebPage::requestAutocorrectionData): (WebKit::WebPage::syncApplyAutocorrection): (WebKit::computeAutocorrectionContext): 2014-05-30 Geoffrey Garen Fixed the build by adding back a declaration I deleted by accident :(. Unreviewed. * UIProcess/API/Cocoa/WKWebView.h: 2014-05-30 Geoffrey Garen Unreviewed, rolling in r169490. I changed a non-ASCII apostrophe to ASCII. Restored changeset: "Some more copy-editing of the Modern WebKit headerdoc" https://bugs.webkit.org/show_bug.cgi?id=133408 http://trac.webkit.org/changeset/169490 * UIProcess/API/Cocoa/WKBackForwardList.h: * UIProcess/API/Cocoa/WKBackForwardListItem.h: * UIProcess/API/Cocoa/WKFrameInfo.h: * UIProcess/API/Cocoa/WKNavigation.h: * UIProcess/API/Cocoa/WKNavigationAction.h: (NS_ENUM): * UIProcess/API/Cocoa/WKNavigationDelegate.h: (NS_ENUM): * UIProcess/API/Cocoa/WKNavigationResponse.h: * UIProcess/API/Cocoa/WKPreferences.h: * UIProcess/API/Cocoa/WKProcessPool.h: * UIProcess/API/Cocoa/WKScriptMessage.h: * UIProcess/API/Cocoa/WKScriptMessageHandler.h: * UIProcess/API/Cocoa/WKUIDelegate.h: * UIProcess/API/Cocoa/WKUserContentController.h: * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.h: 2014-05-30 Geoffrey Garen Unreviewed, rolling out r169490. It broke the build with a mysterious warning about ASCII. Reverted changeset: "Some more copy-editing of the Modern WebKit headerdoc" https://bugs.webkit.org/show_bug.cgi?id=133408 http://trac.webkit.org/changeset/169490 2014-05-30 Geoffrey Garen Some more copy-editing of the Modern WebKit headerdoc https://bugs.webkit.org/show_bug.cgi?id=133408 Reviewed by Beth Dakin. A copy-editor suggested some edits to the headerdoc for clarity, style, and formatting. I reviewed the edits and accepted about 80% of them. * UIProcess/API/Cocoa/WKBackForwardList.h: * UIProcess/API/Cocoa/WKBackForwardListItem.h: * UIProcess/API/Cocoa/WKFrameInfo.h: * UIProcess/API/Cocoa/WKNavigation.h: * UIProcess/API/Cocoa/WKNavigationAction.h: (NS_ENUM): * UIProcess/API/Cocoa/WKNavigationDelegate.h: (NS_ENUM): * UIProcess/API/Cocoa/WKNavigationResponse.h: * UIProcess/API/Cocoa/WKPreferences.h: * UIProcess/API/Cocoa/WKProcessPool.h: * UIProcess/API/Cocoa/WKScriptMessage.h: * UIProcess/API/Cocoa/WKScriptMessageHandler.h: * UIProcess/API/Cocoa/WKUIDelegate.h: * UIProcess/API/Cocoa/WKUserContentController.h: * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.h: 2014-05-30 Timothy Horton Crash loading skydrive.com (assertion under RemoteLayerTreeDisplayRefreshMonitor) https://bugs.webkit.org/show_bug.cgi?id=133370 Reviewed by Darin Adler. * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea): (WebKit::RemoteLayerTreeDrawingArea::willDestroyDisplayRefreshMonitor): (WebKit::RemoteLayerTreeDrawingArea::didUpdate): Post-landing review comments from Darin noted that checking if the DrawingArea's m_displayRefreshMonitors contains the monitor in the list to notify is insufficient, because a new one could have been added with the same address. Instead, copy the HashSet, removing at random from it and firing didUpdateLayers, but *also* removing from it in the willDestroyDisplayRefreshMonitor callback. This is very similar to what DisplayRefreshMonitor itself does internally (we don't have to duplicate its code to avoid re-entry because it is already impossible to re-enter didUpdate). 2014-05-29 Anders Carlsson -[WKProcessPoolConfiguration setCachePartitionedURLSchemes:] should do a deep copy https://bugs.webkit.org/show_bug.cgi?id=133393 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration setCachePartitionedURLSchemes:]): 2014-05-29 Mark Lam Restoring FloatingPointEnvironment initialization that was accidentally rolled out by r169176. Rubber stamped by Oliver Hunt. * Shared/ios/ChildProcessIOS.mm: (WebKit::ChildProcess::platformInitialize): 2014-05-29 Enrica Casucci Need to notify the keyboard about every KeyDown event. https://bugs.webkit.org/show_bug.cgi?id=133383 Reviewed by Benjamin Poulain. A key down will generate most of the time a call to the keyboard to add input or delete. But the event could be handled by JavaScript and its default prevented. We need to notify the keyboard in every case to allow updating its internal state about what has been typed. * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::doneWithKeyEvent): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _didHandleKeyEvent:]): 2014-05-29 Matthew Hanson Roll out r169439. 2014-05-28 Gavin Barraclough viewStateDidChange should always fully update ViewState https://bugs.webkit.org/show_bug.cgi?id=133159 Reviewed by Anders Carlson. Currently WebPageProxy::viewStateDidChange is passed a mask of bits to update. This has the following negative consequences: – WKWebView implicitly requires more detailed knowledge of the internal implementation of the PageClient. – Updates may unnecessarily be split over multiple IPC messages. – In order to support partial updates we make multiple virtual function calls to PageClient, which then makes duplicate objc calls. Better to just always update the entire ViewState. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView didMoveToWindow]): - removed argument to viewStateDidChange. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::viewState): (WebKit::PageClientImpl::isViewWindowActive): Deleted. (WebKit::PageClientImpl::isViewFocused): Deleted. (WebKit::PageClientImpl::isViewVisible): Deleted. (WebKit::PageClientImpl::isViewInWindow): Deleted. * UIProcess/API/gtk/PageClientImpl.h: - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState. * UIProcess/API/mac/WKView.mm: (-[WKView becomeFirstResponder]): (-[WKView resignFirstResponder]): (-[WKView viewDidMoveToWindow]): (-[WKView _windowDidBecomeKey:]): (-[WKView _windowDidResignKey:]): (-[WKView _windowDidMiniaturize:]): (-[WKView _windowDidDeminiaturize:]): (-[WKView _windowDidOrderOffScreen:]): (-[WKView _windowDidOrderOnScreen:]): (-[WKView _windowDidChangeOcclusionState:]): (-[WKView viewDidHide]): (-[WKView viewDidUnhide]): (-[WKView _activeSpaceDidChange:]): (-[WKView _setThumbnailView:]): (-[WKView endDeferringViewInWindowChanges]): (-[WKView endDeferringViewInWindowChangesSync]): - removed argument to viewStateDidChange. * UIProcess/CoordinatedGraphics/WebView.cpp: (WebKit::WebView::viewState): (WebKit::WebView::isViewWindowActive): Deleted. (WebKit::WebView::isViewFocused): Deleted. (WebKit::WebView::isViewVisible): Deleted. (WebKit::WebView::isViewInWindow): Deleted. * UIProcess/CoordinatedGraphics/WebView.h: - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState. * UIProcess/PageClient.h: (WebKit::PageClient::isViewVisibleOrOccluded): Deleted. (WebKit::PageClient::isVisuallyIdle): Deleted. - merged isViewVisibleOrOccluded/isVisuallyIdle to subclass viewState methods. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::reattachToWebProcess): - updateViewState -> PageClient::viewState (WebKit::WebPageProxy::viewStateDidChange): - argument removed; updateViewState -> PageClient::viewState. (WebKit::WebPageProxy::setCursor): - call isViewWindowActive on WebPageProxy, rather than PageClient. (WebKit::WebPageProxy::updateBackingStoreDiscardableState): - call isViewWindowActive on WebPageProxy, rather than PageClient. (WebKit::WebPageProxy::updateViewState): Deleted. - removed - viewState method moved to PageClient. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::isViewWindowActive): - added missing implementation. (WebKit::WebPageProxy::isViewVisible): - removed argument to viewStateDidChange. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::windowServerConnectionStateChanged): - removed argument to viewStateDidChange. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::viewState): (WebKit::PageClientImpl::isViewWindowActive): Deleted. (WebKit::PageClientImpl::isViewFocused): Deleted. (WebKit::PageClientImpl::isViewVisible): Deleted. (WebKit::PageClientImpl::isViewInWindow): Deleted. (WebKit::PageClientImpl::isViewVisibleOrOccluded): Deleted. (WebKit::PageClientImpl::isVisuallyIdle): Deleted. - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState. * UIProcess/ios/WKContentView.mm: (-[WKContentView didMoveToWindow]): (-[WKContentView _applicationDidEnterBackground:]): (-[WKContentView _applicationWillEnterForeground:]): - removed argument to viewStateDidChange. * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::viewState): (WebKit::PageClientImpl::showCorrectionPanel): (WebKit::PageClientImpl::showDictationAlternativeUI): (WebKit::PageClientImpl::isViewWindowActive): Deleted. (WebKit::PageClientImpl::isViewFocused): Deleted. (WebKit::PageClientImpl::isViewVisibleOrOccluded): Deleted. (WebKit::PageClientImpl::isVisuallyIdle): Deleted. - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState. 2014-05-29 Dan Bernstein [Cocoa] Can’t recover from subframe load errors https://bugs.webkit.org/show_bug.cgi?id=133385 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new delegate method. * UIProcess/Cocoa/NavigationState.h: Added flag in m_navigationDelegateMethods struct. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): Initialize webViewNavigationDidFailProvisionalLoadInSubframeWithError flag in the delegate methods struct. (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame): If the error occurred in a subframe, invoke the new delegate method. 2014-05-29 Geoffrey Garen Added a missing @result to WKPreferences headerdoc https://bugs.webkit.org/show_bug.cgi?id=133381 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKPreferences.h: 2014-05-29 Alexey Proskuryakov [Mac] Always use plug-in sandbox with sandboxed clients https://bugs.webkit.org/show_bug.cgi?id=133358 Reviewed by Anders Carlsson. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::initializeSandbox): Refuse to start if parent process is sandboxed, and plug-in process is not going to be. None of this should run in normal case, because there are also checks on UI process side. * Shared/Plugins/PluginModuleInfo.h: * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm: (WebKit::NetscapePluginModule::getPluginInfo): Added a member to PluginModuleInfo, telling whether the plug-in has a sandbox profile. * Shared/Plugins/Netscape/mac/PluginInformationMac.mm: (WebKit::getPlatformPluginModuleInformation): Use the new PluginModuleInfo member, we no longer need to check the file system here. * WebKit2.xcodeproj/project.pbxproj: * Shared/mac/SandboxUtilities.h: Added. * Shared/mac/SandboxUtilities.cpp: Added. (WebKit::processIsSandboxed): This code is simple, but include magic is not. Moved it to a separate file to avoid repeating. * UIProcess/API/C/mac/WKContextPrivateMac.mm: Removed an unused include. * UIProcess/Plugins/mac/PluginInfoStoreMac.mm: (WebKit::PluginInfoStore::shouldUsePlugin): Don't use unsandboxed plug-ins in sandboxed applications. * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: (WebKit::PluginProcessProxy::platformGetLaunchOptions): Don't ever pass disable-sandbox from sandboxed processes. * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm: (WebKit::XPCServiceInitializerDelegate::isClientSandboxed): Use the new shared code in SandboxUtilities.h. 2014-05-29 Timothy Horton Crash loading skydrive.com (assertion under RemoteLayerTreeDisplayRefreshMonitor) https://bugs.webkit.org/show_bug.cgi?id=133370 Reviewed by Anders Carlsson. * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::didUpdate): Copy the set of refresh monitors so that we don't try to mutate the list we're iterating, and don't try to fire refresh monitors that were removed in a previous iteration of the loop. 2014-05-29 Timothy Horton REGRESSION (iOS WebKit2): Find-in-Page doesn't work in subframes https://bugs.webkit.org/show_bug.cgi?id=133372 Reviewed by Simon Fraser. * WebProcess/WebPage/ios/FindControllerIOS.mm: (WebKit::FindController::willFindString): (WebKit::FindController::didFailToFindString): (WebKit::FindController::didHideFindIndicator): Flip ignoreCompositionSelectionChange and updateAppearanceEnabled on all frames, not just the main frame, because the found string can be in a subframe. Ideally we would flip it on/off for each frame as we move the selection between them, but would require a lot of work (and the overhead of touching each frame shouldn't be significant). 2014-05-29 Dan Bernstein WKBundleActivateMacFontAscentHack is unused https://bugs.webkit.org/show_bug.cgi?id=133379 Reviewed by Anders Carlsson. * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleActivateMacFontAscentHack): Deleted. * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: * WebProcess/InjectedBundle/InjectedBundle.h: * WebProcess/InjectedBundle/efl/InjectedBundleEfl.cpp: (WebKit::InjectedBundle::activateMacFontAscentHack): Deleted. * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp: (WebKit::InjectedBundle::activateMacFontAscentHack): Deleted. * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm: (WebKit::InjectedBundle::activateMacFontAscentHack): Deleted. 2014-05-29 Alexey Proskuryakov Add a sandbox profile for com.apple.appstore.CodeRedeemerNetscapePlugin https://bugs.webkit.org/show_bug.cgi?id=133360 Reviewed by Sam Weinig. * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb: Looks like anyone using camera would need access to CoreMedia preferences. * Resources/PlugInSandboxProfiles/com.apple.appstore.CodeRedeemerNetscapePlugin.sb: Added. * WebKit2.xcodeproj/project.pbxproj: Added the profile. 2014-05-29 Carlos Garcia Campos [GTK] Add support for HiDPI icons https://bugs.webkit.org/show_bug.cgi?id=133377 Reviewed by Martin Robinson. * PlatformGTK.cmake: Compile also the @2x versions for the builtin icons. 2014-05-29 Owen Taylor [GTK] Add HighDPI support for non-accelerated compositing contents https://bugs.webkit.org/show_bug.cgi?id=131562 Reviewed by Anders Carlsson. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (deviceScaleFactorChanged): Added this callback to pass scale changes to the page proxy. (webkitWebViewBaseCreateWebPage): Attach the callback to the notify signal. * UIProcess/WebPageProxy.cpp: * UIProcess/cairo/BackingStoreCairo.cpp: (WebKit::WebPageProxy::setCustomDeviceScaleFactor): Do not set a custom device scale factor for cairo when it's not supported. (WebKit::createBackingStoreForGTK): Pass the scale factor to the WebCore backing store. (WebKit::BackingStore::incorporateUpdate): Ditto. 2014-05-28 Carlos Garcia Campos [GTK] Use GMainLoopSource for idle and timeout sources in WebKit2 https://bugs.webkit.org/show_bug.cgi?id=130081 Reviewed by Martin Robinson. * Platform/WorkQueue.h: * Platform/gtk/WorkQueueGtk.cpp: (WorkQueue::registerSocketEventHandler): Stop pretending it's possible to register a socket event handler for more than one descriptor. (WorkQueue::unregisterSocketEventHandler): (WorkQueue::dispatch): (WorkQueue::dispatchAfter): * Shared/Downloads/soup/DownloadSoup.cpp: (WebKit::DownloadClient::DownloadClient): (WebKit::DownloadClient::~DownloadClient): (WebKit::DownloadClient::didReceiveData): (WebKit::DownloadClient::handleResponse): (WebKit::DownloadClient::handleResponseLater): * UIProcess/Plugins/gtk/PluginInfoCache.cpp: (WebKit::PluginInfoCache::PluginInfoCache): (WebKit::PluginInfoCache::~PluginInfoCache): (WebKit::PluginInfoCache::saveToFile): (WebKit::PluginInfoCache::updatePluginInfo): * UIProcess/Plugins/gtk/PluginInfoCache.h: * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: (WebKit::LayerTreeHostGtk::LayerTreeHostGtk): (WebKit::LayerTreeHostGtk::layerFlushTimerFired): (WebKit::LayerTreeHostGtk::scheduleLayerFlush): (WebKit::LayerTreeHostGtk::cancelPendingLayerFlush): * WebProcess/WebPage/gtk/LayerTreeHostGtk.h: 2014-05-28 Gavin Barraclough viewStateDidChange should always fully update ViewState https://bugs.webkit.org/show_bug.cgi?id=133159 Reviewed by Anders Carlson. Currently WebPageProxy::viewStateDidChange is passed a mask of bits to update. This has the following negative consequences: – WKWebView implicitly requires more detailed knowledge of the internal implementation of the PageClient. – Updates may unnecessarily be split over multiple IPC messages. – In order to support partial updates we make multiple virtual function calls to PageClient, which then makes duplicate objc calls. Better to just always update the entire ViewState. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView didMoveToWindow]): - removed argument to viewStateDidChange. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::viewState): (WebKit::PageClientImpl::isViewWindowActive): Deleted. (WebKit::PageClientImpl::isViewFocused): Deleted. (WebKit::PageClientImpl::isViewVisible): Deleted. (WebKit::PageClientImpl::isViewInWindow): Deleted. * UIProcess/API/gtk/PageClientImpl.h: - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState. * UIProcess/API/mac/WKView.mm: (-[WKView becomeFirstResponder]): (-[WKView resignFirstResponder]): (-[WKView viewDidMoveToWindow]): (-[WKView _windowDidBecomeKey:]): (-[WKView _windowDidResignKey:]): (-[WKView _windowDidMiniaturize:]): (-[WKView _windowDidDeminiaturize:]): (-[WKView _windowDidOrderOffScreen:]): (-[WKView _windowDidOrderOnScreen:]): (-[WKView _windowDidChangeOcclusionState:]): (-[WKView viewDidHide]): (-[WKView viewDidUnhide]): (-[WKView _activeSpaceDidChange:]): (-[WKView _setThumbnailView:]): (-[WKView endDeferringViewInWindowChanges]): (-[WKView endDeferringViewInWindowChangesSync]): - removed argument to viewStateDidChange. * UIProcess/CoordinatedGraphics/WebView.cpp: (WebKit::WebView::viewState): (WebKit::WebView::isViewWindowActive): Deleted. (WebKit::WebView::isViewFocused): Deleted. (WebKit::WebView::isViewVisible): Deleted. (WebKit::WebView::isViewInWindow): Deleted. * UIProcess/CoordinatedGraphics/WebView.h: - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState. * UIProcess/PageClient.h: (WebKit::PageClient::isViewVisibleOrOccluded): Deleted. (WebKit::PageClient::isVisuallyIdle): Deleted. - merged isViewVisibleOrOccluded/isVisuallyIdle to subclass viewState methods. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::reattachToWebProcess): - updateViewState -> PageClient::viewState (WebKit::WebPageProxy::viewStateDidChange): - argument removed; updateViewState -> PageClient::viewState. (WebKit::WebPageProxy::setCursor): - call isViewWindowActive on WebPageProxy, rather than PageClient. (WebKit::WebPageProxy::updateBackingStoreDiscardableState): - call isViewWindowActive on WebPageProxy, rather than PageClient. (WebKit::WebPageProxy::updateViewState): Deleted. - removed - viewState method moved to PageClient. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::isViewWindowActive): - added missing implementation. (WebKit::WebPageProxy::isViewVisible): - removed argument to viewStateDidChange. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::windowServerConnectionStateChanged): - removed argument to viewStateDidChange. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::viewState): (WebKit::PageClientImpl::isViewWindowActive): Deleted. (WebKit::PageClientImpl::isViewFocused): Deleted. (WebKit::PageClientImpl::isViewVisible): Deleted. (WebKit::PageClientImpl::isViewInWindow): Deleted. (WebKit::PageClientImpl::isViewVisibleOrOccluded): Deleted. (WebKit::PageClientImpl::isVisuallyIdle): Deleted. - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState. * UIProcess/ios/WKContentView.mm: (-[WKContentView didMoveToWindow]): (-[WKContentView _applicationDidEnterBackground:]): (-[WKContentView _applicationWillEnterForeground:]): - removed argument to viewStateDidChange. * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::viewState): (WebKit::PageClientImpl::showCorrectionPanel): (WebKit::PageClientImpl::showDictationAlternativeUI): (WebKit::PageClientImpl::isViewWindowActive): Deleted. (WebKit::PageClientImpl::isViewFocused): Deleted. (WebKit::PageClientImpl::isViewVisibleOrOccluded): Deleted. (WebKit::PageClientImpl::isVisuallyIdle): Deleted. - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState. 2014-05-28 Jeffrey Pfau Add Obj-C API for cache partitioned URL schemes https://bugs.webkit.org/show_bug.cgi?id=133361 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _initWithConfiguration:]): * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration cachePartitionedURLSchemes]): (-[_WKProcessPoolConfiguration setCachePartitionedURLSchemes:]): (-[_WKProcessPoolConfiguration copyWithZone:]): 2014-05-28 Sam Weinig [iOS WebKit2] Sometimes Safari gets into a limbo state after web process crash https://bugs.webkit.org/show_bug.cgi?id=133362 Reviewed by Dan Bernstein. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): Remove unnecessary initialization of a unique_ptr. (WebKit::WebPageProxy::reattachToWebProcess): Move calls to update the view state and activity tokens to after we have swapped in the new process. (WebKit::WebPageProxy::resetStateAfterProcessExited): Clear the activity token on process exit. 2014-05-28 Timothy Horton Add WKWebView SPI to forcefully kill the associated Web process https://bugs.webkit.org/show_bug.cgi?id=133357 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _killWebContentProcess]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2014-05-28 Dan Bernstein [Cocoa] Crash when trying to decode an instance of a class inheriting from WKObject https://bugs.webkit.org/show_bug.cgi?id=133355 Reviewed by Anders Carlsson. * Shared/Cocoa/WKObject.mm: (-[WKObject classForCoder]): Override this NSObject method to forward to the target object. (-[WKObject classForKeyedArchiver]): Ditto. 2014-05-28 Simon Fraser [iOS WK2] Improve behavior of position:fixed inside accelerated overflow-scroll https://bugs.webkit.org/show_bug.cgi?id=133352 Reviewed by Tim Horton. Pass the correct delta down to descendant nodes. * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll): 2014-05-28 Andy Estes [iOS] REGRESSION (r168388): DidNotHandleTapAsClick not sent when commitPotentialTap() fails https://bugs.webkit.org/show_bug.cgi?id=133349 Reviewed by Benjamin Poulain. WebPage::commitPotentialTap() fails when a recognized single tap cannot be sent as a synthetic click event. We should send WebPageProxy::DidNotHandleTapAsClick in these cases. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::commitPotentialTap): (WebKit::WebPage::commitPotentialTapFailed): 2014-05-28 Commit Queue Unreviewed, rolling out r169423. https://bugs.webkit.org/show_bug.cgi?id=133348 It makes a lot of tests crash in assert (Requested by KaL on #webkit). Reverted changeset: "[GTK] Use GMainLoopSource for idle and timeout sources in WebKit2" https://bugs.webkit.org/show_bug.cgi?id=130081 http://trac.webkit.org/changeset/169423 2014-05-28 Carlos Garcia Campos [GTK] Use GMainLoopSource for idle and timeout sources in WebKit2 https://bugs.webkit.org/show_bug.cgi?id=130081 Reviewed by Martin Robinson. * Platform/WorkQueue.h: * Platform/gtk/WorkQueueGtk.cpp: (WorkQueue::registerSocketEventHandler): Stop pretending it's possible to register a socket event handler for more than one descriptor. (WorkQueue::unregisterSocketEventHandler): (WorkQueue::dispatch): (WorkQueue::dispatchAfter): * Shared/Downloads/soup/DownloadSoup.cpp: (WebKit::DownloadClient::DownloadClient): (WebKit::DownloadClient::~DownloadClient): (WebKit::DownloadClient::didReceiveData): (WebKit::DownloadClient::handleResponse): (WebKit::DownloadClient::handleResponseLater): * UIProcess/Plugins/gtk/PluginInfoCache.cpp: (WebKit::PluginInfoCache::PluginInfoCache): (WebKit::PluginInfoCache::~PluginInfoCache): (WebKit::PluginInfoCache::saveToFile): (WebKit::PluginInfoCache::updatePluginInfo): * UIProcess/Plugins/gtk/PluginInfoCache.h: * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: (WebKit::LayerTreeHostGtk::LayerTreeHostGtk): (WebKit::LayerTreeHostGtk::layerFlushTimerFired): (WebKit::LayerTreeHostGtk::scheduleLayerFlush): (WebKit::LayerTreeHostGtk::cancelPendingLayerFlush): * WebProcess/WebPage/gtk/LayerTreeHostGtk.h: 2014-05-28 Dan Bernstein [Cocoa] Can't use bundle-defined classes for bundle parameters https://bugs.webkit.org/show_bug.cgi?id=133339 Reviewed by Anders Carlsson. Ensure that bundle parameters are decoded only after the injected bundle is loaded. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::create): Moved the definition from the header to here, added the lagacy initializationUserData as a parameter, and made this function set the sandbox extension and load the bundle. (WebKit::InjectedBundle::InjectedBundle): Removed call to platformInitialize. * WebProcess/InjectedBundle/InjectedBundle.h: (WebKit::InjectedBundle::setSandboxExtension): Deleted. * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm: (WebKit::InjectedBundle::initialize): Renamed the load function to this, and added the creation parameters as a parameter. Moved code to initialize the bundle paramters from platformInitialize to here. Changed the class passed to -decodeObjectOfClass:forKey: to NSObject, to allow arbitrary types in the values, and added an assertion that the top-level object is a dictionary. (WebKit::InjectedBundle::platformInitialize): Deleted. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): Changed to pass the legacy initialization user data to InjectedBundle::create() and removed code to separately set the sandbox extension and load the bundle, which is now done by create(). 2014-05-28 Alberto Garcia Unreviewed. Fix warning: unused parameter 'frame' * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didFinishDocumentLoad): 2014-05-27 Simon Fraser [iOS WK2] Fix behavior of position:sticky inside accelerated overflow-scroll https://bugs.webkit.org/show_bug.cgi?id=133334 Reviewed by Tim Horton. When the scroll position changes in an accelerated overflow-scroll element, we have to update child nodes in the scrolling tree for position:sticky. That requires a more generic ability to update the scrolling tree after some arbitrary zoom or scroll. To do this, we need to know the current fixed position rect, rather than having it passed in. So make the fixed position rect available from ScrollingTree, and make it possible to get the current scrollPosition() from any ScrollingTreeScrollingNode. Also, implement updateLayersAfterDelegatedScroll() in ScrollingTreeOverflowScrollingNodeIOS, and have it update descendant layers. Finally, fix ScrollingTreeOverflowScrollingNode to use the correct rectangle for its constraints math, using the scroll position of the parent node if appropriate. * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: * UIProcess/Scrolling/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::fixedPositionRect): * UIProcess/Scrolling/RemoteScrollingTree.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterDelegatedScroll): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll): * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect): 2014-05-27 Simon Fraser Do some renaming in the scrolling tree https://bugs.webkit.org/show_bug.cgi?id=133333 Reviewed by Tim Horton. Rename ScrollingTreeNode::parentScrollPositionDidChange() to updateLayersAfterAncestorChange() since this goes deep and to indicate that it's about layer updating. Also rename the "viewportRect" parameter to "fixedPositionRect", since on iOS this is the custom fixed-position rect that changes on zooming. * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling): * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterViewportChange): 2014-05-27 Geoffrey Garen Some proof-reading of the WebKit2 API headerdoc https://bugs.webkit.org/show_bug.cgi?id=133328 Reviewed by Anders Carlsson. Consistently say "item" to reference back-forward list items. Consistently say "webpage" instead of "page" or "web page". Consistently say "navigation" instead of "load". Plus a few fix-ups for run-on sentences, mismatched verb tense, and mismatched singular vs plural. * UIProcess/API/Cocoa/WKBackForwardList.h: * UIProcess/API/Cocoa/WKBackForwardListItem.h: * UIProcess/API/Cocoa/WKBrowsingContextController.h: * UIProcess/API/Cocoa/WKBrowsingContextGroup.h: * UIProcess/API/Cocoa/WKFrameInfo.h: * UIProcess/API/Cocoa/WKNavigation.h: * UIProcess/API/Cocoa/WKNavigationAction.h: * UIProcess/API/Cocoa/WKNavigationDelegate.h: * UIProcess/API/Cocoa/WKProcessPool.h: * UIProcess/API/Cocoa/WKUIDelegate.h: * UIProcess/API/Cocoa/WKWebView.h: 2014-05-27 Timothy Horton [wk2] PDFPlugin snapshots are misplaced https://bugs.webkit.org/show_bug.cgi?id=133323 Reviewed by Simon Fraser. * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::paintControlForLayerInContext): (WebKit::PDFPlugin::snapshot): Include the scroll offset in the snapshot translation, and use the whole document size instead of just the view size. 2014-05-27 Sam Weinig [WebKit2] Move WebPreferences macro definitions and key names into their own files https://bugs.webkit.org/show_bug.cgi?id=133315 Reviewed by Anders Carlsson. * CMakeLists.txt: * Shared/WebPreferencesDefinitions.h: Copied from Source/WebKit2/Shared/WebPreferencesStore.h. * Shared/WebPreferencesKeys.cpp: Copied from Source/WebKit2/Shared/WebPreferencesStore.cpp. * Shared/WebPreferencesKeys.h: Copied from Source/WebKit2/Shared/WebPreferencesStore.h. * Shared/WebPreferencesStore.cpp: * Shared/WebPreferencesStore.h: * UIProcess/WebPreferences.cpp: * UIProcess/WebPreferences.h: * UIProcess/mac/WebContextMac.mm: * UIProcess/mac/WebPreferencesMac.mm: * UIProcess/mac/WebProcessProxyMac.mm: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/WebCoreSupport/WebChromeClient.cpp: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebProcess.cpp: 2014-05-27 Gavin Barraclough Add UI process watchdog on iOS to ensure WebProcess connections close https://bugs.webkit.org/show_bug.cgi?id=133200 Mountain Lion build fix * Platform/IPC/mac/ConnectionMac.mm: (IPC::ConnectionTerminationWatchdog::watchdogTimerFired): 2014-05-27 Gavin Barraclough importance_assertion -> denap_assertion https://bugs.webkit.org/show_bug.cgi?id=133294 iOS build fix * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::open): 2014-05-27 Gavin Barraclough Add UI process watchdog on iOS to ensure WebProcess connections close https://bugs.webkit.org/show_bug.cgi?id=133200 Reviewed by Darin Adler. When the WebProcessProxy wants to disconnect from a WebContent process it just drops the connection, and hopes the connection closes. There is a watchdog thread in the ChildProcess to try to ensure this happens. On iOS the process may not be runnable at the time, preventing termination. Instead add a watchdog in the UI process to make the process runnable, and to terminate if it doesn't quit in a timely fashion. * Platform/IPC/Connection.h: - added terminateSoon. * Platform/IPC/mac/ConnectionMac.mm: (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog): - take an assertion to make the process runnable, and start a watchdog timer. (IPC::ConnectionTerminationWatchdog::watchdogTimerFired): - if the process hasn't quit by the timer the watchdog fires, kill it. (IPC::Connection::terminateSoon): - create a ConnectionTerminationWatchdog. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::removeWebPage): - when disconnecting from a process, first tell it to terminateSoon. 2014-05-26 Gavin Barraclough importance_assertion -> denap_assertion https://bugs.webkit.org/show_bug.cgi?id=133294 Reviewed by Sam Weinig. Update in accordance with API change. The importance assertion is used on Mavericks & newer to ensure the WebContent process wakes from AppNap. * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::open): - MACH_PORT_IMPORTANCE_RECEIVER -> MACH_PORT_DENAP_RECEIVER * Platform/IPC/mac/ImportanceAssertion.h: (IPC::ImportanceAssertion::ImportanceAssertion): (IPC::ImportanceAssertion::~ImportanceAssertion): - proc_importance_assertion -> proc_denap_assertion 2014-05-27 Jessie Berlin Revert r169362 since it broke the ML build. * Platform/IPC/Connection.h: * Platform/IPC/mac/ConnectionMac.mm: (IPC::ConnectionTerminationWatchdog::createConnectionTerminationWatchdog): Deleted. (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog): Deleted. (IPC::ConnectionTerminationWatchdog::watchdogTimerFired): Deleted. (IPC::Connection::terminateSoon): Deleted. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::removeWebPage): 2014-05-27 Jon Lee Update ENABLE(MEDIA_SOURCE) on Mac https://bugs.webkit.org/show_bug.cgi?id=133141 Reviewed by Darin Adler. * Configurations/FeatureDefines.xcconfig: 2014-05-27 Tibor Meszaros Remove BLOB guards https://bugs.webkit.org/show_bug.cgi?id=132863 Reviewed by Csaba Osztrogonác. * Configurations/FeatureDefines.xcconfig: * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: * NetworkProcess/FileAPI/NetworkBlobRegistry.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didClose): (WebKit::NetworkConnectionToWebProcess::blobSize): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkProcessPlatformStrategies.cpp: * NetworkProcess/NetworkProcessPlatformStrategies.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::NetworkResourceLoader): * WebProcess/FileAPI/BlobRegistryProxy.cpp: * WebProcess/FileAPI/BlobRegistryProxy.h: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: * WebProcess/WebCoreSupport/WebPlatformStrategies.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::canHandleRequest): 2014-05-26 Tim Horton [wk2] RemoteLayerBackingStore front buffers should be purgeable when unparented https://bugs.webkit.org/show_bug.cgi?id=133020 Reviewed by Simon Fraser. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::display): Let the context know whenever a RemoteLayerBackingStore is displayed, so that RemoteLayerBackingStoreCollection can (if needed) note that the backing store is active once again (because we only display parented backing store). (WebKit::RemoteLayerBackingStore::setBufferVolatility): Ensure that we never have live contexts attached to any buffers when marking them volatile, because checking isInUse() with live contexts is futile. * Shared/mac/RemoteLayerBackingStoreCollection.h: * Shared/mac/RemoteLayerBackingStoreCollection.mm: (WebKit::RemoteLayerBackingStoreCollection::RemoteLayerBackingStoreCollection): (WebKit::RemoteLayerBackingStoreCollection::willFlushLayers): (WebKit::RemoteLayerBackingStoreCollection::willCommitLayerTree): (WebKit::RemoteLayerBackingStoreCollection::didFlushLayers): (WebKit::RemoteLayerBackingStoreCollection::backingStoreWillBeDestroyed): (WebKit::RemoteLayerBackingStoreCollection::backingStoreWillBeDisplayed): (WebKit::RemoteLayerBackingStoreCollection::markBackingStoreVolatileImmediately): (WebKit::RemoteLayerBackingStoreCollection::markBackingStoreVolatile): (WebKit::RemoteLayerBackingStoreCollection::backingStoreBecameUnreachable): (WebKit::RemoteLayerBackingStoreCollection::volatilityTimerFired): (WebKit::RemoteLayerBackingStoreCollection::scheduleVolatilityTimer): (WebKit::RemoteLayerBackingStoreCollection::purgeabilityTimerFired): Deleted. (WebKit::RemoteLayerBackingStoreCollection::schedulePurgeabilityTimer): Deleted. Rename purgeable->volatile for accuracy. Keep track of two sets of backing store: those which are active/parented, and those which are not. Backing store is moved to the inactive set after building the transaction in which its owning layer is unparented. When backing store is unparented, try to mark it volatile immediately. Also, mark the backing store property as dirty on the owning layer so that when said layer is reparented, we encode the backing store in the commit that reparents it, as the UI process will throw away its reference to the backing store when the layer is unparented. Mark the front buffers of unparented layers as volatile, in addition to the others. * Shared/mac/RemoteLayerTreeTransaction.h: (WebKit::RemoteLayerTreeTransaction::layerIDsWithNewlyUnreachableBackingStore): * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::encode): (WebKit::RemoteLayerTreeTransaction::decode): (WebKit::RemoteLayerTreeTransaction::setLayerIDsWithNewlyUnreachableBackingStore): Include the list of layers (by ID) with backing store which just became unreachable in the transaction. * UIProcess/mac/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::updateLayerTree): Clear the contents of layers which now have unreachable backing store. Otherwise, the UI process would hold a 'use' on the IOSurface, and prevent the Web process from marking it volatile. * WebProcess/WebPage/mac/RemoteLayerTreeContext.h: * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm: (WebKit::RemoteLayerTreeContext::backingStoreWillBeDisplayed): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::flushLayers): Give RemoteLayerBackingStoreCollection a shot at the RemoteLayerTreeTransaction, so that it can fill in layerIDsWithNewlyUnreachableBackingStore. Also, let it know when the flush begins and ends, so that it can keep track of which layers were reached in the flush. 2014-05-26 Shivakumar JM [EFL][WK2] Fix EWK2BackForwardListTest test fails. https://bugs.webkit.org/show_bug.cgi?id=133171 Reviewed by Gyuyoung Kim. Use local test html pages instead of EWK2UnitTestServer, call ewk_view_url_set() to load test html pages. Since even after setting no_proxy="localhost,127.0.0.1", still test server was unable to load the test html pages for ewk2_back_forward_list tests, so changed to use local html pages. * UIProcess/API/efl/tests/test_ewk2_back_forward_list.cpp: (TEST_F): 2014-05-26 Shivakumar JM [EFL][WK2] Fix code style check errors in EFL API tests. https://bugs.webkit.org/show_bug.cgi?id=133170 Reviewed by Gyuyoung Kim. Omit int when using unsigned modifier, as per coding style rules. * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp: (EWK2UnitTest::EWK2UnitTestBase::SetUp): * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.h: (EWK2UnitTest::EWK2UnitTestEnvironment::defaultWidth): (EWK2UnitTest::EWK2UnitTestEnvironment::defaultHeight): 2014-05-22 Gavin Barraclough Add UI process watchdog on iOS to ensure WebProcess connections close https://bugs.webkit.org/show_bug.cgi?id=133200 Reviewed by Darin Adler. When the WebProcessProxy wants to disconnect from a WebContent process it just drops the connection, and hopes the connection closes. There is a watchdog thread in the ChildProcess to try to ensure this happens. On iOS the process may not be runnable at the time, preventing termination. Instead add a watchdog in the UI process to make the process runnable, and to terminate if it doesn't quit in a timely fashion. * Platform/IPC/Connection.h: - added terminateSoon. * Platform/IPC/mac/ConnectionMac.mm: (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog): - take an assertion to make the process runnable, and start a watchdog timer. (IPC::ConnectionTerminationWatchdog::watchdogTimerFired): - if the process hasn't quit by the timer the watchdog fires, kill it. (IPC::Connection::terminateSoon): - create a ConnectionTerminationWatchdog. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::removeWebPage): - when disconnecting from a process, first tell it to terminateSoon. 2014-05-26 Sam Weinig [WebKit2] Add better default preferences while keeping backward compatibility for the C-SPI https://bugs.webkit.org/show_bug.cgi?id=133289 Reviewed by Anders Carlsson. * Shared/WebPreferencesStore.h: Change a few defaults: - PluginsEnabled -> false - JavaEnabled -> false - JavaEnabledForLocalFiles -> false - StorageBlockingPolicy -> BlockThirdPartyStorage * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesCreate): (WKPreferencesCreateWithIdentifier): * UIProcess/WebPageGroup.cpp: (WebKit::WebPageGroup::WebPageGroup): Switch to using WebPreferences::createWithLegacyDefaults(). * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::create): (WebKit::WebPreferences::createWithLegacyDefaults): * UIProcess/WebPreferences.h: Move create functions to the cpp file and add createWithLegacyDefaults() which keeps the old defaults; * UIProcess/API/C/WKPreferencesRef.h: Fix the comment. * UIProcess/API/Cocoa/WKPreferences.h: Update the comment to reflect the new defaults. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Unconditionally set setShouldDispatchJavaScriptWindowOnErrorEvents() to true. This setting only exists for legacy WebKit. 2014-05-26 Dan Bernstein [Cocoa] Rewrite WK_DESIGNATED_INITIALIZER in installed headers https://bugs.webkit.org/show_bug.cgi?id=133290 Reviewed by Anders Carlsson. * Shared/API/Cocoa/WKFoundation.h: When WK_API_AVAILABILITY_ENABLED is defined, don’t provide definitions of WK_DESIGNATED_INITIALIZER and WK_UNAVAILABLE, since those macros will be rewritten out of the headers. When WK_API_AVAILABILITY_ENABLED isn’t defined, provide definitions of the other two macros as appropriate for the target OS. * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: Removed WK_DESIGNATED_INITIALIZER from a category method declaration. * UIProcess/API/Cocoa/WKWebView.h: Mark the superclass designated initializer -initWithCoder: as unavailable. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithCoder:]): Override this designated initializer of the superclass by returning nil. * mac/rewrite-availability-macros.sh: Rewrite WK_DESIGNATED_INITIALIZER to NS_DESIGNATED_INITIALIZER and WK_UNAVAILABLE to NS_UNAVAILABLE. Also make sure to process all headers if the script has changed since the last time it was run. 2014-05-26 Commit Queue Unreviewed, rolling out r169122. https://bugs.webkit.org/show_bug.cgi?id=133288 Broke CJK font fallback (Requested by ap on #webkit). Reverted changeset: "[Mac] WebProcess doesn't follow localization of UI process when run as a service" https://bugs.webkit.org/show_bug.cgi?id=133126 http://trac.webkit.org/changeset/169122 2014-05-26 Anders Carlsson Convert a couple of loops over to range-based for https://bugs.webkit.org/show_bug.cgi?id=133287 Reviewed by Simon Fraser. * UIProcess/Plugins/PluginInfoStore.cpp: (WebKit::PluginInfoStore::findPluginForMIMEType): (WebKit::PluginInfoStore::findPluginForExtension): (WebKit::PluginInfoStore::infoForPluginWithPath): * UIProcess/Plugins/mac/PluginProcessManagerMac.mm: (WebKit::PluginProcessManager::setProcessSuppressionEnabled): 2014-05-26 Carlos Garcia Campos [GTK] WebProcess leaked when closing pages with network process enabled https://bugs.webkit.org/show_bug.cgi?id=129684 Reviewed by Anders Carlsson. The problem is that the web process is not notified when the UI process closes the connection, because when close() is called on the socket by the UI process, the socket is shared by another web process launched later, preventing the connection from being shut down. We need to set the CLOEXEC flag on the sockets file descriptor to make sure they are not exposed to other processes. * Platform/IPC/Connection.h: Add ConnectionOptions parameter to createPlatformConnection() with a default value compatible with existing callers. * Platform/IPC/unix/ConnectionUnix.cpp: (IPC::Connection::createPlatformConnection): Set the CLOEXEC flag on the client and server socket file descriptors depending on the options passed. * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp: (WebKit::ProcessLauncher::launchProcess): Use IPC::Connection::createPlatformConnection() instead of socketpair() directly, setting the CLOEXEC flag on the server before spawning the new process and on the client right after spawning the new process. 2014-05-25 Anders Carlsson Initialize WKWebViewConfiguration ivars lazily https://bugs.webkit.org/show_bug.cgi?id=133270 Reviewed by Sam Weinig. Create a LazyInitialized class template and use it to lazily initialize WKWebViewConfiguration properties. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (LazyInitialized::get): Initialize m_value with the given function if it hasn't been initialized already. (LazyInitialized::set): Update m_value and set m_isInitialized to true. (LazyInitialized::peek): Return m_value without initializing it. (-[WKWebViewConfiguration description]): Use getters so we'll initialize variables if needed. (-[WKWebViewConfiguration copyWithZone:]): Ditto. (-[WKWebViewConfiguration processPool]): (-[WKWebViewConfiguration setProcessPool:]): (-[WKWebViewConfiguration preferences]): (-[WKWebViewConfiguration setPreferences:]): (-[WKWebViewConfiguration userContentController]): (-[WKWebViewConfiguration setUserContentController:]): (-[WKWebViewConfiguration _visitedLinkProvider]): (-[WKWebViewConfiguration _setVisitedLinkProvider:]): (-[WKWebViewConfiguration _websiteDataStore]): (-[WKWebViewConfiguration _setWebsiteDataStore:]): (-[WKWebViewConfiguration _contentProviderRegistry]): (-[WKWebViewConfiguration _setContentProviderRegistry:]): Pass initialization code to all getters. (-[WKWebViewConfiguration _validate]): Use getters. (-[WKWebViewConfiguration init]): Deleted. 2014-05-26 Martin Hodovan Remove WebKit2 framework from generate-forwarding-headers.pl https://bugs.webkit.org/show_bug.cgi?id=133214 Since renaming WebKit2.framework to WebKit.framework is done and all WebKit2/*.h includes were renamed to WebKit/*.h, generating forwarding headers for WebKit2/*.h framework style headers is not necessary anymore. Reviewed by Darin Adler. * Scripts/generate-forwarding-headers.pl: 2014-05-26 Zan Dobersek WebPage::setComposition(), WebPageProxy::didFindStringMatches() should take Vector parameters by const reference https://bugs.webkit.org/show_bug.cgi?id=133264 Reviewed by Darin Adler. Taking the Vector parameters in the two methods (invoked through the IPC message handling) by value causes unnecessary copies. The methods don't modify the objects and don't want or need fresh copies, hence they should take in const references to Vector objects. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFindStringMatches): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setComposition): * WebProcess/WebPage/WebPage.h: 2014-05-25 Benjamin Poulain [iOS][WK2] Fix some state reset on crash on the WKWebView https://bugs.webkit.org/show_bug.cgi?id=133039 Reviewed by Sam Weinig. This is in no way complete, but this should reduce the undefined states on crash. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _processDidExit]): If the view is animating, nuke the resize animation. That should be invisible to the user because the background color is reset to white below. Reset the contentView frame and scrollview state. Reset the runtime states. We do not strictly need to reset _needsResetViewStateAfterCommitLoadForMainFrame, _delayUpdateVisibleContentRects and _hadDelayedUpdateVisibleContentRects but it seems better to have a clean slate. (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _endAnimatedResize]): We could have crashes during rotation. To simplify the reset code, the animated resize code no longer change any state when WKWebView is using a custom content view. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::processDidExit): Send a _processDidExit on the WKWebView too. 2014-05-25 Anders Carlsson Use the right paths for website data https://bugs.webkit.org/show_bug.cgi?id=133267 Reviewed by Sam Weinig. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _initWithConfiguration:]): Get the path of the absolute URL. * UIProcess/Storage/LocalStorageDatabaseTracker.cpp: (WebKit::LocalStorageDatabaseTracker::databasePath): Fix spelling error. * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didCacheResource): Ditto. 2014-05-25 Benjamin Poulain [iOS][WK2] Use ScrollView's scrollOffset as the unobscuredContentRect https://bugs.webkit.org/show_bug.cgi?id=133262 Reviewed by Simon Fraser. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): (WebKit::WebPage::viewportConfigurationChanged): (WebKit::WebPage::updateVisibleContentRects): 2014-05-25 Sam Weinig Build fix 2. * UIProcess/API/Cocoa/WKPreferences.h: 2014-05-25 Sam Weinig Fix build. * UIProcess/API/Cocoa/WKPreferences.h: 2014-05-24 Sam Weinig [WebKit2] Rework WebPreferencesStore to allow easier overriding of defaults https://bugs.webkit.org/show_bug.cgi?id=133258 Reviewed by Anders Carlsson. To support changing default values of preferences based on which API you are using (either the legacy C-SPI or the Objective-C API), overhaul the WebPreferencesStore to use a single HashMap of String -> Value (where Value is new type that can be a String, bool, uint32_t or double) instead of four HashMaps. This allows us to use two of these new HashMaps, one for the actual set values, and one for overridden defaults. This new Value class will also allow easier incremental updating of preferences in the future. Other notable changes: - Removed Float kind of preferences. There were none. - Move StorageBlockingPolicy preference to the correct group, it's a uint32_t, not bool. * Shared/WebPreferencesStore.cpp: * Shared/WebPreferencesStore.h: 2014-05-25 David Kilzer Add type-checked casts for TransformOperations Reviewed by Simon Fraser. * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: (IPC::ArgumentCoder::encode): - Switch to type-checked casts. 2014-05-25 David Kilzer Use type-checking FilterOperation casts in CoordinatedGraphicsArgumentCoders.cpp Reviewed by Simon Fraser. * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: (IPC::ArgumentCoder::encode): - Replace static_cast<>() operators with type-checking FilterOperation casts. - Replace 'default' statement with 'case' statements so new filters added later require an explicit decision to be made. (IPC::ArgumentCoder::decode): - Replace 'default' statement with 'case' statements so new filters added later require an explicit decision to be made. 2014-05-24 Jon Honeycutt Potential null dereference in WebFrameLoaderClient::dispatchDidFailProvisionalLoad() WebFrameLoaderClient::dispatchDidFailProvisionalLoad() calls the InjectedBundleLoaderClient's didFailProvisionalLoadWithErrorForFrame() before sending a message to the UI process that a provisional load has failed. It's possible for the provisional document loader to become null while calling into the InjectedBundleLoaderClient (as is the case with the WebKitTestRunner's injected bundle), leading to a null dereference when trying to send the DidFailProvisionalLoadForFrame message. Reviewed by Darin Adler. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad): Get the navigation ID before calling into the injected bundle. 2014-05-23 Simon Fraser Rename ScrollingTreeScrollingNode's m_scrollPosition to make it clear that it's the value committed from the state tree https://bugs.webkit.org/show_bug.cgi?id=133254 Reviewed by Tim Horton. Override scrollPosition() on ScrollingTreeOverflowScrollingNodeIOS. * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollPosition): 2014-05-24 Chris Fleizach AX: fix coordinate mapping for iOS accessibility https://bugs.webkit.org/show_bug.cgi?id=133188 Reviewed by Sam Weinig. Add in accessibility conversion methods that will check if the methods are present (if accessibility is not on, they won't be) and use those to convert points into the right coordinate space that VoiceOver is expecting. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::accessibilityScreenToRootView): (WebKit::WebPageProxy::rootViewToAccessibilityScreen): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::accessibilityScreenToRootView): (WebKit::PageClientImpl::rootViewToAccessibilityScreen): * UIProcess/mac/PageClientImpl.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::accessibilityScreenToRootView): (WebKit::WebChromeClient::rootViewToAccessibilityScreen): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm: (-[WKAccessibilityWebPageObject accessibilityHitTest:]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::accessibilityScreenToRootView): (WebKit::WebPage::rootViewToAccessibilityScreen): * WebProcess/WebPage/WebPage.h: 2014-05-24 Carlos Garcia Campos REGRESSION(r165841): Messages sent before the child process is launched are never sent after r165841 https://bugs.webkit.org/show_bug.cgi?id=131675 Reviewed by Anders Carlsson. Since r165841 the connection is opened after the pending messages are sent, because connectionWillOpen might send messages that we want to happen after the ones already pending. The problem is that Connection::canSendOutgoingMessages() returns false when connection hasn't been opened. We should ensure no messages are sent by connectionWillOpen. * Shared/ChildProcessProxy.cpp: (WebKit::ChildProcessProxy::didFinishLaunching): Open the connection before sending pending messages. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::connectionWillOpen): Do not call VisitedLinkProvider::addProcess() here because it tries to send a message to the web process, but the connection hasn't be opened yet. (WebKit::WebPageProxy::processDidFinishLaunching): Call VisitedLinkProvider::addProcess() here instead. * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didFinishLaunching): Call WebPageProxy::processDidFinishLaunching() for every web page. 2014-05-23 Ian Henderson REGRESSION: Rubberbanding out jumps to top left corner on google.com https://bugs.webkit.org/show_bug.cgi?id=133253 Reviewed by Benjamin Poulain. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Avoid deceleration during zooming to work around a UIKit bug. 2014-05-23 Benjamin Poulain [iOS][WK2] Avoid updating the view from the viewport configuration unnecessarily https://bugs.webkit.org/show_bug.cgi?id=133255 Reviewed by Simon Fraser. All the updates were mostly harmless since they are pretty cheap, but they can be very annoying for debugging. This patch skips viewportUpdates in the trivial cases. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setMinimumLayoutSizeOverride:]): (-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::mainFrameDidLayout): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::viewportPropertiesDidChange): 2014-05-23 Benjamin Poulain [iOS][WK2] The page scale factor randomly resets to initial scale when editing https://bugs.webkit.org/show_bug.cgi?id=133244 Reviewed by Enrica Casucci. We were never telling the WebProcess that zoom is used triggered. As a result, the ViewportConfiguration was free to reset the scale whenever it felt like it. The fix is to call willStartUserTriggeredZoom before changing the scale. This patch also split _willStartUserTriggeredScrollingOrZooming from willStartUserTriggeredZoom and rename it to willStartPanOrPinchGesture. This is just a tiny cleanup since the only thing left in _willStartUserTriggeredScrollingOrZooming was gesture related. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _zoomToFocusRect:WebCore::selectionRect:WebCore::fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): (-[WKWebView scrollViewWillBeginZooming:withView:]): (-[WKWebView scrollViewWillBeginDragging:]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/ios/WKViewIOS.mm: (-[WKView scrollViewWillBeginDragging:]): * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView willStartUserTriggeredZoom]): (-[WKContentView willStartUserTriggeredScroll]): Deleted. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView willStartPanOrPinchGesture]): (-[WKContentView _willStartUserTriggeredScrollingOrZooming]): Deleted. 2014-05-23 Tim Horton REGRESSION (iOS WebKit2): requestAnimationFrame fires more than once between layer tree commits https://bugs.webkit.org/show_bug.cgi?id=132794 Reviewed by Simon Fraser. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::createDisplayRefreshMonitor): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::graphicsLayerFactory): (WebKit::DrawingArea::createDisplayRefreshMonitor): Plumb the DisplayRefreshMonitor request through to the DrawingArea. RemoteLayerTreeDrawingArea will implement and return a RemoteLayerTreeDisplayRefreshMonitor. * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.h: Added. (WebKit::RemoteLayerTreeDisplayRefreshMonitor::create): * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.mm: Added. (WebKit::RemoteLayerTreeDisplayRefreshMonitor::RemoteLayerTreeDisplayRefreshMonitor): (WebKit::RemoteLayerTreeDisplayRefreshMonitor::~RemoteLayerTreeDisplayRefreshMonitor): (WebKit::RemoteLayerTreeDisplayRefreshMonitor::requestRefreshCallback): When requesting a display refresh callback, schedule a layer commit. It may end up being empty, but will still call us back with a didUpdate, upon which we'll fire the callback. (WebKit::RemoteLayerTreeDisplayRefreshMonitor::didUpdateLayers): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::createDisplayRefreshMonitor): (WebKit::RemoteLayerTreeDrawingArea::willDestroyDisplayRefreshMonitor): Keep track of the set of DisplayRefreshMonitors. (WebKit::RemoteLayerTreeDrawingArea::didUpdate): Fire requestAnimationFrame callbacks once the UI process commits the new layer tree. 2014-05-23 Jeremy Jones Hide fullscreen immediately when switching tabs. https://bugs.webkit.org/show_bug.cgi?id=133239 Reviewed by Eric Carlson. Renamed a function to better describe it's new functionality. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::viewStateDidChange): now calls: requestHideAndExitFullscreen 2014-05-23 Enrica Casucci REGRESSION (WebKit2): Keyboard disappears/appears automatically between text boxes. https://bugs.webkit.org/show_bug.cgi?id=133243 Reviewed by Benjamin Poulain. We need to ensure that when an element loses focus and another one gets it, this is handled in one single message in the UI process to avoid seeing the keyboard animating in and out. This is accomplished by always postponing the blur notification until all events have been processed. If a new node is focused before the delayed blur notification is sent to the UI process, the message we send includes both blur and focus notification. In this case, the postponed blur notification is not sent. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::startAssistingNode): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): (-[WKContentView _startAssistingNode:userIsInteracting:userObject:]): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::startAssistingNode): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::elementDidFocus): (WebKit::WebPage::elementDidBlur): 2014-05-23 Anders Carlsson Remove an assertion. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadRequest): 2014-05-23 Tim Horton [iOS] WKPDFView should have a page indicator https://bugs.webkit.org/show_bug.cgi?id=133109 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setHasCustomContentView:loadedMIMEType:WTF::]): (-[WKWebView _setObscuredInsets:]): Forward obscured insets changes to the custom content view. (-[WKWebView _updateScrollViewBackground]): If we have a custom content view, use its background instead of the (likely nonexistent) page's when updaing the scroll view's background color. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/WKWebViewContentProvider.h: * UIProcess/Cocoa/WKWebViewContentProviderDelegate.h: Added. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setInsetForOverlaidAccessoryViews:]): Add SPI for clients to inform us about potential overlaid accessory views which should be taken into account e.g. for positioning the page indicator. Add a view that sits fixed on top of the WKWebView, ignores interaction, but provides the WKWebViewContentProvider a place to install views that don't scroll along with the content. * UIProcess/ios/WKPDFPageNumberIndicator.h: Added. * UIProcess/ios/WKPDFPageNumberIndicator.mm: Added. (-[WKPDFPageNumberIndicator initWithFrame:]): (-[WKPDFPageNumberIndicator dealloc]): (-[WKPDFPageNumberIndicator setCurrentPageNumber:]): (-[WKPDFPageNumberIndicator setPageCount:]): (-[WKPDFPageNumberIndicator show]): (-[WKPDFPageNumberIndicator hide:]): (-[WKPDFPageNumberIndicator moveToPoint:animated:]): (-[WKPDFPageNumberIndicator sizeThatFits:]): (-[WKPDFPageNumberIndicator _updateLabel]): (-[WKPDFPageNumberIndicator _makeRoundedCorners]): Add a page number indicator. * UIProcess/ios/WKPDFView.mm: (-[WKPDFView dealloc]): (-[WKPDFView web_setScrollView:]): (-[WKPDFView _revalidateViews]): (-[WKPDFView _offsetForPageNumberIndicator]): (-[WKPDFView _updatePageNumberIndicator]): (-[WKPDFView web_setObscuredInsets:]): (-[WKPDFView web_setInsetForOverlaidAccessoryViews:]): (-[WKPDFView web_setFixedOverlayView:]): (-[WKPDFView _computePageAndDocumentFrames]): Update the page number indicator when the topmost visible page changes. Move the page number indicator around when the obscured insets change. * WebKit2.xcodeproj/project.pbxproj: 2014-05-23 Anders Carlsson Fix test failures on the bot. * UIProcess/API/Cocoa/WKProcessPool.mm: (websiteDataDirectoryURL): If we have no bundle identifier, use the process name. 2014-05-23 Enrica Casucci REGRESSION (iOS WebKit2): Autocorrection is not accurate when changing selection. https://bugs.webkit.org/show_bug.cgi?id=133237 Reviewed by Ryosuke Niwa. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView beginSelectionChange]): (-[WKContentView endSelectionChange]): When the selection is changed with a gesture in an editable element, we must notify the keyboard to make sure the autocorrection engine updates its typing context. WKContentView must implement beginSelectionChange and endSelectionChange to call into the keyboard layer. 2014-05-22 Brent Fulgham [iOS] WK2: Provide implementation for windowFrame https://bugs.webkit.org/show_bug.cgi?id=133205 Reviewed by Benjamin Poulain. * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::windowFrame): Added. * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::convertToUserSpace): Added. 2014-05-20 Anders Carlsson Use a per app directory structure for website data https://bugs.webkit.org/show_bug.cgi?id=133125 Reviewed by Dan Bernstein, Sam Weinig and Tim Horton. Put website data in subdirectories of ~/Library/WebKit//WebsiteData. We use "LocalStorage", "WebSQL", and "IndexedDB" subdirectories. * UIProcess/API/Cocoa/WKProcessPool.mm: (websiteDataDirectoryURL): (-[WKProcessPool _initWithConfiguration:]): 2014-05-23 Dan Bernstein [Cocoa] WKNavigationResponsePrivate.h is internal https://bugs.webkit.org/show_bug.cgi?id=133218 Reviewed by Dean Jackson. * WebKit2.xcodeproj/project.pbxproj: Promote WKNavigationResponsePrivate.h to private. 2014-05-23 Carlos Garcia Campos [UNIX] Reorganize and cleanup main functions of GTK and EFL ports https://bugs.webkit.org/show_bug.cgi?id=131024 Reviewed by Gustavo Noronha Silva. Move main function implementation files to /EntryPoint/unix/Main.cpp files that are now shared by GTK and EFL ports. These files call a main method that wraps a new method ChildProcessMain that contains the common code and uses a helper class for the platform specific code. GTK+ and EFL ports implement that helper class for every process type. * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp: Renamed from Source/WebKit2/efl/MainEfl.cpp. (main): * NetworkProcess/efl/NetworkProcessMainEfl.cpp: Renamed from Source/WebKit2/unix/NetworkMainUnix.cpp. (WebKit::NetworkProcessMainUnix): * NetworkProcess/gtk/NetworkProcessMainGtk.cpp: Renamed from Source/WebKit2/NetworkProcess/unix/NetworkProcessMainUnix.cpp. (WebKit::NetworkProcessMainUnix): * NetworkProcess/unix/NetworkProcessMainUnix.h: * PlatformEfl.cmake: * PlatformGTK.cmake: * PluginProcess/EntryPoint/unix/PluginProcessMain.cpp: Renamed from Source/WebKit2/unix/PluginMainUnix.cpp. (main): * PluginProcess/unix/PluginProcessMainUnix.cpp: (WebKit::webkitXError): (WebKit::PluginProcessMainUnix): * PluginProcess/unix/PluginProcessMainUnix.h: * Shared/unix/ChildProcessMain.cpp: Copied from Source/WebKit2/WebProcess/efl/WebProcessMainEfl.h. (WebKit::ChildProcessMainBase::parseCommandLine): * Shared/unix/ChildProcessMain.h: Renamed from Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.h. (WebKit::ChildProcessMainBase::platformInitialize): (WebKit::ChildProcessMainBase::platformFinalize): (WebKit::ChildProcessMainBase::initializationParameters): (WebKit::ChildProcessMain): * WebProcess/EntryPoint/unix/WebProcessMain.cpp: Renamed from Source/WebKit2/gtk/MainGtk.cpp. (main): * WebProcess/efl/WebProcessMainEfl.cpp: (WebKit::WebProcessMainUnix): (dummyExtensionErrorHandler): Deleted. * WebProcess/gtk/WebProcessMainGtk.cpp: (WebKit::WebProcessMainUnix): * WebProcess/unix/WebProcessMainUnix.h: Renamed from Source/WebKit2/WebProcess/efl/WebProcessMainEfl.h. 2014-05-22 Zan Dobersek Have the decoded element in VectorArgumentCoder::decode() moved into Vector::append() https://bugs.webkit.org/show_bug.cgi?id=133082 Reviewed by Andreas Kling. * Platform/IPC/ArgumentCoders.h: Move the decoded element into the Vector::append() call. This enforces a move instead of a copy if the decoded element's type is move-constructible. 2014-05-22 Zan Dobersek Move the passed-in Vector in MessageDecoder constructor down into ArgumentDecoder https://bugs.webkit.org/show_bug.cgi?id=133080 Reviewed by Andreas Kling. * Platform/IPC/MessageDecoder.cpp: (IPC::MessageDecoder::MessageDecoder): The Vector object was passed in by value. Move it into the ArgumentDecoder constructor as it is not used elsewhere in this constructor and produces a copy otherwise. 2014-05-22 Benjamin Poulain [iOS][WK2] Add support for minimal-ui viewports https://bugs.webkit.org/show_bug.cgi?id=133162 Reviewed by Simon Fraser. In the WebKit2 layers, we have two parts to minimal-ui. -In WebPage, we need to get the values from the UIProcess and setup the ViewportConfiguration. Another part is freezing the state on page load. -In the UIProcess, we need to get the right information for layout and styling, and we need to tell the UI clients about minimal-ui changes. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setUsesMinimalUI:]): (-[WKWebView _usesMinimalUI]): (-[WKWebView _didCommitLayerTree:WebKit::]): (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _minimumLayoutSizeOverride]): (-[WKWebView _setMinimumLayoutSizeOverride:]): (-[WKWebView _minimumLayoutSizeOverrideForMinimalUI]): (-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]): (-[WKWebView _largestUnobscuredSizeOverride]): (-[WKWebView _setMaximumUnobscuredSizeOverride:]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): (setViewportConfigurationMinimumLayoutSize): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::setUsesMinimalUI): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::dynamicViewportSizeUpdate): (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSizeForMinimalUI): (WebKit::WebPageProxy::setMaximumUnobscuredSize): (WebKit::WebPageProxy::setUsesMinimalUI): (WebKit::WebPageProxy::setMinimumLayoutSizeForMinimalUI): Deleted. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): (WebKit::WebPage::didCommitLoad): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::setViewportConfigurationMinimumLayoutSizeForMinimalUI): (WebKit::WebPage::setMaximumUnobscuredSize): (WebKit::WebPage::willFlushLayers): (WebKit::WebPage::dynamicViewportSizeUpdate): (WebKit::WebPage::viewportConfigurationChanged): (WebKit::WebPage::updateViewportSizeForCSSViewportUnits): (WebKit::WebPage::setMinimumLayoutSizeForMinimalUI): Deleted. * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::flushLayers): 2014-05-22 Benjamin Poulain [iOS][WK2] Reset the special action-target of WKSyntheticClickTapGestureRecognizer on destruction https://bugs.webkit.org/show_bug.cgi?id=133165 Reviewed by Andy Estes. It is unclear why, but the WKSyntheticClickTapGestureRecognizer sometimes survives its own view and is reset after WKContentView was destructed. This patch cleans up the target-action on destruction to avoid accessing a destructed object. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): 2014-05-22 Benjamin Poulain Do not force a layout when changing the FixedLayoutSize in WebPage https://bugs.webkit.org/show_bug.cgi?id=133167 Reviewed by Andreas Kling. WebPage::setFixedLayoutSize was forcing a layout immediately after changing the layout size on FrameView. This is forcing plenty of extra layouts since the fixed layout size is one of many properties updated on the FrameView. FrameView marks that layout is needed. It is not clear why a layout was performed immediately. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setFixedLayoutSize): 2014-05-22 Andreas Kling [iOS WebKit2] Web process should try to shrink its memory footprint when going into background. Try to free up as much memory as possible before going into background. Reviewed by Gavin Barraclough. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::processWillSuspend): 2014-05-22 Andreas Kling Hook up a setting for showing detailed logging during memory pressure relief. Plumb through the same setting that we used for detailed logging in WK1. Reviewed by Gavin Barraclough. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::WebProcessCreationParameters): (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2014-05-22 Andy Estes [iOS] Send shareable resources to QuickLook if enabled https://bugs.webkit.org/show_bug.cgi?id=133189 Reviewed by Brady Eidson. Like we do for didReceiveData(), we need to pass an incoming ShareableResource to QuickLook if a QuickLook handle exists. * Shared/ShareableResource.cpp: (WebKit::ShareableResource::Handle::tryWrapInCFData): Return the shared resource in a CFDataRef. (WebKit::ShareableResource::Handle::tryWrapInSharedBuffer): Implemented in terms of tryWrapInCFData(). * Shared/ShareableResource.h: * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveResource): If a QuickLook handle exists, send the shareable resource to it via a CFDataRef. 2014-05-22 Martin Hock [iOS] Enable -apple-system- styled elements to respond to system font size changes. https://bugs.webkit.org/show_bug.cgi?id=133186 Reviewed by Enrica Casucci. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): (-[WKWebView _contentSizeCategoryDidChange:]): (-[WKWebView _contentSizeCategory]): * UIProcess/WebPageProxy.h: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::contentSizeCategoryDidChange): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::contentSizeCategoryDidChange): 2014-05-22 Alexey Proskuryakov [iOS] Add CFBundleAllowMixedLocalizations to WebContentService https://bugs.webkit.org/show_bug.cgi?id=133187 Reviewed by Tim Horton. * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist: We already had it in WebContentService.Development, just not here. 2014-05-22 Alexey Proskuryakov [iOS][WK2] Application cache is broken https://bugs.webkit.org/show_bug.cgi?id=133172 Reviewed by Andy Estes. * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformDefaultApplicationCacheDirectory): Use a proper path for application cache database (same as WebKit1). 2014-05-22 Enrica Casucci REGRESSION (WebKit2): Keyboard should have Search button in duckduckgo.com. https://bugs.webkit.org/show_bug.cgi?id=133183 Reviewed by Geoff Garen. The keyboard type should be search if the input type is search or if it is text and it is inside a form with an action and either name, id or title contain the word search. This matches the heuristics we have in WK1 for iOS. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getAssistedNodeInformation): 2014-05-21 Oliver Hunt Only enable sandbox extensions on mac. RS = Alexey. * WebKit2Prefix.h: 2014-05-21 Oliver Hunt [iOS] Enable sandboxing for the database process https://bugs.webkit.org/show_bug.cgi?id=132963 Reviewed by Alexey Proskuryakov. Simply ensure that the database process is running in a tight sandbox. As part of this i've separated out ChildProcessIOS and ensures that the database process loads a custom sandbox. * Configurations/WebKit.xcconfig: * DatabaseProcess/ios/DatabaseProcessIOS.mm: (WebKit::DatabaseProcess::initializeSandbox): * DatabaseProcess/ios/com.apple.WebKit.DatabasesIOS.sb: Added. * Shared/ios/ChildProcessIOS.mm: Added. Essentially cloned from the Mac version, only all the OSX specific logic has been stripped. (WebKit::ChildProcess::setApplicationIsDaemon): (WebKit::ChildProcess::platformInitialize): (WebKit::ChildProcess::initializeSandbox): (WebKit::ChildProcess::setQOS): * Shared/mac/ChildProcessMac.mm: Remove all the IOS ifdefs. (WebKit::ChildProcess::setApplicationIsDaemon): (WebKit::ChildProcess::platformInitialize): (WebKit::ChildProcess::initializeSandbox): (WebKit::ChildProcess::setQOS): * WebKit2.xcodeproj/project.pbxproj: 2014-05-21 Andy Estes [iOS] Create a UIPrintFormatter for WKWebView https://bugs.webkit.org/show_bug.cgi?id=133005 Reviewed by Tim Horton. Implemented a UIPrintFormatter subclass to support printing WKWebViews using UIPrintInteractionController. Overrode -_recalcPageCount: to synchronously ask the web process to lay out for printing and return the number of page rects. The web process returns the page rects immediately and then starts rendering the page to a PDF, returning the PDF data to the UI process asynchronously. When UIPrintInteractionController later calls our overridden -drawInRect:forPageAtIndex:, we block and wait for the PDF data to be returned. Since UIPrintInteractionController draws each page after a delay, it's possible that the web process has already returned the PDF data to us by the time we print the first page. * Shared/WebPreferencesStore.h: Correctly initialized shouldPrintBackgrounds for iOS. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _dataForDisplayedPDF]): Now that WKPDFView vends its CGPDFDocument directly, extract its data here. (-[WKWebView _printFormatterClass]): Tell UIView which UIPrintFormatter to alloc. (-[WKWebView _computePageCountAndStartDrawingToPDFWithPrintInfo:WebKit::firstPage:computedTotalScaleFactor:]): If we're displaying a PDF, return its page count directly. Otherwise, synchronously ask the web process to compute page rects for printing and then return the number of rects. (-[WKWebView _endPrinting]): Cleared state and sent the WebPage::EndPrinting message to the web process. (-[WKWebView _printedDocument]): If we're displaying a PDF, return its data directly. Otherwise, if we haven't received PDF data from the web process yet, wait for it indefinitely (there's no sensible timeout to use here since failing to receive the data results in printing some number of blank pages). (-[WKWebView _setPrintedDocument:]): Set the CGPDFDocument received from the web process. * UIProcess/API/Cocoa/WKWebViewInternal.h: Declared methods called by WKWebViewPrintFormatter. * UIProcess/PageClient.h: Declared didFinishDrawingPagesToPDF. * UIProcess/WKWebViewPrintFormatter.h: Added. * UIProcess/WKWebViewPrintFormatter.mm: Added. (-[WKWebViewPrintFormatter dealloc]): Cleared state and called -[WKWebView _endPrinting]. (-[WKWebViewPrintFormatter webView]): Returned the WKWebView for this print formatter. (-[WKWebViewPrintFormatter _recalcPageCount]): Set up a PrintInfo object given the formatter's content rect and called -_computePageCountAndStartDrawingToPDFWithPrintInfo:... (-[WKWebViewPrintFormatter rectForPageAtIndex:]): Called -_recalcIfNecessary and then returned the rect from -_pageContentRect. (-[WKWebViewPrintFormatter drawInRect:forPageAtIndex:]): Taught to draw the given page of the printed PDF document into the given rect and context provided to us. * UIProcess/WebPageProxy.h: Declared didFinishDrawingPagesToPDF. * UIProcess/WebPageProxy.messages.in: Added DidFinishDrawingPagesToPDF. Made this a delayed syncrhonous message so that additoinal work could be performed after sending the response. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didFinishDrawingPagesToPDF): Created a CGPDFDocument from the data sent to us by the web process and called -[WKWebView _setPrintedDocument:]. * UIProcess/ios/WKPDFView.h: * UIProcess/ios/WKPDFView.mm: (-[WKPDFView pdfDocument]): Returned the underlying CGPDFDocument. (-[WKPDFView documentData]): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::didFinishDrawingPagesToPDF): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::computePagesForPrinting): Changed to call computePagesForPrintingImpl. (WebKit::WebPage::computePagesForPrintingImpl): Moved the common logic of computePagesForPrinting to here so it could be called by computePagesForPrintingAndStartDrawingToPDF. (WebKit::WebPage::drawPagesToPDF): Changed to call drawPagesToPDFImpl (WebKit::WebPage::drawPagesToPDFImpl): Moved the common logic of drawPagesToPDF to here so it could be called by computePagesForPrintingAndStartDrawingToPDF. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::computePagesForPrintingAndStartDrawingToPDF): Computed page rects and returned them as a synchronous response. Afterwards called drawPagesToPDFImpl() and returned the PDF data by sending WebPageProxy::DidFinishDrawingPagesToPDF. 2014-05-21 Michał Pakuła vel Rutka [EFL] Turn on ENABLE_CSS_FILTERS https://bugs.webkit.org/show_bug.cgi?id=133153 Reviewed by Gyuyoung Kim. Make WebKit2 compile after r166741 when CSS_FILTERS are enabled. * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: (IPC::ArgumentCoder::decode): 2014-05-21 Brady Eidson Special handling of telephone number detection menu. and https://bugs.webkit.org/show_bug.cgi?id=133143 Reviewed by Geoff Garen. Add a bool to ContextMenuContextData to represent telephone number menus: * Shared/ContextMenuContextData.cpp: (WebKit::ContextMenuContextData::ContextMenuContextData): (WebKit::ContextMenuContextData::operator=): (WebKit::ContextMenuContextData::encode): (WebKit::ContextMenuContextData::decode): * Shared/ContextMenuContextData.h: (WebKit::ContextMenuContextData::ContextMenuContextData): (WebKit::ContextMenuContextData::isTelephoneNumberContext): * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::showContextMenu): If the menu is a telephone number menu then display it using a specific AppKit API. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::showTelephoneNumberMenu): Filter the array of menu items through a new WKSI call, and then show it using a telephone number context. 2014-05-21 Alexey Proskuryakov [Mac] REGRESSION (Async text input): Asian text input doesn't work in Flash https://bugs.webkit.org/show_bug.cgi?id=133128 Reviewed by Anders Carlsson. * UIProcess/API/mac/WKView.mm: (-[WKView _interpretKeyEvent:completionHandler:]): Added a separate code path for plug-in input. Before async text input, we used to provide a nil input context due to having _data->_interpretKeyEventsParameters while this function was executing, and thus took a shortcut. The new behavior is different from pre-async in that we don't collect commands at all, but I couldn't find any case where that mattered. (-[WKView inputContext]): The _collectedKeypressCommands check was not a correct replacement for _interpretKeyEventsParameters one, because this variable is not always set within -_interpretKeyEvent:completionHandler:. * UIProcess/mac/WKTextInputWindowController.mm: (-[WKTextInputPanel _interpretKeyEvent:usingLegacyCocoaTextInput:string:]): While at it, fixed a separate issue with Cangjie predictive input. We shouldn't keep prediction pop-up on screen after hiding the bottom input window. 2014-05-16 Martin Robinson [CMake] Improve handling of LIB_INSTALL_DIR, EXEC_INSTALL_DIR, and LIBEXEC_INSTALL_DIR https://bugs.webkit.org/show_bug.cgi?id=132819 Reviewed by Carlos Garcia Campos. * PlatformEfl.cmake: No need to prefix EXEC_INSTALL_DIR with the prefix any longer. * PlatformGtk.cmake: No longer use CMAKE_INSTALL_FULL_FOO variables, instead using the WebKit-specific ones. * efl/EWebKit2Config.cmake.in: Ditto. * efl/ewebkit2.pc.in: Instead of hard-coding the path to the library installation directory use LIB_INSTALL_DIR. * webkit2gtk-web-extension.pc.in: No longer use the pkg-config only variables. Instead use the common CMake ones. * webkit2gtk.pc.in: Ditto. 2014-05-21 Carlos Garcia Campos REGRESSION(r168625): [GTK] Assertion failure in LocalStorageDatabaseTracker https://bugs.webkit.org/show_bug.cgi?id=133118 Reviewed by Philippe Normand. Call WebContext::applyPlatformSpecificConfigurationDefaults() to initialize the WebContextConfiguration before creating the default WebContext. * UIProcess/API/gtk/WebKitWebContext.cpp: (createDefaultWebContext): 2014-05-21 Shivakumar JM [WebKit2] Cleanup the build from unused variable in WebProcess module https://bugs.webkit.org/show_bug.cgi?id=133062 Reviewed by Csaba Osztrogonác. Fix unused parameter by using UNUSED_PARAM macro * WebProcess/UserContent/WebUserContentController.cpp: (WebKit::WebUserContentController::addUserScriptMessageHandlers): (WebKit::WebUserContentController::removeUserScriptMessageHandler): 2014-05-20 Enrica Casucci REGRESSION (WK2): Tapping on the input field in duckduckgo.com shows the keyboard but not the caret. https://bugs.webkit.org/show_bug.cgi?id=133140 Reviewed by Benjamin Poulain. When a page focuses a field on load, we receive the call to startAssistingNode but we don't create a text interaction assistant if the focus is not originated by a user action. Upon receiving the selection change notification we don't call the text interaction assistant, since we don't have one, but we do call the web selection assistant. We don't have any valid rects for web selection and we clear the selection on the page, causing the caret not to appear and the typing to have no effect. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _updateChangedSelection]): 2014-05-20 Dean Jackson [Mac] Allow popup menus to override default appearance https://bugs.webkit.org/show_bug.cgi?id=133129 Reviewed by Tim Horton. Add an extra "hideArrows" flag to PlatformPopupMenuData and replace the call to WKPopupMenuWithSize with WKPopupMenu. * Shared/PlatformPopupMenuData.cpp: Encode and decode the new data value. (WebKit::PlatformPopupMenuData::encode): (WebKit::PlatformPopupMenuData::decode): * Shared/PlatformPopupMenuData.h: Add hideArrows boolean. * UIProcess/mac/WebPopupMenuProxyMac.mm: (WebKit::WebPopupMenuProxyMac::showPopupMenu): * WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm: (WebKit::WebPopupMenu::setUpPlatformData): The hideArrows flag is true if we don't have the default appearance. 2014-05-20 Eric Carlson [Mac] do not deactivate an audio session that has running I/O https://bugs.webkit.org/show_bug.cgi?id=133127 Reviewed by Jer Noble. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): Settings::setShouldManageAudioSession renamed to setShouldManageAudioSessionCategory, deal with it. 2014-05-19 Simon Fraser REGRESSION (r169063) Fixed and sticky nodes misplaced on scrolling sometimes https://bugs.webkit.org/show_bug.cgi?id=133106 Reviewed by Sam Weinig. Fix regression from r169063. That commit removed scrolledContentsLayers from frame scrolling nodes, but they do actually use them. So put them back; not in the base class, because they have a somewhat different meaning for overflow scrolling and frame scrolling. * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder::encode): (ArgumentCoder::decode): (WebKit::RemoteScrollingTreeTextStream::dump): * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): 2014-05-20 Alexey Proskuryakov [Mac] WebProcess doesn't follow localization of UI process when run as a service https://bugs.webkit.org/show_bug.cgi?id=133126 Reviewed by Sam Weinig and Tim Horton. * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm: (WebKit::handleXPCBootstrap): (main): * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm: (WebKit::handleXPCBootstrap): (main): Set localization very early in process lifetime (in development builds, that's even before WebKit framework is loaded). * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::connectToService): Pass UI process localization to the service, computing it in the same way we do for child processes. 2014-05-20 Anders Carlsson Fix a header comment https://bugs.webkit.org/show_bug.cgi?id=133123 Reviewed by Geoffrey Garen. * UIProcess/API/Cocoa/WKUserContentController.h: 2014-05-20 Carlos Garcia Campos [GTK] WebKitWebPage::send-request always pass a valid pointer for redirected response https://bugs.webkit.org/show_bug.cgi?id=133119 Reviewed by Sergio Villar Senin. The problem is that we were checking whether the passed in WKURLResponseRef is NULL or not, but it's always a valid object that can contain a NULL WebCore::ResourceResponse. * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: (willSendRequestForFrame): Pass NULL as redirect-response parameter of WebKitWebPage::send-request signal when the WebCore::ResourceResponse of the passed in WKURLResponseRef is NULL. 2014-05-20 Antti Koivisto Double-tap zoom does not take obscuring insets into account https://bugs.webkit.org/show_bug.cgi?id=133116 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _zoomToRect:WebCore::atScale:origin:WebCore::]): Compute the zoom target taking insets into account. 2014-05-19 Gavin Barraclough WebKit2/iOS: parented view should be considered hidden if app is backgrounded https://bugs.webkit.org/show_bug.cgi?id=133099 radar://16942183 Reviewed by Simon Fraser. * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::isViewWindowActive): - implemented in terms of isViewVisible. - FIXME: https://bugs.webkit.org/show_bug.cgi?id=133098 (WebKit::PageClientImpl::isViewFocused): - implemented in terms of isViewWindowActive. - FIXME: https://bugs.webkit.org/show_bug.cgi?id=133098 (WebKit::PageClientImpl::isViewVisible): - take UIApplication applicationState into account in determining visibility. (WebKit::PageClientImpl::isViewVisibleOrOccluded): - implemented in terms of isViewVisible. (WebKit::PageClientImpl::isVisuallyIdle): - implemented in terms of isViewVisible. * UIProcess/ios/WKContentView.mm: (-[WKContentView initWithFrame:context:WebKit::configuration:WebKit::webView:]): - register for UIApplicationDidEnterBackgroundNotification. (-[WKContentView _applicationDidEnterBackground:]): (-[WKContentView _applicationWillEnterForeground:]): - when the application state changes all flags except IsInWindow may be affected. 2014-05-19 Enrica Casucci WK2 iOS: Pressing the form navigation button causes the keyboard to be dismissed. https://bugs.webkit.org/show_bug.cgi?id=133100 Reviewed by Benjamin Poulain. The call to focusNextAssistedNode is the result of a user action, since it is called when the user pressed the form navigation buttons. Therefore we must set m_userIsInteracting to true before changing the focus to make sure the focus change is honored. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::focusNextAssistedNode): 2014-05-19 Beth Dakin TelephoneNumberOverlayController should use a modern loop for text quad bounding boxes https://bugs.webkit.org/show_bug.cgi?id=133096 Reviewed by Anders Carlsson. * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm: (WebKit::textQuadsToBoundingRectForRange): 2014-05-19 Jeremy Jones PlatformCALayerRemoteCustom properties aren't initialized to match the PlatformLayer https://bugs.webkit.org/show_bug.cgi?id=133025 Reviewed by Simon Fraser. * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm: (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom): Initialize PlatformCALayerRemote properties from the PlatformLayer. 2014-05-19 Benjamin Poulain [iOS][WK2] When a page relayout on dynamic resize, keep the same relative width in view https://bugs.webkit.org/show_bug.cgi?id=133026 Reviewed by Simon Fraser. When a page does not relayout, we keep the same width in view. When a page relayout, we should keep the same relative width in view. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::isResponsiveDesignWithContentLargerThanLayout): (WebKit::WebPage::dynamicViewportSizeUpdate): 2014-05-19 Benjamin Poulain [WK2] Add some missing state reset on crash https://bugs.webkit.org/show_bug.cgi?id=133036 Reviewed by Sam Weinig. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::resetState): The missing reset for m_isTrackingTouchEvents would cause the WebPageProxy to send touch events when it shouldn't. That would only be for an active touch sequence. The missing reset m_lastVisibleContentRectUpdate would prevent pushing the new UI state to the new page on reload, that is very bad. Also moved m_videoFullscreenManager to be in the same order as initialization, and invalidate the callbacks for dictation. 2014-05-19 Benjamin Poulain [iOS][WK2] Move scale noise filtering to the WebProcess https://bugs.webkit.org/show_bug.cgi?id=133021 Reviewed by Darin Adler. Filtering in the UIProcess was stupid. It forces to handle a third kind of scale just for updates. The WebProcess already adjusts the input scale based on the viewport. Changing the input scale at that level is already supported. It is a better place to have the filtering. * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateVisibleContentRects): 2014-05-19 Simon Fraser Split scrolling tree ScrollingNodes into FrameScrollingNodes and OverflowScrollingNodes https://bugs.webkit.org/show_bug.cgi?id=133022 Reviewed by Sam Weinig. In both the scrolling state tree and the scrolling tree, split the "scrolling nodes" into FrameScrolling and OverflowScrolling nodes. Move what was the "viewportSize" property onto the base class for the scrolling nodes, calling it "scrollableAreaSize". Make minimum/maximumScrollPosition() virtual so we can share more code (and there is more code sharing to be done in future). * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder::encode): (ArgumentCoder::encode): (ArgumentCoder::encode): (ArgumentCoder::decode): (ArgumentCoder::decode): (ArgumentCoder::decode): (WebKit::encodeNodeAndDescendants): (WebKit::RemoteScrollingCoordinatorTransaction::decode): (WebKit::RemoteScrollingTreeTextStream::dump): * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): * UIProcess/Scrolling/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::createNode): * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollLayer): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterViewportChange): * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::ScrollingTreeOverflowScrollingNodeIOS): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateBeforeChildren): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll): * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): 2014-05-19 Alexey Proskuryakov [Mac] Fix a typo in plug-in sandbox https://bugs.webkit.org/show_bug.cgi?id=133074 Reviewed by Anders Carlsson. * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb: 2014-05-16 Andy Estes [WebKit2] Wake up threads blocked in waitForAndDispatchImmediately() if we lose our connection https://bugs.webkit.org/show_bug.cgi?id=133010 Reviewed by Geoffrey Garen. If a thread is blocked on m_waitForMessageCondition and we lose our connection, treat that like we do a timeout. * Platform/IPC/Connection.cpp: (IPC::Connection::Connection): (IPC::Connection::waitForMessage): (IPC::Connection::connectionDidClose): * Platform/IPC/Connection.h: 2014-05-19 Mark Rowe Build fix after r169023. * Shared/API/Cocoa/WebKitPrivate.h: Stop including headers that no longer exist. I hope for weinig's sake that no-one was relying on them. 2014-05-18 Anders Carlsson Relax an assertion when creating document loaders https://bugs.webkit.org/show_bug.cgi?id=133058 Reviewed by Sam Weinig. When navigating back/forward items recursively, createDocumentLoader will be called for subframes before main frames so only associate the navigation with main frames. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::createDocumentLoader): 2014-05-18 Zsolt Borbely CMake Buildfix after r169023. Reviewed by Csaba Osztrogonác. * CMakeLists.txt: Add new files after r168994. 2014-05-18 Sam Weinig [WebKit2] Implement ScriptMessageHandlers https://bugs.webkit.org/show_bug.cgi?id=133053 Reviewed by Anders Carlsson. * DerivedSources.make: * Scripts/webkit2/messages.py: (struct_or_class): (argument_coder_headers_for_type): (headers_for_type): * UIProcess/API/Cocoa/WKScriptMessage.mm: (-[WKScriptMessage _initWithBody:webView:name:]): (-[WKScriptMessage body]): (-[WKScriptMessage webView]): (-[WKScriptMessage name]): (-[WKScriptMessage _scriptWorld]): Deleted. * UIProcess/API/Cocoa/WKScriptMessageInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKScriptMessagePrivate.h. * UIProcess/API/Cocoa/WKScriptMessagePrivate.h: Removed. * UIProcess/API/Cocoa/WKUserContentController.mm: (-[WKUserContentController addScriptMessageHandler:name:]): (-[WKUserContentController removeScriptMessageHandlerForName:]): (-[WKUserContentController _addScriptMessageHandler:name:world:]): Deleted. (-[WKUserContentController _removeScriptMessageHandlerForName:world:]): Deleted. * UIProcess/API/Cocoa/WKUserContentControllerInternal.h: * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h: Removed. * UIProcess/API/Cocoa/WKWebView.mm: (pageToViewMap): (fromWebPageProxy): (-[WKWebView initWithFrame:configuration:]): (-[WKWebView dealloc]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/UserContent/WebScriptMessageHandler.cpp: Added. (WebKit::WebScriptMessageHandlerHandle::encode): (WebKit::WebScriptMessageHandlerHandle::decode): (WebKit::generateIdentifier): (WebKit::WebScriptMessageHandler::create): (WebKit::WebScriptMessageHandler::WebScriptMessageHandler): (WebKit::WebScriptMessageHandler::~WebScriptMessageHandler): * UIProcess/UserContent/WebScriptMessageHandler.h: Added. (WebKit::WebScriptMessageHandler::Client::~Client): (WebKit::WebScriptMessageHandler::handle): (WebKit::WebScriptMessageHandler::identifier): (WebKit::WebScriptMessageHandler::name): (WebKit::WebScriptMessageHandler::client): * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::addProcess): (WebKit::WebUserContentControllerProxy::removeProcess): (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler): (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName): (WebKit::WebUserContentControllerProxy::didPostMessage): * UIProcess/UserContent/WebUserContentControllerProxy.h: * UIProcess/UserContent/WebUserContentControllerProxy.messages.in: Added. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/UserContent/WebUserContentController.cpp: (WebKit::WebUserMessageHandlerDescriptorProxy::create): (WebKit::WebUserMessageHandlerDescriptorProxy::~WebUserMessageHandlerDescriptorProxy): (WebKit::WebUserMessageHandlerDescriptorProxy::didPostMessage): (WebKit::WebUserMessageHandlerDescriptorProxy::descriptor): (WebKit::WebUserMessageHandlerDescriptorProxy::identifier): (WebKit::WebUserMessageHandlerDescriptorProxy::WebUserMessageHandlerDescriptorProxy): (WebKit::WebUserContentController::addUserScriptMessageHandlers): (WebKit::WebUserContentController::removeUserScriptMessageHandler): * WebProcess/UserContent/WebUserContentController.h: * WebProcess/UserContent/WebUserContentController.messages.in: 2014-05-18 Rik Cabanier support for navigator.hardwareConcurrency https://bugs.webkit.org/show_bug.cgi?id=132588 Reviewed by Filip Pizlo. * Configurations/FeatureDefines.xcconfig: 2014-05-18 Anders Carlsson Implement Navigations for all methods declared returning one https://bugs.webkit.org/show_bug.cgi?id=133048 Reviewed by Sam Weinig. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView goToBackForwardListItem:]): (-[WKWebView goBack]): (-[WKWebView goForward]): (-[WKWebView reload]): (-[WKWebView reloadFromOrigin]): Create and return navigations. (-[WKWebView _reload]): Call -[WKWebView reload]. * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::createBackForwardNavigation): Create a back/forward navigation. (WebKit::NavigationState::createReloadNavigation): Create a reload navigation. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::reattachToWebProcessWithItem): Generate a navigation ID and send it with the GoToBackForwardItem message. (WebKit::WebPageProxy::reload): Return a navigation ID. (WebKit::WebPageProxy::goForward): Generate a navigation ID and send it with the GoForward message. (WebKit::WebPageProxy::goBack): Generate a navigation ID and send it with the GoBack message. (WebKit::WebPageProxy::goToBackForwardItem): Generate a navigation ID and send it with the GoToBackForwardItem message. * UIProcess/WebPageProxy.h: Return navigation IDs where appropriate. * UIProcess/cf/WebPageProxyCF.cpp: (WebKit::WebPageProxy::restoreFromSessionStateData): Generate a navigation ID and send it with the RestoreSessionAndNavigateToCurrentItem message. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::goForward): (WebKit::WebPage::goBack): (WebKit::WebPage::goToBackForwardItem): Set up the pending navigation ID. (WebKit::WebPage::restoreSessionAndNavigateToCurrentItem): Call goToBackForwardItem with a navigation ID. * WebProcess/WebPage/WebPage.h: Add navigation IDs. * WebProcess/WebPage/WebPage.messages.in: Add navigation IDs. 2014-05-18 Commit Queue Unreviewed, rolling out r169001. https://bugs.webkit.org/show_bug.cgi?id=133050 We can't expose the C SPI from WKWebView (Requested by andersca on #webkit). Reverted changeset: "Need a way to get a WKPageRef from a WKWebView" https://bugs.webkit.org/show_bug.cgi?id=133015 http://trac.webkit.org/changeset/169001 2014-05-18 Martin Hodovan [WK2][GTK] Buildfix after r168999. Reviewed by Csaba Osztrogonác. * UIProcess/gtk/WebContextGtk.cpp: (WebKit::WebContext::platformDefaultWebSQLDatabaseDirectory): Renamed from WebKit::WebContext::platformDefaultDatabaseDirectory(). (WebKit::WebContext::platformDefaultIndexedDBDatabaseDirectory): Added. 2014-05-18 Martin Hodovan [WK2][EFL] Buildfix after r168999. Reviewed by Csaba Osztrogonác. * UIProcess/efl/WebContextEfl.cpp: (WebKit::WebContext::platformDefaultWebSQLDatabaseDirectory): Renamed from WebKit::WebContext::platformDefaultDatabaseDirectory(). (WebKit::WebContext::platformDefaultIndexedDBDatabaseDirectory): Added. 2014-05-18 Martin Hodovan [WK2][cmake] Buildfix after r168994. Reviewed by Csaba Osztrogonác. * CMakeLists.txt: Added new files to the build system introduced in r168994. 2014-05-17 Alexey Proskuryakov REGRESSION (NetworkProcess): Trying to use appcache fallback crashes in ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache https://bugs.webkit.org/show_bug.cgi?id=133007 appcache tests often fail on the Mac WebKit2 bot https://bugs.webkit.org/show_bug.cgi?id=82061 Reviewed by Maciej Stachowiak. * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::willSendRequest): (WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo): (WebKit::WebResourceLoader::didFailResourceLoad): Perform the same appcache checks that ResourceHandleClient implementation in ResourceLoader does. We should eventually come up with a way to share the code. Perhaps add a class that isolates ResourceLoader from networking details? But ResourceLoader was itself supposed to be the class that isolates DocumentLoader from networking details. So, unsure. 2014-05-17 Jae Hyun Park [EFL] Remove m_contentPosition from PageViewportControllerClientEfl https://bugs.webkit.org/show_bug.cgi?id=132774 Reviewed by Anders Carlsson. m_contentPosition is not used anywhere. So, this patch removes m_contentPosition and reduces one unnecessary assignment in setViewportPosition. Also, it renames contentsPoint to contentsPosition. * UIProcess/PageViewportControllerClient.h: * UIProcess/efl/PageViewportControllerClientEfl.cpp: (WebKit::PageViewportControllerClientEfl::setViewportPosition): * UIProcess/efl/PageViewportControllerClientEfl.h: 2014-05-17 David Kilzer Need a way to get a WKPageRef from a WKWebView Reviewed by Benjamin Poulain. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _pageRef]): Added. * UIProcess/API/Cocoa/WKWebViewPrivate.h: (-[WKWebView _pageRef]): Added declaration. 2014-05-17 Anders Carlsson Give user scripts custom URLs https://bugs.webkit.org/show_bug.cgi?id=133035 Reviewed by Beth Dakin. * UIProcess/API/Cocoa/WKUserContentController.mm: (-[WKUserContentController addUserScript:]): Create a user-script: URL for user scripts. * UIProcess/API/Cocoa/WKUserScript.h: Move the init method after the properties. 2014-05-17 Anders Carlsson Replace WKContextSetDatabaseDirectory with two WKContextConfiguration parameters https://bugs.webkit.org/show_bug.cgi?id=133033 Reviewed by Sam Weinig. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: Rename databaseDirectory to webSQLDatabaseDirectory to better indicate the directory type. * UIProcess/API/C/WKContext.cpp: (WKContextSetDatabaseDirectory): Deleted. This is no longer needed. * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationCopyIndexedDBDatabaseDirectory): (WKContextConfigurationSetIndexedDBDatabaseDirectory): (WKContextConfigurationCopyWebSQLDatabaseDirectory): (WKContextConfigurationSetWebSQLDatabaseDirectory): * UIProcess/API/C/WKContextConfigurationRef.h: Add setters and getters. * UIProcess/API/C/WKContextPrivate.h: Remove WKContextSetDatabaseDirectory. * UIProcess/APIContextConfiguration.cpp: (API::ContextConfiguration::webContextConfiguration): Set m_indexedDBDatabaseDirectory and m_webSQLDatabaseDirectory on the configuration. * UIProcess/APIContextConfiguration.h: (API::ContextConfiguration::indexedDBDatabaseDirectory): (API::ContextConfiguration::setIndexedDBDatabaseDirectory): (API::ContextConfiguration::webSQLDatabaseDirectory): (API::ContextConfiguration::setWebSQLDatabaseDirectory): Add getters and setters to the C++ part of WKContextConfigurationRef. * UIProcess/WebContext.cpp: (WebKit::WebContext::applyPlatformSpecificConfigurationDefaults): Set webSQLDatabaseDirectory and indexedDBDatabaseDirectory. (WebKit::WebContext::WebContext): Initialize m_webSQLDatabaseDirectory and m_indexedDBDatabaseDirectory. (WebKit::WebContext::ensureDatabaseProcess): Set parameters.indexedDatabaseDirectory from m_indexedDBDatabaseDirectory. (WebKit::WebContext::createNewWebProcess): Set parameters.webSQLDatabaseDirectory from m_webSQLDatabaseDirectory. * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformDefaultWebSQLDatabaseDirectory): Rename this to indicate that it's about WebSQL databases. (WebKit::WebContext::platformDefaultIndexedDBDatabaseDirectory): Add this. * WebProcess/WebCoreSupport/WebDatabaseManager.cpp: (WebKit::WebDatabaseManager::initialize): Update for WebProcessCreationParameters rename. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): Update for WebProcessCreationParameters rename. 2014-05-17 Brent Fulgham [Phone Number Detection] drop-down menu in the phone number detection box doesn't appear. https://bugs.webkit.org/show_bug.cgi?id=133024 Reviewed by Sam Weinig. * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm: (WebKit::TelephoneNumberOverlayController::drawRect): Don't clear the set of found phone numbers each time we call drawRect. This gets called ~9 times per screen refresh, so end up with no active phone numbers to interact with. 2014-05-17 Alexey Proskuryakov NetworkProcess can repeatedly crash handling Blob messages after any unrelated crash https://bugs.webkit.org/show_bug.cgi?id=133032 Reviewed by Geoffrey Garen. Replaced assertions with runtime checks. This can happen if NetworkProcess previously crashed for any unrelated reason. * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: (WebKit::NetworkBlobRegistry::registerBlobURL): (WebKit::NetworkBlobRegistry::registerBlobURLForSlice): (WebKit::NetworkBlobRegistry::unregisterBlobURL): 2014-05-17 Anders Carlsson -[WKWebView dealloc] should close the page https://bugs.webkit.org/show_bug.cgi?id=133031 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView dealloc]): 2014-05-16 Anders Carlsson Expose WKUserScript as API https://bugs.webkit.org/show_bug.cgi?id=133017 Reviewed by Sam Weinig. * DerivedSources.make: Add WebUserContentController. * Shared/API/Cocoa/WebKit.h: Add WKUserScript.h * Shared/API/c/WKSharedAPICast.h: (WebKit::toUserScriptInjectionTime): Update for WKUserScriptInjectionTime -> _WKUserScriptInjectionTime rename. * Shared/API/c/WKUserScriptInjectionTime.h: Rename WKUserScriptInjectionTime to _WKUserScriptInjectionTime to free up the name for the Objective-C API * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): Encode the user content controller ID. (WebKit::WebPageCreationParameters::decode): Decode the user content controller ID. * Shared/WebPageCreationParameters.h: Add userContentControllerID. * UIProcess/API/C/WKPageGroup.cpp: (WKPageGroupAddUserScript): Update for WKUserScriptInjectionTime -> _WKUserScriptInjectionTime rename. * UIProcess/API/C/WKPageGroup.h: Update for WKUserScriptInjectionTime -> _WKUserScriptInjectionTime rename. * UIProcess/API/Cocoa/WKBrowsingContextGroup.h: Update for WKUserScriptInjectionTime -> _WKUserScriptInjectionTime rename. * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm: (-[WKBrowsingContextGroup addUserScript:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:injectionTime:mainFrameOnly:]): Update for WKUserScriptInjectionTime -> _WKUserScriptInjectionTime rename. * UIProcess/API/Cocoa/WKUserContentController.h: Add new methods. * UIProcess/API/Cocoa/WKUserContentController.mm: (-[WKUserContentController init]): Create the WebUserContentControllerProxy object and user scripts array. (-[WKUserContentController userScripts]): Return the user scripts array. (toWebCoreUserScriptInjectionTime): Helper for converting from a WKUserScriptInjectionTime enum to WebCore::UserScriptInjectionTime. (-[WKUserContentController addUserScript:]): Call through to the _userContentControllerProxy object. (-[WKUserContentController removeAllUserScripts]): Call through to the _userContentControllerProxy object. * UIProcess/API/Cocoa/WKUserContentControllerInternal.h: Added. Add WebUserContentControllerProxy ivar. * UIProcess/API/Cocoa/WKUserScript.h: Added. Add new header. * UIProcess/API/Cocoa/WKUserScript.mm: (-[WKUserScript initWithSource:injectionTime:forMainFrameOnly:]): Initialize the WKUserScript object. (-[WKUserScript source]): (-[WKUserScript injectionTime]): (-[WKUserScript isForMainFrameOnly]): Add getters. (-[WKUserScript copyWithZone:]): Since WKUserScript is immutable, just return a retained object. * UIProcess/API/Cocoa/WKUserScriptInternal.h: Add ivars. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): Set the user content controller from the configuration. * UIProcess/UserContent/WebUserContentControllerProxy.cpp: Added. (WebKit::generateIdentifier): Return a unique identifier. (WebKit::WebUserContentControllerProxy::create): Return a new WebUserContentControllerProxy object. (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy): Initialize m_identifier. (WebKit::WebUserContentControllerProxy::~WebUserContentControllerProxy): Add destructor. (WebKit::WebUserContentControllerProxy::addProcess): Add the process to the m_processes set. If it's the first time doing so, add the user scripts we know about. (WebKit::WebUserContentControllerProxy::removeProcess): Remove the process from m_processes. (WebKit::WebUserContentControllerProxy::addUserScript): Add the user script and let all the web processes know that it was added. (WebKit::WebUserContentControllerProxy::removeAllUserScripts): Remove all user scripts and tell all the web processes about it. * UIProcess/UserContent/WebUserContentControllerProxy.h: Add new class. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): If the process is already running, add it to the user content controller. (WebKit::WebPageProxy::close): If the process is running, remove it from the user content controller. (WebKit::WebPageProxy::connectionWillOpen): Add the process to the user content controller. (WebKit::WebPageProxy::resetStateAfterProcessExited): Remove the process from the user content controller. (WebKit::WebPageProxy::creationParameters): Pass along the user content controller ID when creating the web page. * UIProcess/WebPageProxy.h: Add a WebUserContentControllerProxy object to the web page configuration. * WebKit2.xcodeproj/project.pbxproj: Add new files. * WebProcess/InjectedBundle/API/c/WKBundle.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: Update for WKUserScriptInjectionTime -> _WKUserScriptInjectionTime rename. * WebProcess/UserContent/WebUserContentController.cpp: Added. New class that manages a WebCore::UserContentController object. (WebKit::WebUserContentController::getOrCreate): Look up (or create) a WebUserContentController object given its identifier. (WebKit::WebUserContentController::WebUserContentController): Add ourselves as a message receiver. (WebKit::WebUserContentController::~WebUserContentController): Remove ourselves as a message receiver. (WebKit::WebUserContentController::addUserScripts): Add all passed in user scripts to the WebCore user content controller object. (WebKit::WebUserContentController::removeAllUserScripts): Remove all user scripts from the WebCore user content controller object. * WebProcess/UserContent/WebUserContentController.messages.in: Added. Add new messages file. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): Get a WebUserContentController object and pass it along to WebCore. * WebProcess/WebPage/WebPage.h: Add WebUserContentController member. 2014-05-16 Piotr Grad [GTK] Build break after 168978. https://bugs.webkit.org/show_bug.cgi?id=133012. Reviewed by Simon Fraser. * UIProcess/API/gtk/WebKitSettings.cpp: (webKitSettingsConstructed): 2014-05-16 Simon Fraser Put back a symbol removed in r168978 that Safari needs, but deprecate it. Reviewed by Anders Carlsson. * Shared/API/c/WKDeprecatedFunctions.cpp: (WKPreferencesSetRegionBasedColumnsEnabled): (WKPreferencesGetRegionBasedColumnsEnabled): 2014-05-16 Oliver Hunt Separate enabling sandbox extensions from the WEB_PROCESS_SANDBOX flag https://bugs.webkit.org/show_bug.cgi?id=133016 Reviewed by Alexey Proskuryakov. Add a distinct SANDBOX_EXTENSIONS flag to guard sandbox extensions and switch over to it in the places that extensions are used. * Shared/SandboxExtension.h: * Shared/mac/SandboxExtensionMac.mm: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didChooseFilesForOpenPanel): * WebKit2Prefix.h: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2014-05-16 Benjamin Poulain [iOS][WK2] Add a heuristic to set the right horizontal offset on rotation for responsive websites https://bugs.webkit.org/show_bug.cgi?id=132937 Reviewed by Simon Fraser. When responsive websites have the content size lay out larger than the minimal layout size, we should not keep the relative horizontal position into view, many of those websites have all the content on the left. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): 2014-05-16 Benjamin Poulain [iOS][WK2] On dynamic resize, the content offset is contrained to the old content size https://bugs.webkit.org/show_bug.cgi?id=132972 Reviewed by Simon Fraser. When we set the content offset, UIScrollView limits the value to the current valid range for content size. Since the content size was only updated after the animation, when the first frame comes in, the content offset would sometimes be limited to a smaller rect that the actual content. To fix this, set the expected future content size before changing the offset. During the animation, the content size could have changed arbitrarily. At the end of the animation, we take the actual frame and set the definite content size. Any update after that will be regular updates through didCommitLayer. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _endAnimatedResize]): 2014-05-16 Simon Fraser Remove "region-based columns" prefs https://bugs.webkit.org/show_bug.cgi?id=133006 Reviewed by Dave Hyatt. Remove "region-based columns" prefs and related code, since this is only way to render columns now. * Shared/WebPreferencesStore.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetRegionBasedColumnsEnabled): Deleted. (WKPreferencesGetRegionBasedColumnsEnabled): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2014-05-16 Brent Fulgham Work around bug in Silverlight https://bugs.webkit.org/show_bug.cgi?id=133004 Reviewed by Anders Carlsson. * PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm: (WebKit::PluginProcessMainDelegate::doPreInitializationWork): Add low-resolution flag to user defaults prior to NSApplication invocation. This code was moved from PluginProcess::platformInitializeProcess. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::platformInitializeProcess): Move low-resolution flag setting to PluginProcessMainDelegate. 2014-05-16 Martin Hodovan [WK2] Change the remaining framework includes from WebKit2 to WebKit https://bugs.webkit.org/show_bug.cgi?id=132956 Reviewed by Sam Weinig. * NetworkProcess/unix/NetworkProcessMainUnix.cpp: * NetworkProcess/unix/NetworkProcessMainUnix.h: * PluginProcess/unix/PluginProcessMainUnix.h: * Shared/API/c/cairo/WKImageCairo.h: * Shared/API/c/cf/WKURLRequestCF.h: * Shared/API/c/cf/WKURLResponseCF.h: * Shared/API/c/efl/WKArrayEfl.cpp: * Shared/API/c/efl/WKArrayEfl.h: * UIProcess/API/C/CoordinatedGraphics/WKView.h: * UIProcess/API/C/WKBatteryManager.h: * UIProcess/API/C/WKBatteryStatus.h: * UIProcess/API/C/WKGrammarDetail.h: * UIProcess/API/C/WKTextChecker.h: * UIProcess/API/C/WKVibration.h: * UIProcess/API/C/WKViewportAttributes.h: * UIProcess/API/C/cairo/WKIconDatabaseCairo.h: * UIProcess/API/C/efl/WKAPICastEfl.h: * UIProcess/API/C/efl/WKColorPickerResultListener.h: * UIProcess/API/C/efl/WKEventEfl.h: * UIProcess/API/C/efl/WKPageEfl.h: * UIProcess/API/C/efl/WKPopupItem.h: * UIProcess/API/C/efl/WKPopupMenuListener.h: * UIProcess/API/C/efl/WKViewEfl.cpp: * UIProcess/API/C/efl/WKViewEfl.h: * UIProcess/API/C/gtk/WKFullScreenClientGtk.h: * UIProcess/API/C/gtk/WKInspectorClientGtk.h: * UIProcess/API/C/gtk/WKView.h: * UIProcess/API/C/gtk/WKViewPrivate.h: * UIProcess/API/C/soup/WKContextSoup.h: * UIProcess/API/C/soup/WKCookieManagerSoup.h: * UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h: * UIProcess/API/C/soup/WKSoupRequestManager.h: * UIProcess/API/Cocoa/WKErrorRecoveryAttempting.h: * UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.h: * UIProcess/API/cpp/efl/WKEinaSharedString.cpp: * UIProcess/API/cpp/efl/WKEinaSharedString.h: * UIProcess/API/efl/EwkView.cpp: * UIProcess/API/efl/EwkView.h: * UIProcess/API/efl/EwkViewCallbacks.h: * UIProcess/API/efl/GestureRecognizer.h: * UIProcess/API/efl/ewk_application_cache_manager_private.h: * UIProcess/API/efl/ewk_auth_request_private.h: * UIProcess/API/efl/ewk_back_forward_list_item_private.h: * UIProcess/API/efl/ewk_back_forward_list_private.h: * UIProcess/API/efl/ewk_context_menu_item.cpp: * UIProcess/API/efl/ewk_context_private.h: * UIProcess/API/efl/ewk_cookie_manager_private.h: * UIProcess/API/efl/ewk_database_manager_private.h: * UIProcess/API/efl/ewk_error_private.h: * UIProcess/API/efl/ewk_favicon_database_private.h: * UIProcess/API/efl/ewk_file_chooser_request_private.h: * UIProcess/API/efl/ewk_page_group_private.h: * UIProcess/API/efl/ewk_popup_menu_item_private.h: * UIProcess/API/efl/ewk_popup_menu_private.h: * UIProcess/API/efl/ewk_security_origin_private.h: * UIProcess/API/efl/ewk_settings_private.h: * UIProcess/API/efl/ewk_storage_manager_private.h: * UIProcess/API/efl/ewk_view.cpp: * UIProcess/API/efl/ewk_view_private.h: * UIProcess/API/efl/ewk_window_features_private.h: * UIProcess/API/efl/tests/InjectedBundle/injected_bundle_sample.cpp: * UIProcess/API/efl/tests/test_ewk2_eina_shared_string.cpp: * UIProcess/API/gtk/WebKitDownloadClient.cpp: * UIProcess/API/gtk/WebKitPrivate.h: * UIProcess/CoordinatedGraphics/WKCoordinatedSceneAPICast.h: * UIProcess/efl/BatteryProvider.h: * UIProcess/efl/ContextHistoryClientEfl.h: * UIProcess/efl/DownloadManagerEfl.h: * UIProcess/efl/FindClientEfl.h: * UIProcess/efl/FormClientEfl.h: * UIProcess/efl/PageLoadClientEfl.h: * UIProcess/efl/PagePolicyClientEfl.h: * UIProcess/efl/PageUIClientEfl.h: * UIProcess/efl/RequestManagerClientEfl.h: * UIProcess/efl/TextCheckerClientEfl.h: * UIProcess/efl/VibrationClientEfl.h: * UIProcess/efl/ViewClientEfl.cpp: * UIProcess/efl/ViewClientEfl.h: * UIProcess/efl/WebInspectorProxyEfl.cpp: * WebProcess/WebCoreSupport/efl/WebErrorsEfl.cpp: * WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp: * WebProcess/efl/SeccompFiltersWebProcessEfl.cpp: * WebProcess/efl/SeccompFiltersWebProcessEfl.h: * WebProcess/efl/WebProcessMainEfl.cpp: * WebProcess/efl/WebProcessMainEfl.h: * WebProcess/gtk/WebGtkInjectedBundleMain.cpp: * WebProcess/gtk/WebProcessMainGtk.cpp: * WebProcess/gtk/WebProcessMainGtk.h: * mac/WKPreferences.h: 2014-05-15 Gyuyoung Kim [EFL][WK2] Skip failing unit tests https://bugs.webkit.org/show_bug.cgi?id=132979 Reviewed by Daniel Bates. * PlatformEfl.cmake: Skip failing unit tests for now. 2014-05-15 Simon Fraser [iOS WK2] When zoomed, fixed elements jump at the start of a scroll, and jump back at the end. https://bugs.webkit.org/show_bug.cgi?id=132978 Reviewed by Benjamin Poulain. Move the static function fixedPositionRectFromExposedRect() to a member function on WebPageProxy so we can call it from more places. Also never give WebCore a customFixedPosition rect that extends past the document bounds, but allow rubber-banding/pinching in the UI process to move fixed elements outside the document. * UIProcess/PageClient.h: Need to expose minimumZoomScale() and contentsSize() to WebPageProxy. * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::minimumZoomScale): (WebKit::PageClientImpl::contentsSize): * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): Pass the computeCustomFixedPositionRect(ConstrainedToDocumentRect) to WebCore, but use computeCustomFixedPositionRect() for the ScrollingCoordinator update. (adjustedUnexposedEdge): Deleted. (adjustedUnexposedMaxEdge): Deleted. (fixedPositionRectFromExposedRect): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::adjustedUnexposedEdge): (WebKit::adjustedUnexposedMaxEdge): (WebKit::WebPageProxy::computeCustomFixedPositionRect): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): This fixes some flashing when the scrolling tree was being updated while scrolling; we now pass the correct rect. 2014-05-15 Mark Rowe Move discovery of sharing services off the main thread Discovery of sharing services can require disk access and IPC. Since the interface to ServicesController is already asynchronous, we can easily perform the discovery on a background queue. This can eliminate tens to hundreds of milliseconds worth of work from the main thread when creating the first web process. Reviewed by Brady Eidson. * UIProcess/mac/ServicesController.h: * UIProcess/mac/ServicesController.mm: (WebKit::ServicesController::ServicesController): (WebKit::ServicesController::refreshExistingServices): Bail out early if we're already in the process of refreshing the services. Kick the discovery over to a background queue, with it hopping back to the main queue to update the actual state and notify any contexts that were interested. 2014-05-15 Dan Bernstein Fixed a typo in a comment and updated previous change log entry. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::elementDidFocus): 2014-05-15 Dan Bernstein [iOS] www.wikipedia.org is loading much slower due to FormClient::willBeginInputSession https://bugs.webkit.org/show_bug.cgi?id=132974 Reviewed by Enrica Casucci. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::elementDidFocus): Don’t call FormClient::willBeginInputSession if the focus isn’t user-initiated, because in that case the UI process will bail out of -_startAssistingNode:userIsInteracting:userObject: before creating an input session and calling the -_webView:didStartInputSession:. 2014-05-15 Benjamin Poulain [iOS][WK2] WKWebView sends invalid content offsets at the end of animated resize https://bugs.webkit.org/show_bug.cgi?id=132941 Reviewed by Tim Horton. Since we cannot change the scale and content inset simultaneously while accounting for the obscured insets, we end up with invalid contentOffsets. To work around the problem, change the content scale outside of UIScrollView to ensure none of the side effect happens. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _endAnimatedResize]): 2014-05-15 Tim Horton WebKit2 View Gestures (Zoom): Document size changes during zoom gesture cause erratic scrolling https://bugs.webkit.org/show_bug.cgi?id=132944 Reviewed by Simon Fraser. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::flushLayers): If a layer flush occurs and we have an active transient zoom, re-apply the transient zoom to the relevant platform layers, because WebCore might have overwritten the relevant layer properties. (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage): Reset m_transientZoomScale before flushLayers() so that we don't re-apply the transient zoom when we're actually trying to commit it. 2014-05-15 Alex Christensen Add pointer lock to features without enabling it. https://bugs.webkit.org/show_bug.cgi?id=132961 Reviewed by Sam Weinig. * Configurations/FeatureDefines.xcconfig: Added ENABLE_POINTER_LOCK to list of features. 2014-05-15 Simon Fraser [UI-side compositing] Fix copying animations between layers, and pausing them https://bugs.webkit.org/show_bug.cgi?id=132943 Reviewed by Tim Horton. Fix PlatformCAAnimationRemote to support animation copying, and to record the beginTime for implicitly started animations. This fixes animation pausing, and copying of animations between layers when they go between tiled and non-tiled. This requires sending the animation key back through animationDidStart() so that we can record this beginTime on the PlatformCAAnimationRemote in the web process. This path doesn't set the "hasExplicitBeginTime" flag. PlatformCAAnimationRemote also now stores a hash of active animations, so that it can implement animationForKey(), and record the beginTime. * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart): * UIProcess/mac/RemoteLayerTreeHost.h: * UIProcess/mac/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::animationDidStart): Grovel for the key for this animation; sadly CA doesn't give us an easier way. * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::acceleratedAnimationDidStart): * WebProcess/WebPage/DrawingArea.messages.in: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: (-[WKAnimationDelegate animationDidStart:]): (WebKit::PlatformCAAnimationRemote::copy): (WebKit::PlatformCAAnimationRemote::copyTimingFunctionFrom): (WebKit::PlatformCAAnimationRemote::copyFromValueFrom): (WebKit::PlatformCAAnimationRemote::copyToValueFrom): (WebKit::PlatformCAAnimationRemote::copyValuesFrom): (WebKit::PlatformCAAnimationRemote::copyKeyTimesFrom): (WebKit::PlatformCAAnimationRemote::copyTimingFunctionsFrom): (WebKit::addAnimationToLayer): * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::addAnimationForKey): (WebKit::PlatformCALayerRemote::removeAnimationForKey): (WebKit::PlatformCALayerRemote::animationForKey): (WebKit::PlatformCALayerRemote::animationStarted): * WebProcess/WebPage/mac/PlatformCALayerRemote.h: * WebProcess/WebPage/mac/RemoteLayerTreeContext.h: * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm: (WebKit::RemoteLayerTreeContext::animationDidStart): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::acceleratedAnimationDidStart): 2014-05-14 Simon Fraser Clean up "has non-zero begin time" terminology in animations https://bugs.webkit.org/show_bug.cgi?id=132942 Reviewed by Tim Horton. Change the "non-zero beginTime" terminology in the platform CA animations code to "explicit beginTime": this flag really means that we explicitly set the beginTime of the animation, rather than let CA set the beginTime when committing the animation. This flag is used for animations with negative delay, and when pausing. * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTextStream::operator<<): * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: (-[WKAnimationDelegate animationDidStart:]): (WebKit::PlatformCAAnimationRemote::Properties::encode): (WebKit::PlatformCAAnimationRemote::Properties::decode): (WebKit::PlatformCAAnimationRemote::setBeginTime): (WebKit::addAnimationToLayer): 2014-05-15 Tim Horton [iOS] Incremental updates during scroll-to-top shouldn’t count as “stable” updates https://bugs.webkit.org/show_bug.cgi?id=132934 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _updateVisibleContentRects]): If we're in a scroll-to-top programmatic scroll, the update is not stable. The last event comes in with _isScrollingToTop false, so we do our stable update. 2014-05-15 Carlos Garcia Campos [GTK] Compile all installed resources as GResources https://bugs.webkit.org/show_bug.cgi?id=131099 Reviewed by Philippe Normand. It avoids conflicts with old WebKit versions, and resources are always found even without installing or using environment variables. * PlatformGTK.cmake: Add rules to write the xml file with the resources depending on the configure options and to generate and build the GResources file. 2014-05-14 Gyuyoung Kim [EFL][WK2] Fix an unit test of ewk_context_url_scheme_register() https://bugs.webkit.org/show_bug.cgi?id=132902 Reviewed by Anders Carlsson. This test can be run when CUSTOM_PROTOCOL is enabled. Besides the test needs to check if registered callback function works well. * UIProcess/API/efl/tests/test_ewk2_context.cpp: (EWK2ContextTest::schemeRequestCallback): (TEST_F): 2014-05-14 Ryuan Choi [EFL][WK2] Use default context for ewk_view_add https://bugs.webkit.org/show_bug.cgi?id=132936 Reviewed by Gyuyoung Kim. Since r146265, ewk_view_add created new context and it's regression. This patch restores the behavior of ewk_view_add to original one. * UIProcess/API/efl/ewk_view.cpp: (ewk_view_add): * UIProcess/API/efl/tests/test_ewk2_view.cpp: (TEST_F): 2014-05-14 Maciej Stachowiak Database Process crashes after loading html5test.com https://bugs.webkit.org/show_bug.cgi?id=132938 Reviewed by Ryosuke Niwa. * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: (WebKit::DatabaseProcessIDBConnection::disconnectedFromWebProcess): Expand comment about the null check. (WebKit::DatabaseProcessIDBConnection::deleteDatabase): Call disconnectedFromWebProcess to pick up its null check and to avoid duplicating code. 2014-05-14 Benjamin Poulain [iOS][WK2] The top/bottom edges should not be sticky when restoring the scroll position from the dynamic size update history https://bugs.webkit.org/show_bug.cgi?id=132931 Reviewed by Sam Weinig. The goal of dynamicSizeUpdateHistory is to make dynamic resize completely reversible. Because of the stick-to-edges heuristics, this was not true near the top and bottom edges. For example, start in landscape, scroll the page a bit, then rotate to portrait. Now you have a lot more vertical space, and the top edge of the document is at the edge of the scrollview. Rotate back to landscape: the position is restored correct, but it is then overriden by the stick-to-edges branch. When we restore the position from history, we should only put it back in the valid bounds, skipping stick-to-edges entirely. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): 2014-05-14 Tim Horton Enable IOSurface view snapshots for 10.9+ https://bugs.webkit.org/show_bug.cgi?id=132932 Reviewed by Dean Jackson. * UIProcess/mac/ViewSnapshotStore.h: r166005 unintentionally worked around . r168689 fixed another bug that caused sometimes randomly white snapshots. It's safe to turn on IOSurface view snapshots where purgeability is supported. 2014-05-14 Alexey Proskuryakov Use the correct client in WebPageProxy::unwrapCryptoKey https://bugs.webkit.org/show_bug.cgi?id=132924 Reviewed by Darin Adler. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::unwrapCryptoKey): Match what we now do in wrapCryptoKey(). 2014-05-14 Zalan Bujtas Subpixel layout: Change Element.offset* client* scroll* return type to double. https://bugs.webkit.org/show_bug.cgi?id=132895 Reviewed by Simon Fraser. This patch changes Element.offset*, Element.client* and Element.scroll* APIs return type from long to double to match the latest CSSOM View Module spec[1]. Element.offset* and Element.client* do return subpixel values from now on. Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet. subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off from WK2 preferences. It toggles the return value from subpixel to floored integral. It does not change layout/rendering behavior. Reference list of what other browsers do: IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx Blink: http://www.chromestatus.com/features/5497402177880064 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607 [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/ * Shared/WebPreferencesStore.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetSubpixelCSSOMElementMetricsEnabled): (WKPreferencesGetSubpixelCSSOMElementMetricsEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2014-05-14 Benjamin Poulain [iOS][WK2] Expose the viewport meta tag width on the UIProcess https://bugs.webkit.org/show_bug.cgi?id=132926 Reviewed by Sam Weinig. Safari requires the viewport meta tag width for legacy stuff on WebApps. Just send it over to the UIProcess when it changes. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): (-[WKWebView _setViewportMetaTagWidth:]): (-[WKWebView _viewportMetaTagWidth]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didChangeViewportMetaTagWidth): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::viewportMetaTagWidthDidChange): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::viewportPropertiesDidChange): 2014-05-13 Simon Fraser [iOS WK2] Make view debugging easier https://bugs.webkit.org/show_bug.cgi?id=132892 Reviewed by Tim Horton. Enhance -[WKCompositingView description] to show WebKit-related information which is useful when dumping a window's UIView hierarchy. Also have WKTransformView and WKRemoteView inherit from WKCompositingView, and thereby get the hitTest:withEvent: override for free, as well as better dumping. * UIProcess/ios/RemoteLayerTreeHostIOS.mm: (-[WKCompositingView description]): (-[WKTransformView hitTest:withEvent:]): Deleted. (-[WKRemoteView hitTest:withEvent:]): Deleted. 2014-05-14 Benjamin Poulain [iOS][WK2] Fixed positioned element must relayout correctly before sending resize events to the page https://bugs.webkit.org/show_bug.cgi?id=132920 Reviewed by Simon Fraser. During the dynamic resize operation, we do not update the fixed position elements because it is a very hard problem on the UI Process side. When the animation finishes, the fixed positioned rect is recomputed on the UIProcess and pushed to the WebProcess. The problem is sending the rect after the animation is too late, the content can observe the fixed elements layout through JavaScript and would get the old size. This patch fixes the issue updating the CustomFixedPositionLayoutRect on the WebProcess before notifying the content of the resize. First, we layout the content to the new fixed layout size to get the new content size. Then, we compute the new FixedPositionedLayoutRect with FrameView's viewportConstrainedObjectsRect(), this use the real content size and our estimated unobscured content rect. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): 2014-05-14 Enrica Casucci REGRESSION(WK2): Many pages have very wrong text size after rotating. https://bugs.webkit.org/show_bug.cgi?id=132893 Reviewed by Benjamin Poulain. Whenever our viewport width changes we must reset text autosizing on the renderer. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize): (WebKit::WebPage::setMinimumLayoutSizeForMinimalUI): (WebKit::WebPage::resetTextAutosizingBeforeLayoutIfNeeded): (WebKit::WebPage::dynamicViewportSizeUpdate): 2014-05-14 Alex Christensen Use references instead of pointers with ResourceLoadTiming. https://bugs.webkit.org/show_bug.cgi?id=132846 Reviewed by Alexey Proskuryakov. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Use references instead of pointers and null checks. 2014-05-14 Tibor Meszaros Remove CSS_STICKY_POSITION guards https://bugs.webkit.org/show_bug.cgi?id=132676 Reviewed by Simon Fraser. * Configurations/FeatureDefines.xcconfig: 2014-05-13 Gyuyoung Kim [EFL][WK2] Add ewk_view_fixed_layout_size_set|get() https://bugs.webkit.org/show_bug.cgi?id=132811 Reviewed by Christophe Dumez. Some EFL applications need to set size of fixed layout when enabling fixed layout. This APIs can pass ownership regarding the size of fixed layout to application side. * UIProcess/API/efl/ewk_view.cpp: (ewk_view_layout_fixed_size_set): (ewk_view_layout_fixed_size_get): * UIProcess/API/efl/ewk_view.h: * UIProcess/API/efl/tests/test_ewk2_view.cpp: (TEST_F): 2014-05-13 Simon Fraser Fix "ASSERTION FAILED: m_representation == PlatformLayerRepresentation" with UI-side compositing https://bugs.webkit.org/show_bug.cgi?id=132899 Reviewed by Beth Dakin. The new InsetClipLayer and ContentShadowLayer members on scrolling nodes need to be correctly encoded/decoded for UI-side compositing, and dumped correctly. * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder::encode): (ArgumentCoder::decode): (WebKit::RemoteScrollingTreeTextStream::dump): * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): 2014-05-13 Anders Carlsson Another build fix. Reviewed by Dan Bernstein. * Shared/API/Cocoa/WKFoundation.h: Make sure to include Availability.h 2014-05-13 Beth Dakin REGRESSION (topContentInset): Searching through Facebook Messenger's chat causes scrolling in News Feed https://bugs.webkit.org/show_bug.cgi?id=132889 -and corresponding- Reviewed by Simon Fraser. Re-name scrollOffsetRelativeToDocument() to documentScrollPositionRelativeToViewOrigin(). * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::rectsForTextMatches): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::determinePrimarySnapshottedPlugIn): 2014-05-13 Dean Jackson [iOS] Page scale update messages for media controls should only fire at the end of zooming https://bugs.webkit.org/show_bug.cgi?id=132857 Reviewed by Simon Fraser. As the user was zooming, the media controls that responded to the page scale (and resized themselves) would do so slightly out of sync with the screen refreshes, and it looked terrible. We already know if a pageScale change is happening inside a gesture using the inStableState property of the visibleContentRectUpdateInfo. Simply pass this along to WebCore::Page. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateVisibleContentRects): Pass inStableState onto the WebCore::Page. Note that we have to send this message even if the scale has not changed, since the last changing update might not have been stable. 2014-05-13 Benjamin Poulain [iOS][WK2] When the secondary UIScrollView delegates respond to callbacks, delay the state change until both delegates have finished https://bugs.webkit.org/show_bug.cgi?id=132849 Reviewed by Anders Carlsson. When there are two delegates responding to UIScrollView changes, there was often an intermediate invalid state forwarded to the UIProcess. For example, on scroll, WKWebView would update the state based on the current obscured insets in response to delegate callbacks. After that update, Safari would modify the insets, thus updating the state again. The first state changed by WKWebView is incomplete, and should never have been set. This patch works around the issue by delaying visible update rect in those cases. When the two delegates of WKScrollView respond to the same selector, WKScrollView invokes [UIWebView _willInvokeUIScrollViewDelegateCallback] on entry, and [UIWebView _didInvokeUIScrollViewDelegateCallback] on exit. Between those two calls, WKWebView does not forward the new UI state to the WebProcess. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _willInvokeUIScrollViewDelegateCallback]): (-[WKWebView _didInvokeUIScrollViewDelegateCallback]): (-[WKWebView _updateVisibleContentRects]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/ios/WKViewIOS.mm: (-[WKView _commonInitializationWithContextRef:pageGroupRef:relatedToPage:]): * UIProcess/ios/WKScrollView.h: * UIProcess/ios/WKScrollView.mm: (-[WKScrollViewDelegateForwarder initWithInternalDelegate:externalDelegate:]): (-[WKScrollViewDelegateForwarder forwardInvocation:]): (-[WKScrollView setInternalDelegate:]): 2014-05-13 Benjamin Poulain [iOS][WK2] Remove the _extendedBackgroundExclusionInsets SPI https://bugs.webkit.org/show_bug.cgi?id=132848 Reviewed by Darin Adler. The SPI is no longer needed by Safari. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): (-[WKWebView _updateScrollViewBackground]): (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _setObscuredInsets:]): (-[WKWebView _endAnimatedResize]): (updateTopAndBottomExtendedBackgroundExclusionIfNecessary): Deleted. (-[WKWebView _setExtendedBackgroundExclusionInsets:]): Deleted. (-[WKWebView _extendedBackgroundExclusionInsets]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2014-05-13 Samuel White AX: Hit testing not accounting for top content inset. https://bugs.webkit.org/show_bug.cgi?id=132876 Reviewed by Chris Fleizach. Updated accessibilityHitTest: to account for top content inset when converting from screen coords to WebKit coords. * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: (-[WKAccessibilityWebPageObject accessibilityHitTest:]): 2014-05-13 Enrica Casucci REGRESSION (WebKit2): Zooming to text field leaves it partially hidden by the form assistant. https://bugs.webkit.org/show_bug.cgi?id=132879 Reviewed by Benjamin Poulain. Adds the heuristics to zoom and scroll to ensure the element being focused is fully visible and its text readable. * Shared/AssistedNodeInformation.cpp: (WebKit::AssistedNodeInformation::encode): (WebKit::AssistedNodeInformation::decode): * Shared/AssistedNodeInformation.h: (WebKit::AssistedNodeInformation::AssistedNodeInformation): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _zoomToFocusRect:WebCore::selectionRect:WebCore::fontSize:minimumScale:maximumScale:allowUserScaling:forceScroll:]): (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowUserScaling:forceScroll:]): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _displayFormNodeInputView]): (-[WKContentView _startAssistingNode:userIsInteracting:userObject:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getAssistedNodeInformation): 2014-05-13 Simon Fraser Fix the iOS Simulator build. * UIProcess/mac/ViewSnapshotStore.h: 2014-05-13 Tim Horton Speculative build fix for iOS. * UIProcess/ios/WebMemoryPressureHandlerIOS.cpp: Removed. * UIProcess/ios/WebMemoryPressureHandlerIOS.mm: Added. (WebKit::WebMemoryPressureHandler::shared): (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler): * WebKit2.xcodeproj/project.pbxproj: Make WebMemoryPressureHandlerIOS Obj-C. 2014-05-13 Anders Carlsson Another follow-up build fix. * Shared/API/Cocoa/WKFoundation.h: 2014-05-13 Anders Carlsson Another follow-up build fix. * Shared/API/Cocoa/WKFoundation.h: 2014-05-13 Anders Carlsson Follow-up fix. * UIProcess/API/Cocoa/WKNavigationAction.mm: (-[WKNavigationAction _initWithNavigationActionData:WebKit::]): (-[WKNavigationAction _isUserInitiated]): 2014-05-13 Anders Carlsson Add -[WKNavigationAction modifierFlags] and -[WKNavigationAction buttonNumber] https://bugs.webkit.org/show_bug.cgi?id=132880 Reviewed by Dan Bernstein. * Shared/API/Cocoa/WKFoundation.h: Add typedef for older systems. * UIProcess/API/Cocoa/WKNavigationAction.h: Add -[WKNavigationAction modifierFlags] and -[WKNavigationAction buttonNumber] * UIProcess/API/Cocoa/WKNavigationAction.mm: (toWKNavigationType): This can be static now. (toNSEventModifierFlags): Helper to convert WebEvent::Modifiers to NSEventModifierFlags. (toNSButtonNumber): Helper to convert WebMouseEvent::Button to an AppKit button number. (-[WKNavigationAction initWithNavigationActionData:WebKit::]): New initializer that takes a NavigationActionData and fills in the relevant ivars from it. (-[WKNavigationAction _isUserInitiated]): Return the new ivar. * UIProcess/API/Cocoa/WKNavigationActionInternal.h: Remove readwrite overrides. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction): Use initWithNavigationActionData: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::createNewPage): Use initWithNavigationActionData: 2014-05-13 Tim Horton WebKit2 View Gestures (Swipe): Encode snapshots as JPEG on some platforms https://bugs.webkit.org/show_bug.cgi?id=127788 Reviewed by Anders Carlsson. Allow JPEG snapshots. Compression is done asynchronously. Enable JPEG snapshots (for now) on all PLATFORM(MAC). We'll switch back to IOSurface snapshots on 10.9+ after is resolved. * UIProcess/API/Cocoa/WKWebView.mm: * UIProcess/API/mac/WKView.mm: (-[WKView _takeViewSnapshot]): Store the image size on the ViewSnapshot. Move IOSurface-related code to ViewSnapshotStore. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): Adopt asLayerContents(). * UIProcess/mac/ViewGestureController.h: * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::retrieveSnapshotForItem): (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::removeSwipeSnapshot): Adopt asLayerContents(). Put the snapshot on the right layer (the parent of the snapshot image layer); if it's on the snapshot image layer itself, if there is no image, the shadow is displayed on top of the white placeholder. Only reset snapshot purgeability if we're using IOSurface snapshots. * UIProcess/mac/ViewSnapshotStore.h: Add a bunch of macros to allow us to switch the snapshot backing store implementation. * UIProcess/mac/ViewSnapshotStore.mm: (WebKit::ViewSnapshotStore::ViewSnapshotStore): (WebKit::ViewSnapshotStore::~ViewSnapshotStore): (WebKit::ViewSnapshotStore::recordSnapshot): If takeViewSnapshot() fails, don't remove the existing snapshot. (WebKit::createIOSurfaceFromImage): (WebKit::compressImageAsJPEG): (WebKit::ViewSnapshotStore::reduceSnapshotMemoryCost): (WebKit::ViewSnapshotStore::didCompressSnapshot): (WebKit::ViewSnapshot::clearImage): (WebKit::ViewSnapshot::asLayerContents): Asynchronously compress snapshots - if we're using JPEG snapshots - for a very large memory win (~20-30x). 2014-05-12 Darin Adler Make a few icon database improvements https://bugs.webkit.org/show_bug.cgi?id=132812 Reviewed by Brady Eidson. * UIProcess/API/C/WKIconDatabase.cpp: (WKIconDatabaseCopyIconDataForPageURL): Moved the actual implementation of this out of the bindings into the WebIconDatabase class. * UIProcess/API/C/WKIconDatabase.h: Fixed argument names that were inconsistent. * UIProcess/WebIconDatabase.cpp: Removed unneeded includes. (WebKit::WebIconDatabase::create): Pass a reference instead of a pointer. (WebKit::WebIconDatabase::WebIconDatabase): Take a reference instead of a pointer. (WebKit::WebIconDatabase::invalidate): Use nullptr. (WebKit::WebIconDatabase::setDatabasePath): Use make_unique. (WebKit::WebIconDatabase::setIconDataForIconURL): Removed unneeded local variable. (WebKit::WebIconDatabase::imageForPageURL): Use nullptr. (WebKit::WebIconDatabase::nativeImageForPageURL): Ditto. (WebKit::WebIconDatabase::didFinishURLImport): Use a modern for loop. (WebKit::WebIconDatabase::iconDataForPageURL): Added. Moved this here from WKIconDatabase.cpp, but also changed to use createWithoutCopying to avoid making another copy of the data for each icon. * UIProcess/WebIconDatabase.h: Removed unneeded includes. Derive from IconDatabaseClient privately. Use nullptr. Added iconDataForPageURL member function. Use a reference for the constructor argument. Use override for virtual functions. Use unique_ptr instead of OwnPtr. 2014-05-12 Mark Lam WebKit2 on iOS needs to capture the main thread's floating point environment. Reviewed by Geoffrey Garen. * Shared/mac/ChildProcessMac.mm: (WebKit::ChildProcess::platformInitialize): - Call FloatingPointEnv::enableNeededFloatingPointModes() to initialize the ARMv7 FP env to support denormalized numbers. - Call FloatingPointEnv::saveMainThreadEnvironment() to capture the main thread fp env. 2014-05-12 Gyuyoung Kim [EFL][WK2] Fix ewk_view_navigation test in EWK2ViewTest https://bugs.webkit.org/show_bug.cgi?id=132817 Reviewed by Dirk Schulze. To load test html pages, call ewk_view_uri_set() instead of EWK2UnitTestServer. Besides this patch adds test html page for ewk_view_navigation unit test. * UIProcess/API/efl/tests/resources/Page1.html: Added. * UIProcess/API/efl/tests/resources/Page2.html: Added. * UIProcess/API/efl/tests/resources/Page3.html: Added. * UIProcess/API/efl/tests/test_ewk2_view.cpp: (TEST_F): 2014-05-12 Gyuyoung Kim Unreviewed, EFL build fix since r168625. * UIProcess/efl/WebContextEfl.cpp: (WebKit::WebContext::platformDefaultLocalStorageDirectory): Remove const keyword. 2014-05-12 Simon Fraser [iOS WK2] Fuzzy tiles on some sites on loading https://bugs.webkit.org/show_bug.cgi?id=132847 Reviewed by Benjamin Poulain. PlatformCALayerRemoteTiledBacking overrode setContentsScale() but not contentsScale(), causing us to early-return from GraphicsLayerCA::updateContentsScale() and leave the scale wrong. Fix by overriding contentsScale() also. * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp: (WebKit::PlatformCALayerRemoteTiledBacking::contentsScale): * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h: 2014-05-12 Tim Horton Triple-buffer RemoteLayerBackingStore https://bugs.webkit.org/show_bug.cgi?id=132786 Reviewed by Simon Fraser. We need three buffers because we're currently unable to synchronize with the render server to swap when they're not in use, so we were throwing surfaces away far too frequently. This hugely reduces time spent in IOSurface::create on various repaint benchmarks. * Shared/mac/RemoteLayerBackingStore.h: (WebKit::RemoteLayerBackingStore::hasFrontBuffer): (WebKit::RemoteLayerBackingStore::volatility): Deleted. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::RemoteLayerBackingStore): (WebKit::RemoteLayerBackingStore::clearBackingStore): (WebKit::RemoteLayerBackingStore::encode): (WebKit::RemoteLayerBackingStore::decode): (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer): (WebKit::RemoteLayerBackingStore::display): (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer): (WebKit::RemoteLayerBackingStore::setBufferVolatility): (WebKit::RemoteLayerBackingStore::Buffer::discard): (WebKit::RemoteLayerBackingStore::setVolatility): Deleted. * Shared/mac/RemoteLayerBackingStoreCollection.mm: (WebKit::RemoteLayerBackingStoreCollection::purgeabilityTimerFired): Put the ShareableBitmap/IOSurface and a volatility bit in a Buffer struct. Also factor out "throw away this buffer and put it in the pool" into Buffer::discard(). We keep a volatility bit because querying IOSurface purgeability is expensive, and we have a guarantee that any changes will happen in the Web process and go through this class (the lack of this guarantee in most cases is why I'm not putting this bit in WebCore::IOSurface itself). Make it so that each buffer's volatility can be adjusted individually by setBufferVolatility(), and adopt in RemoteLayerBackingStoreCollection. Add a third buffer, m_secondaryBackBuffer, which will swap with the back buffer before swapping front and back if the back buffer (soon to be the front buffer) is still in use by the render server. This means that we will almost never have to throw away a surface because it's in use (and conversely never need to make a new surface). Adjust RemoteLayerBackingStoreCollection to make secondary back surfaces purgeable more aggressively than others. 2014-05-12 Alexey Proskuryakov REGRESSION (r165972): Can't type into text fields in Flash https://bugs.webkit.org/show_bug.cgi?id=132840 Reviewed by Anders Carlsson. * UIProcess/API/mac/WKView.mm: (-[WKView inputContext]): Restore a function that got accidentally lost when adding async text input code. 2014-05-12 Chris Fleizach AX: .js dialogs shown in unload while AX is running crash WebKit. https://bugs.webkit.org/show_bug.cgi?id=123828 Reviewed by Anders Carlsson. Utilize platform API to inform AX clients when the WebProcess will suspend and resume. This allows us to avoid having special behavior for accessibility when the WebProcess needs to wait on a reply. * Platform/IPC/Connection.cpp: (IPC::Connection::waitForSyncReply): * Platform/IPC/Connection.h: * Platform/IPC/mac/ConnectionMac.cpp: (IPC::Connection::willSendSyncMessage): (IPC::Connection::didReceiveSyncReply): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel): (WebKit::WebChromeClient::runJavaScriptAlert): (WebKit::WebChromeClient::runJavaScriptConfirm): (WebKit::WebChromeClient::runJavaScriptPrompt): (WebKit::WebChromeClient::print): (WebKit::WebChromeClient::exceededDatabaseQuota): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): 2014-05-12 Alex Christensen Progress on web timing. https://bugs.webkit.org/show_bug.cgi?id=132574 Reviewed by Alexey Proskuryakov. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Transfer ResourceLoadTiming values if they exist. 2014-05-12 Dan Bernstein [Cocoa] Expose WebPage::usesEphemeralSession to the bundle https://bugs.webkit.org/show_bug.cgi?id=132836 Reviewed by Anders Carlsson. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _usesNonPersistentWebsiteDataStore]): * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h: 2014-05-12 Carlos Alberto Lopez Perez REGRESSION(168625): [GTK] build broken due to WKContextSetLocalStorageDirectory https://bugs.webkit.org/show_bug.cgi?id=132831 Unreviewed GTK build fix. * UIProcess/gtk/WebContextGtk.cpp: (WebKit::WebContext::platformDefaultLocalStorageDirectory): This is now a static member function. 2014-05-12 Anders Carlsson WKWebViewConfiguration should fill in the blanks https://bugs.webkit.org/show_bug.cgi?id=132832 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration _validate]): * UIProcess/API/Cocoa/WKWebViewConfigurationInternal.h: 2014-05-12 Anders Carlsson WKWebView should default to _backgroundExtendsBeyondPage = YES https://bugs.webkit.org/show_bug.cgi?id=132829 Reviewed by Beth Dakin. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): 2014-05-12 Anders Carlsson Pass local storage directory to StorageManager::create https://bugs.webkit.org/show_bug.cgi?id=132827 Reviewed by Tim Horton. Since we know the local storage directory at creation time and we know it never changes, we can get rid of setLocalStorageDirectory and just pass the local storage directory at creation time. * UIProcess/Storage/LocalStorageDatabaseTracker.cpp: (WebKit::LocalStorageDatabaseTracker::create): (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker): (WebKit::LocalStorageDatabaseTracker::~LocalStorageDatabaseTracker): (WebKit::LocalStorageDatabaseTracker::setLocalStorageDirectory): Deleted. (WebKit::LocalStorageDatabaseTracker::setLocalStorageDirectoryInternal): Deleted. * UIProcess/Storage/LocalStorageDatabaseTracker.h: * UIProcess/Storage/StorageManager.cpp: (WebKit::StorageManager::create): (WebKit::StorageManager::StorageManager): (WebKit::StorageManager::setLocalStorageDirectory): Deleted. * UIProcess/Storage/StorageManager.h: * UIProcess/WebContext.cpp: (WebKit::WebContext::WebContext): 2014-05-11 Anders Carlsson Replace WKContextSetLocalStorageDirectory with a context configuration getter/setter https://bugs.webkit.org/show_bug.cgi?id=132809 Reviewed by Dan Bernstein. * UIProcess/API/C/WKContext.cpp: (WKContextSetLocalStorageDirectory): Deleted. * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationCopyLocalStorageDirectory): (WKContextConfigurationSetLocalStorageDirectory): * UIProcess/API/C/WKContextConfigurationRef.h: Add getters and setters for the local storage directory. * UIProcess/API/C/WKContextPrivate.h: Remove WKContextSetLocalStorageDirectory. * UIProcess/API/Cocoa/WKProcessGroup.mm: (-[WKProcessGroup initWithInjectedBundleURL:]): Call WebContext::applyPlatformSpecificConfigurationDefaults. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _initWithConfiguration:]): Call WebContext::applyPlatformSpecificConfigurationDefaults (for now). * UIProcess/APIContextConfiguration.cpp: (API::ContextConfiguration::webContextConfiguration): Set the local storage. Also, call WebContext::applyPlatformSpecificConfigurationDefaults. * UIProcess/APIContextConfiguration.h: (API::ContextConfiguration::injectedBundlePath): This should be const. (API::ContextConfiguration::localStorageDirectory): (API::ContextConfiguration::setLocalStorageDirectory): Add getter and setter. * UIProcess/Storage/StorageManager.cpp: (WebKit::StorageManager::setLocalStorageDirectory): ASSERT that the path isn't null. * UIProcess/WebContext.cpp: (WebKit::WebContext::applyPlatformSpecificConfigurationDefaults): New helper function that will fill in platform specific defaults for empty parameters. (WebKit::WebContext::WebContext): Get the local storage directory from the configuration. (WebKit::WebContext::setLocalStorageDirectory): Deleted. (WebKit::WebContext::localStorageDirectory): Deleted. These are no longer needed. * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformDefaultLocalStorageDirectory): This should be a static member function. 2014-05-12 Martin Hodovan Typo fix in generate-forwarding-headers https://bugs.webkit.org/show_bug.cgi?id=132820 Reviewed by Anders Carlsson. * Scripts/generate-forwarding-headers.pl: (collectFrameworkHeaderPaths): 2014-05-12 Peter Molnar [EFL] TLSErrors do not cause page load to fail when not ignored https://bugs.webkit.org/show_bug.cgi?id=131104 Reviewed by Gyuyoung Kim. Added EFL unit test for the bug https://bugs.webkit.org/show_bug.cgi?id=121548 * UIProcess/API/efl/tests/test_ewk2_ssl.cpp: Added new test: ewk_ssl_bad_cert_redirect_https_to_http 2014-05-11 Gordon Sheridan Expose a function to copy favicon data without image conversion. https://bugs.webkit.org/show_bug.cgi?id=132805 Reviewed by Darin Adler. * UIProcess/API/C/WKIconDatabase.cpp: (WKIconDatabaseCopyIconDataForPageURL): Add a function to copy the data from the image of a favicon for an associated page url. * UIProcess/API/C/WKIconDatabase.h: Declare WKIconDatabaseCopyIconDataForPageURL. 2014-05-11 Seongjun Kim REGRESSION(r168603): [GTK] Build broken. https://bugs.webkit.org/show_bug.cgi?id=132810 Reviewed by Carlos Garcia Campos. * UIProcess/API/gtk/WebKitWebContext.cpp: (createDefaultWebContext): Construct a WebContextConfiguration object and pass it to WebContext::create. 2014-05-11 Anders Carlsson Remove local storage directory and sandbox extension from WebProcessCreationParameters https://bugs.webkit.org/show_bug.cgi?id=132808 Reviewed by Beth Dakin. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/WebContext.cpp: (WebKit::WebContext::createNewWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2014-05-11 Jaehun Lim Unreviewed, CMake build fix after r168603 Add APIContextConfiguration.cpp and WKContextConfigurationRef.cpp to the source list. * CMakeLists.txt: 2014-05-11 Anders Carlsson Add a WKContextConfigurationRef object and make the injected bundle path part of the configuration https://bugs.webkit.org/show_bug.cgi?id=132806 Reviewed by Beth Dakin. Many setters on WKContextRef really only make sense to set early on, so move to a pattern where we create a configuration object, a WKContextConfiguration which WKContexts can be created from. Add the injected bundle path as a configuration property. More setters will follow. * Shared/API/c/WKBase.h: Add WKContextConfigurationRef. * Shared/APIObject.h: Add ContextConfiguration enum declaration. * UIProcess/API/C/WKAPICast.h: Handle WKContextConfigurationRef. * UIProcess/API/C/WKContext.cpp: (WKContextCreate): Create an empty WKContextConfigurationRef object and pass it to WKContextCreateWithConfiguration. (WKContextCreateWithInjectedBundlePath): Create a WKContextConfigurationRef object, set its bundle path and pass the configuration to WKContextCreateWithConfiguration. (WKContextCreateWithConfiguration): Convert the WKContextConfigurationRef object to a WebContextConfiguration and pass it to WebContext::create. * UIProcess/API/C/WKContext.h: Add WKContextCreateWithConfiguration. * UIProcess/API/C/WKContextConfigurationRef.cpp: Added. (WKContextConfigurationCreate): Create an API::ContextConfiguration object. (WKContextConfigurationCopyInjectedBundlePath): Return the injected bundle path. (WKContextConfigurationSetInjectedBundlePath): Set the injected bundle path. * UIProcess/API/C/WKContextConfigurationRef.h: Added. New C SPI header. * UIProcess/API/Cocoa/WKProcessGroup.mm: (-[WKProcessGroup initWithInjectedBundleURL:]): Construct a WebContextConfiguration object and pass it to WebContext::Create. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _initWithConfiguration:]): Construct a WebContextConfiguration object and pass it to WebContext::Create. * UIProcess/APIContextConfiguration.cpp: Added. New API::ContextConfiguration object. (API::ContextConfiguration::webContextConfiguration): Construct a WebContextConfiguration struct from our current configuration. * UIProcess/APIContextConfiguration.h: Added. * UIProcess/WebContext.cpp: (WebKit::WebContext::create): Pass the WebContextConfiguration to the constructor. (WebKit::WebContext::WebContext): Set the injected bundle path from the WebContextConfiguration object. * UIProcess/WebContext.h: Change the WebContext constructor and create function to take a WebContextConfiguration object. * WebKit2.xcodeproj/project.pbxproj: Add new files. 2014-05-10 Csaba Osztrogonác [WK2] URTBF after r168585. * Platform/IPC/Connection.h: * Shared/ChildProcessProxy.cpp: (WebKit::ChildProcessProxy::terminate): 2014-05-10 Tim Horton [WKWebView _updateScrollViewBackground] churns UI-and-CGColors while repainting https://bugs.webkit.org/show_bug.cgi?id=132793 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _updateScrollViewBackground]): Don't bypass the cache and make a copy of the CGColor just to set its alpha. Cache the last color and don't bother creating a UIColor nor updating the color on our views if it hasn't changed. 2014-05-10 Tim Horton Implement -forwardingTargetForSelector on WKScrollViewDelegateForwarder https://bugs.webkit.org/show_bug.cgi?id=132790 Reviewed by Dan Bernstein. * UIProcess/ios/WKScrollView.mm: (-[WKScrollViewDelegateForwarder forwardingTargetForSelector:]): If only one of the delegates will respond to a selector, we can return it from forwardingTargetForSelector: to avoid NSInvocation overhead. 2014-05-10 Dan Bernstein [Mac] Some targets that link or soft-link WebKit.framework don't depend on it https://bugs.webkit.org/show_bug.cgi?id=132776 Reviewed by Darin Adler. * WebKit2.xcodeproj/project.pbxproj: 2014-05-10 Ryuan Choi [EFL][WK2] Move the ownership of EwkSettings from EwkView to EwkPageGroup https://bugs.webkit.org/show_bug.cgi?id=132771 Reviewed by Gyuyoung Kim. Moved ownership of EwkSettings from EwkView to EwkPageGroup. * UIProcess/API/efl/EwkView.cpp: (EwkView::EwkView): * UIProcess/API/efl/EwkView.h: (EwkView::settings): Deleted. * UIProcess/API/efl/ewk_page_group.cpp: (EwkPageGroup::EwkPageGroup): * UIProcess/API/efl/ewk_page_group_private.h: (EwkPageGroup::settings): * UIProcess/API/efl/ewk_settings_private.h: * UIProcess/API/efl/ewk_view.cpp: (ewk_view_settings_get): 2014-05-10 Tim Horton [iOS WebKit2] REGRESSION (r168493): Canvasmark 2013 benchmark always hits the RELEASE_ASSERT in RemoteLayerTreeDrawingArea::flushLayers() https://bugs.webkit.org/show_bug.cgi?id=132783 Reviewed by Anders Carlsson. * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush): There's a race window between the BackingStoreFlusher sending the new layer tree to the UI process and updating m_hasFlushed where we can get a reply back in (on the Web process main thread) from the UI process that we committed the new layer tree (didUpdate). This will cause the RELEASE_ASSERT in flushLayers() to fire incorrectly. Since the RELEASE_ASSERT is there only to avoid painting garbage, move our code to set m_hasFlushed=true to after we finish calling CGContextFlush on all of the contexts, instead of after we send the layer tree commit message, which will remove the race entirely. 2014-05-10 Anders Carlsson ASSERTION FAILED: !m_connection under RunJavaScriptAlert https://bugs.webkit.org/show_bug.cgi?id=132792 Reviewed by Dan Bernstein. Detect if someone implementing a UI delegate method with a completion handler never calls the completion handler and raise an exception instead of asserting. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::CompletionHandlerCallChecker::create): (WebKit::CompletionHandlerCallChecker::~CompletionHandlerCallChecker): (WebKit::CompletionHandlerCallChecker::didCallCompletionHandler): (WebKit::CompletionHandlerCallChecker::CompletionHandlerCallChecker): (WebKit::CompletionHandlerCallChecker::classImplementingDelegateMethod): (WebKit::UIDelegate::UIClient::runJavaScriptAlert): (WebKit::UIDelegate::UIClient::runJavaScriptConfirm): (WebKit::UIDelegate::UIClient::runJavaScriptPrompt): 2014-05-10 Anders Carlsson Use xpc_connection_kill for killing child processes where appropriate https://bugs.webkit.org/show_bug.cgi?id=132788 Reviewed by Sam Weinig. * Platform/IPC/Connection.h: * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::kill): * Platform/IPC/mac/XPCPtr.h: (IPC::XPCPtr::operator bool): * Shared/ChildProcessProxy.cpp: (WebKit::ChildProcessProxy::terminate): 2014-05-10 Anders Carlsson WebKit2 is leaking an xpc_connection per web process it creates https://bugs.webkit.org/show_bug.cgi?id=132785 Reviewed by Sam Weinig. Introduce an IPC::XPCPtr smart pointer class and use it for XPC connections inside Connection::Identifier and Connection itself. Make sure we always adopt any connections that are created. * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm: (DatabaseServiceInitializer): * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm: (WebKit::NetworkServiceInitializerDelegate::NetworkServiceInitializerDelegate): (NetworkServiceInitializer): * Platform/IPC/Connection.h: (IPC::Connection::Identifier::Identifier): (IPC::Connection::xpcConnection): * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::platformInvalidate): (IPC::Connection::platformInitialize): (IPC::Connection::getAuditToken): * Platform/IPC/mac/XPCPtr.h: Added. (IPC::XPCPtr::XPCPtr): (IPC::XPCPtr::~XPCPtr): (IPC::XPCPtr::get): (IPC::XPCPtr::operator!): (IPC::XPCPtr::operator=): (IPC::adoptXPC): * PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm: (WebKit::PluginServiceInitializerDelegate::PluginServiceInitializerDelegate): (PluginServiceInitializer): * Shared/EntryPointUtilities/mac/LegacyProcess/ChildProcessMain.mm: (WebKit::BootstrapMain): * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h: (WebKit::XPCServiceInitializerDelegate::XPCServiceInitializerDelegate): (WebKit::XPCServiceInitializer): * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm: (WebKit::XPCServiceInitializerDelegate::hasEntitlement): (WebKit::XPCServiceInitializerDelegate::isClientSandboxed): * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm: (WebKit::XPCServiceEventHandler): * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm: (WebKit::XPCServiceEventHandler): * UIProcess/Launcher/ProcessLauncher.cpp: (WebKit::ProcessLauncher::didFinishLaunchingProcess): * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::connectToService): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm: (WebContentServiceInitializer): 2014-05-10 Anders Carlsson Simplify createDataAvailableSource https://bugs.webkit.org/show_bug.cgi?id=132782 Reviewed by Sam Weinig. * Platform/IPC/mac/ConnectionMac.mm: Renamed from Source/WebKit2/Platform/IPC/mac/ConnectionMac.cpp. Rename to make this Objective-C++ so we get the lambda-to-block conversion. (IPC::createDataAvailableSource): Make this a function template and just pass the function directly to dispatch_source_set_event_handler. (IPC::Connection::open): Use lambdas instead of WTF::bind, so we'll make sure the connection is kept alive. * WebKit2.xcodeproj/project.pbxproj: Update for ConnectionMac.cpp to ConnectionMac.mm rename. 2014-05-10 Anders Carlsson Follow-up fix. Reviewed by Darin Adler. * UIProcess/API/Cocoa/WKNavigationResponse.h: * UIProcess/API/Cocoa/WKNavigationResponse.mm: (-[WKNavigationResponse isForMainFrame]): Use a slightly better name. 2014-05-10 Anders Carlsson Make -[WKNavigationResponse frame] SPI and only expose -[WKNavigationResponse isMainFrame] https://bugs.webkit.org/show_bug.cgi?id=132781 Reviewed by Darin Adler. * UIProcess/API/Cocoa/WKNavigationResponse.h: * UIProcess/API/Cocoa/WKNavigationResponse.mm: (-[WKNavigationResponse description]): (-[WKNavigationResponse isMainFrameNavigation]): (-[WKNavigationResponse _frame]): (-[WKNavigationResponse frame]): Deleted. (-[WKNavigationResponse setFrame:]): Deleted. * UIProcess/API/Cocoa/WKNavigationResponseInternal.h: * UIProcess/API/Cocoa/WKNavigationResponsePrivate.h: Added. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::PolicyClient::decidePolicyForResponse): * WebKit2.xcodeproj/project.pbxproj: 2014-05-09 Dan Bernstein [Cocoa] Remove a deprecated bundle form delegate method now that no one implements it https://bugs.webkit.org/show_bug.cgi?id=132769 Reviewed by Sam Weinig. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): 2014-05-09 Benjamin Poulain [iOS][WK2] Fix bugs exposed by r168556 https://bugs.webkit.org/show_bug.cgi?id=132768 Reviewed by Ryosuke Niwa. Fix two bugs exposed by r168556. 1) We were only changing the page scale factor when the scale was not adjusted by live resize. The idea was that the scale would either be the same (responsive content) or that it would be defined by the next viewContentRectUpdate. Now that we also send resize and scroll events, we must always update the scale since it affects some APIs observable from JavaScript (like scrolling bounds). 2) Internally, Page's scaleFactor is stored as a float and not double. The rounding error were causing us to send DynamicViewportUpdateChangedTarget() in cases were there is no change of target. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::withinEpsilon): (WebKit::WebPage::dynamicViewportSizeUpdate): 2014-05-09 Ryuan Choi [EFL][WK2] Close icondatabase when EwkFaviconDatabase is destroyed https://bugs.webkit.org/show_bug.cgi?id=132767 Reviewed by Gyuyoung Kim. IconDatabase should be closed explicitly. * UIProcess/API/efl/ewk_favicon_database.cpp: (EwkFaviconDatabase::~EwkFaviconDatabase): 2014-05-09 Anders Carlsson Another build fix. * mac/MigrateHeadersToWebKit2.make: Don't migrate the WKPreferences.h header, WebKit2 provides its own header. 2014-05-09 Benjamin Poulain [iOS][WK2] Reset the scroll position on the first frame after didCommitLoad https://bugs.webkit.org/show_bug.cgi?id=132765 Reviewed by Tim Horton. Since WebCore does not update our scroll view on load, we need to do that ourself. In case where we need to restore the state from the history, RemoteLayerTreeDrawingAreaProxy will always invoke the scrolling after didCommitLayerTree() (since r167916). Consequently, it is now safe again to reset the scroll position ourself on the first frame. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLoadForMainFrame]): (-[WKWebView _didCommitLayerTree:WebKit::]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView _didCommitLoadForMainFrame]): 2014-05-09 Anders Carlsson Update availability macros https://bugs.webkit.org/show_bug.cgi?id=132763 Reviewed by Dan Bernstein. * Configurations/WebKit.xcconfig: * Shared/API/Cocoa/WKBrowsingContextHandle.h: * Shared/API/Cocoa/WKFoundation.h: * Shared/API/Cocoa/_WKFrameHandle.h: * Shared/API/Cocoa/_WKRemoteObjectInterface.h: * Shared/API/Cocoa/_WKRemoteObjectRegistry.h: * UIProcess/API/Cocoa/WKBackForwardList.h: * UIProcess/API/Cocoa/WKBackForwardListItem.h: * UIProcess/API/Cocoa/WKBackForwardListPrivate.h: * UIProcess/API/Cocoa/WKBrowsingContextController.h: * UIProcess/API/Cocoa/WKBrowsingContextGroup.h: * UIProcess/API/Cocoa/WKConnection.h: * UIProcess/API/Cocoa/WKFrameInfo.h: * UIProcess/API/Cocoa/WKNavigation.h: * UIProcess/API/Cocoa/WKNavigationAction.h: (NS_ENUM): * UIProcess/API/Cocoa/WKNavigationData.h: * UIProcess/API/Cocoa/WKNavigationDelegate.h: (NS_ENUM): * UIProcess/API/Cocoa/WKNavigationResponse.h: * UIProcess/API/Cocoa/WKPreferences.h: * UIProcess/API/Cocoa/WKProcessGroup.h: * UIProcess/API/Cocoa/WKProcessPool.h: * UIProcess/API/Cocoa/WKScriptMessage.h: * UIProcess/API/Cocoa/WKScriptMessageHandler.h: * UIProcess/API/Cocoa/WKTypeRefWrapper.h: * UIProcess/API/Cocoa/WKUIDelegate.h: * UIProcess/API/Cocoa/WKUserContentController.h: * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: (NS_OPTIONS): (NS_ENUM): * UIProcess/API/Cocoa/WKWindowFeatures.h: * UIProcess/API/Cocoa/_WKActivatedElementInfo.h: (NS_ENUM): * UIProcess/API/Cocoa/_WKDownload.h: * UIProcess/API/Cocoa/_WKElementAction.h: (NS_ENUM): * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKScriptWorld.h: * UIProcess/API/Cocoa/_WKThumbnailView.h: * UIProcess/API/Cocoa/_WKVisitedLinkProvider.h: * UIProcess/API/Cocoa/_WKWebsiteDataStore.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h: * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h: * WebProcess/InjectedBundle/API/mac/WKDOMElement.h: * WebProcess/InjectedBundle/API/mac/WKDOMNode.h: * WebProcess/InjectedBundle/API/mac/WKDOMRange.h: * WebProcess/InjectedBundle/API/mac/WKDOMText.h: * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.h: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h: * mac/rewrite-availability-macros.sh: Added. 2014-05-09 Joseph Pecoraro Web Inspector: Allow Remote Inspector to entitlement check UIProcess through WebProcess https://bugs.webkit.org/show_bug.cgi?id=132409 Reviewed by Timothy Hatcher. * WebProcess/WebCoreSupport/WebInspectorClient.h: * WebProcess/WebCoreSupport/WebInspectorClient.cpp: (WebKit::WebInspectorClient::parentProcessIdentifier): Deleted. pid per debuggable is no longer needed. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): Immediately pass the parent process pid and audit_token on to the RemoteInspector singleton when the process is created so that it can be sent to webinspectord. 2014-05-09 Enrica Casucci REGRESSION (WebKit2): Tapping in search field at wikipedia.org doesn’t bring up the keyboard. https://bugs.webkit.org/show_bug.cgi?id=132761 Reviewed by Benjamin Poulain. The interactionAssistant accessor should never create an instance of UIWKTextInteractionAssistant, but simply return the value of _textInteractionAssistant. The text interaction assistant should only be created when needed so that the rest of the code could reliably check if we are interacting with text or not. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView interactionAssistant]): 2014-05-09 Simon Fraser Fix some issues with scrolling tree logging https://bugs.webkit.org/show_bug.cgi?id=132762 Reviewed by Tim Horton. Only dump viewport constraints when they change, and dump the primary layer on scrolling nodes. * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: (WebKit::RemoteScrollingTreeTextStream::dump): Dump the primary layer. 2014-05-09 Simon Fraser [iOS WK2] Fixed elements can go outside the document on pinching https://bugs.webkit.org/show_bug.cgi?id=132759 Reviewed by Benjamin Poulain. Constrain the rect used to position fixed position objects when pinching (when the scale goes below the minimumScale). Do so in such a way that there's a smooth transition between rubber-banding and pinching. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _updateScrollViewBackground]): Use a nicer form for std::max<>. (-[WKWebView _updateVisibleContentRects]): Pass the minimum scale. * UIProcess/API/ios/WKViewIOS.mm: (-[WKView _updateVisibleContentRects]): Ditto. * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (adjustedUnexposedEdge): Helper to adjust the left/top. (adjustedUnexposedMaxEdge): Helper to adjust the right/bottom. (fixedPositionRectFromExposedRect): (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:minimumScale:inStableState:]): (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]): Deleted. 2014-05-09 Zalan Bujtas Subpixel rendering[iOS]: Top bar on apple.com/support jiggles when the swoosh animates. https://bugs.webkit.org/show_bug.cgi?id=132750 Reviewed by Simon Fraser. This patch ensures that GraphicsLayer and RemoteLayerBackingStore have the same dimensions. Remove integral enclosing when we set the size on RemoteLayerBackingStore. It makes the layer's size different from the backingstore when the passed value is fractional. We scale and integral round this value to size the shareable bitmap later. Rounding ensures that the final size value matches what we calculated at GraphicsLayerCA::updateGeometry() Currently not testable. * Shared/mac/RemoteLayerBackingStore.h: (WebKit::RemoteLayerBackingStore::size): * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::ensureBackingStore): (WebKit::RemoteLayerBackingStore::setNeedsDisplay): use enclosing here to ensure we cover the entire backing store. (WebKit::RemoteLayerBackingStore::display): (WebKit::RemoteLayerBackingStore::drawInContext): * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::updateBackingStore): 2014-05-09 Benjamin Poulain [iOS][WK2] Set up the resize events https://bugs.webkit.org/show_bug.cgi?id=132726 Reviewed by Darin Adler and Simon Fraser. Wire the UI Process updates to FrameView to send the resize events appropriately. * Shared/VisibleContentRectUpdateInfo.cpp: (WebKit::VisibleContentRectUpdateInfo::encode): (WebKit::VisibleContentRectUpdateInfo::decode): * Shared/VisibleContentRectUpdateInfo.h: (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): (WebKit::VisibleContentRectUpdateInfo::isChangingObscuredInsetsInteractively): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _updateVisibleContentRects]): * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:isChangingObscuredInsetsInteractively:]): (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]): Deleted. Pass down the status of the content insets with the view update to main frame's FrameView when needed. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): On live resize, send the resize event, then the scroll events (if needed). Since JavaScript now gets two chances to change the content (resize event + scroll event), we query the actual scroll offset and scale for the DynamicViewportUpdateChangedTarget. (WebKit::WebPage::viewportConfigurationChanged): Define the custom size on load before the app gets a chance to send different rects. If for some reason the app changes its mind about the insets, the content will be notified with a resize event. (WebKit::WebPage::updateVisibleContentRects): Send the resize event when the insets are stable. Also move the scroll event after the resize event for consistency with live resize. 2014-05-09 Benjamin Poulain [iOS] Switch geolocation to an explicit authorization query model https://bugs.webkit.org/show_bug.cgi?id=132717 Reviewed by Sam Weinig. Switch WKGeolocationProviderIOS to use the new API of WebGeolocationCoreLocationProvider. On WebKit2, the whole logic to track requesters is in WebGeolocationManagerProxy. Without the warmup sequence, WKGeolocationProviderIOS becomes really dumb: it just provides the two step authorization and forward the start/stop messages to the WebGeolocationCoreLocationProvider. * UIProcess/ios/WKGeolocationProviderIOS.mm: (-[WKGeolocationProviderIOS _stopUpdating]): (-[WKGeolocationProviderIOS decidePolicyForGeolocationRequestFromOrigin:frame:request:window:]): (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]): (-[WKGeolocationProviderIOS geolocationAuthorizationDenied]): (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]): (-[WKWebAllowDenyPolicyListener deny]): (-[WKGeolocationProviderIOS _stopUpdatingIfPossible]): Deleted. (-[WKGeolocationProviderIOS geolocationDelegateStarted]): Deleted. (-[WKGeolocationProviderIOS geolocationDelegateUnableToStart]): Deleted. (-[WKGeolocationProviderIOS permissionDenied:]): Deleted. (-[WKWebAllowDenyPolicyListener initWithProvider:permissionRequestProxy:]): Deleted. 2014-05-09 Gordon Sheridan Expose functions necessary for copying favicon between IconDatabases. https://bugs.webkit.org/show_bug.cgi?id=132709 Reviewed by Brady Eidson. * UIProcess/API/C/WKIconDatabase.cpp: (WKIconDatabaseSetIconURLForPageURL): Add C API wrapper for WebIconDatabase::setIconURLForPageURL(). (WKIconDatabaseCopyIconURLForPageURL): Add C API wrapper for WebIconDatabase::synchronousIconURLForPageURL(). * UIProcess/API/C/WKIconDatabase.h: Added declarations for wrapper functions above. 2014-05-09 Tim Horton Fix the iOS DRT build by including CG headers in WKPreferences.h, which uses CGFloat. * UIProcess/API/Cocoa/WKPreferences.h: 2014-05-09 Brent Fulgham {TelephoneNumber, Selection}ControllerMac implementations dosn't handle tiled drawing properly. https://bugs.webkit.org/show_bug.cgi?id=132746 Reviewed by Tim Horton. Don't try to draw the detector UI if no part of the selection bounds are inside the current tile. Don't limit the detector UI to the bounds of this tile, or else it will attempt to squeeze itself into the possibly small space available. Let it draw as if it had the whole screen, and rely on the context clip region to avoid overdrawing. * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm: (WebKit::TelephoneNumberOverlayController::drawRect): Correct tiled drawing behavior. * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm: (WebKit::SelectionOverlayController::drawRect): Ditto. 2014-05-09 Anders Carlsson Production build fix. Reviewed by Dan Bernstein. * Configurations/BaseTarget.xcconfig: Add SDKROOT in front of UMBRELLA_FRAMEWORKS_DIR for OS X Production builds. 2014-05-09 Tim Horton [iOS WebKit2] Flush RemoteLayerBackingStore contexts on a secondary queue https://bugs.webkit.org/show_bug.cgi?id=132667 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::create): Address a missed review comment about a missing std::move. 2014-05-09 Anders Carlsson Rename WebKit2.framework to WebKit.framework https://bugs.webkit.org/show_bug.cgi?id=132743 Reviewed by Dan Bernstein. * Configurations/BaseLegacyProcess.xcconfig: Change INSTALL_PATH to WebKit.framework. * Configurations/BaseTarget.xcconfig: Change WEBKIT2_FRAMEWORKS_DIR to WEBKIT_FRAMEWORKS_DIR and add WEBKIT_LEGACY_PRIVATE_HEADERS_DIR. * Configurations/BaseXPCService.xcconfig: Change WebKit2.framework to WebKit.framework. * Configurations/WebKit.xcconfig: Copied from Source/WebKit2/Configurations/WebKit2.xcconfig. New configuration file for WebKit.framework. Re-export WebKitLegacy.framework. * Configurations/WebKit2.xcconfig: New configuration file for the WebKit2 shim framework. Re-export WebKit.framework. * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist: Update DYLD_INSERT_LIBRARIES to refer to WebKit.framework. * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist: Update DYLD_INSERT_LIBRARIES to refer to WebKit.framework. * Shared/API/Cocoa/WKBrowsingContextHandle.h: * Shared/API/Cocoa/WKRenderingProgressEvents.h: Update header imports. * Shared/API/Cocoa/WebKit.h: Renamed from Source/WebKit/mac/WebKitLegacy/WebKit.h. New umbrella header. Imports the modern WebKit API as well as the legacy API. * Shared/API/Cocoa/WebKit.m: Renamed from Source/WebKit/mac/WebKitLegacy/WebKit.m. Export install name symbols on iOS. * Shared/API/Cocoa/WebKitPrivate.h: Renamed from Source/WebKit/mac/WebKitLegacy/WebKitPrivate.h. New umbrella SPI header. Imports the modern WebKit SPI. * Many headers: Change WebKit2 includes to WebKit includes. * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm: (WebKit::XPCServiceEventHandler): Change bundle identifiers from com.apple.WebKit2 to com.apple.WebKit. * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm: (WebKit::XPCServiceEventHandler): Change bundle identifier from com.apple.WebKit2 to com.apple.WebKit. * UIProcess/API/Cocoa/WKPreferences.h: Stop including WKPreferencesRef.h, we have a WebKit2 header that handles this workaround for us now. * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::addDYLDEnvironmentAdditions): (WebKit::connectToService): (WebKit::createProcess): (WebKit::ProcessLauncher::launchProcess): Change bundle identifiers from com.apple.WebKit2 to com.apple.WebKit. * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: (WebKit::PluginProcessProxy::createPropertyListFile): Change bundle identifiers from com.apple.WebKit2 to com.apple.WebKit. * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformDefaultDiskCacheDirectory): Change bundle identifier from com.apple.WebKit2 to com.apple.WebKit. * WebKit2.xcodeproj/project.pbxproj: Copy the python message scripts to the WebKit2 framework. Rename WebKit2.framework to WebKit.framework everywhere. Add a new WebKit2 target that builds the shim WebKit2 framework. Move the build script phase that migrates WebKitLegacy headers to WebKit. Add a new build script phase that adds forwarding headers from WebKit2 to WebKit. * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist: Update DYLD_INSERT_LIBRARIES to refer to WebKit.framework. * mac/MigrateHeadersFromWebKitLegacy.make: Renamed from Source/WebKit/mac/WebKitLegacy/MigrateHeadersFromWebKitLegacy.make. Move the makefile that migrates WebKitLegacy headers here. On OS X, it copies the header contents and on iOS it creates forarding headers. * mac/MigrateHeadersToWebKit2.make: New makefile that creates forwarding headers for the WebKit2 shim framework. * mac/WKPreferences.h: Added. Add WebKit2/WKPreferences.h header that imports WebKit2/WKPreferencesref.h. * mac/WebKit2.m: Skeleton for the WebKit2 shim framework. * mac/Info-WebKit2.plist: Added. New Info.plist file for the WebKit2 shim framework. 2014-05-09 Martin Hodovan [WK2] Make generate-forwarding-headers.pl work after WebKit2.framework -> WebKit.framework rename https://bugs.webkit.org/show_bug.cgi?id=132733 Reviewed by Csaba Osztrogonác. Rewrite framework's directory name to WebKit2 if the framework is WebKit (former WebKit2) and then collect headers inside the fixed framework directory and generate forwarding headers point to the fixed directory. Leave WebKit2 in @frameworks list during the transition. It can be removed once style includes were renamed to everywhere. * Scripts/generate-forwarding-headers.pl: (collectFameworkHeaderPaths): (createForwardingHeadersForFramework): 2014-05-08 Alexey Proskuryakov Automatically zip document bundles used via File API https://bugs.webkit.org/show_bug.cgi?id=132713 Reviewed by Anders Carlsson. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: NetworkProcess now uses FileCoordination (WebProcess already had this allowed). * Shared/BlobDataFileReferenceWithSandboxExtension.h: Added final to the class. 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