2015-03-16 Babak Shafiei Merge patch for rdar://problem/20155503. 2015-03-13 Enrica Casucci Webkit crash in WebKit::nextFocusableElement() when typing TAB on external keyboard rdar://problem/20155503 Reviewed by David Kilzer. Adding null check! * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::nextFocusableElement): 2015-03-12 Babak Shafiei Merge r181448. 2015-03-11 Enrica Casucci Adopt new API for keyboard event handling. https://bugs.webkit.org/show_bug.cgi?id=142602 rdar://problem/19966087 Reviewed by Sam Weinig. Adopts the new API. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _didHandleKeyEvent:]): 2015-03-03 Babak Shafiei Merge r180967. 2015-03-03 Enrica Casucci Incomplete dictation results in text fields in a web page. https://bugs.webkit.org/show_bug.cgi?id=142240 rdar://problem/19953432 Reviewed by Tim Horton. The empty stub for insertDictationResult:withCorrectionIdentifier must be removed. This way UIKit will call insertText and do the right thing. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView insertDictationResult:withCorrectionIdentifier:]): Deleted. 2015-02-26 Lucas Forschler Merge r179904 2015-02-10 Dan Bernstein Starting a navigation gesture dismisses the keyboard Reviewed by Tim Horton. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): Reordered the view hierarchy changes, such that m_liveSwipeView will not momentarily move out of the window, because that causes the window’s first responder to be set to nil (if it was a descendant of m_liveSwipView). 2015-02-26 Lucas Forschler Merge r179480 2015-02-02 Jeremy Jones Prevent crash when accessing WebAVPlayerController.delegate. https://bugs.webkit.org/show_bug.cgi?id=140893 Reviewed by Darin Adler. Plumb new resetMediaState() through IPC interface WebVideoFullscreenManagerProxy. * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenManagerProxy::invalidate): remove redundant set to nullptr. * WebProcess/ios/WebVideoFullscreenManager.h: * WebProcess/ios/WebVideoFullscreenManager.mm: (WebKit::WebVideoFullscreenManager::resetMediaState): 2015-02-25 Babak Shafiei Merge r180539. 2015-02-23 Benjamin Poulain [iOS WK2] The WebProcess keep scrolling pages based on the last velocity after scrolling has been interrupted https://bugs.webkit.org/show_bug.cgi?id=141933 rdar://problem/18746673 rdar://problem/19711490 Reviewed by Simon Fraser. The bug happened like this: 1) The user scroll the page. WKContentView tracks the velocity and send the update rect + velocity to the WebProcess. 2) The user interupts the scrolling but does not commit to either scrolling again or cancelling the scrolling. Since we were not notified of this state, the WebProcess still believed the velocity is stable. 3) With any paint update, the WebProcess would account for the last velocity and try to guess the best repaint area. This would drift endlessly out of the view since the view is not really moving. This patch fixes the issue by adding special handling for interrupted scrolling. Kudos to Kurt Revis for providing us the required APIs. * Shared/VisibleContentRectUpdateInfo.h: (WebKit::operator==): We can no longer filter VisibleContentRectUpdateInfo ignoring the velocity. Typically, UIScrollView would call -scrollViewDidScroll: before being interrupted. If we filter based on the VisibleContentRectUpdateInfo, we have two identical states differing only by the velocity. If we filter the second update, the WebProcess would never know the velocity should be zero. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _scrollViewDidInterruptDecelerating:]): We get this callback when scrolling is interrupted. We just need to clear the velocity and re-send a new update for the current state. (-[WKWebView _updateVisibleContentRects]): Do not consider an interrupted scroll as a stable state. We don't know if scrolling will resume or will stop. * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView didInterruptScrolling]): 2015-02-20 Babak Shafiei Merge r180062. 2015-02-12 Simon Fraser determinePrimarySnapshottedPlugIn() should only traverse visible Frames https://bugs.webkit.org/show_bug.cgi?id=141547 Part of rdar://problem/18445733. Reviewed by Anders Carlsson. Use FrameTree::traverseNextRendered() to avoid doing things in unrendered frames which are not guaranteed to have been laid out. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::determinePrimarySnapshottedPlugIn): 2015-02-20 Babak Shafiei Merge r179955. 2015-02-11 Tim Horton REGRESSION (iOS 8): PDFs embedded in / tag don't load at all https://bugs.webkit.org/show_bug.cgi?id=141457 Reviewed by Alexey Proskuryakov. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::objectContentType): On iOS, if we don't know what to do with a PDF-in-object, treat it as an image. 2015-02-16 Babak Shafiei Merge r177625. 2014-12-21 Eric Carlson [iOS] avoid WebVideoFullscreenManager crash https://bugs.webkit.org/show_bug.cgi?id=139852 Reviewed by Darin Adler. * WebProcess/ios/WebVideoFullscreenManager.mm: (WebKit::WebVideoFullscreenManager::didExitFullscreen): NULL-check m_layerHostingContext and m_page. (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced): NULL-check m_layerHostingContext. 2015-02-13 Matthew Hanson Merge r179580. rdar://problem/19709200 2015-02-03 Enrica Casucci [iOS] Add support for deleteFromInputWithFlags. https://bugs.webkit.org/show_bug.cgi?id=141216 rdar://problem/19130081 Reviewed by Benjamin Poulain. Adopts the new method as soon as it is available. The patch also removes some obsolete code used for staging. * Platform/spi/ios/UIKitSPI.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _interpretKeyEvent:isCharEvent:]): 2015-02-13 Matthew Hanson Merge r180031. rdar://problem/19432928 2015-02-12 Tim Horton Crash removing RemoteLayerTreeDisplayRefreshMonitor from the drawing area's map https://bugs.webkit.org/show_bug.cgi?id=141545 Reviewed by Simon Fraser. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::windowScreenDidChange): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: windowScreenDidChange should take uint32_t, since that's what PlatformDisplayID is. * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea): RemoteLayerTreeDisplayRefreshMonitor is driven by the page's RemoteLayerTreeDrawingArea. Because of this, we cannot have the same sharing of DisplayRefreshMonitors that other platforms use. In order to ensure that we get a unique DisplayRefreshMonitor per-DrawingArea, give each page a unique DisplayID derived from WebPage's unique ID. 2015-02-13 Matthew Hanson Merge r179885. rdar://problem/19812617 2015-02-10 Enrica Casucci Hit testing is misplaced when selecting on wikipedia page. https://bugs.webkit.org/show_bug.cgi?id=141410 rdar://problem/19768211 Reviewed by Simon Fraser. When loading a new document into the same WebPage object, we need to clear the assisted node, since there is no guarantee that the node will be blurred. The bug was caused by the use of a stale assisted node to constrain the point where the gesture occurs. The node was still valid, since the previous page was in the cache. I've added a ASSERT to check that, when constraining the point to node rectangle, the node is in the same document as the one we are performing hit test on. When the frame is detached, we clear the assisted node if the node is part of the document is the frame being detached. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::detachedFromParent2): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::constrainPoint): (WebKit::WebPage::resetAssistedNodeForFrame): 2015-02-13 Matthew Hanson Merge r179847. rdar://problem/19711485 2015-02-09 Enrica Casucci Selection flickers when trying to change size of selection. https://bugs.webkit.org/show_bug.cgi?id=141404 rdar://problem/18824863 Reviewed by Benjamin Poulain. When looking for the contracted range from the current range, we were incorrectly choosing a selection whose rectangle is empty as a best match candidate. This was throwing off all the logic and producing a contracted range whose rectangle was bigger than the expanded range, therefore producing a shrink threshold larger than the growth one. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::contractedRangeFromHandle): 2015-02-10 Babak Shafiei Merge r179578. 2015-02-03 Joseph Pecoraro [iOS] Selection Callout should not immediately disappear on pages with frequent layouts https://bugs.webkit.org/show_bug.cgi?id=141210 Reviewed by Enrica Casucci. In iOS WebKit2 in order to keep caret refreshes in sync with WebCore layouts the selection assistant is told to update whenever WebKit's layer tree commits. Unfortunately, for pages with JavaScript animation that are frequently doing a layout / layer tree update, this would trigger very frequent selection updates that would keep the caret from blinking and dismiss any selection callouts. This change tracks the last selection drawing information so that we can avoid informing the assistant of a selection updates unless it has changed visually or needs to redraw (zoom). * Shared/EditorState.cpp: Remove include already in header. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (WebKit::WKSelectionDrawingInfo::WKSelectionDrawingInfo): (WebKit::operator==): (WebKit::operator!=): (-[WKContentView observeValueForKeyPath:ofObject:change:context:]): When zooming, force the selection update, even though the drawing information hasn't changed, the views will need to be updated. (-[WKContentView _updateChangedSelection]): (-[WKContentView _updateChangedSelection:]): Monitor EditorState for changes in selection drawing and avoid informing the selection assistant unless necessary. 2015-01-28 David Kilzer run-webkit-tests: Merge 46 commits from trunk to make it work r171686, r171687, r171789, r171800, r171967, r171968, r171969, r172115, r172117, r172118, r172174, r172602, r172942, r172967, r173129, r173452, r173647, r173937, r174406, r174626, r174628, r174634, r174642, r174650, r174702, r174728, r174824, r174835, r174844, r175204, r176669, r176677, r176872, r176880, r176885, r176897, r177129, r177363, r177370, r177510, r178444, r178570, r178601, r178656, r178867, r178925 * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetMinimumZoomFontSize): (WKPreferencesGetMinimumZoomFontSize): * UIProcess/API/C/WKPreferencesRefPrivate.h: 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: 2015-01-28 Lucas Forschler Merge r178980 2015-01-22 Benjamin Poulain [iOS][WK2] Ignore synthetic click initiated on a previous page https://bugs.webkit.org/show_bug.cgi?id=139556 rdar://problem/18586008 Reviewed by David Kilzer. Under the right accumulation of bad luck, a synthetic click could be generated on a page that never asked for it. What happened was: 1) Page Foo listen to touch event. 2) In response to touch events, Foo decides to navigate to page Bar *but* it does not cancel the native gesture recognizers with preventDefault(). 3) Page Bar loads. 4) The native gesture recognizer ask us to click, we forward that to the WebProcess and generate a synthetic mouse event. -> Bar receives a click. If you are unlucky enough, it looks like a single tap does a double click. There are two ways this patch avoids the problem: First, in the UIProcess, we just cancel the HighlightLongPressGestureRecognizer on didCommitLoadForMainFrame. This prevents "fast clicks" from accidentally going through. This is not bullet proof because we get didCommitLoadForMainFrame asynchronously but killing the timer and gesture seems like a good idea. Second, we skip any tap command at the WebProcess level when it was issued for the previous page. This is using the same principle we used for VisibleContentRect: any input generated before the current layer tree commit is useless for the current page. We track the commit ID in the UIProcess when we decide to do the tracking or not. Note that we keep the ID regardless of the tracking state, it does not matter if we have sent touch events, what matters is what content was on screen when the touch events were handled. If the user interaction result in a tap, we send the commit ID along the tap commands. In the WebProcess, we know the actual layer tree commit associated with the current page. If the tap was generated with a layer ID preceding the current page, we fail the command. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::handleTouchEventSynchronously): (WebKit::WebPageProxy::resetState): * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView _didCommitLoadForMainFrame]): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _attemptClickAtLocation:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::commitPotentialTap): (WebKit::WebPageProxy::handleTap): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didCommitLoad): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleTap): (WebKit::WebPage::commitPotentialTap): 2015-01-28 Lucas Forschler Merge r178175 2015-01-08 Enrica Casucci [iOS] Cannot paste an image URL in a plain text field in a page. https://bugs.webkit.org/show_bug.cgi?id=140274 rdar://problem/18590809 Reviewed by Alexey Proskuryakov. supportedPasteboardTypesForCurrentSelection should include kUTTypeURL for plain text controls and WebArchivePboardType for rich text controls. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView supportedPasteboardTypesForCurrentSelection]): Remove obsolete and incorrect FIXME. 2015-01-28 Lucas Forschler Merge r177738 2014-12-25 Chris Dumez [iOS] Log better using FeatureCounter why PageCache is failing due to pruned resources https://bugs.webkit.org/show_bug.cgi?id=139921 Reviewed by Gavin Barraclough and Alexey Proskuryakov. Call PageCache::pruneToCapacityNow() instead of multiple calls to setCapacity() as it does exactly what we want. Also pass the new PrunedReason argument so help us do better logging. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::releasePageCache): 2015-01-27 Lucas Forschler Merge r177666 2014-12-22 Chris Dumez [iOS] Log using FeatureCounter user-triggered zooming https://bugs.webkit.org/show_bug.cgi?id=139879 Reviewed by Benjamin Poulain. Log using FeatureCounter user-triggered zooming on iOS. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::willStartUserTriggeredZooming): 2015-01-27 Lucas Forschler Merge r177612 2014-12-19 Chris Dumez [iOS] Add didEnterFullscreen / didExitFullscreen callbacks to WKUIDelegatePrivate https://bugs.webkit.org/show_bug.cgi?id=139835 Reviewed by Anders Carlsson. Add didEnterFullscreen / didExitFullscreen callbacks to WKUIDelegatePrivate so that they can be implemented in MobileSafari. * UIProcess/API/APIUIClient.h: (API::UIClient::didEnterFullscreen): (API::UIClient::didExitFullscreen): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::didEnterFullscreen): (WebKit::UIDelegate::UIClient::didExitFullscreen): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didEnterFullscreen): (WebKit::WebPageProxy::didExitFullscreen): * UIProcess/WebPageProxy.h: * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenManagerProxy::didExitFullscreen): (WebKit::WebVideoFullscreenManagerProxy::didEnterFullscreen): 2015-01-27 Lucas Forschler Merge r177531 2014-12-18 Chris Dumez Add missing availability annotation on @property _featureCounterEnabled https://bugs.webkit.org/show_bug.cgi?id=139794 Rubber-stamped by Dan Bernstein. Follow-up to r177526 adding availability annotation on @property _featureCounterEnabled. * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: 2015-01-27 Lucas Forschler Merge r177526 2014-12-18 Chris Dumez [WK2] Stop using WKPreferencesPrivate API to toggle FeatureCounter support https://bugs.webkit.org/show_bug.cgi?id=139794 Reviewed by Anders Carlsson. Stop using WKPreferencesPrivate API to toggle FeatureCounter support and use WKWebViewConfigurationPrivate API instead. FeatureCounter is not meant to change state after the view has been created. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetFeatureCounterEnabled): Deleted. (WKPreferencesGetFeatureCounterEnabled): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _featureCounterEnabled]): Deleted. (-[WKPreferences _setFeatureCounterEnabled:]): Deleted. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _featureCounterEnabled]): (-[WKWebViewConfiguration _setFeatureCounterEnabled:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: 2015-01-27 Lucas Forschler Merge r177455 2014-12-17 Chris Dumez [iOS] Make it possible to toggle FeatureCounter support at runtime https://bugs.webkit.org/show_bug.cgi?id=139688 Reviewed by Andreas Kling. Add private settings API to toggle FeatureCounter support on Safari and MobileSafari. * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetFeatureCounterEnabled): (WKPreferencesGetFeatureCounterEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _featureCounterEnabled]): (-[WKPreferences _setFeatureCounterEnabled:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2015-01-25 David Kilzer Merge r177332. 2014-12-15 Bartlomiej Gajda Build fix after r177301. https://bugs.webkit.org/show_bug.cgi?id=139666 Reviewed by Gyuyoung Kim. * WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp: (WebKit::WebPage::findZoomableAreaForPoint): 2015-01-25 David Kilzer Merge r177301. 2014-12-15 Myles C. Maxfield Addressing post-review comments in r177035 https://bugs.webkit.org/show_bug.cgi?id=139557 Reviewed by Darin Adler. * Shared/WebHitTestResult.cpp: (WebKit::WebHitTestResult::Data::elementBoundingBoxInWindowCoordinates): Migrate off rendererBoundingBox(). * WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp: (WebKit::WebPage::findZoomableAreaForPoint): Ditto. 2015-01-24 David Kilzer Merge r177035. 2014-12-09 Myles C. Maxfield Delete Node::boundingBox() https://bugs.webkit.org/show_bug.cgi?id=139333 Reviewed by Zalan Bujtas. * Shared/WebHitTestResult.cpp: (WebKit::WebHitTestResult::Data::elementBoundingBoxInWindowCoordinates): Use RenderObject::absoluteBoundingBoxRect(). * WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp: (WebKit::WebPage::findZoomableAreaForPoint): Use RenderObject::absoluteBoundingBoxRect(). 2015-01-24 David Kilzer Merge r176382. 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): 2015-01-24 David Kilzer REGRESSION (iOS 8): Reproducible null deref in WebKit::nextFocusableElement Merged small change from r175549. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::nextFocusableElement): Add isElementNode() check. 2015-01-22 David Kilzer Merge r175608. 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. 2015-01-22 David Kilzer Merge r175607. 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:]): 2015-01-22 David Kilzer Merge r175595. 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. 2015-01-22 David Kilzer Merge r175577. 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:]): 2015-01-22 David Kilzer Merge r174885. 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. 2015-01-22 David Kilzer Merge r174286. 2014-10-03 Andy Estes [iOS] Highlight clicked links in WKPDFView https://bugs.webkit.org/show_bug.cgi?id=137400 Reviewed by Tim Horton. Show a _UIHighlightView on top of clicked links for 200 ms before starting the navigation. This matches the behavior of UIWebPDFView. * UIProcess/ios/WKPDFView.mm: (-[WKPDFView _createHighlightViewWithFrame:]): Created a _UIHighlightView with a color and border radius matching the values used by UIWebPDFView. (-[WKPDFView annotation:wasTouchedAtPoint:controller:]): Displayed the highlight, then removed it after the navigation began. 2015-01-22 David Kilzer Merge r174250. 2014-10-02 Andy Estes [iOS] Create an SPI wrapper for _UIHighlightView and use it in WKContentView https://bugs.webkit.org/show_bug.cgi?id=137370 Reviewed by Tim Horton. * UIProcess/ios/WKContentViewInteraction.mm: Included instead of . 2015-01-22 David Kilzer Merge r174232. 2014-10-02 Andy Estes [iOS] Teach WKPDFView to navigate to pageNumber links https://bugs.webkit.org/show_bug.cgi?id=137358 Reviewed by Tim Horton. Treat PDF pageNumber annotations as if they were fragment navigations in an HTML document. For a given page number N, create a fragment called "#pageN" and tell WebKit to navigate to it. By doing this we create history entries for each pageNumber navigation and allow for proper back/forward. When navigating to a page, reset to the initial scale factor and scroll to the beginning of the Nth page. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _zoomToPoint:atScale:animated:]): Added an animated parameter. If animated is NO, use a duration of 0. (-[WKWebView _zoomToRect:atScale:origin:animated:]): Added an animated parameter and passed it to _zoomToPoint:atScale:animated:. (-[WKWebView _zoomOutWithOrigin:animated:]): Ditto. (-[WKWebView _zoomToRect:withOrigin:fitEntireRect:minimumScale:maximumScale:minimumScrollDistance:]): Called _zoomToRect:atScale:origin:animated:, setting animated to YES. (-[WKWebView _didSameDocumentNavigationForMainFrame:]): Called web_didSameDocumentNavigation: on _customContentView. (-[WKWebView _zoomToPoint:atScale:]): Deleted. (-[WKWebView _zoomToRect:atScale:origin:]): Deleted. (-[WKWebView _zoomOutWithOrigin:]): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/Cocoa/WKWebViewContentProvider.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didSameDocumentNavigationForMainFrame): Called _didSameDocumentNavigationForMainFrame on m_webView. * UIProcess/ios/WKContentView.mm: (-[WKContentView _zoomOutWithOrigin:]): Called _zoomOutWithOrigin:animated: on m_webView, setting animated to YES. * UIProcess/ios/WKPDFPageNumberIndicator.h: * UIProcess/ios/WKPDFPageNumberIndicator.mm: (-[WKPDFPageNumberIndicator hide]): Added a method to hide the page number indicator. * UIProcess/ios/WKPDFView.mm: (-[WKPDFView web_setContentProviderData:suggestedFilename:]): Added a FIXME for restoring scroll position and page scale when loading from the back/forward list. (-[WKPDFView scrollViewDidScroll:]): Stopped showing the page number indicator if a same-document navigation is occurring (to match UIWebPDFView). (-[WKPDFView _updatePageNumberIndicator]): Ditto. (-[WKPDFView web_didSameDocumentNavigation:]): (-[WKPDFView _resetZoomAnimated:]): For same-document navigations of type kWKSameDocumentNavigationSessionStatePop, extracted the page index from the URL fragment identifier, hid the page number indicator, reset the zoom (without an animation to match UIWebPDFView), and scrolled to the beginning of the given page. (-[WKPDFView resetZoom:]): Called _resetZoomAnimated:, setting animated to YES. (-[WKPDFView annotation:wasTouchedAtPoint:controller:]): If there is a non-zero pageNumber in the link annotation, construct a "#pageN" fragment and navigate to it. 2015-01-22 David Kilzer Merge r174072. 2014-09-27 Andy Estes [iOS] Add basic support for link navigation in WKPDFView https://bugs.webkit.org/show_bug.cgi?id=137182 Reviewed by Tim Horton. Teach WKPDFView to navigate to URLs when PDF link annotations are tapped. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::navigateToURLWithSimulatedClick): Sent Messages::WebPage::NavigateToURLWithSimulatedClick. * UIProcess/WebPageProxy.h: * UIProcess/ios/WKPDFView.h: * UIProcess/ios/WKPDFView.mm: (-[WKPDFView _clearPages]): Removed self as the UIPDFAnnotationControllerDelegate. (-[WKPDFView _revalidateViews]): Added self as the UIPDFAnnotationControllerDelegate. (-[WKPDFView annotation:wasTouchedAtPoint:controller:]): Retrieved the URL from the touched annotation, computed the touched point relative to the WKPDFView and to the screen, and called navigateToURLWithSimulatedClick() after a 200 ms delay in order to show a soon-to-be-added tap highlight (this value matches the delay in UIWebPDFView). * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::navigateToURLWithSimulatedClick): Created a fake single-click MouseEvent and called FrameLoader::urlSelected(). Creating a mouse event ensures that the navigation appears as a NavigationTypeLinkClicked in navigation policy delegates. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2015-01-22 David Kilzer Merge r172966. 2014-08-26 Tim Horton REGRESSION (r172771): Amazon product page becomes unresponsive after swiping back to it https://bugs.webkit.org/show_bug.cgi?id=136260 Reviewed by Dan Bernstein. Previously, when a swipe ended up performing a same-document navigation, we would never get didFinishLoadForMainFrame nor didFirstVisuallyNonEmptyLayoutForMainFrame nor would we even get didHitRenderTreeSizeThreshold in all cases, so we would never remove the swipe snapshot. Previous implementations removed the snapshot on didSameDocumentNavigation for the main frame if the navigation type was Replace or Pop, so we will match that behavior. Also, reinstate the watchdog that starts at swipe-end which would have prevented this bug from forever breaking the view it was associated with. Also, defend against removing the snapshot before the swipe has finished (before we have even caused the navigation that we're watching for the effects of). * UIProcess/API/mac/WKView.mm: (-[WKView _didSameDocumentNavigationForMainFrame:]): * UIProcess/API/mac/WKViewInternal.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didSameDocumentNavigationForMainFrame): * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::didSameDocumentNavigationForMainFrame): Plumb main-frame same-document navigation notification from WebPageProxy to ViewGestureControllerMac via PageClient and WKView. * UIProcess/mac/ViewGestureController.h: * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::ViewGestureController): (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::endSwipeGesture): Keep track of whether a swipe is currently occurring. We can't use activeGestureType for this because the swipe currently remains the "active" gesture until the snapshot is removed. Reintroduce the old swipeWatchdogTimer (and rename the shorter timer that starts when we get a visually non-empty layout) so that we will always remove the snapshot after 5 seconds, even if we haven't committed the load. This could lead to flashing back to the old content if we fail to get a single byte for 5 seconds, but that is a rare case and should eventually get additional special treatment (dropping the tiles until we do get content, or some such). (WebKit::ViewGestureController::didHitRenderTreeSizeThreshold): If a swipe is still in progress, we haven't done our navigation and thus don't care about render tree size changes. (WebKit::ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame): If a swipe is still in progress, we haven't done our navigation and thus don't care about layouts. Stop the 5 second overall watchdog if we start the 3 second after-visuallyNonEmptyLayout watchdog. This means that the snapshot could stay up for a maximum of 8 seconds for a very, very slow load. (WebKit::ViewGestureController::didFinishLoadForMainFrame): If a swipe is still in progress, we haven't done our navigation and thus don't care about loads that complete. (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame): Remove the swipe snapshot after painting if we do replaceState or popState. (WebKit::ViewGestureController::removeSwipeSnapshotAfterRepaint): If a swipe is still in progress, we shouldn't remove the snapshot yet. 2015-01-22 David Kilzer Merge r173762. 2014-09-19 Simon Fraser Fix the Mac Mavericks build. Only iOS cares about fencing. * Platform/mac/LayerHostingContext.h: * Platform/mac/LayerHostingContext.mm: 2015-01-22 David Kilzer Merge r173741. 2014-09-18 Jeremy Jones Improve fullscreen video rotation animation. https://bugs.webkit.org/show_bug.cgi?id=136870 Reviewed by Simon Fraser. Remove WKCAContext from LayerHostingContext and use a fencePort to synchronize animation between processes. * Platform/mac/LayerHostingContext.h: add setFencePort. Remove WKCAContext. * Platform/mac/LayerHostingContext.mm: (WebKit::LayerHostingContext::createForPort): Remove WKCAContext. (WebKit::LayerHostingContext::createForExternalHostingProcess): ditto (WebKit::LayerHostingContext::setRootLayer): ditto (WebKit::LayerHostingContext::rootLayer): ditto (WebKit::LayerHostingContext::contextID): ditto (WebKit::LayerHostingContext::invalidate): ditto (WebKit::LayerHostingContext::setColorSpace): ditto (WebKit::LayerHostingContext::colorSpace): ditto (WebKit::LayerHostingContext::setFencePort): added * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame): * WebProcess/ios/WebVideoFullscreenManager.h: * WebProcess/ios/WebVideoFullscreenManager.messages.in: add fence port parameter * WebProcess/ios/WebVideoFullscreenManager.mm: ditto (WebKit::WebVideoFullscreenManager::didSetupFullscreen): ditto (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced): ditto 2015-01-21 Babak Shafiei Merge r177329. 2014-12-15 Simon Fraser [iOS WK2] Possible crash when setting the WKWebViews's scroll view delegate, if the scroll view outlives the web view https://bugs.webkit.org/show_bug.cgi?id=139662 rdar://problem/18083882 Reviewed by Benjamin Poulain. Null out the internal delegate on the WKScrollView when the WKWebView goes away, since it's possible for a client to set its own scroll view delegate, forcing the creation of a WKScrollViewDelegateForwarder, and then retain the UIScrollView past the lifetime of the WKWebView. In this situation, the WKScrollViewDelegateForwarder's internalDelegate would point to a deleted WKWebView. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView dealloc]): 2015-01-21 Babak Shafiei Merge r177115. 2014-12-09 Jon Honeycutt Null dereference performing a "TapAndAHalf" gesture in Google search field Reviewed by Darin Adler. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::selectWithGesture): Add a null check in the case that there is no word range for the current position. 2015-01-21 Babak Shafiei Merge r176969. 2014-12-08 Dan Bernstein [iOS] Safari crashes at -[_NSUndoStack popAndInvoke] when trying to undo typing on closed tab https://bugs.webkit.org/show_bug.cgi?id=139408 Reviewed by Anders Carlsson. * UIProcess/ios/WKContentView.mm: (-[WKContentView undoManager]): Override to initialize if necessary and return a unique undo manager for this instance. This ensures that undoable operations for this webview don’t get put in other undo managers, and matches UIWebView behavior. 2015-01-21 Babak Shafiei Merge r176701. 2014-12-02 Dan Bernstein [iOS] Text selection in WKWebView with WKSelectionGranularityCharacter only works in the most recent WKWebView to load https://bugs.webkit.org/show_bug.cgi?id=139211 Reviewed by Anders Carlsson. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView becomeFirstResponder]): Override to activate the text selection for when becoming first resopnder. (-[WKContentView resignFirstResponder]): Deactiavte the text selection when resigning first responder. This ensures that if another WKWebView becomes first responder, and it uses block selection, we don’t end up with two active selection views. (-[WKContentView useSelectionAssistantWithMode:]): Only activate the text selection if this is the first responder. This ensures that loading content into a non-first-responder WKWebView doesn‘t deactivate the text selection in the current first responder. 2015-01-21 Babak Shafiei Merge r176305. 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:]): 2015-01-21 Babak Shafiei Merge r175698. 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. 2015-01-21 Babak Shafiei Merge r175636. 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. 2015-01-21 Babak Shafiei Merge r175334. 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:]): 2015-01-20 Babak Shafiei Merge r175135. 2014-10-23 Joseph Pecoraro [iOS] iPhone unselecting items in . 2015-01-20 Babak Shafiei Merge r174148. 2014-10-01 Joseph Pecoraro [iOS] in iOS 8 https://bugs.webkit.org/show_bug.cgi?id=136117 Reviewed by Alexey Proskuryakov. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Correct an overzealous deny that was accidentally denying all com.apple.app-sandbox.read extensions instead of just the ones in Application bundles it was trying to deny. 2014-08-15 Lucas Forschler Merge r172502 2014-08-12 Pratik Solanki Cached file backed resources don't make it to the Web Process when NETWORK_CFDATA_ARRAY_CALLBACK is enabled https://bugs.webkit.org/show_bug.cgi?id=135727 Reviewed by Darin Adler. tryGetShareableHandleFromSharedBuffer() assumed that we have a file backed resource only if we had a CFDataRef (platformData()) in SharedBuffer. This is wrong when we use the data array callbacks since the file backed buffer could be in the data array. Instead of relying on hasPlatformData(), explicitly ask the SharedBuffer to give us a CFDataRef if it has one so that SharedBuffer can take care of the data array case. * NetworkProcess/mac/NetworkResourceLoaderMac.mm: (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer): 2014-08-07 Matthew Hanson Merge r172238. 2014-08-07 Oliver Hunt WebContent needs access to HSTS database due to some networking still being performed in process https://bugs.webkit.org/show_bug.cgi?id=135711 Reviewed by Alexey Proskuryakov. Simple patch in the same theme as the equivalent network process extension. Provide an extension that covers the WebContent specific HSTS file and consume it on launch. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/WebContext.cpp: (WebKit::WebContext::createNewWebProcess): * UIProcess/WebContext.h: * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::webContentHSTSDatabasePath): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2014-08-07 Matthew Hanson Merge r172191. 2014-08-06 Andy Estes [iOS] Subresources referenced in converted QuickLook documents sometimes fail to load https://bugs.webkit.org/show_bug.cgi?id=135676 Reviewed by David Kilzer. QuickLookHandle needs to stay alive in order for its NSURLProtocol to service subresource loads originating from the converted HTML document. Some of these loads happen dynamically after the main resource finishes loading, so we cannot tie the lifetime of the QuickLookHandle to that of the main resource's ResourceLoader. Instead, give ownership of the QuickLookHandle to DocumentLoader. * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo): Stored the created QuickLookHandle in DocumentLoader. (WebKit::WebResourceLoader::didReceiveData): Accessed DocumentLoader's QuickLookHandle. (WebKit::WebResourceLoader::didFinishResourceLoad): Ditto. (WebKit::WebResourceLoader::didFailResourceLoad): Ditto. (WebKit::WebResourceLoader::didReceiveResource): Ditto. * WebProcess/Network/WebResourceLoader.h: Removed m_quickLookHandle. 2014-08-06 Matthew Hanson Merge r172172. 2014-08-06 Alexey Proskuryakov REGRESSION (WebKit2): iOS Safari default encoding doesn't follow system language https://bugs.webkit.org/show_bug.cgi?id=135667 Reviewed by Anders Carlsson. * Shared/WebPreferencesDefinitions.h: Compute the actual proper default, don't hardcode it to ISO-8859-1 hoping that someone else will correct it later. * Shared/WebPreferencesStore.cpp: Added an include for WebPreferencesDefinitions.h macro expansion to compile. * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::createWithLegacyDefaults): Added a FIXME. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): We now use WKGetWebDefaultCFStringEncoding in WebCore, so it needs to be initialized. 2014-08-06 Matthew Hanson Merge r172035. 2014-08-04 Andy Estes [iOS] The raw bytes of an iWork document's PDF preview are displayed rather than the PDF itself https://bugs.webkit.org/show_bug.cgi?id=135596 Reviewed by David Kilzer. * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo): If the response will be handled by QuickLook, do not call ResourceLoader::didReceiveResponse. It will be called later by WebResourceLoaderQuickLookDelegate once converted data is received. 2014-08-05 Matthew Hanson Roll out r172034. 2014-08-05 Matthew Hanson Merge r172035. 2014-08-04 Andy Estes [iOS] The raw bytes of an iWork document's PDF preview are displayed rather than the PDF itself https://bugs.webkit.org/show_bug.cgi?id=135596 Reviewed by David Kilzer. * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo): If the response will be handled by QuickLook, do not call ResourceLoader::didReceiveResponse. It will be called later by WebResourceLoaderQuickLookDelegate once converted data is received. 2014-08-05 Matthew Hanson Merge r172034. 2014-08-05 Alexey Proskuryakov Build fix. * UIProcess/WebContext.h: 2014-08-05 Matthew Hanson Merge r172031. 2014-08-05 Oliver Hunt SSO expects to be able to walk parent application's bundle https://bugs.webkit.org/show_bug.cgi?id=135581 Reviewed by Alexey Proskuryakov. SSO expects to be able to walk the parent application's bundle looking for Info plists. To allow this to actually work we provide an extension from the ui process that covers the bundle directory, and then in the profile restrict access to the ability to read directories and files named Info.plist. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Shared/Network/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode): (WebKit::NetworkProcessCreationParameters::decode): * Shared/Network/NetworkProcessCreationParameters.h: * UIProcess/WebContext.cpp: (WebKit::WebContext::ensureNetworkProcess): (WebKit::WebContext::parentBundleDirectory): * UIProcess/WebContext.h: * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::parentBundleDirectory): 2014-08-05 Matthew Hanson Merge r172016. 2014-08-04 Benjamin Poulain Check for null frame when processing geolocation authorization request https://bugs.webkit.org/show_bug.cgi?id=135577 Reviewed by Geoffrey Garen. I could have put the null check in GeolocationController instead of the WebKit layer, but that would be a little weird as GeolocationController knows nothing about how the WebKit layer decides what to do with requests. * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp: (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation): 2014-08-05 Matthew Hanson Merge r172035. 2014-08-04 Andy Estes [iOS] The raw bytes of an iWork document's PDF preview are displayed rather than the PDF itself https://bugs.webkit.org/show_bug.cgi?id=135596 Reviewed by David Kilzer. * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo): If the response will be handled by QuickLook, do not call ResourceLoader::didReceiveResponse. It will be called later by WebResourceLoaderQuickLookDelegate once converted data is received. 2014-08-03 Babak Shafiei Merge r171973. 2014-08-02 Jeremy Jones Support both window and view based video fullscreen. https://bugs.webkit.org/show_bug.cgi?id=135525 Reviewed by Simon Fraser. Parenting in the view instead of the window gives the fullscreen implementation more latitude in how it implements the animation. * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Use view instead of window. * WebProcess/ios/WebVideoFullscreenManager.mm: (WebKit::clientRectForNode): Use client rect instead of screen rect. (WebKit::WebVideoFullscreenManager::enterFullscreenForNode): ditto (WebKit::WebVideoFullscreenManager::exitFullscreenForNode): ditto (WebKit::screenRectForNode): Deleted. 2014-08-03 Babak Shafiei Merge r171959. 2014-08-01 Joseph Pecoraro [iOS WK2] Add extension read permission to network sandbox profile Reviewed by Alexey Proskuryakov and Oliver Hunt. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: 2014-08-03 Babak Shafiei Merge r171943. 2014-08-01 Oliver Hunt Various frameworks may want to use the container temp directory, so our current restrictions are too tight https://bugs.webkit.org/show_bug.cgi?id=135518 Reviewed by Anders Carlsson. We don't (and can't) have complete knowledge of what different frameworks will want to use the container temporary directory for, and so our current attempt to heavily restrict access is simply too tight. This patch recognises this by simply giving read-write access to the entire NSTemporary() directory (e.g. $container/tmp in the general case), rather than the single sub directory we wishfully thought that we would be able to get away with. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/WebContext.cpp: (WebKit::WebContext::createNewWebProcess): (WebKit::WebContext::mediaCacheDirectory): Deleted. * UIProcess/WebContext.h: * UIProcess/efl/WebContextEfl.cpp: (WebKit::WebContext::containerTemporaryDirectory): (WebKit::WebContext::platformMediaCacheDirectory): Deleted. * UIProcess/gtk/WebContextGtk.cpp: (WebKit::WebContext::containerTemporaryDirectory): (WebKit::WebContext::platformMediaCacheDirectory): Deleted. * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::containerTemporaryDirectory): (WebKit::WebContext::platformMediaCacheDirectory): Deleted. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2014-08-03 Babak Shafiei Merge r171887. 2014-07-31 Oliver Hunt Various SSO services need the networking process to be able to spoof its bundle id https://bugs.webkit.org/show_bug.cgi?id=135468 Reviewed by Alexey Proskuryakov. Just add the entitlement required to allow the sandbox to let this happen. * Configurations/Network-iOS.entitlements: 2014-07-31 Matthew Hanson Merge r171829. 2014-07-30 Enrica Casucci REGRESSION (WK2 iOS): Inline editing for Chinese and Japanese keyboards does not work in Safari. https://bugs.webkit.org/show_bug.cgi?id=135449 Reviewed by Benjamin Poulain. The WebProcess sends the notification that the gesture modified the phrase boundary, but the flag was not being converted properly, therefore we failed to notify the text input system that a change had occurred. * UIProcess/ios/WKContentViewInteraction.mm: (toUIWKSelectionFlags): 2014-07-29 Matthew Hanson Merge r171709. rdar://problem/16988887> 2014-07-28 Benjamin Poulain [iOS WK2] WKWebView sometime tries to change the size of a null DrawingAreaProxy https://bugs.webkit.org/show_bug.cgi?id=135368 Reviewed by Simon Fraser. We should never assume DrawingAreaProxy exists in the API invoked by the clients of WKWebView. There are at least two cases where the DrawingAreaProxy is null: -In some path on initialization. -After a crash. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): We can safely null check and skip setting the size. If the call was skipped, the size is set on DrawingAreaProxy initialization by querying the current size through the page client. 2014-07-27 Matthew Hanson Merge r171663. 2014-07-27 Gavin Barraclough Don't rely on reading applicationState from within DidEnterBackground/WillEnterForeground https://bugs.webkit.org/show_bug.cgi?id=135329 rdar://problem/17818308 Reviewed by Sam Weinig. API may not be stable. * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::isViewVisible): - changed to use -[WKContentView isBackground] * UIProcess/ios/ProcessAssertionIOS.mm: (-[WKProcessAssertionBackgroundTaskManager init]): - split notification handlers (-[WKProcessAssertionBackgroundTaskManager _applicationWillEnterForeground:]): (-[WKProcessAssertionBackgroundTaskManager _applicationDidEnterBackground:]): (-[WKProcessAssertionBackgroundTaskManager _applicationDidEnterBackgroundOrWillEnterForeground:]): Deleted. - Assume application is background is after DidEnterBackground, and not after WillEnterForeground * UIProcess/ios/WKContentView.h: - added isBackground. * UIProcess/ios/WKContentView.mm: (-[WKContentView initWithFrame:context:configuration:webView:]): - check applicationState at init. (-[WKContentView isBackground]): - accessor (-[WKContentView _applicationDidEnterBackground:]): (-[WKContentView _applicationWillEnterForeground:]): - update isBackground 2014-07-27 Matthew Hanson Merge r171651. 2014-07-26 Enrica Casucci [WebKit2 iOS]Add support for caret movement for the 3rd party keyboard protocol. https://bugs.webkit.org/show_bug.cgi?id=135325 Reviewed by Sam Weinig. WKContentView now implements moveByOffset to support the protocol for 3rd party keyboards. * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView moveByOffset:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::moveSelectionByOffset): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::moveSelectionByOffset): 2014-07-27 Matthew Hanson Merge r171647. 2014-07-26 Timothy Horton Crash in Web Content Process under ~PDFDocument under clearTouchEventListeners at topDocument() https://bugs.webkit.org/show_bug.cgi?id=135319 Reviewed by Darin Adler and Antti Koivisto. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::committedLoad): Allow data through to WebCore for frames with custom content providers; the only custom content provider currently implemented is main frame PDF on iOS, which will end up creating a PDFDocument in WebCore, which drops all data on the floor immediately, so this won't result in WebCore doing anything with the data, but makes sure that more of the normal document lifecycle is maintained. In the future, we might want to consider ensuring that all custom content providers end up creating a SinkDocument or something similarly generic to ensure that WebCore doesn't try to do anything with their data, but for now, the only client is covered. 2014-07-27 Matthew Hanson Merge r171635. 2014-07-25 Jeremy Jones Parent fullscreen from window instead of view https://bugs.webkit.org/show_bug.cgi?id=135310 Reviewed by Jer Noble. Parenting in the view causes an incorrect animation to fullscreen, and can cause fullscreen to only expand to the size of the view instead of the whole window. * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): pass view's window. * WebProcess/ios/WebVideoFullscreenManager.mm: screenRect instead of clientRect (WebKit::screenRectForNode): was clientRectForNode (WebKit::WebVideoFullscreenManager::enterFullscreenForNode): use screenRectForNode (WebKit::WebVideoFullscreenManager::exitFullscreenForNode): ditto (WebKit::clientRectForNode): Deleted. 2014-07-27 Matthew Hanson Merge r171626. 2014-07-24 Anders Carlsson WKNavigation's properties are either always nil or don't behave as documented https://bugs.webkit.org/show_bug.cgi?id=135267 Reviewed by Andreas Kling. Remove the properties from WKNavigation and introduce -[WKNavigation _request] as SPI for now. * Shared/API/Cocoa/WebKitPrivate.h: * UIProcess/API/Cocoa/WKNavigation.h: * UIProcess/API/Cocoa/WKNavigation.mm: (-[WKNavigation _request]): (-[WKNavigation initialRequest]): Deleted. (-[WKNavigation request]): Deleted. (-[WKNavigation setRequest:]): Deleted. (-[WKNavigation response]): Deleted. (-[WKNavigation error]): Deleted. * UIProcess/API/Cocoa/WKNavigationInternal.h: * UIProcess/API/Cocoa/WKNavigationPrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKNavigationInternal.h. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::createLoadRequestNavigation): * WebKit2.xcodeproj/project.pbxproj: 2014-07-25 Matthew Hanson Merge r171622. 2014-07-25 Brady Eidson Clean up WKOriginDataManager and get it messaging to the DatabaseProcess https://bugs.webkit.org/show_bug.cgi?id=135035 Reviewed by Sam Weinig. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::DatabaseProcess): Instantiate the WebOriginDataManager, installing its message handler. (WebKit::DatabaseProcess::didReceiveMessage): Try the message receiver map, which will try the WebOriginDataManager. * DatabaseProcess/DatabaseProcess.h: * DatabaseProcess/DatabaseProcess.messages.in: * UIProcess/API/C/WKOriginDataManager.cpp: (WKOriginDataManagerDeleteEntriesForOrigin): Updated to also take a callback. (WKOriginDataManagerDeleteEntriesModifiedBetweenDates): Added. (WKOriginDataManagerDeleteAllEntries): Updated to also take a callback. (WKOriginDataManagerStartObservingChanges): Deleted. (WKOriginDataManagerStopObservingChanges): Deleted. (WKOriginDataManagerSetChangeClient): Deleted. * UIProcess/API/C/WKOriginDataManager.h: * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::didReceiveMessage): Send messages to the WebOriginDataManagerProxy supplement if appropriate. * UIProcess/Databases/DatabaseProcessProxy.h: * UIProcess/Databases/DatabaseProcessProxy.messages.in: * UIProcess/WebContext.cpp: (WebKit::WebContext::WebContext): Instantiate the WebOriginDataManagerProxy supplement. * UIProcess/WebContext.h: (WebKit::WebContext::sendToDatabaseProcessRelaunchingIfNecessary): * UIProcess/WebOriginDataManagerProxy.cpp: (WebKit::WebOriginDataManagerProxy::contextDestroyed): (WebKit::WebOriginDataManagerProxy::processDidClose): (WebKit::WebOriginDataManagerProxy::getOrigins): (WebKit::WebOriginDataManagerProxy::deleteEntriesForOrigin): Setup a callback with the message. (WebKit::WebOriginDataManagerProxy::deleteEntriesModifiedBetweenDates): Added (WebKit::WebOriginDataManagerProxy::didDeleteEntries): Call the callback. (WebKit::WebOriginDataManagerProxy::deleteAllEntries): Setup a callback with the message. (WebKit::WebOriginDataManagerProxy::didDeleteAllEntries): Call the callback. (WebKit::WebOriginDataManagerProxy::startObservingChanges): Deleted. (WebKit::WebOriginDataManagerProxy::stopObservingChanges): Deleted. (WebKit::WebOriginDataManagerProxy::setChangeClient): Deleted. (WebKit::WebOriginDataManagerProxy::didChange): Deleted. * UIProcess/WebOriginDataManagerProxy.h: * UIProcess/WebOriginDataManagerProxy.messages.in: * UIProcess/WebOriginDataManagerProxyChangeClient.cpp: Removed. * UIProcess/WebOriginDataManagerProxyChangeClient.h: Removed. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/OriginData/WebOriginDataManager.cpp: (WebKit::WebOriginDataManager::deleteEntriesForOrigin): Send the callback reply. (WebKit::WebOriginDataManager::deleteEntriesModifiedBetweenDates): Added. (WebKit::WebOriginDataManager::deleteAllEntries): Send the callback reply. (WebKit::WebOriginDataManager::startObservingChanges): Deleted. (WebKit::WebOriginDataManager::stopObservingChanges): Deleted. * WebProcess/OriginData/WebOriginDataManager.h: * WebProcess/OriginData/WebOriginDataManager.messages.in: 2014-07-25 Matthew Hanson Merge r171629. 2014-07-25 Oliver Hunt Creating incorrect sandbox extension for hsts plist due to missing / https://bugs.webkit.org/show_bug.cgi?id=135309 Reviewed by Sam Weinig. So it turns out that you do actually need /'s in paths... Now we actually create the correct extension. * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformDefaultNetworkingHSTSDatabasePath): 2014-07-25 Dean Jackson Revert back to the Safari behavior from Mavericks and Mountain Lion on this branch. Follow-up comment from Dan Bernstein. * Shared/WebPreferencesDefinitions.h: Make sure this only applies to Mavericks and Mountain Lion. 2014-07-25 Dean Jackson Revert back to the Safari behavior from Mavericks and Mountain Lion on this branch. Reviewed by Ricky Mondello. * Shared/WebPreferencesDefinitions.h: Set WebGL preference default to off. 2014-07-24 Lucas Forschler Merge r171471 2014-07-23 Timothy Horton REGRESSION (r171239): Much more time spent taking snapshots during the PLT https://bugs.webkit.org/show_bug.cgi?id=135177 Reviewed by Dan Bernstein. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::willChangeCurrentHistoryItemForMainFrame): (WebKit::WebPageProxy::willChangeCurrentHistoryItem): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::willChangeCurrentHistoryItem): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::willChangeCurrentHistoryItemForMainFrame): (WebKit::WebPage::willChangeCurrentHistoryItem): Deleted. * WebProcess/WebPage/WebPage.h: Rename WillChangeCurrentHistoryItem to WillChangeCurrentHistoryItemForMainFrame. Only send it when the current history item for the main frame changes. 2014-07-24 Lucas Forschler Merge r171203 2014-07-17 Enrica Casucci [REGRESSION WK2]The menu bar does not show up when tapping on the caret. https://bugs.webkit.org/show_bug.cgi?id=135023 Reviewed by Benjamin Poulain and Ryosuke Niwa. WKContentView needs to implement hasContent to correctly show the appropriate menu bar content. The patch adds this information to the EditorState. * Shared/EditorState.cpp: (WebKit::EditorState::encode): (WebKit::EditorState::decode): * Shared/EditorState.h: (WebKit::EditorState::EditorState): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView hasContent]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::editorState): 2014-07-24 Lucas Forschler Merge r171576 2014-07-24 Benjamin Poulain [iOS][WK2] Do not try to hit test a null mainFrameRenderView on dynamicViewportSizeUpdate() https://bugs.webkit.org/show_bug.cgi?id=135277 Reviewed by Tim Horton. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): There is no guarantee that the main frame have its root view when performing a dynamicViewportSizeUpdate(), we should not attempt to use the layer without null checking it first. The odd part for me is is a little too frequent. In the vast majority of cases, there is a RenderView, it seems actually pretty hard not to have one on dynamicViewportSizeUpdate(). Skipping hit testing is safe because it is a completely optional part of this algorithm. When the hit test is not done, the new position is computed based on the relative position prior to the size change. 2014-07-24 Lucas Forschler Merge r171570 2014-07-24 Tim Horton Sometimes WKWebView is blank after resuming the app, until you scroll https://bugs.webkit.org/show_bug.cgi?id=135275 Reviewed by Benjamin Poulain. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::dispatchViewStateChange): If the UI process is waiting for a didUpdateViewState, we need to *always* get a reply from the Web Process, so dispatchViewStateChange should *always* send SetViewState even if nothing changed (so that we get the reply). 2014-07-24 Lucas Forschler Merge r171560 2014-07-24 Simon Fraser [iOS WK2] Header bar on nytimes articles lands in the wrong place after rubberbanding https://bugs.webkit.org/show_bug.cgi?id=135221 Reviewed by Benjamin Poulain. The call to didCommitLayerTree() can cause one or two visible rect updates, via changes to the UIScrollView contentSize and contentOffset. As a result, we would notify the scrolling tree about a viewport change, but using the old scrolling tree rather than the new one, so we could move layers around for nodes which are about to be removed from the tree. However, we also have to ensure that programmatic scrolls are applied after didCommitLayerTree() has updated the view size, so have RemoteScrollingCoordinatorProxy store data about programmatic scrolls and return them to the caller, which can apply them after didCommitLayerTree(). * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: Store a pointer to a RequestedScrollInfo for the duration of the tree update, so that we can store requested scroll info in it. (WebKit::RemoteScrollingCoordinatorProxy::RemoteScrollingCoordinatorProxy): (WebKit::RemoteScrollingCoordinatorProxy::updateScrollingTree): (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeRequestsScroll): * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didCommitLayerTree): Give Mac a stub implementation. * UIProcess/WebPageProxy.h: Group some editing-related functions together. (WebKit::WebPageProxy::editorState): (WebKit::WebPageProxy::canDelete): (WebKit::WebPageProxy::hasSelectedRange): (WebKit::WebPageProxy::isContentEditable): (WebKit::WebPageProxy::maintainsInactiveSelection): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): Ordering change: update the layer tree, then call didCommitLayerTree(), then do the viewport update, followed by any programmatic scroll. 2014-07-24 Lucas Forschler Merge r171540 2014-07-24 Dan Bernstein WebKit2 part of [Cocoa] WebCore::ProtectionSpace doesn’t preserve all NSURLProtectionSpace properties, such as the distinguishedNames array https://bugs.webkit.org/show_bug.cgi?id=135229 Reviewed by Alexey Proskuryakov. * Shared/Cocoa/WKNSURLProtectionSpace.mm: Changed to use ProtectionSpace::nsSpace. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder::encode): If encoding the space requires encoding the platform data, do that. (IPC::ArgumentCoder::decode): If platform data was encoded, decode it. * Shared/WebCoreArgumentCoders.h: * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encodePlatformData): Archive the NSURLProtectionSpace. (IPC::ArgumentCoder::decodePlatformData): Unarchive it. * Shared/soup/WebCoreArgumentCodersSoup.cpp: (IPC::ArgumentCoder::encodePlatformData): Added. (IPC::ArgumentCoder::decodePlatformData): Added. 2014-07-24 Lucas Forschler Merge r171532 2014-07-24 Benjamin Poulain [WK2] Fixed/Sticky layers can get mispositioned when the layer tree commit change their position or size https://bugs.webkit.org/show_bug.cgi?id=135227 Reviewed by Simon Fraser. In some cases, a fixed or sticky positioned layer would end up at its position corresponding to the WebProcess instead of sticking the to real viewport in the UIProcess. The sequence of event is: 1) A layer becomes fixed in some ScrollingTree transaction. 2) Later, some change in the WebProcess causes a LayerTree update for that exact same layer, but no corresponding ScrollingTree update is made. 3) In the UIProcess, the position of the fixed layer is changed due to the LayerTree update. But! There is no ScrollingTree change, updateScrollingTree() never sets fixedOrStickyLayerChanged to true, and the position is not corrected. -> The layer is now at the wrong position until the next VisibleContentRectUpdate. Ideally, we should have fixedOrStickyLayerChanged track if either the position or size of a fixed layer changed in the layer tree. This is tricky since the layer tree does not keep track of the fixed nodes of the scrolling tree. Since this complexity seems risky at this point, I went for something simpler but with more overhead: any time the scrolling tree contains either a fixed or sticky layer, viewportChangedViaDelegatedScrolling() is called to "fix" the position. * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::updateScrollingTree): (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: (WebKit::RemoteScrollingCoordinatorProxy::hasFixedOrSticky): * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): 2014-07-24 Lucas Forschler Merge r171519 2014-07-24 Oliver Hunt Need to explicitly support location services in webcontent profile https://bugs.webkit.org/show_bug.cgi?id=135251 Reviewed by Dan Bernstein. Switching to uikit-app means that we remove the implicit support for location services. This makes us explicitly opt-in. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2014-07-24 Lucas Forschler Merge r171518 2014-07-24 Tim Horton Crash at [WKContentView _applicationWillEnterForeground:] + 28 Reviewed by Sam Weinig. * UIProcess/ios/WKContentView.mm: (-[WKContentView _applicationWillEnterForeground:]): Drawing area can be null; null check it! It's ok if we don't hide the content in this case, because if the drawing area is null, it doesn't have any layers in the tree anyway. 2014-07-24 Lucas Forschler Merge r171485 2014-07-23 Dan Bernstein [iOS] Client-certificate authentication isn’t working with some certificates https://bugs.webkit.org/show_bug.cgi?id=135206 Reviewed by Anders Carlsson. * Shared/cf/ArgumentCodersCF.cpp: (IPC::copyPersistentRef): Added this helper function. It differs from SecKeyCopyPersistentRef in that if multiple copies of the key exist in the keychain, it ensures that we get a reference to the copy that is in the keychain access group that the Networking process can use. (IPC::encode): Use copyPersistentRef. 2014-07-24 Lucas Forschler Merge r171201 2014-07-17 Benjamin Poulain [iOS][WK2] Add SPI to do a dynamic viewport update without showing any content https://bugs.webkit.org/show_bug.cgi?id=135010 Reviewed by Darin Adler. This patch add a new SPI, [WKWebView _resizeWhileHidingContentWithUpdates:] to perform all the work of a dynamic viewport size update, but instead of animating the old content, it is hidden. The patch is built on top of the animated resize mechanism. Instead of having an animation driving the beginning and end, we let the content do that. The dynamic resize begins, it runs for as long as the WebProcess needs, and it ends when first layer tree commit with the new content is processed. The attribute "_isAnimatingResize" is generalized to support two modes of resizing: animated and hiding content. The attribute "_hasCommittedLoadForMainFrame" is rather silly. It is only needed because [WKWebView _resizeWhileHidingContentWithUpdates:] is intended to be called a lot before the page is initialized, and doing an animated resize would trash the WebProcess state. I wish I had a better solution, this is not great. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _processDidExit]): (-[WKWebView _didCommitLoadForMainFrame]): (-[WKWebView _didCommitLayerTree:]): This is the key to make this work properly. We want _resizeWhileHidingContentWithUpdates: to behave exactly like an animated resize to avoid bugs. So we went to the whole update mechanism using _resizeAnimationTransformAdjustments to accumulate the adjustments, now we need to restore a correct view state. Calling [WKWebView _endAnimatedResize] will do exactly that, but we need to make sure we do not hit the synchronization path or we would be blocked there for a while, which is what we are trying to avoid. After r171154, WebPageProxy keeps track of what stage of dynamic viewport update we are in. Since we are executing the layer tree update stage, with the right transaction ID, WebPageProxy already knows we have everything we need and does not use any synchronous messages. (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]): (-[WKWebView _restorePageStateToExposedRect:scale:]): (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]): (-[WKWebView _scrollToContentOffset:]): (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _updateVisibleContentRects]): (-[WKWebView _setMinimumLayoutSizeOverride:]): (-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]): (-[WKWebView _setInterfaceOrientationOverride:]): (-[WKWebView _setMaximumUnobscuredSizeOverride:]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _endAnimatedResize]): (-[WKWebView _resizeWhileHidingContentWithUpdates:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2014-07-24 Lucas Forschler Merge r171509 2014-07-23 Simon Fraser [iOS WK2] Some help.apple.com pages not scrollable https://bugs.webkit.org/show_bug.cgi?id=135228 Reviewed by Benjamin Poulain. On pages which size their document to the device size, the WKContentView size never changes after it's created. In this situation, we never set a bounds on the _rootContentView, so it remains zero-sized which breaks hit testing on all enclosed UIScrollViews for overflow:scroll. Fix by making the _rootContentView and the _inspectorIndicationView use autosizing so they are always the size of their parent view, and remove the explicit setting of their bounds. * UIProcess/ios/WKContentView.mm: (-[WKContentView initWithFrame:context:configuration:webView:]): (-[WKContentView setShowingInspectorIndication:]): (-[WKContentView _didCommitLayerTree:]): 2014-07-24 Lucas Forschler Merge r171507 2014-07-23 Benjamin Poulain [iOS][WK2] r171124 is incorrect when the virtual keyboard is up https://bugs.webkit.org/show_bug.cgi?id=135187 Reviewed by Simon Fraser. Unfortunately, restricting the input into the document rect does not work. When the keyboard is up, the keyboard bounds can overlap the WKWebView, and the valid range should account for that. Instead of playing with the keyboard rect, we can limit the scroll position inside the valid range of UIScrollView. The keyboard always adjusts the UIScrollView range as needed to give access to the content. Using that range is a bit more permissive because the page could scroll to reveal content in the content inset defined by the client of the API (this could actually be quite useful for hybrid apps). There was already a function to change the content offset in the valid scrollview range: changeContentOffsetBoundedInValidRange(), I extracted the range check to contentOffsetBoundedInValidRange() for the needs of -[WKWebView _scrollToContentOffset:]. So...contentOffsetBoundedInValidRange() is cool, but it is not in the right coordinate system. The scroll position we get from the WebProcess is in document coordinates, while contentOffsetBoundedInValidRange() works with the UIScrollView coordinates. To fix that, we scale the input position to get to the same scale as UIScrollView, then apply the insets with the weirdly named [WKWebView _adjustedContentOffset:]. * UIProcess/API/Cocoa/WKWebView.mm: (contentOffsetBoundedInValidRange): (changeContentOffsetBoundedInValidRange): (-[WKWebView _scrollToContentOffset:]): 2014-07-24 Lucas Forschler Merge r171493 2014-07-23 Oliver Hunt Add a pseudo target to create sandbox override roots https://bugs.webkit.org/show_bug.cgi?id=135216 Reviewed by Alexey Proskuryakov. Just a duplicate of the standard ios sandbox target, targetting the profile overrides directory. This means we can make roots that "Just Work". * WebKit2.xcodeproj/project.pbxproj: 2014-07-23 Matthew Hanson Merged r171490. 2014-07-23 Oliver Hunt Incorrect commit for sandbox profile https://bugs.webkit.org/show_bug.cgi?id=135214 Reviewed by Anders Carlsson. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2014-07-23 Lucas Forschler Merge r171384 2014-07-22 Oliver Hunt Reduce the size of the root WebContent sandbox profile https://bugs.webkit.org/show_bug.cgi?id=135182 Reviewed by Alexey Proskuryakov. Switch from apple-ui-app to uikit-app as the root of the webcontent profile. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2014-07-23 Lucas Forschler Merge r171370 2014-07-22 Enrica Casucci REGRESSION (WebKit2): Selection inside accelerated overflow:scroll doesn't track scrolling. https://bugs.webkit.org/show_bug.cgi?id=135180 Reviewed by Simon Fraser. Adds notifications to the WKContentView to know when scrolling starts and ends in an overflow scroll. When scrolling starts, we hide the selection and we restore it when scrolling ends, though not before the selection information in the editor state has been updated. It also adds a new method to the EditorClient class to force the selection update when scrolling is completed. * UIProcess/PageClient.h: * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: * UIProcess/Scrolling/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::scrollingTreeNodeWillStartScroll): (WebKit::RemoteScrollingTree::scrollingTreeNodeDidEndScroll): * UIProcess/Scrolling/RemoteScrollingTree.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]): (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollWillStart): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollDidEnd): * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::overflowScrollWillStartScroll): (WebKit::PageClientImpl::overflowScrollDidEndScroll): * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartScroll): (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidEndScroll): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _overflowScrollingWillBegin]): (-[WKContentView _overflowScrollingDidEnd]): (-[WKContentView _updateChangedSelection]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::overflowScrollWillStartScroll): (WebKit::WebPageProxy::overflowScrollDidEndScroll): * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebCoreSupport/WebEditorClient.cpp: * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm: (WebKit::WebEditorClient::updateSelection): 2014-07-23 Lucas Forschler Merge r171368 2014-07-22 Benjamin Poulain [iOS][WK2] WebPageProxy should not do anything when responding to an animated resize is the page is not in a valid state https://bugs.webkit.org/show_bug.cgi?id=135169 Reviewed by Tim Horton. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::dynamicViewportSizeUpdate): Neither m_dynamicViewportSizeUpdateWaitingForTarget nor m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit should be modified if there is not WebProcess to respond to DynamicViewportSizeUpdate. (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate): We should not attempt to synchronize anything if the page was closed before the end of the dynamic viewport update. 2014-07-23 Lucas Forschler Merge r171363 2014-07-22 Oliver Hunt Remove unused com.apple.webkit.* rules from profiles https://bugs.webkit.org/show_bug.cgi?id=135174 Reviewed by Anders Carlsson. We never send these rules so we should just remove use of them from the profiles. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2014-07-23 Lucas Forschler Merge r171373 2014-07-22 Jinwoo Song Unreviewed build fix on EFL port after r171356. Implement a dummy platformMediaCacheDirectory() to avoid undefined reference error. * UIProcess/efl/WebContextEfl.cpp: (WebKit::WebContext::platformMediaCacheDirectory): 2014-07-23 Lucas Forschler Merge r171356 2014-07-22 Oliver Hunt Provide networking process with access to its HSTS db https://bugs.webkit.org/show_bug.cgi?id=135121 Reviewed by Alexey Proskuryakov. Add an extension parameter to pass the hsts database file. This requires us to create the Caches/com.apple.WebKit.Networking directory in the UI process, as the network sandbox does not allow it to create the containing directory. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * Shared/Network/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode): (WebKit::NetworkProcessCreationParameters::decode): * Shared/Network/NetworkProcessCreationParameters.h: * UIProcess/WebContext.cpp: (WebKit::WebContext::ensureNetworkProcess): (WebKit::WebContext::networkingHSTSDatabasePath): * UIProcess/WebContext.h: * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformDefaultNetworkingHSTSDatabasePath): 2014-07-23 Lucas Forschler Merge r171352 2014-07-22 Benjamin Poulain [iOS][WK2] UI helpers that zoom on an element ignore the viewport's allowsUserScaling https://bugs.webkit.org/show_bug.cgi?id=135140 Reviewed by Tim Horton. UIScrollView makes a difference between min/max zoom and allowUserScaling. To express that, everything is set up on the LayerTransaction. For zooming related helpers (find on page, double tap to zoom, etc), the min and max zoom should be the actual min/max for the current page state. This patch split the two explicitely. For layer transactions, the values are taken from the viewport configuration directly. For everything else, we should use minimumPageScaleFactor/maximumPageScaleFactor. Those two methods have been updated to take into account allowsUserScaling. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::willCommitLayerTree): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::minimumPageScaleFactor): (WebKit::WebPage::maximumPageScaleFactor): (WebKit::WebPage::getAssistedNodeInformation): 2014-07-23 Lucas Forschler Merge r171345 2014-07-22 Jeremy Jones Don't create new UIWindow for video fullscreen. https://bugs.webkit.org/show_bug.cgi?id=135038 Reviewed by Darin Adler. Use root UIView to parent fullscreen interface. * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): pass parent UIView * WebProcess/ios/WebVideoFullscreenManager.mm: (WebKit::screenRectForNode): Use client rect instead of screen rect. 2014-07-22 Dana Burkart Merge r171336. 2014-07-21 Benjamin Poulain [iOS][WK2] Improve event throttling for Scroll Events https://bugs.webkit.org/show_bug.cgi?id=135082 Reviewed by Simon Fraser. In the WebKit layer, we want a measure that is representative of the responsiveness. In this patch, I use the total delay between a VisibleContentRectUpdate being dispatched by the UIProcess, and the time RemoteLayerTreeDrawingArea flushes the layer tree. The value used for eventThrottlingDelay() is computed by averaging the new value with the old values with a 80/20 split, favoring the old data. Favoring historical data over the last timing avoid excessively throttling for a single slow frame. The computation of m_estimatedMainThreadLatency can be improved in the future, this is a first cut keeping things simple. With m_estimatedMainThreadLatency in our hands, we can compute our eventThrottlingDelay(). If m_estimatedMainThreadLatency is smaller than a single frame timespan, we have a fast page and nothing is throttled. If is it more than a frame, we throttle such that we can at least render two frames per event dispatch based on the historical data. The exact values will need some tweaking, but this set ensures well written pages get 60 events per seconds, while slow pages do not waste too much time on events. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: (WebKit::WebChromeClient::eventThrottlingDelay): * WebProcess/WebPage/ViewUpdateDispatcher.cpp: (WebKit::ViewUpdateDispatcher::visibleContentRectUpdate): (WebKit::ViewUpdateDispatcher::dispatchVisibleContentRectUpdate): * WebProcess/WebPage/ViewUpdateDispatcher.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): (WebKit::WebPage::didFlushLayerTreeAtTime): (WebKit::WebPage::didCommitLoad): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::eventThrottlingDelay): (WebKit::WebPage::updateVisibleContentRects): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::flushLayers): 2014-07-22 Dana Burkart Merge r171329. 2014-07-21 Simon Fraser REGRESSION (r170361): In landscape with UI hidden, fixed position elements at top of screen are too low https://bugs.webkit.org/show_bug.cgi?id=135141 Reviewed by Benjamin Poulain. We can't use the WKWebView's UIScrollView contentInsets to determine the unobscured rect in MobileSafari, because contentInsets can't be changed dynamically while scrolling. To get around this, MobileSafari sets obscured insets instead (but also sets a fixed contentInset). So if the client calls _setObscuredInsets:, always use _obscuredInsets to compute the content insets. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _computedContentInset]): (-[WKWebView _setObscuredInsets:]): 2014-07-22 Dana Burkart Merge r171326. 2014-07-21 Oliver Hunt Remove global cookie workaround from sandbox profiles https://bugs.webkit.org/show_bug.cgi?id=135138 Reviewed by Alexey Proskuryakov. Remove the workaround needed for global cookie access, and silencing of the associated sandbox violation. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformDefaultCookieStorageDirectory): 2014-07-22 Dana Burkart Merge r171322. 2014-07-21 Oliver Hunt Correct sandbox profiles to fix some excess privileges https://bugs.webkit.org/show_bug.cgi?id=135134 Reviewed by Alexey Proskuryakov. This cleans up our sandbox profiles to fix a few issues - the profiles no longer allow us to issue file extension we have the ability to consume, and tightens some of the other file access rules. This means we have to addd some rules to allow us to access things that we previously had access to due to lax file system restrictions. Some of the features were fixable simply by using entitlements on the process rather than custom rules. * Configurations/WebContent-iOS.entitlements: * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2014-07-22 Dana Burkart Merge r171320. 2014-07-21 Simon Fraser [iOS WK2] Turn off position:fixed behavior when the keyboard is up https://bugs.webkit.org/show_bug.cgi?id=132537 Reviewed by Benjamin Poulain. Make interaction with form elements inside position:fixed less terrible by re-laying out fixed elements relative to the document while we have an assisted node. This ensures that all parts of a position:fixed are accessible (e.g. inputs on the right side of a fixed-width top bar). * Shared/AssistedNodeInformation.cpp: Add a flag for being inside postion:fixed, and encode/decode it. (WebKit::AssistedNodeInformation::encode): (WebKit::AssistedNodeInformation::decode): * Shared/AssistedNodeInformation.h: (WebKit::AssistedNodeInformation::AssistedNodeInformation): * UIProcess/PageClient.h: Add isAssistingNode(). * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::isAssistingNode): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::computeCustomFixedPositionRect): If we have an assisted node, just use the document rect as the custom fixed position rect. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getAssistedNodeInformation): Get the selection rect first, since we have to fix it up for position:fixed. If the element is inside fixed position in the main frame, re-set the fixed position rect to the document rect (which forces a layout), re-fetch elementRect, then set it back. This ensures that the UI process gets an elementRect which it can zoom to correctly. 2014-07-22 Dana Burkart Merge r171317. 2014-07-21 Timothy Horton Random crashes on the Web Thread due to Timers firing on the wrong thread in the UI process https://bugs.webkit.org/show_bug.cgi?id=135132 Reviewed by Simon Fraser. * UIProcess/ProcessThrottler.cpp: (WebKit::ProcessThrottler::ProcessThrottler): (WebKit::ProcessThrottler::suspendTimerFired): * UIProcess/ProcessThrottler.h: * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::ViewGestureController): (WebKit::ViewGestureController::swipeSnapshotWatchdogTimerFired): * UIProcess/mac/ViewGestureController.h: * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::ViewGestureController): (WebKit::ViewGestureController::swipeSnapshotWatchdogTimerFired): We can't use WebCore timers in the UI process because of coexistence concerns (they fire on the Web Thread if there is one!), so use RunLoop::Timer instead. 2014-07-22 Dana Burkart Merge r171314. 2014-07-21 Andy Estes [iOS] Handle QuickLook ResourceLoaders in the web process https://bugs.webkit.org/show_bug.cgi?id=135113 Reviewed by David Kilzer. The QuickLook framework registers a NSURLProtocol to handle loading subresources of the HTML documents it generates. In order for these loads to succeed, we need to start them in the same process in which QuickLook generated the main resource. * WebProcess/Network/WebResourceLoadScheduler.cpp: (WebKit::WebResourceLoadScheduler::scheduleLoad): 2014-07-22 Dana Burkart Merge r171303. 2014-07-21 Brady Eidson DatabaseProcess doesn't relaunch after crashing. and https://bugs.webkit.org/show_bug.cgi?id=135117 Reviewed by Alexey Proskuryakov. * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::didClose): Tell the WebContext. * UIProcess/WebContext.cpp: (WebKit::WebContext::databaseProcessCrashed): Notify supplements, then clear the DatabaseProcessProxy pointer. * UIProcess/WebContext.h: * UIProcess/WebContextSupplement.h: (WebKit::WebContextSupplement::processDidClose): Added. No users right now, but the patch in bug 135035 will need this. 2014-07-22 Dana Burkart Merge r171288. 2014-07-20 Jeremy Jones Disable ff/rw based on canPlayFastForward and canPlayFastRewind. https://bugs.webkit.org/show_bug.cgi?id=134894 Reviewed by Darin Adler. Add setCanPlayFastReverse * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: ditto * WebProcess/ios/WebVideoFullscreenManager.h: ditto * WebProcess/ios/WebVideoFullscreenManager.mm: ditto (WebKit::WebVideoFullscreenManager::setCanPlayFastReverse): ditto 2014-07-22 Dana Burkart Merge r171286. 2014-07-20 Jeremy Jones Decrease flicker when enter and exit fullscreen. https://bugs.webkit.org/show_bug.cgi?id=134919 Reviewed by Simon Fraser. Change the sequence of tear down and use transparency to prevent flicker when entering and exiting fullscreen. * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: wait to remove layerHost until didCleanupFullscreen (WebKit::WebVideoFullscreenManagerProxy::didExitFullscreen): removed from here (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen): added here * WebProcess/ios/WebVideoFullscreenManager.mm: (WebKit::WebVideoFullscreenManager::didSetupFullscreen): use transparent background during transition 2014-07-22 Dana Burkart Merge r171280. 2014-07-20 Dan Bernstein REGRESSION (r171057): Crash in WebPage::getPositionInformation() https://bugs.webkit.org/show_bug.cgi?id=135099 Reviewed by David Kilzer. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getPositionInformation): Added a null check. 2014-07-22 Dana Burkart Merge r171257. 2014-07-18 Oliver Hunt We don't provide an extension to the temp file used for uploads https://bugs.webkit.org/show_bug.cgi?id=135079 Reviewed by Sam Weinig. Make sure didChooseFilesForOpenPanelWithDisplayStringAndIcon vends extensions for the files passed to the content process. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon): 2014-07-22 Dana Burkart Merge r171256. 2014-07-18 Tim Horton ASSERTion failures in ViewGestureController indicating that we're copying WebBackForwardList https://bugs.webkit.org/show_bug.cgi?id=135080 Reviewed by Sam Weinig. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::canSwipeInDirection): 2014-07-22 Dana Burkart Merge r171253. 2014-07-18 Yongjun Zhang _WKActivatedElementInfo.title should fallback to innerText if the link doesn't have title attribute. https://bugs.webkit.org/show_bug.cgi?id=135077 When populate InteractionInformationAtPosition's title value, use a link element's innerText if it doesn't have title attribute. Reviewed by Dan Bernstein. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getPositionInformation): 2014-07-22 Dana Burkart Merge r171252. 2014-07-18 Andy Estes [iOS] Tapping "Allow Website" on a restricted page does not bring up the keypad https://bugs.webkit.org/show_bug.cgi?id=135072 Reviewed by David Kilzer. * Shared/WebCoreArgumentCoders.h: Declared an ArgumentCoder for WebCore::ContentFilter. * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encode): Encoded the ContentFilter using a NSKeyedArchiver. (IPC::ArgumentCoder::decode): Decoded the ContentFilter using a NSKeyedUnarchiver. * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame): Called WebFrameProxy::setContentFilterForBlockedLoad(). * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::didStartProvisionalLoad): Reset m_contentFilterForBlockedLoad to nullptr. (WebKit::WebFrameProxy::contentFilterDidHandleNavigationAction): Called ContentFilter::handleUnblockRequestAndDispatchIfSuccessful(). If the unblock is successful, reload the WebPageProxy. * UIProcess/WebFrameProxy.h: (WebKit::WebFrameProxy::setContentFilterForBlockedLoad): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationAction): Check if this is navigation represents an unblock request and ignore if so. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Defined ContentFilterDidBlockLoadForFrame. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::contentFilterDidBlockLoad): Sent ContentFilterDidBlockLoadForFrame to the WebPageProxy. * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 2014-07-22 Dana Burkart Merge r171250. 2014-07-18 Simon Fraser [iOS WK2] position:fixed in iframes with programmatic scroll could end up in the wrong place https://bugs.webkit.org/show_bug.cgi?id=135078 Reviewed by Tim Horton. Fix the logging of requested scroll position and frame scale factor. * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: (WebKit::RemoteScrollingTreeTextStream::dump): 2014-07-22 Dana Burkart Merge r171239. 2014-07-18 Tim Horton Take navigation snapshots whenever the current back-forward item is going to change https://bugs.webkit.org/show_bug.cgi?id=135058 Reviewed by Dan Bernstein. Instead of trying to have the UI process figure out when to take navigation snapshots by itself, snapshot whenever the Web process says that the current back-forward item is going to change. This fixes snapshotting timing with pushState, and lets us bottleneck snapshotting down to just two places instead of 5. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::goForward): (WebKit::WebPageProxy::goBack): (WebKit::WebPageProxy::goToBackForwardItem): (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): We no longer need to special-case taking navigation snapshots when the UI process changes the back forward item or upon didStartProvisionalLoadForFrame, because we'll always snapshot in willChangeCurrentHistoryItem in all of these cases. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::willChangeCurrentHistoryItem): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Add willChangeCurrentHistoryItem message, which comes from the Web process. When it arrives, take a navigation snapshot. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): Take the pre-swipe navigation snapshot before telling WebPageProxy that we're doing a swipe, so that it doesn't bail from taking the snapshot because we have a snapshot up. (WebKit::ViewGestureController::endSwipeGesture): We no longer need to explicitly disable snapshotting while navigating, because we will avoid taking the snapshot if there's a snapshot being displayed. * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::~ViewGestureController): Remove the snapshot if it's still up when ViewGestureController is destroyed. The Mac version of ViewGestureController is destroyed on Web process crashes because it is a message receiver, so it is not guaranteed to have the same lifetime as the WebPageProxy and friends. (WebKit::ViewGestureController::trackSwipeGesture): Make use of recordNavigationSnapshot. (WebKit::ViewGestureController::endSwipeGesture): Ditto from the Mac version. * UIProcess/mac/ViewSnapshotStore.h: (WebKit::ViewSnapshotStore::disableSnapshotting): Deleted. (WebKit::ViewSnapshotStore::enableSnapshotting): Deleted. * UIProcess/mac/ViewSnapshotStore.mm: (WebKit::ViewSnapshotStore::ViewSnapshotStore): (WebKit::ViewSnapshotStore::recordSnapshot): Remove the snapshot disabling mechanism and bail from snapshotting if we're showing a snapshot, as mentioned above. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::willChangeCurrentHistoryItem): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::willChangeCurrentHistoryItem): * WebProcess/WebPage/WebPage.h: Proxy willChangeCurrentHistoryItem from HistoryController to the UI process. 2014-07-22 Dana Burkart Merge r171225. 2014-07-18 Jon Honeycutt REGRESSION: Crash when typing into text field that clears itself on iOS Reviewed by Darin Adler. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::requestAutocorrectionData): wordRangeFromPosition() returns null in some cases; null check range before dereferencing it. Moved some variable declarations around to better match our style. 2014-07-22 Dana Burkart Merge r171219. 2014-07-18 Tim Horton [WK2] Provide a mechanism to grab the back-forward list for gesture navigation purposes from another WKWebView https://bugs.webkit.org/show_bug.cgi?id=134999 Reviewed by Sam Weinig. In some cases, clients may need to throw a WKWebView with no back-forward list over another WKWebView, and want to participate in gesture swipe as if they were actually the page being overlaid. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView setAllowsBackForwardNavigationGestures:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): (-[WKWebViewConfiguration _alternateWebViewForNavigationGestures]): (-[WKWebViewConfiguration _setAlternateWebViewForNavigationGestures:]): * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: Keep an "alternate" WKWebView "for navigation gestures", which ViewGestureController will use as the real source of back-forward items, and the destination of the swipe navigation. All swipe delegate callbacks will also fire from the alternate view, because it owns the items and will be doing the navigation. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::setAlternateBackForwardListSourceView): (WebKit::ViewGestureController::beginSwipeGesture): Send navigationGestureDidBegin via the alternate view's WebPageProxy if it exists. Record a new snapshot on the current page, but copy it to the alternate view if necessary, so that when swiping forward from the alternate view, it will have the "right" snapshot. Get the target back forward item from the alternate view. Send navigationGestureWillEnd via the alternate view's WebPageProxy if it exists. (WebKit::ViewGestureController::canSwipeInDirection): Determine if we can swipe in a direction by looking at the alternate view's back-forward list if necessary. (WebKit::ViewGestureController::endSwipeGesture): Send navigationGestureDidEnd via the alternate view's WebPageProxy if it exists. Perform the navigation on the alternate view if necessary. (WebKit::ViewGestureController::removeSwipeSnapshot): Send navigationGestureSnapshotWasRemoved via the alternate view's WebPageProxy if it exists. * UIProcess/mac/ViewGestureController.h: 2014-07-22 Dana Burkart Merge r171211. 2014-07-17 Alexey Proskuryakov REGRESSION (r171167): LoaderClient processDidCrash call is made after load state changes https://bugs.webkit.org/show_bug.cgi?id=135032 Reviewed by Dan Bernstein. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::processDidCrash): Create a transaction, so that the nested transaction in resetStateAfterProcessExited() wouldn't be committed. (WebKit::WebPageProxy::resetStateAfterProcessExited): Don't use auto - it was hiding the most important fact that this is a stack object that can't be simply moved to a different function. 2014-07-22 Dana Burkart Merge r171167. 2014-07-16 Alexey Proskuryakov A test that hangs at cleanup stage confuses webkitpy hugely https://bugs.webkit.org/show_bug.cgi?id=122475 Reviewed by Anders Carlsson. Reset m_pageLoadState when the process exits cleanly - otherwise messages from a new process for the same WebPageProxy would hit assertions. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::processDidCrash): (WebKit::WebPageProxy::resetStateAfterProcessExited): 2014-07-22 Dana Burkart Merge r171197. 2014-07-17 Brent Fulgham [Mac] Full screen video not always animating in the correct Space https://bugs.webkit.org/show_bug.cgi?id=135020 Reviewed by Dean Jackson. The fullscreen window can "remember" the Space it was part of the first time you enter fullscreen mode. Subsequent fullscreen transitions will always start from this Space, even if you move the WebKit-hosted application to a different Space. We can help the display system know when we've moved to a new Space by calling NSWindow's 'orderBack' method on the fullscreen window prior to starting the transition to fullscreen mode. This method call hooks the window into the current Space so everything works properly. * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): Add the new fullscreen window to the current Space before starting transition to fullscreen. 2014-07-22 Dana Burkart Merge r171195. 2014-07-17 Timothy Hatcher Make console.profile record to the Timeline. https://bugs.webkit.org/show_bug.cgi?id=134643 Reviewed by Joseph Pecoraro. * WebProcess/WebPage/WebInspector.cpp: (WebKit::WebInspector::setJavaScriptProfilingEnabled): (WebKit::WebInspector::startJavaScriptProfiling): (WebKit::WebInspector::stopJavaScriptProfiling): 2014-07-22 Dana Burkart Merge r171194. 2014-07-17 Brady Eidson Crash in ServicesOverlayController::~ServicesOverlayController. and https://bugs.webkit.org/show_bug.cgi?id=135022 Reviewed by Tim Horton. * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::ServicesOverlayController::~ServicesOverlayController): Don’t need to uninstall the PageOverlay as it has already been destroyed by this point in WebPage::~WebPage. 2014-07-22 Dana Burkart Merge r171191. 2014-07-17 Tim Horton Sometimes purgeable (or empty!) tiles are shown on screen when resuming the app https://bugs.webkit.org/show_bug.cgi?id=135018 Reviewed by Simon Fraser. * UIProcess/DrawingAreaProxy.h: (WebKit::DrawingAreaProxy::hideContentUntilNextUpdate): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::hideContentUntilNextUpdate): * UIProcess/mac/RemoteLayerTreeHost.h: * UIProcess/mac/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::detachRootLayer): Add a mechanism to "hide" drawing area content until the next commit, by detaching the root layer. RemoteLayerTreeHost will automatically reattach it at the next commit. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::viewStateDidChange): * UIProcess/WebPageProxy.h: Add a parameter to viewStateDidChange specifying whether dispatching the change to the Web process is deferrable or not. We will also automatically use "Immediate" if the view is coming in-window, like we did before. * UIProcess/ios/WKContentView.mm: (-[WKContentView _applicationWillEnterForeground:]): Make use of the aforementioned new mechanisms to ensure that we immediately dispatch view state changes when coming into the foreground, and will have removed the root layer if a commit didn't come in while waitForDidUpdateViewState blocks. 2014-07-22 Dana Burkart Merge r171365. 2014-07-22 Oliver Hunt Add accountsd access to network sandbox profile https://bugs.webkit.org/show_bug.cgi?id=135176 Reviewed by Anders Carlsson. This is available to the webcontent process already, but is also needed for the networking process. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: 2014-07-18 Babak Shafiei Merge r171209. 2014-07-17 Benjamin Poulain [iOS][WK2] Fix the updateVisibleContentRects synchronization for load after r171154 https://bugs.webkit.org/show_bug.cgi?id=135036 Reviewed by Dan Bernstein. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateVisibleContentRects): I forgot to update one of the condition after changing from lastTransaction to next transaction in r171154. 2014-07-17 Lucas Forschler Rollout r171167. 2014-07-17 Dean Jackson Disable some features on this branch. Reviewed originally by Simon Fraser. Disable: - CSS_EXCLUSIONS - CSS_GRID_LAYOUT - INPUT_TYPE_COLOR - INPUT_TYPE_COLOR_POPUP - CANVAS_PATH - CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED - INDIE_UI - SHARED_WORKERS - NAVIGATOR_HWCONCURRENCY - GAMEPAD - PICTURE_SIZES - CSS3_CONDITIONAL_RULES - WILL_REVEAL_EDGE_EVENTS * Configurations/FeatureDefines.xcconfig: 2014-07-16 Brady Eidson Reintroduce the SPI _websiteDataURLForContainerWithURL: that was removed in r171160 https://bugs.webkit.org/show_bug.cgi?id=134984 Reviewed by David Kilzer. * UIProcess/API/Cocoa/WKProcessPool.mm: (+[WKProcessPool _websiteDataURLForContainerWithURL:]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: 2014-07-16 Alexey Proskuryakov A test that hangs at cleanup stage confuses webkitpy hugely https://bugs.webkit.org/show_bug.cgi?id=122475 Reviewed by Anders Carlsson. Reset m_pageLoadState when the process exits cleanly - otherwise messages from a new process for the same WebPageProxy would hit assertions. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::processDidCrash): (WebKit::WebPageProxy::resetStateAfterProcessExited): 2014-07-16 David Kilzer [iOS] Update order file paths for WebKit and WebKit2 Reviewed by Darin Adler. * Configurations/Base.xcconfig: Add order file for iOS named WebKit.order. 2014-07-16 Brady Eidson Add WebSecurityOrigin "webSecurityOriginFromDatabaseIdentifier" SPI and change _websiteDataURLForContainerWithURL: SPI and https://bugs.webkit.org/show_bug.cgi?id=134984 Reviewed by Dan Bernstein. Change _websiteDataURLForContainerWithURL: SPI to include an optional bundle identifier argument: * UIProcess/API/Cocoa/WKProcessPool.mm: (+[WKProcessPool _websiteDataURLForContainerWithURL:bundleIdentifierIfNotInContainer:]): (+[WKProcessPool _websiteDataURLForContainerWithURL:]): Deleted. * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: Add a big shiny comment in a few key places: * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::initializeDatabaseProcess): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::UniqueIDBDatabase): * UIProcess/WebContext.cpp: (WebKit::WebContext::applyPlatformSpecificConfigurationDefaults): (WebKit::WebContext::ensureDatabaseProcess): 2014-07-16 Enrica Casucci REGRESSION (iOS WebKit2): Cannot scroll while dragging a selection. https://bugs.webkit.org/show_bug.cgi?id=134992 Reviewed by Benjamin Poulain. This patch exposes the scroller and the visible content rect so that UIKit can implement autoscroll when dragging the selections. It also changes that way we do hit testing to allow hit test outside the clipping region and fixes the way we compute the selection rectangle for the block selection, ensuring that we consider also non text elements like images. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView scroller]): (-[WKContentView visibleRect]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::selectionBoxForRange): (WebKit::WebPage::rangeForWebSelectionAtPosition): (WebKit::WebPage::rangeForBlockAtPoint): (WebKit::WebPage::expandedRangeFromHandle): (WebKit::WebPage::contractedRangeFromHandle): (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle): (WebKit::WebPage::changeBlockSelection): 2014-07-16 Alexey Proskuryakov REGRESSION (r170155): Sandbox violations using a wrong CFNetwork cache path in WebContent process Rubber-stamped by Sam Weinig. Before r170155, we incorrectly checked usesNetworkProcess(), which always returns false at this point in initialization sequence. But we did the right thing, as we always need to set the cache path, even when network process is used for most loading. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2014-07-16 Timothy Horton Dispatch top content inset changes immediately if synchronously waiting for view state changes ​https://bugs.webkit.org/show_bug.cgi?id=134942 Reviewed by Simon Fraser. * UIProcess/API/mac/WKView.mm: (-[WKView _dispatchSetTopContentInset]): (-[WKView _setTopContentInset:]): Move the check from _setTopContentInset: to _dispatchSetTopContentInset that ensures that we only send the message if the top content inset changed. 2014-07-16 Benjamin Poulain [iOS][WK2] Synchronize the dynamic viewport updates with their layer tree commit https://bugs.webkit.org/show_bug.cgi?id=134965 Related to Reviewed by Tim Horton. Dynamic viewport update relies on the _resizeAnimationTransformAdjustments being applied to the page at the new size during the transition. Because of the races between the LayerTree Commit and DynamicViewportSizeUpdate, the transform can be applied to the wrong set of tiles. This is mostly a problem for unresponsive WebProcess or when the synchronization is done immediately. There is at least one more case that is not handled: if synchronizeDynamicViewportUpdate() completely fails to get the new page, the UIProcess is in a somewhat messy state. I will look into that separately than the layer tree synchronization. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:]): (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]): (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::resetState): * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::dynamicViewportUpdateChangedTarget): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::dynamicViewportSizeUpdate): (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate): (WebKit::WebPageProxy::didCommitLayerTree): (WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): (WebKit::WebPage::didCommitLoad): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::synchronizeDynamicViewportUpdate): (WebKit::WebPage::updateVisibleContentRects): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: (WebKit::RemoteLayerTreeDrawingArea::nextTransactionID): (WebKit::RemoteLayerTreeDrawingArea::currentTransactionID): Deleted. 2014-07-16 Dan Bernstein REGRESSION (r170653): Web Content service’s Info.plist has wrong format https://bugs.webkit.org/show_bug.cgi?id=134973 Reviewed by Alexey Proskuryakov. * WebKit2.xcodeproj/project.pbxproj: Updated the Add CFBundle Localization Info.plist Key script build phases to convert Info.plist back to binary format if the PLIST_FILE_OUTPUT_FORMAT build setting requires it. 2014-07-15 Benjamin Poulain Fix r171124 * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _scrollToContentOffset:]): On landing, I changed the min/max branches to shrunkTo/expandedTo, but the return value of those was ignored. 2014-07-15 Dan Bernstein WKWebView’s FormClient::willSubmitForm should use CompletionHandlerCallChecker https://bugs.webkit.org/show_bug.cgi?id=134951 Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setFormDelegate:]): 2014-07-15 Benjamin Poulain [iOS][WK2] Scrolling request from the scrolling tree must be limited to offsets in the document https://bugs.webkit.org/show_bug.cgi?id=134952 Reviewed by Enrica Casucci. When we received a scroll request, we were taking that offset directly to set the UIScrollView scroll position. This is a problem if a page request scrolling to an invalid position, we were still doing it. This patch limits the position to be inside the document. -- Why not limit the scroll offset in the WebProcess when we receive the scroll request? -- Some pages rely on the page scale factor changing instantly, because that is how it worked on WebKit1. On WebKit2, the WebProcess cannot know the valid range because the obscured insets are changing dynamically, and the page scale factor can change in response to WebProcess events (the focus changing for example). To make the page works, the WebProcess does not restrict the scroll position. In that architecture, the UIProcess has to sanitize the input, which was not done before this patch. -- Why not use changeContentOffsetBoundedInValidRange()? The scroll offset as seen by the page is relative to the unobscured rect. While the position used for history item is a visual position. All we need in this case is a position in the view. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _scrollToContentOffset:]): * UIProcess/WebPageProxy.h: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::resendLastVisibleContentRects): 2014-07-15 Timothy Horton Dispatch top content inset changes immediately if synchronously waiting for view state changes https://bugs.webkit.org/show_bug.cgi?id=134942 Reviewed by Simon Fraser. * UIProcess/API/mac/WKView.mm: (-[WKView endDeferringViewInWindowChanges]): (-[WKView endDeferringViewInWindowChangesSync]): (-[WKView _dispatchSetTopContentInset]): (-[WKView _setTopContentInset:]): Send top content inset changes immediately before sync-waiting for new tiles from the Web Process. This will ensure that the incoming contents have the right top content inset, and we don't flash between the wrong inset and the right one. 2014-07-15 Enrica Casucci REGRESSION(WK2 iOS): Safari hangs when switching focus from a field using the Tab key. https://bugs.webkit.org/show_bug.cgi?id=134934 Reviewed by Tim Horton. * UIProcess/ios/WKContentViewInteraction.mm: Tab and back tab should be handled as special keys that have a command associated. The command specifies for each key the relevant action. This patch implements the commands property to create the association between key and command and the relevant actions that will execute the same code executed when the used taps on the < > buttons in the accessory bar. (-[WKContentView keyCommands]): (-[WKContentView _nextAccessoryTab:]): (-[WKContentView _prevAccessoryTab:]): 2014-07-15 Oliver Hunt More tidying of the webcontent sandbox profile https://bugs.webkit.org/show_bug.cgi?id=134938 Reviewed by Alexey Proskuryakov. Remove some excessive abilities from the profile and make the required ones explicit. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2014-07-14 Andreas Kling [iOS] Don't progressively re-render tiles while pinch-zooming under memory pressure. When we're under memory pressure, the last thing we want to be doing is creating gratuitous new IOSurfaces. Just wait for the gesture to end before rendering at the new scale. Reviewed by Tim Horton. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateVisibleContentRects): 2014-07-14 Joseph Pecoraro [Cocoa] _WKRemoteObjectInterface leaks NSString ivar https://bugs.webkit.org/show_bug.cgi?id=134914 Reviewed by Simon Fraser. Release our copied NSString in dealloc. * Shared/API/Cocoa/_WKRemoteObjectInterface.mm: (-[_WKRemoteObjectInterface dealloc]): 2014-07-14 Dean Jackson [PlugIns] Check for a non-null snapshot image before trying to decode it https://bugs.webkit.org/show_bug.cgi?id=134913 Reviewed by Tim Horton. Changeset r169820 introduced a bug where we could examine the pixels of an image (looking for solid colors) before checking if the image actually existed. I added a null check, and moved the code around a bit to avoid checking for existence three times. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::pluginSnapshotTimerFired): Check that snapshotImage exists before trying to look at it. 2014-07-14 Anders Carlsson Fix 32-bit build. * UIProcess/Cocoa/SessionStateCoding.mm: (WebKit::encodeSessionState): 2014-07-14 Anders Carlsson Use the legacy session coder for encoding/decoding session state https://bugs.webkit.org/show_bug.cgi?id=134910 Reviewed by Beth Dakin. * UIProcess/Cocoa/SessionStateCoding.mm: (WebKit::encodeSessionState): (WebKit::decodeSessionState): 2014-07-14 Oliver Hunt Restrict network process to remote connections https://bugs.webkit.org/show_bug.cgi?id=134908 Reviewed by Geoffrey Garen. Further restrict network client * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: 2014-07-14 Tim Horton ASSERT(isMainThread()) under OneShotDisplayLinkHandler https://bugs.webkit.org/show_bug.cgi?id=134900 Reviewed by Simon Fraser. * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (-[OneShotDisplayLinkHandler displayLinkFired:]): isMainThread means the Web thread sometimes. 2014-07-14 Tim Horton Fix the build. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): * UIProcess/API/ios/WKViewIOS.mm: (-[WKView _frameOrBoundsChanged]): 2014-07-14 Carlos Alberto Lopez Perez [UNIX] Log error description when failing to create shared memory file. https://bugs.webkit.org/show_bug.cgi?id=134892 Reviewed by Darin Adler. * Platform/unix/SharedMemoryUnix.cpp: (WebKit::SharedMemory::create): Print the string describing the error number (errno). 2014-07-14 Benjamin Poulain [iOS][WK2] On rotation, RemoteLayerTreeDrawingArea renders one extra frame at the wrong orientation https://bugs.webkit.org/show_bug.cgi?id=134875 Reviewed by Tim Horton. On animated resize, the size of the DrawingAreaProxy was changed before the layout parameters were changed. This in turn caused the WebProcess's DrawingArea to flush the layer tree while still at the wrong orientation. This patch fixes the issue by making a special case for animated resize: -While starting animated resize, _frameOrBoundsChanged can be called several times in response to the API's client changing the WKWebView. In that case, we do not update the drawing area. -After the "updateBlock" is executed and the size have been changed, the dynamic viewport update is computed, the dynamicViewportSizeUpdate is sent to the WebProcess, followed by the message DrawingArea::updateGeometry(). Since both messages are asynchronous, they are received in that order, and the updateGeometry() is always done after the viewport configuration has been updated. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView setMinimumSize:]): Deleted. 2014-07-14 Benjamin Poulain [iOS][WK2] Fix withinEpsilon() https://bugs.webkit.org/show_bug.cgi?id=134798 Reviewed by Darin Adler. Move the function back to WKWebView, it is no longer needed in WKContentView. Use the real types as input to properly verify that the two inputs are within a small value of the 32bit floating point. The epsilon we use is always on 32 bits float because we want to avoid doing work for changes that would not make any difference on float. The source of those small changes comes from the fact UIProcess does a lot of processing on CGFloat, which are double on 64bits architecture, while the WebProcess use 32bits floating point for scale. When we are getting updates from the WebProcess, we should ignore any small differences caused by the computations done with less precision. * UIProcess/API/Cocoa/WKWebView.mm: (withinEpsilon): * UIProcess/ios/WKContentViewInteraction.h: (withinEpsilon): Deleted. 2014-07-14 Bear Travis [Feature Queries] Enable Feature Queries on Mac https://bugs.webkit.org/show_bug.cgi?id=134404 Reviewed by Antti Koivisto. Enable Feature Queries on Mac and resume running the feature tests. * Configurations/FeatureDefines.xcconfig: Turn on ENABLE_CSS3_CONDITIONAL_RULES. 2014-07-14 Anders Carlsson Make shouldKeepCurrentBackForwardListItemInList part of WKPageLoaderClientV5 to avoid breaking ABI https://bugs.webkit.org/show_bug.cgi?id=134889 Reviewed by Beth Dakin. * UIProcess/API/C/WKPage.cpp: * UIProcess/API/C/WKPageLoaderClient.h: 2014-07-14 Dan Bernstein REGRESSION (r171045): Reproducible crash on navigation in PageClientImpl::willRecordNavigationSnapshot https://bugs.webkit.org/show_bug.cgi?id=134887 Reviewed by Tim Horton. * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::navigationGestureDidBegin): nil-check m_webView. It can be nil when the client is using WKView directly. (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto. (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto. (WebKit::PageClientImpl::willRecordNavigationSnapshot): Ditto. 2014-07-14 Eric Carlson [Mac] don't enable low power audio mode on external output devices https://bugs.webkit.org/show_bug.cgi?id=134877 Reviewed by Sam Weinig. * PluginProcess/PluginProcess.h: Add an empty implementation of AudioHardwareListener::audioOutputDeviceChanged. 2014-07-14 Tim Horton [iOS] Throttle painting using a UI-process-side CADisplayLink https://bugs.webkit.org/show_bug.cgi?id=134879 Reviewed by Simon Fraser. Just waiting for CA to commit is insufficient to actually throttle to 60fps, because nothing will block the main runloop from spinning. Instead, listen to a CADisplayLink, and send didUpdate to the WebProcess the first time it fires after we commit. This is not a guarantee that our content is on the screen, but we don't have any way to make that guarantee yet. This will throttle painting, rAF, etc. to the display refresh rate. * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (-[OneShotDisplayLinkHandler initWithDrawingAreaProxy:]): (-[OneShotDisplayLinkHandler dealloc]): (-[OneShotDisplayLinkHandler displayLinkFired:]): (-[OneShotDisplayLinkHandler invalidate]): (-[OneShotDisplayLinkHandler schedule]): (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy): (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy): (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay): (WebKit::RemoteLayerTreeDrawingAreaProxy::coreAnimationDidCommitLayers): Deleted. 2014-07-14 Dan Bernstein [iOS] Networking process writes persistent credentials to the keychain https://bugs.webkit.org/show_bug.cgi?id=134878 Reviewed by Sam Weinig. Route CFNetwork’s calls to Security API through to the UI process. * NetworkProcess/ios/NetworkProcessIOS.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcess): Initialize SecItemShim. * Shared/mac/SecItemShim.cpp: (WebKit::SecItemShim::initialize): On iOS, rather than using a shim library, supply CFNetwork with alternate functions to call. * Shared/mac/SecItemShim.messages.in: Removed #if !PLATFORM(IOS). * UIProcess/mac/SecItemShimProxy.messages.in: Ditto. * config.h: Define ENABLE_SEC_ITEM_SHIM to 1 on iOS as well. 2014-07-14 Dan Bernstein NetworkProcess sometimes hangs under copyDefaultCredentialForProtectionSpace https://bugs.webkit.org/show_bug.cgi?id=134666 Reviewed by Tim Horton. A SecItem may have an attribute whose value is a SecAccessControlRef, which is not supported by ArgumentCodersCF. In debug builds, trying to encode a CFDictionary containing a value of unsupprted type causes an assertion to fail, but in release builds encoding succeeds, and only decoding fails, in this case silently, simply not delivering the SecItemShim::secItemResponse message. The fix is to teach ArgumentCodersCF about SecAccessControlRef. * Shared/cf/ArgumentCodersCF.cpp: (IPC::typeFromCFTypeRef): Check for the SecAccessControlRef type. (IPC::encode): Encode the SecAccessControl serialized into CFData. (IPC::decode): Deserialize a SecAccessControl from the decoded CFData. * Shared/cf/ArgumentCodersCF.h: * config.h: Defined HAVE_SEC_ACCESS_CONTROL. 2014-07-13 Dan Bernstein [Cocoa] Include element snapshot in _WKActivatedElementInfo https://bugs.webkit.org/show_bug.cgi?id=134872 Reviewed by Sam Weinig. * Shared/InteractionInformationAtPosition.cpp: (WebKit::InteractionInformationAtPosition::encode): Encode the image if there is one. (WebKit::InteractionInformationAtPosition::decode): Decode the image if there is one. * Shared/InteractionInformationAtPosition.h: Added an image member to the struct. * UIProcess/API/Cocoa/_WKActivatedElementInfo.h: Exposed the boundingRect property and added an image property. * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm: (-[_WKActivatedElementInfo _initWithType:URL:location:title:rect:image:]): Added an image parameter, which is stored in a new ivar. (-[_WKActivatedElementInfo image]): Added this getter, which converts the ShareableBitmap into a cached Cocoa image and returns it. * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h: Added image parameter to the initializer, removed _boundingRect property declaration from here. * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant showImageSheet]): Pass the image from the position information into the _WKActivatedElementInfo initializer. (-[WKActionSheetAssistant showLinkSheet]): Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::snapshotNode): Added. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getPositionInformation): If the element is a link or an image, store a snapshot of it in the image member of the InteractionInformationAtPosition. 2014-07-13 Dan Bernstein [Cocoa] Clean up session state API a little https://bugs.webkit.org/show_bug.cgi?id=134871 Reviewed by Darin Adler. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _sessionState]): (-[WKWebView _restoreFromSessionState:]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2014-07-13 Javier Fernandez REGRESSION(r171045) [GTK] Build broken. https://bugs.webkit.org/show_bug.cgi?id=134867 Unreviewed GTK build fix after r171045. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::willRecordNavigationSnapshot): * UIProcess/API/gtk/PageClientImpl.h: 2014-07-13 Gyuyoung Kim Unreviewed, EFL build fix since r171045. * UIProcess/CoordinatedGraphics/WebView.h: 2014-07-12 Dan Bernstein [Cocoa] Notify the client when a navigation snapshot is taken https://bugs.webkit.org/show_bug.cgi?id=134865 Reviewed by Sam Weinig. * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new delegate method. * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): Initialize new flag in m_navigationDelegateMethods. (WebKit::NavigationState::willRecordNavigationSnapshot): Added. Calls the new WKNavigationDelegate method. * UIProcess/PageClient.h: Declared new client function. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::willRecordNavigationSnapshot): Added. Calls the new client function. * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::willRecordNavigationSnapshot): Override that calls NavigationState::willRecordNavigationSnapshot. * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::willRecordNavigationSnapshot): Ditto. * UIProcess/mac/ViewSnapshotStore.mm: (WebKit::ViewSnapshotStore::recordSnapshot): Added a call to WebPageProxy::willRecordNavigationSnapshot. 2014-07-12 Gyuyoung Kim Unreviewed, fix EFL build break since r171034. * UIProcess/CoordinatedGraphics/WebView.h: * UIProcess/efl/WebContextEfl.cpp: (WebKit::WebContext::platformMediaCacheDirectory): 2014-07-12 Darin Adler Try to fix 32-bit Mac build. * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::navigationGestureDidBegin): Added WK_API_ENABLED conditional. (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto. (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto. 2014-07-12 Javier Fernandez REGRESSION(r171034) [GTK] Build broken. https://bugs.webkit.org/show_bug.cgi?id=134861 Unreviewed GTK build fix. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::navigationGestureDidBegin): (WebKit::PageClientImpl::navigationGestureWillEnd): (WebKit::PageClientImpl::navigationGestureDidEnd): * UIProcess/API/gtk/PageClientImpl.h: 2014-07-12 Javier Fernandez REGRESSION(r171024) [GTK] Build broken. https://bugs.webkit.org/show_bug.cgi?id=134859 Unreviewed GTK build fix. * UIProcess/gtk/WebContextGtk.cpp: (WebKit::WebContext::platformMediaCacheDirectory): 2014-07-12 Dan Bernstein [Cocoa] Inform the client when back-forward navigation gestures begin and end https://bugs.webkit.org/show_bug.cgi?id=134853 Reviewed by Sam Weinig. * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new WKNavigationDelegate methods. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _isShowingNavigationGestureSnapshot]): Added this getter. * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new property _isShowingNavigationGestureSnapshot. * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): Initialize new flags in m_navigationDelegateMethods. (WebKit::NavigationState::navigationGestureDidBegin): Added. Calls the new WKNavigationDelegate method. (WebKit::NavigationState::navigationGestureWillEnd): Ditto. (WebKit::NavigationState::navigationGestureDidEnd): Ditto. * UIProcess/PageClient.h: Declared new client functions. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): Initialize new member variable. (WebKit::WebPageProxy::navigationGestureDidBegin): Set m_isShowingNavigationGestureSnapshot and call the new client function. (WebKit::WebPageProxy::navigationGestureWillEnd): Call the new client function. (WebKit::WebPageProxy::navigationGestureDidEnd): Ditto. (WebKit::WebPageProxy::navigationGestureSnapshotWasRemoved): Clear m_isShowingNavigationGestureSnapshot. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::isShowingNavigationGestureSnapshot): Added this getter. * UIProcess/ios/PageClientImplIOS.h: Declared overrides of new client functions. * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::navigationGestureDidBegin): Override that calls the new NavigationState function. (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto. (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): Added calls to WebPageProxy::navigationGestureDidBegin and WebPageProxy::navigationGestureWillEnd. (WebKit::ViewGestureController::endSwipeGesture): Added calls to WebPageProxy::navigationGestureDidEnd. (WebKit::ViewGestureController::removeSwipeSnapshot): Added call to WebPageProxy::navigationGestureSnapshotWasRemoved. * UIProcess/mac/PageClientImpl.h: Declared overrides of new client functions. * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::navigationGestureDidBegin): Override that calls the new NavigationState function. (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto. (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto. * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::beginSwipeGesture): Added call to WebPageProxy::navigationGestureDidBegin. (WebKit::ViewGestureController::endSwipeGesture): Added calls to WebPageProxy::navigationGestureDidEnd. (WebKit::ViewGestureController::removeSwipeSnapshot): Added call to WebPageProxy::navigationGestureSnapshotWasRemoved. 2014-07-12 Oliver Hunt Fix typo in prior patch https://bugs.webkit.org/show_bug.cgi?id=134858 Reviewed by Sam Weinig. Fix typo * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformDefaultCookieStorageDirectory): 2014-07-12 Dan Bernstein [Cocoa] Client is not notified of same-document navigations https://bugs.webkit.org/show_bug.cgi?id=134855 Reviewed by Sam Weinig. * UIProcess/API/APILoaderClient.h: (API::LoaderClient::didSameDocumentNavigationForFrame): Added navigationID parameter. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageLoaderClient): Ditto. * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Added new enum and delegate method. * UIProcess/Cocoa/NavigationState.h: Declare override of API::LoaderClient::didSameDocumentNavigationForFrame. Added flag in m_navigationDelegateMethods struct. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): Initialize new m_navigationDelegateMethods flag. (WebKit::toWKSameDocumentNavigationType): Added this helper to convert from internal to API values. (WebKit::NavigationState::LoaderClient::didSameDocumentNavigationForFrame): Override to call the delegate method, if implemented. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): Added navigationID parameter, which is forwarded to the client. * UIProcess/WebPageProxy.h: Added navigationID parameter. * UIProcess/WebPageProxy.messages.in: Ditto. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage): Send the navigation ID. (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage): Ditto. (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage): Ditto. (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage): Ditto. 2014-07-12 Oliver Hunt Extend WebContent sandbox to allow some extra access for frameworks https://bugs.webkit.org/show_bug.cgi?id=134844 Reviewed by Sam Weinig. Open up the webcontent sandbox a bit so that some external frameworks can work correctly. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/WebContext.cpp: (WebKit::WebContext::createNewWebProcess): (WebKit::WebContext::mediaCacheDirectory): * UIProcess/WebContext.h: * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformMediaCacheDirectory): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2014-07-12 Oliver Hunt Temporary work around for https://bugs.webkit.org/show_bug.cgi?id=134848 Reviewed by Sam Weinig. Temporarily work around by dropping the explicit cookie storage if it points out of the container. * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformDefaultCookieStorageDirectory): 2014-07-11 Enrica Casucci Implement textStylingAtPosition in WK2. https://bugs.webkit.org/show_bug.cgi?id=134843 Reviewed by Benjamin Poulain. Adding information about typing attributes to EditorState so that we can implement textStylingAtPosition. * Shared/EditorState.cpp: (WebKit::EditorState::encode): (WebKit::EditorState::decode): * Shared/EditorState.h: (WebKit::EditorState::EditorState): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView textStylingAtPosition:inDirection:]): (-[WKContentView canPerformAction:withSender:]): (-[WKContentView toggleBoldface:]): (-[WKContentView toggleItalics:]): (-[WKContentView toggleUnderline:]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::editorState): 2014-07-11 Oliver Hunt Tighten WebContent sandbox https://bugs.webkit.org/show_bug.cgi?id=134834 Reviewed by Sam Weinig. Define a much tighter sandbox profile for the WebContent process * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2014-07-11 Antti Koivisto REGRESSION (r170163?): Web content shifts revealing space equivalent to the find bar when clicking a link while a phrase is targeted via Cmd+F https://bugs.webkit.org/show_bug.cgi?id=134833 Reviewed by Zalan Bujtas. Some versions of OS X Safari can't handle the new unfreeze timing. Revert back to DidFirstLayout on Mac. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidLayout): 2014-07-11 Zalan Bujtas Subpixel layout: return integral results for offset*, client*, scroll* by default. https://bugs.webkit.org/show_bug.cgi?id=134651 Reviewed by Simon Fraser. Revert to returning integral values for Element.offset* client* scroll* by default. Fractional values break number of sites(tight design) and JS frameworks(fail to handle fractional values). Since snapped dimension depends on both the original point and the width/height of the box, we need to call RenderBoxModelObject::pixelSnapped*() helpers, instead of round(). Covered by existing tests * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferencesRefPrivate.h: 2014-07-10 Jinwoo Song Unreviewed EFL build fix after r170970. * UIProcess/efl/WebContextEfl.cpp: (WebKit::WebContext::platformDefaultOpenGLCacheDirectory): 2014-07-10 Carlos Alberto Lopez Perez REGRESSION(r170970) REGRESSION(r170974): [GTK] Build broken. https://bugs.webkit.org/show_bug.cgi?id=134825 Unreviewed GTK build fix. * Shared/SessionState.h: Put ifdefs for ViewSnapshot on Mac port. * Shared/WebBackForwardListItem.h: Idem. * UIProcess/gtk/WebContextGtk.cpp: (WebKit::WebContext::platformDefaultOpenGLCacheDirectory): Implement skeleton. 2014-07-10 Benjamin Poulain [iOS][WK2] It should be safe to call WKContentViewInteraction's cleanupInteraction multiple times https://bugs.webkit.org/show_bug.cgi?id=134820 Reviewed by Andreas Kling. If a view is destroyed just after a crash, "cleanupInteraction" is called twice: once on crash, once on dealloc. The code handling _interactionViewsContainerView is using KVO to monitor transform changes. It is not safe to remove the observer if we are not already observing on that view. To solve the problem, this patch makes the cleanup actually remove the view so that setup and cleanup are completely symmetrical. If cleanup is called twice, the second time would not enter the branch because the view is already nil. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView cleanupInteraction]): 2014-07-10 Simon Fraser [iOS WK2] Move WKInspectorHighlightView to its own file https://bugs.webkit.org/show_bug.cgi?id=134819 Reviewed by Joseph Pecoraro. WKInspectorHighlightView brought a lot of path/quad-related code into WKContentView.mm, so move it into its own file. * UIProcess/WKInspectorHighlightView.h: Added. * UIProcess/WKInspectorHighlightView.mm: Added. (-[WKInspectorHighlightView dealloc]): (-[WKInspectorHighlightView _removeAllLayers]): (-[WKInspectorHighlightView _createLayers:]): (findIntersectionOnLineBetweenPoints): (quadIntersection): (layerPathWithHole): (layerPath): (-[WKInspectorHighlightView _layoutForNodeHighlight:]): (-[WKInspectorHighlightView _layoutForRectsHighlight:]): (-[WKInspectorHighlightView update:]): * UIProcess/ios/WKContentView.mm: (-[WKInspectorHighlightView initWithFrame:]): Deleted. (-[WKInspectorHighlightView dealloc]): Deleted. (-[WKInspectorHighlightView _removeAllLayers]): Deleted. (-[WKInspectorHighlightView _createLayers:]): Deleted. (findIntersectionOnLineBetweenPoints): Deleted. (quadIntersection): Deleted. (layerPathWithHole): Deleted. (layerPath): Deleted. (-[WKInspectorHighlightView _layoutForNodeHighlight:]): Deleted. (-[WKInspectorHighlightView _layoutForRectsHighlight:]): Deleted. (-[WKInspectorHighlightView update:]): Deleted. * WebKit2.xcodeproj/project.pbxproj: 2014-07-10 Tim Horton REGRESSION (r170935): WKWebView is always transparent until the first layer tree commit https://bugs.webkit.org/show_bug.cgi?id=134818 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKWebView.mm: (scrollViewBackgroundColor): r170935 made it so that we would initialize the scroll view background color to an invalid color until the first layer tree commit. We should go with white instead. 2014-07-10 Enrica Casucci Add a mechanism to notify the UIProcess when an editing command is done executing. https://bugs.webkit.org/show_bug.cgi?id=134807 Reviewed by Tim Horton. Some editing commands have an effect on some parts of the system that run inside the UIProcess. A good example are the cursor movement commands that require an update of the autocorrection/autosuggestion machinery. This patch adds a way to reliably know when the command has been executed in the WebProcess. A previous attempt at solving this problem was added in r170858 and was partially reverted in r170948. The change also removes the selectionWillChange notification added in r170858. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::editorStateChanged): * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::selectionWillChange): Deleted. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView executeEditCommandWithCallback:]): (-[WKContentView _moveUp:withHistory:]): (-[WKContentView _moveDown:withHistory:]): (-[WKContentView _moveLeft:withHistory:]): (-[WKContentView _moveRight:withHistory:]): (-[WKContentView _moveToStartOfWord:withHistory:]): (-[WKContentView _moveToStartOfParagraph:withHistory:]): (-[WKContentView _moveToStartOfLine:withHistory:]): (-[WKContentView _moveToStartOfDocument:withHistory:]): (-[WKContentView _moveToEndOfWord:withHistory:]): (-[WKContentView _moveToEndOfParagraph:withHistory:]): (-[WKContentView _moveToEndOfLine:withHistory:]): (-[WKContentView _moveToEndOfDocument:withHistory:]): (-[WKContentView _selectionWillChange]): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::executeEditCommand): (WebKit::WebPageProxy::notifySelectionWillChange): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::executeEditCommandWithCallback): 2014-07-10 Joseph Pecoraro [Mac] NSWindow warning: adding an unknown subview opening detached Inspector https://bugs.webkit.org/show_bug.cgi?id=134813 Reviewed by Timothy Hatcher. * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::createInspectorWindow): Use a selector that will avoid the warning message. 2014-07-10 Oliver Hunt Remove use of container relative restrictions in the network process sandbox https://bugs.webkit.org/show_bug.cgi?id=134816 Reviewed by Anders Carlsson. As i'm tidying up the various sandboxes and that's meaning we need to reduce some file restrictions in the network process. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: 2014-07-10 Pratik Solanki Unreviewed iOS build fix after r170974. Define id if building a non ObjC file. * UIProcess/mac/ViewSnapshotStore.h: 2014-07-10 Tim Horton Store ViewSnapshots directly on the WebBackForwardListItem https://bugs.webkit.org/show_bug.cgi?id=134667 Reviewed by Dan Bernstein. Make ViewSnapshot a refcounted class. Store it directly on the back-forward item instead of in a side map referenced by UUID. Switch to a very simple LRU eviction model for now. This fixes a ton of snapshot management bugs; for example, we would start throwing out snapshots in the page that was actively being interacted with *first* when evicting snapshots, instead of preferring older snapshots. Additionally, we would not throw away snapshots when back forward items became unreachable. There is definitely room for improvement of the eviction mechanism, but this is closer to a time-tested implementation. * Shared/SessionState.h: Keep a ViewSnapshot instead of a UUID on the BackForwardListItemState. * Shared/WebBackForwardListItem.h: Fix some indented namespace contents. (WebKit::WebBackForwardListItem::snapshot): (WebKit::WebBackForwardListItem::setSnapshot): (WebKit::WebBackForwardListItem::setSnapshotUUID): Deleted. (WebKit::WebBackForwardListItem::snapshotUUID): Deleted. Switch the snapshot getter/setter to operate on ViewSnapshots instead of UUIDs. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _takeViewSnapshot]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/mac/WKView.mm: (-[WKView _takeViewSnapshot]): * UIProcess/API/mac/WKViewInternal.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::takeViewSnapshot): * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::takeViewSnapshot): * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::takeViewSnapshot): Adopt ViewSnapshot::create, return a PassRefPtr, and class-ify ViewSnapshot. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::endSwipeGesture): * UIProcess/mac/ViewGestureController.h: * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::shouldUseSnapshotForSize): (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::endSwipeGesture): Grab the ViewSnapshot directly from the WebBackForwardListItem, and adopt the new functions. * UIProcess/ios/WebMemoryPressureHandlerIOS.mm: (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler): Rename discardSnapshots to discardSnapshotImages, because we're really only discarding the images; the render tree size/background color "snapshot" remains and is useful. * UIProcess/mac/ViewSnapshotStore.h: (WebKit::ViewSnapshot::setRenderTreeSize): (WebKit::ViewSnapshot::renderTreeSize): (WebKit::ViewSnapshot::setBackgroundColor): (WebKit::ViewSnapshot::backgroundColor): (WebKit::ViewSnapshot::setDeviceScaleFactor): (WebKit::ViewSnapshot::deviceScaleFactor): (WebKit::ViewSnapshot::imageSizeInBytes): (WebKit::ViewSnapshot::surface): (WebKit::ViewSnapshot::size): (WebKit::ViewSnapshot::creationTime): Make ViewSnapshot a refcounted class. Add create functions which take an image (or slot ID), and relevant sizes. It is expected that a ViewSnapshot is created with an image, and it is only possible to remove that image, never to replace it. A new ViewSnapshot is required in that case. Add setters for things that ViewSnapshotStore sets on the snapshot after the PageClient retrieves it from the view. Add getters for things that the ViewGestureControllers need. Remove removeSnapshotImage, getSnapshot, and the snapshot map. * UIProcess/mac/ViewSnapshotStore.mm: (WebKit::ViewSnapshotStore::~ViewSnapshotStore): (WebKit::ViewSnapshotStore::didAddImageToSnapshot): (WebKit::ViewSnapshotStore::willRemoveImageFromSnapshot): Manage m_snapshotCacheSize and m_snapshotsWithImages via didAddImageToSnapshot and willRemoveImageFromSnapshot. willRemoveImageFromSnapshot will -always- be called before the ViewSnapshot is destroyed. (WebKit::ViewSnapshotStore::pruneSnapshots): Switch to a simple LRU eviction model. As previously mentioned, it's possible to do better, but this is much less broken than the previous implementation. (WebKit::ViewSnapshotStore::recordSnapshot): (WebKit::ViewSnapshotStore::discardSnapshotImages): (WebKit::ViewSnapshot::create): (WebKit::ViewSnapshot::ViewSnapshot): (WebKit::ViewSnapshot::~ViewSnapshot): (WebKit::ViewSnapshot::hasImage): (WebKit::ViewSnapshot::clearImage): (WebKit::ViewSnapshot::asLayerContents): If a surface is Empty when it comes back from being volatile, throw away the surface and notify the Store to remove it from m_snapshotCacheSize (via clearImage()). (WebKit::ViewSnapshotStore::removeSnapshotImage): Deleted. (WebKit::ViewSnapshotStore::getSnapshot): Deleted. (WebKit::ViewSnapshotStore::discardSnapshots): Deleted. 2014-07-10 Beth Dakin Need Setting/WKPreference that allows clients to prevent scrollbars from drawing on a secondary thread https://bugs.webkit.org/show_bug.cgi?id=134778 -and corresponding- Reviewed by Tim Horton. This is a requirement for some types of performance tests. New pref. * Shared/WebPreferencesDefinitions.h: PDFPlugin has to implement this new ScrollableArea virtual function to indicate the Setting’s value. * WebProcess/Plugins/PDF/PDFPlugin.h: * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::forceUpdateScrollbarsOnMainThreadForPerformanceTesting): New pref. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2014-07-10 Tim Horton [iOS] Frequent assertion failures when swiping back Reviewed by Dan Bernstein. * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing): Don't create an unused VoidCallback. It will assert when destroyed without being called. 2014-07-10 Oliver Hunt Pass sandbox extension for GL cache over to webprocess https://bugs.webkit.org/show_bug.cgi?id=134806 Reviewed by Anders Carlsson. Add additional WebProcess parameters to pass an extension that allows access to the opengl cache directory in the host application's container. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/WebContext.cpp: (WebKit::WebContext::createNewWebProcess): (WebKit::WebContext::openGLCacheDirectory): * UIProcess/WebContext.h: * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformDefaultOpenGLCacheDirectory): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2014-07-10 Dan Bernstein iOS build fix. * WebProcess/WebPage/ServicesOverlayController.h: 2014-07-09 Brady Eidson Phone number highlights should always be visible if the mouse hovers over. and https://bugs.webkit.org/show_bug.cgi?id=134784 Reviewed by Tim Horton. This is a fairly extensive rewrite of ServicesOverlayController. It allows one selection highlight for the entire selection, and as many telephone number highlights as there are numbers. If a telephone number highlight is hovered over, it wins and is painted. If no telephone number highlight is hovered but the selection highlight is, then it is painted. The purposes of each method are self evident by their name, and the concepts are mostly the same as they used to be. The exception is establishHoveredTelephoneHighlight which gets a more detailed explanation below. * Platform/Logging.h: Add a Services logging channel. * WebProcess/WebPage/ServicesOverlayController.h: (WebKit::TelephoneNumberData::TelephoneNumberData): * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::ServicesOverlayController::ServicesOverlayController): (WebKit::ServicesOverlayController::selectionRectsDidChange): (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged): (WebKit::ServicesOverlayController::clearHighlightState): (WebKit::ServicesOverlayController::drawRect): (WebKit::ServicesOverlayController::drawSelectionHighlight): (WebKit::ServicesOverlayController::maybeDrawTelephoneNumberHighlight): (WebKit::ServicesOverlayController::drawHighlight): (WebKit::ServicesOverlayController::clearSelectionHighlight): (WebKit::ServicesOverlayController::clearHoveredTelephoneNumberHighlight): (WebKit::ServicesOverlayController::establishHoveredTelephoneHighlight): Starts walking the telephone number ranges and creating a highlight for each one that doesn’t already have a highlight. If that highlight is also being hovered by the mouse, then it is set as the hovered telephone number highlight and the method stops creating new highlights. (WebKit::ServicesOverlayController::maybeCreateSelectionHighlight): (WebKit::ServicesOverlayController::mouseEvent): (WebKit::ServicesOverlayController::handleClick): (WebKit::ServicesOverlayController::drawTelephoneNumberHighlight): Deleted. (WebKit::ServicesOverlayController::drawCurrentHighlight): Deleted. 2014-07-10 Timothy Horton Assertions or crashes under _takeViewSnapshot when restoring windows https://bugs.webkit.org/show_bug.cgi?id=134792 Reviewed by Simon Fraser. * UIProcess/API/mac/WKView.mm: (-[WKView _takeViewSnapshot]): Taking a window-server snapshot of a non-visible window tends to not succeed. 2014-07-09 Pratik Solanki Buffer CSS and JS resources in network process before sending over to web process https://bugs.webkit.org/show_bug.cgi?id=134560 Reviewed by Antti Koivisto. For CSS and JS resources, ask the network process to buffer the entire resource instead of sending it to web process in chunks since the web process can't do anything with a partial css or js file. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::NetworkResourceLoader): * Shared/Network/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters): (WebKit::NetworkResourceLoadParameters::encode): (WebKit::NetworkResourceLoadParameters::decode): * Shared/Network/NetworkResourceLoadParameters.h: * WebProcess/Network/WebResourceLoadScheduler.cpp: (WebKit::WebResourceLoadScheduler::scheduleLoad): 2014-07-09 Benjamin Poulain [iOS][WK2] Disable text quantization while actively changing the page's scale factor https://bugs.webkit.org/show_bug.cgi?id=134781 Reviewed by Tim Horton and Myles C. Maxfield. While zooming a page, text quantization causes glyphs to "move" in order to get to the closest boundary for the current scale factor. We do not want this to happen while dynamically changing the scale factor because the effect is visible. To avoid this, we disable text quantization if the page's scale factor changes in response to a non-stable contentRect update. * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: (WebKit::WebChromeClient::hasStablePageScaleFactor): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::hasStablePageScaleFactor): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateVisibleContentRects): 2014-07-09 Joseph Pecoraro [iOS] Use UIAlertController API in WKFileUploadPanel instead of SPI https://bugs.webkit.org/show_bug.cgi?id=134777 Reviewed by Sam Weinig. * UIProcess/ios/forms/WKFileUploadPanel.mm: (-[WKFileUploadPanel _showMediaSourceSelectionSheet]): 2014-07-09 Shivakumar JM [EFL][WK2] Add new Public API in ewk_download_job.h to get size of the data already downloaded. https://bugs.webkit.org/show_bug.cgi?id=134759 Reviewed by Gyuyoung Kim. Add new API in ewk_download_job.h to get size of the data already downloaded. * UIProcess/API/efl/ewk_download_job.cpp: (ewk_download_job_received_data_length_get): (EwkDownloadJob::receivedData): * UIProcess/API/efl/ewk_download_job.h: * UIProcess/API/efl/ewk_download_job_private.h: * UIProcess/API/efl/tests/test_ewk2_download_job.cpp: (EWK2DownloadJobTest::on_download_requested): (EWK2DownloadJobTest::on_download_finished): 2014-07-09 Enrica Casucci REGRESSION(r170858): Safari freezes upon making a search on a website (yelp.com). https://bugs.webkit.org/show_bug.cgi?id=134791 Reviewed by Benjamin Poulain. After r170858 we notify the keyboard too often about the changed selection. This patch removes the notification until we find a better way to do it that doesn't cause deadlocks. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _selectionWillChange]): (-[WKContentView _selectionChanged]): 2014-07-09 Anders Carlsson Safari showing blank pages https://bugs.webkit.org/show_bug.cgi?id=134790 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): Make sure to add the content view to the scroll view. 2014-07-09 Anders Carlsson Closed web views should never create new web processes https://bugs.webkit.org/show_bug.cgi?id=134787 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView loadHTMLString:baseURL:]): (-[WKWebView reload]): (-[WKWebView reloadFromOrigin]): Return nil if the returned navigation ID is 0. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::reattachToWebProcess): Assert that the page is not closed. (WebKit::WebPageProxy::reattachToWebProcessWithItem): (WebKit::WebPageProxy::loadRequest): (WebKit::WebPageProxy::loadFile): (WebKit::WebPageProxy::loadData): (WebKit::WebPageProxy::loadHTMLString): (WebKit::WebPageProxy::loadAlternateHTMLString): (WebKit::WebPageProxy::loadPlainTextString): (WebKit::WebPageProxy::loadWebArchiveData): Add early returns if the page is closed. * UIProcess/WebPageProxy.h: 2014-07-09 Anders Carlsson Support transparent WKWebViews https://bugs.webkit.org/show_bug.cgi?id=134779 Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): Call _updateScrollViewBackground instead of setting the background color. (contentZoomScale): Use dot notation. (scrollViewBackgroundColor): Helper function that returns the scroll view background color. If the web view isn't opaque, we want the scroll view to be transparent. (-[WKWebView _updateScrollViewBackground]): Call scrollViewBackgroundColor. (-[WKWebView setOpaque:]): Call WebPageProxy::setDrawsBackground and update the scroll view background. (-[WKWebView setBackgroundColor:]): Call setBackgroundColor on the content view. 2014-07-09 Andy Estes [iOS] WebKit can crash under QuickLookDocumentData::encode() when viewing a QuickLook preview https://bugs.webkit.org/show_bug.cgi?id=134780 Reviewed by Tim Horton. Don't use CFDataCreateWithBytesNoCopy() when we can't guarantee the lifetime of the copied-from DataReference will match or exceed that of the CFDataRef. Copy the data instead. * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveData): 2014-07-09 Pratik Solanki Move resource buffering from SynchronousNetworkLoaderClient to NetworkResourceLoader https://bugs.webkit.org/show_bug.cgi?id=134732 Reviewed by Darin Adler. Buffer the resource in NetworkResourceLoader instead of SynchronousNetworkLoaderClient. This is in preparation for bug 134560 where we will be supporting JS and CSS resource buffering that uses AsynchronousNetworkLoaderClient. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::NetworkResourceLoader): (WebKit::NetworkResourceLoader::didReceiveBuffer): (WebKit::NetworkResourceLoader::didFinishLoading): * NetworkProcess/NetworkResourceLoader.h: (WebKit::NetworkResourceLoader::bufferedData): * NetworkProcess/SynchronousNetworkLoaderClient.cpp: (WebKit::SynchronousNetworkLoaderClient::didReceiveBuffer): (WebKit::SynchronousNetworkLoaderClient::didFinishLoading): (WebKit::SynchronousNetworkLoaderClient::didFail): (WebKit::SynchronousNetworkLoaderClient::sendDelayedReply): * NetworkProcess/SynchronousNetworkLoaderClient.h: 2014-07-09 Benjamin Poulain [iOS][WK2] subviews of the unscaled view drift out during CA animations https://bugs.webkit.org/show_bug.cgi?id=134751 Reviewed by Enrica Casucci. It is not possible to animate the WKContentView and the inverse view in such a way that the combined matrix remain the identity for every frame of the animation. This patch solves the issue by moving the unscaled view as a sibling of WKContentView instead of a child so that we do not need to update two scales simultaneously. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): (-[WKWebView _processDidExit]): (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]): Set the z scale to 1 or no coordinate transform will work with this view. (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _endAnimatedResize]): * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): Since we need to observe changes inside the animation block, the code now use KVO to observe changes of scale. (-[WKContentView cleanupInteraction]): (-[WKContentView unscaledView]): (-[WKContentView inverseScale]): (-[WKContentView observeValueForKeyPath:ofObject:change:context:]): We update the utility views as usual. The extra bits here are to deal with views coming in during an animation. If a new utility view comes in during a scaling animation, we do not want to start a new animation with the same curve to end up at the right place. To avoid any issue, we just hide the view until the animation is finished. (-[WKContentView hitTest:withEvent:]): (-[WKContentView _showTapHighlight]): (-[WKContentView _updateUnscaledView]): Deleted. 2014-07-09 Tim Horton Use IOSurface ViewSnapshots everywhere on Mac, remove JPEG encoding path https://bugs.webkit.org/show_bug.cgi?id=134773 Reviewed by Anders Carlsson. * UIProcess/API/mac/WKView.mm: (-[WKView _takeViewSnapshot]): * UIProcess/mac/ViewSnapshotStore.h: * UIProcess/mac/ViewSnapshotStore.mm: (WebKit::ViewSnapshotStore::ViewSnapshotStore): (WebKit::ViewSnapshotStore::~ViewSnapshotStore): (WebKit::ViewSnapshotStore::recordSnapshot): (WebKit::ViewSnapshot::clearImage): (WebKit::ViewSnapshot::asLayerContents): (WebKit::createIOSurfaceFromImage): Deleted. (WebKit::compressImageAsJPEG): Deleted. (WebKit::ViewSnapshotStore::reduceSnapshotMemoryCost): Deleted. (WebKit::ViewSnapshotStore::didCompressSnapshot): Deleted. Remove all ViewSnapshot(Store) code related to JPEG-encoded snapshots. Remove the "image" member on ViewSnapshot; Mac will always start out with an IOSurface instead. Adopt WebCore::IOSurface::createFromImage to make that happen. Add a comment noting that if a snapshot comes back empty, we should throw it away completely. 2014-07-09 Anders Carlsson RemoteLayerBackingStore::ensureBackingStore should ensure that the entire backing store gets redrawn https://bugs.webkit.org/show_bug.cgi?id=134772 Reviewed by Tim Horton. * Shared/mac/RemoteLayerBackingStore.h: (WebKit::RemoteLayerBackingStore::Buffer::operator bool): * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::ensureBackingStore): 2014-07-09 KwangHyuk Kim [EFL] Fix crash caused by invalid cursor image. https://bugs.webkit.org/show_bug.cgi?id=134663 Reviewed by Gyuyoung Kim. Remove calling of updateCursor since the custom cursor image is invalid once a mouse is out of the webview. * UIProcess/API/efl/EwkView.cpp: (EwkViewEventHandler::handleEvent): 2014-07-08 Tim Horton Remove WebBackForwardListItems when their owning page goes away https://bugs.webkit.org/show_bug.cgi?id=134709 Reviewed by Dan Bernstein. * Shared/WebBackForwardListItem.cpp: (WebKit::WebBackForwardListItem::create): (WebKit::WebBackForwardListItem::WebBackForwardListItem): * Shared/WebBackForwardListItem.h: (WebKit::WebBackForwardListItem::pageID): Add the associated PageID to the WebBackForwardListItem. * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::restoreFromState): Push the current PageID onto the WebBackForwardListItem. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::removeWebPage): Remove all of the WebBackForwardListItems from m_backForwardListItemMap when the page they are associated with is removed. (WebKit::WebProcessProxy::addBackForwardItem): Push the PageID from the WebProcess onto the WebBackForwardListItem. * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::idToHistoryItemMap): (WebKit::historyItemToIDMap): (WebKit::updateBackForwardItem): (WebKit::WebBackForwardListProxy::addItemFromUIProcess): (WebKit::WK2NotifyHistoryItemChanged): (WebKit::WebBackForwardListProxy::idForItem): (WebKit::WebBackForwardListProxy::addItem): (WebKit::WebBackForwardListProxy::goToItem): (WebKit::WebBackForwardListProxy::close): * WebProcess/WebPage/WebBackForwardListProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::restoreSession): Keep track of the PageID that back-forward items were created by. Pass the PageID along when registering WebBackForwardListItems. 2014-07-08 Tim Horton [WK2] Expose a few drawing/compositing settings on WKPreferences(Private) https://bugs.webkit.org/show_bug.cgi?id=134645 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _compositingBordersVisible]): (-[WKPreferences _setCompositingBordersVisible:]): (-[WKPreferences _compositingRepaintCountersVisible]): (-[WKPreferences _setCompositingRepaintCountersVisible:]): (-[WKPreferences _tiledScrollingIndicatorVisible]): (-[WKPreferences _setTiledScrollingIndicatorVisible:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Expose layer borders, repaint counters, and the tiled scrolling indicator on WKPreferences, as SPI. 2014-07-08 Tim Horton WKProcessPoolConfigurationPrivate's maximumProcessCount property has no effect https://bugs.webkit.org/show_bug.cgi?id=134711 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _initWithConfiguration:]): Respect the maximumProcessCount. Currently the default limit is UINT_MAX; if maximumProcessCount = 0 (the default), we'll use that limit. 2014-07-08 Adrian Perez de Castro [GTK] Move user style sheet API out of WebKitWebViewGroup https://bugs.webkit.org/show_bug.cgi?id=134551 Reviewed by Carlos Garcia Campos. * PlatformGTK.cmake: Include the new source files in the build. * UIProcess/API/C/gtk/WKView.cpp: (WKViewCreate): Adapt to the additional webkitWebViewBaseCreateWebPage() parameter. * UIProcess/API/gtk/WebKitUserContent.cpp: Added. (toUserContentInjectedFrames): (toUserStyleLevel): (toStringVector): (_WebKitUserStyleSheet::_WebKitUserStyleSheet): (webkit_user_style_sheet_ref): (webkit_user_style_sheet_unref): (webkit_user_style_sheet_new): (webkitWebKitUserStyleSheetToUserStyleSheet): * UIProcess/API/gtk/WebKitUserContent.h: Added. * UIProcess/API/gtk/WebKitUserContentManager.cpp: Added. (_WebKitUserContentManagerPrivate::_WebKitUserContentManagerPrivate): (webkit_user_content_manager_class_init): (webkit_user_content_manager_new): (webkit_user_content_manager_add_style_sheet): (webkit_user_content_manager_remove_all_style_sheets): (webkitUserContentManagerGetUserContentControllerProxy): * UIProcess/API/gtk/WebKitUserContentManager.h: Added. * UIProcess/API/gtk/WebKitUserContentManagerPrivate.h: Added. * UIProcess/API/gtk/WebKitUserContentPrivate.h: Added. * UIProcess/API/gtk/WebKitWebContext.cpp: (webkitWebContextCreatePageForWebView): Add a new parameter to allow passing the WebKitUserContentManager that the web view will use. * UIProcess/API/gtk/WebKitWebContextPrivate.h: Ditto. * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewConstructed): Added handling of the "user-content-manager" property on construction. (webkitWebViewSetProperty): Added support for the "user-content-manager" property. (webkitWebViewGetProperty): Added support for the "user-content-manager" property. (webkit_web_view_class_init): Added the "user-content-manager" property definition to the WebKitWebView class. (webkit_web_view_new_with_related_view): Made related views share the same WebKitUserContentManager used by the view they are related to. (webkit_web_view_new_with_user_content_manager): Added. (webkit_web_view_get_user_content_manager): Added. * UIProcess/API/gtk/WebKitWebView.h: Add new API methods. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseCreate): Added a parameter to pass the user content manager. (webkitWebViewBaseCreateWebPage): Added a parameter to pass the user content manager. * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: Ditto. * UIProcess/API/gtk/WebKitWebViewGroup.cpp: Removed the bits related to user style sheet support from WebKitWebViewGroup. (webkit_web_view_group_set_settings): (toAPIArray): Deleted. (webkit_web_view_group_add_user_style_sheet): Deleted. (webkit_web_view_group_remove_all_user_style_sheets): Deleted. * UIProcess/API/gtk/WebKitWebViewGroup.h: Deleted the API methods for user style sheet handling. * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Added the new API functions and types, and removed the methods which are no longer available in WebKitWebViewGroup. * UIProcess/API/gtk/webkit2.h: Add the new headers. * UIProcess/UserContent/WebUserContentControllerProxy.cpp: Added methods to add and remove user style sheets, alike those used for user scripts. (WebKit::WebUserContentControllerProxy::addProcess): (WebKit::WebUserContentControllerProxy::addUserStyleSheet): (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets): * UIProcess/UserContent/WebUserContentControllerProxy.h: Ditto. * UIProcess/gtk/WebInspectorProxyGtk.cpp: (WebKit::WebInspectorProxy::platformCreateInspectorPage): Adapt to the additional webkitWebViewBaseCreateWebPage() parameter. * WebProcess/UserContent/WebUserContentController.cpp: Added methods to add and remove user style sheets, alike those used for user scripts. (WebKit::WebUserContentController::addUserStyleSheets): (WebKit::WebUserContentController::removeAllUserStyleSheets): * WebProcess/UserContent/WebUserContentController.h: Ditto. * WebProcess/UserContent/WebUserContentController.messages.in: Ditto. 2014-07-08 Zan Dobersek [GTK] Guard uses of RedirectedXCompositeWindow in WebKitWebViewBase with PLATFORM(X11) https://bugs.webkit.org/show_bug.cgi?id=133871 Reviewed by Martin Robinson. Guard uses of the RedirectedXCompositeWindow object in WebKitWebViewBase with the PLATFORM(X11) build guard. This is required to properly support building the GTK port only for the Wayland target. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseConstructed): (webkitWebViewRenderAcceleratedCompositingResults): (resizeWebKitWebViewBaseFromAllocation): (webkitWebViewBaseUpdatePreferences): (webkitWebViewBaseCreateWebPage): 2014-07-07 Tim Horton Turn on accelerated drawing for WebKit2 by default https://bugs.webkit.org/show_bug.cgi?id=134708 Reviewed by Simon Fraser. * Shared/WebPreferencesDefinitions.h: Make Mac match iOS, in that accelerated drawing is on by default. 2014-07-07 Timothy Horton Don't leak _WKRemoteObjectRegistry in WKBrowsingContextController https://bugs.webkit.org/show_bug.cgi?id=134703 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKBrowsingContextController.mm: (-[WKBrowsingContextController _remoteObjectRegistry]): Adoption is important!! 2014-07-07 Simon Fraser [UI-side compositing] Support reflections on custom layers like video https://bugs.webkit.org/show_bug.cgi?id=134701 Reviewed by Tim Horton. For video reflections, we have to support cloning of PlatformCALayerRemoteCustom in the web process. Do so by implementing PlatformCALayerRemoteCustom::clone(), which does the right gyrations to get AVPlayerLayers cloned, then makes a new PlatformCALayerRemoteCustom to wrap the new layer. This ends up getting its own context hosting ID, allowing the clone to show in the UI process. Attempt to do the same for WebGL, but turn it off because it breaks. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::drawInContext): * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode): Unconditionally encode/decode the hostingContextID. It will be 0 for most layers. (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode): (WebKit::RemoteLayerTreeTransaction::description): * UIProcess/ios/RemoteLayerTreeHostIOS.mm: (WebKit::RemoteLayerTreeHost::createLayer): * UIProcess/mac/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::createLayer): * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::create): Creation with a custom PlatformLayer* always creates a PlatformCALayerRemoteCustom. (WebKit::PlatformCALayerRemote::clone): Factor some code. (WebKit::PlatformCALayerRemote::updateClonedLayerProperties): (WebKit::PlatformCALayerRemote::recursiveBuildTransaction): * WebProcess/WebPage/mac/PlatformCALayerRemote.h: * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h: * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm: (WebKit::PlatformCALayerRemoteCustom::create): (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom): (WebKit::PlatformCALayerRemoteCustom::clone): Clone by making an instance of the correct type of platform layer when possible, then wrapping a PlatformCALayerRemoteCustom around it. (WebKit::PlatformCALayerRemoteCustom::contents): (WebKit::PlatformCALayerRemoteCustom::setContents): * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm: (WebKit::RemoteLayerTreeContext::layerWasCreated): (WebKit::RemoteLayerTreeContext::layerWillBeDestroyed): 2014-07-07 Simon Fraser [UI-side compositing] Crash when starting a filter transition on a reflected layer https://bugs.webkit.org/show_bug.cgi?id=134694 Reviewed by Tim Horton. When cloned layers had animations, we would fire two animationDidStart callbacks, but the second would pass an empty animationKey string to the web process, resulting in a crash. Fix by not blindly copying all layer properties when cloning PlatformCALayerRemotes, since the clone would include addedAnimations, and then get the same animations added on top by the caller. Also protect against an empty animation key in the animationDidStart callback. * UIProcess/mac/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::animationDidStart): * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::PlatformCALayerRemote): (WebKit::PlatformCALayerRemote::clone): Don't copy all the properties; copy them manually as PlatformCALayerMac does. Only copy the big things if they don't have their default values. (WebKit::PlatformCALayerRemote::copyFiltersFrom): Need an implementation of this for clone() to call. 2014-07-07 Tim Horton Nearly everything in the UIProcess "leaks" when WKWebView is torn down https://bugs.webkit.org/show_bug.cgi?id=134699 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): Adoption is important! 2014-07-07 Enrica Casucci REGRESSION(iOS WK2): arrow keys movements don't work. https://bugs.webkit.org/show_bug.cgi?id=134561 Reviewed by Benjamin Poulain. This change add the implementations for cursor movement selectors. It also provides a mechanism to ensure that every selection change in WebKit is reflected in UIKit so that it can update the autocorrection data. This way we ensure that the autocorraction state is consistent even when selection changes are originated by JavaScript. WebPageProxy::editorStateChanged now notifies the page client when the selection is about to change as well as when it actually changed. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::editorStateChanged): * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::selectionWillChange): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cut:]): Removed incorrect calls to textWillChange and textDidChange. (-[WKContentView paste:]): (-[WKContentView _moveUp:withHistory:]): (-[WKContentView _moveDown:withHistory:]): (-[WKContentView _moveLeft:withHistory:]): (-[WKContentView _moveRight:withHistory:]): (-[WKContentView _moveToStartOfWord:withHistory:]): (-[WKContentView _moveToStartOfParagraph:withHistory:]): (-[WKContentView _moveToStartOfLine:withHistory:]): (-[WKContentView _moveToStartOfDocument:withHistory:]): (-[WKContentView _moveToEndOfWord:withHistory:]): (-[WKContentView _moveToEndOfParagraph:withHistory:]): (-[WKContentView _moveToEndOfLine:withHistory:]): (-[WKContentView _moveToEndOfDocument:withHistory:]): (-[WKContentView _selectionWillChange]): (-[WKContentView _selectionChanged]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::notifySelectionWillChange): 2014-07-07 Anders Carlsson Add SPI for saving and restoring a WKWebView's _WKSessionState https://bugs.webkit.org/show_bug.cgi?id=134693 Reviewed by Dan Bernstein. * UIProcess/API/C/WKPage.cpp: (WKPageRestoreFromSessionState): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _sessionState]): (-[WKWebView _restoreFromSessionStateData:]): (-[WKWebView _restoreFromSessionState:]): (-[WKWebView _restoreSessionState:andNavigate:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/Cocoa/_WKSessionState.mm: (-[_WKSessionState _initWithSessionState:]): * UIProcess/API/Cocoa/_WKSessionStateInternal.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::restoreFromSessionState): * UIProcess/WebPageProxy.h: 2014-07-07 Anders Carlsson Add a stubbed out _WKSessionState class https://bugs.webkit.org/show_bug.cgi?id=134690 Reviewed by Geoffrey Garen. * UIProcess/API/Cocoa/_WKSessionState.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h. * UIProcess/API/Cocoa/_WKSessionState.mm: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h. (-[_WKSessionState initWithData:]): (-[_WKSessionState data]): * UIProcess/API/Cocoa/_WKSessionStateInternal.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h. * UIProcess/Cocoa/SessionStateCoding.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h. * UIProcess/Cocoa/SessionStateCoding.mm: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h. (WebKit::encodeSessionState): (WebKit::decodeSessionState): * UIProcess/LegacySessionStateCoding.h: * WebKit2.xcodeproj/project.pbxproj: 2014-07-07 Anders Carlsson Some of the WKPreferences (API) property getters read like questions https://bugs.webkit.org/show_bug.cgi?id=134678 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKPreferences.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences javaScriptIsEnabled]): (-[WKPreferences javaIsEnabled]): (-[WKPreferences plugInsAreEnabled]): (-[WKPreferences isJavaScriptEnabled]): Deleted. (-[WKPreferences isJavaEnabled]): Deleted. (-[WKPreferences arePlugInsEnabled]): Deleted. 2014-07-07 Brady Eidson ServicesOverlayController menus show up in the wrong place. and https://bugs.webkit.org/show_bug.cgi?id=134684 Reviewed by Tim Horton. * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged): Handle cases where the telephone number is in a subframe. (WebKit::ServicesOverlayController::handleClick): The click point is always in main frame document coordinates, so convert it to window coordinates using the main frame’s FrameView. 2014-07-07 Dan Bernstein [Cocoa] Assertion failure in NavigationState::LoaderClient::didStartProvisionalLoadForFrame (navigationID) when navigating through the page cache https://bugs.webkit.org/show_bug.cgi?id=134682 Reviewed by Tim Horton. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::LoaderClient::didStartProvisionalLoadForFrame): Replaced the assertion with a FIXME. (WebKit::NavigationState::LoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame): Ditto. (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame): Ditto. (WebKit::NavigationState::LoaderClient::didCommitLoadForFrame): Ditto. (WebKit::NavigationState::LoaderClient::didFinishDocumentLoadForFrame): Ditto. (WebKit::NavigationState::LoaderClient::didFinishLoadForFrame): Ditto. (WebKit::NavigationState::LoaderClient::didFailLoadWithErrorForFrame): Ditto. 2014-07-07 KwangHyuk Kim [EFL] Fix cursor artifacts on naver map site. https://bugs.webkit.org/show_bug.cgi?id=134649 Reviewed by Gyuyoung Kim. Old evas cursor and ecore x cursor are reset before new cursor is applied. * UIProcess/API/efl/EwkView.cpp: (EwkView::updateCursor): 2014-07-06 Benjamin Poulain [iOS][WK2] The tap highlight ID is not invalidated when a long press ends https://bugs.webkit.org/show_bug.cgi?id=134660 Reviewed by Darin Adler. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _cancelInteraction]): (-[WKContentView _finishInteraction]): (cancelPotentialTapIfNecessary): I messed that up in r170600. I only accounted for the web process being too fast. If the web process is too slow, _cancelInteraction or _finishInteraction happen before _didGetTapHighlightForRequest:, and we also need to nuke the tap highlight. 2014-07-06 Tim Horton [WK2] Don't support dynamically enabling the RemoteLayerTree debug indicator https://bugs.webkit.org/show_bug.cgi?id=134644 Reviewed by Darin Adler. * UIProcess/DrawingAreaProxy.h: (WebKit::DrawingAreaProxy::setShouldShowDebugIndicator): Deleted. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::preferencesDidChange): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy): (WebKit::RemoteLayerTreeDrawingAreaProxy::initializeDebugIndicator): (WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator): Deleted. The indicator depends on the live layer tree commits coming in, including layer creation, so it can't be turned on after the root layer is created. Even a refresh is insufficient to get it working; the debug indicator really needs to exist from the first commit. So, don't even attempt to dynamically enable the indicator; create it at RemoteLayerTreeDrawingAreaProxy construction time if the pref is enabled. 2014-07-06 Yoav Weiss Turn on img@sizes compile flag https://bugs.webkit.org/show_bug.cgi?id=134634 Reviewed by Benjamin Poulain. * Configurations/FeatureDefines.xcconfig: Moved compile flag to alphabetical order. 2014-07-06 Brady Eidson Speculative fix for: NetworkProcess sometimes hangs under copyDefaultCredentialForProtectionSpace https://bugs.webkit.org/show_bug.cgi?id=134666 Reviewed by Tim Horton. * Shared/mac/SecItemRequestData.cpp: (WebKit::SecItemRequestData::encode): Encode whether or not the query dictionary exists. (WebKit::SecItemRequestData::decode): Only fail when query dictionary fails to decode if we expect one. * UIProcess/mac/SecItemShimProxy.cpp: (WebKit::SecItemShimProxy::secItemRequest): If the request is of type Invalid, log an error message asking for a bug, and respond with an "invalid parameter" error. 2014-07-06 Antti Koivisto Don't throttle layer flushes when the main resource is a GIF https://bugs.webkit.org/show_bug.cgi?id=134650 Reviewed by Simon Fraser. * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::adjustLayerFlushThrottling): 2014-07-04 Rohit Kumar [EFL][WK2]Fix build break in EFL WK2 https://bugs.webkit.org/show_bug.cgi?id=134629 Unreviewed build fix. * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp: (WebKit::CoordinatedDrawingArea::scheduleCompositingLayerFlushImmediately): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h: 2014-07-04 Dan Bernstein [Cocoa] -[WKWebView _reload] is unused https://bugs.webkit.org/show_bug.cgi?id=134638 Reviewed by Sam Weinig. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _reload]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2014-07-04 Tim Horton [WK2] Take TopContentInset into account when sending dictionary lookup point to PluginView https://bugs.webkit.org/show_bug.cgi?id=134624 Reviewed by Sam Weinig. * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::performDictionaryLookupAtLocation): Perform the same coordinate conversion we use for mouse events, which happens to take the top content inset into account. 2014-07-04 Philippe Normand Unreviewed, GTK WK2 build fix after r170787. * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::scheduleCompositingLayerFlushImmediately): * WebProcess/WebPage/DrawingAreaImpl.h: 2014-07-04 Zan Dobersek Unreviewed. Reverting the bad changes introduced in r170795. * Platform/IPC/ArgumentDecoder.cpp: (IPC::ArgumentDecoder::decode): Deleted. * Platform/IPC/ArgumentDecoder.h: * Platform/IPC/ArgumentEncoder.cpp: (IPC::ArgumentEncoder::encode): Deleted. * Platform/IPC/ArgumentEncoder.h: 2014-07-04 Zan Dobersek Unreviewed. Fixing the build for ports on 64-bit Linux. Add IPC encoding and decoding overloads for the long long type, needed after r170755 started encoding and decoding long long variables in FormDataElement. * Platform/IPC/ArgumentDecoder.cpp: (IPC::ArgumentDecoder::decode): * Platform/IPC/ArgumentDecoder.h: * Platform/IPC/ArgumentEncoder.cpp: (IPC::ArgumentEncoder::encode): * Platform/IPC/ArgumentEncoder.h: 2014-07-04 Timothy Horton [iOS][WK2] Black web view after un-suspending process https://bugs.webkit.org/show_bug.cgi?id=134623 Reviewed by Simon Fraser. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::viewStateDidChange): Add an argument to viewStateDidChange that allows callers (-[WKContentView _applicationWillEnterForeground:]) to force us to wait for a synchronous reply from the Web process after performing a view state change. (WebKit::WebPageProxy::dispatchViewStateChange): Move the has-been-in-window-and-now-is-newly-in-window check into dispatchViewStateChange. Adjust the logic surrounding going into/out of window by factoring out the IsInWindow-did-change check, for clarity. * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView _applicationWillEnterForeground:]): As previously mentioned, wait for a reply when foregrounding. * WebProcess/WebPage/DrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately): (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush): (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange): Make sure to schedule a commit immediately if the UI process is waiting for a reply. Previously we assumed that a commit would be scheduled anyway because we would have to reparent the layer tree, but that doesn't happen in the suspension-without-unparenting case. Also, we want to skip all throttling in this case. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlushImmediately): 2014-07-03 Gavin Barraclough Should not take background task assertion for NetworkProcess https://bugs.webkit.org/show_bug.cgi?id=134622 Reviewed by Tim Horton. When the WebContent wants to complete a task in the background we take a process assertion on the child process, and also need to prevent the UI process from suspending. However for the NetworkProcess we always just hold a process assertion, and don't want this to interfere with UIApp suspension. * Platform/IPC/mac/ConnectionMac.mm: (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog): - ProcessAssertion -> ProcessAndUIAssertion * UIProcess/ProcessAssertion.cpp: (WebKit::ProcessAssertion::ProcessAssertion): - assignment -> initializer list. (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion): (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion): (WebKit::ProcessAndUIAssertion::setState): - added no-op implementation. (WebKit::ProcessAssertion::~ProcessAssertion): Deleted. * UIProcess/ProcessAssertion.h: - removed ~ProcessAssertion, added ProcessAndUIAssertion class. * UIProcess/ProcessThrottler.cpp: (WebKit::ProcessThrottler::didConnnectToProcess): - ProcessAssertion -> ProcessAndUIAssertion * UIProcess/ProcessThrottler.h: - ProcessAssertion -> ProcessAndUIAssertion * UIProcess/ios/ProcessAssertionIOS.mm: (WebKit::ProcessAssertion::ProcessAssertion): - assignment -> initializer list. - moved code to manage WKProcessAssertionBackgroundTaskManager (WebKit::ProcessAssertion::setState): - moved code to manage WKProcessAssertionBackgroundTaskManager (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion): (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion): (WebKit::ProcessAndUIAssertion::setState): - moved code to manage WKProcessAssertionBackgroundTaskManager from ProcessAssertion. (WebKit::ProcessAssertion::~ProcessAssertion): Deleted. - delete - moved code to manage WKProcessAssertionBackgroundTaskManager 2014-07-03 Simon Fraser Clean up Brady's mess on iOS. * Platform/mac/StringUtilities.h: * Platform/mac/StringUtilities.mm: 2014-07-03 Simon Fraser [iOS WK2] Compositing layers draw outside page bounds https://bugs.webkit.org/show_bug.cgi?id=134619 Reviewed by Benjamin Poulain. With the new rubber-banding behavior, we no longer have the root content layer clipping all the web layers, but this resulted in web layers which were moved outside the viewport by CSS transforms not being clipped. Fix by adding a clipping layer inside the scroll view, above _rootContentView. This layer normally has the same bounds as the content, but when rubber-banding or pinching, it takes the union of the content bounds and the rect used for fixed positioning. To make scrolling work as expected in this scenario, when it has non-zero offset, it has to compensate by setting its bounds origin. The bounds of the clipping layer are updated on scrolling/zooming, and when the layer commit tells us that the content size changed. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _updateScrollViewBackground]): * UIProcess/ios/WKContentView.mm: (-[WKContentView initWithFrame:context:configuration:webView:]): (-[WKContentView updateFixedClippingView:]): (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): (-[WKContentView _didCommitLayerTree:]): 2014-07-03 Brady Eidson When showing the selection menu, include menu options for all selected phone numbers. , , and https://bugs.webkit.org/show_bug.cgi?id=134613 Reviewed by Tim Horton. Move some telephone number menu logic from WebKitSystemInterface here. Also provide utility to get just the one menu item relevant to a telephone number. * Platform/mac/MenuUtilities.h: * Platform/mac/MenuUtilities.mm: Added. (WebKit::menuItemForTelephoneNumber): (WebKit::menuItemsForTelephoneNumber): * Platform/mac/StringUtilities.h: * Platform/mac/StringUtilities.mm: (WebKit::formattedPhoneNumberString): Return a localized formatted phone number. Add a member to track the selected phone numbers: * Shared/ContextMenuContextData.h: (WebKit::ContextMenuContextData::ContextMenuContextData): (WebKit::ContextMenuContextData::selectedTelephoneNumbers): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::setupServicesMenu): Also add menu items for each phone number that is in the selection. Switch away from a WKSI method, and remove a lot of unneeded forward declarations and soft linking: * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::showTelephoneNumberMenu): (WebKit::WebPageProxy::showSelectionServiceMenu): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::ServicesOverlayController::drawSelectionHighlight): (WebKit::ServicesOverlayController::handleClick): Pass the phone numbers along. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::handleSelectionServiceClick): Pass the phone numbers along. 2014-07-03 Gavin Barraclough WKProcessAssertionBackgroundTaskManager should clear member if task expires https://bugs.webkit.org/show_bug.cgi?id=134618 Reviewed by Anders Carlson. Failure to do so results in a warning, and could result in us erroneously completing a background task too soon. * UIProcess/ios/ProcessAssertionIOS.mm: (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]): - remove local variable, _backgroundTask = UIBackgroundTaskInvalid; 2014-07-03 Joseph Pecoraro Unreviewed iOS build fix for r170774. Remove some unnecessary WTF::moves on iOS: error: static_assert failed "T is not an lvalue reference; move() is unnecessary." * WebProcess/WebPage/EventDispatcher.cpp: (WebKit::EventDispatcher::getQueuedTouchEventsForPage): (WebKit::EventDispatcher::touchEvent): 2014-07-03 Anders Carlsson Try to fix the iOS build. Add WebPageProxyCocoa.mm for code shared between iOS and OS X. Put the recent searches save/restore code there. * UIProcess/Cocoa/WebPageProxyCocoa.mm: Added. (WebKit::autosaveKey): (WebKit::WebPageProxy::saveRecentSearches): (WebKit::WebPageProxy::loadRecentSearches): * UIProcess/mac/WebPageProxyMac.mm: * WebKit2.xcodeproj/project.pbxproj: 2014-07-03 Dan Bernstein The UI process needs to track the number of HTTP subresource loads in progress (or at least whether there are any) https://bugs.webkit.org/show_bug.cgi?id=134615 Reviewed by Anders Carlsson. Added a _networkRequestsInProgress boolean property to WKWebView. * UIProcess/API/Cocoa/WKBrowsingContextController.mm: Added no-op overrides of new PageLoadStateObserver member functions. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _networkRequestsInProgress]): New getter that gets this state from the PageLoadState. * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new property. * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::willChangeNetworkRequestsInProgress):: Override this new PageLoadState::Observer member function by sending the appropriate KVO change message to the WKWebView. (WebKit::NavigationState::didChangeNetworkRequestsInProgress): Ditto. * UIProcess/PageLoadState.cpp: (WebKit::PageLoadState::commitChanges): Check for changes to networkRequestsInProgress and call the observers if needed. (WebKit::PageLoadState::reset): Reset networkRequestsInProgress in the uncommitted state. (WebKit::PageLoadState::setNetworkRequestsInProgress): Set networkRequestsInProgress in the uncommitted state. * UIProcess/PageLoadState.h: (WebKit::PageLoadState::networkRequestsInProgress): Added this getter. (WebKit::PageLoadState::Data::Data): Initialize new networkRequestsInProgress member. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setNetworkRequestsInProgress): Added. Updates the PageLoadState. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Added SetNetworkRequestsInProgress message. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest): Call WebPage::addResourceRequest. (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading): Call WebPage::removeResourceRequest. (WebKit::WebFrameLoaderClient::dispatchDidFailLoading): Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::addResourceRequest): Added. If the new request is for an HTTP-family URL, add its identifier to the set of network resourece request identifiers. If the set was previously empty, send the WebPageProxy a message. (WebKit::WebPage::removeResourceRequest): Added. Remove the identifier from the set. If it becomes empty, send the WebPageProxy a message. * WebProcess/WebPage/WebPage.h: 2014-07-03 Anders Carlsson Remove two unused functions https://bugs.webkit.org/show_bug.cgi?id=134614 Reviewed by Andreas Kling. * UIProcess/LegacySessionStateCoding.h: * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::encodeLegacySessionHistoryEntryData): Deleted. (WebKit::decodeLegacySessionHistoryEntryData): Deleted. 2014-07-03 Daniel Bates Add WTF::move() https://bugs.webkit.org/show_bug.cgi?id=134500 Rubber-stamped by Anders Carlsson. Substitute WTF::move() for std::move(). * DatabaseProcess/DatabaseProcess.cpp: * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm: * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: * NetworkProcess/NetworkConnectionToWebProcess.cpp: * Platform/IPC/ArgumentCoders.h: * Platform/IPC/ArgumentDecoder.cpp: * Platform/IPC/Connection.cpp: * Platform/IPC/Connection.h: [...] 2014-07-03 Benjamin Poulain [iOS][WK2] Fix small bugs of dynamicViewportSizeUpdate that were causing inaccuracies in the computed target https://bugs.webkit.org/show_bug.cgi?id=134582 Reviewed by Tim Horton. This patch fixes two small bugs that were causing "jumpiness" on animated resize: 1) The new scale was less accurate than the target scale, making the WebProcess force a worse scale on the content. 2) The code putting back the rects in view was ignoring the obscured insets, constraining the scroll position more than it should be. The first problem was cause by a series of rounding issues accumulating to the fact that "scale != targetScale" was almost never true. The first issue is that the unobscured content size was stored in integer coordinates. Because of that, it was impossible to determine accurately how much content is in the view. The outcome was that visibleHorizontalFraction was very inaccurate compared to what the UIProcess computed. Another issue affecting the scale is that scaleAfterViewportWidthChange was computing the widthToKeepInView on floating point. Since ARM64 does all those computations on doubles in the UIProcess, the value would be quite different from the received targetScale. Finally, the code uses withinEpsilon() instead of a strict equality to reduce the effect of rounding errors. For the second issue, the problem was that I was bounding the exposed rect to the page bounds. It is completely valid to have an exposed rect outside the page bounds, that area is just under the obscured insets. On the other hand, the unobscured rect needs to be within the bounds as we do not want to rotate to a rubberbanding position. The fix is simply to put the right rect into bounds, and the horizontal/vertical adjustement applies on both rects. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::scaleAfterViewportWidthChange): (WebKit::WebPage::dynamicViewportSizeUpdate): (WebKit::WebPage::updateVisibleContentRects): 2014-07-03 Anders Carlsson Fix build. * UIProcess/mac/WebPageProxyMac.mm: 2014-07-03 Anders Carlsson Get rid of WebPageProxyCF.cpp https://bugs.webkit.org/show_bug.cgi?id=134609 Reviewed by Dan Bernstein. * UIProcess/cf/WebPageProxyCF.cpp: Removed. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::autosaveKey): (WebKit::WebPageProxy::saveRecentSearches): (WebKit::WebPageProxy::loadRecentSearches): * WebKit2.xcodeproj/project.pbxproj: 2014-07-03 Tim Horton [WK2] Revise the flat find indicator secondary highlight shadows https://bugs.webkit.org/show_bug.cgi?id=134607 Reviewed by Brady Eidson. * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::drawRect): Bring back the secondary highlight shadow, with new constants. 2014-07-03 Tim Horton [iOS][WK2] Sometimes the swipe snapshot stays up too long https://bugs.webkit.org/show_bug.cgi?id=134506 Reviewed by Simon Fraser. Implement a transaction callback mechanism. The UI process can register a callback at any point, generally immediately after sending a message to the Web process. It will then send another message (in-order) with the callback ID to the Web process, which will put it into the next transaction (scheduling a new one if needed). When the transaction comes back to the UI process, the callbacks are performed. This ensures that the callback fires alongside a commit that includes the results of whatever messages were sent before it was registered. For now, all callbacks are fired just before committing layer changes, but it's possible future patches will want post-commit callbacks. Make use of this to remove the ViewGestureControllerIOS snapshots at the right time. * Shared/mac/RemoteLayerTreeTransaction.h: (WebKit::RemoteLayerTreeTransaction::callbackIDs): (WebKit::RemoteLayerTreeTransaction::setCallbackIDs): * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::encode): (WebKit::RemoteLayerTreeTransaction::decode): Add a vector of callback IDs to the transaction; encode and decode as appropriate. * UIProcess/DrawingAreaProxy.h: (WebKit::DrawingAreaProxy::dispatchAfterEnsuringDrawing): (WebKit::DrawingAreaProxy::lastVisibleTransactionID): Deleted. * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy): (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing): Add dispatchAfterEnsuringDrawing, which takes a function. When a callback is added, we send the callback ID to the Web process via the AddTransactionCallbackID message. Perform callbacks listed in the incoming transaction's vector of callback IDs. * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::addTransactionCallbackID): * WebProcess/WebPage/DrawingArea.messages.in: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::flushLayers): (WebKit::RemoteLayerTreeDrawingArea::addTransactionCallbackID): Keep track of the pending callback IDs on the drawing area, and move them into the transaction. We schedule a flush when installing a transaction callback on the premise that sometimes the action (goToBackForwardListItem in the swipe case) might have already occurred and been committed by the time the Web process receives AddTransactionCallbackID, so we need to cause another commit to send the callbacks across. If said commit is still pending, this is a no-op. * UIProcess/ios/ViewGestureControllerIOS.mm: (allViewGestureControllers): (WebKit::ViewGestureController::ViewGestureController): (WebKit::ViewGestureController::~ViewGestureController): (WebKit::ViewGestureController::endSwipeGesture): (WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree): (WebKit::ViewGestureController::setRenderTreeSize): * UIProcess/mac/ViewGestureController.h: Keep a side-map of page IDs to ViewGestureControllers, so that we can safely get back to our ViewGestureController from the callback. When the callback fires, if it succeeded, set m_shouldRemoveSnapshotWhenTargetRenderTreeSizeHit, so that the commit (which is about to occur immediately after the callback returns) which calls setRenderTreeSize will (perhaps) remove the snapshot. If it failed, we remove the snapshot immediately, as this usually happens if the Web process crashed. 2014-07-03 Brady Eidson Followup to "rects sent to ServicesOverlayController are wrong" https://bugs.webkit.org/show_bug.cgi?id=134568 Rubberstamped by Tim Horton. * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::ServicesOverlayController::drawSelectionHighlight): Don’t check to see if the proposed rect intersects the dirty rect. We always need to include all rects that form the selection when creating the DDHighlight. 2014-07-03 Tim Horton [WK2] RemoteLayerTreeDrawingAreaProxy re-checks a preference every commit for no reason https://bugs.webkit.org/show_bug.cgi?id=134586 Reviewed by Benjamin Poulain. * UIProcess/DrawingAreaProxy.h: (WebKit::DrawingAreaProxy::setShouldShowDebugIndicator): (WebKit::DrawingAreaProxy::showDebugIndicator): Deleted. (WebKit::DrawingAreaProxy::isShowingDebugIndicator): Remove this, nobody is using it. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::preferencesDidChange): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy): (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): (WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator): (WebKit::RemoteLayerTreeDrawingAreaProxy::showDebugIndicator): Deleted. Check the debug indicator pref at construction time, and update the state when it changes. Checking it every commit was surprisingly expensive. 2014-07-03 Antti Koivisto Ensure frame creation messages get through to UI process https://bugs.webkit.org/show_bug.cgi?id=134591 Reviewed by Anders Carlsson. If we are middle of handling a synchronous message from UI process a frame creation message back gets delayed. The subsequent synchronous DecidePolicyForNavigationAction message expects that the frame creation message has arrived first and fails. * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::createWithCoreMainFrame): (WebKit::WebFrame::createSubframe): Send messages with DispatchMessageEvenWhenWaitingForSyncReply so they always go through in order. 2014-07-03 Anders Carlsson Get rid of DecoderAdapter and EncoderAdapter https://bugs.webkit.org/show_bug.cgi?id=134598 Reviewed by Andreas Kling. * CMakeLists.txt: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebPage/DecoderAdapter.cpp: Removed. * WebProcess/WebPage/DecoderAdapter.h: Removed. * WebProcess/WebPage/EncoderAdapter.cpp: Removed. * WebProcess/WebPage/EncoderAdapter.h: Removed. * WebProcess/WebPage/WebPage.cpp: 2014-07-02 Anders Carlsson Stop using EncoderAdapter/DecoderAdapter for FormData https://bugs.webkit.org/show_bug.cgi?id=134571 Reviewed by Andreas Kling. * Shared/Network/NetworkResourceLoadParameters.cpp: (WebKit::NetworkResourceLoadParameters::encode): (WebKit::NetworkResourceLoadParameters::decode): 2014-07-03 Brady Eidson Selection rects sent to ServicesOverlayController are wrong. and https://bugs.webkit.org/show_bug.cgi?id=134568 Reviewed by Darin Adler (and Tim Horton and Ryosuke Niwa). * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::selectionRectsDidChange): Also pass the GapRects to the ServicesOverlayController. * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebPage/ServicesOverlayController.h: * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::expandForGap): (WebKit::compactRectsWithGapRects): Combine 3+ rects down to exactly 3 rects, then expand them based on GapRects. (WebKit::ServicesOverlayController::selectionRectsDidChange): Call compactRectsWithGapRects, then reverse the list. (WebKit::ServicesOverlayController::drawSelectionHighlight): Tell data detectors to flip this. (WebKit::ServicesOverlayController::drawTelephoneNumberHighlight): Tell data detectors to flip this. (WebKit::ServicesOverlayController::drawCurrentHighlight): No need to flip this anymore. 2014-07-03 Brady Eidson Possible crash in IconDatabase in WebCore::IconDatabase::dispatchDidRemoveAllIconsOnMainThread and https://bugs.webkit.org/show_bug.cgi?id=134517 Reviewed by Eric Carlson. * UIProcess/WebContext.cpp: (WebKit::WebContext::~WebContext): Instead of directly deref’ing the WebIconDatabase, ask it to deref itself when appropriate. * UIProcess/WebIconDatabase.cpp: (WebKit::WebIconDatabase::WebIconDatabase): (WebKit::WebIconDatabase::didClose): If this WebIconDatabase is supposed to deref itself when appropriate, do so now. (WebKit::WebIconDatabase::derefWhenAppropriate): If the WebCore::IconDatabase is still open then defer this deref. * UIProcess/WebIconDatabase.h: 2014-07-03 Carlos Garcia Campos REGRESSION(r170676): [GTK] UI process crashes when the Web Process crashes https://bugs.webkit.org/show_bug.cgi?id=134541 Reviewed by Gyuyoung Kim. It happens when attaching a new web process, because it tries to encode a null SessionState. * UIProcess/LegacySessionStateCodingNone.cpp: (WebKit::encodeLegacySessionState): Return an empty API::Data object instead of nullptr. (WebKit::encodeLegacySessionHistoryEntryData): Ditto. 2014-07-03 Carlos Garcia Campos REGRESSION(r170743): [GTK] [EFL] Build broken. https://bugs.webkit.org/show_bug.cgi?id=134585 Reviewed by Philippe Normand. Add ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC) guards where needed. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::initializePlugin): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::createPlugin): 2014-07-02 Benjamin Poulain [iOS][WK2] Make is safe/fast to use the animated resize API without resizing anything https://bugs.webkit.org/show_bug.cgi?id=134570 Reviewed by Enrica Casucci. Today, if someone calls _beginAnimatedResizeWithUpdates-_endAnimatedResize, it is always a very heavy process forcing a relayout and can cause synchronous operations. We should not force the caller of the API to maintain their own state tracking, we should do that for them. With this patch, we track everything we need for a resize and only do the heavy lifting if anything has actually changed. * UIProcess/API/Cocoa/WKWebView.mm: (activeMinimumLayoutSize): (activeMinimumLayoutSizeForMinimalUI): (activeMaximumUnobscuredSize): (activeOrientation): This code is used in both _didRelaunchProcess and _beginAnimatedResizeWithUpdates. It is moved to static functions to avoid having it in two places. (-[WKWebView _didRelaunchProcess]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): The updates now goes like this: 1) Set _isAnimatingResize to prevent the undesired side effects updateBlock() if we really need to resize. 2) Get all the original values before calling the update block. 3) Call the update block. 4a) If nothing useful for resize has changed, reset _isAnimatingResize to false. We also need to update the visible content rect because the update block may have changed something unrelated to the view size (scale, scroll position, etc). 4b) If we really need to resize, proceed as usual. (-[WKWebView _endAnimatedResize]): With the changes in _beginAnimatedResizeWithUpdates:, _isAnimatingResize is only set for real cases of animated resize, bail out early if that flag isn't set. The remaining code is unchanged, it is just not indented due to the removal of the if() branch. 2014-07-02 Roger Fong Improve handling of primary offscreen plugins. https://bugs.webkit.org/show_bug.cgi?id=134528. Reviewed by Dean Jackson. * WebProcess/Plugins/PluginView.cpp: Determine whether or not the plugin starts offscreen when the plugin is initialized. (WebKit::PluginView::initializePlugin): (WebKit::PluginView::pluginSnapshotTimerFired): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::createPlugin): Use the PluginProcessTypeNormal for offscreen plugins that are potentially primary plugins. 2014-07-02 Enrica Casucci REGRESSION(WK2): Undo does not work in text fields in Safari. https://bugs.webkit.org/show_bug.cgi?id=134572 Reviewed by Benjamin Poulain. This patch adds for iOS the same implementation we have already for OS X. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (-[WKEditCommandObjC initWithWebEditCommandProxy:]): (-[WKEditCommandObjC command]): (-[WKEditorUndoTargetObjC undoEditing:]): (-[WKEditorUndoTargetObjC redoEditing:]): (WebKit::PageClientImpl::PageClientImpl): (WebKit::PageClientImpl::registerEditCommand): (WebKit::PageClientImpl::clearAllEditCommands): (WebKit::PageClientImpl::canUndoRedo): (WebKit::PageClientImpl::executeUndoRedo): 2014-07-02 Gavin Barraclough ProcessAssertion should also prevent UIApp suspension https://bugs.webkit.org/show_bug.cgi?id=134563 Reviewed by Dan Bernstein. If the application suspends then the child processes will, too. Use beginBackgroundTaskWithName:expirationHandler: to request that the application remain runnable while waiting for background tasks to complete. * UIProcess/ProcessAssertion.cpp: (WebKit::ProcessAssertion::~ProcessAssertion): - Added destructor. * UIProcess/ProcessAssertion.h: - Added destructor. * UIProcess/ios/ProcessAssertionIOS.mm: (+[WKProcessAssertionBackgroundTaskManager shared]): - singleton WKProcessAssertionBackgroundTaskManager. (-[WKProcessAssertionBackgroundTaskManager init]): (-[WKProcessAssertionBackgroundTaskManager dealloc]): - register/remove notification handlers. (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]): - if we need to be runnable make sure we're holding a BackgroundTask, if not release it. (-[WKProcessAssertionBackgroundTaskManager _applicationDidEnterBackgroundOrWillEnterForeground:]): - detect when the app enters/leaves foreground; calls to _updateBackgroundTask. (-[WKProcessAssertionBackgroundTaskManager incrementNeedsToRunInBackgroundCount]): (-[WKProcessAssertionBackgroundTaskManager decrementNeedsToRunInBackgroundCount]): - interface to update the count; calls to _updateBackgroundTask. (WebKit::ProcessAssertion::ProcessAssertion): (WebKit::ProcessAssertion::~ProcessAssertion): - count ProcessAssertions in and out of existance. (WebKit::ProcessAssertion::setState): - count when the state changes. 2014-07-01 Mark Rowe Remove duplication in code that prepares the user agent string on Mac and iOS Reviewed by Simon Fraser. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::webKitBundleVersionString): Return the entire CFBundleVersion now that WebCore handles formatting it. (WebKit::WebPageProxy::standardUserAgent): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::webKitBundleVersionString): Ditto. (WebKit::WebPageProxy::standardUserAgent): 2014-06-28 Oliver Hunt Restrict network process sandbox https://bugs.webkit.org/show_bug.cgi?id=134360 Reviewed by Sam Weinig. Add more restrictions to the network process sandbox. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): Always use the cache directory provided in the initialization parameters, and make sure we consume the cookie directory extension. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Make the sandbox profile much more restrictive. * Shared/Network/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode): (WebKit::NetworkProcessCreationParameters::decode): * Shared/Network/NetworkProcessCreationParameters.h: The network process now requires an extension to access its cookie storage. * Shared/mac/SandboxUtilities.cpp: (WebKit::pathForProcessContainer): * Shared/mac/SandboxUtilities.h: We need to be able to get hold of our container so that we can get the correct cookie storage directory. * UIProcess/WebContext.cpp: (WebKit::WebContext::ensureNetworkProcess): We have to pass in the an extension for the cookie storage directory when initalising the network process * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformDefaultCookieStorageDirectory): Make sure we provide the correct location on IOS * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): Consume the cookie storage extension 2014-07-02 Csaba Osztrogonác URTBF after r170725. * CMakeLists.txt: Removed Shared/LegacySessionState.cpp. 2014-07-02 Csaba Osztrogonác URTBF after r170719 for !CF platforms. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::sessionStateData): Deleted. (WebKit::WebPageProxy::restoreFromSessionStateData): Deleted. 2014-07-02 Mark Rowe iOS should use shared code to determine the system marketing version Reviewed by Simon Fraser. * Shared/ios/ChildProcessIOS.mm: Update #import. * Shared/mac/ChildProcessMac.mm: Ditto. 2014-07-02 Anders Carlsson Rip out more dead code https://bugs.webkit.org/show_bug.cgi?id=134562 Reviewed by Andreas Kling. * Shared/LegacySessionState.cpp: Removed. * Shared/LegacySessionState.h: Removed. * Shared/WebBackForwardListItem.cpp: (WebKit::WebBackForwardListItem::WebBackForwardListItem): Deleted. (WebKit::WebBackForwardListItem::backForwardData): Deleted. (WebKit::WebBackForwardListItem::setBackForwardData): Deleted. (WebKit::WebBackForwardListItem::encode): Deleted. (WebKit::WebBackForwardListItem::decode): Deleted. * Shared/WebBackForwardListItem.h: (WebKit::WebBackForwardListItem::create): Deleted. (WebKit::WebBackForwardListItem::setOriginalURL): Deleted. (WebKit::WebBackForwardListItem::setURL): Deleted. (WebKit::WebBackForwardListItem::setTitle): Deleted. * UIProcess/WebPageProxy.cpp: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: 2014-07-02 Anders Carlsson RestoreSession should take a vector of BackForwardListItemStates https://bugs.webkit.org/show_bug.cgi?id=134558 Reviewed by Tim Horton. * Scripts/webkit2/messages.py: (struct_or_class): (headers_for_type): * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::itemStates): * UIProcess/WebBackForwardList.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::restoreFromSessionState): (WebKit::WebPageProxy::creationParameters): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): (WebKit::WebPage::restoreSession): (WebKit::WebPage::restoreSessionAndNavigateToCurrentItem): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2014-07-02 Anders Carlsson Store the back forward list item id inside BackForwardListItemState https://bugs.webkit.org/show_bug.cgi?id=134557 Reviewed by Tim Horton. * Shared/SessionState.cpp: (WebKit::BackForwardListItemState::encode): (WebKit::BackForwardListItemState::decode): * Shared/SessionState.h: * Shared/WebBackForwardListItem.cpp: (WebKit::WebBackForwardListItem::create): (WebKit::WebBackForwardListItem::WebBackForwardListItem): (WebKit::WebBackForwardListItem::encode): * Shared/WebBackForwardListItem.h: (WebKit::WebBackForwardListItem::itemID): * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::restoreFromState): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::addBackForwardItem): 2014-07-02 Manuel Rego Casasnovas Unreviewed. EFL and GTK build fix after r170716. * UIProcess/LegacySessionStateCodingNone.cpp: (WebKit::decodeLegacySessionState): Update method signature. 2014-07-02 Anders Carlsson Begin ripping out the old session state code https://bugs.webkit.org/show_bug.cgi?id=134556 Reviewed by Andreas Kling. * UIProcess/WebBackForwardList.h: * UIProcess/WebPageProxy.h: * UIProcess/cf/WebBackForwardListCF.cpp: Removed. * UIProcess/cf/WebPageProxyCF.cpp: (WebKit::WebPageProxy::sessionStateData): Deleted. (WebKit::WebPageProxy::restoreFromSessionStateData): Deleted. * WebKit2.xcodeproj/project.pbxproj: 2014-07-02 Anders Carlsson Use legacy state coding directly in WKWebView https://bugs.webkit.org/show_bug.cgi?id=134553 Reviewed by Dan Bernstein. * UIProcess/API/C/WKPage.cpp: (WKPageRestoreFromSessionState): * UIProcess/API/C/WKSessionStateRef.cpp: (WKSessionStateCreateFromData): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _sessionStateData]): (-[WKWebView _sessionState]): (-[WKWebView _restoreFromSessionStateData:]): (-[WKWebView _restoreFromSessionState:]): (releaseNSData): Deleted. * UIProcess/LegacySessionStateCoding.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::restoreFromSessionState): (WebKit::WebPageProxy::restoreFromState): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::decodeLegacySessionState): 2014-07-02 Anders Carlsson Add -[WKWebView _sessionStateData] and -[WKWebView _restoreFromSessionStateData:] https://bugs.webkit.org/show_bug.cgi?id=134549 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _sessionState]): (-[WKWebView _sessionStateData]): (-[WKWebView _restoreFromSessionState:]): (-[WKWebView _restoreFromSessionStateData:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2014-07-02 Carlos Garcia Campos [GTK] WebKitVersion.h should be shared between UI and Web Process APIs https://bugs.webkit.org/show_bug.cgi?id=134538 Reviewed by Martin Robinson. To be able to check current version from web extensions too. * UIProcess/API/gtk/WebKitVersion.h.in: Allow to include WebKitVersion.h also from webkit-web-extension.h. * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h: Include WebKitVersion.h. 2014-07-02 Carlos Garcia Campos [GTK] WebKitWebView::create should receive information about the navigation action https://bugs.webkit.org/show_bug.cgi?id=133680 Reviewed by Martin Robinson. Add WebKitNavigationAction boxed type representing a navigation action to be passed as parameter of WebKitWebView::create signal. In the future it could be also for the WebKitNavigationPolicyDecision class. The class contains information about a navigation action like the navigation type, the request, the mouse button and key modifiers and whether it was started by a user gesture. This information is needed to be able to implement a proper popup blocker. Since all that information is not provided by the C API, we have switched the UI client to use a custom client derived from API::UIClient. This also avoids a lot of toAPI -> toImpl unneeded conversions. * PlatformGTK.cmake: Add new files to compilation. * UIProcess/API/gtk/WebKitHitTestResult.cpp: (webkitHitTestResultCreate): Use a WebHitTestResult::Data const reference instead of a pointer to a WebHitTestResult. (webkitHitTestResultCompare): Ditto. * UIProcess/API/gtk/WebKitHitTestResultPrivate.h: * UIProcess/API/gtk/WebKitNavigationAction.cpp: Added. (webkitNavigationActionCreate): Create a WebKitNavigationAction for the given ResourceRequest and NavigationActionData. (webkit_navigation_action_copy): (webkit_navigation_action_free): (webkit_navigation_action_get_navigation_type): (webkit_navigation_action_get_mouse_button): (webkit_navigation_action_get_modifiers): (webkit_navigation_action_get_request): (webkit_navigation_action_is_user_gesture): * UIProcess/API/gtk/WebKitNavigationAction.h: Added. * UIProcess/API/gtk/WebKitNavigationActionPrivate.h: Added. * UIProcess/API/gtk/WebKitNavigationPolicyDecision.h: * UIProcess/API/gtk/WebKitPrivate.cpp: (toGdkModifiers): (toWebKitNavigationType): (toWebKitMouseButton): * UIProcess/API/gtk/WebKitPrivate.h: * UIProcess/API/gtk/WebKitUIClient.cpp: (UIClient::UIClient): Implement the UIClient using a custom class. (attachUIClientToView): Set the UIClient directly to the WebPageProxy. (createNewPage): Deleted. (showPage): Deleted. (closePage): Deleted. (runJavaScriptAlert): Deleted. (runJavaScriptConfirm): Deleted. (runJavaScriptPrompt): Deleted. (toolbarsAreVisible): Deleted. (setToolbarsAreVisible): Deleted. (menuBarIsVisible): Deleted. (setMenuBarIsVisible): Deleted. (statusBarIsVisible): Deleted. (setStatusBarIsVisible): Deleted. (isResizable): Deleted. (setIsResizable): Deleted. (getWindowFrame): Deleted. (setWindowFrame): Deleted. (mouseDidMoveOverElement): Deleted. (printFrame): Deleted. (runOpenPanel): Deleted. (decidePolicyForGeolocationPermissionRequest): Deleted. (runModal): Deleted. * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewCreate): Add WebKitNavigationAction parameter. (webkit_web_view_class_init): Add WebKitNavigationAction paramter to CREATE signal. (webkitWebViewCreateNewPage): Add WebKitNavigationAction parameter and pass it to the signal callbacks. (webkitWebViewMouseTargetChanged): Use a WebHitTestResult::Data const reference. (webkitWebViewPopulateContextMenu): Ditto. * UIProcess/API/gtk/WebKitWebView.h: * UIProcess/API/gtk/WebKitWebViewPrivate.h: * UIProcess/API/gtk/WebKitWindowProperties.cpp: (webkitWindowPropertiesUpdateFromWebWindowFeatures): Use a WebCore::WindowFeatures const reference. * UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h: * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section. * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols. * UIProcess/API/gtk/webkit2.h: Include WebKitNavigationAction.h. 2014-07-01 KwangHyuk Kim [EFL] Fix occurrence of two cursors on WK2 EFL. https://bugs.webkit.org/show_bug.cgi?id=134436 Reviewed by Anders Carlsson. ecore_x_window_cursor is released when ecore_evas_object_cursor should be shown in order to avoid occurrence of two cursors. * UIProcess/API/efl/EwkView.cpp: (EwkView::updateCursor): 2014-07-01 Gyuyoung Kim Fix build break on EFL and GTK ports since r170683 https://bugs.webkit.org/show_bug.cgi?id=134536 Unreviewed, build fix. * CMakeLists.txt: 2014-07-01 Dean Jackson Make LogsPageMessagesToSystemConsoleEnabled a global debug preference https://bugs.webkit.org/show_bug.cgi?id=134534 Reviewed by Joseph Pecoraro. * Shared/WebPreferencesDefinitions.h: 2014-07-01 Tim Horton Handle invalid data more gracefully. Reviewed by Anders Carlsson. * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::decodeFormData): (WebKit::decodeBackForwardTreeNode): 2014-07-01 Mark Rowe Add a missing return statement in WKPageCopySessionState. Reviewed by Anders Carlsson. * UIProcess/API/C/WKPage.cpp: (WKPageCopySessionState): 2014-07-01 Anders Carlsson Don't encode/decode the snapshot UUID https://bugs.webkit.org/show_bug.cgi?id=134532 Reviewed by Sam Weinig. * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::encodeSessionHistory): (WebKit::decodeSessionHistoryEntry): 2014-07-01 Commit Queue Unreviewed, rolling out r170608. https://bugs.webkit.org/show_bug.cgi?id=134533 Safari keeps crashing on device due to sandbox violation. (Requested by enrica on #webkit). Reverted changeset: "Restrict network process sandbox" https://bugs.webkit.org/show_bug.cgi?id=134360 http://trac.webkit.org/changeset/170608 2014-07-01 Pratik Solanki Encode/decode CFURLRequestRefs when USE(CFNETWORK) is enabled https://bugs.webkit.org/show_bug.cgi?id=134454 Reviewed by Andreas Kling. Use new helper methods to serialize/deserialize CFURLRequestRef directly so we can avoid creating NSURLRequest. * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder::encodePlatformData): (IPC::ArgumentCoder::decodePlatformData): 2014-07-01 Benjamin Poulain [iOS][WK2] Fix a race between the short tap and long tap highlight https://bugs.webkit.org/show_bug.cgi?id=134530 Reviewed by Enrica Casucci. There was a potential race of event that can theoretically cause WKContentViewInteraction to call [WKContentView _showTapHighlight] after all interactions have been cancelled. The race would be like this: 1) On a short tap, _singleTapRecognized: is called, a tap highlight ID is defined and _potentialTapInProgress is set to YES. 2) For some reason, the gesture is cancelled. The method _singleTapDidReset is called, setting _potentialTapInProgress but leaving the tap highlight ID as valid. 3) The UIProcess receives the tap highlight information from the WebProcess, _didGetTapHighlightForRequest: has a valid ID, _potentialTapInProgress is false -> the highlight is shown right away as if a long tap was in progress. The missing piece that causes this is _singleTapDidReset: must also invalidate the tap highlight ID. This is done in the new static function cancelPotentialTapIfNecessary(). Just invalidating the ID would create another race: 1) Short tap gesture recognizer starts. 2) The long press recognizer starts before (1) is commited. 3) The long press recognizers sets up its own tap highlight ID. 4) The short tap gesture recognizer resets, erasing the tap highlight ID defined in (3). To avoid this, the long press gesture recognizers immediately cancels any potential tap in progress. If _singleTapDidReset: is called before (3), this does nothing. If the reset is called after (3), _singleTapDidReset does nothing. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _highlightLongPressRecognized:]): (cancelPotentialTapIfNecessary): (-[WKContentView _singleTapDidReset:]): 2014-07-01 Anders Carlsson Add ABI hacks to allow WKPageRef to use WKSessionStateRef https://bugs.webkit.org/show_bug.cgi?id=134529 Reviewed by Sam Weinig. * UIProcess/API/APISessionState.h: Add a sessionState() getter. * UIProcess/API/C/WKPage.cpp: (WKPageCopySessionState): Add a hack where we return a WKSessionStateRef if the least significant bit of the context pointer is 1, and a WKDataRef otherwise. (WKPageRestoreFromSessionState): Handle both WKDataRef and WKSessionStateref. * UIProcess/API/C/WKPage.h: Use WKTypeRefs for state saving and restoration. * UIProcess/API/C/WKSessionStateRef.cpp: (WKSessionStateCopyData): Add helper function. 2014-07-01 Anders Carlsson WKPageRestoreFromSessionState should use the new session state restore code path https://bugs.webkit.org/show_bug.cgi?id=134526 Reviewed by Tim Horton. * UIProcess/API/C/WKPage.cpp: (WKPageRestoreFromSessionState): Use the new code path. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::restoreFromState): Only restore the back-forward state if we have a back-forward list. * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::encodeSessionHistory): Save the original URL string as well. (WebKit::decodeV1SessionHistory): If we don't have a current index, set it to Nullopt instead of 0. 2014-07-01 Gyuyoung Kim Unreviewed. EFL and GTK build fix since r170654. * UIProcess/LegacySessionStateCodingNone.cpp: Add a dummy encodeLegacySessionState(const SessionState&). (WebKit::encodeLegacySessionState): 2014-07-01 Dan Bernstein Crash in WebDocumentLoader::setNavigationID https://bugs.webkit.org/show_bug.cgi?id=134520 Reviewed by Anders Carlsson. * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::didReceivePolicyDecision): Null-check the policy document loader. 2014-07-01 Dan Bernstein Build fix. * UIProcess/API/APILoaderClient.h: (API::LoaderClient::didDestroyNavigation): 2014-07-01 Anders Carlsson Use the new legacy session state coding in WKPageCopySessionState https://bugs.webkit.org/show_bug.cgi?id=134516 Reviewed by Tim Horton. * UIProcess/API/C/WKPage.cpp: (WKPageCopySessionState): Call encodeLegacySessionState. * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::encodeSessionHistoryEntryData): Use leakPtr() so we won't attempt to double-free the buffer. (WebKit::createDictionary): Fix a typo. (WebKit::encodeLegacySessionState): Don't encode the provisional URL if it's empty. 2014-07-01 Chris Fleizach AX: [iOS WebKit2] Support for Speak selection https://bugs.webkit.org/show_bug.cgi?id=134512 Reviewed by Darin Adler. Implement a method that Speak Selection can use to retrieve the selected content. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView accessibilityRetrieveSpeakSelectionContent]): 2014-07-01 Anders Carlsson Update the highest back-forward list item ID in the other WebBackForwardListItem constructor https://bugs.webkit.org/show_bug.cgi?id=134515 Reviewed by Tim Horton. * Shared/WebBackForwardListItem.cpp: (WebKit::WebBackForwardListItem::WebBackForwardListItem): 2014-07-01 Brady Eidson Fix ServicesOverlayController teardown and https://bugs.webkit.org/show_bug.cgi?id=134510 Reviewed by Mark Rowe. * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::ServicesOverlayController::~ServicesOverlayController): Flipped logic on null-checking the overlay. 2014-07-01 Sam Weinig [Cocoa][Mac] WKWebView should automatically set topContentInset when beneath a toolbar https://bugs.webkit.org/show_bug.cgi?id=134496 Reviewed by Beth Dakin. - Adds _automaticallyAdjustsContentInsets SPI to both WKView and WKWebView. - Defaults _automaticallyAdjustsContentInsets to NO for WKView to keep legacy clients working. - Defaults _automaticallyAdjustsContentInsets to YES for WKWebView. * UIProcess/API/Cocoa/WKViewPrivate.h: Add _automaticallyAdjustsContentInsets SPI. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): Default _automaticallyAdjustsContentInsets to YES for WKWebView. (-[WKWebView _setTopContentInset:]): (-[WKWebView _topContentInset]): Change to forward to the WKView, since we now do coalescing and caching there. (-[WKWebView _setAutomaticallyAdjustsContentInsets:]): (-[WKWebView _automaticallyAdjustsContentInsets]): Forward to the WKView. * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add _automaticallyAdjustsContentInsets SPI. * UIProcess/API/mac/WKView.mm: (-[WKView renewGState]): Ensure the contentInset is updated when the view changes, as its relative location to the toolbar may have changed. (-[WKView addWindowObserversForWindow:]): (-[WKView removeWindowObservers]): (-[WKView observeValueForKeyPath:ofObject:change:context:]): Add observers for the contentLayoutRect and titlebarAppearsTransparent properties on the window. If either of them change, we need to recalculate the content inset. (-[WKView _updateContentInsetsIfAutomatic]): If _automaticallyAdjustsContentInsets is YES, follow the same rules as AppKit in setting the top content inset. Like AppKit this is only done when: - The window's style mask has the NSFullSizeContentViewWindowMask bit. - The window does not have titlebarAppearsTransparent set. - And we are not in an enclosing NSScrollView. (-[WKView _setTopContentInset:]): (-[WKView _topContentInset]): Coalesce setting the topContentInset to avoid a visual lag when resizing the window that was caused by us sending multiple topContentInsets to the WebContentProcess per runloop cycle. The reason for the lag was that at the time we observe the contentLayoutRect changing, our view may not yet be in its final position yet, so the inset will be temporarily wrong. When the view is finally positioned correctly, we will get a renewGState, at which point we will again calculate the inset, which now will be correct. Since these both happen in the same runloop iteration, we can just defer sending the inset to the WebContentProcess. (-[WKView _setAutomaticallyAdjustsContentInsets:]): (-[WKView _automaticallyAdjustsContentInsets]): Add the new SPI. 2014-07-01 Anders Carlsson Add a function for restoring page state given a SessionState object https://bugs.webkit.org/show_bug.cgi?id=134509 Reviewed by Tim Horton. * Shared/WebBackForwardListItem.h: (WebKit::WebBackForwardListItem::itemState): * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::saveState): * UIProcess/WebBackForwardList.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::saveState): * UIProcess/WebPageProxy.h: 2014-07-01 Dan Bernstein [Cocoa] Navigation parameter in navigation delegate messages is nil for navigations started by the Web Content process https://bugs.webkit.org/show_bug.cgi?id=134482 Reviewed by Tim Horton. * UIProcess/API/APILoaderClient.h: (API::LoaderClient::didDestroyNavigation): New client function, called when a navigation ID is not going to be used anymore. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _restoreFromSessionState:]): If restoring triggered a navigation, create a WKNavigation for its ID. * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::createLoadRequestNavigation): Removed FIXME, because we now remove navigations from the map in LoaderClient::didDestroyNavigation. (WebKit::NavigationState::createBackForwardNavigation): Ditto. (WebKit::NavigationState::createReloadNavigation): Ditto. (WebKit::NavigationState::createLoadDataNavigation): Ditto. (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction): If we are only getting a navigation ID now, create a WKNavigation for it. Also changed to create the NSURLRequest lazily. (WebKit::NavigationState::LoaderClient::didStartProvisionalLoadForFrame): Assert that navigationID is not zero and that it maps to an existing WKNavigation. (WebKit::NavigationState::LoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame): Ditto. (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame): Ditto. (WebKit::NavigationState::LoaderClient::didCommitLoadForFrame): Ditto. (WebKit::NavigationState::LoaderClient::didFinishDocumentLoadForFrame): Ditto. (WebKit::NavigationState::LoaderClient::didFinishLoadForFrame): Ditto. (WebKit::NavigationState::LoaderClient::didFailLoadWithErrorForFrame): Ditto. (WebKit::NavigationState::LoaderClient::didDestroyNavigation): Override the new client function to remove the navigation from the map. (WebKit::NavigationState::LoaderClient::processDidCrash): Clear the navigations map. * UIProcess/WebFrameListenerProxy.cpp: (WebKit::WebFrameListenerProxy::WebFrameListenerProxy): Initialize new m_navigationID member variable. (WebKit::WebFrameListenerProxy::receivedPolicyDecision): Pass the navigation ID to WebFrame::receivedPolicyDecision. * UIProcess/WebFrameListenerProxy.h: (WebKit::WebFrameListenerProxy::navigationID): Added this accessor. (WebKit::WebFrameListenerProxy::setNavigationID): Ditto. * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::receivedPolicyDecision): Added navigationID parameter, which is passed along to the WebPageProxy. * UIProcess/WebFrameProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedPolicyDecision): Added navigationID parameter, which is passed along in the message to the Web Content process. (WebKit::WebPageProxy::restoreFromSessionStateData): Changed to return a navigation ID of 0. (WebKit::WebPageProxy::restoreFromState): Changed to return a navigation ID if one was started. (WebKit::WebPageProxy::didDestroyNavigation): Added. Calls the new client function. (WebKit::WebPageProxy::decidePolicyForNavigationAction): Added navigationID and newNavigationID parameters. If a main-frame navigation doesn’t already have an ID, assign it a new ID and return it in the newNavigationID parmeter as well as setting it on the listener for the asynchronous case. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Added navigationID and newNavigationID parameters. * UIProcess/cf/WebPageProxyCF.cpp: (WebKit::WebPageProxy::restoreFromSessionStateData): Changed to return a navigation ID if one was started. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): Updated for additional parameter. (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Send the navigation ID to the UI process, get the new navigation ID from the reply, and set it on the document loader. * WebProcess/WebPage/WebDocumentLoader.cpp: (WebKit::WebDocumentLoader::detachFromFrame): Override to let the UI process know that the navigation ID will not be used anymore. * WebProcess/WebPage/WebDocumentLoader.h: * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::didReceivePolicyDecision): Added navigationID parameter, set it on the document loader. (WebKit::WebFrame::documentLoaderDetached): Pass the message along to the UI process. * WebProcess/WebPage/WebFrame.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didReceivePolicyDecision): Pass new navigationID parameter along. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Added navigationID parameter. 2014-07-01 Anders Carlsson Fix build. * WebKit2.xcodeproj/project.pbxproj: 2014-07-01 Anders Carlsson Temporarily encode and decode the snapshot UUID https://bugs.webkit.org/show_bug.cgi?id=134507 Reviewed by Tim Horton. * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::encodeSessionHistory): (WebKit::decodeSessionHistoryEntry): (WebKit::decodeSessionHistoryEntries): 2014-07-01 Anders Carlsson Implement encodeSessionHistoryEntryData https://bugs.webkit.org/show_bug.cgi?id=134505 Reviewed by Tim Horton. * UIProcess/API/C/WKPage.cpp: (WKPageCopySessionState): Add back a missing null check for the filter pointer. * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::encodeSessionHistoryEntryData): 2014-07-01 Simon Fraser [UI-side compositing] Bad spinner on news.google.com: animations need to be ordered https://bugs.webkit.org/show_bug.cgi?id=134504 Reviewed by Tim Horton. The layer's addedAnimations property needs to maintain order, since the order in which transforms are applied is important. * Shared/mac/RemoteLayerTreeTransaction.h: Use a Vector> for addedAnimations. * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::dumpChangedLayers): * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: (WebKit::PlatformCAAnimationRemote::updateLayerAnimations): * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::addAnimationForKey): If this is a new entry, we can just append to addedAnimations, otherwise we have to find the existing one and update its properties. (WebKit::PlatformCALayerRemote::removeAnimationForKey): Do linear search to find the animation to remove (this list will normally be short). 2014-07-01 Anders Carlsson Add a encodeLegacySessionState function https://bugs.webkit.org/show_bug.cgi?id=134502 Reviewed by Tim Horton. * UIProcess/LegacySessionStateCoding.h: * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::encodeSessionHistoryEntryData): (WebKit::encodeLegacySessionHistoryEntryData): (WebKit::createDictionary): (WebKit::encodeSessionHistory): (WebKit::encodeLegacySessionState): 2014-07-01 Alexey Proskuryakov [Cocoa] WebProcess doesn't follow localization of UI process when run as a service https://bugs.webkit.org/show_bug.cgi?id=133126 Patch by Alexey Proskuryakov. Reviewed by Tim Horton. * Configurations/WebContentService.Development.xcconfig: * Configurations/WebContentService.xcconfig: Figure out which of the two keys to use. CFBundleAllowMixedLocalizations was a workaround before we got CFBundleFollowParentLocalization, and these cannot be used together. * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::connectToService): Set up XPC bootstrap for CFBundle to use. * WebKit2.xcodeproj/project.pbxproj: Added a script that applies the key to Info.plist. * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info-OSX.plist: * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info-iOS.plist: * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist: * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist: Removed CFBundleAllowMixedLocalizations, we now add it programmatically. 2014-07-01 Alex Christensen [iOS] Unreviewed build fix after r170640. * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::selectedTelephoneNumberRangesChanged): (WebKit::WebEditorClient::selectionRectsDidChange): * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebPage/WebPage.h: Add ifdefs to make everything compile and link. 2014-07-01 Anders Carlsson Add WKSessionStateGetTypeID https://bugs.webkit.org/show_bug.cgi?id=134499 Reviewed by Tim Horton. * UIProcess/API/C/WKSessionStateRef.cpp: (WKSessionStateGetTypeID): * UIProcess/API/C/WKSessionStateRef.h: 2014-07-01 Daniel Bates Remove unnecessary calls to std::move() https://bugs.webkit.org/show_bug.cgi?id=134493 Reviewed by Anders Carlsson. * Shared/ShareableResource.cpp: (WebKit::ShareableResource::Handle::tryWrapInCFData): * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::certificateInfo): Return a WebCore::CertificateInfo instead of const WebCore::CertificateInfo& to avoid returning a dangling reference to a local variable. Also, remove the unnecessary calls to std::move() as the compiler will invoke the move constructor for WebCore::CertificateInfo on return from the function. * WebProcess/WebPage/WebFrame.h: 2014-07-01 Anders Carlsson Add a BackForwardListItemState struct and put the snapshot UUID there https://bugs.webkit.org/show_bug.cgi?id=134497 Reviewed by Sam Weinig. * Shared/SessionState.cpp: (WebKit::PageState::encode): (WebKit::PageState::decode): (WebKit::BackForwardListItemState::encode): (WebKit::BackForwardListItemState::decode): * Shared/SessionState.h: * Shared/WebBackForwardListItem.cpp: (WebKit::WebBackForwardListItem::create): (WebKit::WebBackForwardListItem::WebBackForwardListItem): (WebKit::WebBackForwardListItem::backForwardData): (WebKit::WebBackForwardListItem::setBackForwardData): (WebKit::WebBackForwardListItem::encode): * Shared/WebBackForwardListItem.h: (WebKit::WebBackForwardListItem::setPageState): (WebKit::WebBackForwardListItem::setOriginalURL): (WebKit::WebBackForwardListItem::originalURL): (WebKit::WebBackForwardListItem::setURL): (WebKit::WebBackForwardListItem::url): (WebKit::WebBackForwardListItem::setTitle): (WebKit::WebBackForwardListItem::title): (WebKit::WebBackForwardListItem::setSnapshotUUID): (WebKit::WebBackForwardListItem::snapshotUUID): * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::restoreFromState): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::addBackForwardItem): * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::decodeSessionHistoryEntries): 2014-07-01 Yongjun Zhang Add encodeInteger and decodeInteger for remote object encoder and decoder. https://bugs.webkit.org/show_bug.cgi?id=134453 In 64bit system, encodeInteger/decodeInteger is by default mapped into encodeInt64/decodeInt64. For 32bit system, they are mapped to encodeInt32/decodeInt32. However, since we don't have encodeInt32/decodeInt32 implementation in WKRemoteObjectCoder, we could hit crash in 32bit systems. Reviewed by Sam Weinig. * Shared/API/Cocoa/WKRemoteObjectCoder.mm: (-[WKRemoteObjectEncoder encodeInteger:forKey:]): Instead of creating a new number type UInt32, use encodeInt64 for encoding NSInteger. (-[WKRemoteObjectDecoder decodeIntegerForKey:]): 2014-06-30 Anders Carlsson Use an std::function for filtering session state data https://bugs.webkit.org/show_bug.cgi?id=134481 Reviewed by Sam Weinig. * UIProcess/API/C/WKPage.cpp: (WKPageCopySessionState): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _sessionState]): * UIProcess/WebBackForwardList.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::sessionStateData): * UIProcess/WebPageProxy.h: * UIProcess/cf/WebBackForwardListCF.cpp: (WebKit::WebBackForwardList::createCFDictionaryRepresentation): * UIProcess/cf/WebPageProxyCF.cpp: (WebKit::WebPageProxy::sessionStateData): 2014-07-01 Rohit Kumar Clean up the WebKit build from unused parameter warning in Webkit2/UIProcess module https://bugs.webkit.org/show_bug.cgi?id=134294 Reviewed by Darin Adler. * UIProcess/API/APIUIClient.h: (API::UIClient::reachedApplicationCacheOriginQuota): 2014-07-01 Brady Eidson Followup for: Combine the Telephone and Selection overlay controllers, updating UI behavior. https://bugs.webkit.org/show_bug.cgi?id=134461 Rubberstamped by Tim Horton. * WebProcess/WebPage/mac/ServicesOverlayController.mm: Include the correct constant. 2014-07-01 Brady Eidson Build fix. Forgot to commit locally before pushing. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::servicesOverlayController): s/this/*this/ 2014-07-01 Brady Eidson Combine the Telephone and Selection overlay controllers, updating UI behavior. https://bugs.webkit.org/show_bug.cgi?id=134461 Reviewed by Tim Horton. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::selectedTelephoneNumberRangesChanged): (WebKit::WebEditorClient::selectionRectsDidChange): Remove the separate Selection overlay controller: * WebProcess/WebPage/SelectionOverlayController.cpp: Removed. * WebProcess/WebPage/ServicesOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/SelectionOverlayController.h. (WebKit::ServicesOverlayController::create): * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm: Removed. Remove the separate TelephoneNumber overlay controller: * WebProcess/WebPage/TelephoneNumberOverlayController.cpp: Removed. * WebProcess/WebPage/TelephoneNumberOverlayController.h: Removed. * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm: Removed. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::servicesOverlayController): (WebKit::WebPage::telephoneNumberOverlayController): Deleted. (WebKit::WebPage::selectionOverlayController): Deleted. (WebKit::WebPage::didChangeScrollOffsetForFrame): Deleted. * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::serviceControlsEnabled): Deleted. ServicesOverlayController is a combination of the old TelephoneNumber and Selection overlay controllers. A lot of code duplication is resolved, and things are generally easier to follow. It enforces displaying a telephone number highlight if precisely one telephone number is selected, or the selection highlight if the selection contains more than a single phone number * WebProcess/WebPage/mac/ServicesOverlayController.mm: Added. (WebKit::textQuadsToBoundingRectForRange): (WebKit::ServicesOverlayController::ServicesOverlayController): (WebKit::ServicesOverlayController::destroyOverlay): (WebKit::ServicesOverlayController::pageOverlayDestroyed): (WebKit::ServicesOverlayController::willMoveToWebPage): (WebKit::ServicesOverlayController::didMoveToWebPage): (WebKit::ServicesOverlayController::createOverlayIfNeeded): (WebKit::ServicesOverlayController::selectionRectsDidChange): (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged): (WebKit::ServicesOverlayController::clearHighlightState): (WebKit::ServicesOverlayController::drawRect): (WebKit::ServicesOverlayController::drawSelectionHighlight): (WebKit::ServicesOverlayController::drawTelephoneNumberHighlight): (WebKit::ServicesOverlayController::drawCurrentHighlight): (WebKit::ServicesOverlayController::mouseEvent): (WebKit::ServicesOverlayController::handleClick): 2014-07-01 Zan Dobersek [WK2] IPC messages' arguments() method returns const std::tuple<> copies https://bugs.webkit.org/show_bug.cgi?id=131975 Reviewed by Darin Adler. The arguments() method of the different IPC message objects should return a const reference to the std::tuple<> containing the arguments, instead of a const value. This avoids copying the std::tuple<> every time the arguments are encoded, and works best with the ArgumentEncoder::encode>(const std::tuple<...>&) template instantiation. The unit test baselines are updated accordingly. * Scripts/webkit2/LegacyMessages-expected.h: (Messages::WebPage::LoadURL::arguments): (Messages::WebPage::LoadSomething::arguments): (Messages::WebPage::TouchEvent::arguments): (Messages::WebPage::AddEvent::arguments): (Messages::WebPage::LoadSomethingElse::arguments): (Messages::WebPage::DidReceivePolicyDecision::arguments): (Messages::WebPage::Close::arguments): (Messages::WebPage::PreferencesDidChange::arguments): (Messages::WebPage::SendDoubleAndFloat::arguments): (Messages::WebPage::SendInts::arguments): (Messages::WebPage::CreatePlugin::arguments): (Messages::WebPage::RunJavaScriptAlert::arguments): (Messages::WebPage::GetPlugins::arguments): (Messages::WebPage::GetPluginProcessConnection::arguments): (Messages::WebPage::TestMultipleAttributes::arguments): (Messages::WebPage::TestParameterAttributes::arguments): (Messages::WebPage::TemplateTest::arguments): (Messages::WebPage::SetVideoLayerID::arguments): (Messages::WebPage::DidCreateWebProcessConnection::arguments): (Messages::WebPage::InterpretKeyEvent::arguments): (Messages::WebPage::DeprecatedOperation::arguments): (Messages::WebPage::ExperimentalOperation::arguments): * Scripts/webkit2/Messages-expected.h: (Messages::WebPage::LoadURL::arguments): (Messages::WebPage::LoadSomething::arguments): (Messages::WebPage::TouchEvent::arguments): (Messages::WebPage::AddEvent::arguments): (Messages::WebPage::LoadSomethingElse::arguments): (Messages::WebPage::DidReceivePolicyDecision::arguments): (Messages::WebPage::Close::arguments): (Messages::WebPage::PreferencesDidChange::arguments): (Messages::WebPage::SendDoubleAndFloat::arguments): (Messages::WebPage::SendInts::arguments): (Messages::WebPage::CreatePlugin::arguments): (Messages::WebPage::RunJavaScriptAlert::arguments): (Messages::WebPage::GetPlugins::arguments): (Messages::WebPage::GetPluginProcessConnection::arguments): (Messages::WebPage::TestMultipleAttributes::arguments): (Messages::WebPage::TestParameterAttributes::arguments): (Messages::WebPage::TemplateTest::arguments): (Messages::WebPage::SetVideoLayerID::arguments): (Messages::WebPage::DidCreateWebProcessConnection::arguments): (Messages::WebPage::InterpretKeyEvent::arguments): (Messages::WebPage::DeprecatedOperation::arguments): (Messages::WebPage::ExperimentalOperation::arguments): * Scripts/webkit2/MessagesSuperclass-expected.h: (Messages::WebPage::LoadURL::arguments): * Scripts/webkit2/messages.py: (message_to_struct_declaration): 2014-07-01 Evan Nemerson [GTK] Annotations for WebResource.get_data produce wrong signature in Vala binding https://bugs.webkit.org/show_bug.cgi?id=134476 Reviewed by Carlos Garcia Campos. * UIProcess/API/gtk/WebKitWebResource.cpp: Add array length and element-type annotations to return value of webkit_web_resource_get_data_finish(). 2014-07-01 Gyuyoung Kim [WK2] Can not convert ‘sessionState.WebKit::SessionState::provisionalURL’ from ‘WebCore::URL’ to ‘bool’ https://bugs.webkit.org/show_bug.cgi?id=134487 Rubber-stamped by Carlos Garcia Campos. * UIProcess/WebPageProxy.cpp: Use isNull(). (WebKit::WebPageProxy::restoreFromState): 2014-07-01 Gyuyoung Kim Fix build break on EFL and GTK ports since r170611 and r170614 https://bugs.webkit.org/show_bug.cgi?id=134479 Reviewed by Carlos Garcia Campos. Add LegacySessionStateCodingNone.cpp in order to fix build break on EFL and GTK ports. Additionally SessionStateConversion.cpp is added to CMakeLists.txt as well. * CMakeLists.txt: * UIProcess/LegacySessionStateCoding.h: Copied from Source/WebKit2/UIProcess/mac/LegacySessionStateCoding.h. * UIProcess/LegacySessionStateCodingNone.cpp: Renamed from Source/WebKit2/UIProcess/mac/LegacySessionStateCoding.h. (WebKit::encodeLegacySessionHistoryEntryData): (WebKit::decodeLegacySessionState): (WebKit::decodeLegacySessionHistoryEntryData): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadFile): (WebKit::WebPageProxy::restoreFromState): * WebKit2.xcodeproj/project.pbxproj: 2014-06-30 Benjamin Poulain [iOS][WK2] The long press gesture recognizers should not block the pinch gesture https://bugs.webkit.org/show_bug.cgi?id=134477 Reviewed by Tim Horton. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]): 2014-06-30 Anders Carlsson Add WebPageProxy::restoreFromState https://bugs.webkit.org/show_bug.cgi?id=134480 Reviewed by Tim Horton. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::restoreFromState): * UIProcess/WebPageProxy.h: 2014-06-30 Anders Carlsson Add a function to restore a WebBackForwardList object from a BackForwardListState object https://bugs.webkit.org/show_bug.cgi?id=134478 Reviewed by Tim Horton. * UIProcess/WebBackForwardList.cpp: (WebKit::generateWebBackForwardItemID): (WebKit::WebBackForwardList::restoreFromState): * UIProcess/WebBackForwardList.h: * UIProcess/cf/WebBackForwardListCF.cpp: (WebKit::generateWebBackForwardItemID): Deleted. 2014-06-30 Anders Carlsson Change the AddBackForwardItem message to take a page state object https://bugs.webkit.org/show_bug.cgi?id=134475 Reviewed by Andreas Kling. * Scripts/webkit2/messages.py: (struct_or_class): (headers_for_type): * Shared/WebBackForwardListItem.cpp: (WebKit::WebBackForwardListItem::create): (WebKit::WebBackForwardListItem::WebBackForwardListItem): * Shared/WebBackForwardListItem.h: (WebKit::WebBackForwardListItem::setPageState): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::addBackForwardItem): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::updateBackForwardItem): 2014-06-30 Tim Horton [WK2] Add a flatter find-in-page current match indicator style https://bugs.webkit.org/show_bug.cgi?id=134434 Reviewed by Simon Fraser. * UIProcess/FindIndicator.cpp: (WebKit::findIndicatorsForTextRectsOverlap): (WebKit::FindIndicator::frameRect): (WebKit::flatHighlightColor): (WebKit::flatRimShadowColor): (WebKit::flatDropShadowColor): (WebKit::FindIndicator::draw): Add a flatter find indicator, with a bigger shadow. * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::updateFindUIAfterPageScroll): (WebKit::FindController::getFindIndicatorBitmapAndRect): (WebKit::FindController::hideFindIndicator): (WebKit::FindController::drawRect): Don't paint a shadow behind the secondary matches if we're using the new style. 2014-06-30 Benjamin Poulain [iOS][WK2] Improve double-tap-to-scroll on image documents https://bugs.webkit.org/show_bug.cgi?id=134474 Reviewed by Enrica Casucci. On image document, we were always rendering the center of the image as the origin, which broke double tap to scroll. This patch improves on this in two ways: 1) If the hit testing already got the image, only change the type to replaced (to get the right scaling behavior for images since the type is block on iOS's image document). 2) If the hit testing is outside the image, only center the axis that is not in the image. This way, we "fix" the component that is not valid, and keep the vali component. This works great for viewing comics on iPad. * WebProcess/WebPage/ViewGestureGeometryCollector.cpp: (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture): 2014-06-30 Enrica Casucci REGRESSION (WK2): Weird selection behavior on autos.yahoo.com, en.wikipedia.org. https://bugs.webkit.org/show_bug.cgi?id=134466 Reviewed by Benjamin Poulain. Avoid selecting blocks across frame boundaries and skip non-selectable blocks. If the only block we find is almost the same height as the visible area, we should not select at all. This patch also fixes the logic to compute the next block when shrinking the selection. When calculating the new range after shrinking, we should not include the block that corresponds to the current handle position. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::rangeForWebSelectionAtPosition): (WebKit::WebPage::expandedRangeFromHandle): (WebKit::WebPage::contractedRangeFromHandle): (WebKit::WebPage::updateSelectionWithTouches): 2014-06-30 Anders Carlsson WebBackForwardListItem should not store back-forward data https://bugs.webkit.org/show_bug.cgi?id=134469 Reviewed by Darin Adler. Change WebBackForwardListItem::backForwardData to encode the main frame state lazily, and change WebBackForwardListItem::setBackForwardData to decode it into the main frame state. * Shared/WebBackForwardListItem.cpp: (WebKit::WebBackForwardListItem::backForwardData): (WebKit::WebBackForwardListItem::setBackForwardData): (WebKit::WebBackForwardListItem::encode): * Shared/WebBackForwardListItem.h: (WebKit::WebBackForwardListItem::backForwardData): Deleted. * UIProcess/cf/WebBackForwardListCF.cpp: (WebKit::WebBackForwardList::createCFDictionaryRepresentation): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::restoreSession): 2014-06-30 Anders Carlsson WebBackForwardListItems should hold on to PageState objects https://bugs.webkit.org/show_bug.cgi?id=134467 Reviewed by Darin Adler. * Shared/WebBackForwardListItem.cpp: (WebKit::WebBackForwardListItem::WebBackForwardListItem): (WebKit::WebBackForwardListItem::encode): * Shared/WebBackForwardListItem.h: (WebKit::WebBackForwardListItem::setOriginalURL): (WebKit::WebBackForwardListItem::originalURL): (WebKit::WebBackForwardListItem::setURL): (WebKit::WebBackForwardListItem::url): (WebKit::WebBackForwardListItem::setTitle): (WebKit::WebBackForwardListItem::title): 2014-06-30 Benjamin Poulain Add a missing semicolon in WKContentViewInteraction * UIProcess/ios/WKContentViewInteraction.mm: (nsSizeForTapHighlightBorderRadius): I messed up this when fixing the patch on landing. 2014-06-30 Anders Carlsson Adopt the legacy session decoding inside WebPage::restoreSession for now https://bugs.webkit.org/show_bug.cgi?id=134465 Reviewed by Sam Weinig. * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::decodeLegacySessionHistoryEntryData): * UIProcess/mac/LegacySessionStateCoding.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::restoreSession): 2014-06-30 Simon Fraser [iOS WK2] Don't crash on status bar tap with overflow scroll views https://bugs.webkit.org/show_bug.cgi?id=134459 Reviewed by Tim Horton. The tiled scrolling indicator parents UIViews under CALayers, but that causes those views to miss -willMoveToWindow:nil notifications on teardown. This can leave deleted UIScrollViews in UIKit's "scroll to top" list. Fix by not making UIScrollViews in the debug layer tree host. * UIProcess/ios/RemoteLayerTreeHostIOS.mm: (WebKit::RemoteLayerTreeHost::createLayer): 2014-06-28 Oliver Hunt Restrict network process sandbox https://bugs.webkit.org/show_bug.cgi?id=134360 Reviewed by Sam Weinig. Add more restrictions to the network process sandbox. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): Always use the cache directory provided in the initialization parameters, and make sure we consume the cookie directory extension. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Make the sandbox profile much more restrictive. * Shared/Network/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode): (WebKit::NetworkProcessCreationParameters::decode): * Shared/Network/NetworkProcessCreationParameters.h: The network process now requires an extension to access its cookie storage. * Shared/mac/SandboxUtilities.cpp: (WebKit::pathForProcessContainer): * Shared/mac/SandboxUtilities.h: We need to be able to get hold of our container so that we can get the correct cookie storage directory. * UIProcess/WebContext.cpp: (WebKit::WebContext::ensureNetworkProcess): We have to pass in the an extension for the cookie storage directory when initalising the network process * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformDefaultCookieStorageDirectory): Make sure we provide the correct location on IOS * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): Consume the cookie storage extension 2014-06-30 Simon Fraser [iOS WK2] Turn off scrollsToTop on overflow UIScrollViews https://bugs.webkit.org/show_bug.cgi?id=134456 Reviewed by Tim Horton. Set scrollsToTop to NO on our UIScrollViews created for overflow scrolling, since we don't have a good strategy for when to allow it, and doing so would also require some smarts in the main UIScrollView. * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren): 2014-06-30 Enrica Casucci REGRESSION (Okemo): The contextual menu on tap and hold does not cancel the other gestures. https://bugs.webkit.org/show_bug.cgi?id=134463 Reviewed by Benjamin Poulain. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _longPressRecognized:]): 2014-06-30 Anders Carlsson Implement the last pieces of encodeFrameStateNode https://bugs.webkit.org/show_bug.cgi?id=134460 Reviewed by Andreas Kling. * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::HistoryEntryDataEncoder::operator<<): (WebKit::isValidEnum): (WebKit::encodeFormDataElement): (WebKit::encodeFormData): (WebKit::encodeFrameStateNode): 2014-06-30 Benjamin Poulain [iOS][WK2] Move tap highlight to the inverseScaleRootView https://bugs.webkit.org/show_bug.cgi?id=134424 Reviewed by Tim Horton. Enrica introduced the inverseScaleRootView that is a dynamic version of _highlightRootView. This patch moves the tap highlight from its own inverse root to inverseScaleRootView. This provides better handling of scale, better behavior on crash, and remove one extra view from the hierarchy. The code is pretty much the same, just moved around. Some of the changes: Now the code needs to handle repainting live when the view scale. To do that, _showTapHighlightXXX was split in two: -_showTapHighlight to setup the view. -_updateTapHighlight to update the view based on the current scale. Since the view updates live on scaling, we need to recompute the coordinates for each update. To do that, the _potentialTapHighlightInformation was generalized to handle all cases of highlight. Since we can no longer test for the nullity of _potentialTapHighlightInformation, a new attribute is introduced for that: _hasTapHighlightForPotentialTap. The last bit of change concern reentering the tap highlight. This becomes quite simple: 1) _isTapHighlightIDValid is updated before the animation starts so that it can be set again during an animation. 2) The animation checks the "finished" flags before removing the view from its superview to avoid breaking the new animation. * UIProcess/API/Cocoa/WKWebView.mm: (withinEpsilon): Deleted. * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): Make _updateUnscaledView conditional to scale changes, that thing isn't cheap! * UIProcess/ios/WKContentViewInteraction.h: (withinEpsilon): Move withinEpsilon() from WKContentView to use it from both classes. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): (-[WKContentView _updateUnscaledView]): (-[WKContentView _updateTapHighlight]): (-[WKContentView _showTapHighlight]): (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]): (-[WKContentView _cancelInteraction]): (-[WKContentView _finishInteraction]): (-[WKContentView _singleTapDidReset:]): (-[WKContentView _singleTapCommited:]): (-[WKContentView _showTapHighlightWithColor:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]): Deleted. 2014-06-30 Anders Carlsson Add code for encoding legacy session history entries https://bugs.webkit.org/show_bug.cgi?id=134452 Reviewed by Andreas Kling. * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::HistoryEntryDataEncoder::HistoryEntryDataEncoder): (WebKit::HistoryEntryDataEncoder::operator<<): (WebKit::HistoryEntryDataEncoder::finishEncoding): (WebKit::HistoryEntryDataEncoder::encodeArithmeticType): (WebKit::HistoryEntryDataEncoder::encodeFixedLengthData): (WebKit::HistoryEntryDataEncoder::grow): (WebKit::HistoryEntryDataEncoder::growCapacity): (WebKit::encodeFrameStateNode): (WebKit::encodeLegacySessionHistoryEntryData): (WebKit::decodeSessionHistoryEntryData): (WebKit::decodeLegacySessionHistoryEntryData): * UIProcess/mac/LegacySessionStateCoding.h: 2014-06-29 Yoav Weiss Add support for HTMLImageElement's sizes attribute https://bugs.webkit.org/show_bug.cgi?id=133620 Reviewed by Dean Jackson. Added an ENABLE_PICTURE_SIZES compile flag. * Configurations/FeatureDefines.xcconfig: 2014-06-28 Tim Horton [iOS][WK2] PDFs never load inline again after the Web process crashes https://bugs.webkit.org/show_bug.cgi?id=134432 Reviewed by Dan Bernstein. After a crash, the WebPage never gets mimeTypesWithCustomContentProviders filled back in. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): Add mimeTypesWithCustomContentProviders to WebPageCreationParameters. * UIProcess/Cocoa/WKWebViewContentProviderRegistry.h: * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm: (-[WKWebViewContentProviderRegistry addPage:]): We don't need to send the MIME types across when a page is added, because it already got them in its creation parameters. (-[WKWebViewContentProviderRegistry removePage:]): (-[WKWebViewContentProviderRegistry _mimeTypesWithCustomContentProviders]): Return a vector of all registered MIME types. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::mimeTypesWithCustomContentProviders): * UIProcess/PageClient.h: Add (iOS only for now) mimeTypesWithCustomContentProviders to PageClient. 2014-06-28 Dan Bernstein REGRESSION: WebPageProxy::attributedSubstringForCharacterRangeAsync never calls its callback function https://bugs.webkit.org/show_bug.cgi?id=134429 Reviewed by Tim Horton. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync): 2014-06-27 Simon Fraser [iOS WK2] position:fixed inside accelerated overflow:scroll is jumpy https://bugs.webkit.org/show_bug.cgi?id=134426 Reviewed by Tim Horton. After committing a new layer tree (with possibly stale position:fixed layer positions), we need the scrolling tree to update those positions based on the current scroll offset. To achieve that, implement ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange() and have it add to the cumulative delta the difference between the last committed scroll position and the current scroll position. Also make sure that ScrollingTreeOverflowScrollingNodeIOS doesn't call back to scrollViewDidScroll() when we're updating its scroll position inside a scrolling tree commit. * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::ScrollingTreeOverflowScrollingNodeIOS): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll): 2014-06-27 Antti Koivisto Flush throttling with remote layers https://bugs.webkit.org/show_bug.cgi?id=134398 Reviewed by Darin Adler. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::adjustLayerFlushThrottling): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::adjustLayerFlushThrottling): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea): (WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect): (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush): Delay layer flushes during page loading. If use interacts with the page the next flush in unthrottled even if loading is in progress. (WebKit::RemoteLayerTreeDrawingArea::adjustLayerFlushThrottling): Compute the new delay. The first visual flush uses a shorter delay. Flush immediately when we are no longer throttling. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect): 2014-06-27 Joseph Pecoraro [iOS][WK2] is hidden. (-[WKContentView _showRunOpenPanel:resultListener:]): (-[WKContentView fileUploadPanelDidDismiss:]): Handle showing the cleaning up after the file upload panel. * UIProcess/ios/forms/WKFileUploadPanel.h: * UIProcess/ios/forms/WKFileUploadPanel.mm: Added. (squareCropRectForSize): (squareImage): (thumbnailSizedImageForImage): (-[_WKFileUploadItem isVideo]): (-[_WKFileUploadItem fileURL]): (-[_WKFileUploadItem displayImage]): (-[_WKImageFileUploadItem initWithFilePath:originalImage:]): (-[_WKImageFileUploadItem isVideo]): (-[_WKImageFileUploadItem fileURL]): (-[_WKImageFileUploadItem displayImage]): (-[_WKVideoFileUploadItem initWithFilePath:mediaURL:]): (-[_WKVideoFileUploadItem isVideo]): (-[_WKVideoFileUploadItem fileURL]): (-[_WKVideoFileUploadItem displayImage]): Helper class for each image picker selection. Knows how to get a file URL and thumbnail display image for the item. (-[WKFileUploadPanel initWithView:]): (-[WKFileUploadPanel dealloc]): (-[WKFileUploadPanel _dispatchDidDismiss]): (-[WKFileUploadPanel _cancel]): (-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]): Lifetime of the upload panel requires that either cancel or choose must happen as we go through the file picking process. (-[WKFileUploadPanel presentWithParameters:WebKit::resultListener:WebKit::]): (-[WKFileUploadPanel dismiss]): API to show or dismiss the panel. (-[WKFileUploadPanel _dismissDisplayAnimated:]): Helper to clean up the UI as it progresses or completes no matter the device idiom. (-[WKFileUploadPanel _presentPopoverWithContentViewController:animated:]): (-[WKFileUploadPanel _presentFullscreenViewController:animated:]): UI presentation for the appropriate idiom. (-[WKFileUploadPanel _mediaTypesForPickerSourceType:]): (-[WKFileUploadPanel _showMediaSourceSelectionSheet]): (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]): Showing the action sheet or image picker. (-[WKFileUploadPanel popoverControllerDidDismissPopover:]): (-[WKFileUploadPanel _willMultipleSelectionDelegateBeCalled]): (-[WKFileUploadPanel imagePickerController:didFinishPickingMediaWithInfo:]): (-[WKFileUploadPanel imagePickerController:didFinishPickingMultipleMediaWithInfo:]): (-[WKFileUploadPanel imagePickerControllerDidCancel:]): Action sheet or image picker handlers. (-[WKFileUploadPanel _processMediaInfoDictionaries:successBlock:failureBlock:]): (-[WKFileUploadPanel _processMediaInfoDictionaries:atIndex:processedResults:processedImageCount:processedVideoCount:successBlock:failureBlock:]): (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]): (-[WKFileUploadPanel _displayStringForPhotos:videos:]): Processing selections from the image picker to FileUploadItems. 2014-05-01 Simon Fraser [iOS WK2] Animations on vox.com look wrong https://bugs.webkit.org/show_bug.cgi?id=132462 Reviewed by Sam Weinig. PlatformCALayerRemote was managing animations incorrectly; aninations would stick around in m_properties.addedAnimations and get added a second time by mistake. Animations have to be managed a little differently to other properties, since they are not steady-state things. A given commit has to send over the added and removed animations, and then clear the layer properties. Do this by adding PlatformCALayerRemote::didCommit(), which is called after the layer properties have been encoded, and have it clear the lists of added and removed animations. removeAnimationForKey() also has to remove the animation from addedAnimations so that an add/remove in the same commit doesn't send the animation to the UI process. * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::recursiveBuildTransaction): (WebKit::PlatformCALayerRemote::didCommit): (WebKit::PlatformCALayerRemote::removeAnimationForKey): * WebProcess/WebPage/mac/PlatformCALayerRemote.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::flushLayers): 2014-05-01 Simon Fraser [iOS WK2] Can't scroll on gatesnotes.com https://bugs.webkit.org/show_bug.cgi?id=132459 Reviewed by Benjamin Poulain. The custom UIView hit-testing code was finding views that were created by the compositing code for clipping, above the UIScrollViews. We only ever need to find UIScrollViews here for touch overflow-scrolling, so constrain the hit-testing code to only return UIScrollViews. * UIProcess/ios/RemoteLayerTreeHostIOS.mm: (-[UIView _recursiveFindDescendantScrollViewAtPoint:withEvent:]): (-[UIView _findDescendantViewAtPoint:withEvent:]): (-[UIView _recursiveFindDescendantViewAtPoint:withEvent:]): Deleted. 2014-05-02 Carlos Alberto Lopez Perez REGRESSION(r168118): [GTK] build broken due to shouldTrackVisitedLinks https://bugs.webkit.org/show_bug.cgi?id=132447 Unreviewed GTK build fix. shouldTrackVisitedLinks was removed on r168118. Visited link coloring works as expected after this change. * UIProcess/gtk/WebContextGtk.cpp: (WebKit::WebContext::platformInitializeWebProcess): Remove shouldTrackVisitedLinks parameter. 2014-05-01 Enrica Casucci REGRESSION (WebKit2) Need to support Learn button. https://bugs.webkit.org/show_bug.cgi?id=132454 Reviewed by Benjamin Poulain. For traditional Chinese we support the ability to add shortcuts for typing. This is done by pressing the Learn button on the system menu. This patch adds the necessary code to canPerformAction to enable the button when appropriate as well as the implementation of the action itself. It also adds a check for the Replace button not to be shown when the selection only contains CJ characters. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _addShortcut:]): (-[WKContentView canPerformAction:withSender:]): 2014-05-01 Benjamin Poulain [iOS][WK2] Tweak the extended background exclusion for MobileSafari https://bugs.webkit.org/show_bug.cgi?id=132449 Reviewed by Beth Dakin. Some tweaks for Mobile: -Use UIViews instead of CALayers to have the same animation timing as the top views. -The left extended background insets should not exclude the top and bottom insets. Since this code is in the middle of 2 hot paths, also added some performance tweaks. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): In the normal case, we do not have extended background exclusion. To avoid creating a background view, we use the scrollview to render the background. The separate background view is created lazily if needed. (-[WKWebView _updateScrollViewBackground]): (-[WKWebView _frameOrBoundsChanged]): (updateTopAndBottomExtendedBackgroundExclusionIfNecessary): This create the top and bottom extended background view as needed and update their frames for the current insets. (-[WKWebView _setObscuredInsets:]): (-[WKWebView _setExtendedBackgroundExclusionInsets:]): When an exclusion inset is needed, create a view for it, transfer the color from the ScrollView, and reset the color of the scrollview. 2014-05-01 Alexey Proskuryakov Move size computation for Blob constructor into BlobRegistryImpl https://bugs.webkit.org/show_bug.cgi?id=132439 Reviewed by Sam Weinig. Plumbing to make this version of registerBlobURL synchronous for now. I expect to make it async again when data structures on client side are simplified. * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: (WebKit::NetworkBlobRegistry::registerBlobURL): * NetworkProcess/FileAPI/NetworkBlobRegistry.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::registerBlobURL): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::registerBlobURL): * WebProcess/FileAPI/BlobRegistryProxy.h: 2014-05-01 Beth Dakin REGRESSION(168053): Repro crash navigating to another page after selecting phone numbers on a page https://bugs.webkit.org/show_bug.cgi?id=132444 -and corresponding- Reviewed by Darin Adler. Missing null-check. * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm: (WebKit::TelephoneNumberOverlayController::drawRect): 2014-05-01 Anders Carlsson Remove WKBundleSetShouldTrackVisitedLinks and associate code https://bugs.webkit.org/show_bug.cgi?id=132441 Reviewed by Sam Weinig. * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleSetShouldTrackVisitedLinks): Deleted. * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::setShouldTrackVisitedLinks): Deleted. * WebProcess/InjectedBundle/InjectedBundle.h: * WebProcess/WebPage/VisitedLinkTableController.cpp: (WebKit::VisitedLinkTableController::addVisitedLink): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): (WebKit::WebProcess::setShouldTrackVisitedLinks): Deleted. * WebProcess/WebProcess.h: (WebKit::WebProcess::shouldTrackVisitedLinks): Deleted. 2014-05-01 Anders Carlsson window.testRunner.keepWebHistory() should update the UI process state https://bugs.webkit.org/show_bug.cgi?id=132440 Reviewed by Dan Bernstein. * UIProcess/API/C/WKPage.cpp: (WKPageGetAddsVisitedLinks): (WKPageSetAddsVisitedLinks): * UIProcess/API/C/WKPagePrivate.h: 2014-05-01 Filip Pizlo Roll out r60161. Rubber stamped by Mark Hahnenberg. This breaks our debugging workflow. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::decode): * UIProcess/mac/WebContextMac.mm: (WebKit::registerUserDefaultsIfNeeded): (WebKit::WebContext::platformInitializeWebProcess): 2014-05-01 Anders Carlsson WKWebView doesn't track visited links (for visited link coloring) https://bugs.webkit.org/show_bug.cgi?id=132438 Reviewed by Dan Bernstein. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::WebProcessCreationParameters): (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/API/APIHistoryClient.h: (API::HistoryClient::addsVisitedLinks): (API::HistoryClient::shouldTrackVisitedLinks): Deleted. * UIProcess/API/C/WKContext.cpp: (WKContextSetHistoryClient): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _addsVisitedLinks]): (-[WKWebView _setAddsVisitedLinks:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView initWithFrame:context:configuration:webView:]): * UIProcess/Cocoa/HistoryClient.h: * UIProcess/Cocoa/HistoryClient.mm: (WebKit::HistoryClient::shouldTrackVisitedLinks): Deleted. * UIProcess/VisitedLinkProvider.cpp: (WebKit::VisitedLinkProvider::addVisitedLinkHashFromPage): * UIProcess/VisitedLinkProvider.h: * UIProcess/VisitedLinkProvider.messages.in: * UIProcess/WebContext.cpp: (WebKit::WebContext::setHistoryClient): (WebKit::WebContext::createNewWebProcess): * UIProcess/WebContext.h: (WebKit::WebContext::processes): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::addsVisitedLinks): (WebKit::WebPageProxy::setAddsVisitedLinks): * WebProcess/WebPage/VisitedLinkTableController.cpp: (WebKit::VisitedLinkTableController::addVisitedLink): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: 2014-05-01 Benjamin Poulain [iOS][WK2] The highlight view needs to be in WKWebView coordinates https://bugs.webkit.org/show_bug.cgi?id=132435 Reviewed by Tim Horton. _UIHighlightView needs to be in WKWebView coordinates so that it render unscaled for any page scale factor. The view needs to be a child of WKContentView so that it moves/scales with the page. To fix the issue, add an inverse transform root layer for the hightlight, and scale the coordinates to their inverse scaled counterpart. The scale is not updated live with the scaling of WKContentView but that should be fine since the view disappear on any scaling operation (and I would prefer not add live painting during scaling animation). * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): (-[WKContentView _didGetTapHighlightForRequest:color:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]): (-[WKContentView _cancelInteraction]): 2014-05-01 Ryuan Choi [EFL] There are many warnings with software backend https://bugs.webkit.org/show_bug.cgi?id=132422 Reviewed by Gyuyoung Kim. * UIProcess/API/efl/EwkView.cpp: (EwkView::updateCursor): (EwkView::transformToScreen): 2014-04-30 Alexey Proskuryakov Roll out fix for https://bugs.webkit.org/show_bug.cgi?id=131637: Clean up unnecessary methods in the BackForwardClient interface It broke a regression test and an API test. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp: (WebKit::InjectedBundleBackForwardList::clear): * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::WebBackForwardListProxy): (WebKit::WebBackForwardListProxy::addItem): (WebKit::WebBackForwardListProxy::goToItem): (WebKit::WebBackForwardListProxy::itemAtIndex): (WebKit::WebBackForwardListProxy::backListCount): (WebKit::WebBackForwardListProxy::forwardListCount): (WebKit::WebBackForwardListProxy::close): (WebKit::WebBackForwardListProxy::clear): * WebProcess/WebPage/WebBackForwardListProxy.h: (WebKit::WebBackForwardListProxy::create): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): * WebProcess/WebPage/ios/WebBackForwardListProxyIOS.mm: Copied from Source/WebKit2/WebProcess/WebPage/ios/WebBackForwardListProxyIOS.mm. 2014-04-30 Brady Eidson Only reveal selection service UI after a short delay. and https://bugs.webkit.org/show_bug.cgi?id=132418 Reviewed by Sam Weinig. * WebProcess/WebPage/SelectionOverlayController.cpp: (WebKit::SelectionOverlayController::SelectionOverlayController): (WebKit::SelectionOverlayController::destroyOverlay): Also stop the hover timer. (WebKit::SelectionOverlayController::selectionRectsDidChange): Mark the highlight as dirty. (WebKit::SelectionOverlayController::hoverTimerFired): If the mouse is still over the highlight, set the visible flag and setNeedsDisplay(). * WebProcess/WebPage/SelectionOverlayController.h: * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm: (WebKit::SelectionOverlayController::drawRect): Recreate the highlight if it exists but is marked as dirty. After doing that, possibly reset the hover timer. Also, only performing the actual drawing if the visible flag is set. (WebKit::SelectionOverlayController::mouseEvent): If the mouse moves on or off the highlight, start or stop the hover timer accordingly. (WebKit::SelectionOverlayController::mouseHoverStateChanged): Handle starting/stopping the hover timer. (WebKit::SelectionOverlayController::clearHighlight): Deleted. 2014-04-30 Benjamin Poulain [iOS][WK2] Animated resize incorrectly assumes the layout width is the same as the view width https://bugs.webkit.org/show_bug.cgi?id=132373 Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _beginAnimatedResizeWithUpdates:]): Fix a couple of bugs when the left/right obscured insets change, and/or when the minimum layout size is narrower than the view itself. In order: -We need to perfom and update if the insets change since the unobscuredRect will also change. -The min/max zoom scale should be based on the minimum layout size, that's the definition of minimum layout size in scrollview coordinate :) -The old web view width in content coordinate could be narrower than the old view bounds if there are left or right insets. 2014-04-30 Simon Fraser Remove ENABLE_PLUGIN_PROXY_FOR_VIDEO https://bugs.webkit.org/show_bug.cgi?id=132396 Reviewed by Eric Carlson. Remove ENABLE_PLUGIN_PROXY_FOR_VIDEO and related code. * Configurations/FeatureDefines.xcconfig: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::createMediaPlayerProxyPlugin): Deleted. (WebKit::WebFrameLoaderClient::hideMediaPlayerProxyPlugin): Deleted. (WebKit::WebFrameLoaderClient::showMediaPlayerProxyPlugin): Deleted. * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2014-04-30 Brady Eidson If there are no services available, do not show the service controls UI and https://bugs.webkit.org/show_bug.cgi?id=132410 Reviewed by Tim Horton. Add a lightweight class that lazily polls the appropriate APIs for whether or not appropriate services are installed and usable on the system: * UIProcess/mac/ServicesController.h: Added. (WebKit::ServicesController::imageServicesExist): (WebKit::ServicesController::selectionServicesExist): * UIProcess/mac/ServicesController.mm: Added. (WebKit::ServicesController::shared): (WebKit::ServicesController::ServicesController): (WebKit::ServicesController::refreshExistingServices): (WebKit::ServicesController::refreshExistingServicesTimerFired): Add "image services exist" and "selection services exist" parameters: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::WebProcessCreationParameters): (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/WebContext.cpp: (WebKit::WebContext::createNewWebProcess): (WebKit::WebContext::refreshExistingServices): Called when the context menu proxy realizes that services no longer exist. * UIProcess/WebContext.h: Each WebProcess hangs on to its own copy of the flags for whether or not the services exist: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): (WebKit::WebProcess::initializeWebProcess): (WebKit::WebProcess::setEnabledServices): * WebProcess/WebProcess.h: (WebKit::WebProcess::imageServicesExist): (WebKit::WebProcess::selectionServicesExist): * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::setupServicesMenu): If the menu creation failed, the set of services on the system must have changed. So ask the WebContext to refresh them. * WebProcess/WebPage/SelectionOverlayController.cpp: (WebKit::SelectionOverlayController::selectionRectsDidChange): If services don't exist, don't create an overlay (and destroy any existing overlay!) * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm: (WebKit::SelectionOverlayController::drawRect): If services don't exist, don't draw, and destroy the overlay. * WebProcess/WebProcess.messages.in: * WebKit2.xcodeproj/project.pbxproj: 2014-04-30 Gavin Barraclough https://bugs.webkit.org/show_bug.cgi?id=132415 Fix snapshotting on WebKit2 Reviewed by Geoff Garen * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): - Use a VisibilityToken to keep the process runnable. 2014-04-30 Gavin Barraclough Fix PageVisibility on iOS https://bugs.webkit.org/show_bug.cgi?id=132393 Rubber stamped by Tim Horton * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::isViewWindowActive): (WebKit::PageClientImpl::isViewFocused): (WebKit::PageClientImpl::isViewVisible): (WebKit::PageClientImpl::isViewVisibleOrOccluded): (WebKit::PageClientImpl::isVisuallyIdle): - m_contentView -> m_webView 2014-04-30 Benjamin Poulain [iOS][WK2] Add a SPI to exclude the extended background from some areas of WKWebView https://bugs.webkit.org/show_bug.cgi?id=132406 Reviewed by Beth Dakin. Move the extended background to a separate layer bellow the UIScrollView. The geometry of that layer is then changed based on ExtendedBackgroundExclusionInsets as needed. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): (-[WKWebView _updateScrollViewBackground]): (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _setExtendedBackgroundExclusionInsets:]): (-[WKWebView _extendedBackgroundExclusionInsets]): (-[WKWebView pageExtendedBackgroundColor]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2014-04-30 Simon Fraser Fix build error when building for iOS simulator. * UIProcess/ios/ProcessAssertion.mm: 2014-04-30 Alexey Proskuryakov Move Blob.slice() implementation into BlobRegistryImpl https://bugs.webkit.org/show_bug.cgi?id=132402 Reviewed by Anders Carlsson. * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: (WebKit::NetworkBlobRegistry::registerBlobURLForSlice): * NetworkProcess/FileAPI/NetworkBlobRegistry.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::registerBlobURLForSlice): * WebProcess/FileAPI/BlobRegistryProxy.h: 2014-04-30 Beth Dakin Phone number data detection UI is offset for iframes, pages with topContentInset https://bugs.webkit.org/show_bug.cgi?id=132372 -and corresponding- Reviewed by Tim Horton. Make the overlay an OverlayType::Document, which will keep everything relative to the main Document’s coordinates. * WebProcess/WebPage/TelephoneNumberOverlayController.cpp: (WebKit::TelephoneNumberOverlayController::createOverlayIfNeeded): Make frames work by converting to the main document’s coordinate space. * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm: (WebKit::TelephoneNumberOverlayController::drawRect): 2014-04-30 Roger Fong Unreviewed. Unnecessary explicit initialization of LayoutUnit from r167985. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::determinePrimarySnapshottedPlugIn): Darin points out that I can just use “/2” instead of “/LayoutUnit(2.0)”. 2014-04-30 David Hyatt [New Multicolumn] Enable new multi-column mode https://bugs.webkit.org/show_bug.cgi?id=131825 Reviewed by Simon Fraser. * Shared/WebPreferencesStore.h: 2014-04-30 Brian J. Burg Clean up unnecessary methods in the BackForwardClient interface https://bugs.webkit.org/show_bug.cgi?id=131637 Reviewed by Andreas Kling. Remove stubs for iOS-specific methods in the BackForwardClient interface. Construct a WebBackForwardListProxy directly, and make the WebCore page own the BackForwardClient instance. Convert uses of backForward().client() to accept references instead of raw pointers. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp: (WebKit::InjectedBundleBackForwardList::clear): * WebProcess/WebPage/WebBackForwardListProxy.cpp: Store a reference to WebCore::Page instead of a pointer. (WebKit::WebBackForwardListProxy::WebBackForwardListProxy): (WebKit::WebBackForwardListProxy::create): Deleted. (WebKit::WebBackForwardListProxy::addItem): (WebKit::WebBackForwardListProxy::goToItem): (WebKit::WebBackForwardListProxy::itemAtIndex): (WebKit::WebBackForwardListProxy::backListCount): (WebKit::WebBackForwardListProxy::forwardListCount): (WebKit::WebBackForwardListProxy::close): (WebKit::WebBackForwardListProxy::clear): (WebKit::WebBackForwardListProxy::isActive): * WebProcess/WebPage/WebBackForwardListProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): * WebProcess/WebPage/ios/WebBackForwardListProxyIOS.mm: Removed. 2014-04-30 Gavin Barraclough Fix PageVisibility on iOS https://bugs.webkit.org/show_bug.cgi?id=132393 Reviewed by Andreas Kling. Currently page visibility API doesn't work correctly on WK2 iOS for a few reasons, the most significant of which being that the moment a WKWebView leaves the window we'll suspend the content process, which removes the possibility for any notification to be delivered. This patch addresses this issue, by allowing the process to run for long enough for the notification to be delivered. 1) Introduce a new class, ProcessThrottler, to encapsulate the process suspension logic. 2) WebPageProxy uses ProcessThrottler::VisibilityToken to communicate visibility to the throttler. 3) WebPageProxy tracks pending didUpdateViewState messages to detect when the view state update in the web content process has completed. 4) Distiguish between 'Background' and 'Suspended' states in the ProcessAssertion. * Shared/ChildProcessProxy.h: - moved m_assertion to NetworkProcessProxy / WebProcessProxy. * UIProcess/Network/NetworkProcessProxy.h: - added m_assertion. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): - initialize VisibilityToken state. (WebKit::WebPageProxy::reattachToWebProcess): - reinitialize VisibilityToken state. (WebKit::WebPageProxy::viewStateDidChange): - update VisibilityToken, increment m_pendingViewStateUpdates as necessary. (WebKit::WebPageProxy::updateVisibilityToken): - update the VisibiliyToken based on page visibility, and whether an update is still pending. (WebKit::WebPageProxy::didUpdateViewState): - detect when a view state change has completed in the web process, and update throttle state as necessary. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::didUpdateViewState): Deleted. - moved to .cpp. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::WebProcessProxy): - initialize m_throttler. (WebKit::WebProcessProxy::didFinishLaunching): - notify the PageThrottler of the new connection. * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::throttler): - added accessor. (WebKit::WebProcessProxy::updateProcessState): Deleted. - moved trottling login to ProcessThrottler. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::isViewWindowActive): (WebKit::PageClientImpl::isViewFocused): (WebKit::PageClientImpl::isViewVisible): (WebKit::PageClientImpl::isViewVisibleOrOccluded): - these should only be true when the view is in a window. (WebKit::PageClientImpl::isVisuallyIdle): - this should only be true when the view is not in a window. * UIProcess/ios/ProcessAssertion.h: * UIProcess/ios/ProcessAssertion.mm: (WebKit::flagsForState): - map from enum -> BKSAssertion flags values. (WebKit::ProcessAssertion::ProcessAssertion): - use flagsForState (add support for Suspended state). (WebKit::ProcessAssertion::setState): - use flagsForState (add support for Suspended state). * UIProcess/ios/ProcessThrottler.h: Added. (WebKit::ProcessThrottler::VisibilityToken::visibility): - accessor. (WebKit::ProcessThrottler::VisibilityToken::setVisibility): - update Visibility value; update the token as necessary. (WebKit::ProcessThrottler::ProcessThrottler): - constructor; does not take an assention until didConnnectToProcess is called. (WebKit::ProcessThrottler::visibilityToken): - create a VisibilityToken. (WebKit::ProcessThrottler::didConnnectToProcess): - take an assertion. (WebKit::ProcessThrottler::weakPtr): - create a weak pointer, used for references from VisibilityToken to the throttler. (WebKit::ProcessThrottler::assertionState): - determine the correct AssertionState for the process, based on current visibility. (WebKit::ProcessThrottler::updateAssertion): - update assertion, called in response to visibility change. * UIProcess/ios/ProcessThrottler.mm: Added. (WebKit::ProcessThrottler::VisibilityToken::VisibilityToken): - constructor. (WebKit::ProcessThrottler::VisibilityToken::~VisibilityToken): - set visibility to hidden to reset. (WebKit::ProcessThrottler::VisibilityToken::hideTimerFired): - automatically decay from Hiding -> Hidden on a timeout. (WebKit::ProcessThrottler::VisibilityToken::setVisibilityInternal): - update counters tracking visibility in ProcessThrottler. * UIProcess/ios/WKContentView.mm: (-[WKContentView didMoveToWindow]): - This affects all view state flags, not just the 'InWindow' state. If the view moves out of a window request a reply from the WebContent - we use this to detect when the page visibility event has completed. * UIProcess/ios/WebProcessProxyIOS.mm: (WebKit::WebProcessProxy::updateProcessState): Deleted. - removed. * WebKit2.xcodeproj/project.pbxproj: - added new files. 2014-04-30 Anders Carlsson Preemptive header fixes for when WebKit.framework is going to provide the modern API https://bugs.webkit.org/show_bug.cgi?id=132394 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKBrowsingContextPolicyDelegate.h: (NS_ENUM): Delete WKNavigationType for now. Ultimately the entire delegate should be removed. * UIProcess/API/Cocoa/WKPreferences.h: Add a header guard so we can avoid importing WKPreferences.h more than once. * WebKit2.xcodeproj/project.pbxproj: _WKScriptWorld.h should be private, not public. WKScriptMessagePrivate.h and WKUserContentControllerPrivate.h should be private, not project. 2014-04-30 Joseph Pecoraro Web Inspector: Ensure UIProcess checks in to webinspectord after spawning a WebProcess https://bugs.webkit.org/show_bug.cgi?id=132389 Reviewed by Timothy Hatcher. We aggregate WebProcess WebView's under the UIProcess. If the UIProcess didn't connect to webinspectord these WebViews would have remained hidden. Always have the UIProcess connect to webinspectord when it spawns a WebProcess and may have a child process holding views that it ultimately owns and should display under the UIProcess name. * UIProcess/WebContext.cpp: (WebKit::WebContext::createNewWebProcess): 2014-04-30 Zalan Bujtas [iOS]Subpixel rendering: Extra line of pixels next to the YouTube loading indicator. https://bugs.webkit.org/show_bug.cgi?id=132391 Reviewed by Simon Fraser. CG and GraphicsContext clipping should use the same coordinates. Snapping either one while leaving the other unsnapped results in clipping mismatch and that may produce unpainted areas. Not testable. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::drawInContext): 2014-04-30 Alexey Proskuryakov https://bugs.webkit.org/show_bug.cgi?id=132363 Make Blob RawData immutable Reviewed by Anders Carlsson. * Shared/FileAPI/BlobRegistrationData.cpp: (WebKit::BlobRegistrationData::decode): Create RawData in one step. 2014-04-30 Brady Eidson Followup to: Handle selection services menu. and https://bugs.webkit.org/show_bug.cgi?id=132362 * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::setupServicesMenu): Remove an ASSERT from previous version of the patch that landed. I’d forgotten to add this stray change to my staging area. 2014-04-30 Manuel Rego Casasnovas [CSS Grid Layout] Enable runtime feature by default https://bugs.webkit.org/show_bug.cgi?id=132189 Reviewed by Benjamin Poulain. * Shared/WebPreferencesStore.h: Remove unneeded changes that enable/disable the runtime feature depending on the compilation flag. And set it to true by default. * UIProcess/gtk/ExperimentalFeatures.cpp: Set it to true by default. 2014-04-30 Roger Fong Unreviewed. Wrong units used in offset calculation from r167961. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::determinePrimarySnapshottedPlugIn): I accidentally mixed and matches LayoutUnits with Ints in offset calculation here. It should all just be in LayoutUnits. 2014-04-29 Benjamin Poulain [iOS][WK2] When pageScaleFactor * deviceScaleFactor = 1, the tile grid is completely messed up https://bugs.webkit.org/show_bug.cgi?id=132368 Reviewed by Simon Fraser. * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::PlatformCALayerRemote): PlatformCALayerRemote always initialized the content scale to 1. Since contentsScale is supposed to reflect zoomScale * deviceScaleFactor, the value should be 2. This was causing bugs whenever the page scale factor was 1/2 on retina device (device scale factor = 2). When the page is initialized, GraphicsLayerCA::updateContentsScale(0.5) computes a contentsScale of 1. There is an early return on if (contentsScale == m_layer->contentsScale()). Since PlatformCALayerRemote->contentsScale() was incorreclty returning one, we were leaving the tile backing unmodified. Later, when the transaction is commited, the tile backing would still be default initialized and would render everything at the wrong scale. 2014-04-29 Eric Carlson [Mac] tag the video layers with descriptive name to aid debugging https://bugs.webkit.org/show_bug.cgi?id=132371 Reviewed by Darin Adler. * WebProcess/ios/WebVideoFullscreenManager.mm: (WebKit::WebVideoFullscreenManager::enterFullscreenForNode): Set the fullscreen host layer name in a debug build. 2014-04-29 Brady Eidson Handle selection services menu. and https://bugs.webkit.org/show_bug.cgi?id=132362 Reviewed by Tim Horton. Add members for the relevant info for showing a service menu for a selection: * Shared/ContextMenuContextData.cpp: (WebKit::ContextMenuContextData::ContextMenuContextData): (WebKit::ContextMenuContextData::controlledDataIsEditable): * Shared/ContextMenuContextData.h: (WebKit::ContextMenuContextData::ContextMenuContextData): (WebKit::ContextMenuContextData::controlledSelectionData): (WebKit::ContextMenuContextData::needsServicesMenu): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::replaceSelectionWithPasteboardData): Changed to allow for multiple types on the overridden pasteboard. (WebKit::WebPageProxy::showSelectionServiceMenu): Update the services menu code to know the difference between an image service and a selection service: * UIProcess/mac/WebContextMenuProxyMac.h: * UIProcess/mac/WebContextMenuProxyMac.mm: (-[WKSharingServicePickerDelegate sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]): (-[WKSharingServicePickerDelegate sharingService:willShareItems:]): (-[WKSharingServicePickerDelegate sharingService:didShareItems:]): (WebKit::WebContextMenuProxyMac::contextMenuItemSelected): (WebKit::WebContextMenuProxyMac::setupServicesMenu): (WebKit::WebContextMenuProxyMac::clearServicesMenu): (WebKit::WebContextMenuProxyMac::populate): (WebKit::WebContextMenuProxyMac::showContextMenu): (WebKit::WebContextMenuProxyMac::setupImageServicesMenu): Deleted. (WebKit::WebContextMenuProxyMac::clearImageServicesMenu): Deleted. * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp: (WebKit::WebPasteboardOverrides::getDataForOverride): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::replaceSelectionWithPasteboardData): Changed to allow for multiple types on the overridden pasteboard. (WebKit::WebPage::handleSelectionServiceClick): Pass the relevant selection data through to the UIProcess as RTFD data. * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm: (WebKit::SelectionOverlayController::handleClick): Notify the WebPage of the click. 2014-04-29 Dan Bernstein [Cocoa] Crash when invoking a method with an unsigned parameter on a remote object https://bugs.webkit.org/show_bug.cgi?id=132366 Reviewed by Anders Carlsson. * Shared/API/Cocoa/WKRemoteObjectCoder.mm: (encodeInvocation): Handle the 'I' type code. Interpret the 'q' and 'Q' type codes in an architecture-independent manner. (decodeInvocationArguments): Ditto. 2014-04-29 Roger Fong Don't immediately snapshot plugin to allow for proper dominant plugin detection. https://bugs.webkit.org/show_bug.cgi?id=132294. Reviewed by Dean Jackson. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::didInitializePlugin): Instead of immediately setting the display state to DisplaySnapshot, put it on a timer to let the page fully layout and get hit test properly. 2014-04-28 Roger Fong Plugins hidden by images should autoplay. https://bugs.webkit.org/show_bug.cgi?id=132222. Reviewed by Jon Lee and Darin Adler. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::determinePrimarySnapshottedPlugIn): If the image on top of the plugin is similarly sized and similarly positioned as the plugin rect, set the plugin to autoplay. This is assuming that the previous snapshot checks have passed as well. 2014-04-29 Filip Pizlo Use LLVM as a backend for the fourth-tier DFG JIT (a.k.a. the FTL JIT) https://bugs.webkit.org/show_bug.cgi?id=112840 Rubber stamped by Geoffrey Garen. * Configurations/FeatureDefines.xcconfig: 2014-04-29 Brady Eidson Change Image Controls replacement to use selection and paste and https://bugs.webkit.org/show_bug.cgi?id=131992 Reviewed by Tim Horton. Add a "pasteboard override" mechanism which allows WebKit to keep pasteboard content local to the WebProcess and access it there without having to message up to the UI process: * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp: Added. (WebKit::WebPasteboardOverrides::sharedPasteboardOverrides): (WebKit::WebPasteboardOverrides::WebPasteboardOverrides): (WebKit::WebPasteboardOverrides::addOverride): (WebKit::WebPasteboardOverrides::removeOverride): (WebKit::WebPasteboardOverrides::overriddenTypes): (WebKit::WebPasteboardOverrides::getDataForOverride): * WebProcess/WebCoreSupport/WebPasteboardOverrides.h: Added. Change the pasteboard strategy to consult the pasteboard overrides before consulting the native pasteboard: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::getTypes): (WebKit::WebPlatformStrategies::bufferForType): Add "replaceSelectionWithPasteboardData" which uses the new pasteboard overrides mechanism and then has WebCore perform the replacement: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::replaceSelectionPasteboardName): (WebKit::WebPage::replaceSelectionWithPasteboardData): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::replaceSelectionWithPasteboardData): * UIProcess/mac/WebContextMenuProxyMac.h: (WebKit::WebContextMenuProxyMac::page): * UIProcess/mac/WebContextMenuProxyMac.mm: (-[WKSharingServicePickerDelegate sharingService:didShareItems:]): Use "replaceSelectionWithPasteboardData". (WebKit::WebContextMenuProxyMac::WebContextMenuProxyMac): (WebKit::WebContextMenuProxyMac::replaceControlledImage): Deleted. Remain other remnants of "replaceControlledImage": * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::replaceControlledImage): Deleted. * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebContextMenu.cpp: (WebKit::WebContextMenu::replaceControlledImage): Deleted. * WebProcess/WebPage/WebContextMenu.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::replaceControlledImage): Deleted. * WebKit2.xcodeproj/project.pbxproj: 2014-04-29 Tim Horton Build fix. * DatabaseProcess/ios/DatabaseProcessIOS.mm: 2014-04-29 Alexey Proskuryakov [WK2] DatabaseProcess should be sandboxed https://bugs.webkit.org/show_bug.cgi?id=132324 Reviewed by Darin Adler. * Configurations/WebKit2.xcconfig: Added the profile to the list of files skipped on iOS. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::initializeDatabaseProcess): Consume a sandbox extension for IndexedDB directory (which we get with initialization message after entering sandbox). * DatabaseProcess/ios: Added. * DatabaseProcess/ios/DatabaseProcessIOS.mm: Copied from Source/WebKit2/DatabaseProcess/mac/DatabaseProcessMac.mm. Separated from Mac version to match how other processes are implemented. * DatabaseProcess/mac/DatabaseProcessMac.mm: (WebKit::DatabaseProcess::initializeProcessName): Removed ifdefs. * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in: Added. * DerivedSources.make: Generate the profile from .sb.in. * Shared/Databases/DatabaseProcessCreationParameters.cpp: (WebKit::DatabaseProcessCreationParameters::encode): (WebKit::DatabaseProcessCreationParameters::decode): * Shared/Databases/DatabaseProcessCreationParameters.h: Added a sandbox extension for indexedDatabaseDirectory. * Shared/SecurityOriginData.h: Added an unrelated FIXME. * UIProcess/WebContext.cpp: (WebKit::WebContext::ensureDatabaseProcess): Create a sandbox extension for indexedDatabaseDirectory. * WebKit2.xcodeproj/project.pbxproj: Added new files. 2014-04-28 Andy Estes [iOS] Introduce -didNotHandleTapAsClickAtPoint: to WKUIDelegatePrivate https://bugs.webkit.org/show_bug.cgi?id=132316 Reviewed by Darin Adler. One WebKit2 client is interested to know if a tap was not handled by an element that responds to clicks. Introduce a new, private WKUIDelegate method telling it that a tap at a location was not handled as a click on an element. * UIProcess/API/APIUIClient.h: (API::UIClient::didNotHandleTapAsClick): * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::didNotHandleTapAsClick): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::didNotHandleTapAsClick): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleTap): Sent Messages::WebPageProxy::DidNotHandleTapAsClick if the tap wasn't handled, no node responded to the click event, or the responding node wasn't an element. 2014-04-29 Zan Dobersek [GTK][WK2] Avoid Vector copies in WebViewBaseInputMethodFilter::setPreedit() https://bugs.webkit.org/show_bug.cgi?id=132323 Reviewed by Carlos Garcia Campos. * UIProcess/API/gtk/WebViewBaseInputMethodFilter.cpp: (WebKit::WebViewBaseInputMethodFilter::setPreedit): Inline the Vector object construction into the WebPageProxy::setComposition() call to avoid extra Vector copies and moves. 2014-04-28 Dan Bernstein REGRESSION (r159358): Crash in InjectedBundleHitTestResult::frame https://bugs.webkit.org/show_bug.cgi?id=132318 Reviewed by Andy Estes. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction): Fixed a typo: set the source frame, not the destination frame. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Changed to get the frame for the action not from a hit test result, because some link activation actions are not mouse events, but rather from the event’s target. 2014-04-28 Benjamin Poulain [iOS][WK2] Restore the scroll position and scale from the HistoryItem (mostly) https://bugs.webkit.org/show_bug.cgi?id=132307 Reviewed by Simon Fraser. Restore the scroll position and scale on back-forward by restoring the values from HistoryItem. This covers the common cases, see . * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:WebKit::]): (-[WKWebView _didCommitLoadForMainFrame]): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView _didCommitLoadForMainFrame]): Get rid of the old code restoring the scroll position. This is now done by the WebProcess. * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): Update the scrolling tree after invoking didCommitLayerTree() on the WebPageProxy. WKContentView and WKWebView states are updated in response to didCommitLayerTree(), the content size and scale in particular are set there. After that, the content size/scale is in the same state as the layerTree update, and we can scroll the content as needed. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm: (WebKit::WebFrameLoaderClient::restoreViewState): iOS WebKit1 uses a custom restoreViewState(), do the same for WebKit2 since the generic code is #ifdefed out. This is also necessary for the main frame's state update. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::restorePageState): Restore the scale and position of the main frame. For now, we assume m_userHasChangedPageScaleFactor is set otherwise the initial-scale would override the restored value. We will need to fix that, the value should probably be saved with the history. 2014-04-28 Benjamin Poulain [iOS][WK2] iOS fix after r167867 https://bugs.webkit.org/show_bug.cgi?id=132302 Reviewed by Simon Fraser. iOS Touch Points uses "phase" for describing the touch points state for historical reasons. This patch adds state() as a synonym for phase, and revert r167893. * Shared/WebEvent.h: (WebKit::WebPlatformTouchPoint::state): * UIProcess/WebPageProxy.cpp: (WebKit::areAllTouchPointsReleased): 2014-04-28 Andy Estes Fix a transcription error from r167901. When addressing Darin's review feedback, I moved the iteration of dataArray from QuickLookDocumentData::append() to WebQuickLookHandleClient::didReceiveDataArray(), but I forgot to update the context argument to CFArrayApplyFunction() accordingly. * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp: (WebKit::WebQuickLookHandleClient::didReceiveDataArray): 2014-04-28 Enrica Casucci [WK2 iOS] Need to show title in the action sheet for images not inside an anchor element. https://bugs.webkit.org/show_bug.cgi?id=132304 Reviewed by Benjamin Poulain. If the image in not inside an anchor tag, we must use the title attribute as title for the action sheet. * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]): 2014-04-28 Tim Horton WebKit2 View Gestures (Swipe): Discard snapshots made with a different view size/pixel density https://bugs.webkit.org/show_bug.cgi?id=132115 Reviewed by Simon Fraser. We shouldn't try to use snapshots if they no longer match the destination view size. To do this, we need an accurate understanding of the topContentInset, both for the Web view, and for any custom views, because we don't want to include the inset area in the snapshot, and we don't want to reject snapshots that differ from the current view only because they have an inset or not. * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView _takeViewSnapshot]): (-[WKView _setCustomSwipeViewsTopContentInset:]): Add and plumb through a topContentInset property to apply to the custom swipe views. For simplicitly's sake in the multi-view case, it is applied in window coordinates, so clients will have to do conversions if necessary. Don't include the top content inset in the snapshot that is taken. * UIProcess/mac/ViewGestureController.h: (WebKit::ViewGestureController::setCustomSwipeViewsTopContentInset): * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::ViewGestureController): (WebKit::ViewGestureController::windowRelativeBoundsForCustomSwipeViews): Apply the aforementioned custom swipe view top content inset. (WebKit::ViewGestureController::determineSnapshotLayerParent): (WebKit::ViewGestureController::determineLayerAdjacentToSnapshotForParent): Factor these out of beginSwipeGesture. (WebKit::ViewGestureController::retrieveSnapshotForItem): Don't return a snapshot if the current deviceScaleFactor doesn't match that at which the snapshot was taken, or if the size of the snapshot doesn't match the unobscured part of the snapshot layer (the layer's size sans top content inset). (WebKit::layerGeometryFlippedToRoot): Added. Determine whether geometry flipping occurs between a layer and the root of the tree it is in. (WebKit::ViewGestureController::applyDebuggingPropertiesToSwipeViews): Factor out debugging layer properties, and add some borders and backgrounds to our layers. I switched to invert instead of blur because blur makes the borders hard to use. (WebKit::ViewGestureController::beginSwipeGesture): Add an additional layer, the swipeLayer, which is the parent of the swipeSnapshotLayer. We use this layer to compensate for geometry flipping, since we don't necessarily know the structure of the layer tree ahead of time when inserting snapshots into the client's layer tree, in the custom swipe view case. The swipe layer is always the full size of the view, including topContentInset, and has a white background in order to fill in that space. The snapshot layer is the size of the view *excluding* the topContentInset, which should match the size of the snapshot image itself (and we reject the image and just paint white if this is not the case). (WebKit::ViewGestureController::handleSwipeGesture): (WebKit::ViewGestureController::removeSwipeSnapshot): Move and remove the new swipeLayer. * UIProcess/mac/ViewSnapshotStore.h: * UIProcess/mac/ViewSnapshotStore.mm: (WebKit::ViewSnapshotStore::recordSnapshot): Store the deviceScaleFactor at the time the snapshot was taken. Fix a bug where the count of snapshots with live images was too high because we were failing to decrement it when replacing a snapshot of an existing item with a fresh one. 2014-04-28 Enrica Casucci WK2 iOS: crash when handling a synthetic keyboard event. https://bugs.webkit.org/show_bug.cgi?id=132296 Reviewed by Benjamin Poulain. Adding a null check, since synthetic keyboard events do not have a corresponding platform event. We already do this on OS X. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleEditingKeyboardEvent): 2014-04-24 Andy Estes [iOS] Implement WebQuickLookHandleClient for WebKit2 https://bugs.webkit.org/show_bug.cgi?id=132157 Reviewed by Darin Adler. * Shared/API/Cocoa/_WKNSFileManagerExtras.h: Added. * Shared/API/Cocoa/_WKNSFileManagerExtras.mm: Added. (+[NSFileManager _web_createTemporaryFileForQuickLook:]): Called WebCore::createTemporaryFileForQuickLook(). * Shared/ios/QuickLookDocumentData.cpp: Added. (WebKit::QuickLookDocumentData::QuickLookDocumentData): (WebKit::QuickLookDocumentData::append): Appened each CFDataRef to m_data and added their sizes to m_size. (WebKit::QuickLookDocumentData::decodedData): Returned the combined CFDataRef created by decode(). Named this method 'decodedData' to indicate that it should only be called on objects populated by decode(). (WebKit::QuickLookDocumentData::clear): Cleared m_data and reset m_size to 0. (WebKit::QuickLookDocumentData::encode): Implemented a custom encoding function to avoid having to combine m_data into contiguous memory at encoding time. Encoded m_size then sequentially encoded each member of m_data. (WebKit::QuickLookDocumentData::decode): Decoded the byte stream into a single CFDataRef. Eagerly copied the decoded data rather than using a DataReference since we know this will outlive the decoder. * Shared/ios/QuickLookDocumentData.h: Added. * UIProcess/API/APILoaderClient.h: (API::LoaderClient::didStartLoadForQuickLookDocumentInMainFrame): (API::LoaderClient::didFinishLoadForQuickLookDocumentInMainFrame): * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::NavigationState::LoaderClient::didStartLoadForQuickLookDocumentInMainFrame): (WebKit::NavigationState::LoaderClient::didFinishLoadForQuickLookDocumentInMainFrame): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::didStartLoadForQuickLookDocumentInMainFrame): (WebKit::WebPageProxy::didFinishLoadForQuickLookDocumentInMainFrame): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm: (WebKit::WebFrameLoaderClient::didCreateQuickLookHandle): * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp: Added. (WebKit::WebQuickLookHandleClient::WebQuickLookHandleClient): Sent DidStartLoadForQuickLookDocumentInMainFrame to WebPageProxy. (WebKit::WebQuickLookHandleClient::didReceiveDataArray): Appended dataArray to m_data. (WebKit::WebQuickLookHandleClient::didFinishLoading): Sent DidFinishLoadForQuickLookDocumentInMainFrame to WebPageProxy and then cleared m_data. (WebKit::WebQuickLookHandleClient::didFail): Cleared m_data. * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h: Added. (WebKit::WebQuickLookHandleClient::create): 2014-04-28 Brady Eidson Hide service controls for selection behind a runtime switch and https://bugs.webkit.org/show_bug.cgi?id=132291 Reviewed by Tim Horton. * Shared/WebPreferencesStore.h: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::selectionRectsDidChange): Do nothing if the UI is disabled. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): (WebKit::WebPage::updatePreferences): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::serviceControlsEnabled): 2014-04-28 Commit Queue Unreviewed, rolling out r167853. https://bugs.webkit.org/show_bug.cgi?id=132288 caused crashes+timeouts+layout test failures described in the bug (Requested by thorton on #webkit). Reverted changeset: "Coalesce responses on network process side" https://bugs.webkit.org/show_bug.cgi?id=132229 http://trac.webkit.org/changeset/167853 2014-04-28 Simon Fraser Fix the iOS buld. * UIProcess/WebPageProxy.cpp: (WebKit::areAllTouchPointsReleased): 2014-04-24 Simon Fraser [iOS WK2] Make subview rebuilding more incremental https://bugs.webkit.org/show_bug.cgi?id=132162 Reviewed by Sam Weinig. Previously we did bulk replacement of subviews, but that triggers UIKit to send spurious will/DidMoveToWindow messages, which can interfere with UIScrollView scrolling. Make _web_setSubviews more incremental, only removing deleted subviews, adding new ones, and moving existing ones into the correct order. * Shared/mac/RemoteLayerTreePropertyApplier.mm: (-[UIView _web_setSubviews:]): 2014-04-24 Simon Fraser [iOS WK2] flickery scrolling with overflow-scrolling:touch https://bugs.webkit.org/show_bug.cgi?id=132150 Reviewed by Tim Horton. Maintain a flag that tells us if the user is interacting with the UIScrollView, and while set, don't clobber the contentOffset via scrolling tree updates. * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (-[WKOverflowScrollViewDelegate initWithScrollingTreeNode:WebKit::]): (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]): (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]): We need this one, not scrollViewDidEndScrollingAnimation:, to detect the end of decleration. (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren): (-[WKOverflowScrollViewDelegate scrollViewDidEndScrollingAnimation:]): Deleted. 2014-04-28 Krzysztof Wolanski [X11] Add missing case for mime type application/x-webkit-test-netscape https://bugs.webkit.org/show_bug.cgi?id=132278 Reviewed by Darin Adler. Case for x-webkit-test-netscape has been omitted along with r167759. * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::initialize): 2014-04-28 Zan Dobersek [WK2][X11] NetscapePluginModule::scanPlugin() should write UTF-8 strings to stdout https://bugs.webkit.org/show_bug.cgi?id=132245 Reviewed by Carlos Garcia Campos. NetscapePluginModule::scanPlugin(), in the helper writeLine function, takes each character of the given string and writes it out as a UChar, doing two fputc calls for each byte of the 16-bit type. This fails badly with characters with integer value less than 256 as the most significant byte of the UChar is written out as a null character. This effectively chops the output that's gathered in the UIProcess and is parsed in PluginProcessProxy::scanPlugin(). To avoid all this, the UTF-8 encoding of the string is written out in the PluginProcess, and String::fromUTF8() is called in the UIProcess to properly decode the received string. * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp: (WebKit::writeCharacter): (WebKit::writeLine): (WebKit::writeByte): Deleted. * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp: (WebKit::PluginProcessProxy::scanPlugin): 2014-04-28 Zan Dobersek [GTK][WK2] Missing return statement in webkit_plugin_get_description() https://bugs.webkit.org/show_bug.cgi?id=132263 Reviewed by Carlos Garcia Campos. * UIProcess/API/gtk/WebKitPlugin.cpp: (webkit_plugin_get_description): Actually return the data of the cached plugin description CString. 2014-04-28 Carlos Garcia Campos [GTK] Crash in debug build with removing windowed plugin child widgets from the view https://bugs.webkit.org/show_bug.cgi?id=132252 Reviewed by Philippe Normand. It crashes due to an assert in HashTable that checks the iterators validity. The problem is that we are iterating the children map and the callback called on every iteration might modify the map, making the iterators invalid. This happens when the WebView is destroyed, GtkContainer calls gtk_container_foreach() with gtk_widget_destroy as callback. When a widget inside a container is destroyed, it's removed from the container, and in our case, the child widget is removed from the map. This fixes several crashes when running layout tests in debug bot. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseContainerForall): Use copyKeysToVector() instead of using a range iterator for the map keys and check in every iteration that the child widget from the keys vector is still present in the map before calling the callback. 2014-04-28 Carlos Garcia Campos [GTK] GObject introspection links to installed libs when using jhbuild https://bugs.webkit.org/show_bug.cgi?id=132220 Reviewed by Martin Robinson. The problem is that gobject-introspection is linking the temporary binaries adding the library paths present LDFLAGS environment variable first, taking precedence over the libraries in the build dir. Since the libraries paths of the dependencies are already correctly deduced by gobject-introspection using ldd, we can just unset the LDFLAGS variable before calling g-ir-scanner to make sure the libraries in the build dir take predence. * PlatformGTK.cmake: 2014-04-27 Tim Horton REGRESSION (r164702): Double tap doesn't stay under the new element once the animation finishes https://bugs.webkit.org/show_bug.cgi?id=132239 Reviewed by Darin Adler. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::scalePage): The change in r167864 broke iOS animated resize, because it was depending on the dynamic size update code not running if the scale wasn't going to change. So, as a band-aid we should bail from doing that work if the scales aren't different. In the long term we should try to untangle this code and make it less platform dependent. 2014-04-27 Eunmi Lee TouchEvent is not handled after releasing any point among touched points. https://bugs.webkit.org/show_bug.cgi?id=132043 Reviewed by Benjamin Poulain. Handle TouchEvent until all touched points are released by setting trackingTouchEvents variable to false when all points are released. * UIProcess/WebPageProxy.cpp: (WebKit::areAllTouchPointsReleased): (WebKit::WebPageProxy::handleTouchEventSynchronously): (WebKit::WebPageProxy::handleTouchEventAsynchronously): (WebKit::WebPageProxy::handleTouchEvent): 2014-04-27 Alexey Proskuryakov Don't use DispatchMessageEvenWhenWaitingForSyncReply for messages from NetworkProcess https://bugs.webkit.org/show_bug.cgi?id=132144 Reviewed by Darin Adler. * NetworkProcess/AsynchronousNetworkLoaderClient.cpp: (WebKit::AsynchronousNetworkLoaderClient::willSendRequest): (WebKit::AsynchronousNetworkLoaderClient::canAuthenticateAgainstProtectionSpace): Dont use the IPC::DispatchMessageEvenWhenWaitingForSyncReply flag. It's not needed, almost never works in NetworkProcess, but may cause trouble if it did. * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess): Removed setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage() function call, because there are no more any messages in NetworkProcess it could affect. * Platform/IPC/Connection.cpp: (IPC::Connection::dispatchMessage): Added a FIXME for an unrelated bug Anders and myself noticed while looking into this. 2014-04-27 Dan Bernstein [Cocoa] -[WKWebProcessPlugInController parameters] returns nil if no parameters have been set yet https://bugs.webkit.org/show_bug.cgi?id=132223 Reviewed by Sam Weinig. * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm: (WebKit::InjectedBundle::bundleParameters): Create the WKWebProcessBundleParameters if needed. 2014-04-27 Tim Horton REGRESSION (r164702): Double tap doesn't stay under the new element once the animation finishes https://bugs.webkit.org/show_bug.cgi?id=132239 Reviewed by Sam Weinig. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::scalePage): The early-return added to WebPage::scalePage breaks callers who depend on being able to call scalePage() with the same scale but a different origin and having that change take effect. Page::setPageScaleFactor already has the requisite logic, so move the early return down after that call, and guard only notification of page scale changes. 2014-04-25 Andy Estes [iOS] Stop creating a WKWebResourceQuickLookDelegate for every WebResourceLoader https://bugs.webkit.org/show_bug.cgi?id=132215 Reviewed by Dan Bernstein. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo): Called QuickLookHandle::create() directly. * WebProcess/Network/WebResourceLoader.h: * WebProcess/ios/WebResourceLoaderIOS.mm: Removed. 2014-04-27 Sam Weinig [iOS WebKit2] Add support for text autosizing https://bugs.webkit.org/show_bug.cgi?id=132237 Reviewed by Tim Horton. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): * UIProcess/WebPageProxy.h: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::textAutosizingWidth): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): Pass the text autosizing width from the UIProcess to WebProcess. 2014-04-27 Tim Horton WebKit2 View Gestures (Zoom): Pages with 'background-attachment: fixed' don't behave correctly when zoomed https://bugs.webkit.org/show_bug.cgi?id=132225 Reviewed by Darin Adler. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::layerForTransientZoom): (WebKit::TiledCoreAnimationDrawingArea::shadowLayerForTransientZoom): (WebKit::TiledCoreAnimationDrawingArea::adjustTransientZoom): (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom): (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage): Factor out code to choose which layer (and shadow layer) to apply the transient zoom to. If we have a contentsContainmentLayer (because we have composited background-attachment: fixed), it applies page scale, so we should apply the transient zoom to that layer instead of the RenderView's main GraphicsLayer. 2014-04-27 Pratik Solanki Unreviewed. iOS build fix. * UIProcess/ios/SmartMagnificationController.h: 2014-04-27 Zan Dobersek Move cross-port WebKit2 code to std::unique_ptr https://bugs.webkit.org/show_bug.cgi?id=129670 Reviewed by Darin Adler. Replace uses of OwnPtr, PassOwnPtr in cross-port WebKit2 code with std::unique_ptr. * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createIndex): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: * NetworkProcess/NetworkProcess.h: (WebKit::NetworkProcess::addSupplement): * NetworkProcess/SynchronousNetworkLoaderClient.cpp: (WebKit::SynchronousNetworkLoaderClient::didReceiveBuffer): * NetworkProcess/SynchronousNetworkLoaderClient.h: * Platform/IPC/Connection.cpp: (IPC::Connection::dispatchWorkQueueMessageReceiverMessage): * Platform/IPC/Connection.h: * Platform/IPC/MessageReceiver.h: * Platform/Module.h: * Platform/WorkQueue.h: * Platform/efl/ModuleEfl.cpp: (WebKit::Module::load): * Platform/mac/LayerHostingContext.mm: * Shared/APIURL.h: * Shared/Network/CustomProtocols/CustomProtocolManager.h: * Shared/Plugins/NPRemoteObjectMap.cpp: * Shared/ShareableBitmap.h: * UIProcess/DrawingAreaProxyImpl.h: * UIProcess/InspectorServer/WebSocketServer.cpp: (WebKit::WebSocketServer::didAcceptConnection): (WebKit::WebSocketServer::didCloseWebSocketServerConnection): * UIProcess/InspectorServer/WebSocketServer.h: * UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp: (WebKit::connectionCallback): * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::createDownloadProxy): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Notifications/WebNotificationManagerProxy.h: * UIProcess/Plugins/WebPluginSiteDataManager.cpp: (WebKit::WebPluginSiteDataManager::getSitesWithData): (WebKit::WebPluginSiteDataManager::clearSiteData): (WebKit::WebPluginSiteDataManager::didGetSitesWithDataForAllPlugins): (WebKit::WebPluginSiteDataManager::didClearSiteDataForAllPlugins): * UIProcess/Plugins/WebPluginSiteDataManager.h: * UIProcess/Storage/StorageManager.cpp: (WebKit::callCallbackFunction): (WebKit::StorageManager::getOriginsInternal): * UIProcess/WebPageProxy.cpp: (WebKit::ExceededDatabaseQuotaRecords::areBeingProcessed): (WebKit::ExceededDatabaseQuotaRecords::createRecord): (WebKit::ExceededDatabaseQuotaRecords::add): (WebKit::ExceededDatabaseQuotaRecords::next): (WebKit::WebPageProxy::handleMouseEvent): (WebKit::WebPageProxy::handleWheelEvent): (WebKit::WebPageProxy::processNextQueuedWheelEvent): (WebKit::WebPageProxy::internalShowContextMenu): * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::createDownloadProxy): * UIProcess/WebProcessProxy.h: * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::PluginDestructionProtector::PluginDestructionProtector): * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::deliverData): * WebProcess/Plugins/Netscape/NetscapePluginStream.h: * WebProcess/Plugins/PluginProcessConnectionManager.h: * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::initialize): (WebKit::PluginProxy::didCreatePluginInternal): (WebKit::PluginProxy::didFailToCreatePluginInternal): * WebProcess/Plugins/PluginProxy.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::createWebEvent): (WebKit::PluginView::handleEvent): * WebProcess/Plugins/PluginView.h: * WebProcess/WebCoreSupport/WebPopupMenu.h: * WebProcess/WebPage/EventDispatcher.cpp: (WebKit::EventDispatcher::EventDispatcher): * WebProcess/WebPage/EventDispatcher.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): (WebKit::WebPage::beginPrinting): * WebProcess/WebPage/WebPage.h: * WebProcess/WebProcess.h: (WebKit::WebProcess::addSupplement): 2014-04-27 Antti Koivisto Coalesce responses on network process side https://bugs.webkit.org/show_bug.cgi?id=132229 Reviewed by Andreas Kling. To reduce IPC we should coalesce response data in the network process and send it over with single IPC call. * NetworkProcess/AsynchronousNetworkLoaderClient.cpp: (WebKit::AsynchronousNetworkLoaderClient::AsynchronousNetworkLoaderClient): (WebKit::AsynchronousNetworkLoaderClient::didReceiveResponse): (WebKit::AsynchronousNetworkLoaderClient::didReceiveBuffer): (WebKit::AsynchronousNetworkLoaderClient::didFinishLoading): (WebKit::AsynchronousNetworkLoaderClient::didFail): (WebKit::AsynchronousNetworkLoaderClient::dispatchPartialCoalescedResponse): (WebKit::AsynchronousNetworkLoaderClient::clearCoalescedResponse): (WebKit::AsynchronousNetworkLoaderClient::responseCoalesceTimerFired): Coalesce the response. Completed response is sent on didFinishLoading. If the coalesce timer fires before that the data accumulated so far is dispatched. * NetworkProcess/AsynchronousNetworkLoaderClient.h: * NetworkProcess/NetworkResourceLoader.h: * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveCompleteResponse): * WebProcess/Network/WebResourceLoader.h: * WebProcess/Network/WebResourceLoader.messages.in: Add a new message type that covers didReceiveResponse, didReceiveBuffer and didFinishLoading in a single message. 2014-04-26 Tim Horton REGRESSION (r167775): Safari crashes in ViewSnapshotStore::pruneSnapshots after loading 20 pages https://bugs.webkit.org/show_bug.cgi?id=132204 Reviewed by Dan Bernstein and Sam Weinig. * UIProcess/mac/ViewSnapshotStore.mm: (WebKit::ViewSnapshotStore::pruneSnapshots): (WebKit::ViewSnapshotStore::recordSnapshot): Fix a bug where the count of snapshots with live images was too high because we were failing to decrement it when replacing a snapshot of an existing item with a fresh one. 2014-04-26 Dan Bernstein [Cocoa] Rename a bundle form delegate method https://bugs.webkit.org/show_bug.cgi?id=132221 Reviewed by Adele Peterson. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Renamed. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Check for the method under the old (“new”) name and under the new name. 2014-04-25 Dan Bernstein [Cocoa] Synthesized getter for WKNavigationAction's _userInitiated property has the wrong name https://bugs.webkit.org/show_bug.cgi?id=132219 Reviewed by Sam Weinig. * UIProcess/API/Cocoa/WKNavigationActionInternal.h: 2014-04-25 Simon Fraser [iOS] getAssistedNodeInformation crashes getting the bounding box if it doesn't have a renderer https://bugs.webkit.org/show_bug.cgi?id=132217 Reviewed by Dean Jackson. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getAssistedNodeInformation): Check that m_assistedNode has a renderer before asking for its bounding box. 2014-04-25 Benjamin Poulain [iOS][WK2] Add an intermediary view to do the target transform and adjustment transform https://bugs.webkit.org/show_bug.cgi?id=132175 Reviewed by Enrica Casucci. Some utility views of WKContentView account for the transforms between the content view and the utility view. Since the dynamic resize relies on setting subLayerTransforms, it is getting in the way. This patch adds a layer in between for the animation. That way the content view remains unscaled. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:WebKit::]): (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _endAnimatedResize]): 2014-04-25 Enrica Casucci REGRESSION (iOS WebKit2): Selection is not being repainted during live resize. https://bugs.webkit.org/show_bug.cgi?id=132216 Reviewed by Benjamin Poulain. Since the selection is drawn in the UIProcess on iOS, we need to update the selection rects and force a repaint during a live resize. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidLayout): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateSelectionAppearance): 2014-04-25 Brady Eidson Add a selection overlay. and https://bugs.webkit.org/show_bug.cgi?id=132200 Reviewed by David Hyatt. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::selectionRectsDidChange): Pass the new selection rects on to the selection overlay controller. * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebPage/SelectionOverlayController.cpp: Added. (WebKit::SelectionOverlayController::SelectionOverlayController): (WebKit::SelectionOverlayController::createOverlayIfNeeded): (WebKit::SelectionOverlayController::destroyOverlay): (WebKit::SelectionOverlayController::pageOverlayDestroyed): (WebKit::SelectionOverlayController::willMoveToWebPage): (WebKit::SelectionOverlayController::didMoveToWebPage): (WebKit::SelectionOverlayController::selectionRectsDidChange): (WebKit::SelectionOverlayController::drawRect): (WebKit::SelectionOverlayController::mouseEvent): * WebProcess/WebPage/SelectionOverlayController.h: Added. (WebKit::SelectionOverlayController::create): * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm: Added. (WebKit::SelectionOverlayController::drawRect): (WebKit::SelectionOverlayController::mouseEvent): (WebKit::SelectionOverlayController::handleClick): (WebKit::SelectionOverlayController::clearHighlight): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::selectionOverlayController): * WebProcess/WebPage/WebPage.h: 2014-04-25 Enrica Casucci Remove duplicate member variable in WKAutocorrectionRects and WKAutocorrectionContext. https://bugs.webkit.org/show_bug.cgi?id=132206 Reviewed by Benjamin Poulain. * UIProcess/ios/WKContentViewInteraction.mm: 2014-04-25 Dean Jackson Allow a platform-specific size enumeration to be passed into popup-menu display https://bugs.webkit.org/show_bug.cgi?id=132195 Reviewed by Brent Fulgham. With some in-person review comments from Sam Weinig. Platforms like OS X use a set of predefined sizes for built-in controls used for