2014-11-24 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.7.2 release. * gtk/NEWS: Add release notes for 2.7.2. 2014-11-24 Krzysztof Czech [EFL] Utilize Eail library to support accessibility in EFL https://bugs.webkit.org/show_bug.cgi?id=137742 Reviewed by Gyuyoung Kim. Initialize EAIL module so that all the listeners and atk-bridge started properly. Dynamic loading of EAIL help us to avoid elementary dependencies in WebKit. * WebProcess/efl/WebProcessMainEfl.cpp: (eailLibraryPath): reads path provided by ACCESSIBILITY_EAIL_LIBRARY_PATH variable. (eail): 2014-11-24 Carlos Garcia Campos [GTK] WebKitWebView is created with the wrong web context when using webkit_web_view_new_with_related_view() https://bugs.webkit.org/show_bug.cgi?id=139023 Reviewed by Sergio Villar Senin. The WebKitWebContext is a construct only property, so it's always set to the default value when not provided, during the construction. When a related-view is used to create a new web view we should ensure that the same web context is used for the new web view, instead of the default. We should also ignore any web context given as construct parameter if a related view is alos provided. * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewConstructed): Do not set the context to the default one when not given during construction. (webkitWebViewSetProperty): Only use the default web context when not provided as construct parameter and there isn't a related view. 2014-11-23 Carlos Garcia Campos [GTK] Add API to override the default local storage directory https://bugs.webkit.org/show_bug.cgi?id=138828 Reviewed by Gustavo Noronha Silva. Add WebKitWebContext:local-storage-directory construct-only property. If not provided the default will be used. * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextGetProperty): (webkitWebContextSetProperty): (webkitWebContextConstructed): (webkit_web_context_class_init): 2014-11-23 Conrad Shultz Page previews should have titles https://bugs.webkit.org/show_bug.cgi?id=139020 Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKViewPrivate.h: Declare -_titleForPreviewOfURL:. * UIProcess/API/mac/WKView.mm: (-[WKView _titleForPreviewOfURL:]): Stub implementation. * UIProcess/mac/WKActionMenuController.mm: (+[WKPagePreviewViewController previewPadding]): Account for the title height. (-[WKPagePreviewViewController loadView]): Set correct autoresize masks on some views; create and configure a title view that is horizontally and vertically centered. (-[WKActionMenuController pagePreviewViewController:titleForPreviewOfURL:]): WKPagePreviewViewControllerDelegate method; wrap -[WKView _titleForPreviewOfURL:]. 2014-11-22 Simon Fraser Extend WKRenderObject and WKRenderLayer with some more useful data https://bugs.webkit.org/show_bug.cgi?id=139006 Reviewed by Sam Weinig. Implement WKRenderLayerGetBackingStoreMemoryEstimate, WKRenderObjectCopyTextSnippet and WKRenderObjectGetTextLength for improved RenderLayer and RenderTree display in clients of the C SPI. * Shared/API/c/WKRenderLayer.cpp: (WKRenderLayerGetBackingStoreMemoryEstimate): * Shared/API/c/WKRenderLayer.h: * Shared/API/c/WKRenderObject.cpp: (WKRenderObjectCopyTextSnippet): (WKRenderObjectGetTextLength): * Shared/API/c/WKRenderObject.h: * Shared/UserMessageCoders.h: (WebKit::UserMessageEncoder::baseEncode): (WebKit::UserMessageDecoder::baseDecode): * Shared/WebRenderLayer.cpp: (WebKit::WebRenderLayer::create): (WebKit::WebRenderLayer::WebRenderLayer): * Shared/WebRenderLayer.h: (WebKit::WebRenderLayer::backingStoreMemoryEstimate): * Shared/WebRenderObject.cpp: (WebKit::WebRenderObject::create): (WebKit::WebRenderObject::WebRenderObject): * Shared/WebRenderObject.h: (WebKit::WebRenderObject::textSnippet): (WebKit::WebRenderObject::textLength): 2014-11-21 Jer Noble Support multiple signatures of diagnostic logging. https://bugs.webkit.org/show_bug.cgi?id=138690 Reviewed by Anders Carlsson. Extend the existing WKBundlePageDiagnosticLoggingClient interface by deprecating the original logDiagnosticMessage client method in V1 and adding three new, explicit client methods. * CMakeLists.txt: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/API/c/WKBundlePageDiagnosticLoggingClient.h: * WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.cpp: (WebKit::InjectedBundlePageDiagnosticLoggingClient::logDiagnosticMessageDeprecated): Renamed from logDiagnosticMessage(). (WebKit::InjectedBundlePageDiagnosticLoggingClient::logDiagnosticMessage): Pass to the client. (WebKit::InjectedBundlePageDiagnosticLoggingClient::logDiagnosticMessageWithResult): Ditto. (WebKit::InjectedBundlePageDiagnosticLoggingClient::logDiagnosticMessageWithValue): Ditto. * WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.h: * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::logDiagnosticMessage): Deleted. * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp: Added. (WebKit::WebDiagnosticLoggingClient::WebDiagnosticLoggingClient): Simple constructor. (WebKit::WebDiagnosticLoggingClient::~WebDiagnosticLoggingClient): Simple destructor. (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessage): Pass to the injected bundle. (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithResult): Ditto. (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValue): Ditto. * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h: Added. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): Initialize the new client. 2014-11-21 Gyuyoung Kim Unreviewed, EFL build fix since r176459. r176459 removed Timer parameter in timer callbacks only for Mac port. So this patch applies it to remaining classes for EFL port. * UIProcess/API/efl/EwkView.cpp: (EwkView::EwkView): (EwkView::displayTimerFired): * UIProcess/API/efl/EwkView.h: * UIProcess/efl/TextCheckerClientEfl.cpp: (TextCheckerClientEfl::TextCheckerClientEfl): (TextCheckerClientEfl::languagesUpdateTimerFired): (TextCheckerClientEfl::spellCheckingSettingChangeTimerFired): * UIProcess/efl/TextCheckerClientEfl.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost): (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: 2014-11-21 Chris Dumez Unreviewed, iOS build fix after r176462. Fix include path to TextIndicator.h to include WebCore/ as it was moved. * UIProcess/ios/PageClientImplIOS.mm: 2014-11-21 Chris Dumez Unreviewed, iOS build fix after r176452. dencodeFixedLengthData() now only takes 2 arguments instead of 3. * Shared/ios/QuickLookDocumentData.cpp: (WebKit::QuickLookDocumentData::decode): 2014-11-21 Zalan Bujtas Simple line layout: Add "show simple line layout debug borders" setting to MiniBrowser. https://bugs.webkit.org/show_bug.cgi?id=138981 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _simpleLineLayoutDebugBordersEnabled]): (-[WKPreferences _setSimpleLineLayoutDebugBordersEnabled:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2014-11-21 Eric Carlson WebVideoFullscreenManagerProxy must clear pointers when invalidated https://bugs.webkit.org/show_bug.cgi?id=138982 Reviewed by Jer Noble. * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenManagerProxy::~WebVideoFullscreenManagerProxy): Call invalidate. (WebKit::WebVideoFullscreenManagerProxy::invalidate): Set WebVideoFullscreenModel and WebVideoFullscreenChangeObserver to NULL. 2014-11-21 Timothy Horton Fix the build. * UIProcess/API/mac/WKView.mm: (-[WKView mouseDown:]): 2014-11-21 Beth Dakin The preview action menu item should not have a title https://bugs.webkit.org/show_bug.cgi?id=138989 -and corresponding- rdar://problem/19061959 Reviewed by Anders Carlsson. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _createActionMenuItemForTag:]): 2014-11-21 Conrad Shultz Page previews should have a margin. https://bugs.webkit.org/show_bug.cgi?id=138990 Reviewed by Beth Dakin. Enclose the WKWebView (or client-supplied preview view) in a container slightly larger than the preview view. Adjust sizing code to accommodate the margin. * UIProcess/mac/WKActionMenuController.mm: (+[WKPagePreviewViewController previewPadding]): Return the total amount of fixed padding surrounding the preview (-[WKPagePreviewViewController loadView]): Store the actual previewView in an ivar so that clients can distinguish it from the container view; wrap the preview in a container view; set frames appropriately. (-[WKActionMenuController _createPreviewPopover]): Update to reflect method rename; supplement the popover size with the fixed padding. (-[WKActionMenuController _preferredPopoverSizeWithPreviewPadding:]): Renamed from -_preferredPopoverSize; account for the fixed padding when computing the preferred size. (-[WKActionMenuController _clearPreviewPopover]): Use the previewView ivar instead of the view controller's view. (-[WKActionMenuController pagePreviewViewControllerWasClicked:]): Ditto. (-[WKActionMenuController _preferredPopoverSize]): Deleted. 2014-11-21 Tim Horton REGRESSION (r176415): Can get stuck, unable to invoke any DataDetectors popovers https://bugs.webkit.org/show_bug.cgi?id=138955 Reviewed by Anders Carlsson. * UIProcess/API/mac/WKView.mm: (-[WKView mouseDown:]): * UIProcess/mac/WKActionMenuController.h: * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController wkView:willHandleMouseDown:]): (-[WKActionMenuController didCloseMenu:withEvent:]): (-[WKActionMenuController menuNeedsUpdate:]): Keep track of whether we have called shouldUseActionsWithContext: on a DDActionContext; if we get a mouseDown without having seen didCloseMenu: (and thus don't properly pair the shouldUseActionsWithContext: with a didUseActions), tear down the old DDActionContext before proceeding. 2014-11-21 Tim Horton REGRESSION (r176351): Parts of apple.com/contact aren't Lookup-able ​https://bugs.webkit.org/show_bug.cgi?id=138960 Reviewed by Anders Carlsson. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]): (-[WKActionMenuController _defaultMenuItemsForMailtoLink]): Deleted. Use DataDetectors SPI instead of an explicit blacklist. 2014-11-21 Tim Horton Crashes while encoding a TextIndicator with no contentImageWithHighlight https://bugs.webkit.org/show_bug.cgi?id=138984 Reviewed by Sam Weinig. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): encodeImage doesn't deal with null images, so handle that case gracefully. 2014-11-21 Tim Horton REGRESSION (r176351): Parts of apple.com/contact aren't Lookup-able https://bugs.webkit.org/show_bug.cgi?id=138960 Reviewed by Beth Dakin. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]): Blacklist contact results, because they don't have useful menus. If we bail before setting up _currentActionContext, we'll still allow fallthrough to ordinary text actions, avoiding mysterious failure when a contact is detected. This doesn't break the case that r176351 was intended to fix, because in that case we were detecting e.g. addresses. 2014-11-21 Tim Horton Move TextIndicator{Window} to WebCore https://bugs.webkit.org/show_bug.cgi?id=138954 Some adjustments by Csaba Osztrogonác. Reviewed by Anders Carlsson. * CMakeLists.txt: Remove TextIndicator.cpp. * Scripts/webkit/messages.py: (struct_or_class): (headers_for_type): Tell messages.py that TextIndicatorData is a struct, and comes from TextIndicator.h. * Shared/WebCoreArgumentCoders.h: * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): Add argument coders for TextIndicatorData. * Shared/DictionaryPopupInfo.h: * Shared/mac/ActionMenuHitTestResult.h: * Shared/mac/ActionMenuHitTestResult.mm: * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/API/gtk/PageClientImpl.cpp: * UIProcess/API/mac/WKView.mm: * UIProcess/API/mac/WKViewInternal.h: * UIProcess/CoordinatedGraphics/WebView.h: * UIProcess/CoordinatedGraphics/WebView.cpp: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/WKContentView.h: * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: * UIProcess/mac/WKActionMenuController.mm: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm: * WebProcess/WebPage/FindController.cpp: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: * WebProcess/WebPage/mac/WebPageMac.mm: Adjust to TextIndicator and TextIndicatorWindow's new home. 2014-11-21 Tim Horton REGRESSION (r176238): Mailto links are getting preloaded, which results in a compose window https://bugs.webkit.org/show_bug.cgi?id=138972 Reviewed by Beth Dakin. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController willOpenMenu:withEvent:]): Only preload links. 2014-11-21 Anders Carlsson Remove the Timer parameters from timer callbacks https://bugs.webkit.org/show_bug.cgi?id=138974 Reviewed by Antti Koivisto. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::NetworkResourceLoader): (WebKit::NetworkResourceLoader::bufferingTimerFired): * NetworkProcess/NetworkResourceLoader.h: * Shared/WebMemorySampler.cpp: (WebKit::WebMemorySampler::WebMemorySampler): (WebKit::WebMemorySampler::sampleTimerFired): (WebKit::WebMemorySampler::stopTimerFired): * Shared/WebMemorySampler.h: * Shared/mac/RemoteLayerBackingStoreCollection.h: * Shared/mac/RemoteLayerBackingStoreCollection.mm: (WebKit::RemoteLayerBackingStoreCollection::RemoteLayerBackingStoreCollection): (WebKit::RemoteLayerBackingStoreCollection::volatilityTimerFired): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::PluginView): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea): (WebKit::RemoteLayerTreeDrawingArea::layerFlushTimerFired): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): (WebKit::WebProcess::processSuspensionCleanupTimerFired): (WebKit::WebProcess::nonVisibleProcessCleanupTimerFired): * WebProcess/WebProcess.h: 2014-11-21 Anders Carlsson Remove the Timer parameters from timer callbacks https://bugs.webkit.org/show_bug.cgi?id=138974 Reviewed by Antti Koivisto. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::NetworkResourceLoader): (WebKit::NetworkResourceLoader::bufferingTimerFired): * NetworkProcess/NetworkResourceLoader.h: * Shared/WebMemorySampler.cpp: (WebKit::WebMemorySampler::WebMemorySampler): (WebKit::WebMemorySampler::sampleTimerFired): (WebKit::WebMemorySampler::stopTimerFired): * Shared/WebMemorySampler.h: * Shared/mac/RemoteLayerBackingStoreCollection.h: * Shared/mac/RemoteLayerBackingStoreCollection.mm: (WebKit::RemoteLayerBackingStoreCollection::RemoteLayerBackingStoreCollection): (WebKit::RemoteLayerBackingStoreCollection::volatilityTimerFired): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::PluginView): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea): (WebKit::RemoteLayerTreeDrawingArea::layerFlushTimerFired): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): (WebKit::WebProcess::processSuspensionCleanupTimerFired): (WebKit::WebProcess::nonVisibleProcessCleanupTimerFired): * WebProcess/WebProcess.h: 2014-11-21 Antti Koivisto Fix iOS build. * Shared/ios/QuickLookDocumentData.cpp: (WebKit::QuickLookDocumentData::encode): 2014-11-21 Antti Koivisto Remove alignment code from IPC coders https://bugs.webkit.org/show_bug.cgi?id=138963 Reviewed by Anders Carlsson. Alignment code achieves nothing except making the messages somewhat bigger. * Platform/IPC/ArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): (IPC::ArgumentCoder::encode): (IPC::decodeStringText): * Platform/IPC/ArgumentCoders.h: (IPC::SimpleArgumentCoder::encode): (IPC::SimpleArgumentCoder::decode): * Platform/IPC/ArgumentDecoder.cpp: (IPC::ArgumentDecoder::initialize): (IPC::ArgumentDecoder::bufferIsLargeEnoughToContain): (IPC::ArgumentDecoder::decodeFixedLengthData): (IPC::ArgumentDecoder::decodeVariableLengthByteArray): (IPC::ArgumentDecoder::decodeNumber): (IPC::ArgumentDecoder::decode): (IPC::roundUpToAlignment): Deleted. (IPC::alignedBufferIsLargeEnoughToContain): Deleted. (IPC::ArgumentDecoder::alignBufferPosition): Deleted. (IPC::decodeValueFromBuffer): Deleted. * Platform/IPC/ArgumentDecoder.h: (IPC::ArgumentDecoder::isInvalid): (IPC::ArgumentDecoder::markInvalid): (IPC::ArgumentDecoder::bufferIsLargeEnoughToContain): * Platform/IPC/ArgumentEncoder.cpp: (IPC::ArgumentEncoder::ArgumentEncoder): (IPC::ArgumentEncoder::grow): (IPC::ArgumentEncoder::encodeFixedLengthData): (IPC::ArgumentEncoder::encodeVariableLengthByteArray): (IPC::ArgumentEncoder::encode): * Platform/IPC/ArgumentEncoder.h: (IPC::ArgumentEncoder::buffer): (IPC::ArgumentEncoder::mutableBuffer): * Platform/IPC/DataReference.cpp: (IPC::SharedBufferDataReference::encode): * Platform/IPC/MessageEncoder.cpp: (IPC::MessageEncoder::setIsSyncMessage): (IPC::MessageEncoder::setShouldDispatchMessageWhenWaitingForSyncReply): * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::sendOutgoingMessage): 2014-11-21 Anders Carlsson Make memoryCache() return a reference https://bugs.webkit.org/show_bug.cgi?id=138939 Reviewed by Antti Koivisto. * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didCacheResource): * WebProcess/ResourceCache/WebResourceCacheManager.cpp: (WebKit::WebResourceCacheManager::getCacheOrigins): (WebKit::WebResourceCacheManager::clearCacheForOrigin): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::terminate): (WebKit::WebProcess::didClose): (WebKit::WebProcess::clearResourceCaches): (WebKit::getWebCoreMemoryCacheStatistics): (WebKit::WebProcess::setMemoryCacheDisabled): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformSetCacheModel): * WebProcess/soup/WebProcessSoup.cpp: (WebKit::WebProcess::platformSetCacheModel): 2014-11-21 Daniel Bates [iOS] WebKit2 fails to build with public SDK due to missing SPI from CFNetwork, QuartzCore, MediaPlayer, XPC https://bugs.webkit.org/show_bug.cgi?id=138930 Reviewed by Anders Carlsson. * NetworkProcess/mac/NetworkResourceLoaderMac.mm: Remove forward declaration for NSCachedURLResponse methods as this functionality was incorporated into CFNetworkSPI.h, which is included by this file. * Platform/mac/LayerHostingContext.mm: Moved QuartzCore forward declarations from this file to file QuartzCoreSPI.h and included header QuartzCoreSPI.h. * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h: Include header XPCSPI.h. * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm: Remove forward declarations of XPC SPI since these declarations are part of XCPSPI.h, which is included by header XPCServiceEntryPoint.h. * UIProcess/API/Cocoa/WKWebView.mm: Remove unnecessary include of header QuartzCore/CARenderServer.h as it will be included by header QuartzCoreSPI.h. * UIProcess/Network/NetworkProcessProxy.cpp: Include header XPCSPI.h when building for iOS with USE(XPC_SERVICES) enabled. * UIProcess/ios/forms/WKAirPlayRoutePicker.mm: Include header MediaPlayerSPI.h instead of including MediaPlayer private headers directly. Also sort the list of #import directives. 2014-11-20 Dan Bernstein Build fix. * UIProcess/ios/forms/WKAirPlayRoutePicker.mm: (-[WKAirPlayRoutePicker showAirPlayPickerIPad:fromRect:]): Cast the return value of [getMPAudioVideoRoutingPopoverControllerClass() alloc] to resolve ambiguity about which -initWithType: we are calling. (-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]): Cast to resolve ambiguity. (-[WKAirPlayRoutePicker show:fromRect:]): Cast for consistency. 2014-11-20 Benjamin Poulain Remove the remaining vestiges of minimal-ui https://bugs.webkit.org/show_bug.cgi?id=138890 Reviewed by Sam Weinig. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didCommitLoad): (WebKit::WebPage::didFinishDocumentLoad): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::savePageState): (WebKit::WebPage::restorePageState): (WebKit::WebPage::viewportConfigurationChanged): (WebKit::WebPage::updateViewportSizeForCSSViewportUnits): 2014-11-20 Beth Dakin Preview popover needs minimum and maximum sizes https://bugs.webkit.org/show_bug.cgi?id=138943 -and corresponding- rdar://problem/18904651 Reviewed by Tim Horton. Quick follow-up to get the right screen. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController largestPopoverSize]): 2014-11-20 Beth Dakin Preview popover needs minimum and maximum sizes https://bugs.webkit.org/show_bug.cgi?id=138943 -and corresponding- rdar://problem/18904651 Reviewed by Tim Horton. This patch enforces minimum and maximum popover sizes. If the popover needs to be sized up to be above the minimum, it will end up covering some of the _hitTestResult, so we should compute a new origin rect based on the original event location. * UIProcess/mac/WKActionMenuController.h: * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController prepareForMenu:withEvent:]): (-[WKActionMenuController _previewURLFromActionMenu:]): (-[WKActionMenuController _createPreviewPopover]): (-[WKActionMenuController largestPopoverSize]): (-[WKActionMenuController _preferredPopoverSize]): (-[WKActionMenuController _preferredSizeForPopoverPresentedFromOriginRect:]): Deleted. 2014-11-20 Conrad Shultz Clicks on previews can be recognized multiple times https://bugs.webkit.org/show_bug.cgi?id=138944 Reviewed by Tim Horton. * UIProcess/mac/WKActionMenuController.mm: (-[WKPagePreviewViewController _clickRecognized:]): Only dispatch the delegate message on the appropriate gesture recognizer state transition. 2014-11-20 Conrad Shultz Clients should be able to customize preview click behavior https://bugs.webkit.org/show_bug.cgi?id=138940 Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKViewPrivate.h: Declare -_handleClickInPreviewView:URL:. * UIProcess/API/mac/WKView.mm: (-[WKView _handleClickInPreviewView:URL:]): Extracted from -[WKActionMenuController pagePreviewViewControllerWasClicked:]. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController pagePreviewViewControllerWasClicked:]): Extract code to -[WKView _handleClickInPreviewView:URL:]. 2014-11-20 Csaba Osztrogonác URTBF after r176420 to fix non Apple builds. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::shouldPlugInAutoStartFromOrigin): 2014-11-20 Anders Carlsson WebPlugInClient::m_webPage can never be null, use a reference https://bugs.webkit.org/show_bug.cgi?id=138937 Reviewed by Andreas Kling. * WebProcess/WebCoreSupport/WebPlugInClient.cpp: (WebKit::WebPlugInClient::WebPlugInClient): (WebKit::WebPlugInClient::shouldAutoStartFromOrigin): * WebProcess/WebCoreSupport/WebPlugInClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::shouldPlugInAutoStartFromOrigin): * WebProcess/WebProcess.h: 2014-11-20 Tim Horton TextIndicator should have getters for TextIndicator::Data properties https://bugs.webkit.org/show_bug.cgi?id=138920 Reviewed by Beth Dakin. Instead of having clients reach into the data(), add getters. Remove frameRect(), which is identical to the textBoundingRectInWindowCoordinates getter. Remove declarations for draw/drawContentImage, which were already removed. * Shared/TextIndicator.cpp: (WebKit::TextIndicator::frameRect): Deleted. * Shared/TextIndicator.h: (WebKit::TextIndicator::textBoundingRectInWindowCoordinates): (WebKit::TextIndicator::textRectsInBoundingRectCoordinates): (WebKit::TextIndicator::contentImageScaleFactor): (WebKit::TextIndicator::contentImageWithHighlight): (WebKit::TextIndicator::contentImage): * UIProcess/mac/TextIndicatorWindow.mm: (-[WKTextIndicatorView initWithFrame:textIndicator:margin:]): (-[WKTextIndicatorView presentWithCompletionHandler:]): (WebKit::TextIndicatorWindow::setTextIndicator): 2014-11-20 Tim Horton Cancel DataDetectors menu earlier if we know it can't be presented https://bugs.webkit.org/show_bug.cgi?id=138922 Reviewed by Beth Dakin. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController willOpenMenu:withEvent:]): If we end up with a menu with no items, don't change selection or anything. (-[WKActionMenuController menuNeedsUpdate:]): Move our call to shouldUseActionsWithContext earlier, to menuNeedsUpdate, and use a bigger hammer (removeAllItems). 2014-11-20 Tim Horton Don't use a TextIndicator BounceAndCrossfade transition if the selection highlight is never shown https://bugs.webkit.org/show_bug.cgi?id=138919 Reviewed by Beth Dakin. * Shared/TextIndicator.h: (WebKit::TextIndicator::presentationTransition): (WebKit::TextIndicator::setPresentationTransition): Add getter and setter pair. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]): If the selection highlight will never be shown because there's only a single menu item, use a normal bounce animation instead of bounce + crossfade. 2014-11-20 Beth Dakin Invalid message WebPageProxy.DidPerformDictionaryLookup on Google stocks result https://bugs.webkit.org/show_bug.cgi?id=138568 -and corresponding- rdar://problem/18904600 Reviewed by Tim Horton. Skip images for lookup. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performDictionaryLookupForRange): 2014-11-20 Daniel Bates [iOS] Add more ENABLE({TOUCH_EVENTS, IOS_TOUCH_EVENTS})-guards in WebKit2 https://bugs.webkit.org/show_bug.cgi?id=138928 Reviewed by Simon Fraser. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didCommitLoad): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::sendTapHighlightForNodeIfNecessary): 2014-11-20 Anders Carlsson Add -[WKWebView loadData:MIMEType:textEncodingName:baseURL:] https://bugs.webkit.org/show_bug.cgi?id=138929 Reviewed by Dan Bernstein. Also, re-implement -[WKWebView loadHTMLString:baseURL:] in terms of this newly added function and assume a UTF-8 encoding. This matches what Legacy WebKit does. * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView loadHTMLString:baseURL:]): (-[WKWebView loadData:MIMEType:textEncodingName:baseURL:]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadData): * UIProcess/WebPageProxy.h: 2014-11-20 Antti Koivisto Remove alignment code from cache coders https://bugs.webkit.org/show_bug.cgi?id=138927 Failed to land this file. * NetworkProcess/cache/NetworkCacheCoders.cpp: (WebKit::NetworkCacheCoder::encode): (WebKit::NetworkCacheCoder::decode): (WebKit::NetworkCacheCoder::encode): (WebKit::decodeStringText): (WebKit::NetworkCacheCoder::encode): (WebKit::NetworkCacheCoder::decode): * NetworkProcess/cache/NetworkCacheCoders.h: 2014-11-20 Antti Koivisto Remove alignment code from cache coders https://bugs.webkit.org/show_bug.cgi?id=138927 Reviewed by Anders Carlsson. Alignment code doesn't do anything useful, wastes space and produces wrong results if the encoder and decoder buffers don't have the same 8-byte alignment. * NetworkProcess/cache/NetworkCacheDecoder.cpp: (WebKit::NetworkCacheDecoder::NetworkCacheDecoder): (WebKit::NetworkCacheDecoder::bufferIsLargeEnoughToContain): (WebKit::NetworkCacheDecoder::decodeFixedLengthData): (WebKit::NetworkCacheDecoder::decodeNumber): (WebKit::roundUpToAlignment): Deleted. (WebKit::alignedBufferIsLargeEnoughToContain): Deleted. (WebKit::NetworkCacheDecoder::alignBufferPosition): Deleted. * NetworkProcess/cache/NetworkCacheDecoder.h: (WebKit::NetworkCacheDecoder::currentOffset): (WebKit::NetworkCacheDecoder::isInvalid): (WebKit::NetworkCacheDecoder::markInvalid): (WebKit::NetworkCacheDecoder::bufferIsLargeEnoughToContain): * NetworkProcess/cache/NetworkCacheEncoder.cpp: (WebKit::NetworkCacheEncoder::grow): (WebKit::NetworkCacheEncoder::encodeFixedLengthData): (WebKit::NetworkCacheEncoder::encodeNumber): (WebKit::roundUpToAlignment): Deleted. * NetworkProcess/cache/NetworkCacheEncoder.h: 2014-11-20 Csaba Osztrogonác [GTK] URTBF after r176363. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::setTextIndicator): * UIProcess/API/gtk/PageClientImpl.h: 2014-11-19 Yongjun Zhang Don't track sub-resources that are started after main frame progress has completed. https://bugs.webkit.org/show_bug.cgi?id=138582 Reviewed by Sam Weinig. After main frame progress has finished, starting loading a sub-resource shouldn't affect UI process's view of page loading status (i.e., the page has already completed loading and the progress shouldn't change). To achive that, don't track the subresources that are started after the main frame has finished, except for those triggered by user interaction. * WebProcess/WebCoreSupport/WebProgressTrackerClient.cpp: Notify WebPage that the main frame progress has started or finished. (WebKit::WebProgressTrackerClient::progressStarted): (WebKit::WebProgressTrackerClient::progressFinished): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): (WebKit::WebPage::addResourceRequest): Don't track the resource request if it is initiated after the main frame is loaded and it is not triggered by user interaction. (WebKit::WebPage::removeResourceRequest): * WebProcess/WebPage/WebPage.h: Rename m_networkResourceRequestIdentifiers to m_trackedNetworkResourceRequestIdentifiers. (WebKit::WebPage::setMainFrameProgressCompleted): 2014-11-19 Sun-woo Nam [EFL] Fix build failure since r176363. https://bugs.webkit.org/show_bug.cgi?id=138903 Reviewed by Gyuyoung Kim. The parameter for animation on setTextIndicator() was removed on 'PageClient' class. * UIProcess/CoordinatedGraphics/WebView.cpp: (WebKit::WebView::setTextIndicator): * UIProcess/CoordinatedGraphics/WebView.h: 2014-11-19 Timothy Horton Try to fix the iOS build * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::performDictionaryLookupForSelection): (WebKit::WebPage::performDictionaryLookupForRange): 2014-11-19 Timothy Horton Fix the 32-bit build * UIProcess/mac/TextIndicatorWindow.mm: (WebKit::TextIndicatorWindow::setTextIndicator): 2014-11-19 Tim Horton Add an optional entry transition (from selection highlight) to TextIndicator https://bugs.webkit.org/show_bug.cgi?id=138856 Reviewed by Anders Carlsson. * Shared/TextIndicator.cpp: (WebKit::outsetIndicatorRectIncludingShadow): (WebKit::TextIndicator::createWithRange): (WebKit::snapshotSelectionWithHighlight): (WebKit::TextIndicator::createWithSelectionInFrame): (WebKit::TextIndicator::frameRect): (WebKit::TextIndicator::Data::encode): (WebKit::TextIndicator::Data::decode): Remove TextIndicator::draw and related functions; drawing is handled entirely by the TextIndicatorWindow now, and TextIndicator just stores the required data. Unify outsetIndicatorRectIncludingShadow. Add an argument to createWithRange/createWithSelectionInFrame to indicate if the TextIndicator should transition from the selection highlight to the yellow bubble. If we're doing the transition, paint the selection into a second bitmap, without forcing the text to black and without hiding the blue highlight. Encode/decode the second bitmap. * Shared/TextIndicator.h: * UIProcess/mac/TextIndicatorWindow.h: * UIProcess/mac/TextIndicatorWindow.mm: (-[WKTextIndicatorView initWithFrame:textIndicator:margin:transitionFromSelectionColor:]): (-[WKTextIndicatorView presentWithCompletionHandler:]): (-[WKTextIndicatorView hideWithCompletionHandler:]): (-[WKTextIndicatorView isFlipped]): (WebKit::TextIndicatorWindow::TextIndicatorWindow): (WebKit::TextIndicatorWindow::setTextIndicator): (WebKit::TextIndicatorWindow::closeWindow): (WebKit::TextIndicatorWindow::startFadeOutTimerFired): Re-implement the bounce animation using CoreAnimation instead of the WKSI-based WKWindowBounceAnimation*. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performDictionaryLookupForSelection): (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): (WebKit::WebPage::performDictionaryLookupForRange): (WebKit::WebPage::performActionMenuHitTestAtLocation): * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm: Use the aforementioned transition animation for performDictionaryLookupOfCurrentSelection, the context menu lookup item, and for Data Detectors. 2014-11-19 Anders Carlsson Add a version of API::Data::createWithoutCopying that takes an NSData https://bugs.webkit.org/show_bug.cgi?id=138893 Reviewed by Dan Bernstein. * Shared/APIData.h: * Shared/Cocoa/APIDataCocoa.mm: Added. (API::Data::createWithoutCopying): * UIProcess/API/Cocoa/WKBrowsingContextController.mm: (-[WKBrowsingContextController loadData:MIMEType:textEncodingName:baseURL:userData:]): (releaseNSData): Deleted. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): 2014-11-19 Beth Dakin Invoking an action menu on a selection should result in the text menu https://bugs.webkit.org/show_bug.cgi?id=138892 -and corresponding- rdar://problem/18996776 Reviewed by Tim Horton. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _defaultMenuItems]): 2014-11-19 Anders Carlsson Fix iOS build. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: 2014-11-19 Anders Carlsson Rename two Cocoa-only .cpp files to .mm. Rubber-stamped by Sam Weinig. * Shared/APIWebArchive.mm: Renamed from Source/WebKit2/Shared/APIWebArchive.cpp. * Shared/APIWebArchiveResource.mm: Renamed from Source/WebKit2/Shared/APIWebArchiveResource.cpp. * WebKit2.xcodeproj/project.pbxproj: 2014-11-19 Beth Dakin Data detected results with no menu items should not fall through to regular text action menus https://bugs.webkit.org/show_bug.cgi?id=138887 -and corresponding- rdar://problem/18971616 Reviewed by Tim Horton. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _defaultMenuItems]): 2014-11-19 Daniel Bates [iOS] Make WebKit build with public iOS SDK https://bugs.webkit.org/show_bug.cgi?id=136863 Reviewed by David Kilzer. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: Moved CFNetwork forward declarations from this file to file CFNetworkSPI.h and included header CFNetworkSPI.h. * NetworkProcess/mac/NetworkDiskCacheMonitor.mm: Ditto. * NetworkProcess/mac/NetworkResourceLoaderMac.mm: Ditto. * UIProcess/API/Cocoa/WKProcessPool.mm: Ditto. * UIProcess/mac/WebContextMac.mm: Ditto. * WebProcess/cocoa/WebProcessCocoa.mm: Ditto. 2014-11-19 Anders Carlsson Add APIs for customizing the user agent https://bugs.webkit.org/show_bug.cgi?id=138881 rdar://problem/17233981 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): (-[WKWebView customUserAgent]): (-[WKWebView setCustomUserAgent:]): (-[WKWebView _customUserAgent]): (-[WKWebView _setCustomUserAgent:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (LazyInitialized::set): (-[WKWebViewConfiguration copyWithZone:]): (defaultApplicationNameForUserAgent): (-[WKWebViewConfiguration applicationNameForUserAgent]): (-[WKWebViewConfiguration setApplicationNameForUserAgent:]): 2014-11-19 Simon Fraser [WK2 UI-side compositing] Initialize RemoteLayerTreeTransaction properties which are unset on Mac https://bugs.webkit.org/show_bug.cgi?id=138877 Reviewed by Tim Horton. These data members are unused on Mac, but still encoded, so initialize them with reasonable values. * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::RemoteLayerTreeTransaction): 2014-11-19 Enrica Casucci Refactor iOS selection gestures. https://bugs.webkit.org/show_bug.cgi?id=138720 rdar://problem/18964359 Reviewed by Benjamin Poulain. This is a first step towards refactoring the selection gestures code. It introduces more general selection movement functions that can be used to build the gestures. * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (toWKTextGranularity): (toWKSelectionDirection): (-[WKContentView selectPositionAtPoint:completionHandler:]): (-[WKContentView selectPositionAtBoundary:inDirection:fromPoint:completionHandler:]): (-[WKContentView selectTextWithGranularity:atPoint:completionHandler:]): (-[WKContentView beginSelectionInDirection:completionHandler:]): (-[WKContentView updateSelectionWithExtentPoint:completionHandler:]): (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::selectTextWithGranularityAtPoint): (WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection): (WebKit::WebPageProxy::selectPositionAtPoint): (WebKit::WebPageProxy::beginSelectionInDirection): (WebKit::WebPageProxy::updateSelectionWithExtentPoint): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::selectWithGesture): (WebKit::WebPage::visiblePositionInFocusedNodeForPoint): (WebKit::WebPage::selectPositionAtPoint): (WebKit::WebPage::selectPositionAtBoundaryWithDirection): (WebKit::WebPage::selectTextWithGranularityAtPoint): (WebKit::WebPage::beginSelectionInDirection): (WebKit::WebPage::updateSelectionWithExtentPoint): 2014-11-19 Simon Fraser [WK2 UI-side Compositing] Fix the position and scroll indicator of the UI-side tiled scrolling indicator https://bugs.webkit.org/show_bug.cgi?id=138876 Reviewed by Beth Dakin. Fix the position of the tiled scrolling indicator in MiniBrowser by taking top content offset into account. On Mac, pass the current scroll position back to the UI process via the RemoteLayerTreeTransaction so that we can use it to show the correctly scroll offset in the indicator. This is temporary until Mac does UI-side scrolling. * Shared/mac/RemoteLayerTreeTransaction.h: (WebKit::RemoteLayerTreeTransaction::scrollPosition): (WebKit::RemoteLayerTreeTransaction::setScrollPosition): * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::encode): (WebKit::RemoteLayerTreeTransaction::decode): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation): (WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::willCommitLayerTree): 2014-11-19 Michael Catanzaro [GTK] Error in documentation of webkit_print_operation_get_page_setup() https://bugs.webkit.org/show_bug.cgi?id=138868 Reviewed by Carlos Garcia Campos. Fix copypaste error in documentation of webkit_print_operation_get_page_setup(). * UIProcess/API/gtk/WebKitPrintOperation.cpp: 2014-11-19 Mark Rowe Remove an unused file. * version.plist: Removed. 2014-11-18 Benjamin Poulain [WK2] Remove the minimalUI code from the UIProcess https://bugs.webkit.org/show_bug.cgi?id=138819 Reviewed by Sam Weinig. It looks like the only interface we have to keep alive is [WKWebView _overrideLayoutParametersWithMinimumLayoutSize:minimumLayoutSizeForMinimalUI:maximumUnobscuredSizeOverride:]. Clean up everything else, it is a pile of useless code. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLoadForMainFrame]): (-[WKWebView _didCommitLayerTree:]): (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _didRelaunchProcess]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:minimumLayoutSizeForMinimalUI:maximumUnobscuredSizeOverride:]): (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]): (-[WKWebView _setUsesMinimalUI:]): Deleted. (-[WKWebView _usesMinimalUI]): Deleted. (activeMinimumLayoutSizeForMinimalUI): Deleted. (-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/ios/WKViewIOS.mm: (-[WKView _frameOrBoundsChanged]): * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::setUsesMinimalUI): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::dynamicViewportSizeUpdate): (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSizeForMinimalUI): Deleted. (WebKit::WebPageProxy::setUsesMinimalUI): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::viewportPropertiesDidChange): (WebKit::WebPage::dynamicViewportSizeUpdate): (WebKit::WebPage::setViewportConfigurationMinimumLayoutSizeForMinimalUI): Deleted. 2014-11-18 Conrad Shultz Unreviewed. Revision to the build fix in r176304. The guarded method should simply be in the !TARGET_OS_IPHONE block. * UIProcess/API/Cocoa/WKViewPrivate.h: 2014-11-18 Benjamin Poulain iOS8 new "slow tap" heuristic fires mouse compat events despite preventDefault on touchend https://bugs.webkit.org/show_bug.cgi?id=137069 rdar://problem/18481464 Reviewed by Simon Fraser. On WebKit2, we let UIWebTouchEventsGestureRecognizer and _UIWebHighlightLongPressGestureRecognizer run concurrently. This causes a race with an incorrect behavior: 1) If UIWebTouchEventsGestureRecognizer does not cancel the native gestures on start. 2) _UIWebHighlightLongPressGestureRecognizer starts after highlightDelay. 3) When the finger leaves the screen, both gestures end. -> If the touch end sent to JavaScript in [3] ask the priority over native events, that no longer stops the _UIWebHighlightLongPressGestureRecognizer. The two gesture recognizers can run in any order, there is no guarantee on which one runs first. To solve the bug, I must make sure the _UIWebHighlightLongPressGestureRecognizer never trigger a click if the page wants the event. To solve the order problem, I use the fact that event recognition goes in two phases for non cancelled events: 1) Update the gesture recognizers. 2) Trigger the actions. I do not know the order of recognizers in [1], but I know both have run before [2] is executed. I use that to stop _UIWebHighlightLongPressGestureRecognizer from ending with a click in the case of the bug: 1) When _UIWebHighlightLongPressGestureRecognizer starts, I set _highlightLongPressCanClick signaling the gesture can end normally. This is done on a timer and not direct input so I don't really have to worry about a race here. 2) When processing the touch event for UIWebTouchEventsGestureRecognizer, I reset the flag _highlightLongPressCanClick if the page wants the event. 3) When the actions of _UIWebHighlightLongPressGestureRecognizer are processed, the touch event has already been processed by the page and the flag has been cleared if needed. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _webTouchEvent:preventsNativeGestures:]): (-[WKContentView _highlightLongPressRecognized:]): 2014-11-18 Ryosuke Niwa iOS build fix after r176299. This method is not defined in WKViewIOS.mm. * UIProcess/API/Cocoa/WKViewPrivate.h: 2014-11-18 David Kilzer FeatureDefines.xcconfig: Switch from using PLATFORM_NAME to SDK selectors Reviewed by Mark Rowe. * Configurations/FeatureDefines.xcconfig: Switch to using SDK selectors. 2014-11-18 Conrad Shultz Give clients a way to cancel preview popovers https://bugs.webkit.org/show_bug.cgi?id=138855 Reviewed by Tim Horton. Promote -[WKView _dismissActionMenuPopovers] from internal to private. * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView _dismissActionMenuPopovers]): * UIProcess/API/mac/WKViewInternal.h: 2014-11-18 Chris Dumez Add a setting to toggle DOMTimer throttling support https://bugs.webkit.org/show_bug.cgi?id=138844 Reviewed by Andreas Kling. Add a setting to disable DOM timers throttling, in order to help developers determine if a specific issue is caused by timer throttling. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetDOMTimersThrottlingEnabled): (WKPreferencesGetDOMTimersThrottlingEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2014-11-18 Geoffrey Garen Removed the custom allocator for ListHashSet nodes https://bugs.webkit.org/show_bug.cgi?id=138841 Reviewed by Andreas Kling. Uses of ListHashSet no longer need to declare an inline capacity, since that was only used to specify the capacity of the custom allocator. * UIProcess/Plugins/PluginInfoStore.cpp: (WebKit::PluginInfoStore::loadPluginsIfNecessary): 2014-11-18 Eric Carlson Unreviewed build fix after r176283. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: 2014-11-18 Tim Horton Avoid re-encoding action menu image data https://bugs.webkit.org/show_bug.cgi?id=138817 Reviewed by Anders Carlsson. * Shared/mac/ActionMenuHitTestResult.h: * Shared/mac/ActionMenuHitTestResult.mm: (WebKit::ActionMenuHitTestResult::encode): (WebKit::ActionMenuHitTestResult::decode): Store and encode a SharedMemory with the raw encoded image data, instead of re-painting the image into a ShareableBitmap. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _hitTestResultImage]): (-[WKActionMenuController _defaultMenuItemsForImage]): (-[WKActionMenuController _copyImage:]): (-[WKActionMenuController _addImageToPhotos:]): (-[WKActionMenuController _defaultMenuItems]): (-[WKActionMenuController _canAddMediaToPhotos]): Deleted. Build a temporary filename from a UUID and the image's desired extension. Use the Image's encoded data instead of re-encoding it with CGImageDestination. Build an image menu only if we have an image, URL, data, and extension. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performActionMenuHitTestAtLocation): 2014-11-18 Eric Carlson [iOS] allow host application to opt-out of alternate fullscreen https://bugs.webkit.org/show_bug.cgi?id=138787 Reviewed by Sam Weinig. "allowsAlternateFullscreen" doesn't need to be in the public WKWebView header. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): allowsAlternateFullscreen -> _allowsAlternateFullscreen. * UIProcess/API/Cocoa/WKWebViewConfiguration.h: Remove allowsAlternateFullscreen. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration _allowsAlternateFullscreen]): New. (-[WKWebViewConfiguration _setAllowsAlternateFullscreen:]): New. * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: Declare _allowsAlternateFullscreen. 2014-11-18 Myles C. Maxfield Subclass CachedFont for SVG fonts https://bugs.webkit.org/show_bug.cgi?id=138686 Reviewed by Simon Fraser. Re-landing due to flakey bots. Update for enum type. * WebProcess/Network/WebResourceLoadScheduler.cpp: (WebKit::maximumBufferingTime): 2014-11-18 Chris Dumez Update the Vector API to deal with unsigned types instead of size_t https://bugs.webkit.org/show_bug.cgi?id=138824 Reviewed by Andreas Kling. Update code base to fix build errors related to the typing changes in the Vector API (size_t -> unsigned). * Platform/IPC/ArgumentCoders.h: * Platform/IPC/DataReference.h: 2014-11-18 Commit Queue Unreviewed, rolling out r176264. https://bugs.webkit.org/show_bug.cgi?id=138837 caused many test failures (Requested by litherum on #webkit). Reverted changeset: "Subclass CachedFont for SVG fonts" https://bugs.webkit.org/show_bug.cgi?id=138686 http://trac.webkit.org/changeset/176264 2014-11-18 Daniel Bates [iOS] Libdispatch, Dyld, IOKit, Mach, NSPointerFunctions, MobileGestalt SPI are not available in public SDK https://bugs.webkit.org/show_bug.cgi?id=138802 Reviewed by David Kilzer. Include headers DispatchSPI.h and MachVMSPI.h.h instead of including libdispatch and Mach headers directly. * Platform/mac/SharedMemoryMac.cpp: * UIProcess/ios/WebMemoryPressureHandlerIOS.mm: 2014-11-18 Myles C. Maxfield Subclass CachedFont for SVG fonts https://bugs.webkit.org/show_bug.cgi?id=138686 Reviewed by Simon Fraser. Update for enum type. * WebProcess/Network/WebResourceLoadScheduler.cpp: (WebKit::maximumBufferingTime): 2014-11-18 Carlos Garcia Campos [GTK] Add API to create a WebKitWebContext https://bugs.webkit.org/show_bug.cgi?id=138826 Reviewed by Gustavo Noronha Silva. We have always used a default web context without providing API to create others. The main reason was that nobody requested it and we haven't needed it either. The main problem of the default web context is that you can't configure anything during construction. This hasn't been a problem so far because all the web context configuration we expose in the API can be configured after construction. But now we need to expose API to allow the user to configure the local storage directory, which is a construct only configuration. The default web context was also a problem for our unit tests, because sharing the same context made it difficult to ensure tests cases are independent to each other. * UIProcess/API/gtk/WebKitGeolocationProvider.cpp: (WebKitGeolocationProvider::~WebKitGeolocationProvider): Reset the provider to avoid crashes when web context is destroyed and a new one is created. * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextConstructed): Add constructed implementation to create the WebContext and initialize it. (webkitWebContextDispose): Detach web context clients to avoid crashes when a client callback is called on a disposed WebKitWebContext. (webkit_web_context_class_init): Initialize gettext, add constructed implementation and add the pointer to the vmethods when creating signals. (createDefaultWebContext): Simply create a WebKitWebContext. (webkit_web_context_new): New public method to create a WebKitWebContext. (injectedBundleFilename): Deleted. * UIProcess/API/gtk/WebKitWebContext.h: Add virtual methods for signals, so that users can inherit from WebKitWebContext and override the virtual methods. * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbol. 2014-11-18 Carlos Alberto Lopez Perez [SOUP] [GnuTLS] Don't use a SSL3.0 record version in client hello. https://bugs.webkit.org/show_bug.cgi?id=138794 Reviewed by Sergio Villar Senin. It seems that following POODLE many sites incorrectly banned SSL 3.0 record packet versions. Since GnuTLS uses a SSL 3.0 record to advertise TLS 1.2, they are effectively banning it even if it doesn't advertise SSL 3.0. That is a server issue, but it can be worked around by using the modifier %LATEST_RECORD_VERSION. With this modifier, GnuTLS will use the latest TLS version record in client hello instead of using the default SSL 3.0. * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp: (main): * WebProcess/EntryPoint/unix/WebProcessMain.cpp: (main): 2014-11-17 Conrad Shultz Page previews should be loaded sooner https://bugs.webkit.org/show_bug.cgi?id=138814 Reviewed by Tim Horton. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController willOpenMenu:withEvent:]): Send -_createPreviewPopover.. (-[WKActionMenuController _previewURLFromActionMenu:]): Relocate some logic to the new -_createPreviewPopover; gate early return on popover visibility. (-[WKActionMenuController _createPreviewPopover]): Renamed from -_createPreviewPopoverForURL:originRect:; explicitly send -loadView to warm up the preview view. (-[WKActionMenuController _createPreviewPopoverForURL:originRect:]): Deleted. 2014-11-17 Beth Dakin Preview is sometimes dismissed too early https://bugs.webkit.org/show_bug.cgi?id=138811 -and corresponding- rdar://problem/18900839 Reviewed by Tim Horton. Don’t make the popover transient until didCloseMenu: time. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController didCloseMenu:withEvent:]): (-[WKActionMenuController _createPreviewPopoverForURL:originRect:]): 2014-11-17 Daniel Bates Unreviewed, rolling out r176232. Broke the Mac build. Will investigate offline. Reverted changeset: "[iOS] Libdispatch, Dyld, IOKit, Mach, NSPointerFunctions, MobileGestalt" https://bugs.webkit.org/show_bug.cgi?id=138802 http://trac.webkit.org/changeset/176232 2014-11-17 Daniel Bates [iOS] Libdispatch, Dyld, IOKit, Mach, NSPointerFunctions, MobileGestalt SPI are not available in public SDK https://bugs.webkit.org/show_bug.cgi?id=138802 Reviewed by David Kilzer. Include headers DispatchSPI.h and MachVMSPI.h.h instead of including libdispatch and Mach headers directly. * Platform/mac/SharedMemoryMac.cpp: * UIProcess/ios/WebMemoryPressureHandlerIOS.mm: 2014-11-17 Daniel Bates [iOS] CoreText and CoreUI SPI are not available in public SDK https://bugs.webkit.org/show_bug.cgi?id=138760 Reviewed by David Kilzer. Include header CoreTextSPI.h instead of including CoreText private headers. * WebProcess/WebPage/WebPage.cpp: 2014-11-17 Tim Horton DataDetectors PageOverlay callbacks can come in to the wrong overlay https://bugs.webkit.org/show_bug.cgi?id=138801 Reviewed by Anders Carlsson. We can call dataDetectorsDidHideUI on the wrong (or no) PageOverlay, because it's possible to have another performActionMenuHitTestAtLocation between the first one and the dataDetectorsDid*UI that correspond to it. To make sure that the callbacks come to the right PageOverlay, plumb an integer ID through all of the callbacks and find the overlay based on that. * Shared/mac/ActionMenuHitTestResult.h: Store the ID of the PageOverlay that overrode data detection. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]): Send the ID back to the Web process when replying from DD callbacks. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performActionMenuHitTestAtLocation): Store the ID of the PageOverlay that overrode data detection instead of keeping the PageOverlay itself. (WebKit::WebPage::dataDetectorsDidPresentUI): (WebKit::WebPage::dataDetectorsDidChangeUI): (WebKit::WebPage::dataDetectorsDidHideUI): Find and reply to the correct page overlay. 2014-11-17 Beth Dakin Whitespace action menus should focus the HitTestResult and create an insertion point https://bugs.webkit.org/show_bug.cgi?id=138786 -and corresponding- rdar://problem/18944893 Reviewed by Tim Horton. Whitespace menus should cause the HitTestResult to be focused, and they should set the selection based on the HitTest location. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::focusAndSelectLastActionMenuHitTestResult): * UIProcess/WebPageProxy.h: * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController isMenuForTextContent]): (-[WKActionMenuController willOpenMenu:withEvent:]): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performActionMenuHitTestAtLocation): (WebKit::WebPage::focusAndSelectLastActionMenuHitTestResult): 2014-11-17 Daniel Bates [iOS] AVKit and MediaPlayer SPI are not available in public SDK https://bugs.webkit.org/show_bug.cgi?id=138756 Reviewed by Eric Carlson. Include header MPAVRoutingControllerSPI.h instead of including the private header MPAVRoutingController.h. Additionally, sort the list of #import directives. * UIProcess/ios/forms/WKAirPlayRoutePicker.mm: 2014-11-17 Daniel Bates [iOS] QuartzCore SPI not available in public SDK https://bugs.webkit.org/show_bug.cgi?id=138751 Reviewed by David Kilzer. * Shared/mac/RemoteLayerBackingStore.mm: Move CALayer forward declaration from this file to file QuartzCoreSPI.h and include header QuartzCoreSPI.h. * Shared/mac/RemoteLayerTreePropertyApplier.mm: Ditto. * UIProcess/API/Cocoa/WKWebView.mm: Include header QuartzCoreSPI.h instead of including QuartzCore headers directly. * UIProcess/ios/ViewGestureControllerIOS.mm: Ditto. * UIProcess/ios/WKContentView.mm: Ditto. * UIProcess/ios/WKPDFPageNumberIndicator.mm: Ditto. * UIProcess/mac/ViewGestureControllerMac.mm: Move CAFilter forward declarations from this file to fileQuartzCoreSPI.h and include header QuartzCoreSPI.h. Also sort the list of #import directives. * UIProcess/mac/ViewSnapshotStore.mm: Include header QuartzCoreSPI.h instead of including QuartzCore headers directly. 2014-11-17 Eric Carlson [iOS] allow host application to opt-out of alternate fullscreen https://bugs.webkit.org/show_bug.cgi?id=138787 Reviewed by Darin Adler. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetAllowsAlternateFullscreen): (WKPreferencesGetAllowsAlternateFullscreen): * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration copyWithZone:]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2014-11-16 Benjamin Poulain Start cleaning up minimal UI from WKWebView https://bugs.webkit.org/show_bug.cgi?id=138725 Reviewed by Sam Weinig. Start removing the old update path for minimumLayoutSize/maximumUnobscuredSize. Unfortunately, I cannot remove everything yet because the clients still did not have alternatives to [_overrideLayoutParametersWithMinimumLayoutSize:minimumLayoutSizeForMinimalUI:maximumUnobscuredSizeOverride] and might change the minimal UI options. This patch adds [_overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride] to move in the right direction. Next we'll udpate the client code and get rid of all the useless code. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:minimumLayoutSizeForMinimalUI:maximumUnobscuredSizeOverride:]): (-[WKWebView _overrideLayoutParametersWithMinimumLayoutSize:maximumUnobscuredSizeOverride:]): (-[WKWebView _minimumLayoutSizeOverrideForMinimalUI]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2014-11-16 Zan Dobersek [TexMap] Add typecasting support for GraphicsLayerTextureMapper https://bugs.webkit.org/show_bug.cgi?id=138741 Reviewed by Martin Robinson. Replace uses of toTextureMapperLayer() with downcasting and calling the GraphicsLayerTextureMapper::layer() method. * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: (WebKit::LayerTreeHostGtk::initialize): (WebKit::LayerTreeHostGtk::layerFlushTimerFired): (WebKit::LayerTreeHostGtk::compositeLayersToContext): 2014-11-16 Tim Horton Use TextIndicator instead of the built in Lookup highlight https://bugs.webkit.org/show_bug.cgi?id=138775 Follow-up to r176164. * UIProcess/API/mac/WKView.mm: (-[WKView dealloc]): (-[WKView initWithFrame:context:configuration:webView:]): * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::didPerformDictionaryLookup): Include the softlinking macros directly in the files they're used in, as they're supposed to be used. 2014-11-16 Tim Horton Use TextIndicator instead of the built in Lookup highlight https://bugs.webkit.org/show_bug.cgi?id=138775 Reviewed by Anders Carlsson. In order to make the yellow highlight for Lookup more accurately match the painted content of the web page (in light of e.g. Web fonts, and interesting text features that only WebKit implements and cannot round-trip through NSAttributedString), use a TextIndicator instead of the built-in Lookup highlight where possible. * Configurations/BaseTarget.xcconfig: Make it possible to include headers from private frameworks. This matches WebCore. * Shared/DictionaryPopupInfo.cpp: (WebKit::DictionaryPopupInfo::encode): (WebKit::DictionaryPopupInfo::decode): * Shared/DictionaryPopupInfo.h: Include the attributed string inside the DictionaryPopupInfo, instead of as a secondary argument to DidPerformDictionaryLookup. Add a TextIndicator to DictionaryPopupInfo, which can be used to highlight the text in the UI process. * UIProcess/API/mac/WKView.mm: (-[WKView dealloc]): (-[WKView viewDidMoveToWindow]): (-[WKView _dictionaryLookupPopoverWillClose:]): (-[WKView _setTextIndicator:fadeOut:animate:animationCompletionHandler:]): (-[WKView _setTextIndicator:fadeOut:animate:]): (-[WKView initWithFrame:context:configuration:webView:]): (+[WKView hideWordDefinitionWindow]): * UIProcess/API/mac/WKViewInternal.h: Adopt the Lookup SPI header. If we have the requisite API, register the notification that Lookup sends when the popover closes, and hook that up to hide the text indicator. Add a version of _setTextIndicator: that takes an animation completion handler. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::didPerformDictionaryLookup): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::didPerformDictionaryLookup): Adjust to the new didPerformDictionaryLookup signature. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): Remove a WKSI import. * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::didPerformDictionaryLookup): If we have the requisite API, disable Lookup's built-in highlight and present a TextIndicator instead. We currently have to run the animations serially (first bounce the TextIndicator, then animate in the Lookup popover) because the act of adding the Lookup popover blocks us from getting any animation events for the TextIndicator, and breaks the bounce. We could also fix this by using a threaded animation for the TextIndicator, but it's not clear that it's safe to do so. (WebKit::PageClientImpl::dismissDictionaryLookupPanel): When explicitly dismissing the Lookup panel, also hide the text indicator. * UIProcess/mac/TextIndicatorWindow.h: * UIProcess/mac/TextIndicatorWindow.mm: (WebKit::TextIndicatorWindow::setTextIndicator): Store the completion handler. (WebKit::TextIndicatorWindow::bounceAnimationDidEnd): Call the completion handler when the animation completes. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _createActionMenuItemForTag:]): Disable the Lookup item if lookup is not available. * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::showDefinitionForAttributedString): Adjust to the new didPerformDictionaryLookup signature. Since PDFPlugin can't trivially repaint the required part of the PDF, we don't build a TextIndicator. This will result in PDFPlugin continuing to use Lookup's built-in highlight. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performDictionaryLookupForRange): Build a TextIndicator from the Lookup range and pass it along with the DictionaryPopupInfo. 2014-11-15 David Kilzer REGRESSION (r176137): iOS build broke after moving DataDetectors scanning code to WebCore This regressed with the following commit: Move DataDetectors scanning code to WebCore https://bugs.webkit.org/show_bug.cgi?id=138731 * Shared/mac/ActionMenuHitTestResult.mm: Add PLATFORM(MAC) check around the entire implementation since it it unused on iOS. 2014-11-14 Anders Carlsson Raise an exception if -[WKWebView initWithFrame:configuration:] is passed a nil configuration https://bugs.webkit.org/show_bug.cgi?id=138757 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): 2014-11-15 Carlos Garcia Campos Network process crash when running http/tests/appcache/fallback.html https://bugs.webkit.org/show_bug.cgi?id=138740 Reviewed by Alexey Proskuryakov. It happens because ResourceHandle::continueWillSendRequest() is called with a null request. We could handle that case in the ResourceHandle, but the thing is tha the behaviour is not the same for async loads, or when loading in the web process. In WebResourceLoader::willSendRequest(), ResourceRequest::willSendRequest() is called, and cancels the load if the client returns a null request. In this case, the ResourceLoader is detached and WebResourceLoader::willSendRequest() returns early without sending the ContinueWillSendRequest message to the network process. However, for synchronous loads, NetworkResourceLoader::continueWillSendRequest() is always called. Fixes http/tests/appcache/fallback.html for GTK port when using the network process. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::continueWillSendRequest): Do not call ResourceHandle::continueWillSendRequest() if the client request is null, since the load is going to be cancelled. 2014-11-15 Tim Horton Implement data detectors and mailto action menus for WebKit1 https://bugs.webkit.org/show_bug.cgi?id=138765 Reviewed by Beth Dakin. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _defaultMenuItemsForMailtoLink]): 2014-11-14 Tim Horton Remove pre-[DDActionContext contextForView:...] fallback path https://bugs.webkit.org/show_bug.cgi?id=138735 Reviewed by Simon Fraser. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController willOpenMenu:withEvent:]): (-[WKActionMenuController didCloseMenu:withEvent:]): (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]): (hasDataDetectorsCompletionAPI): Deleted. Remove the now-unnecessary fallback path. 2014-11-14 Tim Horton Frequent crashes under actionContextForResultAtPoint https://bugs.webkit.org/show_bug.cgi?id=138761 Reviewed by Dean Jackson. * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp: (PageOverlayClientImpl::actionContextForResultAtPoint): Initialize apiRange. 2014-11-14 Daniel Bates [iOS] CoreGraphics SPI not available in public SDK https://bugs.webkit.org/show_bug.cgi?id=138709 Reviewed by David Kilzer. Include header CoreGraphicsSPI.h instead of including headers of CoreGraphics directly. * UIProcess/API/Cocoa/WKWebView.mm: * UIProcess/ios/WKScrollView.mm: 2014-11-14 Tim Horton Move DataDetectors scanning code to WebCore https://bugs.webkit.org/show_bug.cgi?id=138731 Reviewed by Anders Carlsson. Move DataDetectors scanning code to WebCore, so that both WebKits can use it. * Shared/TextIndicator.cpp: (WebKit::TextIndicator::createWithRange): Move createWithRange in from WebPageMac's textIndicatorForRange. (WebKit::TextIndicator::createWithSelectionInFrame): * Shared/TextIndicator.h: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::createSelectionSnapshot): * WebProcess/WebPage/WebFrame.h: Constify some things. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performActionMenuHitTestAtLocation): Avoid using the DD result if it didn't come with a non-null Range. Make use of detectItemAroundHitTestResult and TextIndicator::createWithRange. (WebKit::scanForDataDetectedItems): Deleted. (WebKit::textIndicatorForRange): Deleted. Moved these two to other places. 2014-11-14 Dan Bernstein Wrong (off-by-1) navigation snapshots shown after a mix of gesture and button back/forward navigation https://bugs.webkit.org/show_bug.cgi?id=138753 Reviewed by Tim Horton. Rather than having the UI process record a snapshot jut before the Web Content process’s notion of its current back/forward list item changes, have the UI process record a snapshot right before its own current back/forward list item changes. This ensures that the right snapshot gets attached to the right item in the UI process. * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::addItem): If there is a current item, record a navigation snapshot of it before making the new item current. (WebKit::WebBackForwardList::goToItem): If there is a current item, record a navigation snapshot of it before making another item current. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::willChangeCurrentHistoryItemForMainFrame): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Removed willChangeCurrentHistoryItemForMainFrame message. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::willChangeCurrentHistoryItem): Deleted. * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: Removed declaration of willChangeCurrentHistoryItem override. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::willChangeCurrentHistoryItemForMainFrame): Deleted. * WebProcess/WebPage/WebPage.h: 2014-11-14 Dan Bernstein Add some tracing to help investigating [iOS] Crash due to null m_webPageProxyForBackForwardListForCurrentSwipe in ViewGestureController::endSwipeGesture https://bugs.webkit.org/show_bug.cgi?id=138750 Reviewed by Tim Horton. Emit trace messages at various points, and log them prior to crashing if the error condition occurs. Otherwise, clear the trace messages. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::addLogEntry): Helper function that adds a message, including a time stamp and a backtrace, to m_logEntries. (WebKit::dumpLogEntries): Helper function that logs everything in m_logEntries. (WebKit::ViewGestureController::beginSwipeGesture): Add a log entry. (WebKit::ViewGestureController::endSwipeGesture): If m_webPageProxyForBackForwardListForCurrentSwipe is null, dump the log entries just before crashing. Otherwise, clear m_logEntries. (WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree): Add a log entry. (WebKit::ViewGestureController::removeSwipeSnapshot): Add a log entry. * UIProcess/mac/ViewGestureController.h: Defined ENABLE_VIEW_GESTURE_CONTROLLER_TRACING, and added m_logEntries member variable. 2014-11-14 Beth Dakin URLs for some videos are not valid URLs, should not be exposed to action menu https://bugs.webkit.org/show_bug.cgi?id=138746 -and corresponding- rdar://problem/18941927 Reviewed by Tim Horton. If the video cannot be downloaded, that is also an indication that the URL of the video will not be valid on its own. In these cases, we should share or copy the main page’s URL. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _defaultMenuItemsForVideo]): (-[WKActionMenuController _copyVideoURL:]): 2014-11-14 Carlos Garcia Campos [SOUP] Encode/Decode allowCookies in ResourceRequest https://bugs.webkit.org/show_bug.cgi?id=138730 Reviewed by Sergio Villar Senin. We are not sending this information to the network process, making cookies always available. Fixes http/tests/xmlhttprequest/cross-origin-no-authorization.html when network process is enabled. * Shared/soup/WebCoreArgumentCodersSoup.cpp: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): 2014-11-14 Zan Dobersek Unreviewed build fix for the GTK+ port using Clang. * UIProcess/gtk/RedirectedXCompositeWindow.h: Include the header for the use of std::function<>. 2014-11-13 Dan Bernstein Two WKWebView internal methods are implemented in a category https://bugs.webkit.org/show_bug.cgi?id=138728 Reviewed by Tim HOrton. Moved the implementations from the category to the class. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _ignoresNonWheelMouseEvents]): (-[WKWebView _setIgnoresNonWheelMouseEvents:]): 2014-11-13 Myles C. Maxfield Move FontMac and FontCacheMac off of WKSI https://bugs.webkit.org/show_bug.cgi?id=138633 Reviewed by Simon Fraser. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): * mac/WebKit2.order: 2014-11-13 Eric Carlson Context menus should not offer the "Download video" option for videos that cannot be downloaded https://bugs.webkit.org/show_bug.cgi?id=138530 -and corresponding- rdar://problem/18919130 Reviewed by Tim Horton. Expose isDownloadableMedia() to the InjectedBundleHitTestResult. * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp: (WKBundleHitTestResultIsDownloadableMedia): * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h: * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp: (WebKit::InjectedBundleHitTestResult::isDownloadableMedia): * WebProcess/InjectedBundle/InjectedBundleHitTestResult.h: 2014-11-13 Daniel Bates [iOS] NSGeometry data types are not available in the public SDK https://bugs.webkit.org/show_bug.cgi?id=137536 Reviewed by David Kilzer. Substitute header WAKAppKitStubs.h for NSGeometry.h as the latter is a private header. * Shared/ios/NativeWebTouchEventIOS.mm: 2014-11-13 Simon Fraser [WK2] Fire a layout milestone on session restore based on render tree size https://bugs.webkit.org/show_bug.cgi?id=138711 rdar://problem/16033854 Reviewed by Anders Carlsson. Add a session-restore layout milestone which fires after restoring a session, when the render tree size reaches 50% of the size saved in the session state. * Shared/SessionState.h: Add renderTreeSize. * UIProcess/API/Cocoa/WKWebView.mm: (layoutMilestones): Translate from SPI to WebCore milestones. * UIProcess/API/Cocoa/WKWebViewPrivate.h: New iOS-only milestone, er, event. * UIProcess/Cocoa/NavigationState.mm: (WebKit::renderingProgressEvents): Translate from WebCore milestone to rendering event. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): Init stuff. (WebKit::WebPageProxy::sessionState): (WebKit::WebPageProxy::restoreFromSessionState): Zero out the target render tree size, then get it out of session state and set the flag to say that we haven't reached it yet. (WebKit::WebPageProxy::listenForLayoutMilestones): Set a flag to know that we should fire the milestone. The other milestones get sent directly to WebCore. * UIProcess/WebPageProxy.h: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::exceedsRenderTreeSizeSizeThreshold): Return true when we've reached 50%. (WebKit::WebPageProxy::didCommitLayerTree): Fire the milestone when appropriate. * UIProcess/mac/LegacySessionStateCoding.cpp: Rev the session state data for iOS (where doing so is less disruptive). Standardize some CFString constants. (WebKit::encodeSessionHistory): Wrap for legibility. (WebKit::encodeLegacySessionState): Make a CFNumber for render tree size, and store it in the root dictionary. (WebKit::decodeBackForwardTreeNode): Move a comment to match another similar block. (WebKit::decodeLegacySessionState): Decode render tree size and store it. 2014-11-13 Tim Horton Adjust the WKBundlePageOverlay Data Detectors SPI https://bugs.webkit.org/show_bug.cgi?id=138685 Reviewed by Anders Carlsson. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]): Forward DDActionContext callbacks to the Web process. * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h: * WebProcess/WebPage/WebPageOverlay.cpp: * WebProcess/WebPage/WebPageOverlay.h: Add four DataDetectors-related WebKit2-only page overlay callbacks: (WebKit::WebPageOverlay::actionContextForResultAtPoint): Called during the action menu hit test; clients can reply with a DDActionContext and a DOM range, and WebKit will treat that result and range as if it had detected it itself, building the action menu and showing the yellow highlight as usual. (WebKit::WebPageOverlay::dataDetectorsPresentedUI): (WebKit::WebPageOverlay::dataDetectorsChangedUI): (WebKit::WebPageOverlay::dataDetectorsHidUI): These correspond to the DDActionContext callbacks, and can be used by clients to show/hide corresponding UI while DataDetectors in the UI process is presenting UI. (WebKit::WebPageOverlay::prepareForActionMenu): Deleted. Get rid of prepareForActionMenu, as nobody ever used it. * WebProcess/WebPage/WebPage.cpp: Add WebPageOverlay.h so that we can build, because the destructor lives here. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performActionMenuHitTestAtLocation): Give all of the WebPageOverlays the first shot at data detection; if none of them reply with a valid DDActionContext/DOM range, we'll go ahead and do our normal detection. (WebKit::WebPage::dataDetectorsPresentedUI): (WebKit::WebPage::dataDetectorsChangedUI): (WebKit::WebPage::dataDetectorsHidUI): Forward these along to the active WebPageOverlay. 2014-11-13 Carlos Garcia Campos [SOUP] Missing ResourceRequest members encoded/decoded https://bugs.webkit.org/show_bug.cgi?id=138694 Reviewed by Sergio Villar Senin. At least timeoutInterval and priority should also be encoded/decoded. This fixes all http/tests/xmlhttprequest/timeout/ tests when using the network process, since the timeout is always 0 for all requests that we send to the network process. * Shared/soup/WebCoreArgumentCodersSoup.cpp: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): 2014-11-12 Ryuan Choi [EFL] Fix the build with EFL 1.12 https://bugs.webkit.org/show_bug.cgi?id=138245 Reviewed by Gyuyoung Kim. * UIProcess/API/efl/EwkView.cpp: First, modified to use Evas_GL raw pointer instead of UniquePtrEfl because Evas_GL.h can't be included in UniquePtrEfl.h It should be moved into EvasGLContext because WebKit/EFL use only one Evas_GL. Second, provided the version of GLES in Evas_GL_Config not to break build with EFL 1.12 (EwkView::EwkView): (EwkView::~EwkView): (EwkView::displayTimerFired): (EwkView::createGLSurface): * UIProcess/API/efl/EwkView.h: 2014-11-12 Ada Chan Fix the iOS build. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::pageMutedStateDidChange): 2014-11-05 Ada Chan Implement new plug-in API for muting plug-ins https://bugs.webkit.org/show_bug.cgi?id=138105 Reviewed by Anders Carlsson. Handle the setting of NPNVmuteAudioBool on the plug-in. * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::PluginControllerProxy): Initialize m_isMuted. (WebKit::PluginControllerProxy::mutedStateChanged): Tell the plugin about the new muted state. * PluginProcess/PluginControllerProxy.h: * PluginProcess/PluginControllerProxy.messages.in: Add the MutedStateChanged message. * PluginProcess/PluginCreationParameters.cpp: (WebKit::PluginCreationParameters::PluginCreationParameters): Initialize isMuted. (WebKit::PluginCreationParameters::encode): Handle isMuted. (WebKit::PluginCreationParameters::decode): Ditto. * PluginProcess/PluginCreationParameters.h: * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::NPN_GetValue): Get the plug-in's muted state. * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::isMuted): Get the muted state from PluginControllerProxy. (WebKit::NetscapePlugin::mutedStateChanged): Call NPP_SetValue with NPNVmuteAudioBool and the updated muted state. * WebProcess/Plugins/Netscape/NetscapePlugin.h: * WebProcess/Plugins/Plugin.h: (WebKit::Plugin::mutedStateChanged): * WebProcess/Plugins/PluginController.h: * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::initialize): Set m_pendingPluginCreationParameters->isMuted. (WebKit::PluginProxy::mutedStateChanged): Send the MutedStateChanged message to the plugin process. * WebProcess/Plugins/PluginProxy.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::pageMutedStateDidChange): Call Plugin::mutedStateChanged() with the page's muted state. (WebKit::PluginView::isMuted): Get the page's current muted state. * WebProcess/Plugins/PluginView.h: 2014-11-12 Tim Horton Two action menu item titles are swapped https://bugs.webkit.org/show_bug.cgi?id=138667 Reviewed by Beth Dakin. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _createActionMenuItemForTag:]): Swap them back. 2014-11-12 Commit Queue Unreviewed, rolling out r175806. https://bugs.webkit.org/show_bug.cgi?id=138666 Capturing CString is not thread safe (Requested by anttik on #webkit). Reverted changeset: "[WK2] Use C++ lambdas in IPC::Connection" https://bugs.webkit.org/show_bug.cgi?id=138018 http://trac.webkit.org/changeset/175806 2014-11-12 Tim Horton Need to show the text indicator when Data Detectors shows a popover https://bugs.webkit.org/show_bug.cgi?id=138664 Reviewed by Beth Dakin. * UIProcess/mac/WKActionMenuController.h: * UIProcess/mac/WKActionMenuController.mm: (hasDataDetectorsCompletionAPI): Determine if we have the new API. (-[WKActionMenuController willDestroyView:]): (-[WKActionMenuController willOpenMenu:withEvent:]): Make use of the new API. If we wanted to show a Data Detectors menu but have no items (or they're all disabled), cancel the menu. If we don't have it, manually manipulate the highlight. (-[WKActionMenuController didCloseMenu:withEvent:]): Make use of the new API. If we don't have it, manually manipulate the highlight. (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]): Set up completion handlers if we have the new API; when DataDetectors presents UI, show the text indicator, when it dismisses, hide it. If we don't have the API, manually manipulate the highlight. 2014-11-12 Tim Horton Make action menus much more reliable https://bugs.webkit.org/show_bug.cgi?id=138654 Reviewed by Anders Carlsson. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController prepareForMenu:withEvent:]): Remove MenuUpdateStage; nothing actually uses this value, we just pass it around. (-[WKActionMenuController didPerformActionMenuHitTest:userData:]): Update the menu as soon as we have a reply from the Web process. (-[WKActionMenuController menuNeedsUpdate:]): If our sync-wait for the Web process' reply times out, we should still update the menu to remove the placeholder separator item. (-[WKActionMenuController _updateActionMenuItems]): (-[WKActionMenuController _updateActionMenuItemsForStage:]): Deleted. If we have our final answer for this menu (_state == Ready), and the final answer has no items in the menu, cancel tracking on the menu. 2014-11-12 Carlos Garcia Campos [GTK] Move RedirectedXCompositeWindow from platform to WebKit2 layer https://bugs.webkit.org/show_bug.cgi?id=138093 Reviewed by Martin Robinson. It's only used by WebKitWebViewBase. While moving the code the following cleanups have been made: - Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL. - Use a helper class XDamageNotifier to handle the XDamage events filtering and notification. - Use std::function instead of pointer to function for the damage callback. - Pass the X display to the RedirectedXCompositeWindow constructor and keep it as a member to use it everywhere, instead of using the default display in some places and the widget display in others. - Pass the damage notify function as a contructor parameter of RedirectedXCompositeWindow instead of setting the callback right after creating the object. - Remove GLContextNeeded and all the dead code related to the CreateGLContext mode that is no longer used. - Rename cairoSurfaceForWidget() as surface(). - windowId() has been renamed as windowID() and made const. - Use std::unique_ptr instead of PassOwnPtr. - Fix coding style issues. * PlatformGTK.cmake: * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseConstructed): (webkitWebViewRenderAcceleratedCompositingResults): (webkitWebViewBaseCreateWebPage): (redirectedWindowDamagedCallback): Deleted. * UIProcess/gtk/RedirectedXCompositeWindow.cpp: Renamed from Source/WebCore/platform/gtk/RedirectedXCompositeWindow.cpp. (WebKit::XDamageNotifier::XDamageNotifier): (WebKit::XDamageNotifier::add): (WebKit::XDamageNotifier::remove): (WebKit::XDamageNotifier::filterXDamageEvent): (WebKit::XDamageNotifier::filterXEvent): (WebKit::xDamageNotifier): (WebKit::supportsXDamageAndXComposite): (WebKit::RedirectedXCompositeWindow::create): (WebKit::RedirectedXCompositeWindow::RedirectedXCompositeWindow): (WebKit::RedirectedXCompositeWindow::~RedirectedXCompositeWindow): (WebKit::RedirectedXCompositeWindow::resize): (WebKit::RedirectedXCompositeWindow::cleanupPixmapAndPixmapSurface): (WebKit::RedirectedXCompositeWindow::surface): * UIProcess/gtk/RedirectedXCompositeWindow.h: Renamed from Source/WebCore/platform/gtk/RedirectedXCompositeWindow.h. (WebKit::RedirectedXCompositeWindow::windowID): 2014-09-01 Philippe Normand [WK2] UserMediaClient support https://bugs.webkit.org/show_bug.cgi?id=123158 Reviewed by Benjamin Poulain. Support for UserMediaPermissionRequest in WebKit2. It's implemented similarily to the GeolocationPermissionRequest support. When the WebPage requires this permission it sends a message to the UI process which at some point grants or denies the permission and sends the result back to the WebProcess. * CMakeLists.txt: Generic CMake support for new files. * Shared/API/c/WKBase.h: New type for UserMediaPermissionRequest. * Shared/APIObject.h: Ditto. * UIProcess/API/C/WKAPICast.h: PermissionRequest API mapping. * UIProcess/API/APIUIClient.h: New decidePolicy handler for UserMediaPermissionRequest. (API::UIClient::decidePolicyForUserMediaPermissionRequest): * UIProcess/API/C/WKPage.cpp: Ditto. (WKPageSetPageUIClient): * UIProcess/API/C/WKPageUIClient.h: WKPageUIClient version bump to 5, including the new decidePolicyForUserMediaPermissionRequest member. * UIProcess/API/C/WKUserMediaPermissionRequest.cpp: Added, C API implementation of the UserMediaPermissionRequest. (WKUserMediaPermissionRequestGetTypeID): (WKUserMediaPermissionRequestAllow): (WKUserMediaPermissionRequestDeny): * UIProcess/API/C/WKUserMediaPermissionRequest.h: Added. * UIProcess/API/C/WebKit2_C.h: * UIProcess/UserMediaPermissionRequestManagerProxy.h: Added. * UIProcess/UserMediaPermissionRequestProxy.cpp: Added, proxy object for the UserMediaPermissionRequestType. (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy): (WebKit::UserMediaPermissionRequestProxy::allow): (WebKit::UserMediaPermissionRequestProxy::deny): (WebKit::UserMediaPermissionRequestProxy::invalidate): * UIProcess/UserMediaPermissionRequestProxy.h: Added. (WebKit::UserMediaPermissionRequestProxy::create): (WebKit::UserMediaPermissionRequestProxy::mediaParameters): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::requestUserMediaPermissionForFrame): Defer UserPermissionRequest to the UIClient. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: New message to handle UserMediaPermissionRequests. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp: Added, WebProcess side of the UserRequestManager, keeping track of each permission request. (WebKit::generateRequestID): (WebKit::UserMediaPermissionRequestManager::UserMediaPermissionRequestManager): (WebKit::UserMediaPermissionRequestManager::startRequest): (WebKit::UserMediaPermissionRequestManager::cancelRequest): (WebKit::UserMediaPermissionRequestManager::didReceiveUserMediaPermissionDecision): * WebProcess/MediaStream/UserMediaPermissionRequestManager.h: Added. * WebProcess/WebCoreSupport/WebUserMediaClient.cpp: Added, WebProcess implementation of the WebCore::UserMediaClient. (WebKit::WebUserMediaClient::WebUserMediaClient): (WebKit::WebUserMediaClient::pageDestroyed): (WebKit::WebUserMediaClient::requestPermission): (WebKit::WebUserMediaClient::cancelRequest): * WebProcess/WebCoreSupport/WebUserMediaClient.h: Added. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): Create the UserMediaPermissionRequestManager and register the UserMediaClient to the page. (WebKit::WebPage::didReceiveUserMediaPermissionDecision): Dispatch decision to manager. * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::userMediaPermissionRequestManager): * WebProcess/WebPage/WebPage.messages.in: New Message to handle permission decision result from the UI process. 2014-11-11 Tim Horton Add support for mailto: link action menus https://bugs.webkit.org/show_bug.cgi?id=138641 Reviewed by Beth Dakin. * Shared/API/c/WKActionMenuTypes.h: Add a new type for mailto links. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _defaultMenuItemsForMailtoLink]): Build a DDActionContext and grab menu items for our mailto link. (-[WKActionMenuController _defaultMenuItems]): Get menu items from _defaultMenuItemsForMailtoLink if needed. 2014-11-11 Conrad Shultz Clients should be notified when a page preview finishes https://bugs.webkit.org/show_bug.cgi?id=138635 Reviewed by Tim Horton. Add SPI to WKView to allow clients to do any cleanup that might be necessary when the preview closes. * UIProcess/API/Cocoa/WKViewPrivate.h: Declare new SPI. * UIProcess/API/mac/WKView.mm: (-[WKView _finishPreviewingURL:withPreviewView:]): Stub SPI implementation. * UIProcess/mac/WKActionMenuController.h: Add an ivar for the preview view controller. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _createPreviewPopoverForURL:originRect:]): Update to use the ivar. (-[WKActionMenuController _clearPreviewPopover]): Send -_finishPreviewingURL:withPreviewView: and nil out the view controller ivar. 2014-11-11 Tim Horton Update artwork for some action menu items https://bugs.webkit.org/show_bug.cgi?id=138634 Reviewed by Anders Carlsson. * Resources/OpenInNewWindowTemplate.pdf: Removed. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _createActionMenuItemForTag:]): (webKitBundleImageNamed): Deleted. * WebKit2.xcodeproj/project.pbxproj: Get rid of our custom art, and use system art for two more items. 2014-11-11 Alexey Proskuryakov DRT and WKTR touch disk cache https://bugs.webkit.org/show_bug.cgi?id=138622 Reviewed by Geoffrey Garen. Setting a cache model has a very strange behavior in WebKit2, where it ignores sizes that were explicitly passed from UI process, and uses different ones. As setCacheModel() is always called on launch, it always creates a non-empty disk cache. The design needs to be improved one day, but for now, just make sure that we never create a disk cache during testing. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::NetworkProcess): (WebKit::NetworkProcess::initializeNetworkProcess): * NetworkProcess/NetworkProcess.h: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): (WebKit::NetworkProcess::platformSetCacheModel): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): (WebKit::WebProcess::initializeWebProcess): * WebProcess/WebProcess.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformSetCacheModel): (WebKit::WebProcess::platformInitializeWebProcess): 2014-11-11 Eric Carlson [iOS] a page with video in optimized fullscreen is visible https://bugs.webkit.org/show_bug.cgi?id=138632 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _isPlayingFullscreenOptimizedVideo]): New. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::isViewVisible): Return true if displaying optimized fullscreen video. 2014-11-11 Tim Horton Occasional assertion failure under recommendedScrollbarStyleDidChange() https://bugs.webkit.org/show_bug.cgi?id=138604 Reviewed by Beth Dakin. It is possible for AppKit to install tracking areas into our view behind our back, but we have code that depends on knowing exactly the set of tracking areas installed on WKView. Make this more robust by keeping a reference to the tracking area we use for many things and manipulating that instead of making assumptions about the total set of tracking areas on WKView. * UIProcess/API/mac/WKView.mm: (-[WKView _primaryTrackingArea]): (-[WKView _replacePrimaryTrackingArea:]): Provide a 'primary' tracking area setter/getter. (-[WKView initWithFrame:context:configuration:webView:]): Keep a reference to the original tracking area installed at initialization time. * UIProcess/API/mac/WKViewInternal.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::recommendedScrollbarStyleDidChange): Instead of walking the set of tracking areas, make use of the fact that we know exactly which tracking area we installed, and uninstall just that one, and replace it with our newly-built one. 2014-11-11 Myles C. Maxfield Finish moving CTFontGetVerticalGlyphsForCharacters and CTLineCreateWithUniCharProvider out from WKSI https://bugs.webkit.org/show_bug.cgi?id=138623 Reviewed by Geoff Garen. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): * mac/WebKit2.order: 2014-11-11 Timothy Horton Add a respondsToSelector check to dismissActionMenuPopovers ​https://bugs.webkit.org/show_bug.cgi?id=138600 Reviewed by Beth Dakin. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController dismissActionMenuPopovers]): Avoid calling this wherever it doesn't exist. 2014-11-11 Tim Horton DataDetectors' menu items aren't presented in the telephone number menu https://bugs.webkit.org/show_bug.cgi?id=138602 Reviewed by Beth Dakin. We currently round-trip the DataDetectors telephone number NSMenuItems through the very-lossy WebContextMenuItemData, for no real reason. We should avoid this so that DataDetectors' actual NSMenuItems are presented in the final menu, so that they can adjust their items after providing them to us. * Platform/mac/MenuUtilities.h: * Platform/mac/MenuUtilities.mm: (WebKit::menuItemTitleForTelephoneNumber): Deleted. Stop adjusting the menu item titles, as they come correct now. (WebKit::menuItemsForTelephoneNumber): Deleted. (WebKit::menuForTelephoneNumber): Return a fully-formed menu for the single telephone number case. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::showTelephoneNumberMenu): Present the fully-formed menu, without round-tripping through WebContextMenuItemData, because we do not need to hand the items to the context menu client (and indeed, were not), and because this allows us to use the exact items returned by DataDetectors, so they can keep ahold of the items that we actually present. * UIProcess/PageClient.h: * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::showPlatformContextMenu): Add a Mac-only PageClient function for presenting a NSMenu at a WKView-relative point. 2014-11-11 Tim Horton Adopt DDActionContext menu type SPI https://bugs.webkit.org/show_bug.cgi?id=138603 Reviewed by Anders Carlsson. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]): Use the new SPI instead of WKSI. 2014-11-11 Tim Horton Data Detectors popovers should be dismissed upon scrolling https://bugs.webkit.org/show_bug.cgi?id=138600 Reviewed by Beth Dakin. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController prepareForMenu:withEvent:]): Dismiss popovers when we start preparing another menu. (-[WKActionMenuController dismissActionMenuPopovers]): Use the new DataDetectors SPI. 2014-11-11 Tim Horton Localize strings for action menus https://bugs.webkit.org/show_bug.cgi?id=138591 Reviewed by Dan Bates. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _showTextIndicator]): (-[WKActionMenuController _hideTextIndicator]): (-[WKActionMenuController _createActionMenuItemForTag:]): Make use of the new strings. 2014-11-11 Myles C. Maxfield Cleanup from r175379 https://bugs.webkit.org/show_bug.cgi?id=138616 Reviewed by Simon Fraser. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): * mac/WebKit2.order: 2014-11-11 Myles C. Maxfield Move CTFontTransformGlyphs out from WKSI https://bugs.webkit.org/show_bug.cgi?id=138599 Reviewed by Simon Fraser. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): * mac/WebKit2.order: 2014-11-10 Simon Fraser Fix possible crash when closing the web inspector https://bugs.webkit.org/show_bug.cgi?id=138597 rdar://problem/18872688 Reviewed by Andreas Kling. I reported a crash when reloading a page after inspecting it, possibly caused by r172864. Speculatively fix by null-checking the main frame. * WebProcess/WebCoreSupport/WebInspectorClient.cpp: (WebKit::WebInspectorClient::~WebInspectorClient): 2014-11-10 Beth Dakin Whitespace action menus aren't working properly https://bugs.webkit.org/show_bug.cgi?id=138585 -and corresponding- rdar://problem/18933586 Reviewed by Tim Horton. Treat the whitespace menu as a text menu. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController isMenuForTextContent]): 2014-11-10 Simon Fraser [iOS WK2] Scroll deceleration rate is wrong https://bugs.webkit.org/show_bug.cgi?id=138574 rdar://problem/18715303 Reviewed by Benjamin Poulain. The CSS Snap Points code incorrectly set the WKScrollView's deceleration rate, overriding the custom value that UIWebScrollView sets. Fix by having WKScrollView store the custom rate at init time, and using that value in -scrollViewWillBeginDragging:. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView scrollViewWillBeginDragging:]): * UIProcess/ios/WKScrollView.h: * UIProcess/ios/WKScrollView.mm: (-[WKScrollView initWithFrame:]): 2014-11-09 Ada Chan Reset WebPageProxy's isPlayingAudio state after web process crash or page invalidation. https://bugs.webkit.org/show_bug.cgi?id=138559 Reviewed by Andreas Kling. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::resetState): 2014-11-10 Beth Dakin WK1: Support default actions for read-only text https://bugs.webkit.org/show_bug.cgi?id=138552 -and corresponding- rdar://problem/18877483 Reviewed by Tim Horton. WK1 now needs to do a lot of dictionary lookup operations that it did not previously have to handle. So this patch takes a lot of that functionality, which was implemented as static functions in WebPageMac for WK2 and moves it into WebCore. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performDictionaryLookupForRange): (WebKit::isPositionInRange): Deleted. (WebKit::shouldUseSelection): Deleted. (WebKit::rangeExpandedAroundPositionByCharacters): Deleted. (WebKit::rangeForDictionaryLookupForSelection): Deleted. (WebKit::rangeForDictionaryLookupAtHitTestResult): Deleted. 2014-11-10 Dan Bernstein iOS build fix. * UIProcess/ios/RemoteLayerTreeHostIOS.mm: (WebKit::RemoteLayerTreeHost::createLayer): 2014-11-10 Zan Dobersek [WK2] Use C++ lambdas in IPC::Connection https://bugs.webkit.org/show_bug.cgi?id=138018 Reviewed by Anders Carlsson. Replace uses of WTF::bind() in the IPC::Connection class with C++11 lambdas. * Platform/IPC/Connection.cpp: (IPC::Connection::SyncMessageState::processIncomingMessage): (IPC::Connection::dispatchWorkQueueMessageReceiverMessage): (IPC::Connection::invalidate): (IPC::Connection::sendMessage): (IPC::Connection::processIncomingMessage): (IPC::Connection::enqueueIncomingMessage): * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::initializeDeadNameSource): (IPC::Connection::receiveSourceEventHandler): * Platform/IPC/unix/ConnectionUnix.cpp: (IPC::Connection::open): 2014-11-09 Gyuyoung Kim Remove create() factory function in FooAnimationValue classes https://bugs.webkit.org/show_bug.cgi?id=138206 Reviewed by Darin Adler. As a step to use std::unique_ptr and std::make_unique, this patch removes create() factory function in FooAnimationValue classes. As this changes, FooAnimationValue::create() are changed to std::make_unique<>. * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: (IPC::ArgumentCoder::decode): * WebProcess/WebCoreSupport/WebInspectorClient.cpp: (WebKit::WebInspectorClient::showPaintRect): 2014-11-09 Chris Dumez Unreviewed, fix typo in r175796. Rename areEssentialEqualAsFloat to areEssentiallyEqualAsFloat. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::areEssentiallyEqualAsFloat): (WebKit::WebPage::dynamicViewportSizeUpdate): (WebKit::areEssentialEqualAsFloat): Deleted. 2014-11-09 Chris Dumez Add a more correct way to compare floating point numbers and use it https://bugs.webkit.org/show_bug.cgi?id=138527 Reviewed by Darin Adler. Use the new WTF::areEssentuallyEqual() utility function from MathExtras.h to compare floating-point numbers. * UIProcess/API/Cocoa/WKWebView.mm: (withinEpsilon): * UIProcess/CoordinatedGraphics/PageViewportController.cpp: (WebKit::PageViewportController::updateMinimumScaleToFit): (WebKit::fuzzyCompare): Deleted. * UIProcess/CoordinatedGraphics/PageViewportController.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::withinEpsilon): * UIProcess/API/Cocoa/WKWebView.mm: (areEssentiallyEqualAsFloat): (-[WKWebView _didCommitLayerTree:]): (withinEpsilon): Deleted. * UIProcess/CoordinatedGraphics/PageViewportController.cpp: (WebKit::PageViewportController::updateMinimumScaleToFit): (WebKit::fuzzyCompare): Deleted. * UIProcess/CoordinatedGraphics/PageViewportController.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::areEssentialEqualAsFloat): (WebKit::WebPage::dynamicViewportSizeUpdate): (WebKit::withinEpsilon): Deleted. 2014-11-08 Simon Fraser Implement round-rect clipping on video elements https://bugs.webkit.org/show_bug.cgi?id=138537 rdar://problem/9534399 Reviewed by Darin Adler. Support border-radius on video and other layers with composited contents, by pushing a FloatRoundedRect onto the GraphicsLayer as the contentsClippingRect, and, on Mac, using layer corner-radius or a CAShapeLayer mask. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): * Shared/WebCoreArgumentCoders.h: * Shared/mac/RemoteLayerBackingStore.mm: New shape layer type. (WebKit::RemoteLayerBackingStore::drawInContext): * Shared/mac/RemoteLayerTreePropertyApplier.mm: (WebKit::applyPropertiesToLayer): Apply corner-radius and shape path. * Shared/mac/RemoteLayerTreeTransaction.h: Prettify the flags. Yes, I prefer this style. * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties): (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode): (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode): (WebKit::RemoteLayerTreeTextStream::operator<<): (WebKit::dumpChangedLayers): (WebKit::RemoteLayerTreeTransaction::description): * UIProcess/ios/RemoteLayerTreeHostIOS.mm: (+[WKShapeView layerClass]): Make UIViews with a CAShapeLayer layer class. (WebKit::RemoteLayerTreeHost::createLayer): * UIProcess/mac/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::createLayer): * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::updateClonedLayerProperties): (WebKit::isEquivalentLayer): (WebKit::PlatformCALayerRemote::setMask): (WebKit::PlatformCALayerRemote::setClonedLayer): (WebKit::PlatformCALayerRemote::cornerRadius): (WebKit::PlatformCALayerRemote::setCornerRadius): (WebKit::PlatformCALayerRemote::shapeRoundedRect): (WebKit::PlatformCALayerRemote::setShapeRoundedRect): * WebProcess/WebPage/mac/PlatformCALayerRemote.h: 2014-11-09 Conrad Shultz Move _ignoresNonWheelMouseEvents implementation to WKView(Private) https://bugs.webkit.org/show_bug.cgi?id=138487 Reviewed by Dan Bernstein. Relocate some methods that should have been in a category implementation. * UIProcess/API/mac/WKView.mm: (-[WKView _setIgnoresNonWheelMouseEvents:]): (-[WKView _ignoresNonWheelMouseEvents]): 2014-11-08 Beth Dakin WKActionMenuController methods should be more careful to use the best WebHitTestResult https://bugs.webkit.org/show_bug.cgi?id=138536 -and corresponding- rdar://problem/18919195 Reviewed by Tim Horton. This patch re-names _hitTestResultForStage to _webHitTestResult. The method no longer takes a stage since that value is really not necessary to determine the correct WebHitTestResult. This patch also makes all spots in this file that access a WebHitTestResult go through _webHitTestResult to ensure that they get the most up-to-date option. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController willOpenMenu:withEvent:]): (-[WKActionMenuController _openURLFromActionMenu:]): (-[WKActionMenuController _addToReadingListFromActionMenu:]): (-[WKActionMenuController _previewURLFromActionMenu:]): (-[WKActionMenuController _defaultMenuItemsForVideo]): (-[WKActionMenuController _copyVideoURL:]): (-[WKActionMenuController _saveVideoToDownloads:]): (-[WKActionMenuController _saveImageToDownloads:]): (-[WKActionMenuController _defaultMenuItems]): (-[WKActionMenuController _updateActionMenuItemsForStage:]): (imageForResource:name::switch): Deleted. (-[WKActionMenuController _defaultMenuItems:]): Deleted. 2014-11-08 Beth Dakin Implement action menu support for videos https://bugs.webkit.org/show_bug.cgi?id=138534 -and corresponding- rdar://problem/18742164 Reviewed by Tim Horton. New menu type and items types. * Shared/API/c/WKActionMenuItemTypes.h: * Shared/API/c/WKActionMenuTypes.h: Plumb isMediaThatCanBeDownloaded() up to WebHitTestResult. * Shared/WebHitTestResult.cpp: (WebKit::WebHitTestResult::Data::Data): (WebKit::WebHitTestResult::Data::encode): (WebKit::WebHitTestResult::Data::decode): * Shared/WebHitTestResult.h: (WebKit::WebHitTestResult::isMediaThatCanBeDownloaded): Re-name _canAddImageToPhotos to _canAddMediaToPhotos, which is more accurate. We might use this method for videos some day, so now it has an accurate name. * UIProcess/mac/WKActionMenuController.mm: Default items and their actions. (-[WKActionMenuController _defaultMenuItemsForVideo]): (-[WKActionMenuController _copyVideoURL:]): (-[WKActionMenuController _saveVideoToDownloads:]): (-[WKActionMenuController _defaultMenuItemsForImage]): (-[WKActionMenuController _canAddMediaToPhotos]): (-[WKActionMenuController _addImageToPhotos:]): (-[WKActionMenuController _createActionMenuItemForTag:]): (-[WKActionMenuController _defaultMenuItems:]): (-[WKActionMenuController _canAddImageToPhotos]): Deleted. We hit test including shadow content to get the desired result for editable text regions. But for media, we want to re-set to the shadow root. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performActionMenuHitTestAtLocation): 2014-11-08 Carlos Garcia Campos [GTK] Allow to create a view with a related page in WTR https://bugs.webkit.org/show_bug.cgi?id=138501 Reviewed by Martin Robinson. This is needed when running tests in multi web process mode. * UIProcess/API/C/gtk/WKView.cpp: (WKViewCreate): * UIProcess/API/C/gtk/WKView.h: 2014-11-07 Conrad Shultz "Lookup" action menu should read "Look up" https://bugs.webkit.org/show_bug.cgi?id=138509 Reviewed by Tim Horton. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _createActionMenuItemForTag:]): 2014-11-07 Beth Dakin Null deref performing Lookup on Apple Trailers full screen button https://bugs.webkit.org/show_bug.cgi?id=138513 -and corresponding- rdar://problem/18909699 Reviewed by Tim Horton. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performDictionaryLookupForSelection): 2014-11-07 Anshu Chimala Make it possible to associate snapshots with back/forward list items other than the current item. https://bugs.webkit.org/show_bug.cgi?id=138490 Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKViewPrivate.h: Declare -saveBackForwardSnapshotForItem:, an alternative to -saveBackForwardSnapshotForCurrentItem that accepts a back/forward list item as an argument. * UIProcess/API/mac/WKView.mm: (-[WKView saveBackForwardSnapshotForItem:]): Pass the provided back/forward list item along to WebPageProxy::recordNavigationSnapshot(). * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::recordNavigationSnapshot): Overloaded to optionally take a back/forward list item as an argument. If one isn't provided, default to the current item as before; otherwise, associate the snapshot with whichever item was provided. * UIProcess/WebPageProxy.h: Declare the new recordNavigationSnapshot() overload. * UIProcess/mac/ViewSnapshotStore.h: Make recordSnapshot() take a back/forward list item as an argument. * UIProcess/mac/ViewSnapshotStore.mm: (WebKit::ViewSnapshotStore::recordSnapshot): Store the snapshot in the provided back/forward list item instead of in the current item. 2014-11-07 Tim Horton Popovers do not dismiss when navigating back and forth using gestures https://bugs.webkit.org/show_bug.cgi?id=138512 Reviewed by Beth Dakin. * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::navigationGestureDidBegin): Dismiss action menu related popovers when navigation gestures begin. 2014-11-07 Beth Dakin Action menu preview popover should dismiss on scroll https://bugs.webkit.org/show_bug.cgi?id=138511 -and corresponding- rdar://problem/18901445 Reviewed by Tim Horton. This patch re-names dismissActionMenuDataDetectorPopovers() to dismissActionMenuPopovers() and also calls _clearPreviewPopover from that method as well. * UIProcess/API/mac/WKView.mm: (-[WKView viewDidMoveToWindow]): (-[WKView _dismissActionMenuPopovers]): (-[WKView _dismissActionMenuDataDetectorPopovers]): Deleted. * UIProcess/API/mac/WKViewInternal.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didCommitLoadForFrame): (WebKit::WebPageProxy::pageDidScroll): (WebKit::WebPageProxy::resetStateAfterProcessExited): * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::dismissActionMenuPopovers): (WebKit::PageClientImpl::dismissActionMenuDataDetectorPopovers): Deleted. * UIProcess/mac/WKActionMenuController.h: * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController dismissActionMenuPopovers]): (-[WKActionMenuController dismissActionMenuDataDetectorPopovers]): Deleted. 2014-11-07 Beth Dakin Support action menus for whitespace in editable areas https://bugs.webkit.org/show_bug.cgi?id=138488 -and corresponding- rdar://problem/18877717 Reviewed by Tim Horton. Very simple menu for whitespace in editable areas. * Shared/API/c/WKActionMenuTypes.h: * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _defaultMenuItemsForWhitespaceInEditableArea]): (-[WKActionMenuController _defaultMenuItems:]): 2014-11-07 Beth Dakin Invoking an action menu should dismiss existing selection https://bugs.webkit.org/show_bug.cgi?id=138496 -and corresponding- rdar://problem/18892787 Reviewed by Tim Horton. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController willOpenMenu:withEvent:]): 2014-11-07 Eric Carlson [iOS] Update optimized fullscreen media controls https://bugs.webkit.org/show_bug.cgi?id=138493 Reviewed by Brent Fulgham. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): Initialize GetMediaUIImageData. 2014-11-07 Antti Koivisto Add cache coders https://bugs.webkit.org/show_bug.cgi?id=138413 Reviewed by Anders Carlsson. Add encoding and decoding support for cache types. This is largely a copy of the IPC coder classes with some unnecessary features removed. The coders compute a type-sensitive checksum that can be used to verify the data integrity. The code is behind ENABLE(NETWORK_CACHE) and not yet used. * NetworkProcess/cache: Added. * NetworkProcess/cache/NetworkCacheCoder.h: Added. * NetworkProcess/cache/NetworkCacheCoders.cpp: Added. * NetworkProcess/cache/NetworkCacheCoders.h: Added. * NetworkProcess/cache/NetworkCacheDecoder.cpp: Added. * NetworkProcess/cache/NetworkCacheDecoder.h: Added. * NetworkProcess/cache/NetworkCacheEncoder.cpp: Added. * NetworkProcess/cache/NetworkCacheEncoder.h: Added. * WebKit2.xcodeproj/project.pbxproj: 2014-11-06 Conrad Shultz Clients should be able to customize the view used for page previews https://bugs.webkit.org/show_bug.cgi?id=138447 Reviewed by Tim Horton. Add SPI to WKView that clients can use to customize the view used in the page preview popover. * UIProcess/API/Cocoa/WKViewPrivate.h: Declare -_viewForPreviewingURL:initialFrameSize:. * UIProcess/API/mac/WKView.mm: (-[WKView _viewForPreviewingURL:initialFrameSize:]): Return nil in the default implementation. * UIProcess/mac/WKActionMenuController.mm: (-[WKPagePreviewViewController loadView]): Only spin up a WKWebView if the delegate (and, therefore, the presenting WKView) doesn't supply a custom view. (-[WKActionMenuController pagePreviewViewController:viewForPreviewingURL:initialFrameSize:]): WKPagePreviewViewControllerDelegate method; wrap the WKView SPI. 2014-11-05 Jer Noble De-templatize Timer https://bugs.webkit.org/show_bug.cgi?id=138450 Reviewed by Anders Carlsson. Remove template specifiers from Timer. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::bufferingTimerFired): * NetworkProcess/NetworkResourceLoader.h: * Shared/WebMemorySampler.cpp: (WebKit::WebMemorySampler::sampleTimerFired): (WebKit::WebMemorySampler::stopTimerFired): * Shared/WebMemorySampler.h: * Shared/mac/RemoteLayerBackingStoreCollection.h: * Shared/mac/RemoteLayerBackingStoreCollection.mm: (WebKit::RemoteLayerBackingStoreCollection::volatilityTimerFired): * UIProcess/API/efl/EwkView.cpp: (EwkView::displayTimerFired): * UIProcess/API/efl/EwkView.h: * UIProcess/efl/TextCheckerClientEfl.cpp: (TextCheckerClientEfl::languagesUpdateTimerFired): (TextCheckerClientEfl::spellCheckingSettingChangeTimerFired): * UIProcess/efl/TextCheckerClientEfl.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::layerFlushTimerFired): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::processSuspensionCleanupTimerFired): (WebKit::WebProcess::nonVisibleProcessCleanupTimerFired): * WebProcess/WebProcess.h: 2014-11-06 Dean Jackson [filters2] Support for backdrop-filter https://bugs.webkit.org/show_bug.cgi?id=138384 Reviewed by Simon Fraser. Take 2!! Previous patch was rolled out. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::drawInContext): Handle LayerTypeBackdropLayer in the switch. * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::description): Describe a backdrop layer. * UIProcess/ios/RemoteLayerTreeHostIOS.mm: (+[WKBackdropView layerClass]): Define CABackdropLayer and use it as the class. (WebKit::RemoteLayerTreeHost::createLayer): * UIProcess/mac/RemoteLayerTreeHost.mm: Ditto. (WebKit::RemoteLayerTreeHost::createLayer): 2014-11-06 Tim Horton Data detectors popover points at the first line of the detected item https://bugs.webkit.org/show_bug.cgi?id=138471 Reviewed by Sam Weinig. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::scanForDataDetectedItems): Determine the bounding box of all quads of the detected item's text. This way, the popover will point at the border of the item, instead of right at the very first line. 2014-11-06 Beth Dakin Preview views often misplaced inside popover https://bugs.webkit.org/show_bug.cgi?id=138472 Reviewed by Tim Horton. This patch makes the popover maintain aspect ratio, and it uses the final scale of that popover to scale the preview view as well. * UIProcess/mac/WKActionMenuController.mm: (-[WKPagePreviewViewController initWithPageURL:mainViewSize:popoverToViewScale:]): (-[WKPagePreviewViewController loadView]): (-[WKActionMenuController _createPreviewPopoverForURL:originRect:]): (-[WKActionMenuController _targetSize:fitsInAvailableSpace:]): (-[WKActionMenuController _preferredSizeForPopoverPresentedFromOriginRect:]): (-[WKPagePreviewViewController initWithPageURL:]): Deleted. 2014-11-06 Tim Horton TextIndicatorWindow's bounce animation is lopsided when indicating two short lines of text https://bugs.webkit.org/show_bug.cgi?id=138458 Reviewed by Simon Fraser. Previously, the TextIndicator's frame() covered the entire selection highlight bounds. This was undesirable in cases where the highlight included areas far outside the bounds of the selected text, as the TextIndicatorWindow's 'bounce' animation would be misaligned (centered on the highlight instead of on the text). * Shared/TextIndicator.cpp: Get rid of the many-argument TextIndicator::create, because it was only used internally, and have createWithSelectionInFrame make a ::Data instead. (WebKit::TextIndicator::createWithSelectionInFrame): Compute and store the bounding rect of all of the selected text rects, and store all of the text rects relative to that bounding rect instead of relative to the selection highlight bounds. We do this because the selection highlight bounds often includes area which is far outside of the text bounds (in the case of a selection that spans multiple lines), and causes the text indicator bounce animation to bounce in a lopsided manner. (WebKit::TextIndicator::TextIndicator): Adjust to the rename of textRectsInSelectionRectCoordinates -> textRectsInBoundingRectCoordinates. (WebKit::TextIndicator::frameRect): Instead of the TextIndicator's frame being the selection highlight bounds, it is now the bounds of all of the text rects. (WebKit::TextIndicator::draw): Translate into the image by the difference between the selection highlight bounds and the text bounding rect. This is necessary because the content image is still generated covering the entire selection highlight bounds, but the text rects are in text-rect-bounds coordinates. (WebKit::TextIndicator::Data::encode): (WebKit::TextIndicator::Data::decode): Adjust to the rename of textRectsInSelectionRectCoordinates -> textRectsInBoundingRectCoordinates. Encode/decode textBoundingRectInWindowCoordinates. * Shared/TextIndicator.h: (WebKit::TextIndicator::contentImage): Deleted. Get rid of an unnecessary getter and constructor. 2014-11-06 Tim Horton Only provide a single result to the action menu DDActionContext https://bugs.webkit.org/show_bug.cgi?id=138469 Reviewed by Anders Carlsson. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::scanForDataDetectedItems): Only provide one result; secondary results can be extremely unrelated to the primary one and confuse Data Detectors further down the line. 2014-11-06 Tim Horton Null deref in rangeForDictionaryLookupAtHitTestResult on occasion https://bugs.webkit.org/show_bug.cgi?id=138459 Reviewed by Andreas Kling. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::rangeForDictionaryLookupAtHitTestResult): rangeExpandedAroundPositionByCharacters can return null. 2014-11-06 Tim Horton Prefer link action menus over images https://bugs.webkit.org/show_bug.cgi?id=138461 Reviewed by Anders Carlsson. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _defaultMenuItems:]): Swap the priority of links and images. 2014-11-05 Sam Weinig Use std::unique_ptr for TileController https://bugs.webkit.org/show_bug.cgi?id=138429 Reviewed by Anders Carlsson. * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp: (WebKit::PlatformCALayerRemoteTiledBacking::PlatformCALayerRemoteTiledBacking): * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h: 2014-11-06 Dan Bernstein iOS build fix. * WebProcess/Plugins/PluginController.h: 2014-11-06 Daniel Bates [iOS] WebProcess needs to take a background task assertion to prevent being killed for "suspended with locked system files" https://bugs.webkit.org/show_bug.cgi?id=138155 Reviewed by Anders Carlsson. Mitigates an issue where the WebProcess may be killed when suspended holding locked files by allowing the WebProcess to notify the UIProcess when it is holding such files so that both can continue to run for a period of time after the UIProcess transitions to the background. In particular, the WebProcess notifies the UIProcess that it is holding- or relinquished- a locked file when it begins and ends a sequence of SQLite transactions, respectively. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::disconnect): Relinquish an existing background task assertion when the WebProcess disconnects. Among other situations, the WebProcess may disconnect as a result of being suspended holding locked files even when the UIProcess requested a background task assertion (i.e. it may have exceeded its background time limit). (WebKit::WebProcessProxy::setIsHoldingLockedFiles): Added. Either acquires a new background task assertion or relinquishes an existing one. * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: Added message SetIsHoldingLockedFiles(bool). The WebProcess dispatches this message to inform the UIProcess that it is holding- or relinquished- a locked file. * WebKit2.xcodeproj/project.pbxproj: Added files WebSQLiteDatabaseTracker.{cpp, h}. * WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.cpp: Added. (WebKit::WebSQLiteDatabaseTracker::supplementName): Added. (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker): Added. (WebKit::WebSQLiteDatabaseTracker::initialize): Register to receive SQLiteDatabaseTrackerClient callbacks. (WebKit::WebSQLiteDatabaseTracker::willBeginFirstTransaction): Inform the HysteresisActivity object on the main thread that we began a transaction so that it calls WebSQLiteDatabaseTracker::started(). (WebKit::WebSQLiteDatabaseTracker::didFinishLastTransaction): Inform the HysteresisActivity object on the main thread that we finished a transaction so that it may eventually call WebSQLiteDatabaseTracker::stopped(). (WebKit::WebSQLiteDatabaseTracker::started): Notify the UIProcess that the WebProcess is holding a locked file. (WebKit::WebSQLiteDatabaseTracker::stopped): Notify the UIProcess that the WebProcess has relinquished the locked file. * WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.h: Added. We use a HysteresisActivity object to coalesce SetIsHoldingLockedFiles(false) messages as an optimization to minimize the number of messages exchanged between the UIProcess and WebProcess when a web page performs SQLite transactions in batches. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): Instantiate the supplement WebSQLiteDatabaseTracker when building for iOS. 2014-11-06 Alberto Garcia [GTK] [Stable] webkitgtk 2.6.1 fails to load flashplugin https://bugs.webkit.org/show_bug.cgi?id=137849 Reviewed by Carlos Garcia Campos. NPPVpluginNeedsXEmbed is a boolean value, so it should normally use an NPBool (1 byte). However some plugins (the Flash player in particular) are using an int instead, so we have to do it as well else we'll end up corrupting the stack. * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: (WebKit::NetscapePlugin::platformPostInitialize): 2014-11-06 Carlos Garcia Campos [GTK] Add context menu API to Web Process Extensions https://bugs.webkit.org/show_bug.cgi?id=138311 Reviewed by Gustavo Noronha Silva. Add WebKitWebPage::context-menu signal, similar to the WebKitWebView one, but that receives a WebKitWebHitTestResult, a class that extends WebKitTestResult to provide the WebKitDOMNode from the Web Process Extensions API. This makes WebKitContextMenu, WebKitContextMenuItem and WebKitTestResult classes shared between UI and Web Extensions APIs. In addition to be able to customize the context menu, it also provides API to set user data, as a GVariant, in the Web Process that is sent to the UI Process. * PlatformGTK.cmake: Add new files. * UIProcess/API/gtk/WebKitContextMenu.cpp: (webkit_context_menu_set_user_data): Add user data to the context menu as a GVariant. (webkit_context_menu_get_user_data): Get the user data previously set with webkit_context_menu_set_user_data() either from the Web or UI processes. * UIProcess/API/gtk/WebKitContextMenu.h: * UIProcess/API/gtk/WebKitContextMenuActions.h: * UIProcess/API/gtk/WebKitContextMenuClient.cpp: (getContextMenuFromProposedMenu): Convert the received user data into a GVariant and pass it to webkitWebViewPopulateContextMenu(). * UIProcess/API/gtk/WebKitContextMenuItem.h: * UIProcess/API/gtk/WebKitForwardDeclarations.h: * UIProcess/API/gtk/WebKitHitTestResult.h: * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewPopulateContextMenu): Set the user data received from the Web Process to the WebKitContextMenu before emitting WebKitWebView::context-menu. * UIProcess/API/gtk/WebKitWebViewPrivate.h: * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section for WebKitWebHitTestResult. * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols. * UIProcess/API/gtk/docs/webkit2gtk.types: Add webkit_web_hit_test_result_get_type. * WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.cpp: Added. (webkitWebHitTestResultGetProperty): Add getter for node property. (webkitWebHitTestResultSetProperty): Add setter for node property. (webkit_web_hit_test_result_class_init): Add node property. (webkitWebHitTestResultCreate): Create a new WebKitWebHitTestResult for the given InjectedBundleHitTestResult. (webkit_web_hit_test_result_get_node): Return the WebKitDOMNode. * WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.h: Added. * WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResultPrivate.h: Added. * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: (getContextMenuFromDefaultMenu): Build a WebKitContextMenu and WebKitWebHitTestResult and emit WebKitWebPage::context-menu signal. (webkit_web_page_class_init): Add WebKitWebPage::context-menu signal. (webkitWebPageCreate): Add implementation for getContextMenuFromDefaultMenu. * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h: 2014-11-06 Ryuan Choi [EFL] Remove m_scrollPosition from CoordinatedGraphicsScene https://bugs.webkit.org/show_bug.cgi?id=138419 Reviewed by Gyuyoung Kim. m_scrollPosition of CoordinatedGraphicsScene is only to adjust the position of fixed element. But this adjustment is only called by paintToCurrentGLContext() and WebView can pass same information to the parameter of that method. * UIProcess/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebCore::CoordinatedGraphicsScene::paintToCurrentGLContext): (WebCore::CoordinatedGraphicsScene::adjustPositionForFixedLayers): (WebCore::CoordinatedGraphicsScene::setScrollPosition): Deleted. * UIProcess/CoordinatedGraphics/CoordinatedGraphicsScene.h: * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp: (WebKit::CoordinatedLayerTreeHostProxy::setVisibleContentsRect): * UIProcess/CoordinatedGraphics/WebView.cpp: (WebKit::WebView::paintToCurrentGLContext): 2014-11-05 Commit Queue Unreviewed, rolling out r175672. https://bugs.webkit.org/show_bug.cgi?id=138455 Tries to make backdrop layers on every layer, asserts on Mavericks (Requested by smfr on #webkit). Reverted changeset: "[filters2] Support for backdrop-filter" https://bugs.webkit.org/show_bug.cgi?id=138384 http://trac.webkit.org/changeset/175672 2014-11-04 Ada Chan Figure out whether a plug-in is playing audio. https://bugs.webkit.org/show_bug.cgi?id=137219 Reviewed by Anders Carlsson. Handle the setting of the NPPVpluginIsPlayingAudio variable. * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::setPluginIsPlayingAudio): Send a SetPluginIsPlayingAudio message to the WebProcess. * PluginProcess/PluginControllerProxy.h: * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::NPN_SetValue): Handle NPPVpluginIsPlayingAudio. Call NetscapePlugin::setIsPlayingAudio(). * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::setIsPlayingAudio): Call PluginControllerProxy::setPluginIsPlayingAudio(). * WebProcess/Plugins/Netscape/NetscapePlugin.h: * WebProcess/Plugins/PluginController.h: * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::setPluginIsPlayingAudio): Call PluginView::setPluginIsPlayingAudio(). * WebProcess/Plugins/PluginProxy.h: * WebProcess/Plugins/PluginProxy.messages.in: Add the SetPluginIsPlayingAudio message. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::PluginView): Initialize m_pluginIsPlayingAudio. (WebKit::PluginView::~PluginView): Remove itself from the Document's list of AudioProducers. (WebKit::PluginView::initializePlugin): Add itself to the Document's list of AudioProducers. (WebKit::PluginView::pageMutedStateDidChange): Add a FIXME. (WebKit::PluginView::setPluginIsPlayingAudio): If m_pluginIsPlayingAudio has changed, tell the Document to update its audio playing state. * WebProcess/Plugins/PluginView.h: Now inherits AudioProducer. 2014-11-05 Dan Bernstein Tried to fix the GTK build. * PlatformGTK.cmake: Removed references to deletion UI resources that have been removed. 2014-11-04 Dean Jackson [filters2] Support for backdrop-filter https://bugs.webkit.org/show_bug.cgi?id=138384 Reviewed by Simon Fraser. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::drawInContext): Handle LayerTypeBackdropLayer in the switch. * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::description): Describe a backdrop layer. * UIProcess/ios/RemoteLayerTreeHostIOS.mm: (+[WKBackdropView layerClass]): Define CABackdropLayer and use it as the class. (WebKit::RemoteLayerTreeHost::createLayer): * UIProcess/mac/RemoteLayerTreeHost.mm: Ditto. (WebKit::RemoteLayerTreeHost::createLayer): 2014-11-05 Ryuan Choi [EFL] Improve previous temporary fix against drawing (0,0) position before rendering content of next web page https://bugs.webkit.org/show_bug.cgi?id=138305 Reviewed by Gyuyoung Kim. WebKit2 has freezed layer tree until frame load completion since r101838. In EFL port, we unfreeze it when PageViewportController::pageTransitionViewportReady() is called though, UIProcess on EFL port updates cairo surface during the freezing time of layer tree. Thus UIProcess should not update the layer trees until the layerTreeState is unfrozen. * UIProcess/API/efl/EwkView.h: Removed previous workarounds. (EwkView::setWaitingForNewPage): Deleted. (EwkView::waitingForNewPage): Deleted. (EwkView::didCommitNewPage): Deleted. * UIProcess/CoordinatedGraphics/PageViewportController.cpp: (WebKit::PageViewportController::PageViewportController): (WebKit::PageViewportController::didCommitLoad): (WebKit::PageViewportController::didRenderFrame): (WebKit::PageViewportController::syncVisibleContents): * UIProcess/CoordinatedGraphics/PageViewportController.h: * UIProcess/efl/PageLoadClientEfl.cpp: (WebKit::PageLoadClientEfl::didCommitLoadForFrame): * UIProcess/efl/PageViewportControllerClientEfl.cpp: (WebKit::PageViewportControllerClientEfl::didChangeVisibleContents): * UIProcess/efl/ViewClientEfl.cpp: (WebKit::ViewClientEfl::didRenderFrame): 2014-11-05 Timothy Horton Fix the build. * UIProcess/mac/WKActionMenuController.mm: 2014-11-05 Dan Bernstein Remove the unused deletion UI feature https://bugs.webkit.org/show_bug.cgi?id=138442 Rubber-stamped by Alexey Proskuryakov. * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::shouldShowDeleteInterface): Deleted. * WebProcess/WebCoreSupport/WebEditorClient.h: 2014-11-05 Conrad Shultz It should be possible to open a page preview by clicking on it https://bugs.webkit.org/show_bug.cgi?id=138445 Reviewed by Tim Horton. Add a click recognizer to WKPagePreviewViewController and plumb it through to WKActionMenuController. * UIProcess/mac/WKActionMenuController.mm: Declare , currently home to just a single method. (-[WKPagePreviewViewController loadView]): Configure and add a click gesture recognizer to the WKWebView. (-[WKPagePreviewViewController _clickRecognized:]): Gesture recognizer action; send -pagePreviewViewControllerWasClicked: to the delegate. (-[WKActionMenuController willDestroyView:]): Extract code to -_clearPreviewPopover. (-[WKActionMenuController didCloseMenu:withEvent:]): Ditto. (-[WKActionMenuController _createPreviewPopoverForURL:]): Set ourself as the delegate of the page preview controller. (-[WKActionMenuController _clearPreviewPopover]): Extracted from various other methods; if appropriate, nil out the preview view controller's delegate. (-[WKActionMenuController popoverWillClose:]): Extract code to -_clearPreviewPopover. (-[WKActionMenuController pagePreviewViewControllerWasClicked:]): WKPagePreviewViewControllerDelegate method; open the URL of the clicked page. 2014-11-05 Beth Dakin Page preview popover should show scaled-down web content https://bugs.webkit.org/show_bug.cgi?id=138444 Reviewed by Anders Carlsson. Instead of keeping the preferred size in the controller, keep the main view’s size, and then scale the bounds of the popover’s view using that and the scale factor as a constant. Set the size of the popover explicitly so that it doesn’t get the view’s size. This will cause it to scale the WKWebView. * UIProcess/mac/WKActionMenuController.mm: (-[WKPagePreviewViewController initWithPageURL:]): (-[WKPagePreviewViewController loadView]): (-[WKActionMenuController _createPreviewPopoverForURL:originRect:]): (-[WKActionMenuController _preferredSizeForPopoverPresentedFromOriginRect:]): 2014-11-05 Conrad Shultz Page preview popovers sometimes cover their originating element https://bugs.webkit.org/show_bug.cgi?id=138437 Reviewed by Beth Dakin. If a popover is sufficiently large, and the originating element is in a particular location, it's possible that the popover can't be positioned in a manner that doesn't occlude the originating element. Address this by scaling down the popover content if it can't fit entirely between the originating element and the screen edge. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _previewURLFromActionMenu:]): Update to use -_createPreviewPopoverForURL:originRect:. (-[WKActionMenuController _createPreviewPopoverForURL:originRect:]): Renamed from -_createPreviewPopoverForURL:; extract code to -_preferredSizeForPopoverPresentedFromOriginRect:. (-[WKActionMenuController _preferredSizeForPopoverPresentedFromOriginRect:]): Compute a size that is as large as possible while keeping the popover between the origin rect and screen edge (with an arbitrary padding applied to keep from directly abutting the screen edge). (-[WKActionMenuController _createPreviewPopoverForURL:]): Deleted. 2014-11-05 Alexey Proskuryakov fast/dom/remove-body-during-body-replacement2.html fails on WK2 https://bugs.webkit.org/show_bug.cgi?id=138334 Reviewed by Anders Carlsson. Added an SPI to focus a frame. * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp: (WKBundleFrameFocus): * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setViewState): 2014-11-05 Tim Horton Select Data Detectors results instead of just highlighting them https://bugs.webkit.org/show_bug.cgi?id=138435 Reviewed by Beth Dakin. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::selectLastActionMenuRange): (WebKit::WebPageProxy::selectLookupTextAtLocation): Deleted. Rename selectLookupTextAtLocation to selectLastActionMenuRange. * UIProcess/WebPageProxy.h: * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController willOpenMenu:withEvent:]): Do a real selection for single-item Data Detector menus; show the yellow highlight otherwise. Adopt selectLastActionMenuRange for non-detected text. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performActionMenuHitTestAtLocation): (WebKit::WebPage::selectLastActionMenuRange): (WebKit::WebPage::selectLookupTextAtLocation): Deleted. Store the last (detected data or Lookup-derived) action menu range. Select it upon selectLastActionMenuRange. 2014-11-04 Jon Honeycutt WebContent crash in WebPage::selectWithGesture() This crash occurs when the web process receives a "TapAndAHalf" gesture with the "Changed" state without having received a "TapAndAHalf" gesture with the "Began" state. No test possible. Reviewed by Simon Fraser. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::selectWithGesture): Null check m_currentWordRange before dereferencing it. 2014-11-05 Conrad Shultz Disable action menus on page previews https://bugs.webkit.org/show_bug.cgi?id=138431 Reviewed by Anders Carlsson. * UIProcess/API/mac/WKView.mm: (-[WKView _shouldIgnoreMouseEvents]): Renamed from -shouldIgnoreMouseEvents since this isn't actually public. (-[WKView swipeWithEvent:]): (-[WKView mouseMoved:]): (-[WKView mouseDown:]): (-[WKView mouseUp:]): (-[WKView mouseDragged:]): Updated to reflect method rename. (-[WKView shouldIgnoreMouseEvents]): Deleted. * UIProcess/API/mac/WKViewInternal.h: Expose -_shouldIgnoreMouseEvents. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController prepareForMenu:withEvent:]): Cancel the menu if the presenting WKView should ignore mouse events. 2014-11-05 Beth Dakin Action menu URL preview should "peek," i.e. appear when the menu item is highlighted https://bugs.webkit.org/show_bug.cgi?id=138432 -and corresponding- rdar://problem/18774264 Reviewed by Anders Carlsson. New ivars. Keep a reference to the popover, and a BOOL that indicates whether we should close the popover when the menu goes away. * UIProcess/mac/WKActionMenuController.h: * UIProcess/mac/WKActionMenuController.mm: Re-set the preview bool to NO whenever we are about to pop up a new menu. (-[WKActionMenuController prepareForMenu:withEvent:]): Close the popover when the menu closes unless _shouldKeepPreviewPopoverOpen has been set. (-[WKActionMenuController didCloseMenu:withEvent:]): Set _shouldKeepPreviewPopoverOpen. (-[WKActionMenuController _keepPreviewOpen:]): Re-factored to use ivar. (-[WKActionMenuController _previewURLFromActionMenu:]): (-[WKActionMenuController _createPreviewPopoverForURL:]): Now call _previewURLFromActionMenu on menu item highlight. (-[WKActionMenuController menu:willHighlightItem:]): NSPopover delegate method so that we can keep our BOOL and ivar accurate in the case where the popover is closed by some other mechanism than the action menu going away. (-[WKActionMenuController popoverWillClose:]): New selector for the preview. Now when this item is actually selected, we just want to set the BOOL _shouldKeepPreviewPopoverOpen to YES so that we keep the preview open. (-[WKActionMenuController _createActionMenuItemForTag:]): 2014-11-05 Conrad Shultz Disable interaction with action menu page previews https://bugs.webkit.org/show_bug.cgi?id=138400 Reviewed by Tim Horton. Expand on the existing -[WKView shouldIgnoreMouseEvents] by adding facilities to suppress handling of all non-wheel events, effectively creating a scroll-only web view. Deploy this in WKPagePreviewViewController. * UIProcess/API/Cocoa/WKViewPrivate.h: Declare the OS X-only ignoresNonWheelMouseEvents SPI. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _ignoresNonWheelMouseEvents]): (-[WKWebView _setIgnoresNonWheelMouseEvents:]): Wrap the underlying WKView methods. * UIProcess/API/Cocoa/WKWebViewInternal.h: Declare the OS X-only ignoresNonWheelMouseEvents property. * UIProcess/API/mac/WKView.mm: Add _ignoresNonWheelMouseEvents to WKViewData. (-[WKView shouldIgnoreMouseEvents]): Include a check for _ignoresNonWheelMouseEvents. (-[WKView _setIgnoresNonWheelMouseEvents:]): Set the ivar in WKViewData. (-[WKView _ignoresNonWheelMouseEvents]): Fetch the ivar in WKViewData. (-[WKView _shouldIgnoreWheelEvents]): Implement the old -shouldIgnoreMouseEvents behavior. (-[WKView scrollWheel:]): -shouldIgnoreMouseEvents -> -_shouldIgnoreWheelEvents. * UIProcess/mac/WKActionMenuController.mm: (-[WKPagePreviewViewController loadView]): Configure the WKWebView to ignore non-wheel mouse events; use RetainPtr for the WKWebView. 2014-11-03 Dean Jackson Add ENABLE_FILTERS_LEVEL_2 feature guard. https://bugs.webkit.org/show_bug.cgi?id=138362 Reviewed by Tim Horton. Add a new feature define for Level 2 of CSS Filters. http://dev.w3.org/fxtf/filters-2/ * Configurations/FeatureDefines.xcconfig: 2014-11-05 Alberto Garcia NetscapePlugin: NPP_GetValue should receive a pointer to NPBool, not bool https://bugs.webkit.org/show_bug.cgi?id=138418 Reviewed by Carlos Garcia Campos. Replace bool with NPBool, which is actually an unsigned char. * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: (WebKit::NetscapePlugin::platformPostInitialize): 2014-11-05 Carlos Garcia Campos [GTK] Add WebKitWebResource::failed-with-tls-errors signal https://bugs.webkit.org/show_bug.cgi?id=137862 Reviewed by Gustavo Noronha Silva. When a resource load fails due to TLS errors emit WebKitWebResource::failed-with-tls-errors signal instead of WebKitWebResource::failed so that TLS errors information and certificate are provided. * UIProcess/API/gtk/WebKitInjectedBundleClient.cpp: (didReceiveWebViewMessageFromInjectedBundle): Check if the error is a TLS failure to emit failed-with-tls-errors instead of failed. * UIProcess/API/gtk/WebKitWebResource.cpp: (webkit_web_resource_class_init): Add WebKitWebResource::failed-with-tls-errors signal. (webkitWebResourceFailedWithTLSErrors): Emit failed-with-tls-errors and finish signals. * UIProcess/API/gtk/WebKitWebResourcePrivate.h: 2014-11-05 Shivakumar JM Fix build warning in WebKit2/WebProcess module. https://bugs.webkit.org/show_bug.cgi?id=138410 Reviewed by Alexey Proskuryakov. Fix build warning by removing parameter name * WebProcess/WebPage/WebPageOverlay.h: (WebKit::WebPageOverlay::Client::prepareForActionMenu): 2014-11-05 Antti Koivisto Move HTTPHeaderMap encoding to the class https://bugs.webkit.org/show_bug.cgi?id=138412 Reviewed by Andreas Kling. * PluginProcess/PluginControllerProxy.cpp: * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): Deleted. (IPC::ArgumentCoder::decode): Deleted. Make these HTTPHeaderMap members instead so they can access internals and can be used elsewhere. * Shared/WebCoreArgumentCoders.h: 2014-11-04 Beth Dakin Speculative build fix. * UIProcess/API/mac/WKView.mm: (-[WKView _dismissActionMenuDataDetectorPopovers]): * UIProcess/API/mac/WKViewInternal.h: 2014-11-04 Beth Dakin Un-anchor data detector popovers on scroll https://bugs.webkit.org/show_bug.cgi?id=138385 -and corresponding- rdar://problem/18869345 Reviewed by Tim Horton. Whenever we dismiss the dictionary popover, and on scroll, we should try to dismiss the data detector popovers. Right now we don’t have the ability to know if a dismiss succeeded, so we will settle for un-anchoring the popover. * UIProcess/API/mac/WKView.mm: (-[WKView viewDidMoveToWindow]): (-[WKView _dismissActionMenuDataDetetcorPopovers]): * UIProcess/API/mac/WKViewInternal.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didCommitLoadForFrame): (WebKit::WebPageProxy::pageDidScroll): (WebKit::WebPageProxy::resetStateAfterProcessExited): * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::dismissActionMenuDataDetetcorPopovers): * UIProcess/mac/WKActionMenuController.h: * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController dismissActionMenuDataDetetcorPopovers]): 2014-11-04 Andy Estes [iOS] WKPDFView should scroll to a fragment when loading a PDF https://bugs.webkit.org/show_bug.cgi?id=138404 Reviewed by Tim Horton. WKPDFView already knew how to scroll to a page number fragment during a same-document navigation, but it didn't know to do so when loading a PDF whose URL already contained a page number fragment. This could happen if the user long-presses a page number link and taps 'Open in New Tab'. * UIProcess/ios/WKPDFView.mm: (-[WKPDFView web_setContentProviderData:suggestedFilename:]): Called _scrollToFragment:. (-[WKPDFView _scrollToFragment:]): Moved fragment scrolling code to here from web_didSameDocumentNavigation:. (-[WKPDFView web_didSameDocumentNavigation:]): Called _scrollToFragment. 2014-11-04 Andy Estes [iOS] Stop using +[NSURL _web_URLWithWTFString:relativeToURL:] in WKPDFView https://bugs.webkit.org/show_bug.cgi?id=138357 Rubber-stamped by Dan Bernstein. During patch review for r175595 I changed from using +URLWithString:relativeToURL: to using +_web_URLWithWTFString:relativeToURL: to append a page number fragment to the document URL. If the base URL already contains a fragment, +_web_URLWithWTFString:relativeToURL: appends to the existing fragment whereas +URLWithString:relativeToURL: replaces the existing fragment. I want the latter behavior. * UIProcess/ios/WKPDFView.mm: (-[WKPDFView _URLForLinkAnnotation:]): 2014-11-04 Tim Horton Add bundle SPI allowing PageOverlay to customize the action menu https://bugs.webkit.org/show_bug.cgi?id=138388 Reviewed by Anders Carlsson. * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp: Bump the BundlePageOverlay client version. (WKBundlePageOverlayCreate): (WKBundlePageOverlaySetAccessibilityClient): Don't return if we have a version; the version check happens later anyway, and now it is valid to have a version >0. * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h: Bump the BundlePageOverlay client version. Add prepareForActionMenu callback. * WebProcess/WebPage/WebPageOverlay.h: (WebKit::WebPageOverlay::Client::prepareForActionMenu): * WebProcess/WebPage/WebPageOverlay.cpp: (WebKit::overlayMap): (WebKit::WebPageOverlay::WebPageOverlay): (WebKit::WebPageOverlay::~WebPageOverlay): (WebKit::WebPageOverlay::fromCoreOverlay): (WebKit::WebPageOverlay::pageOverlayDestroyed): Keep track of a map of PageOverlay to WebPageOverlay. (WebKit::WebPageOverlay::prepareForActionMenu): Forward prepareForActionMenu to the client. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performActionMenuHitTestAtLocation): Iterate through the overlays and let them prepareForActionMenu; the first overlay that returns true wins. If no overlays want to do anything, hand preparation along to the context menu client. 2014-11-03 Jeremy Jones Add button and enable optimized fullscreen. https://bugs.webkit.org/show_bug.cgi?id=138351 Reviewed by Eric Carlson. Add IsOptimizedFullscreenSupported to enable the feature only where appropriate. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): add IsOptimizedFullscreenSupported 2014-11-04 Andy Estes [iOS] Add long press support for links in WKPDFView https://bugs.webkit.org/show_bug.cgi?id=138357 Reviewed by Dan Bernstein. Use WKActionSheetAssistant to show a link action sheet in response to long-pressing on a link. Have WKPDFView conform to WKActionSheetAssistantDelegate in order to respond to the open and copy actions as well as to provide the link's URL and position information to WKActionSheetAssistant. The long-pressed link is highlighted for .75 seconds before the sheet is displayed in order to match UIWebPDFView. * UIProcess/ios/WKActionSheetAssistant.h: Made protocol methods that WKPDFView doesn't implement optional. * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant updatePositionInformation]): Checked if delegate responds to updatePositionInformationForActionSheetAssistant: before calling. (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]): Checked if delegate responds to actionSheetAssistant:willStartInteractionWithElement: before calling. (-[WKActionSheetAssistant cleanupSheet]): Checked if delegate responds to actionSheetAssistantDidStopInteraction: before calling. * UIProcess/ios/WKPDFView.h: Conformed to WKActionSheetAssistantDelegate. * UIProcess/ios/WKPDFView.mm: (-[WKPDFView web_initWithFrame:webView:]): Instantiated a WKActionSheetAssistant and set self as its delegate. (-[WKPDFView _highlightLinkAnnotation:forDuration:completionHandler:]): Moved highlight drawing to here from annotation:wasTouchedAtPoint:controller: in order to be reused for long-press. (-[WKPDFView _URLForLinkAnnotation:]): Moved URL creation to here from annotation:wasTouchedAtPoint:controller: in order to be reused for long-press. Generated an absolute URL since this URL might go into the pasteboard. (-[WKPDFView annotation:wasTouchedAtPoint:controller:]): Changed to call _highlightLinkAnnotation:forDuration:completionHandler: and _URLForLinkAnnotation:. (-[WKPDFView annotation:isBeingPressedAtPoint:controller:]): Set values on _positionInformation and called -[WKActionSheetAssistant showLinkSheet] after showing a highlight for .75 seconds. (-[WKPDFView positionInformation]): Returned _positionInformation. (-[WKPDFView performAction:]): Added a UTF-8 text and URL representation of the pressed URL to the pasteboard. (-[WKPDFView openElementAtLocation:]): Called WebPage::navigateToURLWithSimulatedClick(). (-[WKPDFView actionsForElement:defaultActions:]): Returned actions from UIClient::actionsForElement(). (-[WKPDFView _createHighlightViewWithFrame:]): Deleted. 2014-11-04 Anders Carlsson Try to fix the 32-bit build. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _defaultMenuItemsForLink]): (-[WKActionMenuController _createActionMenuItemForTag:]): 2014-11-04 Conrad Shultz Use a web view for Quick Look in action menus https://bugs.webkit.org/show_bug.cgi?id=138370 Reviewed by Anders Carlsson. Instead of using the QLPreviewBubble SPI, show a popover containing a web view. This currently does not inherit any configuration from the presenting WKView and does not expose any customization options. * UIProcess/mac/WKActionMenuController.mm: Declare new internal NSViewController subclass, WKPagePreviewViewController. (-[WKPagePreviewViewController initWithPageURL:]): Store the passed-in URL and set a somewhat arbitrary (iPhone 5 screen size) default preferred size. (-[WKPagePreviewViewController loadView]): Create a WKWebView and load the URL passed into the initializer. (-[WKActionMenuController _previewURLFromActionMenu:]): Renamed from -_quickLookURLFromActionMenu:; present the popover returned by -_createPreviewPopoverForURL:. (-[WKActionMenuController _createPreviewPopoverForURL:]): New helper method; return a popover that owns a _WKPagePreviewViewController configured to show a scaled-down web page. (-[WKActionMenuController _createActionMenuItemForTag:]): Update to reflect method rename. (-[WKActionMenuController _quickLookURLFromActionMenu:]): Deleted. 2014-11-04 Chris Dumez Add ptr() method to Ref class https://bugs.webkit.org/show_bug.cgi?id=138361 Reviewed by Darin Adler. Use the new Ref::ptr() method. * UIProcess/WebContext.cpp: (WebKit::WebContext::createWebPage): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setPreferences): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didNavigateWithNavigationData): (WebKit::WebProcessProxy::didPerformClientRedirect): (WebKit::WebProcessProxy::didPerformServerRedirect): (WebKit::WebProcessProxy::didUpdateHistoryTitle): 2014-11-04 Andy Estes [iOS] Include a WKActionSheetAssistant parameter in WKActionSheetAssistantDelegate methods https://bugs.webkit.org/show_bug.cgi?id=137792 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/_WKElementAction.mm: (+[_WKElementAction elementActionWithTitle:actionHandler:]): (+[_WKElementAction elementActionWithType:customTitle:]): (-[_WKElementAction _runActionWithElementInfo:forActionSheetAssistant:]): * UIProcess/API/Cocoa/_WKElementActionInternal.h: * UIProcess/ios/WKActionSheetAssistant.h: * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant initialPresentationRectInHostViewForSheet]): (-[WKActionSheetAssistant presentationRectInHostViewForSheet]): (-[WKActionSheetAssistant updatePositionInformation]): (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]): (-[WKActionSheetAssistant showImageSheet]): (-[WKActionSheetAssistant showLinkSheet]): (-[WKActionSheetAssistant showDataDetectorsSheet]): (-[WKActionSheetAssistant cleanupSheet]): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView positionInformationForActionSheetAssistant:]): (-[WKContentView updatePositionInformationForActionSheetAssistant:]): (-[WKContentView actionSheetAssistant:performAction:]): (-[WKContentView actionSheetAssistant:openElementAtLocation:]): (-[WKContentView actionSheetAssistant:decideActionsForElement:defaultActions:]): (-[WKContentView actionSheetAssistant:willStartInteractionWithElement:]): (-[WKContentView actionSheetAssistantDidStopInteraction:]): 2014-11-04 Csaba Osztrogonác URTBF after r175564 for !PLATFORM(COCOA). * Shared/TextIndicator.cpp: 2014-11-04 Tim Horton Implement yellow highlight over data detected items https://bugs.webkit.org/show_bug.cgi?id=138340 Reviewed by Anders Carlsson. * Shared/TextIndicator.cpp: Renamed from Source/WebKit2/UIProcess/TextIndicator.cpp. * Shared/TextIndicator.h: Renamed from Source/WebKit2/UIProcess/TextIndicator.h. Move TextIndicator to Shared. Move all of the members to a Data struct. Implement encode/decode for TextIndicator::Data, so it can be passed as the argument to SetTextIndicator, and also as a field on ActionMenuHitTestResult. Add 'createWithSelectionInFrame', which builds a TextIndicator from the selection in the given frame. * Shared/mac/ActionMenuHitTestResult.h: * Shared/mac/ActionMenuHitTestResult.mm: (WebKit::ActionMenuHitTestResult::encode): (WebKit::ActionMenuHitTestResult::decode): Rename actionBoundingBox to detectedDataBoundingBox. Store/encode/decode detectedDataTextIndicator. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setTextIndicator): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Create a TextIndicator from the TextIndicator::Data. Add an explicit ClearTextIndicator message instead of sending empty Data. * UIProcess/mac/WKActionMenuController.h: * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController prepareForMenu:withEvent:]): If the text indicator is up when preparing for a new menu invocation, hide it. (-[WKActionMenuController willOpenMenu:withEvent:]): Show the text indicator when the menu opens, for data detected items. (-[WKActionMenuController didCloseMenu:withEvent:]): Hide the text indicator when the menu closes, unless we only had one item. Then, we'll hide it in the DDActionContext completionHandler block. (-[WKActionMenuController _showTextIndicator]): (-[WKActionMenuController _hideTextIndicator]): Added. Show and hide the text indicator based on the TextIndicator data included in the action menu hit test result. (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]): Hide the text indicator when the data detector popover completes. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::getImageForFindMatch): Make use of the newly-moved createSelectionSnapshot. (WebKit::FindController::updateFindIndicator): Make use of TextIndicator::createWithSelectionInFrame, which allows us to share this code for building a TextIndicator with other callers. (WebKit::FindController::hideFindIndicator): (WebKit::getFindIndicatorBitmap): Deleted. Move getFindIndicatorBitmap to WebFrame::createSelectionSnapshot. * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::createSelectionSnapshot): Moved from FindController's getFindIndicatorBitmap. Now returns a ShareableBitmap instead of going ahead and making a Handle. * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::scanForDataDetectedItems): (WebKit::textIndicatorForRange): Temporarily change the selection to the given range, then use TextIndicator::indicatorWithSelectionInFrame to acquire a TextIndicator, then reset the selection. (WebKit::WebPage::performActionMenuHitTestAtLocation): Create a TextIndicator from the data detected range. 2014-11-04 Andy Estes Fix the iOS build after r175549. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::performActionOnElement): 2014-11-04 Darin Adler Eliminate ResourceBuffer and use SharedBuffer directly instead https://bugs.webkit.org/show_bug.cgi?id=138174 Reviewed by Antti Koivisto. * CMakeLists.txt: Removed WebResourceBuffer.cpp. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::sendBuffer): Use a reference instead of pointer. * NetworkProcess/NetworkResourceLoader.h: Ditto. * NetworkProcess/mac/NetworkDiskCacheMonitor.h: Ditto. * NetworkProcess/mac/NetworkDiskCacheMonitor.mm: (WebKit::NetworkDiskCacheMonitor::resourceBecameFileBacked): Ditto. * NetworkProcess/mac/NetworkResourceLoaderMac.mm: (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer): Ditto. * Shared/WebResourceBuffer.cpp: Removed. * Shared/WebResourceBuffer.h: Removed. * WebKit2.xcodeproj/project.pbxproj: Removed WebResourceBuffer.cpp/h. * WebProcess/Network/NetworkProcessConnection.cpp: Removed unneeded includes. (WebKit::NetworkProcessConnection::didCacheResource): Use a reference instead of a pointer. * WebProcess/Network/WebResourceLoadScheduler.cpp: Removed unneeded include. * WebProcess/Network/WebResourceLoader.cpp: Ditto. * WebProcess/Network/WebResourceLoader.h: Ditto. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: Ditto. (WebKit::WebFrameLoaderClient::finishedLoading): Use SharedBuffer directly. * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::source): Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::runJavaScriptInMainFrame): Refactored to make the relationship between the buffer and the DataReference clearer and to avoid having a long-lived DataReference pointing to an underlying buffer with unclear lifetime. (WebKit::WebPage::getContentsAsString): Ditto. (WebKit::WebPage::getSelectionAsWebArchiveData): Ditto. (WebKit::WebPage::getMainResourceDataOfFrame): Ditto. Also use SharedBuffer directly. (WebKit::WebPage::getResourceDataFromFrame): Ditto. (WebKit::WebPage::getWebArchiveOfFrame): Ditto. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::containingLinkElement): Use elementLineage. (WebKit::WebPage::performActionOnElement): Use references and SharedBuffer. ALso did a bit of other cleanup in here. (WebKit::isAssistableElement): Take Element& instead of Node*, since that's what the caller has. (WebKit::nextAssistableElement): Changed name to match what the function does. Added an obviously-missing check on the startNode argument. Updated for change to isAssistableElement above. Take a Page& instead of a Page*. (WebKit::hasAssistableElement): Changed name to match what the function does. Updated for change to nextAssistableElement above. Took out incorrect comparison of a C++ pointer to the Objective-C object pointer nil. Take a Page& instead of a Page*. (WebKit::WebPage::focusNextAssistedNode): Updated for above changes. (WebKit::WebPage::getAssistedNodeInformation): Updated for above changes. 2014-11-04 Tim Horton Dictionary lookup panel pops up at random when clicking on selected text https://bugs.webkit.org/show_bug.cgi?id=138353 * WebProcess/WebPage/WebPage.h: Fix the build; this needs to be public. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::rangeForDictionaryLookupAtHitTestResult): Use the right selection (the one we just tested) in the change from r175517. 2014-11-04 Tim Horton Dictionary lookup panel pops up at random when clicking on selected text https://bugs.webkit.org/show_bug.cgi?id=138353 Reviewed by Andreas Kling. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::rangeForDictionaryLookupForSelection): (WebKit::rangeForDictionaryLookupAtHitTestResult): Factor rangeForDictionaryLookupForSelection out of performDictionaryLookupForSelection. Make use of rangeForDictionaryLookupForSelection in rangeForDictionaryLookupAtHitTestResult, returning the selection-based range if the hit test intersects the selected text. Previously, we were just going forward with performDictionaryLookupForSelection, which would actually *do* the lookup, even if we just wanted to retrieve the range. Make rangeForDictionaryLookup* static. (WebKit::WebPage::performDictionaryLookupForSelection): Make use of rangeForDictionaryLookupForSelection. 2014-11-03 Chris Dumez Allow implicit conversion from Ref to T& https://bugs.webkit.org/show_bug.cgi?id=138331 Reviewed by Andreas Kling. Remove unnecessary calls to Ref::get() now that a Ref can be converted implicitly to a T&. 2014-11-03 Simon Fraser Expose visibleDebugOverlayRegions pref via the WK2 C SPI https://bugs.webkit.org/show_bug.cgi?id=138342 Reviewed by Dan Bernstein. Expose WKDebugOverlayRegions via the C SPI. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetVisibleDebugOverlayRegions): (WKPreferencesGetVisibleDebugOverlayRegions): * UIProcess/API/C/WKPreferencesRef.h: 2014-11-03 Beth Dakin Implement action menus for editable text with spelling suggestions https://bugs.webkit.org/show_bug.cgi?id=138333 -and corresponding- rdar://problem/18742371 Reviewed by Tim Horton. New types. * Shared/API/c/WKActionMenuItemTypes.h: * Shared/API/c/WKActionMenuTypes.h: ActionMenuHitTestResult now stores the String result of the lookup. * Shared/mac/ActionMenuHitTestResult.h: * Shared/mac/ActionMenuHitTestResult.mm: (WebKit::ActionMenuHitTestResult::encode): (WebKit::ActionMenuHitTestResult::decode): Make getGuessesForWord() public so we can call it from WKActionMenuController. * UIProcess/WebPageProxy.h: * UIProcess/mac/WKActionMenuController.mm: Select the text for all types of text menus. (-[WKActionMenuController isMenuForTextContent]): (-[WKActionMenuController willOpenMenu:withEvent:]): Spelling suggestions are presented in a sub-menu and will replace the selection when chosen. (-[WKActionMenuController _defaultMenuItemsForEditableTextWithSuggestions:]): (-[WKActionMenuController _changeSelectionToSuggestion:]): (-[WKActionMenuController _createActionMenuItemForTag:]): (-[WKActionMenuController _defaultMenuItems:]): New function to store the lookupText as a String on the ActionMenuHitTestResult. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performActionMenuHitTestAtLocation): (WebKit::WebPage::lookupTextAtLocation): 2014-11-03 Simon Fraser Add page overlays that show regions with mouseWheel event handlers, and the non-fast-scrollable region, and code to toggle them in MiniBrowser WK2 https://bugs.webkit.org/show_bug.cgi?id=138257 Reviewed by Tim Horton. Add private prefs to control visibility of debug-related page region overlays. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _visibleDebugOverlayRegions]): (-[WKPreferences _setVisibleDebugOverlayRegions:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/mac/WebPreferencesMac.mm: (WebKit::setDebugUInt32ValueIfInUserDefaults): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::updatePreferences): Update the overlays. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::updatePreferences): Update the overlays. 2014-11-03 Commit Queue Unreviewed, rolling out r175406, r175413, and r175423. https://bugs.webkit.org/show_bug.cgi?id=138327 Multipart tests are still broken (Requested by ap on #webkit). Reverted changesets: "Eliminate ResourceBuffer and use SharedBuffer directly instead" https://bugs.webkit.org/show_bug.cgi?id=138174 http://trac.webkit.org/changeset/175406 "Unreviewed, iOS build fix since 175406." http://trac.webkit.org/changeset/175413 "Fix assertion in CachedResource::addDataBuffer" http://trac.webkit.org/changeset/175423 2014-11-03 Tim Horton _actionMenuItemsForHitTestResult is given kWKActionMenuLink but an empty array of defaultMenuItems https://bugs.webkit.org/show_bug.cgi?id=138321 Reviewed by Beth Dakin. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _defaultMenuItemsForLink]): (-[WKActionMenuController _defaultMenuItems:]): Move the HTTP-family-URLs-only condition to the place where we decide what kind of menu to show. We depend on _defaultMenuItemsForLink returning the link menu, and should never set the link menu type if we aren't going to build a link menu. 2014-11-03 Tim Horton Use FrameSnapshotting functions in FindController::getFindIndicatorBitmap https://bugs.webkit.org/show_bug.cgi?id=138300 Reviewed by Simon Fraser. Share more code by using WebCore's FrameSnapshotting::snapshotSelection in FindController instead of copying it into FindController wholesale. * WebProcess/WebPage/FindController.cpp: (WebKit::getFindIndicatorBitmap): Make getFindIndicatorBitmap static, rename it from getFindIndicatorBitmapAndRect, and drop the rect argument because only one caller wanted it, and we no longer need to compute it (this happens in WebCore now). Use snapshotSelection; all of the removed paint behaviors get added by code in or underneath snapshotSelection now. Draw the snapshot into our ShareableBitmap; we could avoid this in a future patch by refactoring the FrameSnapshotting functions to take GraphicsContexts. (WebKit::FindController::getImageForFindMatch): (WebKit::FindController::updateFindIndicator): Adopt the new getFindIndicatorBitmap. * WebProcess/WebPage/FindController.h: Remove getFindIndicatorBitmap(AndRect), which is now static. 2014-11-03 Csaba Osztrogonác URTBF after r175476 to make GTK and EFL build happy. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::setTextIndicator): (WebKit::PageClientImpl::setFindIndicator): Deleted. * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/CoordinatedGraphics/WebView.cpp: (WebKit::WebView::setTextIndicator): (WebKit::WebView::setFindIndicator): Deleted. * UIProcess/CoordinatedGraphics/WebView.h: 2014-11-03 Tim Horton Rename FindIndicator{Window} to TextIndicator{Window} https://bugs.webkit.org/show_bug.cgi?id=138302 Reviewed by Anders Carlsson. Rename FindIndicator{Window} to TextIndicator{Window} (and related), because it will soon be used to indicate ranges of text that are not necessarily find-in-page results. FindController still has things named 'findIndicator' internally, and I left the API alone (because all the API bits are actually find-specific), but the actual FindIndicator/Window and the message to set it up, etc. are all now called Text*. * CMakeLists.txt: * UIProcess/API/mac/WKView.mm: * UIProcess/API/mac/WKViewInternal.h: * UIProcess/PageClient.h: * UIProcess/TextIndicator.cpp: Renamed from Source/WebKit2/UIProcess/FindIndicator.cpp. * UIProcess/TextIndicator.h: Renamed from Source/WebKit2/UIProcess/FindIndicator.h. * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: * UIProcess/ios/WKContentView.h: * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: * UIProcess/mac/TextIndicatorWindow.h: Renamed from Source/WebKit2/UIProcess/mac/FindIndicatorWindow.h. * UIProcess/mac/TextIndicatorWindow.mm: Renamed from Source/WebKit2/UIProcess/mac/FindIndicatorWindow.mm. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebPage/FindController.cpp: 2014-11-03 Beth Dakin Implement action menus for editable text https://bugs.webkit.org/show_bug.cgi?id=138284 -and corresponding- rdar://problem/18742323 Reviewed by Tim Horton. New item type for paste. * Shared/API/c/WKActionMenuItemTypes.h: New menu type for editable text. * Shared/API/c/WKActionMenuTypes.h: * UIProcess/mac/WKActionMenuController.mm: willOpenMenu should select text for both regular text menus and editable text menus. (-[WKActionMenuController willOpenMenu:withEvent:]): Default items for editable text. (-[WKActionMenuController _defaultMenuItemsForEditableText]): (-[WKActionMenuController _paste:]): (-[WKActionMenuController _createActionMenuItemForTag:]): New method _hitTestResultForStage:(MenuUpdateStage)stage will figure out whether we can use the WebHitTestResult from the ActionMenuHitTestResult or if we have to use the potentially out-of-date WebHitTestResult that is cached on WebPageProxy. An important difference between these results is that the ActionMenuHitTest result, in addition to being more recent and accurate, also now includes shadow content, which affects some editable regions on important sites such as bugs.webkit.org and nytimes.com. (-[WKActionMenuController _defaultMenuItems:]): (-[WKActionMenuController _updateActionMenuItemsForStage:]): (imageForResource:name::if): Deleted. Allow shadow content in action menu hit testing. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performActionMenuHitTestAtLocation): (WebKit::WebPage::selectLookupTextAtLocation): 2014-11-03 Ada Chan Persist the page's muted state across web process crashes. https://bugs.webkit.org/show_bug.cgi?id=138195 Reviewed by Anders Carlsson. Store the Page's muted state in WebPageCreationParameters so that state can be properly restored after recovering from a crash in the web process. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): Initialize m_muted. (WebKit::WebPageProxy::setMuted): Update m_muted. (WebKit::WebPageProxy::creationParameters): Set the muted data member in WebPageCreationParameters. * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): Initialize the page's muted state with the muted value from WebPageCreationParameters. 2014-11-03 Ryuan Choi [EFL] Remove dependency of PageViewportController from PageViewportControllerClient https://bugs.webkit.org/show_bug.cgi?id=138301 Reviewed by Gyuyoung Kim. PaeViewportControllerClient does not need to keep the instance of PageViewPortController. This patch removes it to simplify relation between them. In addition, uses a reference for the client of PageViewportController. * UIProcess/API/efl/EwkView.cpp: (EwkView::EwkView): (EwkView::setViewportPosition): * UIProcess/API/efl/EwkView.h: * UIProcess/CoordinatedGraphics/PageViewportController.cpp: (WebKit::PageViewportController::PageViewportController): (WebKit::PageViewportController::didChangeContentsSize): (WebKit::PageViewportController::didRenderFrame): (WebKit::PageViewportController::pageDidRequestScroll): (WebKit::PageViewportController::syncVisibleContents): (WebKit::PageViewportController::didChangeViewportAttributes): * UIProcess/CoordinatedGraphics/PageViewportController.h: * UIProcess/PageViewportControllerClient.h: * UIProcess/efl/PageViewportControllerClientEfl.cpp: (WebKit::PageViewportControllerClientEfl::PageViewportControllerClientEfl): (WebKit::PageViewportControllerClientEfl::setViewportPosition): (WebKit::PageViewportControllerClientEfl::setController): Deleted. * UIProcess/efl/PageViewportControllerClientEfl.h: 2014-11-03 Sungmann Cho AX: Fix some minor typos related to the word "accessibility". https://bugs.webkit.org/show_bug.cgi?id=138299 Reviewed by Chris Fleizach. No new tests, no behavior change. * WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm: 2014-11-01 Carlos Garcia Campos REGRESSION(r163656): Remote inspector doesn't work unless preferences change after page initialization https://bugs.webkit.org/show_bug.cgi?id=138246 Reviewed by Joseph Pecoraro. The problem is that initializeWebPage() is still using pageGroup().preferences() instead of m_preferences to check if developer extras are enabled to enable remote inspection of the page. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::initializeWebPage): Use m_preferences instead of pageGroup().preferences(). 2014-11-01 Carlos Garcia Campos REGRESSION(CMake): Make it possible to build without introspection https://bugs.webkit.org/show_bug.cgi?id=138006 Reviewed by Philippe Normand. Do not install introspection files when introspection is disabled. * PlatformGTK.cmake: 2014-10-31 Dan Bernstein Removed a reference to a file that’s been deleted. * WebKit2.xcodeproj/project.pbxproj: Removed reference to XPCPtr.h. 2014-10-31 Gyuyoung Kim Use std::unique_ptr instead of OwnPtr in CoordinatorDrawingProxy https://bugs.webkit.org/show_bug.cgi?id=138238 Reviewed by Ryosuke Niwa. * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp: (WebKit::CoordinatedDrawingAreaProxy::CoordinatedDrawingAreaProxy): Use std::make_unique. (WebKit::CoordinatedDrawingAreaProxy::enterAcceleratedCompositingMode): * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.h: Use std::unique_ptr instead of OwnPtr. 2014-10-31 Sam Weinig Add bundle SPI to customize the action menu https://bugs.webkit.org/show_bug.cgi?id=138271 Reviewed by Anders Carlsson. - Adds a new function to the WKBundlePageContextMenuClient that allows the client to pass construct user data in the bundle that can be available when customizing the menu in -[WKView _actionMenuItemsForHitTestResult...]. - Changes the signature of -[WKView _actionMenuItemsForHitTestResult...] to add userData. - Makes the actual hit test result available in the second invocation of -[WKView _actionMenuItemsForHitTestResult...] by serializing it in the ActionMenuHitTestResult. * Shared/mac/ActionMenuHitTestResult.h: * Shared/mac/ActionMenuHitTestResult.mm: (WebKit::ActionMenuHitTestResult::encode): (WebKit::ActionMenuHitTestResult::decode): Adds the WebHitTestResult and the original hit test request location. * UIProcess/API/Cocoa/WKViewPrivate.h: Adds a new version of _actionMenuItemsForHitTestResult that passes userData along. * UIProcess/API/mac/WKView.mm: (-[WKView _didPerformActionMenuHitTest:userData:]): (-[WKView _actionMenuItemsForHitTestResult:withType:defaultActionMenuItems:userData:]): * UIProcess/API/mac/WKViewInternal.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didPerformActionMenuHitTest): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::didPerformActionMenuHitTest): Pipe the user data through to the WKView. * UIProcess/mac/WKActionMenuController.h: * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController prepareForMenu:withEvent:]): (-[WKActionMenuController didPerformActionMenuHitTest:userData:]): (-[WKActionMenuController menuNeedsUpdate:]): (-[WKActionMenuController _updateActionMenuItemsForStage:]): Differentiate between the two times _updateActionMenuItems was called via a new stage parameter, (it is called once in prepareForMenu, and once in menuNeedsUpdate). Use the last mouse move hit test result in the prepareForMenu case (as we don't have a real result yet), and the hit result passed in via didPerformActionMenuHitTest in the menuNeedsUpdate case (assuming we didn't time out) waiting on the web process. * WebProcess/InjectedBundle/API/c/WKBundlePageContextMenuClient.h: * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp: (WebKit::InjectedBundlePageContextMenuClient::prepareForActionMenu): * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performActionMenuHitTestAtLocation): Adds new bundle SPI to collect user data to pass to the -[WKView _actionMenuItemsForHitTestResult...] method. 2014-10-31 Gyuyoung Kim Use std::unique_ptr for TypeCountSet https://bugs.webkit.org/show_bug.cgi?id=138242 Reviewed by Andreas Kling. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::getWebCoreStatistics): Use std::unique_ptr<> instead of OwnPtr. 2014-10-30 Jer Noble [WK2] Send origin & deletion requests to WebProcessess in additon to the DatabaseProcess. https://bugs.webkit.org/show_bug.cgi?id=138212 Reviewed by Brady Eidson. Now that the WebProcess has its own WebOriginDataManager, WebOriginDataManagerProxy needs to send its origin and deletion messages to all the WebProcesses. This necessetates synchronizing all the various process's callbacks so that the final callback is only triggered once all the messaged processes reply. Add a simple class, CallbackSynchronizer, which will keep track of outstanding process callbacks and which will trigger the final callback once all of them finish. * UIProcess/WebOriginDataManagerProxy.cpp: (WebKit::CallbackSynchronizer::create): (WebKit::CallbackSynchronizer::~CallbackSynchronizer): (WebKit::CallbackSynchronizer::taskStarted): (WebKit::CallbackSynchronizer::taskCompleted): (WebKit::CallbackSynchronizer::CallbackSynchronizer): (WebKit::createSynchronizedCallback): (WebKit::sendMessageToAllProcessesInContext): (WebKit::WebOriginDataManagerProxy::getOrigins): (WebKit::WebOriginDataManagerProxy::deleteEntriesForOrigin): (WebKit::WebOriginDataManagerProxy::deleteEntriesModifiedBetweenDates): (WebKit::WebOriginDataManagerProxy::deleteAllEntries): Drive-by fix: check the correct enum value for WebMedia origin requests. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::getOrigins): (WebKit::WebProcess::deleteEntriesForOrigin): (WebKit::WebProcess::deleteEntriesModifiedBetweenDates): (WebKit::WebProcess::deleteAllEntries): 2014-10-31 Tim Horton REGRESSION (r175376): Occasional null deref when doing a dictionary lookup https://bugs.webkit.org/show_bug.cgi?id=138261 Reviewed by Anders Carlsson. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performDictionaryLookupAtLocation): rangeForDictionaryLookupAtHitTestResult can easily return null. 2014-10-31 Beth Dakin Use system art for action menus when possible https://bugs.webkit.org/show_bug.cgi?id=138260 Reviewed by Tim Horton. * Resources/AddImageToPhotosTemplate.pdf: Removed. * Resources/CopyImageTemplate.pdf: Removed. * Resources/SaveImageToDownloadsTemplate.pdf: Removed. * Resources/ShareImageTemplate.pdf: Removed. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _createActionMenuItemForTag:]): * WebKit2.xcodeproj/project.pbxproj: 2014-10-31 Timothy Horton Fix the build for Yosemite systems after r175417 * UIProcess/mac/WKActionMenuController.mm: 2014-10-31 Timothy Horton Fix the build for pre-Yosemite systems after r175417 * UIProcess/API/mac/WKView.mm: (-[WKView dealloc]): (-[WKView initWithFrame:context:configuration:webView:]): * UIProcess/API/mac/WKViewInternal.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::didPerformActionMenuHitTest): * UIProcess/mac/WKActionMenuController.h: * UIProcess/mac/WKActionMenuController.mm: 2014-10-31 Timothy Horton Remove "Add to iPhoto" from the action menu's sharing menu https://bugs.webkit.org/show_bug.cgi?id=138251 Reviewed by Anders Carlsson. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]): Retain/autorelease the new array. 2014-10-31 Tim Horton Remove "Add to iPhoto" from the action menu's sharing menu https://bugs.webkit.org/show_bug.cgi?id=138251 Reviewed by Anders Carlsson. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]): Filter out "Add to iPhoto". 2014-10-31 Adrian Perez de Castro [GTK] Support script message handlers WebKitUserContentManager https://bugs.webkit.org/show_bug.cgi?id=133730 Reviewed by Carlos Garcia Campos. Support user script message handlers in WebKitUserContentManager. This needs building with ENABLE_USER_MESSAGE_HANDLERS, for which an option is added to the CMake build files. The option is disabled globally by default, and the WebKitGTK port enables it. On the API level, two new methods to register and unregister names are provided in the "window.webkit" namespace, and on message reception the "WebKitUserContentManager::script-message-received" signal is emitted, using the registered names as signal detail. * UIProcess/API/gtk/WebKitJavascriptResult.cpp: Add a new private function to construct a WebKitJavascriptResult directly from a WebCore::SerializedScriptValue. (_WebKitJavascriptResult::_WebKitJavascriptResult): Ditto. (webkitJavascriptResultCreate): Ditto. * UIProcess/API/gtk/WebKitJavascriptResultPrivate.h: Ditto. * UIProcess/API/gtk/WebKitUserContentManager.cpp: (webkit_user_content_manager_class_init): Install the "script-message-received" signal. (webkit_user_content_manager_register_script_message_handler): Added. (webkit_user_content_manager_unregister_script_message_handler): Added. * UIProcess/API/gtk/WebKitUserContentManager.h: Added the new public API methods. * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Ditto. * UIProcess/API/gtk/docs/webkit2gtk.types: Add webkit_user_content_manager_get_type() to the list in order to make gtk-doc to generate documentation for signals. 2014-10-31 Martin Hock Unreviewed, iOS build fix since 175406. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::performActionOnElement): 2014-10-30 Darin Adler Eliminate ResourceBuffer and use SharedBuffer directly instead https://bugs.webkit.org/show_bug.cgi?id=138174 Reviewed by Antti Koivisto. * CMakeLists.txt: Removed WebResourceBuffer.cpp. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::sendBuffer): Use a reference instead of pointer. * NetworkProcess/NetworkResourceLoader.h: Ditto. * NetworkProcess/mac/NetworkDiskCacheMonitor.h: Ditto. * NetworkProcess/mac/NetworkDiskCacheMonitor.mm: (WebKit::NetworkDiskCacheMonitor::resourceBecameFileBacked): Ditto. * NetworkProcess/mac/NetworkResourceLoaderMac.mm: (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer): Ditto. * Shared/WebResourceBuffer.cpp: Removed. * Shared/WebResourceBuffer.h: Removed. * WebKit2.xcodeproj/project.pbxproj: Removed WebResourceBuffer.cpp/h. * WebProcess/Network/NetworkProcessConnection.cpp: Removed unneeded includes. (WebKit::NetworkProcessConnection::didCacheResource): Use a reference instead of a pointer. * WebProcess/Network/WebResourceLoadScheduler.cpp: Removed unneeded include. * WebProcess/Network/WebResourceLoader.cpp: Ditto. * WebProcess/Network/WebResourceLoader.h: Ditto. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: Ditto. (WebKit::WebFrameLoaderClient::finishedLoading): Use SharedBuffer directly. * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::source): Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::runJavaScriptInMainFrame): Refactored to make the relationship between the buffer and the DataReference clearer and to avoid having a long-lived DataReference pointing to an underlying buffer with unclear lifetime. (WebKit::WebPage::getContentsAsString): Ditto. (WebKit::WebPage::getSelectionAsWebArchiveData): Ditto. (WebKit::WebPage::getMainResourceDataOfFrame): Ditto. Also use SharedBuffer directly. (WebKit::WebPage::getResourceDataFromFrame): Ditto. (WebKit::WebPage::getWebArchiveOfFrame): Ditto. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::containingLinkElement): Use elementLineage. (WebKit::WebPage::performActionOnElement): Use references and SharedBuffer. ALso did a bit of other cleanup in here. (WebKit::isAssistableElement): Take Element& instead of Node*, since that's what the caller has. (WebKit::nextAssistableElement): Changed name to match what the function does. Added an obviously-missing check on the startNode argument. Updated for change to isAssistableElement above. Take a Page& instead of a Page*. (WebKit::hasAssistableElement): Changed name to match what the function does. Updated for change to nextAssistableElement above. Took out incorrect comparison of a C++ pointer to the Objective-C object pointer nil. Take a Page& instead of a Page*. (WebKit::WebPage::focusNextAssistedNode): Updated for above changes. (WebKit::WebPage::getAssistedNodeInformation): Updated for above changes. 2014-10-30 Jer Noble [EME] Add Setting for accessing storage location for MediaKeys data https://bugs.webkit.org/show_bug.cgi?id=138147 Reviewed by Brady Eidson. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): Pass from WebMediaKeyStorageManager into Settings. 2014-10-30 Dana Burkart Workaround for Unreviewed. * Shared/API/Cocoa/WKFoundation.h: 2014-10-30 Dana Burkart Prepare for the mysterious future Reviewed by Lucas Forschler. * Configurations/Base.xcconfig: * Configurations/DebugRelease.xcconfig: * Configurations/FeatureDefines.xcconfig: * Configurations/Version.xcconfig: * Configurations/WebContentService.Development.xcconfig: * Configurations/WebContentService.xcconfig: * Configurations/WebKit.xcconfig: 2014-10-30 Anders Carlsson Try to fix the iOS build. * WebProcess/WebPage/WebPage.messages.in: 2014-10-30 Tim Horton Long spins under rangeExpandedAroundPosition on Yahoo Mail https://bugs.webkit.org/show_bug.cgi?id=138223 Reviewed by Enrica Casucci. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::rangeExpandedAroundPositionByCharacters): Reimplement rangeExpandedAroundPosition to operate on characters instead of lines, and to use Position. Moving VisiblePositions by line can be very expensive in some cases, and for generating lookup/Data Detectors context, we don't care about that kind of precision. This makes this function ~1000x faster when it hits on a row in the Yahoo Mail message list. (WebKit::WebPage::performDictionaryLookupAtLocation): (WebKit::scanForDataDetectedItems): Adopt the new rangeExpandedAroundPositionByCharacters, expanding 250 characters before and after, which roughly matches what we were usually getting going by line, and is a reasonable amount of context for these operations. 2014-10-30 Brady Eidson IndexedDB is deleting data when a PK is shared amongst two objectStores rdar://problem/18479306 and https://bugs.webkit.org/show_bug.cgi?id=137154 Reviewed by Jer Noble. * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: (WebKit::v1RecordsTableSchema): Store away the v1 schema for introspection into the database. (WebKit::v2RecordsTableSchema): Add utility methods to get the v2 schema with different Table names. (WebKit::createOrMigrateRecordsTableIfNecessary): Check to see if the Records table exists with the correct schema. If it is the v1 schema, then migrate the data to a new v2 table, drop the v1 table, then slide the new table into place. (WebKit::UniqueIDBDatabaseBackingStoreSQLite::ensureValidRecordsTable): Make sure the Records table exists and is v2, and then make sure the uniqueness index exists. (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): Don’t bother creating the Records table here as it will have already been established earlier. (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: 2014-10-30 Beth Dakin Implement action menus for text https://bugs.webkit.org/show_bug.cgi?id=138220 -and corresponding- rdar://problem/18742297 Reviewed by Tim Horton. Two new types of actions for the two text actions. * Shared/API/c/WKActionMenuItemTypes.h: One new type of menu. * Shared/API/c/WKActionMenuTypes.h: Pass willOpenMenu on to the WKActionMenuController. * UIProcess/API/mac/WKView.mm: (-[WKView willOpenMenu:withEvent:]): Two new WebPageProxy functions that will pass messages along to the web process. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::selectLookupTextAtLocation): * UIProcess/WebPageProxy.h: At willOpenMenu time, text menus should select text so that it is clear what the menu actions will apply to. * UIProcess/mac/WKActionMenuController.h: * UIProcess/mac/WKActionMenuController.mm: Menu items for text menus. (-[WKActionMenuController willOpenMenu:withEvent:]): (-[WKActionMenuController _defaultMenuItemsForText]): (-[WKActionMenuController _copyText:]): (-[WKActionMenuController _lookupText:]): (-[WKActionMenuController _createActionMenuItemForTag:]): (imageForResource:name::if): New messages to the web process. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Re-factor performDictionaryLookupAtLocation() to re-use the code that finds the Range for the dictionary lookup. That code now lives in rangeForDictionaryLookupAtHitTestResult() and can be used by performDictionaryLookupAtLocation() and our new function selectLookupTextAtLocation(). * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::rangeForDictionaryLookupAtHitTestResult): (WebKit::WebPage::performDictionaryLookupAtLocation): Since the action menu text is always selected, when the lookup action is chosen, we can just lookup the current selection. (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Uses the new function rangeForDictionaryLookupAtHitTestResult() to get a lookup range and then select it. (WebKit::WebPage::selectLookupTextAtLocation): 2014-10-30 Dan Bernstein When a client certificate is rejected, Safari says the website didn’t accept the certificate “unknown” instead of naming the certificate https://bugs.webkit.org/show_bug.cgi?id=138216 Reviewed by Alexey Proskuryakov. * Shared/cf/ArgumentCodersCF.cpp: (IPC::typeFromCFTypeRef): Remove no-longer-necessary platform guards around SecIdentityRef. (IPC::encode): Ditto. (IPC::decode): Ditto. * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encodePlatformData): If NSErrorClientCertificateChainKey is present in the error’s userInfo dictionary, assert that it’s an array of identities and certificates, and include it in the filtered dictionary. 2014-10-29 Hunseop Jeong [CoordinatedGraphics] Use modern for-loops https://bugs.webkit.org/show_bug.cgi?id=138168 Reviewed by Andreas Kling. No new tests as there is no change in functionality. * UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp: Use a modern for loop. (WebCore::CoordinatedBackingStore::texture): (WebCore::CoordinatedBackingStore::paintTilesToTextureMapper): * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp: Use a modern for loop. (WebKit::CoordinatedDrawingAreaProxy::incorporateUpdate): * UIProcess/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: Use a modern for loop. (WebCore::CoordinatedGraphicsScene::setLayerChildrenIfNeeded): (WebCore::CoordinatedGraphicsScene::createLayers): changed the name of argument to be equal with deleteLayer(). (WebCore::CoordinatedGraphicsScene::deleteLayers): (WebCore::CoordinatedGraphicsScene::createTilesIfNeeded): (WebCore::CoordinatedGraphicsScene::removeTilesIfNeeded): (WebCore::CoordinatedGraphicsScene::updateTilesIfNeeded): (WebCore::CoordinatedGraphicsScene::syncUpdateAtlases): (WebCore::CoordinatedGraphicsScene::syncImageBackings): (WebCore::CoordinatedGraphicsScene::commitSceneState): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp: Use a modern for loop. (WebKit::shouldPaintBoundsRect): (WebKit::CoordinatedDrawingArea::display): 2014-10-29 Gyuyoung Kim Unreviewed, EFL build fix since r175349. * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::didRemoveItem): Use PLATFORM(COCOA) for setSnapshot(). 2014-10-29 Tim Horton Null deref under performActionMenuHitTestAtLocation https://bugs.webkit.org/show_bug.cgi?id=138197 Reviewed by Beth Dakin. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::scanForDataDetectedItems): Null-check the expanded range. 2014-10-28 Ada Chan Implement WKPageSetMuted(bool). https://bugs.webkit.org/show_bug.cgi?id=138158 Reviewed by Anders Carlsson. * UIProcess/API/C/WKPage.cpp: (WKPageSetMuted): * UIProcess/API/C/WKPagePrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setMuted): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setMuted): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2014-10-29 Anders Carlsson Clear ViewSnapshots when back/forward list items are removed from their list https://bugs.webkit.org/show_bug.cgi?id=138188 Reviewed by Tim Horton. Ideally we should remove the WebBackForwardListItem objects as well, but this is a somewhat safer fix. Change all the "remove item" codepaths to call WebBackForwardList::didRemoveItem and have it clear out the snapshot. * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::pageClosed): (WebKit::WebBackForwardList::addItem): (WebKit::WebBackForwardList::removeAllItems): (WebKit::WebBackForwardList::clear): (WebKit::WebBackForwardList::didRemoveItem): * UIProcess/WebBackForwardList.h: 2014-10-29 Tim Horton Hide the 'Add to Photos' item if it isn't available https://bugs.webkit.org/show_bug.cgi?id=138182 Reviewed by Beth Dakin. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _defaultMenuItemsForImage]): (-[WKActionMenuController _canAddImageToPhotos]): (-[WKActionMenuController _addImageToPhotos:]): Factor _canAddImageToPhotos out of _addImageToPhotos:, and use it in _defaultMenuItemsForImage to avoid including the menu item in the first place. 2014-10-29 Tim Horton Rename WebPageProxy::activeActionMenuHitTestResult to lastMouseMoveHitTestResult https://bugs.webkit.org/show_bug.cgi?id=138137 Reviewed by Anders Carlsson. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::mouseDidMoveOverElement): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::lastMouseMoveHitTestResult): (WebKit::WebPageProxy::activeActionMenuHitTestResult): Deleted. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _defaultMenuItemsForLink]): (-[WKActionMenuController _openURLFromActionMenu:]): (-[WKActionMenuController _addToReadingListFromActionMenu:]): (-[WKActionMenuController _quickLookURLFromActionMenu:]): (-[WKActionMenuController _saveImageToDownloads:]): (imageForResource:name::if): (-[WKActionMenuController _updateActionMenuItems]): Rename to the more accurate and general name. 2014-10-29 Tim Horton Implement action menus for data detected items https://bugs.webkit.org/show_bug.cgi?id=138178 Reviewed by Anders Carlsson. * Shared/API/c/WKActionMenuTypes.h: Add a new type. * Shared/WebHitTestResult.cpp: (WebKit::WebHitTestResult::Data::Data): (WebKit::WebHitTestResult::Data::encode): (WebKit::WebHitTestResult::Data::decode): * Shared/WebHitTestResult.h: (WebKit::WebHitTestResult::isTextNode): Determine, store, encode, and decode whether or not the hit node is a text node. * Shared/mac/ActionMenuHitTestResult.h: * Shared/mac/ActionMenuHitTestResult.mm: Renamed from Source/WebKit2/Shared/mac/ActionMenuHitTestResult.cpp. (WebKit::ActionMenuHitTestResult::encode): (WebKit::ActionMenuHitTestResult::decode): Make ActionMenuHitTestResult an Obj-C++ file. Store, encode, and decode (securely!) a DDActionContext and FloatRect representing the bounding box of the data detected item, if any. * UIProcess/API/mac/WKView.mm: (-[WKView initWithFrame:context:configuration:webView:]): (-[WKView willOpenMenu:withEvent:]): Deleted. Stop using willOpenMenu; we'll use NSMenuDelegate's menuNeedsUpdate: instead. Hook up WKActionMenuController as our action menu's delegate. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController prepareForMenu:withEvent:]): Call _updateActionMenuItems *after* we've adjusted _state, so that it can depend on the value being correct. (-[WKActionMenuController willOpenMenu:withEvent:]): (-[WKActionMenuController didPerformActionMenuHitTest:]): Move menu updating to menuNeedsUpdate for more accurate timing. (_updateActionMenuItems): When building the menu, if we have a text node that is not a link, and hit a data detected item, retrieve the menu from the DDActionContext. If we have nothing, make sure to reset _type, and if the final hit-test is still pending, build a menu with a dummy item. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performActionMenuHitTestAtLocation): Moved to WebPageMac. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::rangeExpandedAroundPosition): Factor this out of performDictionaryLookupAtLocation. (WebKit::WebPage::performDictionaryLookupAtLocation): Make use of rangeExpandedAroundPosition. (WebKit::scanForDataDetectedItems): Expand to four lines of context around the hit point. Convert that range to plain text, and feed it to DataDetectors. Find the result that intersects the hit point, and make a DDActionContext for it. Also, store the bounding box of the first quad of the detected text, to provide to Data Detectors as a hint for UI placement. (WebKit::WebPage::performActionMenuHitTestAtLocation): If the hit node is a text node, call scanForDataDetectedItems and store the resultant DDActionContext and bounding rect on our ActionMenuHitTestResult for transfer to the UI process. 2014-10-29 Joseph Pecoraro [iOS] iPad: Occasional https://bugs.webkit.org/show_bug.cgi?id=137991 Reviewed by Darin Adler. We seem to be getting the delegate when we are not supposed to. Workaround the issue as best we can by reseting the styles for the group's content view and not changing selections. * UIProcess/ios/forms/WKFormSelectPicker.mm: (-[WKMultipleSelectPicker pickerView:row:column:checked:]): 2014-10-28 Tim Horton Remove an inaccurate comment in WKActionMenuController https://bugs.webkit.org/show_bug.cgi?id=138135 Reviewed by Anders Carlsson. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _defaultMenuItemsForLink]): The comment is wrong; the separator is there for spacing, not just as a workaround. 2014-10-28 Carlos Garcia Campos Unreviewed. Update OptionsGTK.cmake and NEWS for 2.7.1 release. * gtk/NEWS: Add release notes for 2.7.1. 2014-10-28 Dan Bernstein [Mac] OS X Mavericks build broken with public SDK https://bugs.webkit.org/show_bug.cgi?id=138108 Reviewed by Mark Rowe. * Shared/API/Cocoa/WKFoundation.h: Only define the NSEventModifierFlags type when using a version of the OS X SDK that doesn’t define it. 2014-10-27 Conrad Shultz NSSharingService protocol conformance should be internal to WKActionMenuController https://bugs.webkit.org/show_bug.cgi?id=138112 Reviewed by Tim Horton. * UIProcess/mac/WKActionMenuController.h: * UIProcess/mac/WKActionMenuController.mm: Move protocol conformance from the interface to a class extension. 2014-10-27 Enrica Casucci WebContent crash in WebKit::WebPage::expandedRangeFromHandle. https://bugs.webkit.org/show_bug.cgi?id=138023 rdar://problem/18787412 Reviewed by Ryosuke Niwa. We must change that we have a valid currentRange before trying to expand or contract. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::changeBlockSelection): 2014-10-27 Alexey Proskuryakov http/tests/cookies/third-party-cookie-relaxing.html is flaky on bots https://bugs.webkit.org/show_bug.cgi?id=138098 Reviewed by Anders Carlsson. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * WebProcess/com.apple.WebProcess.sb.in: Update for the new name of testing session. Memory regions are now of the form "WebKit Test--0". 2014-10-27 Chris Dumez Use separate HashMaps for common and uncommon headers in HTTPHeaderMap https://bugs.webkit.org/show_bug.cgi?id=138079 Reviewed by Anders Carlsson. Update the WK2 IPC HTTPHeaderMap serialization / deserialization code to leverage the fact that HTTPHeaderMap now stores common HTTP headers and uncommon one in separate HashMaps. This speeds up deserialization as we no longer need to call findHTTPHeaderName() for every decoded header. We already know if the header is a common one or not, and if it is then we already have a HTTPHeaderName type instead of a String. I see that we spend ~40% less time in HTTPHeaderMap decoding when loading http://flickr.com/explore, while the encoding takes about the same amount of time as before. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): (IPC::ArgumentCoder::decode): 2014-10-24 Benjamin Poulain Fix the iOS build * Configurations/WebKit.xcconfig: 2014-10-24 Beth Dakin _actionMenuItemsForHitTestResult should also take a type indicating what the menu was built for https://bugs.webkit.org/show_bug.cgi?id=138063 Reviewed by Dan Bernstein. New type enum that can be used by clients. * Shared/API/c/WKActionMenuTypes.h: Added. Remove the old SPI and add the new. * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView _actionMenuItemsForHitTestResult:withType:defaultActionMenuItems:]): (-[WKView _actionMenuItemsForHitTestResult:defaultActionMenuItems:]): Deleted. Now keep an ivar for the type. * UIProcess/mac/WKActionMenuController.h: Create a category for the old SPI so that we can still call it if clients have implemented it. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController initWithPage:view:]): (-[WKActionMenuController didCloseMenu:withEvent:]): (imageForResource:name::if): (-[WKActionMenuController _updateActionMenuItems]): * WebKit2.xcodeproj/project.pbxproj: 2014-10-24 Tim Horton Share sheet doesn't attach to the window https://bugs.webkit.org/show_bug.cgi?id=138062 Reviewed by Beth Dakin. * UIProcess/mac/WKActionMenuController.h: WKActionMenuController is now a NSSharingService{Picker}Delegate. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _defaultMenuItemsForImage]): Set us up as the NSSharingServicePicker delegate. (-[WKActionMenuController sharingServicePicker:delegateForSharingService:]): Set us up as the NSSharingService delegate. (-[WKActionMenuController sharingService:sourceWindowForShareItems:sharingContentScope:]): Return the appropriate window to attach to. 2014-10-24 Jer Noble Abstractify WebOriginDataManager to support arbitrary ChildProcess supplements. https://bugs.webkit.org/show_bug.cgi?id=137993 Reviewed by Brady Eidson. To allow different ChildProcess subclasses to handle listing and deletion of origin data, make WebOriginDataManager more generic by having a supplement implement the details, leaving WebOriginDataManager to deal with cross-process messaging. De-virtualize AsyncTask, allowing a task to be created by passing in a function, rather than an object, method, and arguments. * Shared/AsyncTask.h: (WebKit::AsyncTask::AsyncTask): (WebKit::AsyncTask::performTask): (WebKit::AsyncTask::~AsyncTask): Deleted. Add a new virtual base class, to be implemented by various ChildProcesses, which WebOriginDataManager will use to implement listing and deletion requests. * WebProcess/OriginData/WebOriginDataManager.h: * WebProcess/OriginData/WebOriginDataManagerSupplement.h: Added. (WebKit::WebOriginDataManagerSupplement::WebOriginDataManagerSupplement): (WebKit::WebOriginDataManagerSupplement::~WebOriginDataManagerSupplement): (WebKit::WebOriginDataManagerSupplement::getOrigins): (WebKit::WebOriginDataManagerSupplement::deleteEntriesForOrigin): (WebKit::WebOriginDataManagerSupplement::deleteEntriesModifiedBetweenDates): (WebKit::WebOriginDataManagerSupplement::deleteAllEntries): * WebKit2.xcodeproj/project.pbxproj: WebOriginDataManager doesn't need to be a ChildSupplement. Remove the DatabaseProcess- specific implementations for its message handlers and replace with clean, generic calls to its supplement. Because these supplements may want to respond to the request asynchronously, pass a completion function in to be called by the supplement once its work is complete. * WebProcess/OriginData/WebOriginDataManager.cpp: (WebKit::WebOriginDataManager::WebOriginDataManager): (WebKit::WebOriginDataManager::getOrigins): (WebKit::WebOriginDataManager::deleteEntriesForOrigin): (WebKit::WebOriginDataManager::deleteEntriesModifiedBetweenDates): (WebKit::WebOriginDataManager::deleteAllEntries): (WebKit::WebOriginDataManager::supplementName): Deleted. DatabaseProcess already uses WebOriginDataManager, so it will be the first process to fall under the heel of the new regime. DatabaseProcess will subclass WebOriginDataManagerSupplement, and pass itself in twice to the WebOriginDataManager constructor. Create a lambda-based AsyncTask for each request, and call the completion function when each request is complete. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::DatabaseProcess): (WebKit::DatabaseProcess::getIndexedDatabaseOrigins): (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigin): (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedBetweenDates): (WebKit::DatabaseProcess::deleteAllIndexedDatabaseEntries): (WebKit::DatabaseProcess::getOrigins): (WebKit::DatabaseProcess::deleteEntriesForOrigin): (WebKit::DatabaseProcess::deleteEntriesModifiedBetweenDates): (WebKit::DatabaseProcess::deleteAllEntries): (WebKit::DatabaseProcess::doGetIndexedDatabaseOrigins): Deleted. (WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesForOrigin): Deleted. (WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesModifiedBetweenDates): Deleted. (WebKit::DatabaseProcess::doDeleteAllIndexedDatabaseEntries): Deleted. * DatabaseProcess/DatabaseProcess.h: 2014-10-24 Beth Dakin Very large images crash in action menu code https://bugs.webkit.org/show_bug.cgi?id=138059 -and corresponding- rdar://problem/18767859 Reviewed by Tim Horton. If the HitTestResult failed to create and image, then don’t go for the image action menu. * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController _defaultMenuItems]): ShareableBitmap::createShareable() can fail. The result needs to be null-checked. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performActionMenuHitTestAtLocation): 2014-10-24 Beth Dakin Build fix. * UIProcess/mac/WKActionMenuController.h: * UIProcess/mac/WKActionMenuController.mm: 2014-10-24 Tim Horton Blindly try to fix all the builds. * UIProcess/mac/WKActionMenuController.h: * UIProcess/mac/WKActionMenuController.mm: 2014-10-24 Timothy Horton Blindly try to fix all the builds. * UIProcess/mac/WKActionMenuController.h: 2014-10-24 Timothy Horton Blindly try to fix the 32-bit build. * UIProcess/mac/WKActionMenuController.h: * UIProcess/mac/WKActionMenuController.mm: 2014-10-24 Tim Horton [Mac][WebKit2] Move action menu code into its own file https://bugs.webkit.org/show_bug.cgi?id=138034 * UIProcess/mac/WKActionMenuController.mm: (-[WKActionMenuController prepareForMenu:withEvent:]): (-[WKActionMenuController _addImageToPhotos:]): Review comments that were not previously addressed. 2014-10-24 Tim Horton [Mac][WebKit2] Move action menu code into its own file https://bugs.webkit.org/show_bug.cgi?id=138034 Reviewed by Dan Bernstein. * UIProcess/API/mac/WKView.mm: (-[WKView initWithFrame:context:configuration:webView:]): Make a WKActionMenuController if needed. (-[WKView prepareForMenu:withEvent:]): (-[WKView willOpenMenu:withEvent:]): (-[WKView didCloseMenu:withEvent:]): (-[WKView _didPerformActionMenuHitTest:]): Forward these to WKActionMenuController. (-[WKView _openURLFromActionMenu:]): Deleted. (-[WKView _addToReadingListFromActionMenu:]): Deleted. (-[WKView _quickLookURLFromActionMenu:]): Deleted. (-[WKView _createActionMenuItemForTag:]): Deleted. (webKitBundleImageNamed): Deleted. (-[WKView _copyImage:]): Deleted. (-[WKView _saveImageToDownloads:]): Deleted. (temporaryPhotosDirectoryPath): Deleted. (pathToPhotoOnDisk): Deleted. (-[WKView _addImageToPhotos:]): Deleted. (-[WKView _defaultMenuItemsForImage]): Deleted. (-[WKView _defaultMenuItems]): Deleted. (-[WKView _updateActionMenu]): Deleted. Moved to WKActionMenuController. * UIProcess/mac/WKActionMenuController.h: Added. * UIProcess/mac/WKActionMenuController.mm: Added. (-[WKActionMenuController initWithPage:view:]): (-[WKActionMenuController prepareForMenu:withEvent:]): (-[WKActionMenuController willOpenMenu:withEvent:]): (-[WKActionMenuController didCloseMenu:withEvent:]): (-[WKActionMenuController didPerformActionMenuHitTest:]): (-[WKActionMenuController _defaultMenuItemsForLink]): (-[WKActionMenuController _openURLFromActionMenu:]): (-[WKActionMenuController _addToReadingListFromActionMenu:]): (-[WKActionMenuController _quickLookURLFromActionMenu:]): (-[WKActionMenuController _defaultMenuItemsForImage]): (-[WKActionMenuController _copyImage:]): (-[WKActionMenuController _saveImageToDownloads:]): (temporaryPhotosDirectoryPath): (pathToPhotoOnDisk): (-[WKActionMenuController _addImageToPhotos:]): (-[WKActionMenuController _createActionMenuItemForTag:]): (webKitBundleImageNamed): (imageForResource:name::if): (-[WKActionMenuController _updateActionMenuItems]): Moved from WKView. * WebKit2.xcodeproj/project.pbxproj: 2014-10-24 Marcos Chavarría Teijeiro [GTK] Implement is_selected method on WebKitHitTestResult https://bugs.webkit.org/show_bug.cgi?id=137110 Reviewed by Tim Horton. Expose CONTEXT_SELECTION for WebKitHitTestResult. * Shared/WebHitTestResult.cpp: Add is_selected field and getter for this field. (WebKit::WebHitTestResult::Data::Data): (WebKit::WebHitTestResult::Data::encode): (WebKit::WebHitTestResult::Data::decode): * Shared/WebHitTestResult.h: (WebKit::WebHitTestResult::isSelected): * UIProcess/API/gtk/WebKitHitTestResult.cpp: Add WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION context and method to check it. (webkitHitTestResultCreate): (webkitHitTestResultCompare): (webkit_hit_test_result_context_is_selection): * UIProcess/API/gtk/WebKitHitTestResult.h: * UIProcess/API/gtk/WebKitWebView.cpp: Modify context-menu callback to set the new context option. (webkitWebViewPopulateContextMenu): * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add documentation about new function. 2014-10-23 Carlos Garcia Campos [GTK][Cairo] Remove GTK dependency of WidgetBackingStoreGtkX11 https://bugs.webkit.org/show_bug.cgi?id=138004 Reviewed by Gustavo Noronha Silva. * UIProcess/BackingStore.h: Rename m_backingStore as m_backend, since it's a bit confusing that a BackingStore class has a m_backingStore member and WidgetBackingStore has been renamed as BackingStoreBackendCairo. * UIProcess/cairo/BackingStoreCairo.cpp: (WebKit::BackingStore::createBackend): Helper function to create the BackingStore backend depending on the platform. (WebKit::BackingStore::paint): Use m_backend instead of m_backingStore. (WebKit::BackingStore::incorporateUpdate): Ditto. (WebKit::BackingStore::scroll): Ditto. (WebKit::createBackingStoreForGTK): Deleted. 2014-10-23 Benjamin Poulain Fix a bad find-and-replace in r175153 Looks like I messed up the commit on landing. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::didCommitLoadForFrame): 2014-10-23 Benjamin Poulain [iOS WK2] If a page has the exact same VisibleContentRect as the page before, its VisibleContentRectUpdate can be ignored https://bugs.webkit.org/show_bug.cgi?id=138031 rdar://problem/18739335 Reviewed by Simon Fraser. Since any VisibleContentRectUpdate is costly for the WebProcess, we avoid sending updates if none of the important parameters have changed (scale and geometry). One unintended side effect is that the update of a page can be blocked if the parameters of the previous page were identical. What happen is this: 1) Page [A] sends its content rect update as needed. WebPageProxy saves the last update in m_lastVisibleContentRectUpdate and use that value to avoid useless updates. 2) Page [B] load after page [A] and have the exact VisibleContentRect. When receiving the first layer tree commit after didCommitLoadForFrame, WKWebView sends its VisibleContentRect to WebPageProxy to synchronize the state of the WebProcess with what is on screen. 3) Since the two VisibleContentRect update has the same value as the ones of page [A], WebPageProxy discards the update. The WebProcess has its initialization viewport and is not udpated until a major parameter changes (scale or position). In rdar://problem/18739335, the problem is the similar but with a different failure point: 1) Everything above happened already. 2) The layer tree transaction has a scrolling request. This is processed by WKWebView. 3) Since the scrolling position is invalid, the request is ignored and we send the last VisibleContentRect to the WebProcess with WebPageProxy::resendLastVisibleContentRects(). 4) Since the VisibleContentRect was never updated after didCommitLoadForFrame, the one we send is for the previous page, which the web process correctly ignores. This patch solves the problem by nuking the cached m_lastVisibleContentRectUpdate before any valid VisibleContentRectUpdate for a new page. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::didCommitLoadForFrame): * UIProcess/WebPageProxy.h: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::didCommitLayerTree): 2014-10-23 Joseph Pecoraro Web Inspector: Provide a way to have alternate inspector agents https://bugs.webkit.org/show_bug.cgi?id=137901 Reviewed by Brian Burg. * Configurations/FeatureDefines.xcconfig: 2014-10-23 Tim Horton Add some SPI headers for NSExtension and NSSharingService{Picker} https://bugs.webkit.org/show_bug.cgi?id=138027 Reviewed by Anders Carlsson. * UIProcess/API/mac/WKView.mm: * UIProcess/mac/ServicesController.mm: * UIProcess/mac/WebContextMenuProxyMac.mm: Replace redefinitions with SPI header #imports. 2014-10-23 Benjamin Poulain [iOS WK2] Make sure any dynamic viewport update schedules a layer tree commit https://bugs.webkit.org/show_bug.cgi?id=138021 Reviewed by Simon Fraser. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): Sometimes, the clients can do a dynamic viewport update but only change the minimum layout size (see rdar://problem/18755250). When that happens, it is possible to do the full state update without ever scheduling a layer tree commit. For example, if the new minimum layout height is only a few pixels smaller than the old value and the layout of the page is equal or larger than the old value, the layout is done without any side effect to the content (assuming a viewport configuration based on width). The contract with the client is that the next layer tree commit after a dynamic viewport update carries all the valid parameters for the new viewport size. Since the new layout never scheduled a layer tree commit, the UIProcess is just waiting for one, discarding all input. This patch solves the issue by explicitely scheduling a layer flush after updating all the layout and view parameters to their final values. In most cases, this makes no difference since a layer tree commit was already scheduled. In the rare cases where nothing was scheduled, scheduling the layer tree commit ensure we unlock the UIProcess. 2014-10-23 Ryosuke Niwa WebContent crash in WebKit::WebPage::expandedRangeFromHandle https://bugs.webkit.org/show_bug.cgi?id=138023 Reviewed by Enrica Casucci. The crashes are caused by rangeForBlockAtPoint returning a null Range. Exit early or continue if a range is null in various places. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::expandedRangeFromHandle): Continue looking for another point if the range returned by rangeForBlockAtPoint is null. (WebKit::WebPage::contractedRangeFromHandle): Ditto. (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle): Removed the FIXME now that Enrica has verified that this early exit added in r173788 is correct. 2014-10-23 Joseph Pecoraro [iOS] iPhone unselecting items in . 2014-10-23 Tim Horton Assertion failures in ImageKit soft linking https://bugs.webkit.org/show_bug.cgi?id=138009 Reviewed by Anders Carlsson. * UIProcess/API/mac/WKView.mm: Soft-link ImageKit correctly. ImageKit is inside the Quartz umbrella framework. 2014-10-23 Daniel Bates [iOS] Fix the build after (https://bugs.webkit.org/show_bug.cgi?id=137995) Rubber-stamped by Anders Carlsson. Remove PageClientImpl::didPerformActionMenuHitTest() for iOS. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didPerformActionMenuHitTest): Deleted. 2014-10-23 Krzysztof Czech [EFL] Fix build problem after r175098 https://bugs.webkit.org/show_bug.cgi?id=138002 Reviewed by Gyuyoung Kim. Add ECORE_X dependency to avoid linking problems while building unit tests. * PlatformEfl.cmake: 2014-10-23 Krzysztof Czech [EFL] Set proper default value for WebPageAccessibilityObject https://bugs.webkit.org/show_bug.cgi?id=137951 Reviewed by Csaba Osztrogonác. Initial value for WebPageAccessibilityObject should be nullptr. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): 2014-10-23 Krzysztof Czech [EFL] Introduce EFL Accessibility in WebKit https://bugs.webkit.org/show_bug.cgi?id=137819 Reviewed by Gyuyoung Kim. EFL Accessibility provides an API that is used to notify clients that certain Accessibility events occur. Utilizing it makes WebKit-EFL coherent with EFL native accessibility approach. * PlatformEfl.cmake: * UIProcess/API/efl/EwkView.cpp: (EwkView::EwkView): * UIProcess/API/efl/EwkView.h: (EwkView::webAccessibility): * UIProcess/API/efl/WebAccessibility.cpp: Added. (WebKit::WebAccessibility::WebAccessibility): (WebKit::WebAccessibility::~WebAccessibility): (WebKit::WebAccessibility::eventHandler): (WebKit::WebAccessibility::executeGestureAction): (WebKit::WebAccessibility::activate): (WebKit::WebAccessibility::read): (WebKit::WebAccessibility::readNext): (WebKit::WebAccessibility::readPrev): (WebKit::WebAccessibility::up): (WebKit::WebAccessibility::down): (WebKit::WebAccessibility::scroll): (WebKit::WebAccessibility::mouse): (WebKit::WebAccessibility::enable): (WebKit::WebAccessibility::disable): * UIProcess/API/efl/WebAccessibility.h: Added. (WebKit::WebAccessibility::activateAction): (WebKit::WebAccessibility::nextAction): (WebKit::WebAccessibility::prevAction): (WebKit::WebAccessibility::readAction): * UIProcess/API/efl/ewk_view.cpp: (ewk_view_accessibility_action_activate_get): (ewk_view_accessibility_action_next_get): (ewk_view_accessibility_action_prev_get): (ewk_view_accessibility_action_read_by_point_get): * UIProcess/API/efl/ewk_view.h: * UIProcess/API/efl/tests/test_ewk2_accessibility.cpp: Added. (EWK2Accessibility::xwindow): (TEST_F): * UIProcess/WebPageProxy.h: * UIProcess/efl/WebPageProxyEfl.cpp: (WebKit::WebPageProxy::accessibilityObjectReadByPoint): (WebKit::WebPageProxy::accessibilityObjectReadPrevious): (WebKit::WebPageProxy::accessibilityObjectReadNext): 2014-10-22 Benjamin Poulain [iOS WK2] Protect WKWebView dynamic viewport change against empty sizes https://bugs.webkit.org/show_bug.cgi?id=137988 rdar://problem/17785162 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _beginAnimatedResizeWithUpdates:]): The algorithm behind dynamic size update finds the best content area to put in the viewport after a viewport change. If an initial size or a target size is empty, it is impossible to compute a reasonable area to keep in the view. We end up handling NaN scales and/or sizes and CoreAnimation raises an exception when applying that value. This patch add early exits when that occurs and fallback to the common code. On Input, things are easy. If any of the initial values is empty, we just execute the updateBlock without attempting any of the dynamic behaviors. For the target values, things are trickier. We do not know what the values are going to be before we execute the block. But once we executed the block, we have already skipped all the setters that call the web process. To handle that, every value is set manually on WebPageProxy. This is a bit unfortunate because the setters get yet another entry point. 2014-10-22 Gyuyoung Kim EFL and GTK ports have broken since r175075 https://bugs.webkit.org/show_bug.cgi?id=137995 Unreviewed, EFL and GTK ports build fix. Need to use PLATFORM(MAC) guard for ActionMenuHitTest functions. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::removeNavigationGestureSnapshot): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2014-10-22 Tim Horton Add action menu support for images https://bugs.webkit.org/show_bug.cgi?id=137987 Reviewed by Anders Carlsson, Sam Weinig, and Beth Dakin. * Resources/AddImageToPhotos.pdf: Added. * Resources/CopyImage.pdf: Added. * Resources/SaveImageToDownloads.pdf: Added. * Resources/ShareImage.pdf: Added. Add some temporary artwork. * Scripts/webkit/messages.py: (struct_or_class): ActionMenuHitTestResult is a struct. * Shared/API/c/WKActionMenuItemTypes.h: Add new items for image menus. * Shared/mac/ActionMenuHitTestResult.cpp: (WebKit::ActionMenuHitTestResult::encode): (WebKit::ActionMenuHitTestResult::decode): For now, pass the hit image data across to the UI process as a ShareableBitmap. * Shared/mac/ActionMenuHitTestResult.h: * UIProcess/API/mac/WKView.mm: (-[WKView _createActionMenuItemForTag:]): Refactor action menu item creation into a single function, so that callers can share code and be much simpler. (webKitBundleImageNamed): Add a helper to acquire an image from the WebKit2 bundle. (-[WKView _copyImage:]): (-[WKView _saveImageToDownloads:]): (temporaryPhotosDirectoryPath): (pathToPhotoOnDisk): (-[WKView _addImageToPhotos:]): Add rudimentary implementations of image actions. (-[WKView _defaultMenuItemsForImage]): Support the image menu, plus a submenu acquired from NSSharingServicePicker for the Share menu. (-[WKView _defaultMenuItems]): Call _defaultMenuItemsForImage if needed. (-[WKView _updateActionMenu]): Refactor _updateActionMenu out of prepareForMenu:withEvent:. (-[WKView prepareForMenu:withEvent:]): Ask the Web process to re-hit-test under the location that the menu will appear. Mark the menu as pending. (-[WKView _didPerformActionMenuHitTest:]): When we get the hit test reply, record the result for future use. (-[WKView willOpenMenu:withEvent:]): If we got a hit test reply, rebuild the menu immediately. If not, wait up to 500ms for the reply to come in. This eventually needs to be cancellable if the menu is rejected in the interim. (-[WKView didCloseMenu:withEvent:]): Clear all state when the menu closes. * UIProcess/API/mac/WKViewInternal.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::performActionMenuHitTestAtLocation): (WebKit::WebPageProxy::didPerformActionMenuHitTest): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::didPerformActionMenuHitTest): * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Plumb didPerformActionMenuHitTest back from WebPageProxy to WKView. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performActionMenuHitTestAtLocation): Hit test at the given location, recording the image data if there is any, and return the result to the UI process. * WebKit2.xcodeproj/project.pbxproj: Add the PDFs. 2014-10-22 Gyuyoung Kim Remove WidgetBackingStoreCairo::create() factory function https://bugs.webkit.org/show_bug.cgi?id=137943 Reviewed by Darin Adler. WidgetBackingStoreCairo::create() can be replaced by std::make_unique<>. Thus this patch removes it, then use std::make_unique<>|std::unique_ptr<>. * UIProcess/BackingStore.h: * UIProcess/cairo/BackingStoreCairo.cpp: (WebKit::createBackingStoreForGTK): (WebKit::BackingStore::incorporateUpdate): 2014-10-22 Gyuyoung Kim Remove TextCheckerEnchant::create() factory function https://bugs.webkit.org/show_bug.cgi?id=137944 Reviewed by Darin Adler. TextCheckerEnchant::create() can be replaced by std::make_unique<> and std::unique_ptr<>. * UIProcess/API/gtk/WebKitTextChecker.cpp: (WebKitTextChecker::WebKitTextChecker): * UIProcess/API/gtk/WebKitTextChecker.h: * UIProcess/efl/TextCheckerClientEfl.cpp: (TextCheckerClientEfl::TextCheckerClientEfl): * UIProcess/efl/TextCheckerClientEfl.h: 2014-10-22 Antti Koivisto Revert fix for REGRESSION (r173356): Safari can't install a profile, gets 'Download Failed error (https://bugs.webkit.org/show_bug.cgi?id=137493) Turns out the root cause was a bug in MIME type sniffing, https://bugs.webkit.org/show_bug.cgi?id=137855 Remove the workaround. * Shared/Downloads/ios/DownloadIOS.mm: (WebKit::Download::startWithHandle): * Shared/Downloads/mac/DownloadMac.mm: (WebKit::Download::startWithHandle): 2014-10-22 Beth Dakin Remove action menu web preference https://bugs.webkit.org/show_bug.cgi?id=137975 Reviewed by Tim Horton. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetActionMenuSupportEnabled): Deleted. (WKPreferencesGetActionMenuSupportEnabled): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView initWithFrame:context:configuration:webView:]): 2014-10-22 Chris Dumez [Mac][WK2] Fix applicationIsSafari() detection https://bugs.webkit.org/show_bug.cgi?id=137893 Reviewed by Alexey Proskuryakov. Provide an implementation for FrameLoaderClient's new needsQuickLookResourceCachingQuirks(), which accesses the flag stored on the WebProcess, which is initialized upon WebProcess creation. QuickLookMac::computeNeedsQuickLookResourceCachingQuirks() is called on UIProcess side so that it works reliably and the flag is passed as parameter when constructing the WebProcess. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformInitializeWebProcess): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::needsQuickLookResourceCachingQuirks): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): * WebProcess/WebProcess.h: (WebKit::WebProcess::needsQuickLookResourceCachingQuirks): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2014-10-22 Carlos Garcia Campos Unreviewed. Fix GTK+ debug build after r175046. Remove invalid ASSERT. * UIProcess/gtk/InputMethodFilter.cpp: (WebKit::InputMethodFilter::setCursorRect): 2014-10-22 Carlos Garcia Campos [GTK] Move GtkInputMethodFilter from Platform to WebKit2 https://bugs.webkit.org/show_bug.cgi?id=137884 Reviewed by Gustavo Noronha Silva. Merge WebViewBaseInputMethodFilter and GtkInputMethodFilter into a single class InputMethodFilter. The code is mostly the same, but instead of having a setWebView method only to get the WebPageProxy, it has a setPage method that passes the WebPageProxy. The GtkIMContext client window is set by the WebView when it's realized/unrealized. * PlatformGTK.cmake: * Shared/NativeWebKeyboardEvent.h: * Shared/gtk/NativeWebKeyboardEventGtk.cpp: (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseRealize): (webkitWebViewBaseUnrealize): (webkit_web_view_base_class_init): (webkitWebViewBaseCreateWebPage): (webkitWebViewBaseEnterFullScreen): Deleted. * UIProcess/API/gtk/WebViewBaseInputMethodFilter.cpp: Removed. * UIProcess/API/gtk/WebViewBaseInputMethodFilter.h: Removed. * UIProcess/gtk/InputMethodFilter.cpp: Added. (WebKit::InputMethodFilter::handleCommitCallback): (WebKit::InputMethodFilter::handlePreeditStartCallback): (WebKit::InputMethodFilter::handlePreeditChangedCallback): (WebKit::InputMethodFilter::handlePreeditEndCallback): (WebKit::InputMethodFilter::InputMethodFilter): (WebKit::InputMethodFilter::~InputMethodFilter): (WebKit::InputMethodFilter::setEnabled): (WebKit::InputMethodFilter::setCursorRect): (WebKit::InputMethodFilter::handleKeyboardEvent): (WebKit::InputMethodFilter::handleKeyboardEventWithCompositionResults): (WebKit::InputMethodFilter::filterKeyEvent): (WebKit::InputMethodFilter::confirmComposition): (WebKit::InputMethodFilter::updatePreedit): (WebKit::InputMethodFilter::notifyFocusedIn): (WebKit::InputMethodFilter::notifyFocusedOut): (WebKit::InputMethodFilter::notifyMouseButtonPress): (WebKit::InputMethodFilter::confirmCurrentComposition): (WebKit::InputMethodFilter::cancelContextComposition): (WebKit::InputMethodFilter::sendCompositionAndPreeditWithFakeKeyEvents): (WebKit::InputMethodFilter::handleCommit): (WebKit::InputMethodFilter::handlePreeditStart): (WebKit::InputMethodFilter::handlePreeditChanged): (WebKit::InputMethodFilter::handlePreeditEnd): (WebKit::InputMethodFilter::logHandleKeyboardEventForTesting): (WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting): (WebKit::InputMethodFilter::logConfirmCompositionForTesting): (WebKit::InputMethodFilter::logSetPreeditForTesting): * UIProcess/gtk/InputMethodFilter.h: Added. (WebKit::InputMethodFilter::context): (WebKit::InputMethodFilter::setPage): (WebKit::InputMethodFilter::setTestingMode): (WebKit::InputMethodFilter::events): 2014-10-21 Tim Horton Quick Look preview bubble has unnecessary controls https://bugs.webkit.org/show_bug.cgi?id=137940 Reviewed by Simon Fraser. * UIProcess/API/mac/WKView.mm: (-[WKView _quickLookURLFromActionMenu:]): Temporarily use more SPI to allow us to hide the preview bubble's controls. 2014-10-21 Jeff Miller Remove const from WKURLRequestRef parameter to WKContextDownloadURLRequest() https://bugs.webkit.org/show_bug.cgi?id=137928 Reviewed by Darin Adler. * UIProcess/API/C/WKContext.cpp: (WKContextDownloadURLRequest): * UIProcess/API/C/WKContext.h: 2014-10-21 Anders Carlsson WKRemoteObjectCoder should handle floats https://bugs.webkit.org/show_bug.cgi?id=137926 Reviewed by Beth Dakin. * Shared/API/Cocoa/WKRemoteObjectCoder.mm: (encodeInvocation): (-[WKRemoteObjectEncoder encodeFloat:forKey:]): (decodeInvocationArguments): (-[WKRemoteObjectDecoder decodeFloatForKey:]): 2014-10-21 Jeff Miller WKContext needs to provide an API to resume a download https://bugs.webkit.org/show_bug.cgi?id=137507 Reviewed by Darin Adler. This patch adds WKContextResumeDownload(), which is only supported on the Mac, and requires the resume data from WKDownloadGetResumeData(). We have to create a sandbox extension for the partially downloaded file in the UI process so the network or web process can resume writing to it. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::resumeDownload): Added, calls through to DownloadManager::resumeDownload(). * NetworkProcess/NetworkProcess.h: Added resumeDownload(). * NetworkProcess/NetworkProcess.messages.in: Added ResumeDownload message. * Shared/Downloads/Download.h: Added resume(). * Shared/Downloads/DownloadManager.cpp: (WebKit::DownloadManager::resumeDownload): Added. The URL being downloaded is part of the opaque resumeData, so we can't specify it when the Download is constructed. * Shared/Downloads/DownloadManager.h: Added resumeDownload(). * Shared/Downloads/ios/DownloadIOS.mm: (WebKit::Download::resume): Added, not implemented on this platform. * Shared/Downloads/mac/DownloadMac.mm: (WebKit::Download::resume): Added. Consumes the sandbox extension, resumes the download, and sets m_request after the NSURLDownload has been created. Note that we already have code to revoke the sandbox extension when the download is finished, canceled, or fails. * Shared/Downloads/soup/DownloadSoup.cpp: (WebKit::Download::resume): Added, not implemented on this platform. * UIProcess/API/C/WKContext.cpp: (WKContextResumeDownload): Added. * UIProcess/API/C/WKContext.h: Added WKContextResumeDownload(). * UIProcess/WebContext.cpp: (WebKit::WebContext::resumeDownload): Added. Creates a sandbox extension for the existing file and includes it in the message to the network or web process. * UIProcess/WebContext.h: Added resumeDownload(). * WebProcess/WebProcess.cpp: (WebKit::WebProcess::resumeDownload): Added, calls through to DownloadManager::resumeDownload(). * WebProcess/WebProcess.h: Added resumeDownload(). * WebProcess/WebProcess.messages.in: Added ResumeDownload message. 2014-10-20 Michael Catanzaro Change the default TLS errors policy to WEBKIT_TLS_ERRORS_POLICY_FAIL https://bugs.webkit.org/show_bug.cgi?id=137832 Reviewed by Carlos Garcia Campos. Too many general-purpose browsers that really need this policy are not selecting it, so let's do so for them. * UIProcess/API/gtk/WebKitWebContext.cpp: (createDefaultWebContext): 2014-10-21 Michael Catanzaro [SOUP] Disable SSLv3 https://bugs.webkit.org/show_bug.cgi?id=137859 Reviewed by Carlos Garcia Campos. Set G_TLS_GNUTLS_PRIORITY if unset. * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp: (main): * WebProcess/EntryPoint/unix/WebProcessMain.cpp: (main): 2014-10-20 Chris Dumez ResourceRequest deserialization unnecessarily calls partitionName() on encoded cache partition https://bugs.webkit.org/show_bug.cgi?id=137797 Reviewed by Darin Adler. This patch adds a |needsValidation| argument to ResourceRequest::setCachePartition() setter so that the caller can indicate that the partition name is valid (because it was already processed by partitionName() before). Use this new argument in ArgumentCoder::decode() to spent a bit less time deserializing resource requests. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::decode): 2014-10-20 Beth Dakin Action menu items should have tags https://bugs.webkit.org/show_bug.cgi?id=137898 Reviewed by Anders Carlsson. * Shared/API/c/WKActionMenuItemTypes.h: Added. * UIProcess/API/mac/WKView.mm: (-[WKView _defaultMenuItemsForLink]): * WebKit2.xcodeproj/project.pbxproj: 2014-10-20 Beth Dakin Add support for action menus https://bugs.webkit.org/show_bug.cgi?id=137891 rdar://problem/18451638 rdar://problem/18694470 Reviewed by Anders Carlsson. Temporary artwork needed for menu item. * Resources/OpenInNewWindowTemplate.pdf: Added. * WebKit2.xcodeproj/project.pbxproj: Add a preference that defaults to false for action menu support. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetActionMenuSupportEnabled): (WKPreferencesGetActionMenuSupportEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: New SPI. WebKit clients can implement this method to customize the action menu. * UIProcess/API/Cocoa/WKViewPrivate.h: Create the action menu if it is supported. * UIProcess/API/mac/WKView.mm: (-[WKView initWithFrame:context:configuration:webView:]): Methods to implement the default menu actions. (-[WKView _openURLFromActionMenu:]): (-[WKView _addToReadingListFromActionMenu:]): (-[WKView _quickLookURLFromActionMenu:]): Add action menus support for links. Populate the menu at the right time. (-[WKView _defaultMenuItemsForLink]): (-[WKView _defaultMenuItems]): (-[WKView prepareForMenu:withEvent:]): (-[WKView _actionMenuItemsForHitTestResult:defaultActionMenuItems:]): New member variable caches the HitTestResult on mouse move. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::mouseDidMoveOverElement): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::activeActionMenuHitTestResult): 2014-10-20 Timothy Hatcher Web Inspector: Delay and white area when Web Inspector crashes https://bugs.webkit.org/show_bug.cgi?id=137230 Reviewed by Anders Carlsson. * UIProcess/WebInspectorProxy.cpp: (WebKit::processDidCrash): Added. (WebKit::WebInspectorProxy::eagerlyCreateInspectorPage): Hook up loader client. 2014-10-20 Joseph Pecoraro Web Inspector: Generate all Inspector domains together in JavaScriptCore https://bugs.webkit.org/show_bug.cgi?id=137748 Reviewed by Brian Burg. * PlatformGTK.cmake: 2014-10-19 Antti Koivisto Avoid unnecessary NSURLResponse construction for QuickLook on iOS https://bugs.webkit.org/show_bug.cgi?id=137876 Reviewed by Andy Estes. * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveResponse): Switch to the modified QuickLookHandle interface that does not need NSURLResponse. 2014-10-16 Andy Estes [iOS] Capture WKActionSheetAssistant's interaction with WKContentView in a @protocol https://bugs.webkit.org/show_bug.cgi?id=137792 Reviewed by Tim Horton. WKPDFView would like to use WKActionSheetAssistant to show an action sheet when long-pressing a link, but it can't so long as WKActionSheetAssistant is tightly coupled to WKContentView. Resolve this by factoring WKActionSheetAssistant's interaction with WKContentView into a new protocol called WKActionSheetAssistantDelegate and having WKContentView conform to this protocol. * UIProcess/API/Cocoa/_WKElementAction.mm: (+[_WKElementAction elementActionWithTitle:actionHandler:]): Changed instances of WKContentView * to id . (+[_WKElementAction elementActionWithType:customTitle:]): Ditto. (-[_WKElementAction _runActionWithElementInfo:delegate:]): Ditto. (copyElement): Deleted. (saveImage): Deleted. (-[_WKElementAction _runActionWithElementInfo:view:]): Deleted. * UIProcess/API/Cocoa/_WKElementActionInternal.h: * UIProcess/ios/WKActionSheet.h: * UIProcess/ios/WKActionSheet.mm: (-[WKActionSheet init]): Renamed from initWithView: since WKActionSheet no longer needs to know about a view. (-[WKActionSheet _didRotateAndLayout]): Called -[WKActionSheetDelegate updatePositionInformation]. (-[WKActionSheet initWithView:]): Deleted. * UIProcess/ios/WKActionSheetAssistant.h: * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant delegate]): Added a getter for the delegate property. (-[WKActionSheetAssistant setDelegate:]): Added a setter for the delegate property. (-[WKActionSheetAssistant initWithView:]): Changed argument type from WKContentView * to UIView *. (-[WKActionSheetAssistant initialPresentationRectInHostViewForSheet]): Returned CGRectZero if there is no delegate. Otherwise, retrieved positionInformation from the delegate. (-[WKActionSheetAssistant presentationRectInHostViewForSheet]): Ditto. (-[WKActionSheetAssistant updatePositionInformation]): Called -[WKActionSheetAssistantDelegate updatePositionInformation]. (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]): Returned early if there is no delegate. Otherwise, retrieved positionInformation from the delegate. (-[WKActionSheetAssistant showImageSheet]): Ditto. (-[WKActionSheetAssistant showLinkSheet]): Ditto. (-[WKActionSheetAssistant showDataDetectorsSheet]): Ditto. (-[WKActionSheetAssistant cleanupSheet]): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): Installed self as WKActionSheetAssistant's delegate. (-[WKContentView updatePositionInformation]): Renamed from _updatePositionInformation. (-[WKContentView performAction:]): Renamed from _performAction:. (-[WKContentView openElementAtLocation:]): Called _attemptClickAtLocation:. (-[WKContentView actionsForElement:defaultActions:]): Called API::UIClient::actionsForElement(). (-[WKContentView startInteractionWithElement:]): Called WebPageProxy::startInteractionWithElementAtPosition(). (-[WKContentView stopInteraction]): Called WebPageProxy::stopInteraction(). (-[WKContentView _updatePositionInformation]): Deleted. (-[WKContentView _performAction:]): Deleted. 2014-10-20 Carlos Garnacho [GTK] Improve zooming gesture positioning https://bugs.webkit.org/show_bug.cgi?id=137822 Reviewed by Carlos Garcia Campos. * UIProcess/WebPageProxy.h: * UIProcess/gtk/GestureController.cpp: (WebKit::GestureController::ZoomGesture::center): (WebKit::GestureController::ZoomGesture::begin): (WebKit::GestureController::ZoomGesture::handleZoom): (WebKit::GestureController::ZoomGesture::scaleChanged): Calculate the proper view coordinates for the current offset/scale, based on the initial gesture center point in document coordinates, and the current center/scale. * UIProcess/gtk/GestureController.h: * UIProcess/gtk/WebPageProxyGtk.cpp: (WebKit::WebPageProxy::getCenterForZoomGesture): Added. Synchronous call to retrieve the zoom gesture anchor point, in document coordinates. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Added stub. * WebProcess/WebPage/gtk/WebPageGtk.cpp: (WebKit::WebPage::getCenterForZoomGesture): Added. Getter for the translated coordinates used as the anchor point of the zoom gesture. 2014-10-20 Carlos Garcia Campos [GTK] Remove the factory method from DragAndDropHandler https://bugs.webkit.org/show_bug.cgi?id=137872 Reviewed by Sergio Villar Senin. Make the constructor public and use std::make_unique instead. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseDragAndDropHandler): * UIProcess/gtk/DragAndDropHandler.cpp: (WebKit::DragAndDropHandler::create): Deleted. * UIProcess/gtk/DragAndDropHandler.h: 2014-10-20 Carlos Garcia Campos [GTK] Add initial gestures support https://bugs.webkit.org/show_bug.cgi?id=137812 Reviewed by Sergio Villar Senin. Now that GTK+ has support for gestures, we can use it to handle touch events and allow to scroll, zoom and tap with the fingers. * PlatformGTK.cmake: Add new files to compilation. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::doneWithTouchEvent): When the touch event hasn't been handled by the web process pass it to the GestureController and only fallback to pointer emulation when the GestureController doesn't handle the event. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseTouchEvent): If the GestureController is currently processing gestures is because the START touch event was not handled by the web process, so pass any successive touch events to the GestureController directly. (webkitWebViewBaseGestureController): Create the GestureController on demand and return a reference. * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: * UIProcess/gtk/GestureController.cpp: Added. (WebKit::GestureController::create): Create a GestureController. (WebKit::GestureController::GestureController): Initialize the Gesture memebers. (WebKit::GestureController::handleEvent): Pass the event to the gestures. (WebKit::GestureController::isProcessingGestures): Whether Gestures are active. (WebKit::GestureController::Gesture::Gesture): Base class for gestures. (WebKit::GestureController::Gesture::isActive): Whether the gesture is active. (WebKit::GestureController::Gesture::handleEvent): Pass the event to the GtkGesture to process it. (WebKit::GestureController::DragGesture::handleDrag): Send a wheel event corresponding to the drag gesture to the web process. (WebKit::GestureController::DragGesture::handleTap): Send move, press and release events corresponding to a tap gesture to the web process. (WebKit::GestureController::DragGesture::begin): Start a drag gesture and schedule a timer to discard tap gesture in case of long press. (WebKit::GestureController::DragGesture::update): If the actual drag hasn't started yet, check the drag threshold to decide whether to start the drag or not. Otherwise call handleDrag() to send the appropriate events to the web process. (WebKit::GestureController::DragGesture::end): If the drag gesture finishes and the drag didn't happen (it wasn't a long press and drag threshold was not reached), call handleTap() to emulate a click event. (WebKit::GestureController::DragGesture::DragGesture): Initialize the GtkGestureDrag. (WebKit::GestureController::ZoomGesture::begin): Save the current page scale factor and the center point of the gesture. (WebKit::GestureController::ZoomGesture::scaleChanged): Schedule a page scale change in an idle for the given scale value. (WebKit::GestureController::ZoomGesture::ZoomGesture): Initialize the GtkGestureZoom. * UIProcess/gtk/GestureController.h: Added. 2014-10-19 Chris Dumez Use is<>() / downcast<>() for all remaining RenderObject subclasses https://bugs.webkit.org/show_bug.cgi?id=137845 Reviewed by Darin Adler. Use is<>() / downcast<>() for all remaining RenderObject subclasses and clean up the surrounding code. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::pluginProcessCrashed): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::createPlugin): 2014-10-19 Carlos Garcia Campos [GTK] Move GtkDragAndDropHelper from Platform to WebKit2 https://bugs.webkit.org/show_bug.cgi?id=137422 Reviewed by Martin Robinson. WebKitWebViewBase is currently the only user of GtkDragAndDropHelper, that was added to share the code with WebKit1. Move all the drag and drop logic to a new class DragAndDropHandler. * PlatformGTK.cmake: Add new files to compilation. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::startDrag): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseConstructed): (webkitWebViewBaseDragDataGet): (webkitWebViewBaseDragEnd): (webkitWebViewBaseDragDataReceived): (webkitWebViewBaseDragMotion): (webkitWebViewBaseDragLeave): (webkitWebViewBaseDragDrop): (webkitWebViewBaseDragAndDropHandler): (dragExitedCallback): Deleted. (webkitWebViewBaseStartDrag): Deleted. * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: * UIProcess/gtk/DragAndDropHandler.cpp: Added. (WebKit::DragAndDropHandler::create): (WebKit::DragAndDropHandler::DragAndDropHandler): (WebKit::DragAndDropHandler::DroppingContext::DroppingContext): (WebKit::dragOperationToGdkDragActions): (WebKit::dragOperationToSingleGdkDragAction): (WebKit::gdkDragActionToDragOperation): (WebKit::DragAndDropHandler::startDrag): (WebKit::DragAndDropHandler::fillDragData): (WebKit::DragAndDropHandler::finishDrag): (WebKit::DragAndDropHandler::dataObjectForDropData): (WebKit::DragAndDropHandler::dragEntered): (WebKit::DragAndDropHandler::requestDragData): (WebKit::DragAndDropHandler::dragMotion): (WebKit::DragAndDropHandler::dragLeave): (WebKit::DragAndDropHandler::drop): * UIProcess/gtk/DragAndDropHandler.h: Added. 2014-10-18 Dan Bernstein WorkQueue dispatches functions but isn’t a FunctionDispatcher https://bugs.webkit.org/show_bug.cgi?id=137853 Reviewed by Anders Carlsson. * Platform/WorkQueue.h: Changed to inherit from FunctionDispatcher. 2014-10-18 Michael Catanzaro [GTK] Improve documentation of webkit_web_view_get_tls_info() https://bugs.webkit.org/show_bug.cgi?id=137852 Reviewed by Martin Robinson. * UIProcess/API/gtk/WebKitWebView.cpp: 2014-10-17 Chris Dumez Use is<>() / downcast<>() for RenderBox https://bugs.webkit.org/show_bug.cgi?id=137804 Reviewed by Andreas Kling. Use is<>() / downcast<>() for RenderBox and clean up the surrounding code. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::determinePrimarySnapshottedPlugIn): (WebKit::WebPage::plugInIsPrimarySize): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::sendTapHighlightForNodeIfNecessary): 2014-10-16 Simon Fraser [iOS] Turn off font autosizing for iOS WebKitTestRunner https://bugs.webkit.org/show_bug.cgi?id=137806 Reviewed by Sam Weinig. Confusingly, WKPreferencesSetTextAutosizingEnabled() does nothing on iOS. Instead, we have to add WKPreferencesSetMinimumZoomFontSize() and set it to 0 to disable font autosizing. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetMinimumZoomFontSize): (WKPreferencesGetMinimumZoomFontSize): * UIProcess/API/C/WKPreferencesRefPrivate.h: 2014-10-17 Gyuyoung Kim [EFL] REGRESSION(r173929): It broke the Web Inspector https://bugs.webkit.org/show_bug.cgi?id=137522 Reviewed by Csaba Osztrogonác. r173929 let web inspector use a separate web process. Besides it changed that the inspector is shown as docking mode by default. However EFL port doesn't support to show web inspector as docking window yet. This patch is to show web inspector on EFL new window as before. Docking mode should be implemented by upcoming patch. * UIProcess/efl/WebInspectorProxyEfl.cpp: (WebKit::WebInspectorProxy::platformAttach): 2014-10-17 Carlos Garcia Campos [GLIB] Add API to GMainLoopSource to schedule sources after a delay in microseconds https://bugs.webkit.org/show_bug.cgi?id=137782 Reviewed by Sergio Villar Senin. * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: (WebKit::LayerTreeHostGtk::layerFlushTimerFired): Use microseconds instead of milliseconds. 2014-10-17 Carlos Garcia Campos [GTK] Move touch events handling from Platform to WebKit2 https://bugs.webkit.org/show_bug.cgi?id=137735 Reviewed by Sergio Villar Senin. GtkTouchContextHelper was only used by WebKitWebViewBase, since it's the only one that can create touch events. The code has been simplified by processing the events in the view, and the native touch events are now created with the native event and touch points. * Shared/NativeWebTouchEvent.h: (WebKit::NativeWebTouchEvent::touchContext): Deleted. * Shared/gtk/NativeWebTouchEventGtk.cpp: (WebKit::NativeWebTouchEvent::NativeWebTouchEvent): Pass touch points instead of touch context to WebEventFactory::createWebTouchEvent(). * Shared/gtk/WebEventFactory.cpp: (WebKit::WebEventFactory::createWebTouchEvent): Create the WebTouchEvent for the given native event and points. (WebKit::touchPhaseFromEvents): Deleted. (WebKit::appendTouchEvent): Deleted. * Shared/gtk/WebEventFactory.h: * UIProcess/API/gtk/WebKitWebViewBase.cpp: (appendTouchEvent): Helper function to create a WebPlatformTouchPoint for the given native event and add it to the list of touch points. (webkitWebViewBaseGetTouchPointForEvent): Build the touch point list for the event. (webkitWebViewBaseTouchEvent): Process the touch event. (webkitWebViewBaseDragDataReceived): Deleted. 2014-10-16 Pascal Jacquemart Removing CUSTOM_PROTOCOLS guard https://bugs.webkit.org/show_bug.cgi?id=137741 Reviewed by Benjamin Poulain. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::NetworkProcess): * Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm: * Shared/Network/CustomProtocols/CustomProtocolManager.h: * Shared/Network/CustomProtocols/CustomProtocolManager.messages.in: * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.cpp: * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.h: * Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp: * Shared/Network/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode): (WebKit::NetworkProcessCreationParameters::decode): * Shared/Network/NetworkProcessCreationParameters.h: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/API/C/soup/WKAPICastSoup.h: * UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp: (WKSoupCustomProtocolRequestManagerGetTypeID): (WKSoupCustomProtocolRequestManagerSetClient): * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h: * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.messages.in: * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm: * UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp: * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp: * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.h: * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp: * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::NetworkProcessProxy): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebContext.cpp: (WebKit::WebContext::WebContext): (WebKit::WebContext::unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers): (WebKit::WebContext::unregisterSchemeForCustomProtocol): * UIProcess/WebContext.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::WebProcessProxy): * UIProcess/WebProcessProxy.h: * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformInitializeWebProcess): (WebKit::WebContext::platformInitializeNetworkProcess): * WebKit2Prefix.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): * WebProcess/soup/WebKitSoupRequestGeneric.cpp: (webkitSoupRequestGenericSendAsync): (webkitSoupRequestGenericSendFinish): * WebProcess/soup/WebKitSoupRequestGeneric.h: 2014-10-16 Simon Fraser Crash under RemoteLayerTreeHost::getLayer() when closing a tab https://bugs.webkit.org/show_bug.cgi?id=137796 rdar://problem/18547565 Reviewed by Tim Horton. CA can call our animation delegate after the RemoteLayerTreeHost has been destroyed. CAAnimation retains its delegate, so it's safe for us to null out the WKAnimationDelegate's pointer to the RemoteLayerTreeHost when tearing down the RemoteLayerTreeHost. * UIProcess/mac/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::~RemoteLayerTreeHost): (WebKit::RemoteLayerTreeHost::animationDidEnd): * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: (-[WKAnimationDelegate invalidate]): (-[WKAnimationDelegate animationDidStart:]): (-[WKAnimationDelegate animationDidStop:finished:]): 2014-10-16 Tim Horton Implement selection services menu for Legacy WebKit https://bugs.webkit.org/show_bug.cgi?id=137582 Reviewed by Brady Eidson. * UIProcess/mac/WebContextMenuProxyMac.mm: (-[WKSharingServicePickerDelegate sharingService:didShareItems:]): Add a note that we should transition to using replaceSelectionWithAttributedString. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::handleSelectionServiceClick): Allow editor services in editable-but-not-rich-text areas, just like in WebKit1. 2014-10-16 Tim Horton Various crashes in ViewGestureControllerIOS when closing a tab while a swipe gesture is in progress https://bugs.webkit.org/show_bug.cgi?id=137770 Reviewed by Dan Bernstein. When tearing down a WKWebView in the middle of a swipe gesture, a variety of UI process crashes were observed. First, two uses of potentially deleted objects (the WebBackForwardListItem and ViewGestureController), which were fixed by extending the object's lifetime and checking for its liveness, respectively. Second, a potential null-deref of DrawingArea if the timing of endSwipeGesture vs. page teardown was such that DrawingArea was null but everything else was in line. Lastly, another case of messaging a potentially deleted object (specifically, the _UIViewControllerTransitionContext's animator) in a callback from CA, which was fixed by nulling out the animator (and a few other properties) when tearing down the ViewGestureController. * UIProcess/ios/ViewGestureControllerIOS.mm: (-[WKSwipeTransitionController invalidate]): Clear the soon-to-be-invalid ViewGestureController pointer. (WebKit::ViewGestureController::~ViewGestureController): Call [WKSwipeTransitionController invalidate] upon destruction. Clear our transition context's interactor and animator, and inform it that the transition is not in flight. This avoids a crash when calling back to the already-destroyed animator later. (WebKit::ViewGestureController::beginSwipeGesture): Keep a reference to the target WebBackForwardListItem; this avoids it being deleted between here and the transition completion block firing. Look up the ViewGestureController by pageID, just like we do in endSwipeGesture, to avoid situations where the callback fires after the WKWebView/ViewGestureController have gone away. Hold on to our _UIViewControllerOneToOneTransitionContext, so that we can do the aforementioned clearing upon deallocation. (WebKit::ViewGestureController::endSwipeGesture): Null check the DrawingArea. If it is null, instead of doing our normal delayed logic for swipe snapshot teardown, just put things back together immediately. (WebKit::ViewGestureController::removeSwipeSnapshot): Clear m_swipeTransitionContext. 2014-10-16 Antti Koivisto REGRESSION (r173356): Downloading a disk image appends ".txt" to it https://bugs.webkit.org/show_bug.cgi?id=137493 Reviewed by Alexey Proskuryakov. * Shared/Downloads/ios/DownloadIOS.mm: (WebKit::Download::startWithHandle): * Shared/Downloads/mac/DownloadMac.mm: (WebKit::Download::startWithHandle): It appears that the synthesized NS/CFURLResponse fails to serialize the suggested filename correctly unless it has been accessed first. 2014-10-15 Dan Bernstein [Cocoa] "Plug-in will handle load" error isn't declared in the modern API https://bugs.webkit.org/show_bug.cgi?id=137747 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKError.mm: Define _WKLegacyErrorDomain. * UIProcess/API/Cocoa/WKErrorInternal.h: Changed to import WKErrorPrivate.h. * UIProcess/API/Cocoa/WKErrorPrivate.h: Added. Declares _WKLegacyErrorDomain and _WKLegacyErrorPlugInWillHandleLoad. * WebKit2.xcodeproj/project.pbxproj: Added new private header. 2014-10-15 Chris Dumez Use is<>() / downcast<>() for TransformOperation subclasses https://bugs.webkit.org/show_bug.cgi?id=137731 Reviewed by Darin Adler. Use is<>() / downcast<>() for TransformOperation subclasses and clean up the surrounding code. * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: (IPC::ArgumentCoder::encode): 2014-10-15 Alexey Proskuryakov [Mac] Allow some Kerberos related paths in sandbox https://bugs.webkit.org/show_bug.cgi?id=137666 rdar://problem/17965010 Reviewed by Darin Adler. * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: * WebProcess/com.apple.WebProcess.sb.in: 2014-10-15 Alexey Proskuryakov [Mac] Allow plug-ins to read managed preferences https://bugs.webkit.org/show_bug.cgi?id=137665 Reviewed by Darin Adler. * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb: 2014-10-14 Joonghun Park [WK2][EFL] Fix the problem that threads created by a DispatchQueueEfl are not destroyed even after the DispatchQueueEfl has been destructed https://bugs.webkit.org/show_bug.cgi?id=137195 Reviewed by Gyuyoung Kim. Linux and Unix System's pthreads are created in joinable state by default. If threads aren't destructed explicitly, it will be still live until process which created the thread is dead. Besides it may cause out of capacity range of thread creation in a process. It is one of hidden defects. This patch calls detachThread() to detach thread immediately after it is created. So the thread can be destroyed as soon as the thread's ThreadContext::function() returns. * Platform/efl/DispatchQueueEfl.cpp: (DispatchQueue::ThreadContext::start): 2014-10-14 Chris Dumez Use is<>() / downcast<>() for PlatformCAAnimation subclasses https://bugs.webkit.org/show_bug.cgi?id=137722 Reviewed by Simon Fraser. Use is<>() / downcast<>() for PlatformCAAnimation subclasses and clean up the surrounding code. * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: (WebKit::PlatformCAAnimationRemote::copy): (WebKit::PlatformCAAnimationRemote::copyTimingFunctionFrom): (WebKit::PlatformCAAnimationRemote::copyFromValueFrom): (WebKit::PlatformCAAnimationRemote::copyToValueFrom): (WebKit::PlatformCAAnimationRemote::copyValuesFrom): (WebKit::PlatformCAAnimationRemote::copyKeyTimesFrom): (WebKit::PlatformCAAnimationRemote::copyTimingFunctionsFrom): * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::addAnimationForKey): (WebKit::PlatformCALayerRemote::animationStarted): * WebProcess/WebPage/mac/PlatformCALayerRemote.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom): 2014-10-14 Alexey Proskuryakov REGRESSION (r165356): Issues with Japanese text input https://bugs.webkit.org/show_bug.cgi?id=137719 rdar://problem/18431952 rdar://problem/18483741 Reviewed by Darin Adler. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didChangeSelection): In sync code path, ensure consistent message delivery order by adding a DispatchMessageEvenWhenWaitingForSyncReply flag. This way, delayed EditorStateChanged messages won't confuse UI process. 2014-10-14 Anders Carlsson Hide the find indicator when starting a swipe https://bugs.webkit.org/show_bug.cgi?id=137711 Reviewed by Tim Horton. * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::navigationGestureDidBegin): 2014-10-14 Chris Dumez Use is<>() / downcast<>() for RenderImage https://bugs.webkit.org/show_bug.cgi?id=137683 Reviewed by Mihnea Ovidenie. Use is<>() / downcast<>() for RenderImage. * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::cachedImage): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::performActionOnElement): 2014-10-13 Carlos Garcia Campos [GTK][CMake] Non-ninja build is broken since r174422 https://bugs.webkit.org/show_bug.cgi?id=137656 Reviewed by Philippe Normand. Make WebKit2-forwarding-headers depend only on static, non-generated sources. * CMakeLists.txt: * PlatformGTK.cmake: 2014-10-13 Chris Dumez Use is<>() / downcast<>() for PlatformCALayer subclasses https://bugs.webkit.org/show_bug.cgi?id=137661 Reviewed by Simon Fraser. Use is<>() / downcast<>() for PlatformCALayer subclasses and clean up the surrounding code. * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::~PlatformCALayerRemote): (WebKit::PlatformCALayerRemote::updateClonedLayerProperties): (WebKit::PlatformCALayerRemote::recursiveBuildTransaction): (WebKit::PlatformCALayerRemote::setSublayers): (WebKit::PlatformCALayerRemote::appendSublayer): (WebKit::PlatformCALayerRemote::insertSublayer): (WebKit::PlatformCALayerRemote::replaceSublayer): (WebKit::PlatformCALayerRemote::adoptSublayers): (WebKit::PlatformCALayerRemote::setMask): (WebKit::PlatformCALayerRemote::copyFiltersFrom): * WebProcess/WebPage/mac/PlatformCALayerRemote.h: * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h: * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm: (WebKit::RemoteLayerTreeContext::buildTransaction): 2014-10-13 Chris Dumez Use is<>() / downcast<>() for Filter / FilterOperation subclasses https://bugs.webkit.org/show_bug.cgi?id=137644 Reviewed by Darin Adler. Use is<>() / downcast<>() for Filter / FilterOperation subclasses. * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: (IPC::ArgumentCoder::encode): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTextStream::operator<<): 2014-10-12 Sergio Villar Senin [SOUP] [WK2] WebProcess and NetworkProcess initialization clears cache contents https://bugs.webkit.org/show_bug.cgi?id=137489 Reviewed by Carlos Garcia Campos. Temporarily set the SoupCache's maximum size to a huge value before calling soup_cache_load() so that the cache is not shrinked to the default value. * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::NetworkProcess::platformInitializeNetworkProcess): * WebProcess/soup/WebProcessSoup.cpp: (WebKit::WebProcess::platformInitializeWebProcess): 2014-10-12 Ryuan Choi [EFL] Introduce EWebKit_Extension https://bugs.webkit.org/show_bug.cgi?id=134921 Reviewed by Gyuyoung Kim. EWebKit2 does not provide the functionality to extend WebProcess. Although there is ewk_context_new_with_injected_bundle_path() in ewebkit2 APIs, application developers can not make bundle object without touching WK APIs which ewebkit2 does not expose. This patch introduces EWebKit_Extension, basic structure for the extension of WebProcess. * PlatformEfl.cmake: Added files for the EWebKit_Extension and install them properly. * UIProcess/API/efl/ewk_context.cpp: (EwkContext::EwkContext): (bundlePathForExtension): (EwkContext::create): (EwkContext::getInjectedBundleInitializationUserData): (EwkContext::setMessageFromInjectedBundleCallback): (ewk_context_new_with_extensions_path): Deleted because ewebkit2 does not have a way to make injected bundle. Instead, Ewk_Extension will cover the same functionalities. (ewk_context_new_with_injected_bundle_path): Deleted. * UIProcess/API/efl/ewk_context.h: * UIProcess/API/efl/ewk_context_private.h: (EwkContext::extensionsPath): * UIProcess/API/efl/tests/InjectedBundle/injected_bundle_sample.cpp: Removed. * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.cpp: (EWK2UnitTest::EWK2UnitTestEnvironment::extensionSample): (EWK2UnitTest::EWK2UnitTestEnvironment::injectedBundleSample): Renamed injectedBundleSample to extensionSample. * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.h: * UIProcess/API/efl/tests/extensions/extension_sample.cpp: Copied from Source/WebKit2/UIProcess/API/efl/tests/InjectedBundle/injected_bundle_sample.cpp. * UIProcess/API/efl/tests/test_ewk2_context.cpp: Renamed ewk_context_new_with_injected_bundle_path to ewk_context_new_with_extensions_path. (TEST_F): * WebProcess/InjectedBundle/API/efl/EWebKit_Extension.h: Added. * WebProcess/InjectedBundle/API/efl/ewk_extension.cpp: Added. (EwkExtension::append): (EwkExtension::remove): (ewk_extension_client_add): (ewk_extension_client_del): * WebProcess/InjectedBundle/API/efl/ewk_extension.h: Added. * WebProcess/InjectedBundle/API/efl/ewk_extension_private.h: Added. (EwkExtension::EwkExtension): (EwkExtension::~EwkExtension): * WebProcess/efl/ExtensionManagerEfl.cpp: Added. (WebKit::ExtensionManagerEfl::shared): (WebKit::ExtensionManagerEfl::ExtensionManagerEfl): (WebKit::ExtensionManagerEfl::initialize): * WebProcess/efl/ExtensionManagerEfl.h: Added. * WebProcess/efl/WebInjectedBundleMainEfl.cpp: Added. (WKBundleInitialize): * efl/ewebkit2-extension.pc.in: Added. 2014-10-10 Chris Dumez Use is<>() / downcast<>() for Image subclasses https://bugs.webkit.org/show_bug.cgi?id=137625 Reviewed by Andreas Kling. Use is<>() / downcast<>() for Image subclasses. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::pluginSnapshotTimerFired): 2014-10-10 Chris Dumez Use is<>() / downcast<>() for GraphicsLayer subclasses https://bugs.webkit.org/show_bug.cgi?id=137595 Reviewed by Darin Adler. Use is<>() / downcast<>() for GraphicsLayer subclasses and clean up the surrounding code. * WebProcess/WebPage/mac/GraphicsLayerCARemote.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::flushLayers): * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::layerForTransientZoom): (WebKit::TiledCoreAnimationDrawingArea::shadowLayerForTransientZoom): 2014-10-10 Pascal Jacquemart Fix debug build on EFL after r174584 https://bugs.webkit.org/show_bug.cgi?id=137613 Reviewed by Christophe Dumez. * UIProcess/efl/RequestManagerClientEfl.cpp: (WebKit::RequestManagerClientEfl::RequestManagerClientEfl): 2014-10-10 Chris Dumez Use is<>() / downcast<>() for RenderBoxModelObject https://bugs.webkit.org/show_bug.cgi?id=137587 Reviewed by Mihnea Ovidenie. Use is<>() / downcast<>() for RenderBoxModelObject and clean up the surrounding code. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::renderer): (WebKit::PluginView::invalidateRect): 2014-10-10 Pascal Jacquemart [SOUP] Remove custom URI schemes implementation https://bugs.webkit.org/show_bug.cgi?id=128169 Reviewed by Carlos Garcia Campos. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/API/C/soup/WKAPICastSoup.h: * UIProcess/API/C/soup/WKContextSoup.cpp: Removed. * UIProcess/API/C/soup/WKSoupRequestManager.cpp: Removed. * UIProcess/WebContext.cpp: (WebKit::WebContext::WebContext): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didReceiveURIRequest): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/soup/WebSoupRequestManagerClient.cpp: Removed. * UIProcess/soup/WebSoupRequestManagerProxy.cpp: Removed. * UIProcess/soup/WebSoupRequestManagerProxy.messages.in: Removed. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): * WebProcess/soup/WebKitSoupRequestGeneric.cpp: (webkitSoupRequestGenericSendAsync): (webkitSoupRequestGenericSendFinish): * WebProcess/soup/WebProcessSoup.cpp: (WebKit::WebProcess::platformInitializeWebProcess): * WebProcess/soup/WebSoupRequestManager.cpp: Removed. * WebProcess/soup/WebSoupRequestManager.messages.in: Removed. 2014-10-09 Dean Jackson Remove ENABLE_CSS3_CONDITIONAL_RULES https://bugs.webkit.org/show_bug.cgi?id=137571 Reviewed by Simon Fraser. * Configurations/FeatureDefines.xcconfig: 2014-10-09 Tim Horton Move ServicesOverlayController to WebCore https://bugs.webkit.org/show_bug.cgi?id=137416 Reviewed by Anders Carlsson. * Platform/Logging.h: Move Services logging channel to WebCore. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::handleTelephoneNumberClick): (WebKit::WebChromeClient::handleSelectionServiceClick): (WebKit::WebChromeClient::hasRelevantSelectionServices): Implement services-related ChromeClient callbacks. Clicks are forwarded to WebPageMac where they do what they used to; hasRelevantSelectionServices is implemented as it was when it lived inside ServicesOverlayController. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::selectedTelephoneNumberRangesChanged): Deleted. (WebKit::WebEditorClient::selectionRectsDidChange): Deleted. * WebProcess/WebCoreSupport/WebEditorClient.h: Remove WebEditorClient overrides for now-removed functions. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): (WebKit::WebPage::updatePreferences): Forward serviceControlsEnabled setting to WebCore. (WebKit::WebPage::servicesOverlayController): Deleted. * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::serviceControlsEnabled): Deleted. 2014-10-09 Andy Estes [iOS] Crash in CFURLDownloadClient.didFail if the download has a null resumeData https://bugs.webkit.org/show_bug.cgi?id=137551 Reviewed by David Kilzer. CFDataGetBytePtr() and CFDataGetLength() crash if passed a null value. * Shared/Downloads/ios/DownloadIOS.mm: (WebKit::setUpDownloadClient): 2014-10-09 Carlos Garcia Campos [X11] Plugin process crashes in NetscapePlugin::platformPostInitialize() https://bugs.webkit.org/show_bug.cgi?id=137426 Reviewed by Darin Adler. For some reason flash crashes when NPP_GetValue is called with NPPVpluginCancelSrcStream, but only in windowed mode. Not calling NPP_GetValue and unconditionally loading the source URL in the browser fixes the crash and plugins work normally. We can handle this particular case with a new quirk. * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp: (WebKit::NetscapePluginModule::determineQuirks): Add DoNotCancelSrcStreamInWindowedMode quirk if it's flash plugin. * Shared/Plugins/PluginQuirks.h: Add DoNotCancelSrcStreamInWindowedMode quirk. * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::shouldLoadSrcURL): Return early if plugin is windowed and DoNotCancelSrcStreamInWindowedMode quirk is present. 2014-10-09 Chris Dumez Use is<>() / downcast<>() for Widget subclasses https://bugs.webkit.org/show_bug.cgi?id=137549 Reviewed by Darin Adler. Use is<>() / downcast<>() for Widget subclasses and clean up the surrounding code. * Shared/WebRenderObject.cpp: (WebKit::WebRenderObject::WebRenderObject): 2014-10-08 Carlos Garcia Campos [GTK] Use the PageLoadState observer also to monitor title and estimated load progress https://bugs.webkit.org/show_bug.cgi?id=136997 Reviewed by Gustavo Noronha Silva. * UIProcess/API/gtk/WebKitLoaderClient.cpp: (attachLoaderClientToView): Remove implementation of didReceiveTitleForFrame, didStartProgress, didChangeProgress and didFinishProgress. (didReceiveTitleForFrame): Deleted. (didChangeProgress): Deleted. * UIProcess/API/gtk/WebKitWebView.cpp: (webkit_web_view_get_estimated_load_progress): Return the value directly from the PageLoadState object, since we don't need to cache the value anymore. (webkitWebViewSetTitle): Deleted. (webkitWebViewSetEstimatedLoadProgress): Deleted. * UIProcess/API/gtk/WebKitWebViewPrivate.h: 2014-10-08 Carlos Garcia Campos Race condition with WebKitWebView:is-loading after starting page load https://bugs.webkit.org/show_bug.cgi?id=136692 Reviewed by Gustavo Noronha Silva. Use PageLoadState::Observer to update both is-loading and uri properties, instead of manually update them. This ensures that our web view is always in sync with the WebPageProxy so that webkit_web_view_is_loading() returns true right after requesting any load. We still need to manually set the is-loading property only in the case where we delay the emission of the load-changed signals when waiting for the main resource. The bahaviour is a bit different but still consistent with what our API documentation says. * UIProcess/API/gtk/WebKitLoaderClient.cpp: (attachLoaderClientToView): Remove didSameDocumentNavigationForFrame implementation, since we are already notified about the URL change by the PageLoadState::Observer. (didSameDocumentNavigationForFrame): Deleted. * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewSetIsLoading): No longer update the URI when changing the is-loading property. (webkitWebViewConstructed): Crate a PageLoadStateObserver and add it to the PageLoadState. (webkitWebViewDispose): Remove the PageLoadStateObserver from the PageLoadState. (webkitWebViewEmitLoadChanged): Add isDelayedEvent parameter to update the is-loading property accordingly when emitting the delayed events. (webkitWebViewEmitDelayedLoadEvents): Pass true as isDelayedEvent parameter of webkitWebViewEmitLoadChanged(). (webkitWebViewLoadChanged): Pass false as isDelayedEvent parameter of webkitWebViewEmitLoadChanged(). (webkitWebViewLoadFailed): (webkitWebViewLoadFailedWithTLSErrors): (webkitWebViewUpdateURI): Deleted. * UIProcess/API/gtk/WebKitWebViewPrivate.h: 2014-10-08 Christophe Dumez Use is<>() / downcast<>() for RenderBlock objects https://bugs.webkit.org/show_bug.cgi?id=137512 Reviewed by Darin Adler. Use is<>() / downcast<>() for RenderBlock objects and clean up the surrounding code. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::rangeForWebSelectionAtPosition): (WebKit::WebPage::contractedRangeFromHandle): 2014-10-08 Ada Chan Implement WKPageIsPlayingAudio(). https://bugs.webkit.org/show_bug.cgi?id=137048 Reviewed by Darin Adler. * UIProcess/API/C/WKPage.cpp: (WKPageIsPlayingAudio): 2014-10-08 Gyuyoung Kim [EFL][CoordinatedGraphics] All EFL layout tests are broken since r174231 https://bugs.webkit.org/show_bug.cgi?id=137443 Reviewed by Zoltan Herczeg. EFL layout test and MiniBrowser have broken since r174231. r174231 was to move PageOverlay implementation from WebKit2 to WebCore with lazy initializing of PageOverlayController. It caused all EFL layout tests crash and build break. To restore EFL layout test, this patch sets viewOverlayRootLayer through attachViewOverlayGraphicsLayer() as mac port's one in r174231. * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp: (WebKit::CoordinatedDrawingArea::attachViewOverlayGraphicsLayer): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost): (WebKit::CoordinatedLayerTreeHost::updateRootLayers): (WebKit::CoordinatedLayerTreeHost::setViewOverlayRootLayer): (WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer): (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: 2014-10-08 Commit Queue Unreviewed, rolling out r174335. https://bugs.webkit.org/show_bug.cgi?id=137515 It broke EFL layout test totally (Requested by gyuyoung on #webkit). Reverted changeset: "[EFL] Introduce EWebKit_Extension" https://bugs.webkit.org/show_bug.cgi?id=134921 http://trac.webkit.org/changeset/174335 2014-10-08 Carlos Garcia Campos [GTK] Make forwarding headers generation depend on source code https://bugs.webkit.org/show_bug.cgi?id=137394 Reviewed by Philippe Normand. Only run generate-forwarding-headers.pl when source code changes and use a different target for the symlinks. * PlatformGTK.cmake: 2014-10-07 Pascal Jacquemart [EFL] Enable custom URI schemes with CustomProtocols https://bugs.webkit.org/show_bug.cgi?id=128177 Reviewed by Gyuyoung Kim. Fixing ewk_context_url_scheme_register() ewebkit2 API rely on r162449 - CustomProtocols implementation from Carlos Garcia Campos * PlatformEfl.cmake: * UIProcess/API/efl/ewk_context.h: * UIProcess/API/efl/ewk_url_scheme_request.cpp: (EwkUrlSchemeRequest::EwkUrlSchemeRequest): (EwkUrlSchemeRequest::finish): * UIProcess/API/efl/ewk_url_scheme_request_private.h: (EwkUrlSchemeRequest::create): * UIProcess/API/efl/tests/test_ewk2_context.cpp: (TEST_F): * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp: * UIProcess/efl/RequestManagerClientEfl.cpp: (WebKit::RequestManagerClientEfl::RequestManagerClientEfl): (WebKit::RequestManagerClientEfl::startLoading): (WebKit::RequestManagerClientEfl::stopLoading): (WebKit::RequestManagerClientEfl::registerURLSchemeHandler): (WebKit::EwkUrlSchemeHandler::EwkUrlSchemeHandler): Deleted. (WebKit::RequestManagerClientEfl::didReceiveURIRequest): Deleted. * UIProcess/efl/RequestManagerClientEfl.h: * UIProcess/efl/WebContextEfl.cpp: (WebKit::WebContext::platformInitializeWebProcess): * UIProcess/soup/WebContextSoup.cpp: (WebKit::WebContext::platformInitializeNetworkProcess): 2014-10-07 Sungmann Cho Remove WKPageCreateSnapshotOfVisibleContent API. https://bugs.webkit.org/show_bug.cgi?id=66979 Reviewed by Darin Adler. After the landing of the first patch of webkit.org/b/66979, WKPageCreateSnapshotOfVisibleContent API has been neglected for years. Currently, this is not used anywhere and does not break the nightlies. So we can remove this. * UIProcess/API/C/WKPage.cpp: (WKPageCreateSnapshotOfVisibleContent): Deleted. * UIProcess/API/C/WKPagePrivate.h: 2014-10-07 Sungmann Cho Remove WKPageSetInvalidMessageFunction. https://bugs.webkit.org/show_bug.cgi?id=137509 Reviewed by Benjamin Poulain. According to the FIXME comment in WKPageSetInvalidMessageFunction, we can remove this function when doing so won't break the nightlies. Currently, this is not used anywhere and does not break the nightlies. So we can remove this. * UIProcess/API/C/WKPage.cpp: (WKPageSetInvalidMessageFunction): Deleted. * UIProcess/API/C/WKPagePrivate.h: 2014-10-07 Christophe Dumez [WK2] Use is<>() / downcast<>() for DrawingArea subclasses https://bugs.webkit.org/show_bug.cgi?id=137497 Reviewed by Benjamin Poulain. Use is<>() / downcast<>() for DrawingArea subclasses. * WebProcess/WebPage/DrawingArea.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didCommitLoad): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::synchronizeDynamicViewportUpdate): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: 2014-10-07 Simon Fraser Roll-over Changelogs. * ChangeLog-2014-10-07: Copied from Source/WebKit2/ChangeLog. == Rolled over to ChangeLog-2014-10-07 ==