2014-09-13 Babak Shafiei <bshafiei@apple.com> Merge r173595 2014-09-12 Tim Horton <timothy_horton@apple.com> Swiping back from a Twitter image to Twitter flashes to the wrong position https://bugs.webkit.org/show_bug.cgi?id=136798 <rdar://problem/18324338> Reviewed by Darin Adler and Sam Weinig. * UIProcess/mac/ViewGestureController.h: * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::ViewGestureController): (WebKit::ViewGestureController::didFinishLoadForMainFrame): (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame): Add a 250ms repeating timer that we start in didFinishLoadForMainFrame if we are for some reason still loading, and in didSameDocumentNavigationForMainFrame unconditionally, to match behavior of the old swipe implementation. Also, do the active gesture check in both of those places so that we don't start the timer if we're in the middle of a live swipe or have already torn down the snapshot (removeSwipeSnapshotAfterRepaint does this as well, so this isn't really a behavior change). (WebKit::ViewGestureController::activeLoadMonitoringTimerFired): Every time the timer fires, check if we're still loading; if not, tear down the swipe snapshot (after repainting). (WebKit::ViewGestureController::removeSwipeSnapshotAfterRepaint): Stop the active load monitoring timer. 2014-09-12 Lucas Forschler <lforschler@apple.com> Merge r173573 2014-09-12 Tim Horton <timothy_horton@apple.com> Flash of page scrolled to wrong origin before restoring scroll position after swiping back to CNN front page from an article https://bugs.webkit.org/show_bug.cgi?id=136788 <rdar://problem/18314597> Reviewed by Sam Weinig. * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::didHitRenderTreeSizeThreshold): (WebKit::ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame): Always wait until didFinishLoadForMainFrame or didSameDocumentNavigationForMainFrame before removing the snapshot, because otherwise we don't know if the scroll position has been restored yet. We should revisit this at some point, because it should be possible to determine if the scroll position has been restored appropriately, but for now it is safest to restore the antique behavior. 2014-08-29 Lucas Forschler <lforschler@apple.com> Merge r173121 2014-08-29 Alexey Proskuryakov <ap@apple.com> Crashes in IPC code under VisitedLinkProvider::pendingVisitedLinksTimerFired https://bugs.webkit.org/show_bug.cgi?id=136384 rdar://problem/16991213 Reviewed by Sam Weinig. VisitedLinkProvider process tracking relied on a combination of WebPageProxy process lifecycle notifications and checking process state. As evidenced by multiple FIXMEs, these are not yet as reliable as they should be. Changed to unregister a process when it closes, not when it no longer has any pages using the particular VisitedLinkProvider or WebUserContentControllerProxy. This is a deoptimization that should not matter in practice. * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::~WebUserContentControllerProxy): (WebKit::WebUserContentControllerProxy::removeProcess): (WebKit::WebUserContentControllerProxy::addUserScript): (WebKit::WebUserContentControllerProxy::removeAllUserScripts): (WebKit::WebUserContentControllerProxy::addUserStyleSheet): (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets): (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler): (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName): * UIProcess/UserContent/WebUserContentControllerProxy.h: * UIProcess/VisitedLinkProvider.cpp: (WebKit::VisitedLinkProvider::~VisitedLinkProvider): (WebKit::VisitedLinkProvider::removeProcess): (WebKit::VisitedLinkProvider::removeAll): (WebKit::VisitedLinkProvider::pendingVisitedLinksTimerFired): (WebKit::VisitedLinkProvider::resizeTable): * UIProcess/VisitedLinkProvider.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::close): (WebKit::WebPageProxy::processDidFinishLaunching): (WebKit::WebPageProxy::resetStateAfterProcessExited): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::disconnect): (WebKit::WebProcessProxy::addVisitedLinkProvider): (WebKit::WebProcessProxy::addWebUserContentControllerProxy): (WebKit::WebProcessProxy::didDestroyVisitedLinkProvider): (WebKit::WebProcessProxy::didDestroyWebUserContentControllerProxy): * UIProcess/WebProcessProxy.h: 2014-08-29 Lucas Forschler <lforschler@apple.com> Merge r173118 2014-08-29 Alexey Proskuryakov <ap@apple.com> WebPageProxy::close() is a no-op for terminated processes https://bugs.webkit.org/show_bug.cgi?id=136378 Related to <rdar://problem/16991213> and to <rdar://problem/17095600> Reviewed by Brady Eidson. Also fixes issues that got uncovered after making close() work. * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::invalidate): Don't close the page, because it makes no sense, and causes an assertion now. Previosly, this was OK because the page was invalid already, and close() was a no-op. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::~WebPageProxy): Added some assertions to catch invalidation issues earlier. (WebKit::WebPageProxy::reattachToWebProcess): Make it an invariant that a page's process always has a message receiver for it, until close() removes it. (WebKit::WebPageProxy::close): Make this function work for all open pages, whether they have a page or not. (WebKit::WebPageProxy::processDidFinishLaunching): Added an asserion that process agrees about its state. (WebKit::WebPageProxy::resetStateAfterProcessExited): Don't remove a message receiver, we now only do this in reattach or close. 2014-08-28 Lucas Forschler <lforschler@apple.com> Merge r173093 2014-08-28 Tim Horton <timothy_horton@apple.com> _setDidMoveSwipeSnapshotCallback's block should only be called if the snapshot is going to move https://bugs.webkit.org/show_bug.cgi?id=136354 <rdar://problem/18167791> Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKViewPrivate.h: Update the comment to note the new behavior. * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::beginSwipeGesture): Don't call the block until the snapshot is actually moving (if the snapshot never moves because it's behind the live view, don't call the block at all). 2014-08-28 Lucas Forschler <lforschler@apple.com> Merge r173092 2014-08-28 Tim Horton <timothy_horton@apple.com> Occasional thread-safety-related crashes on the ServicesController queue https://bugs.webkit.org/show_bug.cgi?id=136356 <rdar://problem/18045685> Reviewed by Dan Bernstein. * UIProcess/mac/ServicesController.mm: (WebKit::hasCompatibleServicesForItems): Added. Check directly with NSSharingService if we have any services for the given items. We should eventually check Viewer and Editor services separately so the Web process can be smarter about when it shows the overlay, but for now this maintains the existing behavior. (WebKit::ServicesController::refreshExistingServices): Make use of hasCompatibleServicesForItems instead of having NSSharingServicePicker construct NSMenus. 2014-08-28 Lucas Forschler <lforschler@apple.com> Merge r172989 2014-08-26 Joseph Pecoraro <pecoraro@apple.com> FileReader cannot read files selected with <input type="file"> 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-28 Lucas Forschler <lforschler@apple.com> Merge r171782 2014-07-29 Enrica Casucci <enrica@apple.com> REGRESSION [WebKit2 iOS]: Cannot add shortcut to user dictionary from non editable content. https://bugs.webkit.org/show_bug.cgi?id=135392 <rdar://problem/17760073> Reviewed by Benjamin Poulain. Adding a shortcut to the user dictionary needs to be available in non editable content too. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _addShortcut:]): 2014-08-28 Lucas Forschler <lforschler@apple.com> Merge r173078 2014-08-28 Tim Horton <timothy_horton@apple.com> WebKit2 doesn't support viewer services that accept image attachments https://bugs.webkit.org/show_bug.cgi?id=136349 <rdar://problem/18164606> Reviewed by Brady Eidson. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): Encode the already-existing parameter. 2014-08-28 Lucas Forschler <lforschler@apple.com> Merge r173040 2014-08-27 Tim Horton <timothy_horton@apple.com> WebKit2 swipe gesture should report the position of the snapshot to the client https://bugs.webkit.org/show_bug.cgi?id=136308 rdar://problem/18105827 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView _setDidMoveSwipeSnapshotCallback:]): Add _setDidMoveSwipeSnapshotCallback, and plumb it to ViewGestureController. Callers provide a block which is called whenever ViewGestureController moves the swipe *snapshot* layer around. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::boundsOfLayerInLayerBackedWindowCoordinates): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::boundsOfLayerInLayerBackedWindowCoordinates): Expose a Mac-only way to get the bounds of a given CALayer in window coordinates, respecting transforms. This only works for layer-backed windows because it uses CA in order to do the mapping respecting transforms. * UIProcess/mac/ViewGestureController.h: * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::ViewGestureController): (WebKit::ViewGestureController::~ViewGestureController): (WebKit::ViewGestureController::setDidMoveSwipeSnapshotCallback): Do the Block_copy and Block_release dance to keep our copy of the callback block. (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::handleSwipeGesture): (WebKit::ViewGestureController::didMoveSwipeSnapshotLayer): When the swipe snapshot layer moves around, call the block. 2014-08-28 Lucas Forschler <lforschler@apple.com> Merge r173029 2014-08-27 Tim Horton <timothy_horton@apple.com> Occasional crashes in commitTransientZoom's transaction completion block https://bugs.webkit.org/show_bug.cgi?id=136309 <rdar://problem/17215064> Reviewed by Dan Bernstein. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom): Hold a reference to zoomLayer and the WebPage. It's possible that either of these things could have gone away by the time the transaction is committed. 2014-08-28 Lucas Forschler <lforschler@apple.com> Merge r172939 2014-08-25 Brady Eidson <beidson@apple.com> Don't crash when the DataDetectors framework is unavailable. <rdar://problem/18106066> and https://bugs.webkit.org/show_bug.cgi?id=136234 Reviewed by Tim Horton. * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::ServicesOverlayController::buildPhoneNumberHighlights): Bail if DD.framework didn’t soft link. (WebKit::ServicesOverlayController::buildSelectionHighlight): Ditto. 2014-08-26 Dana Burkart <dburkart@apple.com> Merge r172988. <rdar://problem/17923694> 2014-08-26 Tim Horton <timothy_horton@apple.com> Crashes in ViewGestureController::beginSwipeGesture when swiping in rapid succession https://bugs.webkit.org/show_bug.cgi?id=136271 <rdar://problem/17923694> Reviewed by Simon Fraser. It was possible to get into trackSwipeGesture while another swipe was still occurring, because the guard against this happening depended on m_pendingSwipeReason never being set while a swipe was occurring. However, if the very first scroll event had sufficient magnitude, we would still set m_pendingSwipeReason to InsufficientMagnitude, and then *never clear it*, leading to a path around the guard against multiple live swipes. This in turn allowed stale layers in m_liveSwipeLayers, which lead to the crash. * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::handleScrollWheelEvent): Don't unset m_pendingSwipeReason before calling trackSwipeGesture; trackSwipeGesture will do it itself. Don't set m_pendingSwipeReason to InsufficientMagnitude if the event actually *has* sufficient magnitude to start a swipe. (WebKit::ViewGestureController::trackSwipeGesture): Assert that we don't have an active gesture while starting a swipe. Reset m_pendingSwipeReason, because the swipe is no longer pending! 2014-08-26 Dana Burkart <dburkart@apple.com> Merge r172966. <rdar://problem/18107826> 2014-08-26 Tim Horton <timothy_horton@apple.com> REGRESSION (r172771): Amazon product page becomes unresponsive after swiping back to it https://bugs.webkit.org/show_bug.cgi?id=136260 <rdar://problem/18107826> 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. 2014-08-19 Dana Burkart <dburkart@apple.com> Merge r172643. <rdar://problem/18032571> 2014-08-15 Enrica Casucci <enrica@apple.com> [Services with UI] Selections are incorrect when selecting three lines. https://bugs.webkit.org/show_bug.cgi?id=135989 <rdar://problem/18032571> Reviewed by Tim Horton. The stitching algorithm did not handle correctly the case of selections over three lines if the middle line is composed of only one rectangle. * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::stitchRects): 2014-08-19 Dana Burkart <dburkart@apple.com> Merge r172639. <rdar://problem/17957716> 2014-08-15 Tim Horton <timothy_horton@apple.com> Service overlays stay fixed when <iframe> scrolls https://bugs.webkit.org/show_bug.cgi?id=135959 <rdar://problem/17957716> Reviewed by Enrica Casucci. * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::ServicesOverlayController::highlightsAreEquivalent): Tiny correctness fix; highlights can only be equivalent if their types are equivalent as well. 2014-08-19 Dana Burkart <dburkart@apple.com> Merge r172636. <rdar://problem/17957716> 2014-08-15 Tim Horton <timothy_horton@apple.com> Service overlays stay fixed when <iframe> scrolls https://bugs.webkit.org/show_bug.cgi?id=135959 <rdar://problem/17957716> Reviewed by Enrica Casucci. * WebProcess/WebPage/PageOverlay.cpp: (WebKit::PageOverlay::didScrollFrame): * WebProcess/WebPage/PageOverlay.h: (WebKit::PageOverlay::Client::didScrollFrame): * WebProcess/WebPage/PageOverlayController.cpp: (WebKit::PageOverlayController::didScrollFrame): Push didScrollFrame down to the overlays. * WebProcess/WebPage/ServicesOverlayController.h: * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::ServicesOverlayController::Highlight::createForSelection): Hold on to the selection's Range so we can use it to compare Highlights later. (WebKit::ServicesOverlayController::Highlight::Highlight): (WebKit::ServicesOverlayController::Highlight::setDDHighlight): Factor the code to set up and paint the highlight out, so that we can set a new DDHighlightRef on a Highlight and the layer moves/reshapes/repaints. (WebKit::ServicesOverlayController::buildPhoneNumberHighlights): (WebKit::ServicesOverlayController::buildSelectionHighlight): (WebKit::ServicesOverlayController::replaceHighlightsOfTypePreservingEquivalentHighlights): Factor replaceHighlightsOfTypePreservingEquivalentHighlights out so that we can use it for buildSelectionHighlight as well. Steal the DDHighlightRef from the new Highlight when re-using an old one so that the newly computed rects are used instead of the old ones. (WebKit::ServicesOverlayController::highlightsAreEquivalent): We will always have a Range now, so we can always check equivalence using it. (WebKit::ServicesOverlayController::didScrollFrame): Rebuild all highlights upon subframe scroll, as they might have moved. We could optimize this in the future, but for now it's cheap enough and rare enough that it doesn't matter. 2014-08-19 Dana Burkart <dburkart@apple.com> Merge r172635. <rdar://problem/18006149> 2014-08-15 Tim Horton <timothy_horton@apple.com> REGRESSION (WebKit2 Gestures): White flash when swiping back to cnn.com's homepage from an article https://bugs.webkit.org/show_bug.cgi?id=135951 <rdar://problem/18006149> Reviewed by Simon Fraser. Wait for (the first visually non-empty layout AND the render tree size threshold to be hit), OR didFinishLoadForFrame, whichever comes first. Once we've done the first visually non-empty layout, we'll start the watchdog and tear down the snapshot in three seconds no matter what. Also, force a repaint so we can asynchronously wait for the Web Process to paint and return to us before removing the snapshot, which improves our chances that something is actually on the screen. * UIProcess/API/mac/WKView.mm: (-[WKView _didFirstVisuallyNonEmptyLayoutForMainFrame]): (-[WKView _didFinishLoadForMainFrame]): (-[WKView _removeNavigationGestureSnapshot]): * UIProcess/API/mac/WKViewInternal.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFinishLoadForFrame): (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame): (WebKit::WebPageProxy::removeNavigationGestureSnapshot): * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame): (WebKit::PageClientImpl::didFinishLoadForMainFrame): * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame): (WebKit::PageClientImpl::didFinishLoadForMainFrame): (WebKit::PageClientImpl::removeNavigationGestureSnapshot): Plumb didFirstVisuallyNonEmptyLayoutForMainFrame and didFinishLoadForMainFrame through to ViewGestureController from WebPageProxy via the PageClient, etc. Ditto for removeNavigationGestureSnapshot, though it is called from a VoidCallback in ViewGestureController instead of from WebFrameLoaderClient and friends. * UIProcess/mac/ViewGestureController.h: * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::ViewGestureController): (WebKit::ViewGestureController::endSwipeGesture): When finishing a swipe, we want to wait for both the first visually non-empty layout and the render tree size threshold being hit. (WebKit::ViewGestureController::didHitRenderTreeSizeThreshold): (WebKit::ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame): When both of these things have happened, remove the swipe snapshot (after forcing a repaint). For didFirstVisuallyNonEmptyLayoutForMainFrame, we will also start a watchdog ensuring that we remove the snapshot in three seconds. (WebKit::ViewGestureController::didFinishLoadForMainFrame): When didFinishLoadForMainFrame happens, remove the swipe snapshot (after forcing a repaint). (WebKit::ViewGestureController::swipeSnapshotWatchdogTimerFired): If the watchdog timer fires, remove the swipe snapshot (after forcing a repaint). (WebKit::ViewGestureController::removeSwipeSnapshotAfterRepaint): Force a repaint and wait for the async callback before removing the snapshot. It is safe to hold on to the WebPageProxy here because it will always call all of its callbacks before it is destroyed. Avoid enqueuing multiple force-repaints. (WebKit::ViewGestureController::removeSwipeSnapshot): 2014-08-19 Dana Burkart <dburkart@apple.com> Merge r172596 2014-08-14 Enrica Casucci <enrica@apple.com> [Services with UI] Selection services don't work inside <iframes>. https://bugs.webkit.org/show_bug.cgi?id=135941 <rdar://problem/17957690> Reviewed by Tim Horton. Need to map the selection rectangles using the correct FrameView. When handling the click, we must use the selection from the focused frame. * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::ServicesOverlayController::buildSelectionHighlight): (WebKit::ServicesOverlayController::handleClick): 2014-08-19 Dana Burkart <dburkart@apple.com> Merge r172502 2014-08-12 Pratik Solanki <psolanki@apple.com> 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 <rdar://problem/17947880> 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-18 Dana Burkart <dburkart@apple.com> Merge r172680 2014-08-15 Alexey Proskuryakov <ap@apple.com> REGRESSION (r172660): WebKit2.TerminateTwice asserts https://bugs.webkit.org/show_bug.cgi?id=136012 * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::terminateProcess): Added bug number to a fixme. 2014-08-18 Dana Burkart <dburkart@apple.com> Merge r172660 2014-08-15 Alexey Proskuryakov <ap@apple.com> Improve page to process relationship tracking https://bugs.webkit.org/show_bug.cgi?id=135996 <rdar://problem/16991213> Reviewed by Sam Weinig. * UIProcess/VisitedLinkProvider.cpp: (WebKit::VisitedLinkProvider::removeAll): (WebKit::VisitedLinkProvider::pendingVisitedLinksTimerFired): (WebKit::VisitedLinkProvider::sendTable): Added assertions for m_processes only having valid entries. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::reattachToWebProcess): When attaching to a new process, tell the old process that the page is not longer associated with it, avoiding a potential stale pointer. If re-attached to an existing process, make sure that we perform all the same registrations as after having launched a new process. This substantially improves the behavior when the number of open tabs is over process limit. (WebKit::WebPageProxy::reattachToWebProcessWithItem): Added ASSERT(!isValid()) to avoid confusion. All other calls to reattachToWebProcess() have this as a runtime check, but reattachToWebProcessWithItem() is only called for valid pages. (WebKit::WebPageProxy::terminateProcess): Added an assertion with a FIXME for something that will need to be fixed another day. * UIProcess/WebPageProxy.h: Removed an unimplemented function. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::addExistingWebPage): Added assertions for page map sanity. (WebKit::WebProcessProxy::removeWebPage): Added a check for page state being Terminated already. This avoids an assertion failure that happened under the new call to removeWebPage() in reattachToWebProcess(), as we are now calling it for terminated processes that are not in WebContext::m_processes any more. (WebKit::WebProcessProxy::didFinishLaunching): Added an assertion that page agrees about using this process. 2014-08-13 Lucas Forschler <lforschler@apple.com> Merge r172546 2014-08-13 Enrica Casucci <enrica@apple.com> [Services with UI] Use a longer delay duration for editable content. https://bugs.webkit.org/show_bug.cgi?id=135918 <rdar://problem/17998929> Reviewed by Tim Horton. Use a 1 second delay for selections in editable content. * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown): 2014-08-13 Lucas Forschler <lforschler@apple.com> Merge r172539 2014-08-13 Joseph Pecoraro <pecoraro@apple.com> Opening Web Inspector causes a large amount of sandbox violations https://bugs.webkit.org/show_bug.cgi?id=135908 Reviewed by Timothy Hatcher. * WebProcess/com.apple.WebProcess.sb.in: Permit the WebContent process to create file read extensions for the system WebInspectorUI.framework which the Network process can already read anyways. 2014-08-13 Lucas Forschler <lforschler@apple.com> Merge r172528 2014-08-13 Tim Horton <timothy_horton@apple.com> Avoid making new active service overlay highlights while the mouse is down https://bugs.webkit.org/show_bug.cgi?id=135872 <rdar://problem/17982341> Reviewed by Enrica Casucci. * WebProcess/WebPage/ServicesOverlayController.h: * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown): (WebKit::ServicesOverlayController::mouseEvent): If the mouse is pressed or it's been less than 200ms since the mouse went up, don't allow the highlight to change. We apply the mouse-is-pressed rule to telephone number highlights as well, unlike the rest of the hysteresis logic. 2014-08-13 Lucas Forschler <lforschler@apple.com> Merge r172526 2014-08-13 Timothy Hatcher <timothy@apple.com> Web Inspector: Workaround a NSWindow change to the title bar. https://bugs.webkit.org/show_bug.cgi?id=135880 Reviewed by Joseph Pecoraro. * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::createInspectorWindow): Set titlebarAppearsTransparent on 10.10. Only call border thickness APIs on 10.9 and earlier. (WebKit::WebInspectorProxy::platformCreateInspectorPage): Only call setDrawsBackground: on 10.9 and earlier. (WebKit::WebInspectorProxy::platformSetToolbarHeight): Only call setContentBorderThickness: on 10.9 and earlier. 2014-08-13 Lucas Forschler <lforschler@apple.com> Merge r172512 2014-08-12 Tim Horton <timothy_horton@apple.com> Document-relative page overlays drop some mouse events with non-zero top content inset https://bugs.webkit.org/show_bug.cgi?id=135871 <rdar://problem/17982275> Reviewed by Beth Dakin. * WebProcess/WebPage/PageOverlay.cpp: (WebKit::PageOverlay::mouseEvent): Convert the mouse position into document-relative coordinates; the bounds() already are! This way, we can actually compare them without being wrong sometimes. 2014-08-13 Lucas Forschler <lforschler@apple.com> Merge r172501 2014-08-12 Tim Horton <timothy_horton@apple.com> Small region (~1px tall) where you get the selection button instead of the phone number overlay https://bugs.webkit.org/show_bug.cgi?id=135852 <rdar://problem/17992795> Reviewed by Enrica Casucci. * WebProcess/WebPage/ServicesOverlayController.h: * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight): (WebKit::ServicesOverlayController::determineActiveHighlight): If our new active highlight is a selection highlight that is completely contained by one of the phone number highlights, we'll make the phone number highlight active even if it's not hovered. This fixes the case where the selection highlight (a subset of a telephone number) is slightly taller than the telephone number highlight, and can be hovered without hovering the phone number highlight. 2014-08-13 Lucas Forschler <lforschler@apple.com> Merge r172500 2014-08-12 Alexey Proskuryakov <ap@apple.com> REGRESSION: WebContent process has a sandbox extension for the entirety of user's temp directory https://bugs.webkit.org/show_bug.cgi?id=135853 <rdar://problem/17986556> Reviewed by Oliver hunt. Move extensions recently added for iOS benefit under PLATFORM(IOS). Removed some dead code while at it (child processes don't need actual paths, they only need sandbox extensions in most cases). * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * Shared/Network/NetworkProcessCreationParameters.cpp: (WebKit::NetworkProcessCreationParameters::encode): (WebKit::NetworkProcessCreationParameters::decode): * Shared/Network/NetworkProcessCreationParameters.h: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/WebContext.cpp: (WebKit::WebContext::ensureNetworkProcess): (WebKit::WebContext::createNewWebProcess): (WebKit::WebContext::openGLCacheDirectory): Deleted. (WebKit::WebContext::networkingHSTSDatabasePath): Deleted. * UIProcess/WebContext.h: * UIProcess/efl/WebContextEfl.cpp: (WebKit::WebContext::containerTemporaryDirectory): Deleted. (WebKit::WebContext::platformDefaultNetworkingHSTSDatabasePath): Deleted. * UIProcess/gtk/WebContextGtk.cpp: (WebKit::WebContext::containerTemporaryDirectory): Deleted. (WebKit::WebContext::platformDefaultNetworkingHSTSDatabasePath): Deleted. * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::openGLCacheDirectory): (WebKit::WebContext::parentBundleDirectory): (WebKit::WebContext::networkingHSTSDatabasePath): (WebKit::WebContext::platformDefaultOpenGLCacheDirectory): Deleted. (WebKit::WebContext::platformDefaultNetworkingHSTSDatabasePath): Deleted. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2014-08-13 Lucas Forschler <lforschler@apple.com> Merge r172498 2014-08-12 Tim Horton <timothy_horton@apple.com> REGRESSION (r172424): Extra menu header in combined telephone number menu when no phone paired https://bugs.webkit.org/show_bug.cgi?id=135854 <rdar://problem/17996339> Reviewed by Enrica Casucci. * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::setupServicesMenu): Get all the menu items ahead of time, and only add the shared header if there are any telephone number menu items. 2014-08-13 Lucas Forschler <lforschler@apple.com> Merge r172497 2014-08-12 Enrica Casucci <enrica@apple.com> Crash at com.apple.WebKit.WebContent at com.apple.WebKit: WebKit::expandForGap https://bugs.webkit.org/show_bug.cgi?id=135859 <rdar://problem/17994679> Reviewed by Tim Horton. expandForGap made the assumption that the selection rects were always three. This was not true even before http://trac.webkit.org/changeset/172395 but was more likely to happen after that change. * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::expandForGap): 2014-08-13 Lucas Forschler <lforschler@apple.com> Merge r172484 2014-08-12 Tim Horton <timothy_horton@apple.com> Don't show the combined menu if there are no services available https://bugs.webkit.org/show_bug.cgi?id=135846 <rdar://problem/17582099> Reviewed by Enrica Casucci. * WebProcess/WebPage/ServicesOverlayController.h: Add a FIXME. * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::ServicesOverlayController::determineActiveHighlight): Don't allow a selection Highlight to become active if there is no service available to handle it. Previously we showed the combined menu with just phone numbers in it if any were detected. 2014-08-13 Lucas Forschler <lforschler@apple.com> Merge r172483 2014-08-12 Tim Horton <timothy_horton@apple.com> Add a fade transition to services highlights https://bugs.webkit.org/show_bug.cgi?id=135829 <rdar://problem/17935736> Reviewed by Enrica Casucci. Add a smooth fade to highlight installation and uninstallation. To do so, we make each highlight paint into its own small layer. * WebProcess/WebPage/PageOverlay.cpp: (WebKit::PageOverlay::layer): * WebProcess/WebPage/PageOverlay.h: * WebProcess/WebPage/PageOverlayController.cpp: (WebKit::PageOverlayController::layerForOverlay): * WebProcess/WebPage/PageOverlayController.h: Expose the GraphicsLayer on PageOverlay. * WebProcess/WebPage/ServicesOverlayController.h: (WebKit::ServicesOverlayController::Highlight::layer): (WebKit::ServicesOverlayController::activeHighlight): (WebKit::ServicesOverlayController::webPage): (WebKit::ServicesOverlayController::Highlight::Highlight): Deleted. * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::ServicesOverlayController::Highlight::createForSelection): (WebKit::ServicesOverlayController::Highlight::createForTelephoneNumber): (WebKit::ServicesOverlayController::Highlight::Highlight): Highlights now own a GraphicsLayer, which are later installed as sublayers of the ServicesOverlayController's PageOverlay layer. These layers are sized and positioned according to the DDHighlight's bounds. (WebKit::ServicesOverlayController::Highlight::~Highlight): (WebKit::ServicesOverlayController::Highlight::invalidate): ServicesOverlayController will invalidate any remaining highlights when it is torn down, so they can clear their backpointers. (WebKit::ServicesOverlayController::Highlight::notifyFlushRequired): Forward flush notifications to the DrawingArea. (WebKit::ServicesOverlayController::Highlight::paintContents): Paint the DDHighlight into the layer. Translation is done by the layer position, so we zero the bounds origin when painting. (WebKit::ServicesOverlayController::Highlight::deviceScaleFactor): Forward the deviceScaleFactor so that things are painted at the right scale. (WebKit::ServicesOverlayController::Highlight::fadeIn): (WebKit::ServicesOverlayController::Highlight::fadeOut): Apply a fade animation to the layer. (WebKit::ServicesOverlayController::Highlight::didFinishFadeOutAnimation): When the fade completes, unparent the layer, unless it has become active again. (WebKit::ServicesOverlayController::ServicesOverlayController): (WebKit::ServicesOverlayController::~ServicesOverlayController): Invalidate all highlights, so they can clear their backpointers. (WebKit::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown): Make remainingTimeUntilHighlightShouldBeShown act upon a particular highlight instead of always the active highlight. (WebKit::ServicesOverlayController::determineActiveHighlightTimerFired): Rename. (WebKit::ServicesOverlayController::drawRect): drawRect is no longer called and will no longer do anything; all of the painting is done in sublayers. (WebKit::ServicesOverlayController::buildPhoneNumberHighlights): Ensure that phone number Highlights stay stable even while the selection changes, by comparing the underlying Ranges and keeping around old Highlights that match the new ones. This enables us to e.g. fade in while changing the selection within a phone number. (WebKit::ServicesOverlayController::buildSelectionHighlight): (WebKit::ServicesOverlayController::didRebuildPotentialHighlights): (WebKit::ServicesOverlayController::createOverlayIfNeeded): Don't call setNeedsDisplay; the overlay doesn't have backing store. Instead, call determineActiveHighlight, which will install/uninstall highlights as necessary. (WebKit::ServicesOverlayController::determineActiveHighlight): Apply fade in/fade out to the overlays. Keep track of which highlight we're going to activate, until the hysteresis delay is up, then actually make it active/parent it/fade it in. We now will have no active highlight between the fade out of the previous one and the fade in of the new one (during the hysteresis delay). (WebKit::ServicesOverlayController::mouseEvent): The overlay now will not become active until the delay is up, so we don't need to check it again here. (WebKit::ServicesOverlayController::handleClick): (WebKit::ServicesOverlayController::didCreateHighlight): (WebKit::ServicesOverlayController::willDestroyHighlight): (WebKit::ServicesOverlayController::repaintHighlightTimerFired): Deleted. (WebKit::ServicesOverlayController::drawHighlight): Deleted. 2014-08-13 Lucas Forschler <lforschler@apple.com> Merge r172395 2014-08-08 Enrica Casucci <enrica@apple.com> [Services with UI] Action menu arrow hit testing is sometimes wrong. https://bugs.webkit.org/show_bug.cgi?id=135776 <rdar://problem/17837670> Reviewed by Brady Eidson. There was a problem in the algorithm that stitches together the selection rectangles to be given to Data Detectors API. This change adds a new function that stiches together all the rects contributing to the first line, all the rects contributing to the last line and all the ones in the middle. This way we can have a maximum of 3 non overlapping rectangles. * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::stitchRects): (WebKit::compactRectsWithGapRects): 2014-08-13 Lucas Forschler <lforschler@apple.com> Merge r172383 2014-08-10 Tim Horton <timothy_horton@apple.com> Yelp phone number highlights often disappear https://bugs.webkit.org/show_bug.cgi?id=135789 <rdar://problem/17971057> Reviewed by Brady Eidson. Since selectedTelephoneNumberRangesChanged doesn't provide an associated Frame, an incoming selectedTelephoneNumberRangesChanged from a subframe would overwrite ServicesOverlayController's cached (and potentially active) telephone number highlights. This happens a lot on Yelp, because they have many subframes which are doing layout on a regular basis. * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::selectedTelephoneNumberRangesChanged): * WebProcess/WebCoreSupport/WebEditorClient.h: Adjust to the new (lack of) arguments. * WebProcess/WebPage/ServicesOverlayController.h: * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged): Adjust logging; we can revisit it later. (WebKit::ServicesOverlayController::buildPhoneNumberHighlights): When building phone number highlights, walk the Frame tree and retrieve them from all of the Editors. (WebKit::ServicesOverlayController::didRebuildPotentialHighlights): (WebKit::ServicesOverlayController::telephoneNumberRangesForFocusedFrame): (WebKit::ServicesOverlayController::determineActiveHighlight): (WebKit::ServicesOverlayController::handleClick): Retrieve the detected telephone number ranges from the focused frame when combining telephone numbers with selection services. This ensures that we don't show combined phone number highlights from other frames. 2014-08-13 Lucas Forschler <lforschler@apple.com> Merge r172382 2014-08-10 Tim Horton <timothy_horton@apple.com> Refactor ServiceOverlayController in preparation for fading between highlights https://bugs.webkit.org/show_bug.cgi?id=135787 <rdar://problem/17935736> Reviewed by Brady Eidson. Rework ServicesOverlayController so that we always keep a set of generic "potential highlights", which are refcounted Highlight objects and wrap a DDHighlightRef, as well as a type (Selection or TelephoneNumber), Range (only used in the case of TelephoneNumber), and potentially more things in the future (like, say, fade state!). We eagerly update the list of potential highlights when the selection or set of detected telephone numbers changes, and use this information to install or uninstall the page overlay as needed. When we need to recompute the "active" highlight from this set (for example, we need to handle a mouse event or paint the highlight), we look through the set of potential highlights and decide. This moves the "active" highlight decision logic into one small and confined place. * WebProcess/WebPage/ServicesOverlayController.h: (WebKit::ServicesOverlayController::Highlight): Add the new aforementioned refcounted Highlight class. Rename m_lastHoveredHighlightChangeTime to m_lastActiveHighlightChangeTime. Make m_webPage a reference. The rest is just added/removed/adjusted functions for the refactoring. (WebKit::TelephoneNumberData::TelephoneNumberData): Deleted. * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::ServicesOverlayController::Highlight::createForSelection): (WebKit::ServicesOverlayController::Highlight::createForTelephoneNumber): Create Highlights for the two different highlight types. (WebKit::ServicesOverlayController::ServicesOverlayController): (WebKit::ServicesOverlayController::willMoveToWebPage): Our WebPage pointer is always valid because it owns us; don't clear it. We need to keep it around so that we can uninstall the overlay and install it again later, anyway. (WebKit::ServicesOverlayController::selectionRectsDidChange): (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged): When selection rects or detected telephone numbers change, rebuild potential highlights. This will have the side-effect of installing the overlay if needed. (WebKit::ServicesOverlayController::mouseIsOverHighlight): Make this function take a Highlight instead of a DDHighlightRef. (WebKit::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown): Make this function take a Highlight instead of a DDHighlightRef. (WebKit::ServicesOverlayController::drawHighlight): Make this function take a Highlight instead of a DDHighlightRef. There's no reason to do the translation separately from the layer blit, also allowing us to avoid the StateSaver. (WebKit::ServicesOverlayController::drawRect): drawRect now always paints the active highlight, instead of duplicating logic about which highlight should be active. Also, it will update the active highlight before painting. We no longer need to re-determine whether the active highlight's phone number range is still a valid phone number range, because we rebuild the potential highlights whenever the set of phone number ranges changes. (WebKit::ServicesOverlayController::clearActiveHighlight): Mostly an adoption of new names. (WebKit::ServicesOverlayController::removeAllPotentialHighlightsOfType): Run through the list of potential highlights and remove any of the given type. The two highlight building functions use this helper to clear the old ones before building. (WebKit::ServicesOverlayController::buildPhoneNumberHighlights): (WebKit::ServicesOverlayController::buildSelectionHighlight): Rebuild the list of potential highlights, replacing all highlights of the given type with new ones. (WebKit::ServicesOverlayController::hasRelevantSelectionServices): Factor out the code that decides whether our current selection is viable for servicing based on whether we have plain-text and/or rich-text services. (WebKit::ServicesOverlayController::didRebuildPotentialHighlights): When rebuilding potential highlights, if we have no potential highlights at all, uninstall the page overlay; we don't need mouse tracking and don't need to paint anything. This improves memory use and compositing performance significantly, where previously we were leaving the overlay up forever after creating it. If we have either detected telephone numbers or relevant selection services, create and install the overlay if it doesn't already exist. (WebKit::ServicesOverlayController::createOverlayIfNeeded): This just moved from elsehwere, except that it now uses FadeMode::DoNotFade. It doesn't make sense to fade on install/uninstall (which happens even before hover) but not on changing the active highlight; fading will be re-addressed in the next patch. (WebKit::ServicesOverlayController::highlightsAreEquivalent): Determine whether two highlights are equivalent. While we may have created a new Highlight at rebuild time, if two telephone number highlights have equivalent ranges, there's no need to 'transition' to the new one. (WebKit::ServicesOverlayController::determineActiveHighlight): Run through the list of services, and try to find one that is hovered. We prefer telephone number highlights to selection highlights, and we will never make a selection highlight active if it is both not serviceable and there are no telephone numbers to show in the combined menu. This is the centralized location for determination of which highlight should be considered active. If the active highlight changed, update the time since last change and cancel the mouse-down tracking. (WebKit::ServicesOverlayController::mouseEvent): Adjust some comments to be more explanatory. A bunch of code moved out of here and into determineActiveHighlight. (WebKit::ServicesOverlayController::handleClick): Adjust to take a reference and use Highlight instead of DDHighlightRef. 2014-08-12 Matthew Hanson <matthew_hanson@apple.com> Rollout 172395. <rdar://problem/17837670> 2014-08-12 Lucas Forschler <lforschler@apple.com> Merge r172379 2014-08-10 Timothy Hatcher <timothy@apple.com> Web Inspector: new glyphs are visible on OS X 10.9 builds https://bugs.webkit.org/show_bug.cgi?id=135743 Reviewed by Joseph Pecoraro. * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::createInspectorWindow): Use 10100 instead of 1090 for the version. 2014-08-12 Lucas Forschler <lforschler@apple.com> Merge r172424 2014-08-11 Enrica Casucci <enrica@apple.com> Improve look and feel of combined service menu.. https://bugs.webkit.org/show_bug.cgi?id=135824 <rdar://problem/17936880> Reviewed by Tim Horton. When showing the combined menu, list the phone numbers first, grouped under a common header, followed by the entries relative to the services. * Platform/mac/MenuUtilities.h: * Platform/mac/MenuUtilities.mm: (WebKit::menuItemTitleForTelephoneNumberGroup): (WebKit::menuItemForTelephoneNumber): * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::setupServicesMenu): 2014-08-12 Lucas Forschler <lforschler@apple.com> Merge r172406 2014-08-11 Joseph Pecoraro <pecoraro@apple.com> Add Private WKPreferences API for developer extras (show inspector) https://bugs.webkit.org/show_bug.cgi?id=135811 Reviewed by Timothy Hatcher. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _developerExtrasEnabled]): (-[WKPreferences _setDeveloperExtrasEnabled:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: 2014-08-12 Lucas Forschler <lforschler@apple.com> Merge r172395 2014-08-08 Enrica Casucci <enrica@apple.com> [Services with UI] Action menu arrow hit testing is sometimes wrong. https://bugs.webkit.org/show_bug.cgi?id=135776 <rdar://problem/17837670> Reviewed by Brady Eidson. There was a problem in the algorithm that stitches together the selection rectangles to be given to Data Detectors API. This change adds a new function that stiches together all the rects contributing to the first line, all the rects contributing to the last line and all the ones in the middle. This way we can have a maximum of 3 non overlapping rectangles. * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::stitchRects): (WebKit::compactRectsWithGapRects): 2014-08-12 Lucas Forschler <lforschler@apple.com> Merge r172374 2014-08-09 Tim Horton <timothy_horton@apple.com> REGRESSION (r172301): Combined phone number highlight doesn't appear if rich content is selected and we have no rich content services https://bugs.webkit.org/show_bug.cgi?id=135785 <rdar://problem/17969843> Reviewed by Brady Eidson. * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::ServicesOverlayController::drawSelectionHighlight): We can't early return in the rich-content-but-no-rich-services case if we have telephone numbers in the selection, because we want to offer them up in the combined menu. * UIProcess/mac/WebContextMenuProxyMac.mm: If we end up with no menu, because there were no services available, make a fresh one that we can fill with combined telephone number items. 2014-08-12 Lucas Forschler <lforschler@apple.com> Merge r172369 2014-08-08 Tim Horton <timothy_horton@apple.com> Build fix for 32-bit. * UIProcess/mac/ServicesController.mm: (WebKit::ServicesController::ServicesController): Don't dynamically refresh services in 32-bit apps. It's not possible to write a 32-bit app with the Modern API, so this doesn't matter. 2014-08-12 Lucas Forschler <lforschler@apple.com> Merge r172366 2014-08-08 Tim Horton <timothy_horton@apple.com> [mac] Dynamically update serviceability when the set of services changes https://bugs.webkit.org/show_bug.cgi?id=135738 <rdar://problem/17533459> Reviewed by Brady Eidson. * UIProcess/WebContext.cpp: (WebKit::WebContext::createNewWebProcess): Adopt the new universal refreshExistingServices. (WebKit::WebContext::refreshExistingServices): Deleted. * UIProcess/WebContext.h: Remove WebContext::refreshExistingServices; there's no need for it. * UIProcess/mac/ServicesController.h: * UIProcess/mac/ServicesController.mm: Fix the build with only public headers by including NSSharingService.h itself. Place the NSSharingServicePicker (Details) category outside the #ifdef. Forward-declare and possibly import NSExtension SPI. (WebKit::ServicesController::ServicesController): Register a callback to be notified whenever the set of services changes. When this occurs, call refreshExistingServices. We let refreshExistingServices coalesce updates because these notifications can come in small batches. (WebKit::ServicesController::refreshExistingServices): Dispatch changes in service availability to all processes in all contexts. * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::setupServicesMenu): Adjust the referenced rdar:// and call ServicesController::refreshExistingServices instead of the now-removed WebContext:: variant. We can't remove this yet because our services state can still be stale because NSServiceSharingPicker can still sometimes lie about the current service state immediately after a change occurs; once that is fixed, we should get rid of this as well as the refresh in Web Process creation. 2014-08-12 Lucas Forschler <lforschler@apple.com> Merge r172364 2014-08-08 Timothy Horton <timothy_horton@apple.com> Clients that request the selection services menu after WebKit2 will get one with different metrics than otherwise https://bugs.webkit.org/show_bug.cgi?id=135765 <rdar://problem/17962180> Reviewed by Brady Eidson. * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::setupServicesMenu): The menu is cached between clients, but we make adjustments to it. We should copy it before adjusting. 2014-08-12 Lucas Forschler <lforschler@apple.com> Merge r172344 2014-08-08 Timothy Horton <timothy_horton@apple.com> Services overlay dropdown is often in the wrong place with zoomed pages or horizontal scrolling https://bugs.webkit.org/show_bug.cgi?id=135755 <rdar://problem/17907752> Reviewed by Brady Eidson. * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::ServicesOverlayController::establishHoveredTelephoneHighlight): (WebKit::ServicesOverlayController::maybeCreateSelectionHighlight): DDHighlightCreateWithRectsInVisibleRectWithStyleAndDirection adjusts the location of the button based on the visible rect, trying to keep the button visible. We're handing it the wrong visible rect, though, not taking scrolling into account. This leads to pages that scroll horizontally showing the button on the left even if there's space for it on the right, or sometimes not showing it at all. Instead, provide the actual main FrameView visible rect; the same coordinate space that the highlight rects are provided in. 2014-08-12 Lucas Forschler <lforschler@apple.com> Merge r172343 2014-08-08 Timothy Horton <timothy_horton@apple.com> Additional items added to selection services menus are misaligned https://bugs.webkit.org/show_bug.cgi?id=135747 <rdar://problem/17933167> Reviewed by Brady Eidson. * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::setupServicesMenu): Use NSSharingServicePickerStyleRollover for the rollover image services menu; use NSSharingServicePickerStyleTextSelection for the selection services menu. Set NSMenu's showsStateColumn to YES for selection services menus, so that other items added to the menu line up correctly. Remove an unncessary .get() 2014-08-12 Lucas Forschler <lforschler@apple.com> Merge r172235 2014-08-07 Gordon Sheridan <gordon_sheridan@apple.com> Clear the m_previousItem member of HistoryControllers when it matches the HistoryItem being removed. https://bugs.webkit.org/show_bug.cgi?id=135634 <rdar://problem/17388461> Reviewed by Brady Eidson. * WebProcess/WebPage/WebBackForwardListProxy.cpp: (WebKit::WebBackForwardListProxy::removeItem): Call WebCore::Page::clearPreviousItemFromAllPages() for each item removed from the back/forward list to ensure the page URL is released from IconDatabase. 2014-08-07 Lucas Forschler <lforschler@apple.com> Merge r172322 2014-08-07 Tim Horton <timothy_horton@apple.com> [Services with UI] Action menu does not appear if selection includes both text and an image https://bugs.webkit.org/show_bug.cgi?id=135731 <rdar://problem/17837491> Reviewed by Dean Jackson. * UIProcess/WebContext.cpp: (WebKit::WebContext::createNewWebProcess): Initialize hasRichContentServices with the cached value. 2014-08-07 Dana Burkart <dburkart@apple.com> Merge r172307 2014-08-07 Timothy Horton <timothy_horton@apple.com> setCustomSwipeViews inside didChangeBackForwardList client callback is ignored https://bugs.webkit.org/show_bug.cgi?id=135633 <rdar://problem/17926507> Reviewed by Sam Weinig. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didChangeBackForwardList): * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::clearCustomSwipeViews): Deleted. * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::clearCustomSwipeViews): Deleted. WebKit clears the set of custom swipe views at the end of WebPageProxy::didChangeBackForwardList, *after* calling into the client. This means that if the client wants to setCustomSwipeViews in didChangeBackForwardList, it won't be respected. Since there's only one client of this SPI, let's just stop clearing the list of custom swipe views in WebKit and leave that totally up to the client. 2014-08-07 Dana Burkart <dburkart@apple.com> Merge r172301 2014-08-07 Enrica Casucci <enrica@apple.com> [Services with UI] Action menu does not appear if selection includes both text and an image. https://bugs.webkit.org/show_bug.cgi?id=135731 <rdar://problem/17837491> Reviewed by Brady Eidson. Adding a new setting to ServicesController to communicate to the WebProcess if there are services installed that can handle a combination of text and images. This way ServicesOverlayController can decide if it appropriate to show the hightlight based on the type of selection (text only or non text only). This information is retrieved when the selection rects are collected by SelectionGatherer and used by SelectionGatherer::Notifier to communicate the selection change. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::WebProcessCreationParameters): * Shared/WebProcessCreationParameters.h: * UIProcess/mac/ServicesController.h: (WebKit::ServicesController::hasRichContentServices): * UIProcess/mac/ServicesController.mm: (WebKit::ServicesController::ServicesController): (WebKit::ServicesController::refreshExistingServices): * WebProcess/WebCoreSupport/WebEditorClient.cpp: (WebKit::WebEditorClient::selectionRectsDidChange): * WebProcess/WebCoreSupport/WebEditorClient.h: * WebProcess/WebPage/ServicesOverlayController.h: * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::ServicesOverlayController::ServicesOverlayController): (WebKit::ServicesOverlayController::selectionRectsDidChange): (WebKit::ServicesOverlayController::drawSelectionHighlight): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): (WebKit::WebProcess::initializeWebProcess): (WebKit::WebProcess::setEnabledServices): * WebProcess/WebProcess.h: (WebKit::WebProcess::hasRichContentServices): * WebProcess/WebProcess.messages.in: 2014-08-07 Dana Burkart <dburkart@apple.com> Merge r172241 2014-08-07 Timothy Hatcher <timothy@apple.com> Web Inspector: Update glyphs to be more like Xcode 6 https://bugs.webkit.org/show_bug.cgi?id=135705 Reviewed by Joseph Pecoraro. * Resources/DockBottom.pdf: Added. * Resources/DockBottomLegacy.pdf: Copied from Source/WebKit/mac/Resources/Dock.pdf. * Resources/DockRight.pdf: Added. * Resources/DockRightLegacy.pdf: Copied from Source/WebKit2/Resources/DockRight.pdf. * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::createInspectorWindow): Use new images. * WebKit2.xcodeproj/project.pbxproj: Added new images. 2014-08-07 Dana Burkart <dburkart@apple.com> Merge r172238 2014-08-07 Oliver Hunt <oliver@apple.com> WebContent needs access to HSTS database due to some networking still being performed in process https://bugs.webkit.org/show_bug.cgi?id=135711 <rdar://17940220> 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 Dana Burkart <dburkart@apple.com> Merge r172191 2014-08-06 Andy Estes <aestes@apple.com> [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-07 Dana Burkart <dburkart@apple.com> Merge r172200 2014-08-06 Tim Horton <timothy_horton@apple.com> Services overlay flashes a lot; should have some hysteresis before showing overlay https://bugs.webkit.org/show_bug.cgi?id=135683 <rdar://problem/16878039> Reviewed by Simon Fraser. Don't show the highlight until it's been 200ms since the last change in selection or change in which highlight is hovered, whichever was more recent. * WebProcess/WebPage/ServicesOverlayController.h: * WebProcess/WebPage/mac/ServicesOverlayController.mm: (WebKit::ServicesOverlayController::ServicesOverlayController): (WebKit::ServicesOverlayController::selectionRectsDidChange): Keep track of when the selection last changed. (WebKit::ServicesOverlayController::drawTelephoneNumberHighlightIfVisible): Make establishHoveredTelephoneHighlight take a bool instead of Boolean. (WebKit::ServicesOverlayController::mouseIsOverHighlight): Factor mouseIsOverHighlight out of establishHoveredTelephoneHighlight and drawHighlight. (WebKit::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown): Return the amount of time until the highlight should be shown; this is the maximum of (the difference between the last selection change and the timeout) and (the difference between the last change in which highlight is hovered and the timeout). Telephone number highlights are shown immediately, because they are already stable by virtue of being expanded to include the entire telephone number. (WebKit::ServicesOverlayController::repaintHighlightTimerFired): (WebKit::ServicesOverlayController::drawHighlight): If the highlight shouldn't be shown yet (because we haven't hit the two timeouts), schedule a timer to repaint us around when we will hit the timeouts. (WebKit::ServicesOverlayController::establishHoveredTelephoneHighlight): (WebKit::ServicesOverlayController::mouseEvent): Don't allow mouseUp to trigger the menu if we shouldn't be showing the overlay yet. 2014-08-07 Dana Burkart <dburkart@apple.com> Merge r172193 2014-08-06 Brady Eidson and Jeffrey Pfau <beidson@apple.com> IDB transactions never reset if the Web Process ends before cleaning up https://bugs.webkit.org/show_bug.cgi?id=135218 Reviewed by Darin Adler and David Kilzer. * DatabaseProcess/DatabaseToWebProcessConnection.cpp: (WebKit::DatabaseToWebProcessConnection::didReceiveMessage): (WebKit::DatabaseToWebProcessConnection::didReceiveSyncMessage): Added. (WebKit::DatabaseToWebProcessConnection::didClose): * DatabaseProcess/DatabaseToWebProcessConnection.h: * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: (WebKit::DatabaseProcessIDBConnection::resetTransactionSync): Added Wait until the reset is complete before sending the sync reply. (WebKit::DatabaseProcessIDBConnection::rollbackTransactionSync): Added. Ditto. * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h: * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in: Keep track of all in progress transactions and make sure they’re cleaned up whenever a connection to a WebProcess is broken: * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::unregisterConnection): (WebKit::UniqueIDBDatabase::didCompleteTransactionOperation): (WebKit::UniqueIDBDatabase::openBackingStoreTransaction): (WebKit::UniqueIDBDatabase::resetBackingStoreTransaction): (WebKit::UniqueIDBDatabase::didEstablishTransaction): (WebKit::UniqueIDBDatabase::didResetTransaction): (WebKit::UniqueIDBDatabase::resetAllTransactions): (WebKit::UniqueIDBDatabase::finalizeRollback): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: (WebKit::UniqueIDBDatabaseBackingStoreSQLite::rollbackTransaction): Add sync versions of reset/rollback: * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp: (WebKit::WebIDBServerConnection::resetTransactionSync): (WebKit::WebIDBServerConnection::rollbackTransactionSync): * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h: 2014-08-07 Dana Burkart <dburkart@apple.com> Merge r172172 2014-08-06 Alexey Proskuryakov <ap@apple.com> REGRESSION (WebKit2): iOS Safari default encoding doesn't follow system language https://bugs.webkit.org/show_bug.cgi?id=135667 <rdar://problem/17862892> 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-07 Dana Burkart <dburkart@apple.com> Merge r172035. <rdar://problem/17869353> 2014-08-04 Andy Estes <aestes@apple.com> [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 Lucas Forschler <lforschler@apple.com> Merge r172104 2014-08-05 Tim Horton <timothy_horton@apple.com> REGRESSION (r164337): Pages are sometimes cut off/oriented incorrectly after using WKThumbnailView https://bugs.webkit.org/show_bug.cgi?id=135622 <rdar://problem/17202556> Reviewed by Dan Bernstein. In some cases (when the page changed scroll offset while thumbnailed), when transitioning back to thumbnail scale = 1, we would get the math wrong and end up with a non-identity sublayerTransform on the DrawingArea. Luckily, none of this code is necessary anymore, as the only client of WKThumbnailView only uses its snapshotting mode. * Shared/ImageOptions.h: Remove SnapshotOptionsRespectDrawingAreaTransform; DrawingArea no longer has a rootLayerTransform(). * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setThumbnailScale): Deleted. * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): (WebKit::WebPage::scaledSnapshotWithOptions): (WebKit::WebPage::snapshotAtSize): (WebKit::WebPage::setThumbnailScale): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: Remove setThumbnailScale and SnapshotOptionsRespectDrawingAreaTransform. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didCommitLoad): Revert this to its state before r164337, as we no longer have "thumbnail scale". * UIProcess/API/Cocoa/_WKThumbnailView.h: * UIProcess/API/Cocoa/_WKThumbnailView.mm: (-[_WKThumbnailView initWithFrame:fromWKView:]): (-[_WKThumbnailView _viewWasUnparented]): (-[_WKThumbnailView _viewWasParented]): (-[_WKThumbnailView _requestSnapshotIfNeeded]): (-[_WKThumbnailView setScale:]): Clean up code assuming _shouldApplyThumbnailScale = NO, _usesSnapshot = YES. (-[_WKThumbnailView setUsesSnapshot:]): (-[_WKThumbnailView usesSnapshot]): Always return YES from usesSnapshot; we only support snapshotting WKThumbnailViews. Ignore setUsesSnapshot. * UIProcess/API/mac/WKView.mm: (-[WKView _setThumbnailView:]): (-[WKView _updateThumbnailViewLayer]): Stop checking usesSnapshot; it's always true. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::setRootLayerTransform): Deleted. * WebProcess/WebPage/DrawingArea.cpp: (WebKit::DrawingArea::rootLayerTransform): Deleted. * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::setRootLayerTransform): Deleted. Remove rootLayerTransform() and setRootLayerTransform(). 2014-08-05 Lucas Forschler <lforschler@apple.com> Merge r172034 2014-08-05 Alexey Proskuryakov <ap@apple.com> Build fix. * UIProcess/WebContext.h: 2014-08-05 Lucas Forschler <lforschler@apple.com> Merge r172031 2014-08-05 Oliver Hunt <oliver@apple.com> SSO expects to be able to walk parent application's bundle https://bugs.webkit.org/show_bug.cgi?id=135581 <rdar://problem/17864079> 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 Lucas Forschler <lforschler@apple.com> Merge r172016 2014-08-04 Benjamin Poulain <bpoulain@apple.com> Check for null frame when processing geolocation authorization request https://bugs.webkit.org/show_bug.cgi?id=135577 <rdar://problem/17896295> 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 Lucas Forschler <lforschler@apple.com> Merge r171973 2014-08-02 Jeremy Jones <jeremyj@apple.com> 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-05 Lucas Forschler <lforschler@apple.com> Merge r171959 2014-08-01 Joseph Pecoraro <pecoraro@apple.com> [iOS WK2] Add extension read permission to network sandbox profile <rdar://problem/17671574> Reviewed by Alexey Proskuryakov and Oliver Hunt. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: 2014-08-05 Lucas Forschler <lforschler@apple.com> Merge r171943 2014-08-01 Oliver Hunt <oliver@apple.com> 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 <rdar://17869279> 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-05 Lucas Forschler <lforschler@apple.com> Merge r171928 2014-08-01 Dan Bernstein <mitz@apple.com> <rdar://problem/17862013> REGRESSION (r169357): Disabling "allow plug-ins" doesn't stick on quit/relaunch https://bugs.webkit.org/show_bug.cgi?id=135511 Reviewed by Alexey Proskuryakov. Since the values map in the preferences store doesn’t include values that are equal to the defaults, we need to update it when a new default is registered. * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::createWithLegacyDefaults): Changed to use new member functions for registering defaults. (WebKit::WebPreferences::registerDefaultBoolValueForKey): Added. Sets an override default in the store, and sets the user default, if there is one, on top of it. (WebKit::WebPreferences::registerDefaultUInt32ValueForKey): Ditto. * UIProcess/WebPreferences.h: Declared new member functions for getting the user default value for a key. * UIProcess/efl/WebPreferencesEfl.cpp: (WebKit::WebPreferences::platformGetStringUserValueForKey): Added an implementation that returns false, because the EFL port doesn’t support persistent user defaults. (WebKit::WebPreferences::platformGetBoolUserValueForKey): Ditto. (WebKit::WebPreferences::platformGetUInt32UserValueForKey): Ditto. (WebKit::WebPreferences::platformGetDoubleUserValueForKey): Ditto. * UIProcess/gtk/WebPreferencesGtk.cpp: (WebKit::WebPreferences::platformGetStringUserValueForKey): Ditto for the GTK port. (WebKit::WebPreferences::platformGetBoolUserValueForKey): Ditto. (WebKit::WebPreferences::platformGetUInt32UserValueForKey): Ditto. (WebKit::WebPreferences::platformGetDoubleUserValueForKey): Ditto. * UIProcess/mac/WebPreferencesMac.mm: (WebKit::WebPreferences::platformGetStringUserValueForKey): Added. Replaces setStringValueIfInUserDefaults, on which it is based. (WebKit::WebPreferences::platformGetBoolUserValueForKey): Similarly for booleans. (WebKit::WebPreferences::platformGetUInt32UserValueForKey): Similarly for integers. (WebKit::WebPreferences::platformGetDoubleUserValueForKey): Similarly for doubles. (WebKit::WebPreferences::platformInitializeStore): Changed to use the above functions. 2014-08-05 Lucas Forschler <lforschler@apple.com> Merge r171920 2014-08-01 Brent Fulgham <bfulgham@apple.com> [Mac] Fullscreen mode for some applications shows only a black screen. https://bugs.webkit.org/show_bug.cgi?id=135493 <rdar://problem/17628212> Reviewed by Jer Noble. In some applications, the window hosting the WKView is an InProcess layer hosting mode. The fullscreen window created by the WKFullScreenWindowController defaults to an OutOfProcess mode. When this kind of mismatch is encountered, the WK2 layer in the UI process is supposed to send a message back to the WebProcess indicating that the layer hosting mode of the containing window is different, so that the WebProcess can adjust its logic accordingly. Unfortunately, the notification that this had happened was not getting sent to the WebProcess due to an optimization in window state change logic (see Bug 135509 for details). The fix is to check layer hosting mode state when a WKView is added to a window, and notify the WebProcess when it needs to change state to match. * UIProcess/API/mac/WKView.mm: (-[WKView viewDidMoveToWindow]): When moving to a new window, always call 'layerHostingModeDidChange' to pick up any changes in the layer hosting mode. 2014-08-05 Lucas Forschler <lforschler@apple.com> Merge r171891 2014-07-31 Beth Dakin <bdakin@apple.com> Hit-testing broken in WebKit 1 views with AppKit's contentInsets https://bugs.webkit.org/show_bug.cgi?id=135434 -and corresponding- <rdar://problem/17850323> Reviewed by Benjamin Poulain. Re-named functions. * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::convertFromScrollbarToContainingView): (WebKit::PDFPlugin::convertFromContainingViewToScrollbar): 2014-08-05 Lucas Forschler <lforschler@apple.com> Merge r171887 2014-07-31 Oliver Hunt <oliver@apple.com> Various SSO services need the networking process to be able to spoof its bundle id https://bugs.webkit.org/show_bug.cgi?id=135468 <rdar://problem/17864139> Reviewed by Alexey Proskuryakov. Just add the entitlement required to allow the sandbox to let this happen. * Configurations/Network-iOS.entitlements: 2014-07-30 Lucas Forschler <lforschler@apple.com> Merge r171829 2014-07-30 Enrica Casucci <enrica@apple.com> REGRESSION (WK2 iOS): Inline editing for Chinese and Japanese keyboards does not work in Safari. https://bugs.webkit.org/show_bug.cgi?id=135449 <rdar://problem/17824833> 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-30 Lucas Forschler <lforschler@apple.com> Merge r171749 2014-07-29 Brady Eidson <beidson@apple.com> Make WKOriginDataManager actually operate on IndexedDatabases. https://bugs.webkit.org/show_bug.cgi?id=135346 Reviewed by Sam Weinig (and David Kilzer and Alex Christensen) * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::DatabaseProcess): (WebKit::DatabaseProcess::getIndexedDatabaseOrigins): (WebKit::DatabaseProcess::doGetIndexedDatabaseOrigins): (WebKit::removeAllDatabasesForOriginPath): Utility to delete all database files for the given origin path that have been modified between the given dates. (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigin): (WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesForOrigin): (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedBetweenDates): (WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesModifiedBetweenDates): (WebKit::DatabaseProcess::deleteAllIndexedDatabaseEntries): (WebKit::DatabaseProcess::doDeleteAllIndexedDatabaseEntries): * DatabaseProcess/DatabaseProcess.h: * Shared/WebCrossThreadCopier.cpp: (WebCore::SecurityOriginData>::copy): * Shared/WebCrossThreadCopier.h: * UIProcess/WebOriginDataManagerProxy.cpp: (WebKit::WebOriginDataManagerProxy::getOrigins): (WebKit::WebOriginDataManagerProxy::didGetOrigins): (WebKit::WebOriginDataManagerProxy::deleteEntriesForOrigin): (WebKit::WebOriginDataManagerProxy::deleteEntriesModifiedBetweenDates): (WebKit::WebOriginDataManagerProxy::deleteAllEntries): * WebProcess/OriginData/WebOriginDataManager.cpp: (WebKit::WebOriginDataManager::getOrigins): Pipe IDB requests through to the DatabaseProcess. (WebKit::WebOriginDataManager::deleteEntriesForOrigin): Ditto. (WebKit::WebOriginDataManager::deleteEntriesModifiedBetweenDates): Ditto. (WebKit::WebOriginDataManager::deleteAllEntries): Ditto. 2014-07-29 Lucas Forschler <lforschler@apple.com> Merge r171748 2014-07-29 Commit Queue <commit-queue@webkit.org> Unreviewed, rolling out r171704. https://bugs.webkit.org/show_bug.cgi?id=135389 Broke two IndexedDB tests (Requested by ap on #webkit). Reverted changeset: "IDB transactions never reset if the Web Process ends before cleaning up" https://bugs.webkit.org/show_bug.cgi?id=135218 http://trac.webkit.org/changeset/171704 2014-07-29 Lucas Forschler <lforschler@apple.com> Merge r171709 2014-07-28 Benjamin Poulain <bpoulain@apple.com> [iOS WK2] WKWebView sometime tries to change the size of a null DrawingAreaProxy https://bugs.webkit.org/show_bug.cgi?id=135368 <rdar://problem/16988887> 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-29 Lucas Forschler <lforschler@apple.com> Merge r171706 2014-07-28 Roger Fong <roger_fong@apple.com> Disable tagged strings for the plugin process. https://bugs.webkit.org/show_bug.cgi?id=135354 <rdar://problem/17295639>. Patch by Alexey Proskuryakov and Roger Fong. Reviewed by Anders Carlsson. * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::connectToReExecService): 2014-07-29 Lucas Forschler <lforschler@apple.com> Merge r171704 2014-07-25 Jeffrey Pfau <jpfau@apple.com> IDB transactions never reset if the Web Process ends before cleaning up https://bugs.webkit.org/show_bug.cgi?id=135218 Reviewed by Darin Adler. * DatabaseProcess/DatabaseToWebProcessConnection.cpp: (WebKit::DatabaseToWebProcessConnection::didClose): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::unregisterConnection): (WebKit::UniqueIDBDatabase::didCompleteTransactionOperation): (WebKit::UniqueIDBDatabase::openBackingStoreTransaction): (WebKit::UniqueIDBDatabase::resetBackingStoreTransaction): (WebKit::UniqueIDBDatabase::didEstablishTransaction): (WebKit::UniqueIDBDatabase::didResetTransaction): (WebKit::UniqueIDBDatabase::resetAllTransactions): (WebKit::UniqueIDBDatabase::finalizeRollback): (WebKit::UniqueIDBDatabase::absoluteDatabaseDirectory): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: (WebKit::UniqueIDBDatabaseBackingStoreSQLite::rollbackTransaction): 2014-07-27 Matthew Hanson <matthew_hanson@apple.com> Merge r171663. <rdar://problem/17818308> 2014-07-27 Gavin Barraclough <baraclough@apple.com> 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 <matthew_hanson@apple.com> Merge r171651. <rdar://problem/17682120> 2014-07-26 Enrica Casucci <enrica@apple.com> [WebKit2 iOS]Add support for caret movement for the 3rd party keyboard protocol. https://bugs.webkit.org/show_bug.cgi?id=135325 <rdar://problem/17682120> 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 <matthew_hanson@apple.com> Merge r171647. <rdar://problem/17315168> 2014-07-26 Timothy Horton <timothy_horton@apple.com> Crash in Web Content Process under ~PDFDocument under clearTouchEventListeners at topDocument() https://bugs.webkit.org/show_bug.cgi?id=135319 <rdar://problem/17315168> 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 <matthew_hanson@apple.com> Merge r171635. <rdar://problem/17782407> 2014-07-25 Jeremy Jones <jeremyj@apple.com> 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 <matthew_hanson@apple.com> Merge r171626. <rdar://problem/17730536> 2014-07-24 Anders Carlsson <andersca@apple.com> WKNavigation's properties are either always nil or don't behave as documented https://bugs.webkit.org/show_bug.cgi?id=135267 <rdar://problem/17730536> 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 <matthew_hanson@apple.com> Merge r171622. <rdar://problem/15917314> 2014-07-25 Brady Eidson <beidson@apple.com> 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 <matthew_hanson@apple.com> Merge r171629. <rdar://problem/17654369> 2014-07-25 Oliver Hunt <oliver@apple.com> 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 <dino@apple.com> Revert back to the Safari behavior from Mavericks and Mountain Lion on this branch. <rdar://problem/17800530> Follow-up comment from Dan Bernstein. * Shared/WebPreferencesDefinitions.h: Make sure this only applies to Mavericks and Mountain Lion. 2014-07-25 Dean Jackson <dino@apple.com> Revert back to the Safari behavior from Mavericks and Mountain Lion on this branch. <rdar://problem/17800530> Reviewed by Ricky Mondello. * Shared/WebPreferencesDefinitions.h: Set WebGL preference default to off. 2014-07-24 Lucas Forschler <lforschler@apple.com> Merge r171471 2014-07-23 Timothy Horton <timothy_horton@apple.com> REGRESSION (r171239): Much more time spent taking snapshots during the PLT https://bugs.webkit.org/show_bug.cgi?id=135177 <rdar://problem/17764847> 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 <lforschler@apple.com> Merge r171203 2014-07-17 Enrica Casucci <enrica@apple.com> [REGRESSION WK2]The menu bar does not show up when tapping on the caret. https://bugs.webkit.org/show_bug.cgi?id=135023 <rdar://problem/17617282> 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 <lforschler@apple.com> Merge r171576 2014-07-24 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] Do not try to hit test a null mainFrameRenderView on dynamicViewportSizeUpdate() https://bugs.webkit.org/show_bug.cgi?id=135277 <rdar://problem/17804891> 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 <rdar://problem/17804891> 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 <lforschler@apple.com> Merge r171570 2014-07-24 Tim Horton <timothy_horton@apple.com> Sometimes WKWebView is blank after resuming the app, until you scroll https://bugs.webkit.org/show_bug.cgi?id=135275 <rdar://problem/17803170> 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 <lforschler@apple.com> Merge r171560 2014-07-24 Simon Fraser <simon.fraser@apple.com> [iOS WK2] Header bar on nytimes articles lands in the wrong place after rubberbanding https://bugs.webkit.org/show_bug.cgi?id=135221 <rdar://problem/17542454> 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 <lforschler@apple.com> Merge r171540 2014-07-24 Dan Bernstein <mitz@apple.com> WebKit2 part of <rdar://problem/17766348> [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<ProtectionSpace>::encode): If encoding the space requires encoding the platform data, do that. (IPC::ArgumentCoder<ProtectionSpace>::decode): If platform data was encoded, decode it. * Shared/WebCoreArgumentCoders.h: * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Archive the NSURLProtectionSpace. (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Unarchive it. * Shared/soup/WebCoreArgumentCodersSoup.cpp: (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Added. (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Added. 2014-07-24 Lucas Forschler <lforschler@apple.com> Merge r171532 2014-07-24 Benjamin Poulain <benjamin@webkit.org> [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 <rdar://problem/17279500> 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 <lforschler@apple.com> Merge r171519 2014-07-24 Oliver Hunt <oliver@apple.com> Need to explicitly support location services in webcontent profile https://bugs.webkit.org/show_bug.cgi?id=135251 <rdar://17798346> 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 <lforschler@apple.com> Merge r171518 2014-07-24 Tim Horton <timothy_horton@apple.com> Crash at [WKContentView _applicationWillEnterForeground:] + 28 <rdar://problem/17797103> 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 <lforschler@apple.com> Merge r171485 2014-07-23 Dan Bernstein <mitz@apple.com> <rdar://problem/17782623> [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 <lforschler@apple.com> Merge r171201 2014-07-17 Benjamin Poulain <benjamin@webkit.org> [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 <lforschler@apple.com> Merge r171509 2014-07-23 Simon Fraser <simon.fraser@apple.com> [iOS WK2] Some help.apple.com pages not scrollable https://bugs.webkit.org/show_bug.cgi?id=135228 <rdar://problem/17790792> 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 <lforschler@apple.com> Merge r171507 2014-07-23 Benjamin Poulain <bpoulain@apple.com> [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 <lforschler@apple.com> Merge r171493 2014-07-23 Oliver Hunt <oliver@apple.com> Add a pseudo target to create sandbox override roots https://bugs.webkit.org/show_bug.cgi?id=135216 <rdar://17785560> 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 <matthew_hanson@apple.com> Merged r171490. <rdar://problem/17739108> 2014-07-23 Oliver Hunt <oliver@apple.com> Incorrect commit for sandbox profile https://bugs.webkit.org/show_bug.cgi?id=135214 <rdar://17739108> Reviewed by Anders Carlsson. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 2014-07-23 Lucas Forschler <lforschler@apple.com> Merge r171384 2014-07-22 Oliver Hunt <oliver@apple.com> Reduce the size of the root WebContent sandbox profile https://bugs.webkit.org/show_bug.cgi?id=135182 <rdar://problem/17739108> 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 <lforschler@apple.com> Merge r171370 2014-07-22 Enrica Casucci <enrica@apple.com> REGRESSION (WebKit2): Selection inside accelerated overflow:scroll doesn't track scrolling. https://bugs.webkit.org/show_bug.cgi?id=135180 <rdar://problem/16721055> 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 <lforschler@apple.com> Merge r171368 2014-07-22 Benjamin Poulain <bpoulain@apple.com> [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 <rdar://problem/17740149> 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 <lforschler@apple.com> Merge r171363 2014-07-22 Oliver Hunt <oliver@apple.com> Remove unused com.apple.webkit.* rules from profiles https://bugs.webkit.org/show_bug.cgi?id=135174 <rdar://17755931> 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 <lforschler@apple.com> Merge r171373 2014-07-22 Jinwoo Song <jinwoo7.song@samsung.com> 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 <lforschler@apple.com> Merge r171356 2014-07-22 Oliver Hunt <oliver@apple.com> Provide networking process with access to its HSTS db https://bugs.webkit.org/show_bug.cgi?id=135121 <rdar://17654369> 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 <lforschler@apple.com> Merge r171352 2014-07-22 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] UI helpers that zoom on an element ignore the viewport's allowsUserScaling https://bugs.webkit.org/show_bug.cgi?id=135140 <rdar://problem/17754921> 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 <lforschler@apple.com> Merge r171345 2014-07-22 Jeremy Jones <jeremyj@apple.com> 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 <dburkart@apple.com> Merge r171336. 2014-07-21 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] Improve event throttling for Scroll Events https://bugs.webkit.org/show_bug.cgi?id=135082 <rdar://problem/17445266> 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 <dburkart@apple.com> Merge r171329. 2014-07-21 Simon Fraser <simon.fraser@apple.com> 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 <rdar://problem/17627525> 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 <dburkart@apple.com> Merge r171326. 2014-07-21 Oliver Hunt <oliver@apple.com> Remove global cookie workaround from sandbox profiles https://bugs.webkit.org/show_bug.cgi?id=135138 <rdar://17513375> 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 <dburkart@apple.com> Merge r171322. 2014-07-21 Oliver Hunt <oliver@apple.com> Correct sandbox profiles to fix some excess privileges https://bugs.webkit.org/show_bug.cgi?id=135134 <rdar://problem/17741886> <rdar://problem/17739080> 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 <dburkart@apple.com> Merge r171320. 2014-07-21 Simon Fraser <simon.fraser@apple.com> [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 <dburkart@apple.com> Merge r171317. 2014-07-21 Timothy Horton <timothy_horton@apple.com> 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 <rdar://problem/17719832> 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 <dburkart@apple.com> Merge r171314. 2014-07-21 Andy Estes <aestes@apple.com> [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 <dburkart@apple.com> Merge r171303. 2014-07-21 Brady Eidson <beidson@apple.com> DatabaseProcess doesn't relaunch after crashing. <rdar://problem/17717343> 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 <dburkart@apple.com> Merge r171288. 2014-07-20 Jeremy Jones <jeremyj@apple.com> 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 <dburkart@apple.com> Merge r171286. 2014-07-20 Jeremy Jones <jeremyj@apple.com> 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 <dburkart@apple.com> Merge r171280. 2014-07-20 Dan Bernstein <mitz@apple.com> <rdar://problem/17739804> 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 <dburkart@apple.com> Merge r171257. 2014-07-18 Oliver Hunt <oliver@apple.com> 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 <dburkart@apple.com> Merge r171256. 2014-07-18 Tim Horton <timothy_horton@apple.com> ASSERTion failures in ViewGestureController indicating that we're copying WebBackForwardList https://bugs.webkit.org/show_bug.cgi?id=135080 <rdar://problem/17734714> Reviewed by Sam Weinig. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::canSwipeInDirection): 2014-07-22 Dana Burkart <dburkart@apple.com> Merge r171253. 2014-07-18 Yongjun Zhang <yongjun_zhang@apple.com> _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 <dburkart@apple.com> Merge r171252. 2014-07-18 Andy Estes <aestes@apple.com> [iOS] Tapping "Allow Website" on a restricted page does not bring up the keypad https://bugs.webkit.org/show_bug.cgi?id=135072 <rdar://problem/17528188> Reviewed by David Kilzer. * Shared/WebCoreArgumentCoders.h: Declared an ArgumentCoder for WebCore::ContentFilter. * Shared/mac/WebCoreArgumentCodersMac.mm: (IPC::ArgumentCoder<ContentFilter>::encode): Encoded the ContentFilter using a NSKeyedArchiver. (IPC::ArgumentCoder<ContentFilter>::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 <dburkart@apple.com> Merge r171250. 2014-07-18 Simon Fraser <simon.fraser@apple.com> [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 <rdar://problem/17401823> 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 <dburkart@apple.com> Merge r171239. 2014-07-18 Tim Horton <timothy_horton@apple.com> Take navigation snapshots whenever the current back-forward item is going to change https://bugs.webkit.org/show_bug.cgi?id=135058 <rdar://problem/17464515> 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 <dburkart@apple.com> Merge r171225. 2014-07-18 Jon Honeycutt <jhoneycutt@apple.com> REGRESSION: Crash when typing into text field that clears itself on iOS <https://bugs.webkit.org/show_bug.cgi?id=135044> <rdar://problem/17640443> 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 <dburkart@apple.com> Merge r171219. 2014-07-18 Tim Horton <timothy_horton@apple.com> [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 <rdar://problem/17238025> 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 <dburkart@apple.com> Merge r171211. 2014-07-17 Alexey Proskuryakov <ap@apple.com> REGRESSION (r171167): LoaderClient processDidCrash call is made after load state changes https://bugs.webkit.org/show_bug.cgi?id=135032 <rdar://problem/17716602> 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 <dburkart@apple.com> Merge r171167. 2014-07-16 Alexey Proskuryakov <ap@apple.com> A test that hangs at cleanup stage confuses webkitpy hugely https://bugs.webkit.org/show_bug.cgi?id=122475 <rdar://problem/17184354> 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 <dburkart@apple.com> Merge r171197. 2014-07-17 Brent Fulgham <bfulgham@apple.com> [Mac] Full screen video not always animating in the correct Space https://bugs.webkit.org/show_bug.cgi?id=135020 <rdar://problem/17542310> 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 <dburkart@apple.com> Merge r171195. 2014-07-17 Timothy Hatcher <timothy@apple.com> 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 <dburkart@apple.com> Merge r171194. 2014-07-17 Brady Eidson <beidson@apple.com> Crash in ServicesOverlayController::~ServicesOverlayController. <rdar://problem/17622172> 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 <dburkart@apple.com> Merge r171191. 2014-07-17 Tim Horton <timothy_horton@apple.com> Sometimes purgeable (or empty!) tiles are shown on screen when resuming the app https://bugs.webkit.org/show_bug.cgi?id=135018 <rdar://problem/17615038> 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 <dburkart@apple.com> Merge r171365. 2014-07-22 Oliver Hunt <oliver@apple.com> Add accountsd access to network sandbox profile https://bugs.webkit.org/show_bug.cgi?id=135176 <rdar://17656487> 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 <bshafiei@apple.com> Merge r171209. 2014-07-17 Benjamin Poulain <bpoulain@apple.com> [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 <lforschler@apple.com> Rollout r171167. <rdar://problem/17716602> 2014-07-17 Dean Jackson <dino@apple.com> <rdar://problem/17675068> 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 <beidson@apple.com> 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 <ap@apple.com> A test that hangs at cleanup stage confuses webkitpy hugely https://bugs.webkit.org/show_bug.cgi?id=122475 <rdar://problem/17184354> 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 <ddkilzer@apple.com> [iOS] Update order file paths for WebKit and WebKit2 <http://webkit.org/b/134993> <rdar://problem/17557776> Reviewed by Darin Adler. * Configurations/Base.xcconfig: Add order file for iOS named WebKit.order. 2014-07-16 Brady Eidson <beidson@apple.com> Add WebSecurityOrigin "webSecurityOriginFromDatabaseIdentifier" SPI and change _websiteDataURLForContainerWithURL: SPI <rdar://problem/17454712> 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 <enrica@apple.com> REGRESSION (iOS WebKit2): Cannot scroll while dragging a selection. https://bugs.webkit.org/show_bug.cgi?id=134992 <rdar://problem/17528020> 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 <ap@apple.com> <rdar://problem/17669097> 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 <timothy_horton@apple.com> Dispatch top content inset changes immediately if synchronously waiting for view state changes https://bugs.webkit.org/show_bug.cgi?id=134942 <rdar://problem/17666800> 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 <bpoulain@apple.com> [iOS][WK2] Synchronize the dynamic viewport updates with their layer tree commit https://bugs.webkit.org/show_bug.cgi?id=134965 Related to <rdar://problem/17082607> 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 <mitz@apple.com> 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 <bpoulain@apple.com> 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 <mitz@apple.com> 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 <benjamin@webkit.org> [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 <rdar://problem/17647116> 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 <timothy_horton@apple.com> Dispatch top content inset changes immediately if synchronously waiting for view state changes https://bugs.webkit.org/show_bug.cgi?id=134942 <rdar://problem/17666800> 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 <enrica@apple.com> REGRESSION(WK2 iOS): Safari hangs when switching focus from a field using the Tab key. https://bugs.webkit.org/show_bug.cgi?id=134934 <rdar://problem/17224638> 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 <oliver@apple.com> 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 <akling@apple.com> [iOS] Don't progressively re-render tiles while pinch-zooming under memory pressure. <https://webkit.org/b/134915> 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 <pecoraro@apple.com> [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 <dino@apple.com> [PlugIns] Check for a non-null snapshot image before trying to decode it https://bugs.webkit.org/show_bug.cgi?id=134913 <rdar://problem/17606033> 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 <andersca@apple.com> Fix 32-bit build. * UIProcess/Cocoa/SessionStateCoding.mm: (WebKit::encodeSessionState): 2014-07-14 Anders Carlsson <andersca@apple.com> 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 <oliver@apple.com> 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 <timothy_horton@apple.com> 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 <timothy_horton@apple.com> 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 <clopez@igalia.com> [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 <benjamin@webkit.org> [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 <bpoulain@apple.com> [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 <betravis@adobe.com> [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 <andersca@apple.com> 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 <mitz@apple.com> 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 <eric.carlson@apple.com> [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 <timothy_horton@apple.com> [iOS] Throttle painting using a UI-process-side CADisplayLink https://bugs.webkit.org/show_bug.cgi?id=134879 <rdar://problem/17641699> 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 <mitz@apple.com> <rdar://problem/17657391> [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 <mitz@apple.com> <rdar://problem/17398060> 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 <mitz@apple.com> <rdar://problem/17295636> [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 <mitz@apple.com> [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 <jfernandez@igalia.com> 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 <gyuyoung.kim@samsung.com> Unreviewed, EFL build fix since r171045. * UIProcess/CoordinatedGraphics/WebView.h: 2014-07-12 Dan Bernstein <mitz@apple.com> [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 <gyuyoung.kim@samsung.com> Unreviewed, fix EFL build break since r171034. * UIProcess/CoordinatedGraphics/WebView.h: * UIProcess/efl/WebContextEfl.cpp: (WebKit::WebContext::platformMediaCacheDirectory): 2014-07-12 Darin Adler <darin@apple.com> 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 <jfernandez@igalia.com> 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 <jfernandez@igalia.com> 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 <mitz@apple.com> <rdar://problem/16020380> [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 <oliver@apple.com> 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 <mitz@apple.com> [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 <oliver@apple.com> 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 <oliver@apple.com> Temporary work around for <rdar://<rdar://problem/17513375> https://bugs.webkit.org/show_bug.cgi?id=134848 Reviewed by Sam Weinig. Temporarily work around <rdar://<rdar://problem/17513375> 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 <enrica@apple.com> Implement textStylingAtPosition in WK2. https://bugs.webkit.org/show_bug.cgi?id=134843 <rdar://problem/17614981> 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 <oliver@apple.com> 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 <antti@apple.com> 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 <rdar://problem/17580021> 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 <zalan@apple.com> 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 <jinwoo7.song@samsung.com> Unreviewed EFL build fix after r170970. * UIProcess/efl/WebContextEfl.cpp: (WebKit::WebContext::platformDefaultOpenGLCacheDirectory): 2014-07-10 Carlos Alberto Lopez Perez <clopez@igalia.com> 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 <bpoulain@apple.com> [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 <simon.fraser@apple.com> [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 <timothy_horton@apple.com> REGRESSION (r170935): WKWebView is always transparent until the first layer tree commit https://bugs.webkit.org/show_bug.cgi?id=134818 <rdar://problem/17632468> 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 <enrica@apple.com> 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 <pecoraro@apple.com> [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 <oliver@apple.com> 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 <psolanki@apple.com> Unreviewed iOS build fix after r170974. Define id if building a non ObjC file. * UIProcess/mac/ViewSnapshotStore.h: 2014-07-10 Tim Horton <timothy_horton@apple.com> Store ViewSnapshots directly on the WebBackForwardListItem https://bugs.webkit.org/show_bug.cgi?id=134667 <rdar://problem/17082639> 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 <bdakin@apple.com> 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- <rdar://problem/17595333> 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 <timothy_horton@apple.com> [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 <oliver@apple.com> 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 <mitz@apple.com> iOS build fix. * WebProcess/WebPage/ServicesOverlayController.h: 2014-07-09 Brady Eidson <beidson@apple.com> Phone number highlights should always be visible if the mouse hovers over. <rdar://problem/17527476> 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 <timothy_horton@apple.com> 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 <psolanki@apple.com> Buffer CSS and JS resources in network process before sending over to web process https://bugs.webkit.org/show_bug.cgi?id=134560 <rdar://problem/16737186> 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 <bpoulain@apple.com> [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 <pecoraro@apple.com> [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 <shiva.jm@samsung.com> [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 <enrica@apple.com> REGRESSION(r170858): Safari freezes upon making a search on a website (yelp.com). https://bugs.webkit.org/show_bug.cgi?id=134791 <rdar://problem/17616971> 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 <andersca@apple.com> Safari showing blank pages https://bugs.webkit.org/show_bug.cgi?id=134790 <rdar://problem/17617166> 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 <andersca@apple.com> Closed web views should never create new web processes https://bugs.webkit.org/show_bug.cgi?id=134787 <rdar://problem/16892526> 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 <andersca@apple.com> Support transparent WKWebViews https://bugs.webkit.org/show_bug.cgi?id=134779 <rdar://problem/17351058> 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 <aestes@apple.com> [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 <psolanki@apple.com> 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 <bpoulain@apple.com> [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 <timothy_horton@apple.com> 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 <andersca@apple.com> 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 <hyuki.kim@samsung.com> [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<EVAS_CALLBACK_MOUSE_IN>::handleEvent): 2014-07-08 Tim Horton <timothy_horton@apple.com> Remove WebBackForwardListItems when their owning page goes away https://bugs.webkit.org/show_bug.cgi?id=134709 <rdar://problem/17584645> 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 <timothy_horton@apple.com> [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 <timothy_horton@apple.com> 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 <aperez@igalia.com> [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 <zdobersek@igalia.com> [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 <timothy_horton@apple.com> Turn on accelerated drawing for WebKit2 by default https://bugs.webkit.org/show_bug.cgi?id=134708 <rdar://problem/17584642> Reviewed by Simon Fraser. * Shared/WebPreferencesDefinitions.h: Make Mac match iOS, in that accelerated drawing is on by default. 2014-07-07 Timothy Horton <timothy_horton@apple.com> 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 <simon.fraser@apple.com> [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 <simon.fraser@apple.com> [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 <timothy_horton@apple.com> Nearly everything in the UIProcess "leaks" when WKWebView is torn down https://bugs.webkit.org/show_bug.cgi?id=134699 <rdar://problem/17581777> Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): Adoption is important! 2014-07-07 Enrica Casucci <enrica@apple.com> REGRESSION(iOS WK2): arrow keys movements don't work. https://bugs.webkit.org/show_bug.cgi?id=134561 <rdar://problem/16827629> 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 <andersca@apple.com> 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 <andersca@apple.com> 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 <andersca@apple.com> Some of the WKPreferences (API) property getters read like questions https://bugs.webkit.org/show_bug.cgi?id=134678 <rdar://problem/17576847> 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 <beidson@apple.com> ServicesOverlayController menus show up in the wrong place. <rdar://problem/17130576> 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 <mitz@apple.com> [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 <hyuki.kim@samsung.com> [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 <bpoulain@apple.com> [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 <timothy_horton@apple.com> [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 <yoav@yoav.ws> 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 <beidson@apple.com> 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 <antti@apple.com> 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 <kumar.rohit@samsung.com> [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 <mitz@apple.com> [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 <timothy_horton@apple.com> [WK2] Take TopContentInset into account when sending dictionary lookup point to PluginView https://bugs.webkit.org/show_bug.cgi?id=134624 <rdar://problem/17222041> 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 <pnormand@igalia.com> Unreviewed, GTK WK2 build fix after r170787. * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::scheduleCompositingLayerFlushImmediately): * WebProcess/WebPage/DrawingAreaImpl.h: 2014-07-04 Zan Dobersek <zdobersek@igalia.com> 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 <zdobersek@igalia.com> 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 <timothy_horton@apple.com> [iOS][WK2] Black web view after un-suspending process https://bugs.webkit.org/show_bug.cgi?id=134623 <rdar://problem/17513223> 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 <baraclough@apple.com> 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 <simon.fraser@apple.com> Clean up Brady's mess on iOS. * Platform/mac/StringUtilities.h: * Platform/mac/StringUtilities.mm: 2014-07-03 Simon Fraser <simon.fraser@apple.com> [iOS WK2] Compositing layers draw outside page bounds https://bugs.webkit.org/show_bug.cgi?id=134619 <rdar://problem/16953222> 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 <beidson@apple.com> When showing the selection menu, include menu options for all selected phone numbers. <rdar://problem/16983434>, <rdar://problem/16874568>, 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 <baraclough@apple.com> 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 <pecoraro@apple.com> 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 <andersca@apple.com> 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 <mitz@apple.com> <rdar://problem/16337741> 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 <andersca@apple.com> 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 <dabates@apple.com> 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 <bpoulain@apple.com> [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 <andersca@apple.com> Fix build. * UIProcess/mac/WebPageProxyMac.mm: 2014-07-03 Anders Carlsson <andersca@apple.com> 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 <timothy_horton@apple.com> [WK2] Revise the flat find indicator secondary highlight shadows https://bugs.webkit.org/show_bug.cgi?id=134607 <rdar://problem/17554828> 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 <timothy_horton@apple.com> [iOS][WK2] Sometimes the swipe snapshot stays up too long https://bugs.webkit.org/show_bug.cgi?id=134506 <rdar://problem/17496803> 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 <beidson@apple.com> 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 <timothy_horton@apple.com> [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 <antti@apple.com> Ensure frame creation messages get through to UI process https://bugs.webkit.org/show_bug.cgi?id=134591 <rdar://problem/16918218> 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 <andersca@apple.com> 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 <andersca@apple.com> 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 <beidson@apple.com> Selection rects sent to ServicesOverlayController are wrong. <rdar://problem/16727796> 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 <beidson@apple.com> Possible crash in IconDatabase in WebCore::IconDatabase::dispatchDidRemoveAllIconsOnMainThread <rdar://problem/17437687> 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 <cgarcia@igalia.com> 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 <cgarcia@igalia.com> 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 <benjamin@webkit.org> [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 <roger_fong@apple.com> Improve handling of primary offscreen plugins. https://bugs.webkit.org/show_bug.cgi?id=134528. <rdar://problem/17471864> 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 <enrica@apple.com> REGRESSION(WK2): Undo does not work in text fields in Safari. https://bugs.webkit.org/show_bug.cgi?id=134572 <rdar://problem/17542238> 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 <baraclough@apple.com> 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 <mrowe@apple.com> <https://webkit.org/b/134522> 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 <oliver@apple.com> 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 <ossy@webkit.org> URTBF after r170725. * CMakeLists.txt: Removed Shared/LegacySessionState.cpp. 2014-07-02 Csaba Osztrogonác <ossy@webkit.org> URTBF after r170719 for !CF platforms. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::sessionStateData): Deleted. (WebKit::WebPageProxy::restoreFromSessionStateData): Deleted. 2014-07-02 Mark Rowe <mrowe@apple.com> <https://webkit.org/b/134521> 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 <andersca@apple.com> 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 <andersca@apple.com> 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 <andersca@apple.com> 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 <rego@igalia.com> Unreviewed. EFL and GTK build fix after r170716. * UIProcess/LegacySessionStateCodingNone.cpp: (WebKit::decodeLegacySessionState): Update method signature. 2014-07-02 Anders Carlsson <andersca@apple.com> 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 <andersca@apple.com> 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 <andersca@apple.com> 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 <cgarcia@igalia.com> [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 <cgarcia@igalia.com> [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 <hyuki.kim@samsung.com> [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 <gyuyoung.kim@samsung.com> 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 <dino@apple.com> 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 <timothy_horton@apple.com> Handle invalid data more gracefully. Reviewed by Anders Carlsson. * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::decodeFormData): (WebKit::decodeBackForwardTreeNode): 2014-07-01 Mark Rowe <mrowe@apple.com> Add a missing return statement in WKPageCopySessionState. Reviewed by Anders Carlsson. * UIProcess/API/C/WKPage.cpp: (WKPageCopySessionState): 2014-07-01 Anders Carlsson <andersca@apple.com> 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 <commit-queue@webkit.org> 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 <psolanki@apple.com> Encode/decode CFURLRequestRefs when USE(CFNETWORK) is enabled https://bugs.webkit.org/show_bug.cgi?id=134454 <rdar://problem/17510980> 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<ResourceRequest>::encodePlatformData): (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData): 2014-07-01 Benjamin Poulain <benjamin@webkit.org> [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 <andersca@apple.com> 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 <andersca@apple.com> 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 <gyuyoung.kim@samsung.com> Unreviewed. EFL and GTK build fix since r170654. * UIProcess/LegacySessionStateCodingNone.cpp: Add a dummy encodeLegacySessionState(const SessionState&). (WebKit::encodeLegacySessionState): 2014-07-01 Dan Bernstein <mitz@apple.com> 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 <mitz@apple.com> Build fix. * UIProcess/API/APILoaderClient.h: (API::LoaderClient::didDestroyNavigation): 2014-07-01 Anders Carlsson <andersca@apple.com> 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 <cfleizach@apple.com> 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 <andersca@apple.com> 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 <beidson@apple.com> Fix ServicesOverlayController teardown <rdar://problem/17523998> 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 <sam@webkit.org> [Cocoa][Mac] WKWebView should automatically set topContentInset when beneath a toolbar <rdar://problem/17523159> 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 <andersca@apple.com> 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 <mitz@apple.com> [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 <andersca@apple.com> Fix build. * WebKit2.xcodeproj/project.pbxproj: 2014-07-01 Anders Carlsson <andersca@apple.com> 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 <andersca@apple.com> 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 <simon.fraser@apple.com> [UI-side compositing] Bad spinner on news.google.com: animations need to be ordered https://bugs.webkit.org/show_bug.cgi?id=134504 <rdar://problem/17507892> 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<pair<>> 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 <andersca@apple.com> 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 <ap@apple.com> [Cocoa] WebProcess doesn't follow localization of UI process when run as a service https://bugs.webkit.org/show_bug.cgi?id=133126 <rdar://problem/13396515> 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 <achristensen@webkit.org> [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 <andersca@apple.com> 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 <dabates@apple.com> 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 <andersca@apple.com> 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 <yongjun_zhang@apple.com> 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 <andersca@apple.com> 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 <kumar.rohit@samsung.com> 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 <beidson@apple.com> 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 <beidson@apple.com> Build fix. Forgot to commit locally before pushing. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::servicesOverlayController): s/this/*this/ 2014-07-01 Brady Eidson <beidson@apple.com> 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 <zdobersek@igalia.com> [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<std::tuple<...>>(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 <evan@nemerson.com> [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 <gyuyoung.kim@samsung.com> [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 <gyuyoung.kim@samsung.com> 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 <benjamin@webkit.org> [iOS][WK2] The long press gesture recognizers should not block the pinch gesture https://bugs.webkit.org/show_bug.cgi?id=134477 <rdar://problem/17514936> Reviewed by Tim Horton. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]): 2014-06-30 Anders Carlsson <andersca@apple.com> 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 <andersca@apple.com> 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 <andersca@apple.com> 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 <timothy_horton@apple.com> [WK2] Add a flatter find-in-page current match indicator style https://bugs.webkit.org/show_bug.cgi?id=134434 <rdar://problem/16225673> 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 <benjamin@webkit.org> [iOS][WK2] Improve double-tap-to-scroll on image documents https://bugs.webkit.org/show_bug.cgi?id=134474 <rdar://problem/17496778> 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 <enrica@apple.com> REGRESSION (WK2): Weird selection behavior on autos.yahoo.com, en.wikipedia.org. https://bugs.webkit.org/show_bug.cgi?id=134466 <rdar://problem/16817263> 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 <andersca@apple.com> 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 <andersca@apple.com> 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 <benjamin@webkit.org> 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 <andersca@apple.com> 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 <simon.fraser@apple.com> [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 <oliver@apple.com> 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 <simon.fraser@apple.com> [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 <enrica@apple.com> REGRESSION (Okemo): The contextual menu on tap and hold does not cancel the other gestures. https://bugs.webkit.org/show_bug.cgi?id=134463 <rdar://problem/17388907> Reviewed by Benjamin Poulain. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _longPressRecognized:]): 2014-06-30 Anders Carlsson <andersca@apple.com> 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 <bpoulain@apple.com> [iOS][WK2] Move tap highlight to the inverseScaleRootView https://bugs.webkit.org/show_bug.cgi?id=134424 <rdar://problem/17480880> 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 <andersca@apple.com> 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 <yoav@yoav.ws> 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 <timothy_horton@apple.com> [iOS][WK2] PDFs never load inline again after the Web process crashes https://bugs.webkit.org/show_bug.cgi?id=134432 <rdar://problem/17484205> 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 <mitz@apple.com> 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 <simon.fraser@apple.com> [iOS WK2] position:fixed inside accelerated overflow:scroll is jumpy https://bugs.webkit.org/show_bug.cgi?id=134426 <rdar://problem/17474523> 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 <antti@apple.com> 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 <pecoraro@apple.com> [iOS][WK2] <select> tapping "next" does not save new picker value https://bugs.webkit.org/show_bug.cgi?id=134409 Reviewed by Enrica Casucci. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView accessoryTab:]): We know the assisted node will change, so call endEditing before the assisted node changes in the WebProcess. (-[WKContentView _stopAssistingNode]): Ensure we call endEditing to trigger controlEndEditing. * UIProcess/ios/forms/WKFormSelectPicker.mm: (-[WKMultipleSelectPicker initWithView:]): (-[WKMultipleSelectPicker pickerView:row:column:checked:]): (-[WKSelectSinglePicker dealloc]): Style fixes. 2014-06-27 Peyton Randolph <prandolph@apple.com> Add feature flag for link long-press gesture. https://bugs.webkit.org/show_bug.cgi?id=134262 Reviewed by Enrica Casucci. * Configurations/FeatureDefines.xcconfig: Add ENABLE_LINK_LONG_PRESS. 2014-06-26 Simon Fraser <simon.fraser@apple.com> [iOS WK2] Fix touch-scrollable elements with overflow:scroll on just one axis, and RTL scrolling https://bugs.webkit.org/show_bug.cgi?id=134377 <rdar://problem/16762224> Reviewed by Tim Horton. Make -webkit-overflow-scrolling:touch scrolling work correctly when one axis has overflow:scroll and the other overflow:hidden. Also fix scrolling in RTL contexts. An RTL scroller with overflow-x:hidden will have a non-zero scroll origin, and needs to truncate the scrolled content on the left side. To pass the correct geometry to the UI process, we need to introduce the concept of "reachable" size as well as total content size; normally these are the same, but will differ when scrolling is only allowed on one axis but there is overflow on both axes. ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren() uses the total and reachable content sizes to set a negative edge inset on the left (for RTL) or top (for bottom-to-top) so prevent scrolling into these areas. * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder<ScrollingStateScrollingNode>::encode): (ArgumentCoder<ScrollingStateScrollingNode>::decode): (WebKit::RemoteScrollingTreeTextStream::dump): * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren): 2014-06-27 Joseph Pecoraro <pecoraro@apple.com> Fix various leaks, RetainPtrs should adopt allocs https://bugs.webkit.org/show_bug.cgi?id=134308 Reviewed by Alexey Proskuryakov. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _remoteObjectRegistry]): 2014-06-27 Dan Bernstein <mitz@apple.com> Remove unused definitions that were mistakenly added back in r170323 and then again in r170329 https://bugs.webkit.org/show_bug.cgi?id=134397 Reviewed by Geoff Garen. * UIProcess/API/Cocoa/WKBackForwardList.mm: 2014-06-26 Daniel Bates <dabates@apple.com> [iOS][WK2] Distant focusable element may not be scrolled into view when focused using keyboard https://bugs.webkit.org/show_bug.cgi?id=134309 <rdar://problem/17427385> Reviewed by Darin Adler. Fixes an issue where the focusable element may not be scrolled into view when it's focused by using the keyboard accessory (i.e. the < and > buttons). In particular, we don't scroll a keyboard focused text field into view when it's positioned significantly outside the visible region. * UIProcess/ios/WKContentViewInteraction.h: Added an instance variable called _didAccessoryTabInitiateFocus to track whether an accessory tab initiated the focus of the focusable element. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): Clear _didAccessoryTabInitiateFocus so that we're in a good state should the WebProcess crash between the time the UIProcess receives the accessory tab request and the WebProcess calls back to the UIProcess to zoom/scroll to the newly focused element. (-[WKContentView _displayFormNodeInputView]): Modified to pass an empty rectangle for the selection rectangle to -_zoomToFocusRect to avoid constraining the scroll to the newly focused element when it was focused using the keyboard accessory tab buttons (-[WKContentView accessoryTab:]): Modified to set _didAccessoryTabInitiateFocus to YES. We'll set this boolean to NO in -_displayFormNodeInputView. 2014-06-26 Timothy Horton <timothy_horton@apple.com> [iOS][WK2] Implement WKPDFView smart magnification https://bugs.webkit.org/show_bug.cgi?id=134269 <rdar://problem/17272825> Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _currentContentView]): (contentZoomScale): Factor _currentContentView out of contentZoomScale. (-[WKWebView _zoomToRect:WebCore::atScale:origin:WebCore::]): (-[WKWebView _scrollToRect:WebCore::origin:WebCore::minimumScrollDistance:]): (-[WKWebView _contentRectForUserInteraction]): Use it in a bunch more places so we query the right view when zooming/scrolling for smart magnification. * UIProcess/ios/WKPDFView.h: * UIProcess/ios/WKPDFView.mm: (-[WKPDFView scrollViewDidScroll:]): (-[WKPDFView _revalidateViews]): (-[WKPDFView zoom:to:atPoint:kind:]): (-[WKPDFView resetZoom:]): Implement zoom:to:atPoint:kind: and resetZoom: UIPDFPageViewDelegate methods. Convert the rects/points and forward them on to the WKWebView to do the zoom. resetZoom: doesn't provide the gesture origin, so we zoom out using the view center as our origin. Avoid parenting new UIPDFPageViews while starting a zoom; they'll end up with a bizarre animation on them and go flying across the screen (even before _isAnimatingZoom is set). 2014-06-26 Tim Horton <timothy_horton@apple.com> [WK2] Pinch-zoom shadows can overlap headers and footers https://bugs.webkit.org/show_bug.cgi?id=134372 <rdar://problem/16004095> Reviewed by Simon Fraser. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::shadowLayerPositionForFrame): (WebKit::shadowLayerBoundsForFrame): Compute the initial shadow layer and shadow bounds exactly as RenderLayerCompositor does (in updateRootLayerPosition and friends). Also, clip the shadow layer to the old document rect, otherwise it can extend over top of the header/footers. The content is automatically clipped to this rect by the root content layer, but the shadow is outside of that. (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToLayers): (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom): Pass all of the arguments to constrainScrollPositionForOverhang, not just half of them. There's still a bug where we constrain incorrectly with header/footer layers, but that will be addressed elsewhere. (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage): Make use of the new helpers. 2014-06-26 Tim Horton <timothy_horton@apple.com> Don't leak WKBrowsingContextControllers https://bugs.webkit.org/show_bug.cgi?id=134368 <rdar://problem/17476582> Reviewed by Sam Weinig. * UIProcess/API/mac/WKView.mm: (-[WKView browsingContextController]): Adoption is important. 2014-06-26 Alexey Proskuryakov <ap@apple.com> REGRESSION: Mountain Lion: Gmail's "in new window" view of mail threads is very slow to load its content https://bugs.webkit.org/show_bug.cgi?id=133882 <rdar://problem/17271965> Reviewed by Brady Eidson. * NetworkProcess/mac/NetworkResourceLoadSchedulerMac.mm: (WebKit::NetworkResourceLoadScheduler::platformInitializeMaximumHTTPConnectionCountPerHost): Same fix as in WebCore. 2014-06-26 Brady Eidson <beidson@apple.com> Remove use of PlatformStrategies for Gamepad API. https://bugs.webkit.org/show_bug.cgi?id=134348 https://bugs.webkit.org/show_bug.cgi?id=134348 * NetworkProcess/NetworkProcessPlatformStrategies.cpp: (WebKit::NetworkProcessPlatformStrategies::createGamepadStrategy): Deleted. * NetworkProcess/NetworkProcessPlatformStrategies.h: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::createGamepadStrategy): Deleted. (WebKit::WebPlatformStrategies::startMonitoringGamepads): Deleted. (WebKit::WebPlatformStrategies::stopMonitoringGamepads): Deleted. (WebKit::WebPlatformStrategies::platformGamepads): Deleted. * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2014-06-26 Dan Bernstein <mitz@apple.com> [iOS] Add API for opting into character selection granularity https://bugs.webkit.org/show_bug.cgi?id=134354 Reviewed by Geoff Garen. * Shared/API/Cocoa/WKFoundation.h: Added a definition of WK_ENUM_AVAILABLE_IOS. * UIProcess/API/Cocoa/WKWebViewConfiguration.h: (WKSelectionGranularity): Added this enum with two values, one representing dynamic granularity( the current, default behavior) and one representing character granularity. Delcared new selectionGranularity property. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): Copy the _selectionGranularity ivar. * UIProcess/ios/WKContentViewInteraction.mm: (toUIWebSelectionMode): Added this helper function for mapping WKSelectionGranularity values to UIWebSelectionMode values. (-[WKContentView setupInteraction]): Use a selection assistant with the mode specified in the configuration. (-[WKContentView _stopAssistingKeyboard]): Ditto. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::selectWithGesture): Changed the behavior of the loupe gesture type in non-editable text to select a word, rather than an empty range, matching the UITextView behavior. 2014-06-26 Ada Chan <adachan@apple.com> Change the target membership of WKBackForwardListPrivate.h from WebKit2 to WebKit. Rubber-stamped by Dan Bernstein. * WebKit2.xcodeproj/project.pbxproj: 2014-06-26 Benjamin Poulain <bpoulain@apple.com> Remove a useless return in WebPageProxyIOS * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::updateVisibleContentRects): Darin caught this mistake in r170460. 2014-06-26 Chris Fleizach <cfleizach@apple.com> Add an undo group for each dictated utterance in WebKit https://bugs.webkit.org/show_bug.cgi?id=134086 Applied review comments from Sam Weinig. Move the associated USE #define into Platform.h. * UIProcess/PageClient.h: 2014-06-24 Roger Fong <roger_fong@apple.com> Don't allow sudden termination while writing to local storage. https://bugs.webkit.org/show_bug.cgi?id=134254. <rdar://problem/15093854>. Reviewed by Darin Adler. * UIProcess/Storage/LocalStorageDatabase.cpp: (WebKit::LocalStorageDatabase::scheduleDatabaseUpdate): Disable sudden termination when a database update is scheduled. (WebKit::LocalStorageDatabase::updateDatabase): Re-enable sudden termination when the update completes. * UIProcess/Storage/LocalStorageDatabase.h: 2014-06-25 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] Update the long press interactions correctly when an overflow scroll view scrolls https://bugs.webkit.org/show_bug.cgi?id=134334 Reviewed by Simon Fraser. * UIProcess/PageClient.h: * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll): * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewWillStartPanGesture): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewWillStartPanGesture): Deleted. * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::overflowScrollViewWillStartPanGesture): (WebKit::PageClientImpl::overflowScrollViewDidScroll): (WebKit::PageClientImpl::scrollViewWillStartPanGesture): Deleted. * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartPanGesture): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::overflowScrollViewWillStartPanGesture): (WebKit::WebPageProxy::overflowScrollViewDidScroll): (WebKit::WebPageProxy::scrollViewWillStartPanGesture): Deleted. 2014-06-25 Simon Fraser <simon.fraser@apple.com> [iOS WK2] Page jumps when rubber-banding on azuremagazine.com https://bugs.webkit.org/show_bug.cgi?id=134238 <rdar://problem/16918228> Reviewed by Benjamin Poulain. If the scroll view is in the process of rubber-banding when -setContentSize: is called, it clamps the scroll offsets between zero and the max value, which visibly interrupts the rubberband. This can easily happen now that we continually send scroll events to the page on scrolling, especially when pages like azuremagazine.com do fake sticky by toggling in-flow elements into position:fixed. Fix by computing the amount of rubber-band before calling -setContentSize:, and then restoring the contentOffset with the same amount of rubber-band even when the content size is different, for top/left rubberbands. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLayerTree:WebKit::]): * UIProcess/ios/WKScrollView.h: * UIProcess/ios/WKScrollView.mm: (-[WKScrollView _currentTopLeftRubberbandAmount]): (-[WKScrollView _restoreContentOffsetWithRubberbandAmount:]): (-[WKScrollView _setContentSizePreservingContentOffsetDuringRubberband:]): 2014-06-25 Simon Fraser <simon.fraser@apple.com> [iOS WK2] Fixed position elements jump around when zooming https://bugs.webkit.org/show_bug.cgi?id=134328 <rdar://problem/17447048> Reviewed by Zalan Bujtas. If a given remote layer tree commit contains changes of layers for viewport-constrained objects, then the associated scrolling tree also needs to show that the layers changed, since we need to re-run the "viewport changed" logic in the UI process to get the layers correctly positioned for the current zoom level. The bug was that page scale changes resulted in small "pixel alignment" position changes which touched layers, but we didn't commit any scrolling tree changes. So the scrolling tree commit would result in visibly stale layer positions, with no scrolling tree update to adjust them for the current transient zoom. Fix by making use of the existing "alignment offset" field in the ViewportConstraints data, and having RemoteScrollingCoordinatorProxy::connectStateNodeLayers() note that fixed or sticky layers changed if any properties of fixed or sticky scrolling tree nodes were updated. * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): 2014-06-25 Benjamin Poulain <bpoulain@apple.com> REGRESSION (r170325): UI process crashes in lastCommittedLayerTreeTransactionID() when the Web Content process crashes https://bugs.webkit.org/show_bug.cgi?id=134284 Reviewed by Simon Fraser. The crash was caused by the access to the Drawing Area after the crash. This lead to discovering another bug: m_lastVisibleContentRectUpdate could have been updated after WebPageProxy::resetState(), which in turn would prevent valid updates when a new WebProcess is created. This patch fixes both issues by moving the VisibleContentRectUpdateInfo to be internal to WebPageProxy, then early return if we get there in an invalid state. * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::updateVisibleContentRects): 2014-06-25 Brady Eidson <beidson@apple.com> Add new platform gamepad abstractions https://bugs.webkit.org/show_bug.cgi?id=134325 Reviewed by Dean Jackson. * NetworkProcess/NetworkProcessPlatformStrategies.cpp: (WebKit::NetworkProcessPlatformStrategies::createGamepadStrategy): * NetworkProcess/NetworkProcessPlatformStrategies.h: Actually return a GamepadStrategy in WK2 with no implementation for now: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: (WebKit::WebPlatformStrategies::createGamepadStrategy): (WebKit::WebPlatformStrategies::startMonitoringGamepads): (WebKit::WebPlatformStrategies::stopMonitoringGamepads): (WebKit::WebPlatformStrategies::platformGamepads): * WebProcess/WebCoreSupport/WebPlatformStrategies.h: 2014-06-25 Jaehun Lim <ljaehun.lim@samsung.com> Unreviewed, CMake build fix after r170450 * CMakeLists.txt: Add ProcessAssertion.cpp and ProcessThrottler.cpp. * UIProcess/ProcessAssertion.cpp: Replace #import with #include. 2014-06-25 Tim Horton <timothy_horton@apple.com> [WK2] Shadow layer is in the wrong place while pinch-zooming https://bugs.webkit.org/show_bug.cgi?id=134321 Reviewed by Dan Bernstein. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToLayers): (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom): (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage): The anchor point of the shadow layer changed, so we no longer need to shift our position to the center. 2014-06-25 Dan Bernstein <mitz@apple.com> Fixed crashes after r170450. Reviewed by Tim Horton. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::WebProcessProxy): Removed iOS platform #ifdef around initialization of m_throttler. 2014-06-25 Beth Dakin <bdakin@apple.com> Crash in ScrollingTree::isRubberBandInProgress() https://bugs.webkit.org/show_bug.cgi?id=134316 -and corresponding- <rdar://problem/16247911> Reviewed by Geoffrey Garen. Move all ScrollingTreeNode creation from ScrollingCoordinator subclasses into ScrollingTree subclasses. * UIProcess/Scrolling/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::createScrollingTreeNode): (WebKit::RemoteScrollingTree::createNode): Deleted. * UIProcess/Scrolling/RemoteScrollingTree.h: * WebProcess/Scrolling/RemoteScrollingCoordinator.h: * WebProcess/Scrolling/RemoteScrollingCoordinator.mm: (WebKit::RemoteScrollingCoordinator::createScrollingTreeNode): Deleted. 2014-06-25 Dan Bernstein <mitz@apple.com> Web process should become active when sent a message that requires a callback https://bugs.webkit.org/show_bug.cgi?id=134315 Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): Removed one-off code to acquire an activity token, now that WebPageProxy::takeSnapshot does it automatically for us. * UIProcess/GenericCallback.h: (WebKit::CallbackBase::CallbackBase): Made this constructor take and adopt an activity token. (WebKit::GenericCallback::create): Added an optional activity token parameter. (WebKit::GenericCallback::GenericCallback): Pass the activity token to the CallbackBase constructor. (WebKit::CallbackMap::put): Added an activity token parameter, which is passed along to GenericCallback::create. * UIProcess/ProcessAssertion.cpp: Moved from Source/WebKit2/UIProcess/ios/ProcessAssertion.mm. This copy includes generic no-op implementations for platforms that don’t have assertions. (WebKit::ProcessAssertion::ProcessAssertion): (WebKit::ProcessAssertion::setState): * UIProcess/ProcessAssertion.h: Moved from Source/WebKit2/UIProcess/ios/ProcessAssertion.h. Changed platform #ifdefs to make this usable by all platforms. * UIProcess/ProcessThrottler.cpp: Moved from Source/WebKit2/UIProcess/ios/ProcessThrottler.mm. Removed iOS platform #ifdef. * UIProcess/ProcessThrottler.h: Moved from Source/WebKit2/UIProcess/ios/ProcessThrottler.h. Ditto. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::validateCommand): Create a background activity token and pass it along to CallbackMap::put. (WebKit::WebPageProxy::runJavaScriptInMainFrame): Ditto. (WebKit::WebPageProxy::getRenderTreeExternalRepresentation): Ditto. (WebKit::WebPageProxy::getSourceForFrame): Ditto. (WebKit::WebPageProxy::getContentsAsString): Ditto. (WebKit::WebPageProxy::getBytecodeProfile): Ditto. (WebKit::WebPageProxy::getSelectionOrContentsAsString): Ditto. (WebKit::WebPageProxy::getSelectionAsWebArchiveData): Ditto. (WebKit::WebPageProxy::getMainResourceDataOfFrame): Ditto. (WebKit::WebPageProxy::getResourceDataFromFrame): Ditto. (WebKit::WebPageProxy::getWebArchiveOfFrame): Ditto. (WebKit::WebPageProxy::getMarkedRangeAsync): Ditto. (WebKit::WebPageProxy::getSelectedRangeAsync): Ditto. (WebKit::WebPageProxy::characterIndexForPointAsync): Ditto. (WebKit::WebPageProxy::firstRectForCharacterRangeAsync): Ditto. (WebKit::WebPageProxy::takeSnapshot): Ditto. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::sendProcessWillSuspend): Moved from WebProcessProxyIOS.mm. (WebKit::WebProcessProxy::sendCancelProcessWillSuspend): Ditto. (WebKit::WebProcessProxy::processReadyToSuspend): Ditto. (WebKit::WebProcessProxy::didCancelProcessSuspension): Ditto. * UIProcess/WebProcessProxy.h: Removed iOS platform #ifdef. * UIProcess/WebProcessProxy.messages.in: Ditto. * UIProcess/ios/ProcessAssertionIOS.mm: Renamed from Source/WebKit2/UIProcess/ios/ProcessAssertion.mm. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::selectWithGesture): Changed to pass the function directly to CallbackMap::put, along with a background activity token. (WebKit::WebPageProxy::updateSelectionWithTouches): Ditto. (WebKit::WebPageProxy::requestAutocorrectionData): Ditto. (WebKit::WebPageProxy::applyAutocorrection): Ditto. (WebKit::WebPageProxy::requestDictationContext): Ditto. (WebKit::WebPageProxy::requestAutocorrectionContext): Ditto. (WebKit::WebPageProxy::selectWithTwoTouches): Ditto. * UIProcess/ios/WebProcessProxyIOS.mm: (WebKit::WebProcessProxy::sendProcessWillSuspend): Moved to WebProcessProxy.cpp. (WebKit::WebProcessProxy::sendCancelProcessWillSuspend): Ditto. (WebKit::WebProcessProxy::processReadyToSuspend): Ditto. (WebKit::WebProcessProxy::didCancelProcessSuspension): Ditto. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync): Create a background activity token and pass it along to CallbackMap::put. * WebKit2.xcodeproj/project.pbxproj: Updated for moves and copies. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): Moved iOS platform #ifdef. * WebProcess/WebProcess.h: Ditto. * WebProcess/WebProcess.messages.in: Ditto. 2014-06-25 Chris Fleizach <cfleizach@apple.com> Add an undo group for each dictated utterance in WebKit https://bugs.webkit.org/show_bug.cgi?id=134086 Reviewed by Enrica Casucci. * UIProcess/API/mac/WKView.mm: (-[WKView insertText:replacementRange:]): (-[WKView validAttributesForMarkedText]): * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::registerInsertionUndoGrouping): (WebKit::WebPageProxy::insertTextAsync): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::registerInsertionUndoGrouping): * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::registerInsertionUndoGrouping): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::insertDictatedTextAsync): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::insertTextAsync): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::insertDictatedTextAsync): 2014-06-25 Joseph Pecoraro <pecoraro@apple.com> [iOS]: WK2 Inspector Node Search https://bugs.webkit.org/show_bug.cgi?id=134279 Reviewed by Benjamin Poulain. * UIProcess/ios/WKInspectorNodeSearchGestureRecognizer.h: Added. * UIProcess/ios/WKInspectorNodeSearchGestureRecognizer.mm: Added. (-[WKInspectorNodeSearchGestureRecognizer locationInView:]): (-[WKInspectorNodeSearchGestureRecognizer _processTouches:state:]): (-[WKInspectorNodeSearchGestureRecognizer touchesBegan:withEvent:]): (-[WKInspectorNodeSearchGestureRecognizer touchesMoved:withEvent:]): (-[WKInspectorNodeSearchGestureRecognizer touchesEnded:withEvent:]): (-[WKInspectorNodeSearchGestureRecognizer touchesCancelled:withEvent:]): (-[WKInspectorNodeSearchGestureRecognizer reset]): Gesture recognizer that tracks a single touch, updates as that touch moves, and ends when that touch is cancelled or ends. The location of the gesture recognizer is the location of the touch it was tracking. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): Handle the inspector node search gesture recognizer if needed. (-[WKContentView _removeDefaultGestureRecognizers]): (-[WKContentView _addDefaultGestureRecognizers]): Helpers to add and remove the default gestures. (-[WKContentView _enableInspectorNodeSearch]): (-[WKContentView _disableInspectorNodeSearch]): When node search is enabled, remove all gesture recognizers and replace with a single inspector node search gesture recognizer. Likewise, inverse that when disabled. (-[WKContentView _inspectorNodeSearchRecognized:]): Notify the WebProcess of new touch positions during node search. (-[WKContentView hasSelectablePositionAtPoint:]): When inspector node search is enabled, disable selection. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::inspectorNodeSearchMovedToPosition): Send a mouse move to the new location. WebCore will update the highlight. (WebKit::WebPage::inspectorNodeSearchEndedAtPosition): Inspect the node at the location. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _enableInspectorNodeSearch]): (-[WKWebView _disableInspectorNodeSearch]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::enableInspectorNodeSearch): (WebKit::PageClientImpl::disableInspectorNodeSearch): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::inspectorNodeSearchMovedToPosition): (WebKit::WebPageProxy::inspectorNodeSearchEndedAtPosition): (WebKit::WebPageProxy::enableInspectorNodeSearch): (WebKit::WebPageProxy::disableInspectorNodeSearch): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebInspectorClient.cpp: (WebKit::WebInspectorClient::didSetSearchingForNode): * WebProcess/WebCoreSupport/WebInspectorClient.h: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::enableInspectorNodeSearch): (WebKit::WebPage::disableInspectorNodeSearch): Pass the inspector node search state up from the WebProcess to the WKContentView in the UIProcess. Likewise some messages in the reverse direction. 2014-06-25 Dana Burkart <dburkart@apple.com> Add support for 5-tuple versioning. Reviewed by David Farler. * Configurations/Version.xcconfig: 2014-06-25 Dan Bernstein <mitz@apple.com> <rdar://problem/17448049> REGRESSION (r170254): Input methods don’t work https://bugs.webkit.org/show_bug.cgi?id=134311 Reviewed by Tim Horton. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::getSelectedRangeAsync): Removed code that accidentally put the callback function into a throwaway EditingRangeCallback. 2014-06-25 Timothy Horton <timothy_horton@apple.com> [iOS][WK2] Rotating a zoomed PDF leads to weird scrolling behavior https://bugs.webkit.org/show_bug.cgi?id=134286 Reviewed by Benjamin Poulain. * UIProcess/ios/WKPDFView.mm: (-[WKPDFView _computePageAndDocumentFrames]): The WKPDFView frame and scroll view content size need to be scaled. (-[WKPDFView web_setScrollView:]): Deleted. (-[WKPDFView web_initWithFrame:webView:]): Get rid of _documentFrame, and don't set it at initWithFrame: time (it's not useful yet). 2014-06-25 Laszlo Gombos <l.gombos@samsung.com> Remove build guard for progress element https://bugs.webkit.org/show_bug.cgi?id=134292 Reviewed by Benjamin Poulain. * Configurations/FeatureDefines.xcconfig: 2014-06-24 Carlos Garcia Campos <cgarcia@igalia.com> [GTK] Windowed plugins visibility doesn't work https://bugs.webkit.org/show_bug.cgi?id=131487 Reviewed by Anders Carlsson. Implement plugins visibility changes and add a new message to notify the UI process when a windowed plugin is shown/hidden to show/hide the plugin widget. * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::visibilityDidChange): Add implementation to notify the plugin about visibility change. (WebKit::PluginControllerProxy::windowedPluginVisibilityDidChange): Send WindowedPluginVisibilityDidChange to the plugin proxy. * PluginProcess/PluginControllerProxy.h: * PluginProcess/PluginControllerProxy.messages.in: Add VisibilityDidChange message. * UIProcess/WebPageProxy.h: Add windowedPluginVisibilityDidChange to handle WindowedPluginVisibilityDidChange message. * UIProcess/WebPageProxy.messages.in: Add WindowedPluginVisibilityDidChange message. * UIProcess/efl/WebPageProxyEfl.cpp: (WebKit::WebPageProxy::windowedPluginVisibilityDidChange): * UIProcess/gtk/WebPageProxyGtk.cpp: (WebKit::WebPageProxy::createPluginContainer): Do not show the plugins by default. (WebKit::WebPageProxy::windowedPluginVisibilityDidChange): Show or hide the plugin widget. * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::NetscapePlugin): Initialize m_isVisible. (WebKit::NetscapePlugin::visibilityDidChange): Add visible parameter and save it in m_isVisible member, calling platformVisibilityDidChange() only when it has actually changed. * WebProcess/Plugins/Netscape/NetscapePlugin.h: * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: (WebKit::NetscapePlugin::platformVisibilityDidChange): Notify the controller about visibility change. * WebProcess/Plugins/PDF/PDFPlugin.h: * WebProcess/Plugins/Plugin.h: * WebProcess/Plugins/PluginController.h: * WebProcess/Plugins/PluginProxy.cpp: (WebKit::PluginProxy::visibilityDidChange): Send VisibilityDidChange message to the plugin controller proxy. (WebKit::PluginProxy::windowedPluginVisibilityDidChange): Notify the controller about visibility change. * WebProcess/Plugins/PluginProxy.h: * WebProcess/Plugins/PluginProxy.messages.in: Add WindowedPluginVisibilityDidChange message. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::didInitializePlugin): Also call viewVisibilityDidChange() when the plugin is initialized. (WebKit::PluginView::setParentVisible): Override this Widget method to update the plugin visibility when parent widget is shown/hidden. (WebKit::PluginView::viewVisibilityDidChange): Pass visible parameter to visibilityDidChange(). (WebKit::PluginView::windowedPluginVisibilityDidChange): Send WindowedPluginVisibilityDidChange message to the UI process. * WebProcess/Plugins/PluginView.h: 2014-06-24 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] We should not start potential tap activation unless the tap gesture recognizer succeed https://bugs.webkit.org/show_bug.cgi?id=134277 <rdar://problem/17439973> Reviewed by Anders Carlsson. * UIProcess/ios/WKSyntheticClickTapGestureRecognizer.m: (-[WKSyntheticClickTapGestureRecognizer setState:]): We were calling the _gestureRecognizedAction even for failure states. The potential activation work is not light on the Web Process, we should not start if we don't care about the result. 2014-06-24 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] Adopt the C API of UIWebTouchEventsGestureRecognizer for touch event mapping https://bugs.webkit.org/show_bug.cgi?id=134234 Reviewed by Tim Horton. The C API is more efficient and expose properties we will need for other patches. This patch moves from getting each value independently on UIWebTouchEventsGestureRecognizer to the single structure exposed by _UIWebTouchEvent. * Shared/NativeWebTouchEvent.h: * Shared/ios/NativeWebTouchEventIOS.mm: (WebKit::convertTouchPhase): (WebKit::extractWebTouchPoint): (WebKit::NativeWebTouchEvent::NativeWebTouchEvent): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _webTouchEventsRecognized:]): 2014-06-24 Joseph Pecoraro <pecoraro@apple.com> [iOS]: WK2 Inspector Node Highlighting https://bugs.webkit.org/show_bug.cgi?id=134257 Reviewed by Timothy Hatcher. * Scripts/webkit2/messages.py: (struct_or_class): (headers_for_type): * Shared/WebCoreArgumentCoders.h: * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<Highlight>::encode): (IPC::ArgumentCoder<Highlight>::decode): Add a way to encode a WebCore::Highlight struct. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _showInspectorHighlight:WebCore::]): (-[WKWebView _hideInspectorHighlight]): * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::showInspectorHighlight): (WebKit::PageClientImpl::hideInspectorHighlight): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::showInspectorHighlight): (WebKit::WebPageProxy::hideInspectorHighlight): * WebProcess/WebCoreSupport/WebInspectorClient.cpp: (WebKit::WebInspectorClient::highlight): (WebKit::WebInspectorClient::hideHighlight): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::showInspectorHighlight): (WebKit::WebPage::hideInspectorHighlight): Send web process highlight / hideHighlight messages up to the UIProcess so it can highlight in the WKContentView. Pass up a WebCore::Highlight in Document coordinates. * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKInspectorHighlightView initWithFrame:]): (-[WKInspectorHighlightView dealloc]): (-[WKInspectorHighlightView _removeAllLayers]): (-[WKInspectorHighlightView _createLayers:]): (findIntersectionOnLineBetweenPoints): (quadIntersection): (layerPathWithHole): (layerPath): (-[WKInspectorHighlightView _layoutForNodeHighlight:]): (-[WKInspectorHighlightView _layoutForRectsHighlight:]): (-[WKInspectorHighlightView update:]): Reuse the WebKit1 code to turn highlight float quads into CAShapeLayers. (-[WKContentView _showInspectorHighlight:WebCore::]): (-[WKContentView _hideInspectorHighlight]): Show and hide the highlight view with the respective WebCore::Highlight. 2014-06-24 Anders Carlsson <andersca@apple.com> Simplify decodeLegacySessionState https://bugs.webkit.org/show_bug.cgi?id=134280 Reviewed by Andreas Kling. There's no need to use a LegacySessionStateDecoder object with a single member, just make all functions static and only export a single entry point; decodeLegacySessionState. No functionality change, just moving code around. * UIProcess/API/C/WKSessionStateRef.cpp: (WKSessionStateCreateFromData): * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::decodeSessionHistoryEntryData): (WebKit::decodeSessionHistoryEntry): (WebKit::decodeSessionHistoryEntries): (WebKit::decodeV0SessionHistory): (WebKit::decodeV1SessionHistory): (WebKit::decodeSessionHistory): (WebKit::decodeLegacySessionState): (WebKit::LegacySessionStateDecoder::LegacySessionStateDecoder): Deleted. (WebKit::LegacySessionStateDecoder::~LegacySessionStateDecoder): Deleted. (WebKit::LegacySessionStateDecoder::decodeSessionState): Deleted. (WebKit::LegacySessionStateDecoder::decodeSessionHistory): Deleted. (WebKit::LegacySessionStateDecoder::decodeV0SessionHistory): Deleted. (WebKit::LegacySessionStateDecoder::decodeV1SessionHistory): Deleted. (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntries): Deleted. (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntry): Deleted. (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntryData): Deleted. * UIProcess/mac/LegacySessionStateCoding.h: 2014-06-24 Brady Eidson <beidson@apple.com> Enable GAMEPAD in the Mac build, but disabled at runtime. https://bugs.webkit.org/show_bug.cgi?id=134255 Reviewed by Dean Jackson. * Configurations/FeatureDefines.xcconfig: * Shared/WebPreferencesDefinitions.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetGamepadsEnabled): (WKPreferencesGetGamepadsEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2014-06-24 Anders Carlsson <andersca@apple.com> Add support for v0 legacy decoding https://bugs.webkit.org/show_bug.cgi?id=134275 Reviewed by Andreas Kling. * Shared/SessionState.h: * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::LegacySessionStateDecoder::decodeV0SessionHistory): (WebKit::LegacySessionStateDecoder::decodeV1SessionHistory): 2014-06-24 Anders Carlsson <andersca@apple.com> Add SPI for clearing an entire back-forward list https://bugs.webkit.org/show_bug.cgi?id=134274 Reviewed by Dan Bernstein. Add -[WKBackForwardList _clear] which only clears the back-forward items, and change -[WKBackForwardList _removeAllItems] to remove all items including the current one. * UIProcess/API/Cocoa/WKBackForwardList.mm: (-[WKBackForwardList _removeAllItems]): (-[WKBackForwardList _clear]): * UIProcess/API/Cocoa/WKBackForwardListPrivate.h: * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::removeAllItems): * UIProcess/WebBackForwardList.h: 2014-06-24 Anders Carlsson <andersca@apple.com> Add iOS specific frame state member variables https://bugs.webkit.org/show_bug.cgi?id=134268 Reviewed by Andreas Kling. * Shared/SessionState.cpp: (WebKit::FrameState::encode): (WebKit::FrameState::decode): * Shared/SessionState.h: * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::HistoryEntryDataDecoder::operator>>): (WebKit::decodeBackForwardTreeNode): * WebProcess/WebCoreSupport/SessionStateConversion.cpp: (WebKit::toFrameState): (WebKit::applyFrameState): 2014-06-24 Enrica Casucci <enrica@apple.com> iOS WebKit2: block selection tends to prefer block to single words even when the page is zoomed. https://bugs.webkit.org/show_bug.cgi?id=134267 <rdar://problem/17138059> Reviewed by Benjamin Poulain. When trying to find the best selection match for the position where the tap occurs, we need to take into account the page scale. This patch applies the scale factor to the selection rect before comparing it with the desired size. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::rangeForWebSelectionAtPosition): 2014-06-24 Anders Carlsson <andersca@apple.com> Add code to convert HistoryItem to PageState https://bugs.webkit.org/show_bug.cgi?id=134263 Reviewed by Andreas Kling. * WebProcess/WebCoreSupport/SessionStateConversion.cpp: (WebKit::toHTTPBody): (WebKit::toFrameState): (WebKit::toPageState): * WebProcess/WebCoreSupport/SessionStateConversion.h: 2014-06-24 Andreas Kling <akling@apple.com> [iOS WebKit2] Disable screen font substitution by default. <https://webkit.org/b/134266> <rdar://problem/17427740> Just like OS X >= 10.9, screen font substitution should be disabled by default in WebKit2 for iOS. Reviewed by Anders Carlsson. * Shared/WebPreferencesDefinitions.h: 2014-06-24 Anders Carlsson <andersca@apple.com> Add PageState to HistoryItem conversion code https://bugs.webkit.org/show_bug.cgi?id=134259 Reviewed by Andreas Kling. * Shared/SessionState.h: * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::decodeBackForwardTreeNode): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/SessionStateConversion.cpp: Added. (WebKit::toFormData): (WebKit::applyFrameState): (WebKit::toHistoryItem): * WebProcess/WebCoreSupport/SessionStateConversion.h: Added. 2014-06-24 Antti Koivisto <antti@apple.com> Only flush layers when the exposed rect actually changes https://bugs.webkit.org/show_bug.cgi?id=134248 Reviewed by Anders Carlsson. * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::setExposedContentRect): 2014-06-24 Martin Hock <mhock@apple.com> [iOS] DOMWindow::outerWidth and outerHeight don't return useful values, so return 0. Also, revert r169281. https://bugs.webkit.org/show_bug.cgi?id=134233 <rdar://problem/17060183> Reviewed by Benjamin Poulain. * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::windowFrame): Deleted. * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::convertToUserSpace): 2014-06-24 Jeremy Jones <jeremyj@apple.com> Initialize WKWebViewConfiguration properties to their default values. https://bugs.webkit.org/show_bug.cgi?id=134216 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): add -init method to initialize _mediaPlaybackRequiresUserAction and _mediaPlaybackAllowsAirPlay. 2014-06-24 Anders Carlsson <andersca@apple.com> Add missing semicolon. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _updateVisibleContentRects]): 2014-06-24 Eva Balazsfalvi <evab.u-szeged@partner.samsung.com> Fix unused parameter warnings if inspector is disabled https://bugs.webkit.org/show_bug.cgi?id=134244 Reviewed by Zalan Bujtas. * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp: (WKBundleInspectorShow): (WKBundleInspectorClose): (WKBundleInspectorEvaluateScriptForTest): (WKBundleInspectorSetPageProfilingEnabled): 2014-06-24 Anders Carlsson <andersca@apple.com> WKWebView doesn't respect -[UIScrollView contentInset] https://bugs.webkit.org/show_bug.cgi?id=134230 <rdar://problem/17429107> Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setHasCustomContentView:loadedMIMEType:WTF::]): Call initWithFrame and pass the WKWebView along. (-[WKWebView _adjustedContentOffset:]): New helper method that takes a content offset as a CGPoint and offsets it by the computed content inset. (-[WKWebView _computedContentInset]): New helper method that returns the _obscuredInsets, or if it's zero, the scroll view's content inset. (-[WKWebView _processDidExit]): Use _computedContentInset. (-[WKWebView _didCommitLayerTree:WebKit::]): use _computedContentInset. (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]): Use _computedContentInset. (-[WKWebView _scrollToContentOffset:WebCore::]): Use _computedContentInset. (-[WKWebView _updateVisibleContentRects]): If we have a custom content view, call web_computedContentInsetDidChange. (-[WKWebView _setObscuredInsets:]): Don't call web_setObscuredInsets: if we have a custom content view. * UIProcess/API/Cocoa/WKWebViewInternal.h: Add new methods. * UIProcess/Cocoa/WKWebViewContentProvider.h: Add new methods. * UIProcess/ios/WKPDFView.mm: (-[WKPDFView web_initWithFrame:webView:]): Set the _webView and _scrollView ivars. (-[WKPDFView _offsetForPageNumberIndicator]): Get the computed content offset from the WKWebView. (-[WKPDFView web_computedContentInsetDidChange]): Update the page indicator. (-[WKPDFView initWithFrame:]): Deleted. (-[WKPDFView web_setObscuredInsets:]): Deleted. * UIProcess/ios/WKScrollView.mm: (-[WKScrollView setContentInset:]): Call _updateVisibleContentRects. 2014-06-23 Jaehun Lim <ljaehun.lim@samsung.com> Unreviewed, fix build warning. Source/WebKit2/WebProcess/WebPage/DrawingArea.h:117:18: warning: unused parameter ‘wantsDidUpdateViewState’ [-Wunused-parameter] * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::viewStateDidChange): 2014-06-23 Ryuan Choi <ryuan.choi@samsung.com> [EFL] Replace RefPtr<Evas_Object> with UniquePtrEfl https://bugs.webkit.org/show_bug.cgi?id=134236 Reviewed by Gyuyoung Kim. * PlatformEfl.cmake: * UIProcess/API/efl/EwkView.cpp: (EwkView::updateCursor): * UIProcess/API/efl/EwkView.h: * UIProcess/API/efl/SnapshotImageGL.cpp: * UIProcess/API/efl/ewk_favicon_database.cpp: (ewk_favicon_database_icon_get): * UIProcess/API/efl/tests/test_ewk2_refptr_evas_object.cpp: Removed. 2014-06-23 Daniel Bates <dabates@apple.com> [iOS][WK2] REGRESSION (r169324): Page jumps to top when you type into a text field https://bugs.webkit.org/show_bug.cgi?id=134219 <rdar://problem/17279113> Reviewed by Benjamin Poulain. Fixes an issue where typing into a text field may cause a noticeable jump to the top of the page. Currently when updating the visual content rectangles we always constrain the scroll offset (s_x, s_y) such that 0 <= s_x <= "content width" - "visible width" and 0 <= s_y <= "content height" - "visible height". However the UIProcess may want to scroll the page by an offset outside of this range to create a visually pleasing result. In particular, on iOS we may scroll the page slightly outside of this range (e.g. s_y > 0 = "content height" - "visible height") when a form control is focused so as to be consistent with platform convention. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateVisibleContentRects): Temporarily disable content edge constraint when updating scroll offset. 2014-06-23 Dan Bernstein <mitz@apple.com> <rdar://problem/17413374> [iOS] Application cache size per origin is not limited https://bugs.webkit.org/show_bug.cgi?id=134229 Reviewed by Anders Carlsson. * UIProcess/WebContext.cpp: (WebKit::WebContext::createNewWebProcess): Set the default quota per origin to the same value it is set in Legacy WebKit. 2014-06-23 Ryuan Choi <ryuan.choi@samsung.com> Unreviewed, EFL build fix after r170330. * WebProcess/WebPage/WebPage.cpp: Guard WKStringCF.h with PLATFORM(COCOA) macro. 2014-06-23 Timothy Horton <timothy_horton@apple.com> [WK2] Use the page background color instead of white when swipe snapshots were purged (134218) https://bugs.webkit.org/show_bug.cgi?id=134218 <rdar://problem/17426454> Reviewed by Benjamin Poulain. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _updateScrollViewBackground]): (-[WKWebView WebKit::]): * UIProcess/API/mac/WKView.mm: (-[WKView _takeViewSnapshot]): * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::shouldUseSnapshotForSize): (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::retrieveSnapshotForItem): Deleted. * UIProcess/mac/ViewSnapshotStore.h: Store a color along with each snapshot. Set the background color of the swipe snapshot layer accordingly. 2014-06-23 Anders Carlsson <andersca@apple.com> Add -[WKBackForwardList _removeAllItems] https://bugs.webkit.org/show_bug.cgi?id=134227 <rdar://problem/17291623> Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKBackForwardList.mm: (-[WKBackForwardList _removeAllItems]): * UIProcess/API/Cocoa/WKBackForwardListPrivate.h: Added. * WebKit2.xcodeproj/project.pbxproj: 2014-06-23 Dan Bernstein <mitz@apple.com> <rdar://problem/17413498> [Cocoa] Expose WebPreferences::offlineWebApplicationCacheEnabled https://bugs.webkit.org/show_bug.cgi?id=134217 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _offlineApplicationCacheIsEnabled]): (-[WKPreferences _setOfflineApplicationCacheIsEnabled:]): * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Added _offlineWebApplicationCacheIsEnabled property. 2014-06-23 Grant Kennell <gkennell@apple.com> Add SPI for Injected Bundle to provide user agent for a given URL. https://bugs.webkit.org/show_bug.cgi?id=133562 Reviewed by Sam Weinig. * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h: Added delegate method to WebProcess PluIn protocol to provide UserAgent per URL. * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h: Added new typedef for function pointer for this new delegate call. Added new version (V8) of bundle loader client struct containing a function pointer of that new type. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (userAgentForURL): Makes delegate call with the new method. (setUpPageLoaderClient): Sets the struct's new function pointer to the new method. * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp: (WebKit::InjectedBundlePageLoaderClient::userAgentForURL): * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::userAgent): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::userAgent): Began using the new API to ask for user agent instead of simply returning what had been stored. * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::userAgent): Deleted. 2014-06-23 Commit Queue <commit-queue@webkit.org> Unreviewed, rolling out r170324. https://bugs.webkit.org/show_bug.cgi?id=134223 lots of build breakage (Requested by bradeeoh on #webkit). Reverted changeset: "Unreviewed, revert an unintentional change committed with r170323." http://trac.webkit.org/changeset/170324 2014-06-23 Timothy Horton <timothy_horton@apple.com> [iOS][wk2] Don't use view snapshots if the destination layer is a different size https://bugs.webkit.org/show_bug.cgi?id=134210 <rdar://problem/17369463> Reviewed by Benjamin Poulain. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): Only use the view snapshot if the snapshot is the same (in device space) size as the layer it's going to be put into, and only if the device scale factor is the same as it was when the snapshot was taken. 2014-06-23 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] Make the state restore from HistoryItem more precise and reliable https://bugs.webkit.org/show_bug.cgi?id=134150 Reviewed by Tim Horton. This patch make several little improvements to improve how we restore the visible content rect and scale from the HistoryItem. The biggest architectural change is that the exposed rect is now restored on the UIProcess instead of the WebProcess, this ensure we restore the same position regardless of any modification of obscured areas. * Shared/VisibleContentRectUpdateInfo.cpp: (WebKit::VisibleContentRectUpdateInfo::encode): (WebKit::VisibleContentRectUpdateInfo::decode): * Shared/VisibleContentRectUpdateInfo.h: (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): (WebKit::VisibleContentRectUpdateInfo::lastLayerTreeTransactionId): (WebKit::WebPage::updateVisibleContentRects): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: A race between the UIProcess and the WebProcess could cause the viewport of the next page to be influenced by updates of the previous page. To avoid that, VisibleContentRectUpdateInfo keeps track of the last transaction seen at the time of the update. The WebProcess updates the size and scale of the content through layer tree updates. If an update was generated for a layer tree update of the old page, none of the information is valid for the current content. Since the UIProcess drives the state in case of conflicts, the WebProcess was updating the scale of the current page based on incorrect information. To avoid the problems, we save the layer tree transaction ID when we commit a new page. Only updates after that transaction are useful for the current page. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _processDidExit]): (withinEpsilon): (changeContentOffsetBoundedInValidRange): (-[WKWebView _didCommitLayerTree:WebKit::]): (-[WKWebView _restorePageStateToExposedRect:WebCore::scale:]): (-[WKWebView _restorePageStateToUnobscuredCenter:WebCore::scale:]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::restorePageState): (WebKit::PageClientImpl::restorePageCenterAndScale): Restoring the state is now done by WKWebView. The state is only updated on the next layer tree commit, this is done to avoid any jumping if the page has scrolled since we tried to restore its state. Both update path end up calling _updateVisibleContentRects. This is because the update on the WebProcess never sets the ScrollPosition (because it does not know the current state of the obscured insets). Pushing a new VisibleContentRect will nicely udpates the exposed rect, scroll position, fixed elements, etc. * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::restorePageState): (WebKit::WebPageProxy::restorePageCenterAndScale): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: (WebKit::RemoteLayerTreeDrawingAreaProxy::lastCommittedLayerTreeTransactionID): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy): * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm: (WebKit::WebFrameLoaderClient::saveViewStateToItem): (WebKit::WebFrameLoaderClient::restoreViewState): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): (WebKit::WebPage::didCommitLoad): * WebProcess/WebPage/WebPage.h: Get rid of m_obscuredTopInset. It was a bad idea. The UIProcess updates the obscured insets a lot during page load, the value we used to restore the scroll position was frequently stale. (WebKit::WebPage::userHasChangedPageScaleFactor): Deleted. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::savePageState): (WebKit::scaleAfterViewportWidthChange): (WebKit::relativeCenterAfterContentSizeChange): (WebKit::adjustExposedRectForNewScale): Extract this out of dynamicViewportSizeUpdate(). It is useful to adjust the exposed rect when restoring a HistoryItem to a ViewportConfiguration that is different from when it was saved. (WebKit::WebPage::restorePageState): There are two variations of restorePage: 1) If the viewport configuration is compatible, restore the exact scale and position of the page. 2) Otherwise, restore the scale and position similarily to dynamicViewportSizeUpdate(). (WebKit::WebPage::dynamicViewportSizeUpdate): (WebKit::WebPage::viewportConfigurationChanged): (WebKit::adjustExposedRectForBoundedScale): (WebKit::RemoteLayerTreeDrawingArea::currentTransactionID): Expose the transactionID for the race issue on VisibleRectUpdate. * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::setExposedContentRect): Store the exposed rect in floating point coordinates. This makes it possible to restore that exact position when needed. 2014-06-23 Eric Carlson <eric.carlson@apple.com> Unreviewed, revert an unintentional change committed with r170323. * UIProcess/API/Cocoa/WKBackForwardList.mm: 2014-06-23 Anders Carlsson <andersca@apple.com> Policy delegate methods should use CompletionHandlerCallChecker https://bugs.webkit.org/show_bug.cgi?id=134215 Reviewed by Dan Bernstein. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction): (WebKit::NavigationState::PolicyClient::decidePolicyForResponse): 2014-06-23 Anders Carlsson <andersca@apple.com> Don't use the WK prefix for internal C++ types https://bugs.webkit.org/show_bug.cgi?id=134214 Reviewed by Dan Bernstein. * Shared/AssistedNodeInformation.cpp: (WebKit::OptionItem::encode): (WebKit::OptionItem::decode): (WebKit::WKOptionItem::encode): Deleted. (WebKit::WKOptionItem::decode): Deleted. * Shared/AssistedNodeInformation.h: (WebKit::OptionItem::OptionItem): (WebKit::AssistedNodeInformation::AssistedNodeInformation): (WebKit::WKOptionItem::WKOptionItem): Deleted. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _requiresKeyboardWhenFirstResponder]): (-[WKContentView inputView]): (-[WKContentView requiresAccessoryView]): (-[WKContentView _updateAccessory]): (-[WKContentView textInputTraits]): (-[WKContentView assistedNodeSelectOptions]): (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): (-[WKContentView _stopAssistingNode]): * UIProcess/ios/forms/WKFormInputControl.mm: (-[WKDateTimePicker initWithView:datePickerMode:]): (-[WKFormInputControl initWithView:]): * UIProcess/ios/forms/WKFormSelectControl.h: * UIProcess/ios/forms/WKFormSelectControl.mm: (adjustedFontSize): * UIProcess/ios/forms/WKFormSelectPicker.mm: (-[WKOptionPickerCell initWithOptionItem:]): (-[WKOptionGroupPickerCell initWithOptionItem:]): (-[WKMultipleSelectPicker initWithView:]): (-[WKMultipleSelectPicker pickerView:viewForRow:forComponent:reusingView:]): (-[WKMultipleSelectPicker pickerView:row:column:checked:]): (-[WKSelectSinglePicker pickerView:attributedTitleForRow:forComponent:]): (-[WKSelectSinglePicker pickerView:didSelectRow:inComponent:]): * UIProcess/ios/forms/WKFormSelectPopover.mm: (-[WKSelectTableViewController initWithView:hasGroups:]): (-[WKSelectTableViewController tableView:numberOfRowsInSection:]): (-[WKSelectTableViewController tableView:titleForHeaderInSection:]): (-[WKSelectTableViewController populateCell:withItem:]): (-[WKSelectTableViewController findItemIndexAt:]): (-[WKSelectTableViewController findItemAt:]): (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]): (-[WKSelectTableViewController tableView:didSelectRowAtIndexPath:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getAssistedNodeInformation): 2014-06-23 Dan Bernstein <mitz@apple.com> [Cocoa] No way to grant storage quotas for web application cache https://bugs.webkit.org/show_bug.cgi?id=134213 Reviewed by Anders Carlsson. * UIProcess/API/APIUIClient.h: (API::UIClient::reachedApplicationCacheOriginQuota): Added this new client function, with a default implementation that calls the completion handler with the current quota. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Declared a new delegate method. * UIProcess/API/Cocoa/_WKSecurityOrigin.mm: (-[_WKSecurityOrigin _initWithSecurityOrigin:WebCore::]): Changed the parameter into a const reference, since we copy it. * UIProcess/API/Cocoa/_WKSecurityOriginInternal.h: * UIProcess/Cocoa/UIDelegate.h: Override API::UIClient::reachedApplicationCacheOriginQuota. Added flag to m_delegateMethods struct for new delegate method. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): Set new flag in m_delegateMethods struct. (WebKit::UIDelegate::UIClient::exceededDatabaseQuota): Updated for change in _WKSecurityOrigin initializer. (WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota): Added. Calls the new delegate method. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota): Added. Forwards the message to the UI client. * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: Added ReachedApplicationCacheOriginQuota message. * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h: (API::InjectedBundle::PageUIClient::didReachApplicationCacheOriginQuota): Changed the return type to bool, indicating whether the client handled the callback. * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp: (WebKit::InjectedBundlePageUIClient::didReachApplicationCacheOriginQuota): Return the appropriate value. * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota): If the bundle client didn’t handle the callback, send a message the the UI process, and update the quota with the reply. 2014-06-23 Tim Horton <timothy_horton@apple.com> [wk2] Synchronously wait a short time for a layer tree update after bringing a web view in-window https://bugs.webkit.org/show_bug.cgi?id=134189 Reviewed by Simon Fraser. Make the old behavior of -[WKView endDeferringViewInWindowChangesSync] the default; synchronously wait for a fraction of a second when a page that was previously in-window but currently isn't comes back in-window, until new content is painted (or we hit a timeout). * UIProcess/DrawingAreaProxy.h: (WebKit::DrawingAreaProxy::waitForDidUpdateViewState): * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h: * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateViewState): Delegate waitForDidUpdateViewState to the DrawingAreaProxys, because behavior is very dependent on them. * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::coreAnimationDidCommitLayers): (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState): Implement waitForDidUpdateViewState for the RemoteLayerTree; it waits for CommitLayerTree. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::updateViewState): (WebKit::WebPageProxy::viewStateDidChange): (WebKit::WebPageProxy::dispatchViewStateChange): (WebKit::WebPageProxy::waitForDidUpdateViewState): (WebKit::WebPageProxy::resetStateAfterProcessExited): (WebKit::WebPageProxy::viewSize): Deleted. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::didUpdateViewState): * UIProcess/API/mac/WKView.mm: (-[WKView endDeferringViewInWindowChangesSync]): Always waitForDidUpdateViewState when a page that was previously in-window but currently isn't comes back in-window. * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::viewStateDidChange): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): (WebKit::WebPage::setViewState): (WebKit::WebPage::didUpdateViewStateTimerFired): Deleted. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::flushLayers): (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange): * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea): (WebKit::TiledCoreAnimationDrawingArea::viewStateDidChange): (WebKit::TiledCoreAnimationDrawingArea::didUpdateViewStateTimerFired): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::didUpdateViewStateTimerFired): Deleted. Delegate sending of didUpdateViewState to the DrawingAreas (RemoteLayerTreeDrawingArea won't send it, because the UI process waits for CommitLayerTree instead). 2014-06-23 Timothy Horton <timothy_horton@apple.com> [iOS][wk2] Ensure that layers are marked volatile before allowing the process to suspend https://bugs.webkit.org/show_bug.cgi?id=134004 <rdar://problem/17186342> Reviewed by Simon Fraser. WebKit tries to make layers volatile when unparented, but sometimes isn't given a chance to do so before the process gets suspended, so we end up with lots of non-volatile surfaces that should really be volatile. * Shared/mac/RemoteLayerBackingStoreCollection.h: * Shared/mac/RemoteLayerBackingStoreCollection.mm: (WebKit::RemoteLayerBackingStoreCollection::markBackingStoreVolatileImmediately): (WebKit::RemoteLayerBackingStoreCollection::markAllBackingStoreVolatileImmediatelyIfPossible): Add markAllBackingStoreVolatileImmediatelyIfPossible, which tries to mark *all* buffers of *all* backing store, (live and unreachable), (front, back, and secondary), volatile right away. It returns false if any buffer isn't marked volatile (because it was in-use). * UIProcess/ios/ProcessThrottler.h: * UIProcess/ios/ProcessThrottler.mm: (WebKit::ProcessThrottler::updateAssertion): (WebKit::ProcessThrottler::processReadyToSuspend): (WebKit::ProcessThrottler::didCancelProcessSuspension): * UIProcess/ios/WebProcessProxyIOS.mm: (WebKit::WebProcessProxy::sendCancelProcessWillSuspend): (WebKit::WebProcessProxy::didCancelProcessSuspension): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: If the UI process is waiting for the Web process to confirm that it can suspend and something happens (the view is reparented) that cancels the suspension, inform the Web process that this happened, so that it can cancel any cleanup that might still be taking place. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::viewStateDidChange): If a view goes in-window, dispatch the view state change immediately without delay, to minimize the latency between coming in-window and being ready to go. * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::markLayersVolatileImmediatelyIfPossible): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer): Schedule a flush when we change the root layer; otherwise, we can end up detaching the root layer but changing nothing else, and never committing that change. (WebKit::RemoteLayerTreeDrawingArea::markLayersVolatileImmediatelyIfPossible): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::WebProcess): (WebKit::WebProcess::processWillSuspend): (WebKit::WebProcess::cancelProcessWillSuspend): (WebKit::WebProcess::markAllLayersVolatileIfPossible): (WebKit::WebProcess::processSuspensionCleanupTimerFired): When the UI process is going to suspend the process, it sends us ProcessWillSuspend, and defers the suspension until we send a ProcessReadyToSuspend back. Delay ProcessReadyToSuspend until all layers in our process have been marked volatile. We'll keep trying every 20ms until they're all volatile. For safety, the UI process will eventually stop waiting for us, but the volatility change is usually applied successfully within the first or second timer callback. 2014-06-23 Oliver Hunt <oliver@apple.com> Ensure that we always use symlink free paths when specifying cache directories https://bugs.webkit.org/show_bug.cgi?id=134206 Reviewed by Anders Carlsson. Sandboxing will deny symlink based paths, so we use realpath to create extensions. This leaves us in the position of an extension using a visually different path from other parts of the process code. This patch simply makes sure that we always use the realpath for cache directories, so making debugging easier and also ensuring that we don't ever accidentally try to use a path with symlinks that will thus get denied. * Shared/SandboxExtension.h: (WebKit::stringByResolvingSymlinksInPath): * Shared/mac/SandboxExtensionMac.mm: (WebKit::stringByResolvingSymlinksInPath): * UIProcess/WebContext.cpp: (WebKit::WebContext::ensureNetworkProcess): * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformDefaultApplicationCacheDirectory): (WebKit::WebContext::platformDefaultDiskCacheDirectory): (WebKit::WebContext::platformDefaultWebSQLDatabaseDirectory): (WebKit::WebContext::platformDefaultIconDatabasePath): (WebKit::WebContext::platformDefaultLocalStorageDirectory): 2014-06-23 Roger Fong <roger_fong@apple.com> Unregister notification observer registered in r170156. https://bugs.webkit.org/show_bug.cgi?id=134204. Reviewed by Tim Horton. * UIProcess/API/mac/WKView.mm: (-[WKView dealloc]): 2014-06-23 Dan Bernstein <mitz@apple.com> [Cocoa] No way to grant storage quotas for WebSQL https://bugs.webkit.org/show_bug.cgi?id=134175 Reviewed by Anders Carlsson. * Shared/WebSecurityOrigin.h: (WebKit::WebSecurityOrigin::securityOrigin): Changed to return a non-const reference. * UIProcess/API/APIUIClient.h: (API::UIClient::exceededDatabaseQuota): Added a completion handler parameter than takes the new quota, and changed the return type to void. * UIProcess/API/C/WKPage.cpp: (WKPageSetPageUIClient): Changed the override of exceededDatabaseQuota to call the completion handler with the new quota, or with the existing quota if the client doesn’t implement the callback. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Declared new delegate method. * UIProcess/API/Cocoa/_WKSecurityOrigin.h: Added. * UIProcess/API/Cocoa/_WKSecurityOrigin.mm: Added. (-[_WKSecurityOrigin _initWithSecurityOrigin:WebCore::]): Store the origin in an ivar. (-[_WKSecurityOrigin protocol]): Added this accessor. (-[_WKSecurityOrigin host]): Ditto. (-[_WKSecurityOrigin port]): Ditto. * UIProcess/API/Cocoa/_WKSecurityOriginInternal.h: Added. * UIProcess/Cocoa/UIDelegate.h: Override API::UIClient::exceededDatabaseQuota. Added flag to m_delegateMethods struct for new delegate method. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): Set new flag in m_delegateMethods struct. (WebKit::UIDelegate::UIClient::exceededDatabaseQuota): Added. Calls the new delegate method. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::exceededDatabaseQuota): Updated for the new client interface: now passing a completion handler that replies with the new quota. * WebKit2.xcodeproj/project.pbxproj: Added references to new files, sorted a group. 2014-06-23 Simon Fraser <simon.fraser@apple.com> More build fixing after r170295. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): 2014-06-23 Anders Carlsson <andersca@apple.com> Give read-only properties proper ownership attributes https://bugs.webkit.org/show_bug.cgi?id=134197 <rdar://problem/16830117> Reviewed by Dan Bernstein. Also, make WKFrameInfo conform to NSCopying since it's a data-only object and thus intended to be copied. * UIProcess/API/Cocoa/WKBackForwardList.h: * UIProcess/API/Cocoa/WKBackForwardListItem.h: * UIProcess/API/Cocoa/WKFrameInfo.h: * UIProcess/API/Cocoa/WKFrameInfo.mm: (-[WKFrameInfo copyWithZone:]): (-[WKFrameInfo setRequest:]): Deleted. * UIProcess/API/Cocoa/WKNavigation.h: * UIProcess/API/Cocoa/WKNavigationAction.h: * UIProcess/API/Cocoa/WKNavigationAction.mm: (-[WKNavigationAction setSourceFrame:]): (-[WKNavigationAction setTargetFrame:]): * UIProcess/API/Cocoa/WKNavigationActionInternal.h: * UIProcess/API/Cocoa/WKNavigationResponse.h: * UIProcess/API/Cocoa/WKScriptMessage.h: * UIProcess/API/Cocoa/WKUserContentController.h: * UIProcess/API/Cocoa/WKUserScript.h: * UIProcess/API/Cocoa/WKWebView.h: 2014-06-23 Gwang Yoon Hwang <yoon@igalia.com> Unreviewed, GTK build fix after r170274. * WebProcess/WebPage/DrawingAreaImpl.cpp: Drawing::m_webPage changed to reference. (WebKit::DrawingAreaImpl::DrawingAreaImpl): (WebKit::DrawingAreaImpl::setNeedsDisplay): (WebKit::DrawingAreaImpl::setNeedsDisplayInRect): (WebKit::DrawingAreaImpl::forceRepaint): (WebKit::DrawingAreaImpl::updatePreferences): (WebKit::DrawingAreaImpl::layerHostDidFlushLayers): (WebKit::DrawingAreaImpl::updateBackingStoreState): (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState): (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode): (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): (WebKit::DrawingAreaImpl::display): * WebProcess/WebPage/DrawingAreaImpl.h: 2014-06-22 Gyuyoung Kim <gyuyoung.kim@samsung.com> REGRESSION(r170163): It made everything crash on EFL https://bugs.webkit.org/show_bug.cgi?id=134097 Unreviewed EFL layout test and perforamcne crash fix. * WebProcess/WebPage/WebPage.cpp: Add a null check for m_mainFrame. (WebKit::WebPage::didCompletePageTransition): 2014-06-22 Gyuyoung Kim <gyuyoung.kim@samsung.com> Unreviewed EFL build fix since r170274. Use reference for m_webPage member variable. * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp: (WebKit::CoordinatedDrawingArea::CoordinatedDrawingArea): (WebKit::CoordinatedDrawingArea::setNeedsDisplay): (WebKit::CoordinatedDrawingArea::setNeedsDisplayInRect): (WebKit::CoordinatedDrawingArea::forceRepaint): (WebKit::CoordinatedDrawingArea::updatePreferences): (WebKit::CoordinatedDrawingArea::mainFrameContentSizeChanged): (WebKit::CoordinatedDrawingArea::layerHostDidFlushLayers): (WebKit::CoordinatedDrawingArea::updateBackingStoreState): (WebKit::CoordinatedDrawingArea::sendDidUpdateBackingStoreState): (WebKit::CoordinatedDrawingArea::suspendPainting): (WebKit::CoordinatedDrawingArea::resumePainting): (WebKit::CoordinatedDrawingArea::enterAcceleratedCompositingMode): (WebKit::CoordinatedDrawingArea::display): * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h: 2014-06-22 Tim Horton <timothy_horton@apple.com> [iOS][wk2] Swiping back sometimes results in a missing (not blank) swipe snapshot https://bugs.webkit.org/show_bug.cgi?id=134181 Reviewed by Benjamin Poulain. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::ViewGestureController): (WebKit::ViewGestureController::endSwipeGesture): (WebKit::ViewGestureController::setRenderTreeSize): (WebKit::ViewGestureController::removeSwipeSnapshot): * UIProcess/mac/ViewGestureController.h: Make it explicit that we should only remove the swipe snapshot when a big-enough render tree size arrives *after the swipe ends*. 2014-06-22 Tim Horton <timothy_horton@apple.com> Thread some references through the remote layer tree code https://bugs.webkit.org/show_bug.cgi?id=134177 Reviewed by Zalan Bujtas. A first pass at references for never-null things (first pass because I didn't touch the collections). Things that aren't straightforward reference-threading: * Shared/mac/RemoteLayerBackingStoreCollection.h: * Shared/mac/RemoteLayerBackingStoreCollection.mm: Remove the unimplemented/nonexistant RemoteLayerBackingStoreCollection::create. Make RemoteLayerBackingStoreCollection constructor not take a context, because m_context is never used. * WebProcess/WebPage/mac/RemoteLayerTreeContext.h: * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm: Factor out grabbing the PlatformLayerID in a few places. * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: Use WebPage::mainFrameView() instead of WebPage::corePage()->mainFrame().view(). * Shared/mac/RemoteLayerTreeTransaction.h: * Shared/mac/RemoteLayerTreeTransaction.mm: * WebProcess/WebPage/DrawingArea.cpp: * WebProcess/WebPage/DrawingArea.h: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/mac/GraphicsLayerCARemote.h: * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: * WebProcess/WebPage/mac/PlatformCALayerRemote.h: * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h: * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:om): * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp: * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h: * Shared/mac/RemoteLayerBackingStore.mm: References. 2014-06-22 Anders Carlsson <andersca@apple.com> Replace a couple of uses of bind with lambdas https://bugs.webkit.org/show_bug.cgi?id=134172 Reviewed by Sam Weinig. * Platform/IPC/Connection.cpp: (IPC::Connection::postConnectionDidCloseOnConnectionWorkQueue): (IPC::Connection::connectionDidClose): (IPC::Connection::dispatchMessage): (IPC::Connection::dispatchConnectionDidClose): Deleted. * Platform/IPC/Connection.h: * Shared/Plugins/NPObjectProxy.cpp: (WebKit::NPObjectProxy::NP_Deallocate): * UIProcess/Storage/LocalStorageDatabase.cpp: (WebKit::LocalStorageDatabase::scheduleDatabaseUpdate): * WebProcess/Plugins/Netscape/NetscapePlugin.cpp: (WebKit::NetscapePlugin::pluginThreadAsyncCall): (WebKit::NetscapePlugin::handlePluginThreadAsyncCall): Deleted. * WebProcess/Plugins/Netscape/NetscapePlugin.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::forceRepaintAsync): (WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition): 2014-06-20 Simon Fraser <simon.fraser@apple.com> Have scrollingTreeAsText() dump the non-fast-scrollable region https://bugs.webkit.org/show_bug.cgi?id=134149 Reviewed by Sam Weinig. Dump the non-fast-scrollable region (as an array of rects). * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: (WebKit::RemoteScrollingTreeTextStream::dump): 2014-06-22 Anders Carlsson <andersca@apple.com> Add IPC decoding support to BackForwardListState https://bugs.webkit.org/show_bug.cgi?id=134171 Reviewed by Dan Bernstein. * Shared/SessionState.cpp: (WebKit::isValidEnum): (WebKit::HTTPBody::Element::decode): (WebKit::HTTPBody::decode): (WebKit::FrameState::decode): (WebKit::PageState::decode): (WebKit::BackForwardListState::decode): * Shared/SessionState.h: 2014-06-22 Anders Carlsson <andersca@apple.com> Address a review comment. * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::HistoryEntryDataDecoder::markInvalid): (WebKit::decodeFormDataElement): 2014-06-21 Anders Carlsson <andersca@apple.com> Implement the rest of back forward tree decoding https://bugs.webkit.org/show_bug.cgi?id=134166 Reviewed by Sam Weinig. * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::HistoryEntryDataDecoder::operator>>): (WebKit::decodeFormDataElement): (WebKit::decodeFormData): (WebKit::decodeBackForwardTreeNode): 2014-06-22 Dan Bernstein <mitz@apple.com> [iOS] WKWebViewConfiguration.allowsInlineMediaPlayback has no effect https://bugs.webkit.org/show_bug.cgi?id=134170 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): Fixed a typo. 2014-06-21 Zan Dobersek <zdobersek@igalia.com> Unreviewed. Fixing the GTK+ build after r170253. * UIProcess/API/gtk/WebKitSettings.cpp: (_WebKitSettingsPrivate::_WebKitSettingsPrivate): WebPreferences::create() now takes an additional String argument. 2014-06-21 Dan Bernstein <mitz@apple.com> CallbackMap::put should be able to take an unwrapped function https://bugs.webkit.org/show_bug.cgi?id=134104 Reviewed by Anders Carlsson. * UIProcess/GenericCallback.h: (WebKit::CallbackMap::put): Added an overload that takes a function and creates and puts a callback. Changed both overloads of put() to return the callback ID. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::validateCommand): (WebKit::WebPageProxy::runJavaScriptInMainFrame): (WebKit::WebPageProxy::getRenderTreeExternalRepresentation): (WebKit::WebPageProxy::getSourceForFrame): (WebKit::WebPageProxy::getContentsAsString): (WebKit::WebPageProxy::getBytecodeProfile): (WebKit::WebPageProxy::getContentsAsMHTMLData): (WebKit::WebPageProxy::getSelectionOrContentsAsString): (WebKit::WebPageProxy::getSelectionAsWebArchiveData): (WebKit::WebPageProxy::getMainResourceDataOfFrame): (WebKit::WebPageProxy::getResourceDataFromFrame): (WebKit::WebPageProxy::getWebArchiveOfFrame): (WebKit::WebPageProxy::getMarkedRangeAsync): (WebKit::WebPageProxy::getSelectedRangeAsync): (WebKit::WebPageProxy::characterIndexForPointAsync): (WebKit::WebPageProxy::firstRectForCharacterRangeAsync): (WebKit::WebPageProxy::takeSnapshot): 2014-06-21 Anders Carlsson <andersca@apple.com> Make it possible to override debug preferences on a per-identifier basis as well as globally https://bugs.webkit.org/show_bug.cgi?id=134164 Reviewed by Dan Bernstein. * Shared/WebPreferencesDefinitions.h: * Shared/WebPreferencesKeys.cpp: * Shared/WebPreferencesKeys.h: * Shared/WebPreferencesStore.cpp: (WebKit::defaults): * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesCreate): (WKPreferencesCreateWithIdentifier): * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences init]): * UIProcess/WebPageGroup.cpp: (WebKit::WebPageGroup::WebPageGroup): * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::create): (WebKit::WebPreferences::createWithLegacyDefaults): (WebKit::WebPreferences::WebPreferences): * UIProcess/WebPreferences.h: * UIProcess/mac/WebPreferencesMac.mm: (WebKit::makeKey): (WebKit::debugUserDefaultsValue): (WebKit::setDebugBoolValueIfInUserDefaults): (WebKit::WebPreferences::platformInitializeStore): 2014-06-21 Anders Carlsson <andersca@apple.com> Begin work on decoding form data https://bugs.webkit.org/show_bug.cgi?id=134163 Reviewed by Sam Weinig. * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::HistoryEntryDataDecoder::operator>>): (WebKit::HistoryEntryDataDecoder::isValid): (WebKit::isValidEnum): (WebKit::decodeFormDataElement): (WebKit::decodeFormData): (WebKit::decodeBackForwardTreeNode): 2014-06-21 Anders Carlsson <andersca@apple.com> Only initialize WebPreferences from NSUserDefaults if there's an identifier https://bugs.webkit.org/show_bug.cgi?id=134162 Reviewed by Sam Weinig. We don't want to allow changing preferences by registering user defaults. * UIProcess/mac/WebPreferencesMac.mm: (WebKit::makeKey): (WebKit::WebPreferences::platformInitializeStore): 2014-06-21 Anders Carlsson <andersca@apple.com> Begin work on decoding the back/forward tree https://bugs.webkit.org/show_bug.cgi?id=134161 Reviewed by Sam Weinig. * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntries): (WebKit::HistoryEntryDataDecoder::operator>>): (WebKit::HistoryEntryDataDecoder::decodeArithmeticType): (WebKit::HistoryEntryDataDecoder::bufferIsLargeEnoughToContain): (WebKit::decodeBackForwardTreeNode): (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntryData): (WebKit::HistoryEntryDataDecoder::decode): Deleted. 2014-06-21 Brady Eidson <beidson@apple.com> Gamepad API - Deprecate the existing implementation https://bugs.webkit.org/show_bug.cgi?id=134108 Reviewed by Timothy Hatcher. -Add new "GAMEPAD_DEPRECATED" build flag, moving the existing implementation to use it -Move some implementation files into a "deprecated" subdirectory. * Configurations/FeatureDefines.xcconfig: 2014-06-20 Anders Carlsson <andersca@apple.com> Implement more of HistoryEntryDataDecoder https://bugs.webkit.org/show_bug.cgi?id=134146 Reviewed by Sam Weinig. * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::HistoryEntryDataDecoder::HistoryEntryDataDecoder): (WebKit::HistoryEntryDataDecoder::operator>>): (WebKit::HistoryEntryDataDecoder::decode): (WebKit::HistoryEntryDataDecoder::decodeFixedLengthData): (WebKit::HistoryEntryDataDecoder::alignBufferPosition): (WebKit::HistoryEntryDataDecoder::alignedBuffer): (WebKit::HistoryEntryDataDecoder::alignedBufferIsLargeEnoughToContain): (WebKit::HistoryEntryDataDecoder::markInvalid): (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntryData): 2014-06-21 Commit Queue <commit-queue@webkit.org> Unreviewed, rolling out r170244. https://bugs.webkit.org/show_bug.cgi?id=134157 GTK/EFL bindings generator works differently, making this patch not work there. Will fix entire patch after a rollout. (Requested by bradee-oh on #webkit). Reverted changeset: "Gamepad API - Deprecate the existing implementation" https://bugs.webkit.org/show_bug.cgi?id=134108 http://trac.webkit.org/changeset/170244 2014-06-21 Brady Eidson <beidson@apple.com> Gamepad API - Deprecate the existing implementation https://bugs.webkit.org/show_bug.cgi?id=134108 Reviewed by Timothy Hatcher. -Add new "GAMEPAD_DEPRECATED" build flag, moving the existing implementation to use it -Add the "Deprecated" suffix to some implementation files * Configurations/FeatureDefines.xcconfig: 2014-06-21 Gyuyoung Kim <gyuyoung.kim@samsung.com> [CoordinatedGraphics][WK2][EFL] Page is moved to (0,0) position before rendering content https://bugs.webkit.org/show_bug.cgi?id=133300 Reviewed by Csaba Osztrogonác. When new page is loaded, PageViewportController::didCommitLoad() calls PageViewportController::syncVisibleContents() with initial position via applyPositionAfterRenderingContents() before starting to render new page by PageViewportController::didRenderFrame(). This call flow causes that webview shows incomplete tiles to the user during a few milliseconds. To fix showing incomplete tiles during the page loading, this patch adds a flag so that we don't show the incomplete tiles until showing new page. * UIProcess/API/efl/EwkView.cpp: (EwkView::EwkView): * UIProcess/API/efl/EwkView.h: (EwkView::setWaitingForNewPage): (EwkView::waitingForNewPage): * UIProcess/efl/PageLoadClientEfl.cpp: (WebKit::PageLoadClientEfl::didCommitLoadForFrame): * UIProcess/efl/PageViewportControllerClientEfl.cpp: (WebKit::PageViewportControllerClientEfl::didChangeVisibleContents): * UIProcess/efl/ViewClientEfl.cpp: (WebKit::ViewClientEfl::didRenderFrame): (WebKit::ViewClientEfl::didCompletePageTransition): 2014-06-21 Ryosuke Niwa <rniwa@webkit.org> Commit queue has been failing due to a build failure in WKFoundation.h https://bugs.webkit.org/show_bug.cgi?id=134152 Reviewed by Csaba Osztrogonác. Landed by Brady Eidson. The build failure was caused by WKFoundation.h erroneously redefining NSURLSessionAuthChallengeDisposition even when building with 10.9 SDK. The availability of this type depends on the version of SDK, not the target operating system. * Shared/API/Cocoa/WKFoundation.h: 2014-06-21 Eva Balazsfalvi <evab.u-szeged@partner.samsung.com> Removing PAGE_VISIBILITY_API compile guard. https://bugs.webkit.org/show_bug.cgi?id=133844 Reviewed by Gavin Barraclough. * Configurations/FeatureDefines.xcconfig: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2014-06-20 Anders Carlsson <andersca@apple.com> Implement more of LegacySessionStateDecoder https://bugs.webkit.org/show_bug.cgi?id=134145 Reviewed by Sam Weinig. * Shared/SessionState.h: * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntry): (WebKit::HistoryEntryDataDecoder::HistoryEntryDataDecoder): (WebKit::HistoryEntryDataDecoder::finishDecoding): (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntryData): * UIProcess/mac/LegacySessionStateCoding.h: 2014-06-20 Anders Carlsson <andersca@apple.com> Implement more of LegacySessionStateDecoder https://bugs.webkit.org/show_bug.cgi?id=134144 Reviewed by Sam Weinig. * Shared/SessionState.cpp: (WebKit::BackForwardListState::encode): (WebKit::SessionState::encode): Deleted. * Shared/SessionState.h: * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::LegacySessionStateDecoder::decodeSessionState): (WebKit::LegacySessionStateDecoder::decodeSessionHistory): (WebKit::LegacySessionStateDecoder::decodeV0SessionHistory): (WebKit::LegacySessionStateDecoder::decodeV1SessionHistory): (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntries): (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntry): * UIProcess/mac/LegacySessionStateCoding.h: 2014-06-20 Ryuan Choi <ryuan.choi@samsung.com> Unreviewed. build fix for the cmake based ports since r170188 * CMakeLists.txt: Added LegacySessionState.cpp in source list. 2014-06-20 Dan Bernstein <mitz@apple.com> [Cocoa] No way to get the main frame’s main resource’s data https://bugs.webkit.org/show_bug.cgi?id=134113 Reviewed by Sam Weinig. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _getMainResourceDataWithCompletionHandler:]): Added. Calls WebPageProxy::getMainResourceDataOfFrame and invokes the completion handler form the callback. * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new method. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::getMainResourceDataOfFrame): Made it safe to pass a NULL frame into this function. 2014-06-20 Anders Carlsson <andersca@apple.com> Introduce a WKSessionStateRef object https://bugs.webkit.org/show_bug.cgi?id=134136 Reviewed by Tim Horton. WKSessionStateRef is going to hold session state, making it possible to migrate state from one webpage to another without having to do any serialization/deserialization. * Shared/API/c/WKBase.h: * Shared/APIObject.h: * Shared/SessionState.cpp: (WebKit::SessionState::encode): * Shared/SessionState.h: * UIProcess/API/APISessionState.cpp: Added. (API::SessionState::create): (API::SessionState::SessionState): (API::SessionState::~SessionState): * UIProcess/API/APISessionState.h: * UIProcess/API/C/WKAPICast.h: * UIProcess/API/C/WKSessionStateRef.cpp: (WKSessionStateCreateFromData): * UIProcess/API/C/WKSessionStateRef.h: * UIProcess/mac/LegacySessionStateCoding.cpp: (WebKit::LegacySessionStateDecoder::LegacySessionStateDecoder): (WebKit::LegacySessionStateDecoder::~LegacySessionStateDecoder): (WebKit::LegacySessionStateDecoder::decodeSessionState): * UIProcess/mac/LegacySessionStateCoding.h: * WebKit2.xcodeproj/project.pbxproj: 2014-06-19 Enrica Casucci <enrica@apple.com> iOS WebKit2: selection handles become too large when zooming a page. https://bugs.webkit.org/show_bug.cgi?id=134084 <rdar://problem/16799164> Reviewed by Benjamin Poulain. Since the document view is zoomed, we add a subview that has the inverse transform of the document view. This new view becomes the root for the selection hierarchy. The new view has zero size, not to interfere with the existing gestures on the WKContenView therefore we implement hitTest to detect interaction with the selection elements. * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView setupInteraction]): (-[WKContentView cleanupInteraction]): (-[WKContentView unscaledView]): (-[WKContentView inverseScale]): (-[WKContentView _updateUnscaledView]): (-[WKContentView hitTest:withEvent:::]): (-[WKContentView selectedTextRange]): 2014-06-20 Timothy Horton <timothy_horton@apple.com> Snapshotting WKThumbnailViews should not tell Web processes backing unparented WKViews that they're in window https://bugs.webkit.org/show_bug.cgi?id=134134 <rdar://problem/17402119> Reviewed by Anders Carlsson. * UIProcess/API/mac/WKView.mm: (-[WKView _setThumbnailView:]): Re-evaluating our in-window state is only useful if we're going to use the live layer tree; snapshots can be taken of unparented views with no trouble. Plus, doing so sets off a chain of expensive things in the Web process which we can avoid if using snapshots. 2014-06-20 Timothy Horton <timothy_horton@apple.com> WKThumbnailView should only use live layer trees before the snapshot arrives for parented WKViews https://bugs.webkit.org/show_bug.cgi?id=134129 <rdar://problem/17401591> Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/_WKThumbnailView.mm: (-[_WKThumbnailView initWithFrame:fromWKView:]): Add a white background to WKThumbnailView, so that if we have no snapshot and no layer tree, the view isn't transparent. * UIProcess/API/mac/WKView.mm: (-[WKView _updateThumbnailViewLayer]): We currently pull the live layer tree into the WKThumbnailView even in snapshot mode, before the snapshot arrives, to avoid flashing when transitioning a live WKView to a thumbnail view. This is, however, not useful for unparented WKViews, because their layer tree will be detached and we'll flash anyway. So, only do that when the WKView is parented. 2014-06-20 Geoffrey Garen <ggaren@apple.com> WebKit delegate methods should document their default behaviors https://bugs.webkit.org/show_bug.cgi?id=134132 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKNavigationDelegate.h: * UIProcess/API/Cocoa/WKUIDelegate.h: 2014-06-20 Simon Fraser <simon.fraser@apple.com> Fix lots of WK2 test crashes. We don't always have a ScrollingCoordinator. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::flushLayers): 2014-06-20 Anders Carlsson <andersca@apple.com> Always use XPC on iOS https://bugs.webkit.org/show_bug.cgi?id=134130 Reviewed by Sam Weinig. * UIProcess/ios/WebProcessProxyIOS.mm: (WebKit::WebProcessProxy::platformGetLaunchOptions): (WebKit::shouldUseXPC): Deleted. 2014-06-20 Anders Carlsson <andersca@apple.com> Fix build. * Shared/SessionState.cpp: 2014-06-20 Anders Carlsson <andersca@apple.com> Add ArgumentEncoder support to PageState and friends https://bugs.webkit.org/show_bug.cgi?id=134128 Reviewed by Andreas Kling. Change the classes to structs, get rid of the constructors/destructors and add encode member functions. * Shared/SessionState.cpp: (WebKit::HTTPBody::Element::encode): (WebKit::HTTPBody::encode): (WebKit::FrameState::encode): (WebKit::PageState::encode): (WebKit::HTTPBody::Element::Element): Deleted. (WebKit::HTTPBody::Element::~Element): Deleted. (WebKit::FrameState::FrameState): Deleted. (WebKit::FrameState::~FrameState): Deleted. (WebKit::PageState::PageState): Deleted. (WebKit::PageState::~PageState): Deleted. * Shared/SessionState.h: (WebKit::HTTPBody::Element::type): Deleted. 2014-06-20 Anders Carlsson <andersca@apple.com> Add encoding and decoding support for WTF::Optional https://bugs.webkit.org/show_bug.cgi?id=134125 Reviewed by Andreas Kling. * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder<WTF::Optional<T>>::encode): (IPC::ArgumentCoder<WTF::Optional<T>>::decode): 2014-06-20 Anders Carlsson <andersca@apple.com> Give NPAPI post requests a default content type https://bugs.webkit.org/show_bug.cgi?id=134120 Reviewed by Andreas Kling. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::loadURL): 2014-06-20 Simon Fraser <simon.fraser@apple.com> Always commit the scrolling tree when we flush layers https://bugs.webkit.org/show_bug.cgi?id=134115 Reviewed by Beth Dakin. The scrolling state tree contains bare pointers to GraphicsLayers, which get converted to CALayers at commit time. To avoid a window of time where those GraphicsLayer pointers go stale, commit the scrolling tree whenever we flush the compositing layer tree. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::flushLayers): 2014-06-19 Simon Fraser <simon.fraser@apple.com> [iOS WebKit2] Make -webkit-overflow-scrolling:touch work in iframes (breaks MSWord previews) https://bugs.webkit.org/show_bug.cgi?id=134085 <rdar://problem/16440586> Reviewed by Tim Horton. Add some debug-only assertions that check that the number of nodes we encoded is the expected number. * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: (WebKit::encodeNodeAndDescendants): (WebKit::RemoteScrollingCoordinatorTransaction::encode): 2014-06-19 Simon Fraser <simon.fraser@apple.com> Handle scrolling tree modifications which remove intermediate nodes https://bugs.webkit.org/show_bug.cgi?id=134082 Reviewed by Tim Horton. When updating the scrolling tree from the state tree, we failed to maintain the children arrays correctly. Fix by removing all children on scrolling nodes, and allowing the calls on children to add them back. A temporary hash map keeps the nodes alive. The state tree's m_nodesRemovedSinceLastCommit was also made into a HashSet, to make it easier to handle removal followed by re-insertion. * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: (WebKit::RemoteScrollingCoordinatorTransaction::decode): (WebKit::RemoteScrollingTreeTextStream::dump): 2014-06-19 Simon Fraser <simon.fraser@apple.com> Make ScrollingTreeNodes refounted, for easier tree reconfiguration https://bugs.webkit.org/show_bug.cgi?id=134075 Reviewed by Tim Horton. Make ScrollingTreeNode be ref-counted. * UIProcess/Scrolling/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::createNode): * UIProcess/Scrolling/RemoteScrollingTree.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::create): * WebProcess/Scrolling/RemoteScrollingCoordinator.h: * WebProcess/Scrolling/RemoteScrollingCoordinator.mm: (WebKit::RemoteScrollingCoordinator::createScrollingTreeNode): 2014-06-20 Dan Bernstein <mitz@apple.com> [Cocoa] No way to get the MIME type of the main frame https://bugs.webkit.org/show_bug.cgi?id=134111 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _MIMEType]): Added. Returns the MIME type of the main frame, or nil. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2014-06-20 Joseph Pecoraro <pecoraro@apple.com> [iOS]: Overrelease of RetainPtr object in file upload https://bugs.webkit.org/show_bug.cgi?id=134072 Reviewed by Brady Eidson. This ivar is a RetainPtr, the release will be done automatically for us when we assign to nil or destruct. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView fileUploadPanelDidDismiss:]): 2014-06-20 Anders Carlsson <andersca@apple.com> Begin stubbing out new session state classes https://bugs.webkit.org/show_bug.cgi?id=134110 Reviewed by Geoffrey Garen. The basic idea is that these classes will replace the data blobs representing HistoryItems that we currently send back and forth between the web and UI processes. * Shared/SessionState.cpp: Added. (WebKit::HTTPBody::Element::Element): (WebKit::HTTPBody::Element::~Element): (WebKit::FrameState::FrameState): (WebKit::FrameState::~FrameState): (WebKit::PageState::PageState): (WebKit::PageState::~PageState): * Shared/SessionState.h: Added. (WebKit::HTTPBody::Element::type): * WebKit2.xcodeproj/project.pbxproj: 2014-06-20 Anders Carlsson <andersca@apple.com> Rename SessionState to LegacySessionState https://bugs.webkit.org/show_bug.cgi?id=134107 Reviewed by Dan Bernstein. * Shared/LegacySessionState.cpp: Renamed from Source/WebKit2/Shared/SessionState.cpp. (IPC::ArgumentCoder<RefPtr<T>>::encode): (IPC::ArgumentCoder<RefPtr<T>>::decode): (WebKit::LegacySessionState::LegacySessionState): (WebKit::LegacySessionState::isEmpty): (WebKit::LegacySessionState::encode): (WebKit::LegacySessionState::decode): * Shared/LegacySessionState.h: Renamed from Source/WebKit2/Shared/SessionState.h. (WebKit::LegacySessionState::list): (WebKit::LegacySessionState::currentIndex): * Shared/WebPageCreationParameters.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): * UIProcess/cf/WebPageProxyCF.cpp: (WebKit::WebPageProxy::restoreFromSessionStateData): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::restoreSession): (WebKit::WebPage::restoreSessionAndNavigateToCurrentItem): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2014-06-20 Anders Carlsson <andersca@apple.com> Document the underlying types of the WKWindowFeatures rect properties https://bugs.webkit.org/show_bug.cgi?id=134103 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKWindowFeatures.h: 2014-06-20 Zan Dobersek <zdobersek@igalia.com> PluginProcessMainUnix should only scan for plugins when X11 plugin architecture is enabled https://bugs.webkit.org/show_bug.cgi?id=134098 Reviewed by Carlos Garcia Campos. * PluginProcess/unix/PluginProcessMainUnix.cpp: Guard the call to NetscapePluginModule::scanPlugin() with PLUGIN_ARCHITECTURE(X11) since the declaration has the same build guard. In case the X11 plugin architecture is not enabled the program exits with EXIT_FAILURE. 2014-06-20 Tim Horton <timothy_horton@apple.com> LayerPool’d PlatformCALayerRemote/RemoteLayerBackingStore can have stale context pointers https://bugs.webkit.org/show_bug.cgi?id=134050 <rdar://problem/17315114> Reviewed by Simon Fraser. * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::recursiveBuildTransaction): (WebKit::PlatformCALayerRemote::layerPool): * WebProcess/WebPage/mac/PlatformCALayerRemote.h: * WebProcess/WebPage/mac/RemoteLayerTreeContext.h: (WebKit::RemoteLayerTreeContext::layerPool): * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm: (WebKit::RemoteLayerTreeContext::buildTransaction): Ensure that layers being committed are always in the context that is committing them. Use a LayerPool per RemoteLayerTreeContext, to avoid moving layers between contexts. 2014-06-20 Tim Horton <timothy_horton@apple.com> WKContentViewInteraction isn't cleaned up when the Web Content process crashes https://bugs.webkit.org/show_bug.cgi?id=134080 <rdar://problem/17387652> and <rdar://problem/16848360> Reviewed by Benjamin Poulain. * UIProcess/ios/WKContentView.mm: (-[WKContentView _processDidExit]): Tear down WKContentViewInteraction when the process crashes. (-[WKContentView _didRelaunchProcess]): Set WKContentViewInteraction back up when the process is relaunched. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): Clear the SmartMagnificationController, which is a message receiver and thus must be re-created with the new page. Remove all gesture recognizers from the content view. Clear _fileUploadPanel, else we'll get an assert the next time we try to open one. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::resetStateAfterProcessExited): Give the PageClient a chance to clean up *before* we clean up internals; it is at a higher level and some cleanup depends on WebPageProxy members not having been cleared yet. 2014-06-19 Dan Bernstein <mitz@apple.com> Removed unused SPI -[WKWebView _runJavaScriptInMainFrame:]. Rubber-stamped by Simon Fraser. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _runJavaScriptInMainFrame:]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2014-06-19 Dan Bernstein <mitz@apple.com> Use a single map for all callback types in WebPageProxy https://bugs.webkit.org/show_bug.cgi?id=134069 Reviewed by Tim Horton. * UIProcess/GenericCallback.h: (WebKit::CallbackMap::take): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::printFinishedCallback): (WebKit::WebPageProxy::resetState): (WebKit::WebPageProxy::drawPagesForPrinting): * UIProcess/WebPageProxy.h: * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync): (WebKit::WebPageProxy::attributedStringForCharacterRangeCallback): 2014-06-19 Anders Carlsson <andersca@apple.com> Another build fix attempt. * Shared/API/Cocoa/WKFoundation.h: 2014-06-19 Dan Bernstein <mitz@apple.com> [iOS] Legacy processes are installed inside WebKit.framework https://bugs.webkit.org/show_bug.cgi?id=134079 Reviewed by Anders Carlsson. * Configurations/All.xcconfig: Exclude the legacy processes on iOS so they don’t get copied. * Configurations/BaseLegacyProcess.xcconfig: Set SKIP_INSTALL to YES on iOS. 2014-06-19 Anders Carlsson <andersca@apple.com> It's OS X, not OSX... * Shared/API/Cocoa/WKFoundation.h: 2014-06-19 Antti Koivisto <antti@apple.com> Unfreeze the layer tree on DidFirstVisuallyNonEmptyLayout https://bugs.webkit.org/show_bug.cgi?id=134073 Reviewed by Simon Fraser. DidFirstLayout is too early and we usually get a blank page. This doesn't match the existing iOS behavior either. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidLayout): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): 2014-06-19 Anders Carlsson <andersca@apple.com> Try to fix the Mavericks build. * Shared/API/Cocoa/WKFoundation.h: 2014-06-19 Sam Weinig <sam@webkit.org> [Cocoa] Need SPI to determine if the WKWebView is displaying a standalone image https://bugs.webkit.org/show_bug.cgi?id=134071 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _isDisplayingStandaloneImageDocument]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2014-06-19 Dan Bernstein <mitz@apple.com> Use a single map for all callback types in WebPageProxy https://bugs.webkit.org/show_bug.cgi?id=134069 Reviewed by Anders Carlsson. * UIProcess/GenericCallback.h: (WebKit::CallbackBase::as): Added. Performs a dynamic cast to a specific callback type. (WebKit::CallbackBase::CallbackBase): Added a type parameter, which is used to initialize the new m_type member. (WebKit::GenericCallback::GenericCallback): Pass the type to the base class constructor. (WebKit::GenericCallback::type): Added. Returns a unique type. (WebKit::GenericCallback::invalidate): Now virtual. (WebKit::CallbackMap::put): Adds the callback to the map. (WebKit::CallbackMap::take): Removes the callback from the map, and dynamically casts it to the specified type. (WebKit::CallbackMap::invalidate): Invalidates the map. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::validateCommand): (WebKit::WebPageProxy::runJavaScriptInMainFrame): (WebKit::WebPageProxy::getRenderTreeExternalRepresentation): (WebKit::WebPageProxy::getSourceForFrame): (WebKit::WebPageProxy::getContentsAsString): (WebKit::WebPageProxy::getBytecodeProfile): (WebKit::WebPageProxy::getSelectionOrContentsAsString): (WebKit::WebPageProxy::getSelectionAsWebArchiveData): (WebKit::WebPageProxy::getMainResourceDataOfFrame): (WebKit::WebPageProxy::getResourceDataFromFrame): (WebKit::WebPageProxy::getWebArchiveOfFrame): (WebKit::WebPageProxy::forceRepaint): (WebKit::WebPageProxy::clearLoadDependentCallbacks): (WebKit::WebPageProxy::voidCallback): (WebKit::WebPageProxy::dataCallback): (WebKit::WebPageProxy::imageCallback): (WebKit::WebPageProxy::stringCallback): (WebKit::WebPageProxy::scriptValueCallback): (WebKit::WebPageProxy::computedPagesCallback): (WebKit::WebPageProxy::validateCommandCallback): (WebKit::WebPageProxy::unsignedCallback): (WebKit::WebPageProxy::editingRangeCallback): (WebKit::WebPageProxy::rectForCharacterRangeCallback): (WebKit::WebPageProxy::resetState): (WebKit::WebPageProxy::computePagesForPrinting): (WebKit::WebPageProxy::drawRectToImage): (WebKit::WebPageProxy::drawPagesToPDF): (WebKit::WebPageProxy::getMarkedRangeAsync): (WebKit::WebPageProxy::getSelectedRangeAsync): (WebKit::WebPageProxy::characterIndexForPointAsync): (WebKit::WebPageProxy::firstRectForCharacterRangeAsync): (WebKit::WebPageProxy::takeSnapshot): * UIProcess/WebPageProxy.h: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::gestureCallback): (WebKit::WebPageProxy::touchesCallback): (WebKit::WebPageProxy::autocorrectionDataCallback): (WebKit::WebPageProxy::dictationContextCallback): (WebKit::WebPageProxy::autocorrectionContextCallback): (WebKit::WebPageProxy::selectWithGesture): (WebKit::WebPageProxy::updateSelectionWithTouches): (WebKit::WebPageProxy::requestAutocorrectionData): (WebKit::WebPageProxy::applyAutocorrection): (WebKit::WebPageProxy::requestDictationContext): (WebKit::WebPageProxy::requestAutocorrectionContext): (WebKit::WebPageProxy::selectWithTwoTouches): 2014-06-19 Anders Carlsson <andersca@apple.com> No way to handle HTTP Authentication with WKWebView https://bugs.webkit.org/show_bug.cgi?id=134067 <rdar://problem/17317874> Reviewed by Dan Bernstein. Add a public webView:didReceiveAuthenticationChallenge:completionHandler: delegate method and get rid of the SPI. * Shared/API/Cocoa/WKFoundation.h: * UIProcess/API/Cocoa/WKNavigationDelegate.h: * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): (WebKit::NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame): 2014-06-18 Roger Fong <roger_fong@apple.com> Don't kill the UIProcess until all local storage transactions have been committed. https://bugs.webkit.org/show_bug.cgi?id=134042. <rdar://problem/16660724>. Reviewed by Anders Carlsson. * UIProcess/API/mac/WKView.mm: Add a listener for the application will terminate notification. (-[WKView _applicationWillTerminate:]): (-[WKView initWithFrame:context:configuration:webView:]): * UIProcess/WebContext.cpp: Calls code in StorageManager to cleanup local storage transactions upon application termination. (WebKit::WebContext::applicationWillTerminate): * UIProcess/WebContext.h: * UIProcess/Storage/StorageManager.cpp: (WebKit::StorageManager::applicationWillTerminate): Dispatch local storage cleanup task to background thread and make sure the UIProcess can't exit early. * UIProcess/Storage/StorageManager.h: 2014-06-19 Oliver Hunt <oliver@apple.com> Switch to using the process parameters during initialisation to determine whether we hsould be using the network process. RS=Sam Weinig * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2014-06-19 Pratik Solanki <psolanki@apple.com> Copy SharedBuffer data into IPC message directly https://bugs.webkit.org/show_bug.cgi?id=133920 Reviewed by Anders Carlsson. When data array callbacks are enabled, we currently merge all the CFDataRefs in SharedBuffer into one contiguous memory buffer when creating IPC::DataReference. This patch creates a subclass of DataReference that uses SharedBuffer::getSomeData() to copy the data directly into the IPC message. * NetworkProcess/AsynchronousNetworkLoaderClient.cpp: (WebKit::AsynchronousNetworkLoaderClient::didReceiveBuffer): * Platform/IPC/ArgumentEncoder.cpp: (IPC::ArgumentEncoder::reserve): Added. (IPC::ArgumentEncoder::grow): * Platform/IPC/ArgumentEncoder.h: * Platform/IPC/DataReference.cpp: (IPC::SharedBufferDataReference::encode): * Platform/IPC/DataReference.h: (IPC::DataReference::~DataReference): 2014-06-18 Zan Dobersek <zdobersek@igalia.com> Unreviewed. Fixing the GTK+ build after r170114. * UIProcess/API/gtk/WebKitAuthenticationRequest.cpp: (webkit_authentication_request_get_proposed_credential): The core() accessor has been renamed to credential(). 2014-06-18 Dan Bernstein <mitz@apple.com> Try to fix the Mountain Lion build. * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame): 2014-06-18 Tim Horton <timothy_horton@apple.com> Remove RemoteLayerBackingStore’s RemoteLayerTreeContext pointer https://bugs.webkit.org/show_bug.cgi?id=134055 Reviewed by Simon Fraser. * Shared/mac/RemoteLayerBackingStore.h: * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::RemoteLayerBackingStore): (WebKit::RemoteLayerBackingStore::~RemoteLayerBackingStore): (WebKit::RemoteLayerBackingStore::ensureBackingStore): (WebKit::RemoteLayerBackingStore::display): (WebKit::RemoteLayerBackingStore::drawInContext): Remove RemoteLayerBackingStore's RemoteLayerTreeContext pointer. Instead, use the PlatformCALayer's. Pass the PlatformCALayer in to the constructor, and remove it from ensureBackingStore(); RemoteLayerBackingStore is (for now) strictly tied to a single layer. * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::ensureBackingStore): (WebKit::PlatformCALayerRemote::updateBackingStore): * WebProcess/WebPage/mac/PlatformCALayerRemote.h: (WebKit::PlatformCALayerRemote::context): 2014-06-18 Dan Bernstein <mitz@apple.com> [Cocoa] Modernize one-method authentication https://bugs.webkit.org/show_bug.cgi?id=134051 Reviewed by Anders Carlsson. Instead of an NSURLConnection-style delegate method that takes a challenge and responds to its sender, provide an NSURLSession-style method that takes a challenge and a completion handler. * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new delegate method, replacing old unused method. * UIProcess/Cocoa/NavigationState.h: Renamed flag in m_navigationDelegateMethods struct. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): Check for new delegate method and update new flag. (WebKit::NavigationState::LoaderClient::canAuthenticateAgainstProtectionSpaceInFrame): If the delegate implements the new method, return true (if it cannot handle the protection space, it can reject it through the completion handler), except for server-trust authentication, which is not supported yet. (WebKit::NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame): If the delegate implements the new method, call it, passing a completion handler that calls the right AuthenticationDecisionListener function based on its disposition and credential parameters. 2014-06-18 Anders Carlsson <andersca@apple.com> Make FrameLoadType a strongly typed enum https://bugs.webkit.org/show_bug.cgi?id=134047 Reviewed by Andreas Kling. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didCommitLoadForFrame): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::goForward): (WebKit::WebPage::goBack): (WebKit::WebPage::goToBackForwardItem): (WebKit::shouldReuseCommittedSandboxExtension): (WebKit::WebPage::didCommitLoad): 2014-06-18 Anders Carlsson <andersca@apple.com> Simplify WebSecurityOrigin https://bugs.webkit.org/show_bug.cgi?id=134049 Reviewed by Andreas Kling. * Shared/API/c/WKSecurityOrigin.cpp: (WKSecurityOriginCreateFromString): (WKSecurityOriginCreateFromDatabaseIdentifier): (WKSecurityOriginCopyDatabaseIdentifier): (WKSecurityOriginCopyToString): (WKSecurityOriginCopyProtocol): (WKSecurityOriginCopyHost): (WKSecurityOriginGetPort): * Shared/WebSecurityOrigin.h: (WebKit::WebSecurityOrigin::securityOrigin): (WebKit::WebSecurityOrigin::createFromDatabaseIdentifier): Deleted. (WebKit::WebSecurityOrigin::protocol): Deleted. (WebKit::WebSecurityOrigin::host): Deleted. (WebKit::WebSecurityOrigin::port): Deleted. (WebKit::WebSecurityOrigin::databaseIdentifier): Deleted. (WebKit::WebSecurityOrigin::toString): Deleted. * UIProcess/Notifications/WebNotificationManagerProxy.cpp: (WebKit::WebNotificationManagerProxy::providerDidUpdateNotificationPolicy): (WebKit::WebNotificationManagerProxy::providerDidRemoveNotificationPolicies): * UIProcess/Storage/StorageManager.cpp: (WebKit::StorageManager::deleteEntriesForOrigin): * UIProcess/Storage/StorageManager.h: * UIProcess/WebApplicationCacheManagerProxy.cpp: (WebKit::WebApplicationCacheManagerProxy::deleteEntriesForOrigin): * UIProcess/WebDatabaseManagerProxy.cpp: (WebKit::WebDatabaseManagerProxy::didGetDatabasesByOrigin): (WebKit::WebDatabaseManagerProxy::didGetDatabaseOrigins): (WebKit::WebDatabaseManagerProxy::deleteDatabaseWithNameForOrigin): (WebKit::WebDatabaseManagerProxy::deleteDatabasesForOrigin): (WebKit::WebDatabaseManagerProxy::setQuotaForOrigin): (WebKit::WebDatabaseManagerProxy::didModifyOrigin): (WebKit::WebDatabaseManagerProxy::didModifyDatabase): * UIProcess/WebKeyValueStorageManager.cpp: (WebKit::didGetStorageDetailsByOrigin): * UIProcess/WebOriginDataManagerProxy.cpp: (WebKit::WebOriginDataManagerProxy::deleteEntriesForOrigin): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::exceededDatabaseQuota): (WebKit::WebPageProxy::requestGeolocationPermissionForFrame): * UIProcess/WebResourceCacheManagerProxy.cpp: (WebKit::WebResourceCacheManagerProxy::clearCacheForOrigin): * UIProcess/ios/WKGeolocationProviderIOS.mm: (-[WKGeolocationProviderIOS decidePolicyForGeolocationRequestFromOrigin:frame:request:window:]): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::exceededDatabaseQuota): 2014-06-18 Anders Carlsson <andersca@apple.com> Add back WKPageRunJavaScriptInMainFrame_b for now https://bugs.webkit.org/show_bug.cgi?id=134045 <rdar://problem/17368879> Reviewed by Tim Horton. Reverted changeset: "Remove WKPageRunJavaScriptInMainFrame_b" https://bugs.webkit.org/show_bug.cgi?id=133926 http://trac.webkit.org/changeset/169991 2014-06-18 Anders Carlsson <andersca@apple.com> Simplify WebPageProxy::saveRecentSearches and WebPageProxy::loadRecentSearches https://bugs.webkit.org/show_bug.cgi?id=134041 Reviewed by Andreas Kling. * UIProcess/cf/WebPageProxyCF.cpp: (WebKit::WebPageProxy::saveRecentSearches): (WebKit::WebPageProxy::loadRecentSearches): 2014-06-18 Simon Fraser <simon.fraser@apple.com> Make ScrollingStateNodes refcounted, and other minor cleanup https://bugs.webkit.org/show_bug.cgi?id=134040 Reviewed by Beth Dakin. * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: (WebKit::encodeNodeAndDescendants): 2014-06-18 Benjamin Poulain <benjamin@webkit.org> [iOS][WK2] Do not add padding when magnifying replaced elements https://bugs.webkit.org/show_bug.cgi?id=134019 Reviewed by Tim Horton. Having margins for regular blocks make sense to improve readability. For replaced elements, we should follow iOS's UI and display edge to edge. * UIProcess/ios/SmartMagnificationController.mm: (WebKit::SmartMagnificationController::didCollectGeometryForSmartMagnificationGesture): 2014-06-18 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] Re-sync didCommitLoadForMainFrame with its corresponding tile update https://bugs.webkit.org/show_bug.cgi?id=134009 Reviewed by Tim Horton. WKWebView assumed the first _didCommitLayerTree: after _didCommitLoadForMainFrame had the state of the page being loaded. This is not always true. Sometimes, a set of tiles can be rendering asynchronously while the next page is loaded, and does not flush the queue until after didCommitLoadForMainFrame is executed. Tim introduced a transactionID with each layer tree update. This patch uses that to synchronize WKWebView with the right set of tiles. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLoadForMainFrame]): (-[WKWebView _didCommitLayerTree:WebKit::]): (-[WKWebView _updateVisibleContentRects]): * UIProcess/WebPageProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: (WebKit::RemoteLayerTreeDrawingAreaProxy::nextLayerTreeTransactionID): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.messages.in: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy): (WebKit::RemoteLayerTreeDrawingAreaProxy::willCommitLayerTree): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::flushLayers): 2014-06-18 Anders Carlsson <andersca@apple.com> Simplify WebCredential https://bugs.webkit.org/show_bug.cgi?id=134036 Reviewed by Andreas Kling. * UIProcess/API/C/WKCredential.cpp: (WKCredentialCreate): (WKCredentialCreateWithCertificateInfo): (WKCredentialCopyUser): * UIProcess/Authentication/AuthenticationChallengeProxy.cpp: (WebKit::AuthenticationChallengeProxy::useCredential): * UIProcess/Authentication/WebCredential.cpp: (WebKit::WebCredential::credential): (WebKit::WebCredential::core): Deleted. (WebKit::WebCredential::user): Deleted. * UIProcess/Authentication/WebCredential.h: (WebKit::WebCredential::create): Deleted. 2014-06-18 Anders Carlsson <andersca@apple.com> Adopt modern C++11 loops and fix WebArchive creation functions https://bugs.webkit.org/show_bug.cgi?id=134032 Reviewed by Andreas Kling. * Shared/APIWebArchive.cpp: (API::WebArchive::WebArchive): 2014-06-18 Anders Carlsson <andersca@apple.com> Give WKWebView on iOS a mobile user agent https://bugs.webkit.org/show_bug.cgi?id=134034 <rdar://problem/17346489> Reviewed by Enrica Casucci. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): 2014-06-18 Joseph Pecoraro <pecoraro@apple.com> Remove stale include, header was removed in r170101. Unreviewed build fix. * Shared/API/Cocoa/WebKitPrivate.h: 2014-06-18 Anders Carlsson <andersca@apple.com> Add CF type cast function templates and use them in KeyedDecoder in WebKit2 https://bugs.webkit.org/show_bug.cgi?id=134033 Reviewed by Sam Weinig. * Shared/cf/KeyedDecoder.cpp: (WebKit::KeyedDecoder::KeyedDecoder): (WebKit::KeyedDecoder::decodeBytes): (WebKit::KeyedDecoder::decodeBool): (WebKit::KeyedDecoder::decodeInt32): (WebKit::KeyedDecoder::decodeInt64): (WebKit::KeyedDecoder::decodeFloat): (WebKit::KeyedDecoder::decodeDouble): (WebKit::KeyedDecoder::decodeString): (WebKit::KeyedDecoder::beginObject): (WebKit::KeyedDecoder::beginArray): (WebKit::KeyedDecoder::beginArrayElement): 2014-06-18 Dan Bernstein <mitz@apple.com> Remove the unused _WKBackForwardListDidChangeNotification. Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKBackForwardList.mm: * UIProcess/API/Cocoa/WKBackForwardListInternal.h: * UIProcess/API/Cocoa/WKBackForwardListPrivate.h: Removed. * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::LoaderClient::didChangeBackForwardList): Deleted. * WebKit2.xcodeproj/project.pbxproj: 2014-06-18 Andreas Kling <akling@apple.com> Set main thread QoS policies after IPC initialization. <https://webkit.org/b/134014> Something was flipping the QoS level back to "unspecified" after setting it in the ChildProcess initialization code. Pending a better understanding of what really happens, move the code to a later stage, after IPC channels are up and running. Now the priority sticks. Reviewed by Anders Carlsson. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::initializeNetworkProcess): * Shared/ChildProcess.cpp: (WebKit::ChildProcess::initialize): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): 2014-06-17 Dan Bernstein <mitz@apple.com> [Cocoa] WKWebView's _privateBrowsingEnabled property is unused https://bugs.webkit.org/show_bug.cgi?id=134013 Reviewed by Sam Weinig. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _privateBrowsingEnabled]): Deleted. (-[WKWebView _setPrivateBrowsingEnabled:]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2014-06-17 Tim Horton <timothy_horton@apple.com> [iOS][wk2] Use ImageDocument to display subframe PDFs https://bugs.webkit.org/show_bug.cgi?id=133944 <rdar://problem/17205983> Reviewed by Dan Bates. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Always use ImageDocument for subframe PDFs in WebKit2 on iOS. 2014-06-17 Anders Carlsson <andersca@apple.com> Make it possible to use -[NSBundle classNamed:] to find WebKitLegacy classes https://bugs.webkit.org/show_bug.cgi?id=134008 <rdar://problem/17037600> Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/LegacyBundleForClass.mm: Added. * WebKit2.xcodeproj/project.pbxproj: 2014-06-17 Anders Carlsson <andersca@apple.com> Expose the location of website data https://bugs.webkit.org/show_bug.cgi?id=134000 <rdar://problem/17350498> Reviewed by Dan Bernstein. Also, remove the bundle ID from the website data path for containerized apps. * Shared/mac/SandboxUtilities.cpp: (WebKit::processIsAppSandboxed): * Shared/mac/SandboxUtilities.h: * UIProcess/API/Cocoa/WKProcessPool.mm: (+[WKProcessPool _websiteDataURLForContainerWithURL:]): (websiteDataDirectoryURL): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: 2014-06-17 Jeremy Jones <jeremyj@apple.com> Improve enter and exit fullscreen transition by using two step transition. https://bugs.webkit.org/show_bug.cgi?id=133706 Reviewed by Simon Fraser. Add setupFullscreen()/didSetupFullscreen() and cleanupFullscreen()/didCleanupFullscreen() to the proxies. And refactor enter/exit fullscreen to do some of the work in setup/cleanup. * UIProcess/ios/WebVideoFullscreenManagerProxy.h: Add four methods mentioned above. * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: Add Setup/Cleanup functions. * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): does what enterFullscreen used to do. (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen): forward IPC. (WebKit::WebVideoFullscreenManagerProxy::didSetupFullscreen): forward IPC. (WebKit::WebVideoFullscreenManagerProxy::enterFullscreenWithID): changed to enterFullscreen * WebProcess/ios/WebVideoFullscreenManager.h: Add didSetup/didCleanup * WebProcess/ios/WebVideoFullscreenManager.messages.in: Add didSetup/didCleanup * WebProcess/ios/WebVideoFullscreenManager.mm: (WebKit::WebVideoFullscreenManager::enterFullscreenForNode): refactored, some implementation moves to didSetupFullscreen. (WebKit::WebVideoFullscreenManager::didSetupFullscreen): Moves the video layer over to the hosted layer, and initiates fullscreen. (WebKit::WebVideoFullscreenManager::didExitFullscreen): refactored, some implementation moves to didCleanupFullscreen, and initiates cleanup. (WebKit::WebVideoFullscreenManager::didCleanupFullscreen): Final cleanup refactored from didExitFullscreen() 2014-06-17 Eric Carlson <eric.carlson@apple.com> [iOS] enable background audio in WK2 https://bugs.webkit.org/show_bug.cgi?id=133996 Reviewed by Jer Noble. * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info-iOS.plist: Mark as allowed to play audio when in the background. * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist: Ditto. 2014-06-17 Simon Fraser <simon.fraser@apple.com> [UI-side compositing] fix reflections on composited layers https://bugs.webkit.org/show_bug.cgi?id=133942 Reviewed by Tim Horton. Fix reflections on composited layers. There are two main set of changes. First, a PlatformCALayerRemote which is a clone has to track the layer it is a clone of, so it knows where to grab the contents from in the UI process. This layer may be told that its contents need updating out of order during recursiveBuildTransaction(), so we need some small changes in RemoteLayerTreeContext to allow a layer to add itself to the set of layers requiring commit. In the UI process, a new step is added to RemoteLayerTreeHost::updateLayerTree() to go through clones, and copy their contents from the origin layer. The second set of changes makes platformCALayerLayerDidDisplay() work for UI-side compositing by not taking a PlatformLayer*, but instead a PlatformCALayer*. PlatformCALayer::setContentsChanged() changed to copyContentsFromLayer() so we know what the origin layer is. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::display): Remove the early return so we can always call platformCALayerLayerDidDisplay(). * Shared/mac/RemoteLayerTreeTransaction.h: * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties): (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode): (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode): (WebKit::dumpChangedLayers): * UIProcess/mac/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::updateLayerTree): * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::clone): (WebKit::PlatformCALayerRemote::recursiveBuildTransaction): (WebKit::PlatformCALayerRemote::copyContentsFromLayer): (WebKit::PlatformCALayerRemote::setClonedLayer): (WebKit::PlatformCALayerRemote::setContentsChanged): Deleted. * WebProcess/WebPage/mac/PlatformCALayerRemote.h: (WebKit::PlatformCALayerRemote::properties): (WebKit::PlatformCALayerRemote::context): 2014-06-17 Anders Carlsson <andersca@apple.com> Remove session state methods from WKBrowsingContextController https://bugs.webkit.org/show_bug.cgi?id=133995 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKBrowsingContextController.h: * UIProcess/API/Cocoa/WKBrowsingContextController.mm: (-[WKBrowsingContextController sessionState]): Deleted. (-[WKBrowsingContextController restoreFromSessionState:]): Deleted. 2014-06-17 Brady Eidson <beidson@apple.com> Only show telephone number highlights if only one number is selected <rdar://problem/16874568> and https://bugs.webkit.org/show_bug.cgi?id=133989 Reviewed by Tim Horton. Add a flag to TelephoneNumberData to remember if it was hovered over: * WebProcess/WebPage/TelephoneNumberOverlayController.h: (WebKit::TelephoneNumberData::hovered): (WebKit::TelephoneNumberData::setHovered): (WebKit::TelephoneNumberData::TelephoneNumberData): * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm: (WebKit::TelephoneNumberOverlayController::drawRect): Only draw the highlight if one phone number is selected. (WebKit::TelephoneNumberOverlayController::mouseEvent): Update the hover state of the current phone number, and setNeedsDisplay if the hover state changes. (WebKit::TelephoneNumberOverlayController::clearHighlights): 2014-06-17 Tim Horton <timothy_horton@apple.com> Remove WKContentView _setFindIndicator:fadeOut:animate: https://bugs.webkit.org/show_bug.cgi?id=133976 Reviewed by Anders Carlsson. Find indicators are totally internal to FindController on iOS, we don't need to push them to the content view via PageClient, so this code was unused. * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::setFindIndicator): * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView _setFindIndicator:WebKit::fadeOut:animate:]): Deleted. 2014-06-17 Andreas Kling <akling@apple.com> Web process main thread priority is lower than some network process threads. <https://webkit.org/b/133987> <rdar://problem/17330300> Mark the main thread as "user initiated" in process entry. Reviewed by Maciej Stachowiak. * Shared/ChildProcess.cpp: (WebKit::ChildProcess::initialize): 2014-06-17 Anders Carlsson <andersca@apple.com> Add SPI to get the NSURLRequest from a WKNavigationResponse https://bugs.webkit.org/show_bug.cgi?id=133984 <rdar://problem/17006399> Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKNavigationResponse.mm: (-[WKNavigationResponse _request]): * UIProcess/API/Cocoa/WKNavigationResponseInternal.h: * UIProcess/API/Cocoa/WKNavigationResponsePrivate.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::PolicyClient::decidePolicyForResponse): 2014-06-17 Gyuyoung Kim <gyuyoung.kim@samsung.com> [EFL][WK2] Skip failing EFL API tests https://bugs.webkit.org/show_bug.cgi?id=133981 Reviewed by Csaba Osztrogonác. UserMessage, WillLoad and test_ewk2_view have been failed since r169784. * PlatformEfl.cmake: 2014-06-17 Zan Dobersek <zdobersek@igalia.com> Unreviewed build fix for the GTK+ port. Removing the *Callback::create() wrappings for lambda callbacks that aren't required anymore after the changes in r170041. * UIProcess/API/gtk/WebKitWebView.cpp: (webkit_web_view_can_execute_editing_command): (webkit_web_view_run_javascript): (resourcesStreamReadCallback): (webkit_web_view_save): (webkit_web_view_save_to_file): 2014-06-16 Jaehun Lim <ljaehun.lim@samsung.com> Unreviewed build fix when MHTML is enabled after r170041 * UIProcess/API/C/WKPage.cpp: (WKPageGetContentsAsMHTMLData): 2014-06-16 Dan Bernstein <mitz@apple.com> Part 2 of: Change GenericCallback<> function parameters into std::function<> https://bugs.webkit.org/show_bug.cgi?id=133927 Reviewed by Sam Weinig. * UIProcess/API/C/WKPage.cpp: (WKPageRunJavaScriptInMainFrame): (WKPageRenderTreeExternalRepresentation): (WKPageGetSourceForFrame): (WKPageGetContentsAsString): (WKPageGetBytecodeProfile): (WKPageGetSelectionAsWebArchiveData): (WKPageValidateCommand): * UIProcess/API/C/WKPluginSiteDataManager.cpp: (WKPluginSiteDataManagerClearSiteData): (WKPluginSiteDataManagerClearAllSiteData): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView evaluateJavaScript:completionHandler:]): * UIProcess/API/mac/WKView.mm: (-[WKView validateUserInterfaceItem:]): (-[WKView startSpeaking:]): (-[WKView selectedRangeWithCompletionHandler:]): (-[WKView markedRangeWithCompletionHandler:]): (-[WKView hasMarkedTextWithCompletionHandler:]): (-[WKView firstRectForCharacterRange:completionHandler:]): (-[WKView characterIndexForPoint:completionHandler:]): * UIProcess/Plugins/WebPluginSiteDataManager.cpp: (WebKit::WebPluginSiteDataManager::clearSiteData): * UIProcess/Plugins/WebPluginSiteDataManager.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::validateCommand): (WebKit::WebPageProxy::runJavaScriptInMainFrame): (WebKit::WebPageProxy::getRenderTreeExternalRepresentation): (WebKit::WebPageProxy::getSourceForFrame): (WebKit::WebPageProxy::getContentsAsString): (WebKit::WebPageProxy::getBytecodeProfile): (WebKit::WebPageProxy::getContentsAsMHTMLData): (WebKit::WebPageProxy::getSelectionOrContentsAsString): (WebKit::WebPageProxy::getSelectionAsWebArchiveData): (WebKit::WebPageProxy::getMarkedRangeAsync): (WebKit::WebPageProxy::getSelectedRangeAsync): (WebKit::WebPageProxy::characterIndexForPointAsync): (WebKit::WebPageProxy::firstRectForCharacterRangeAsync): (WebKit::WebPageProxy::takeSnapshot): * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _define:]): (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]): (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]): (-[WKContentView requestDictationContext:]): (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]): (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::updateSelectionWithTouches): (WebKit::WebPageProxy::requestAutocorrectionData): (WebKit::WebPageProxy::applyAutocorrection): (WebKit::WebPageProxy::requestDictationContext): (WebKit::WebPageProxy::requestAutocorrectionContext): 2014-06-16 Jaehun Lim <ljaehun.lim@samsung.com> Unreviewed build fix after r170029 Use String() instead of AtomicString(). * UIProcess/InspectorServer/HTTPRequest.cpp: (WebKit::HTTPRequest::parseHeaders): 2014-06-16 Brent Fulgham <bfulgham@apple.com> [Win] Use TileController on Windows https://bugs.webkit.org/show_bug.cgi?id=133895 Reviewed by Tim Horton. * WebProcess/WebPage/mac/PlatformCALayerRemote.h: Remove unneeded overload. 2014-06-16 Timothy Horton <timothy_horton@apple.com> [iOS][wk2] Swipe snapshots are removed too quickly if there is no saved render tree size https://bugs.webkit.org/show_bug.cgi?id=133891 Reviewed by Simon Fraser. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::endSwipeGesture): (WebKit::ViewGestureController::setRenderTreeSize): If we don't know the target render tree size, wait until the first layer tree commit that comes in, instead of removing the snapshot when the gesture ends. 2014-06-16 Timothy Horton <timothy_horton@apple.com> [iOS][wk2] Swiping back briefly shows the previous page before loading the new one https://bugs.webkit.org/show_bug.cgi?id=133885 Reviewed by Simon Fraser. Remove a race between the UI and Web processes when removing the swipe snapshot. Previously, it was possible to get a commit from the Web process with layer content (and render tree size) from the previous page *after* sending the navigation request to the page, because of the asynchronicity of layer tree commits. This could cause the snapshot to be removed early (if the previous fully-loaded page had a sufficiently large render tree size), revealing the old tiles underneath the snapshot. * Shared/mac/RemoteLayerTreeTransaction.h: (WebKit::RemoteLayerTreeTransaction::transactionID): (WebKit::RemoteLayerTreeTransaction::setTransactionID): * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::encode): (WebKit::RemoteLayerTreeTransaction::decode): * UIProcess/DrawingAreaProxy.h: (WebKit::DrawingAreaProxy::lastVisibleTransactionID): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy): (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): (WebKit::RemoteLayerTreeDrawingAreaProxy::coreAnimationDidCommitLayers): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea): (WebKit::RemoteLayerTreeDrawingArea::flushLayers): (WebKit::RemoteLayerTreeDrawingArea::didUpdate): Keep track of an ever-increasing transaction ID in RemoteLayerTreeDrawingArea(Proxy). It increments in the UI process at didUpdate time, because the Web process cannot have started on a new layer tree commit until didUpdate is sent. It increments in the Web process at commit time. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::endSwipeGesture): (WebKit::ViewGestureController::setRenderTreeSize): * UIProcess/mac/ViewGestureController.h: Adopt transaction IDs; don't remove the snapshot until the commit that includes the navigation arrives. 2014-06-16 Dan Bernstein <mitz@apple.com> <rdar://problem/17327707> [Cocoa] Expose WebPreferences::storageBlockingPolicy https://bugs.webkit.org/show_bug.cgi?id=133958 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKPreferences.mm: (toStorageBlockingPolicy): Added this helper conversion function. (toAPI): Ditto. (-[WKPreferences _storageBlockingPolicy]): Added this getter. (-[WKPreferences _setStorageBlockingPolicy:]): Added this setter. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Declared new _storageBlockingPolicy property and _WKStorageBlockingPolicy enum. 2014-06-16 Anders Carlsson <andersca@apple.com> Don't use AtomicString in HTTPHeaderMap https://bugs.webkit.org/show_bug.cgi?id=133957 <rdar://problem/15256572> Reviewed by Andreas Kling. Update for WebCore changes. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<HTTPHeaderMap>::decode): 2014-06-15 Anders Carlsson <andersca@apple.com> Change ResourceRequestBase::addHTTPHeaderFields to setHTTPHeaderFields instead https://bugs.webkit.org/show_bug.cgi?id=133925 Reviewed by Sam Weinig. * PluginProcess/PluginControllerProxy.h: * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<ResourceRequest>::decode): * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::NPN_PostURL): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::loadURL): * WebProcess/Plugins/PluginView.h: 2014-06-16 Anders Carlsson <andersca@apple.com> Add HTTPHeaderName overloads on ResourceResponseBase https://bugs.webkit.org/show_bug.cgi?id=133946 Reviewed by Andreas Kling. * WebProcess/Plugins/PluginView.cpp: (WebKit::buildHTTPHeaders): 2014-06-16 Dan Bernstein <mitz@apple.com> Fixed a typo in the last change. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences init]): 2014-06-16 Dan Bernstein <mitz@apple.com> [Cocoa] Remove WKPreferences persistence in user defaults https://bugs.webkit.org/show_bug.cgi?id=133945 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKPreferences.h: Removed userDefaultsKeyPrefix property and initializer with userDefaultsKeyPrefix parameter. * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences init]): Changed to initialize an instance with an empty identifier, which means that it won’t persist to user defaults. (-[WKPreferences initWithUserDefaultsKeyPrefix:]): Deleted. (-[WKPreferences userDefaultsKeyPrefix]): Deleted. 2014-06-16 Zan Dobersek <zdobersek@igalia.com> Page::findStringMatchingRanges() should take Vector<RefPtr<Range>> by reference instead of pointer https://bugs.webkit.org/show_bug.cgi?id=133677 Reviewed by Anders Carlsson. * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::findString): Update the call to Page::findStringMatchingRanges() to pass in a Vector<RefPtr<Range>> reference instead of a pointer. (WebKit::FindController::findStringMatches): Ditto. 2014-06-16 Zan Dobersek <zdobersek@igalia.com> Unreviewed build fixes for the EFL and GTK+ ports after r169994 and 170000. * UIProcess/API/C/WKPluginSiteDataManager.cpp: Undefine the None macro under X11. * UIProcess/API/gtk/WebKitCookieManager.cpp: (webkit_cookie_manager_get_accept_policy): Remove unnecessary ::create() wrappings. (webkit_cookie_manager_get_domains_with_cookies): Ditto. * UIProcess/API/gtk/WebKitWebResource.cpp: (webkit_web_resource_get_data): Ditto. 2014-06-15 Dan Bernstein <mitz@apple.com> Part 1 of: Change GenericCallback<> function parameters into std::function<> https://bugs.webkit.org/show_bug.cgi?id=133927 Reviewed by Sam Weinig. * UIProcess/API/C/WKApplicationCacheManager.cpp: (WKApplicationCacheManagerGetApplicationCacheOrigins): * UIProcess/API/C/WKContext.cpp: (WKContextGetStatistics): (WKContextGetStatisticsWithOptions): * UIProcess/API/C/WKCookieManager.cpp: (WKCookieManagerGetHostnamesWithCookies): (WKCookieManagerGetHTTPCookieAcceptPolicy): * UIProcess/API/C/WKDatabaseManager.cpp: (WKDatabaseManagerGetDatabasesByOrigin): (WKDatabaseManagerGetDatabaseOrigins): * UIProcess/API/C/WKFrame.cpp: (WKFrameGetMainResourceData): (WKFrameGetResourceData): (WKFrameGetWebArchive): * UIProcess/API/C/WKKeyValueStorageManager.cpp: (WKKeyValueStorageManagerGetKeyValueStorageOrigins): (WKKeyValueStorageManagerGetStorageDetailsByOrigin): * UIProcess/API/C/WKMediaCacheManager.cpp: (WKMediaCacheManagerGetHostnamesWithMediaCache): * UIProcess/API/C/WKOriginDataManager.cpp: (WKOriginDataManagerGetOrigins): * UIProcess/API/C/WKPluginSiteDataManager.cpp: (WKPluginSiteDataManagerGetSitesWithData): * UIProcess/API/C/WKResourceCacheManager.cpp: (WKResourceCacheManagerGetCacheOrigins): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _getWebArchiveDataWithCompletionHandler:]): * UIProcess/API/mac/WKView.mm: (-[WKView attributedSubstringForProposedRange:completionHandler:]): * UIProcess/Plugins/WebPluginSiteDataManager.cpp: (WebKit::WebPluginSiteDataManager::getSitesWithData): * UIProcess/Plugins/WebPluginSiteDataManager.h: * UIProcess/WebApplicationCacheManagerProxy.cpp: (WebKit::WebApplicationCacheManagerProxy::getApplicationCacheOrigins): * UIProcess/WebApplicationCacheManagerProxy.h: * UIProcess/WebContext.cpp: (WebKit::WebContext::getStatistics): * UIProcess/WebContext.h: * UIProcess/WebCookieManagerProxy.cpp: (WebKit::WebCookieManagerProxy::getHostnamesWithCookies): (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy): * UIProcess/WebCookieManagerProxy.h: * UIProcess/WebDatabaseManagerProxy.cpp: (WebKit::WebDatabaseManagerProxy::getDatabasesByOrigin): (WebKit::WebDatabaseManagerProxy::getDatabaseOrigins): * UIProcess/WebDatabaseManagerProxy.h: * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::getWebArchive): (WebKit::WebFrameProxy::getMainResourceData): (WebKit::WebFrameProxy::getResourceData): * UIProcess/WebFrameProxy.h: * UIProcess/WebKeyValueStorageManager.cpp: (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins): (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin): * UIProcess/WebKeyValueStorageManager.h: * UIProcess/WebMediaCacheManagerProxy.cpp: (WebKit::WebMediaCacheManagerProxy::getHostnamesWithMediaCache): * UIProcess/WebMediaCacheManagerProxy.h: * UIProcess/WebOriginDataManagerProxy.cpp: (WebKit::WebOriginDataManagerProxy::getOrigins): * UIProcess/WebOriginDataManagerProxy.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::getMainResourceDataOfFrame): (WebKit::WebPageProxy::getResourceDataFromFrame): (WebKit::WebPageProxy::getWebArchiveOfFrame): * UIProcess/WebPageProxy.h: * UIProcess/WebResourceCacheManagerProxy.cpp: (WebKit::WebResourceCacheManagerProxy::getCacheOrigins): * UIProcess/WebResourceCacheManagerProxy.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:]): (-[WKContentView changeSelectionWithTouchesFrom:to:withGesture:withState:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::selectWithGesture): (WebKit::WebPageProxy::selectWithTwoTouches): * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync): 2014-06-15 Dan Bernstein <mitz@apple.com> <rdar://problem/17291697> [Cocoa] Can’t tell at policy decision time whether WebKit can handle the request https://bugs.webkit.org/show_bug.cgi?id=133930 Reviewed by Sam Weinig. * Shared/NavigationActionData.cpp: (WebKit::NavigationActionData::NavigationActionData): Initialize new member canHandleRequest to false. (WebKit::NavigationActionData::encode): Encode canHandleRequest. (WebKit::NavigationActionData::decode): Decode it. * Shared/NavigationActionData.h: Declared new boolean member canHandleRequest. * UIProcess/API/Cocoa/WKNavigationAction.mm: (-[WKNavigationAction _initWithNavigationActionData:]): Set new ivar _canHandleRequest from the action data. (-[WKNavigationAction _canHandleRequest]): Added this getter. * UIProcess/API/Cocoa/WKNavigationActionPrivate.h: Declared new property _canHandleRequest. * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::createWindow): Set canHandleRequest in the NavigationActionData. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): Ditto. (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto. 2014-06-15 Ryuan Choi <ryuan.choi@samsung.com> [EFL][WK2] Change ewk_view_settings_get to ewk_page_group_settings_get https://bugs.webkit.org/show_bug.cgi?id=133841 Reviewed by Gyuyoung Kim. Ewk_Settings object is a member of Ewk_Page_Group. So, Ewk_Page_Group is better place for the getter of Ewk_Settings. * UIProcess/API/efl/ewk_page_group.cpp: (ewk_page_group_settings_get): Added instead of ewk_view_settings_get. * UIProcess/API/efl/ewk_page_group.h: * UIProcess/API/efl/ewk_view.cpp: (ewk_view_settings_get): Deleted. * UIProcess/API/efl/ewk_view.h: * UIProcess/API/efl/tests/test_ewk2_page_group.cpp: (TEST_F): * UIProcess/API/efl/tests/test_ewk2_settings.cpp: (TEST_F): * UIProcess/API/efl/tests/test_ewk2_view.cpp: (TEST_F): Deleted. 2014-06-15 Anders Carlsson <andersca@apple.com> Add an autorelease() member function to RetainPtr https://bugs.webkit.org/show_bug.cgi?id=133929 Reviewed by Dan Bernstein. * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm: (-[_WKRemoteObjectRegistry remoteObjectProxyWithInterface:]): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView navigationDelegate]): (-[WKWebView UIDelegate]): (-[WKWebView loadRequest:]): (-[WKWebView loadHTMLString:baseURL:]): (-[WKWebView goToBackForwardListItem:]): (-[WKWebView goBack]): (-[WKWebView goForward]): (-[WKWebView reload]): (-[WKWebView reloadFromOrigin]): (-[WKWebView _historyDelegate]): * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: (WebKit::animationValueFromKeyframeValue): 2014-06-15 Dan Bernstein <mitz@apple.com> Get rid of VoidAPICallback https://bugs.webkit.org/show_bug.cgi?id=133928 Reviewed by Sam Weinig. * UIProcess/API/C/WKPage.cpp: (WKPageForceRepaint): Wrap the API callback in a generic callback here. * UIProcess/API/C/WKPluginSiteDataManager.cpp: (WKPluginSiteDataManagerClearSiteData): Ditto. (WKPluginSiteDataManagerClearAllSiteData): Ditto. * UIProcess/GenericCallback.h: (WebKit::GenericCallback::performCallback): Added this helper for 0-argument callbacks. (WebKit::VoidCallback::create): Deleted. (WebKit::VoidCallback::~VoidCallback): Deleted. (WebKit::VoidCallback::performCallback): Deleted. (WebKit::VoidCallback::invalidate): Deleted. (WebKit::VoidCallback::VoidCallback): Deleted. (WebKit::VoidAPICallback::create): Deleted. * UIProcess/mac/WKFullScreenWindowController.h: 2014-06-15 Zan Dobersek <zdobersek@igalia.com> Unreviewed build fix for the GTK+ port after r169990. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::resetState): Pass the error value to the rest of invalidateCallbackMap calls. 2014-06-15 Anders Carlsson <andersca@apple.com> Remove WKPageRunJavaScriptInMainFrame_b https://bugs.webkit.org/show_bug.cgi?id=133926 Reviewed by Dan Bernstein. * UIProcess/API/C/WKPage.cpp: (callRunJavaScriptBlockAndRelease): Deleted. (WKPageRunJavaScriptInMainFrame_b): Deleted. * UIProcess/API/C/WKPage.h: 2014-06-15 Anders Carlsson <andersca@apple.com> invalidateCallbackMap doesn’t pass the error parameter on to invalidate(), so script completion handler is passed the wrong error https://bugs.webkit.org/show_bug.cgi?id=133921 <rdar://problem/17316653> Reviewed by Dan Bernstein. * UIProcess/GenericCallback.h: (WebKit::VoidCallback::performCallback): (WebKit::VoidCallback::invalidate): (WebKit::VoidAPICallback::create): (WebKit::invalidateCallbackMap): * UIProcess/Plugins/WebPluginSiteDataManager.cpp: (WebKit::WebPluginSiteDataManager::invalidate): (WebKit::WebPluginSiteDataManager::clearSiteData): * UIProcess/WebApplicationCacheManagerProxy.cpp: (WebKit::WebApplicationCacheManagerProxy::contextDestroyed): (WebKit::WebApplicationCacheManagerProxy::processDidClose): * UIProcess/WebContext.cpp: (WebKit::WebContext::~WebContext): * UIProcess/WebCookieManagerProxy.cpp: (WebKit::WebCookieManagerProxy::contextDestroyed): (WebKit::WebCookieManagerProxy::processDidClose): * UIProcess/WebDatabaseManagerProxy.cpp: (WebKit::WebDatabaseManagerProxy::contextDestroyed): (WebKit::WebDatabaseManagerProxy::processDidClose): * UIProcess/WebMediaCacheManagerProxy.cpp: (WebKit::WebMediaCacheManagerProxy::contextDestroyed): (WebKit::WebMediaCacheManagerProxy::processDidClose): * UIProcess/WebOriginDataManagerProxy.cpp: (WebKit::WebOriginDataManagerProxy::contextDestroyed): (WebKit::WebOriginDataManagerProxy::processDidClose): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::forceRepaint): (WebKit::WebPageProxy::resetState): * UIProcess/WebResourceCacheManagerProxy.cpp: (WebKit::WebResourceCacheManagerProxy::contextDestroyed): (WebKit::WebResourceCacheManagerProxy::processDidClose): * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController dealloc]): (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): 2014-06-15 Zan Dobersek <zdobersek@igalia.com> Unreviewed build fix for the GTK+ port after r169987. * UIProcess/API/gtk/WebKitWebView.cpp: (webkit_web_view_can_execute_editing_command): The first passed-in parameter is now a reference to a const String object. 2014-06-14 Dan Bernstein <mitz@apple.com> Replace StringImpl* callback parameters with const String& https://bugs.webkit.org/show_bug.cgi?id=133922 Reviewed by Sam Weinig. * UIProcess/API/C/WKPage.cpp: (toGenericCallbackFunction): Added this helper function to wrap a WKStringRef-returning API callback in a generic const String&-returning callback. (WKPageRenderTreeExternalRepresentation): (WKPageGetSourceForFrame): (WKPageGetContentsAsString): (WKPageGetBytecodeProfile): (WKPageValidateCommand): * UIProcess/API/mac/WKView.mm: (-[WKView validateUserInterfaceItem:]): (-[WKView startSpeaking:]): * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _define:]): (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]): 2014-06-14 Dan Bernstein <mitz@apple.com> Additional iOS build fix. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _define:]): (selectionChangedWithGesture): (selectionChangedWithTouch): (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:]): (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]): (-[WKContentView changeSelectionWithTouchesFrom:to:withGesture:withState:]): (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]): 2014-06-14 Dan Bernstein <mitz@apple.com> iOS build fix. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): 2014-06-14 Dan Bernstein <mitz@apple.com> Get rid of GenericAPICallback https://bugs.webkit.org/show_bug.cgi?id=133909 Reviewed by Sam Weinig. In preparation for passing callbacks as functions, replace GenericAPICallback::create, which returned a GenericCallback, with a function template that returns an appropriate callback function. * UIProcess/API/C/WKApplicationCacheManager.cpp: (WKApplicationCacheManagerGetApplicationCacheOrigins): * UIProcess/API/C/WKContext.cpp: (WKContextGetStatistics): (WKContextGetStatisticsWithOptions): * UIProcess/API/C/WKCookieManager.cpp: (WKCookieManagerGetHostnamesWithCookies): (WKCookieManagerGetHTTPCookieAcceptPolicy): * UIProcess/API/C/WKDatabaseManager.cpp: (WKDatabaseManagerGetDatabasesByOrigin): (WKDatabaseManagerGetDatabaseOrigins): * UIProcess/API/C/WKFrame.cpp: (WKFrameGetMainResourceData): (WKFrameGetResourceData): (WKFrameGetWebArchive): * UIProcess/API/C/WKKeyValueStorageManager.cpp: (WKKeyValueStorageManagerGetKeyValueStorageOrigins): (WKKeyValueStorageManagerGetStorageDetailsByOrigin): * UIProcess/API/C/WKMediaCacheManager.cpp: (WKMediaCacheManagerGetHostnamesWithMediaCache): * UIProcess/API/C/WKOriginDataManager.cpp: (WKOriginDataManagerGetOrigins): * UIProcess/API/C/WKPage.cpp: (WKPageRunJavaScriptInMainFrame): (WKPageRenderTreeExternalRepresentation): (WKPageGetSourceForFrame): (WKPageGetContentsAsString): (WKPageGetBytecodeProfile): (WKPageGetSelectionAsWebArchiveData): (WKPageGetContentsAsMHTMLData): (WKPageDrawPagesToPDF): * UIProcess/API/C/WKPluginSiteDataManager.cpp: (WKPluginSiteDataManagerGetSitesWithData): * UIProcess/API/C/WKResourceCacheManager.cpp: (WKResourceCacheManagerGetCacheOrigins): * UIProcess/GenericCallback.h: (WebKit::toGenericCallbackFunction): Added. Given a C SPI callback function, returns a generic callback function that wraps it. 2014-06-14 Dan Bernstein <mitz@apple.com> Reverted the last change, which broken the Mac build. * UIProcess/GenericCallback.h: (WebKit::invalidateCallbackMap): 2014-06-14 Dan Bernstein <mitz@apple.com> Tried to fix the GTK build. * UIProcess/GenericCallback.h: (WebKit::invalidateCallbackMap): 2014-06-14 Anders Carlsson <andersca@apple.com> Fix build. * UIProcess/API/mac/WKView.mm: (-[WKView selectedRangeWithCompletionHandler:]): (-[WKView markedRangeWithCompletionHandler:]): (-[WKView hasMarkedTextWithCompletionHandler:]): (-[WKView attributedSubstringForProposedRange:completionHandler:]): (-[WKView firstRectForCharacterRange:completionHandler:]): (-[WKView characterIndexForPoint:completionHandler:]): 2014-06-14 Zan Dobersek <zdobersek@igalia.com> Unreviewed build fix for the GTK+ port. Fixing the callback lambda parameters after r169962. * UIProcess/API/gtk/WebKitPrintOperation.cpp: (webkitPrintOperationPrintPagesForFrame): * UIProcess/API/gtk/WebKitWebResource.cpp: (webkit_web_resource_get_data): * UIProcess/API/gtk/WebKitWebView.cpp: (webkit_web_view_can_execute_editing_command): (webkit_web_view_run_javascript): (resourcesStreamReadCallback): (webkit_web_view_save): (webkit_web_view_save_to_file): 2014-06-14 Csaba Osztrogonác <ossy@webkit.org> URTBF after r169943 and r169946, use the format of set/get. * UIProcess/InspectorServer/WebInspectorServer.cpp: (WebKit::WebInspectorServer::didReceiveUnrecognizedHTTPRequest): * UIProcess/InspectorServer/WebSocketServerConnection.cpp: (WebKit::WebSocketServerConnection::readHTTPMessage): (WebKit::WebSocketServerConnection::upgradeToWebSocketServerConnection): 2014-06-13 Andreas Kling <akling@apple.com> REGRESSION (r167635): Reference leak in NetworkResourceLoader while loads are being deferred. <https://webkit.org/b/133894> <rdar://problem/17312299> Don't self-ref() in start() until we actually start; if page loads are being deferred, start() will be called again once deferral stops. This was causing us to leak the entire NetworkResourceLoader object graph. Reviewed by Brady Eidson. * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::start): 2014-06-13 Dan Bernstein <mitz@apple.com> Make GenericCallback variadic https://bugs.webkit.org/show_bug.cgi?id=133897 Reviewed by Sam Weinig. Also eliminated legacy callback functions and all CallbackBase derived classes outside of GenericCallback.h. * UIProcess/API/C/WKPage.cpp: (WKPageValidateCommand): Changed legacy callback (with leading bool parameter) into modern callback (with trailing error parameter). (WKPageComputePagesForPrinting): Ditto. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _getWebArchiveDataWithCompletionHandler:]): Ditto. (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): Ditto. * UIProcess/API/Cocoa/_WKThumbnailView.mm: (-[_WKThumbnailView _requestSnapshotIfNeeded]): Ditto. * UIProcess/API/mac/WKView.mm: (-[WKView validateUserInterfaceItem:]): Ditto. (-[WKView startSpeaking:]): Ditto. * UIProcess/AutoCorrectionCallback.h: Replaced CallbackBase derived classes with GenericCallback specializations. * UIProcess/GenericCallback.h: - Made GenericCallback variadic: (WebKit::GenericCallback::performCallbackWithReturnValue): (WebKit::GenericCallback::invalidate): (WebKit::GenericAPICallback::create): - Replaced CallbackBase derived classes with GenericCallback specializations: (WebKit::GenericCallback::create): Deleted. (WebKit::ComputedPagesCallback::create): Deleted. (WebKit::ComputedPagesCallback::~ComputedPagesCallback): Deleted. (WebKit::ComputedPagesCallback::performCallbackWithReturnValue): Deleted. (WebKit::ComputedPagesCallback::invalidate): Deleted. (WebKit::ComputedPagesCallback::ComputedPagesCallback): Deleted. (WebKit::ImageCallback::create): Deleted. (WebKit::ImageCallback::~ImageCallback): Deleted. (WebKit::ImageCallback::performCallbackWithReturnValue): Deleted. (WebKit::ImageCallback::invalidate): Deleted. (WebKit::ImageCallback::ImageCallback): Deleted. * UIProcess/WebPageProxy.h: Replaced CallbackBase derived classes with GenericCallback specializations. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]): Changed legacy callback (with leading bool parameter) into modern callback (with trailing error parameter). (-[WKContentView requestDictationContext:]): Ditto. (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]): Ditto. * UIProcess/mac/WKPrintingView.mm: (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]): Ditto. (-[WKPrintingView _askPageToComputePageRects]): Ditto. (-[WKPrintingView _drawPreview:]): Ditto. 2014-06-13 Tim Horton <timothy_horton@apple.com> Unreviewed; fix the build. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::drawInContext): 2014-06-13 Martin Hock <mhock@apple.com> Clean up layers in RemoteLayerTreeHost::clearLayers(). https://bugs.webkit.org/show_bug.cgi?id=133888 Reviewed by Tim Horton. * UIProcess/mac/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::clearLayers): 2014-06-13 Anders Carlsson <andersca@apple.com> Add a HTTPHeaderMap::get overload that takes an HTTPHeaderName https://bugs.webkit.org/show_bug.cgi?id=133877 Reviewed by Andreas Kling. * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::parsePostBuffer): 2014-06-13 Dan Bernstein <mitz@apple.com> [iOS] Networking process always decodes keys https://bugs.webkit.org/show_bug.cgi?id=133863 Reviewed by Anders Carlsson. * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h: (WebKit::XPCServiceInitializer): Call checkEntitlements on iOS, too. * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm: (WebKit::XPCServiceInitializerDelegate::checkEntitlements): On iOS, allow decoding keys if the application has the appropriate keychain access group. * Shared/cf/ArgumentCodersCF.cpp: (IPC::setAllowsDecodingSecKeyRef): Added. Sets static bool. (IPC::decode): Check the secKeyRefDecodingAllowed bool before decoding a key. * Shared/cf/ArgumentCodersCF.h: 2014-06-12 Anders Carlsson <andersca@apple.com> Add overloads of HTTPHeaderMap::find and remove that take enums https://bugs.webkit.org/show_bug.cgi?id=133823 Reviewed by Sam Weinig. * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::parsePostBuffer): Update for WebCore changes. 2014-06-12 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] Do not update the viewport configuration on load until the first viewport arguments is received https://bugs.webkit.org/show_bug.cgi?id=133719 <rdar://problem/17008149> Reviewed by Simon Fraser. When pages are loaded from the page cache, we were updating the viewport to the initial values in WebPage::dynamicViewportSizeUpdate(), then update the viewport again when the page's viewport argument are received. The problem is that was messing up with text autosizing. The page would relayout with the default viewport configuration, adopt the text autosizing parameters from that size, then remain in that state when the actual viewport configuration would be set. With this patch, the viewport configuration is updated from the values in WebCore instead of with default values. For new documents, this is strictly equivalent. For documents coming from the page cache, the values are from the previous state of the page, which ensure we do not restart negotiating a viewport configuration from scratch. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didCommitLoad): 2014-06-12 Gavin Barraclough <barraclough@apple.com> Add support for thread/WorkQueue QoS https://bugs.webkit.org/show_bug.cgi?id=130688 Reviewed by Anders Carlson & Simon Fraser. The EventDispatcher's WorkQueue should be UserInteractive. * Platform/WorkQueue.cpp: (WorkQueue::create): - pass QOS to constructor. (WorkQueue::WorkQueue): - pass QOS to platformInitialize. * Platform/WorkQueue.h: - added enum, arguments. * Platform/efl/WorkQueueEfl.cpp: (WorkQueue::platformInitialize): - has extra argument. * Platform/gtk/WorkQueueGtk.cpp: (WorkQueue::platformInitialize): - has extra argument. * Platform/mac/WorkQueueMac.cpp: (platformQOS): - map from enum to platform type. (WorkQueue::platformInitialize): - set the QoS of the dispatch queue. * WebProcess/WebPage/EventDispatcher.cpp: (WebKit::EventDispatcher::EventDispatcher): - EventDispatcher's WorkQueue should be UserInteractive. * config.h: - added HAVE_QOS_CLASSES 2014-06-12 Simon Fraser <simon.fraser@apple.com> [iOS] Tiny hack to fix WebKitTestRunner view visibility https://bugs.webkit.org/show_bug.cgi?id=133833 Reviewed by Tim Horton. PageClientImplIOS in WebKitTestRunner has a null m_webView, so isViewInWindow was returning false, which confused things. Fix by falling back to a check on the content view if the m_webView is nil. * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::isViewVisible): (WebKit::PageClientImpl::isViewInWindow): 2014-06-12 Brady Eidson <beidson@apple.com> Add SPI for image controls and service controls preferences. <rdar://problem/17292209> and https://bugs.webkit.org/show_bug.cgi?id=133820 Reviewed by Anders Carlsson. * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetServiceControlsEnabled): (WKPreferencesGetServiceControlsEnabled): (WKPreferencesSetImageControlsEnabled): (WKPreferencesGetImageControlsEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: 2014-06-12 Alexey Proskuryakov <ap@apple.com> [Mac] Allow reading com.apple.universalaccess preferences https://bugs.webkit.org/show_bug.cgi?id=133817 <rdar://problem/17028261> Reviewed by Anders Carlsson. * WebProcess/com.apple.WebProcess.sb.in: 2014-06-12 Anders Carlsson <andersca@apple.com> Fix build. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<HTTPHeaderMap>::decode): (CoreIPC::ArgumentCoder<ResourceRequest>::decode): 2014-06-12 Dan Bernstein <mitz@apple.com> Fixed a harmless error message when rewrite-availability-macros.sh is run in a clean build. Rubber-stamped by Anders Carlsson. * mac/rewrite-availability-macros.sh: 2014-06-12 Carlos Garcia Campos <cgarcia@igalia.com> [GTK] Remove view mode API https://bugs.webkit.org/show_bug.cgi?id=133725 Reviewed by Martin Robinson. It currently does nothing because support for view source mode was removed from WebCore. * UIProcess/API/gtk/WebKitWebView.cpp: (webkitWebViewSetProperty): (webkitWebViewGetProperty): (webkit_web_view_class_init): (webkit_web_view_set_view_mode): Deleted. (webkit_web_view_get_view_mode): Deleted. * UIProcess/API/gtk/WebKitWebView.h: * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: 2014-06-12 Pratik Solanki <psolanki@apple.com> Avoid creating a CFData when checking if a resource is file backed https://bugs.webkit.org/show_bug.cgi?id=133783 Reviewed by Andreas Kling. When a resource is file backed, we have it as a single CFDataRef in SharedBuffer. Add an early return in tryGetShareableHandleFromSharedBuffer() so we don't end up creating a new CFDataRef if we don't already have one in SharedBuffer. If we had to create a CFDataRef, the it can't have been a file backed resource. * NetworkProcess/mac/NetworkResourceLoaderMac.mm: (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer): 2014-06-11 Gyuyoung Kim <gyuyoung.kim@samsung.com> Fix build break on EFL and GTK ports since r169820 https://bugs.webkit.org/show_bug.cgi?id=133786 Reviewed by Philippe Normand. ENABLE_PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC macro are missing in PluginView::pluginSnapshotTimerFired(). * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::pluginSnapshotTimerFired): 2014-06-11 Csaba Osztrogonác <ossy@webkit.org> [EFL][GTK] Ultimate fix not to have build failures in the future because of "#if TARGET_OS_IPHONE" guards. Unreviewed buildfix. Revert the previous wrong fix attempt r169879. * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: 2014-06-11 Gyuyoung Kim <gyuyoung.kim@samsung.com> Fix build break on EFL port since r169869 https://bugs.webkit.org/show_bug.cgi?id=133785 Unreviewed, fix a build break on EFL port. * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: Use defined(TARGET_OS_IPHONE). * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: ditto. 2014-06-11 Simon Fraser <simon.fraser@apple.com> [iOS WK2] Give WebKitTestRunner a viewport configuration with initial scale=1 for testing https://bugs.webkit.org/show_bug.cgi?id=133779 Reviewed by Benjamin Poulain. Support a custom viewport configuration for testing, on iOS. * UIProcess/API/ios/WKViewIOS.mm: (-[WKView _frameOrBoundsChanged]): Call setViewportConfigurationMinimumLayoutSize() just as WKWebView does. * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageSetUseTestingViewportConfiguration): New SPI to set a viewport config for testing. * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::setUseTestingViewportConfiguration): (WebKit::WebPage::isUsingTestingViewportConfiguration): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::resetViewportDefaultConfiguration): 2014-06-11 Timothy Horton <timothy_horton@apple.com> Remove unused VisibleContentRectUpdateInfo update ID https://bugs.webkit.org/show_bug.cgi?id=133777 Reviewed by Benjamin Poulain. Remove some unused code. * Shared/VisibleContentRectUpdateInfo.cpp: (WebKit::VisibleContentRectUpdateInfo::encode): (WebKit::VisibleContentRectUpdateInfo::decode): * Shared/VisibleContentRectUpdateInfo.h: (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo): (WebKit::operator==): (WebKit::VisibleContentRectUpdateInfo::updateID): Deleted. * Shared/mac/RemoteLayerTreeTransaction.h: (WebKit::RemoteLayerTreeTransaction::setLastVisibleContentRectUpdateID): Deleted. (WebKit::RemoteLayerTreeTransaction::lastVisibleContentRectUpdateID): Deleted. * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::encode): (WebKit::RemoteLayerTreeTransaction::decode): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::nextVisibleContentRectUpdateID): Deleted. (WebKit::WebPageProxy::lastVisibleContentRectUpdateID): Deleted. * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): (WebKit::WebPage::willCommitLayerTree): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateVisibleContentRects): 2014-06-11 Dan Bernstein <mitz@apple.com> [Cocoa] Move CompletionHandlerCallChecker into a separate file https://bugs.webkit.org/show_bug.cgi?id=133774 Reviewed by Anders Carlsson. * Shared/Cocoa/CompletionHandlerCallChecker.h: Added. * Shared/Cocoa/CompletionHandlerCallChecker.mm: Added. (WebKit::CompletionHandlerCallChecker::create): (WebKit::CompletionHandlerCallChecker::CompletionHandlerCallChecker): (WebKit::CompletionHandlerCallChecker::~CompletionHandlerCallChecker): (WebKit::CompletionHandlerCallChecker::didCallCompletionHandler): (WebKit::CompletionHandlerCallChecker::classImplementingDelegateMethod): * UIProcess/Cocoa/UIDelegate.mm: (WebKit::CompletionHandlerCallChecker::create): Deleted. (WebKit::CompletionHandlerCallChecker::~CompletionHandlerCallChecker): Deleted. (WebKit::CompletionHandlerCallChecker::didCallCompletionHandler): Deleted. (WebKit::CompletionHandlerCallChecker::CompletionHandlerCallChecker): Deleted. (WebKit::CompletionHandlerCallChecker::classImplementingDelegateMethod): Deleted. * WebKit2.xcodeproj/project.pbxproj: 2014-06-11 Martin Hock <mhock@apple.com> [iOS] Clear UIProcess visual state after WebProcess crash https://bugs.webkit.org/show_bug.cgi?id=133664 <rdar://problem/16952742> Reviewed by Benjamin Poulain. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didRelaunchProcess]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didRelaunchProcess): * UIProcess/mac/RemoteLayerTreeHost.h: * UIProcess/mac/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::~RemoteLayerTreeHost): (WebKit::RemoteLayerTreeHost::clearLayers): 2014-06-11 Tim Horton <timothy_horton@apple.com> Implement swipeWithEvent for non-fluid swipes https://bugs.webkit.org/show_bug.cgi?id=133766 <rdar://problem/17126889> Reviewed by Anders Carlsson. * UIProcess/API/mac/WKView.mm: (-[WKView swipeWithEvent:]): On non-fluid swipes, go back or forward depending on the swipe direction. 2014-06-11 Dan Bernstein <mitz@apple.com> [Cocoa] Xcode cannot infer that the WebKit target implicitly depends on WebCore.framework https://bugs.webkit.org/show_bug.cgi?id=133765 Reviewed by Anders Carlsson. * Configurations/WebKit.xcconfig: Move linking against WebCore from OTHER_LDFLAGS here... * WebKit2.xcodeproj/project.pbxproj: ...to the Link Binary With Libraries build phase here. 2014-06-11 Timothy Horton <timothy_horton@apple.com> [wk2] Don't dispatch view state changes immediately https://bugs.webkit.org/show_bug.cgi?id=133713 Reviewed by Simon Fraser. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::viewStateDidChange): (WebKit::WebPageProxy::dispatchViewStateChange): (WebKit::WebPageProxy::updateViewState): Deleted. * UIProcess/WebPageProxy.h: On PLATFORM(COCOA), wait until just before CA is going to commit the UI process layer tree to dispatch view state changes to the Web process. This avoids sending multiple view state change messages to the Web process within one run-loop cycle, for example when a view is moved around in the view hierarchy but the view state otherwise remains the same. 2014-06-11 Timothy Horton <timothy_horton@apple.com> Make it possible for waitForAndDispatchImmediately to bail if a sync message comes in from the other direction https://bugs.webkit.org/show_bug.cgi?id=133708 Reviewed by Anders Carlsson. * Platform/IPC/Connection.cpp: (IPC::WaitForMessageState): (IPC::Connection::Connection): (IPC::Connection::waitForMessage): (IPC::Connection::processIncomingMessage): (IPC::Connection::connectionDidClose): * Platform/IPC/Connection.h: (IPC::Connection::waitForAndDispatchImmediately): Remove the waitForMessageMap, and assert that we're only ever waiting for one message at a time. This simplifies this code a bit, and we never wait on more than one message at a time, so it was unnecessary. Add a flag to waitForAndDispatchImmediately, InterruptWaitingIfSyncMessageArrives, which will cause waitForAndDispatchImmediately to bail if a sync message arrives, to avoid pointlessly blocking both processes for the entire timeout. 2014-06-11 Oliver Hunt <oliver@apple.com> Restrict database process profile https://bugs.webkit.org/show_bug.cgi?id=133750 Reviewed by Alexey Proskuryakov. Make the sandbox profile much more restrictive. * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb: 2014-06-11 Roger Fong <roger_fong@apple.com> Don't snapshot offscreen plugins that would normally be considered primary plugins after they are moved in view. https://bugs.webkit.org/show_bug.cgi?id=133667. <rdar://problem/16743250> Reviewed by Tim Horton. * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::PluginView): (WebKit::PluginView::pluginSnapshotTimerFired): Set the display state to Playing if the following is true: The plugin in question is large enough to be considered the primary snapshot and either: a) The maximum number of snapshot retries has been reached and no good snapshot has been found. b) The plugin is moved to be on-screen while the snapshot attempts are in progress. * WebProcess/Plugins/PluginView.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::plugInIntersectsSearchRect): Re-factor out intersection logic. (WebKit::WebPage::plugInIsPrimarySize): Re-factor out primary plugin size logic. (WebKit::WebPage::determinePrimarySnapshottedPlugIn): Use the above two methods here. * WebProcess/WebPage/WebPage.h: 2014-06-11 Anders Carlsson <andersca@apple.com> Move more WKPreferences to WKWebViewConfiguration https://bugs.webkit.org/show_bug.cgi?id=133756 <rdar://problem/17271468> Reviewed by Tim Horton. * UIProcess/API/Cocoa/WKPreferences.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences setMinimumFontSize:]): (-[WKPreferences suppressesIncrementalRendering]): Deleted. (-[WKPreferences setSuppressesIncrementalRendering:]): Deleted. (-[WKPreferences allowsInlineMediaPlayback]): Deleted. (-[WKPreferences setAllowsInlineMediaPlayback:]): Deleted. (-[WKPreferences mediaPlaybackRequiresUserAction]): Deleted. (-[WKPreferences setMediaPlaybackRequiresUserAction:]): Deleted. (-[WKPreferences mediaPlaybackAllowsAirPlay]): Deleted. (-[WKPreferences setMediaPlaybackAllowsAirPlay:]): Deleted. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): * WebKit2.xcodeproj/project.pbxproj: 2014-06-11 Enrica Casucci <enrica@apple.com> WebKit2 iOS: Unable to open UI menu for "open in new tab" for links on yahoo.com. https://bugs.webkit.org/show_bug.cgi?id=133749 <rdar://problem/17165992> Reviewed by Brady Eidson. The URL returned to the UIProcess as string needs to be encoded. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getPositionInformation): 2014-06-10 Anders Carlsson <andersca@apple.com> Move suppressesIncrementalRendering to WKWebViewConfiguration https://bugs.webkit.org/show_bug.cgi?id=133707 <rdar://problem/17271468> Reviewed by Sam Weinig. * UIProcess/API/Cocoa/WKPreferences.h: Get rid of suppressesIncrementalRendering. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): Set the suppressesIncrementalRenderingKey key in webPageConfiguration.preferenceValues. * UIProcess/API/Cocoa/WKWebViewConfiguration.h: Add suppressesIncrementalRendering. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration copyWithZone:]): Assign suppressesIncrementalRendering. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): Copy webPageConfiguration.preferenceValues to m_configurationPreferenceValues. (WebKit::WebPageProxy::preferencesStore): If m_configurationPreferenceValues is empty, just return m_preferences->store(). Otherwise, copy the store and apply the configuration preference values. (WebKit::WebPageProxy::preferencesDidChange): Call preferencesStore() so we'll get the configuration preference values as well. (WebKit::WebPageProxy::creationParameters): Ditto. * UIProcess/WebPageProxy.h: 2014-06-11 Antti Koivisto <antti@apple.com> Wrap NSURLRequest in bundle API https://bugs.webkit.org/show_bug.cgi?id=133732 <rdar://problem/17267217> Reviewed by Andreas Kling. Patch by Dan Bernstein. We don't want to construct actual NSURLRequests in the web process side unless really needed as it is slow. * Shared/Cocoa/APIObject.mm: (API::Object::newObject): * Shared/Cocoa/WKNSURLRequest.h: Added. (WebKit::wrapper): * Shared/Cocoa/WKNSURLRequest.mm: Added. Add a wrapper object that initializes the underlying NSURLRequest on-demand. (-[WKNSURLRequest _web_createTarget]): (-[WKNSURLRequest URL]): (-[WKNSURLRequest copyWithZone:]): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (willSendRequestForFrame): (didInitiateLoadForResource): 2014-06-11 Dan Bernstein <mitz@apple.com> <rdar://problem/17218629> [Cocoa] WKWebView’s canGoBack and canGoForward properties are not KVO-compliant https://bugs.webkit.org/show_bug.cgi?id=133722 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKBrowsingContextController.mm: Added no-op overrides of new PageLoadStateObserver member functions. * UIProcess/API/Cocoa/WKWebView.h: Documented the canGoBack and canGoForward properties as being KVO-compliant. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView canGoBack]): Changed to get the return value from the page load state. (-[WKWebView canGoForward]): Ditto. * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::willChangeCanGoBack): Override this new PageLoadStateObserver member function by sending the appropriate KVO change message to the WKWebView. (WebKit::NavigationState::didChangeCanGoBack): Ditto. (WebKit::NavigationState::willChangeCanGoForward): Ditto. (WebKit::NavigationState::didChangeCanGoForward): Ditto. * UIProcess/PageLoadState.cpp: (WebKit::PageLoadState::commitChanges): Check for changes to canGoBack and canGoForward and call the observers if needed. (WebKit::PageLoadState::canGoBack): Added. Returns the value from the committed state. (WebKit::PageLoadState::setCanGoBack): Added. Sets the value in the uncommitted state. (WebKit::PageLoadState::canGoForward): Added. Returns the value from the committed state. (WebKit::PageLoadState::setCanGoForward): Added. Sets the value in the uncommitted state. * UIProcess/PageLoadState.h: (WebKit::PageLoadState::Data::Data): Added canGoBack and canGoForward boolean members. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didChangeBackForwardList): Update the page load state with the new state of canGoBack and canGoForward. * UIProcess/WebPageProxy.h: Removed unused member variables m_canGoBack and m_canGoForward. 2014-06-11 Zan Dobersek <zdobersek@igalia.com> Avoid Vector copies in WebNotificationManagerProxy::providerDidCloseNotifications(), FindController::findStringMatches() https://bugs.webkit.org/show_bug.cgi?id=133676 Reviewed by Andreas Kling. * UIProcess/Notifications/WebNotificationManagerProxy.cpp: (WebKit::WebNotificationManagerProxy::providerDidCloseNotifications): Move the newly-created Vector object into the HashMap<>::add() call. * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::findStringMatches): Movethe newly-create Vector object into the Vector<>::append() call. 2014-06-11 Shivakumar JM <shiva.jm@samsung.com> [EFL][WK2] Add missing test cases for EWK2ViewTest. https://bugs.webkit.org/show_bug.cgi?id=133715 Reviewed by Gyuyoung Kim. Add missing test cases for ewk_view.h APIs, ewk_view_stop(), ewk_view_html_string_load(), ewk_view_theme_get(), ewk_view_feed_touch_event(), ewk_view_text_find_highlight_clear(), ewk_view_text_find(), ewk_view_text_matches_count(), ewk_view_page_contents_get(), ewk_view_script_execute(). * PlatformEfl.cmake: * UIProcess/API/efl/tests/test_ewk2_view.cpp: (TEST_F): 2014-06-11 Carlos Garcia Campos <cgarcia@igalia.com> [GTK] Use a different user agent string depending on the site https://bugs.webkit.org/show_bug.cgi?id=132681 Reviewed by Anders Carlsson. * UIProcess/API/gtk/WebKitSettings.cpp: (webkit_settings_class_init): Enable site specific quirks setting by default. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::userAgent): Pass the given URL to WebPage. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::userAgent): Try to get the user agent for the URL received falling back to the current one otherwise. * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::platformUserAgent): Added. * WebProcess/WebPage/efl/WebPageEfl.cpp: (WebKit::WebPage::platformUserAgent): Return null String. * WebProcess/WebPage/gtk/WebPageGtk.cpp: (WebKit::WebPage::platformUserAgent): Use WebCore::standardUserAgentForURL() when site specific quirks setting is enabled. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::platformUserAgent): Return null String. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::platformUserAgent): Return null String. 2014-06-10 Benjamin Poulain <benjamin@webkit.org> [iOS][WK2] ScrollingTreeOverflowScrollingNode does not use asynchronous touch dispatch https://bugs.webkit.org/show_bug.cgi?id=133702 <rdar://problem/17259261> Reviewed by Simon Fraser. Notify the WKWebView and the TouchGestureRecognizer when on of the internal UIScrollView starts scrolling in response to a gesture. * UIProcess/PageClient.h: * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: * UIProcess/Scrolling/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::scrollingTreeNodeWillStartPanGesture): * UIProcess/Scrolling/RemoteScrollingTree.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewWillStartPanGesture): * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::scrollViewWillStartPanGesture): * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartPanGesture): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::scrollViewWillStartPanGesture): 2014-06-10 Dan Bernstein <mitz@apple.com> WebKit2 part of [Cocoa] Handling authentication challenges should not require multiple delegate methods https://bugs.webkit.org/show_bug.cgi?id=133697 Reviewed by Anders Carlsson. * Shared/Authentication/AuthenticationManager.cpp: (WebKit::AuthenticationManager::performDefaultHandling): Added. Calls the new AuthenticationClient function receivedRequestToPerformDefaultHandling. (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinue): Added. Calls the new AuthenticationClient function receivedChallengeRejection. * Shared/Authentication/AuthenticationManager.h: * Shared/Authentication/AuthenticationManager.messages.in: Added new messages PerformDefaultHandling and RejectProtectionSpaceAndContinue. * Shared/Downloads/DownloadAuthenticationClient.h: Override new AuthenticationClient member functions. * Shared/Downloads/ios/DownloadIOS.mm: (WebKit::Download::receivedRequestToPerformDefaultHandling): Added empty implementation. (WebKit::Download::receivedChallengeRejection): Ditto. * Shared/Downloads/mac/DownloadMac.mm: (WebKit::Download::receivedRequestToPerformDefaultHandling): Added. Forwards to the sender. (WebKit::Download::receivedChallengeRejection): Ditto. * UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.mm: (checkChallenge): Factored out a bit of code into this helper function. (-[WKNSURLAuthenticationChallengeSender cancelAuthenticationChallenge:]): Use new helper. (-[WKNSURLAuthenticationChallengeSender continueWithoutCredentialForAuthenticationChallenge:]): Ditto. (-[WKNSURLAuthenticationChallengeSender useCredential:forAuthenticationChallenge:]): Ditto. (-[WKNSURLAuthenticationChallengeSender performDefaultHandlingForAuthenticationChallenge:]): Implemented this optional NSURLAuthenticationChallengeSender protocol method by forwarding to the decision listener. (-[WKNSURLAuthenticationChallengeSender rejectProtectionSpaceAndContinueWithChallenge:]): Ditto. * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new delegate method. * UIProcess/Authentication/AuthenticationChallengeProxy.cpp: (WebKit::AuthenticationChallengeProxy::performDefaultHandling): Added. Sends a message to the authentication manager. (WebKit::AuthenticationChallengeProxy::rejectProtectionSpaceAndContinue): Ditto. * UIProcess/Authentication/AuthenticationChallengeProxy.h: * UIProcess/Authentication/AuthenticationDecisionListener.cpp: (WebKit::AuthenticationDecisionListener::performDefaultHandling): Added. Forwards to the authentication challenge proxy. (WebKit::AuthenticationDecisionListener::rejectProtectionSpaceAndContinue): Ditto. * UIProcess/Authentication/AuthenticationDecisionListener.h: * UIProcess/Cocoa/NavigationState.h: Added flag in m_navigationDelegateMethods struct. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): Initialize webViewWillSendRequestForAuthenticationChallenge flag in the delegate methods struct. (WebKit::NavigationState::LoaderClient::canAuthenticateAgainstProtectionSpaceInFrame): If the delegate implements -_webView:willSendRequestForAuthenticationChallenge:, return true here; the delegate will respond with -rejectProtectionSpaceAndContinueWithChallenge: if it cannot authenticate. (WebKit::NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame): If the delegate implements -_webView:willSendRequestForAuthenticationChallenge:, send that message. 2014-06-10 Timothy Horton <timothy_horton@apple.com> Factor repeated CFRunLoopObserver code out https://bugs.webkit.org/show_bug.cgi?id=133690 Reviewed by Simon Fraser. * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy): (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy): (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): (WebKit::RemoteLayerTreeDrawingAreaProxy::showDebugIndicator): (WebKit::coreAnimationDidCommitLayersCallback): Deleted. (WebKit::RemoteLayerTreeDrawingAreaProxy::scheduleCoreAnimationLayerCommitObserver): Deleted. (WebKit::RemoteLayerTreeDrawingAreaProxy::coreAnimationDidCommitLayers): Deleted. Make use of WebCore::RunLoopObserver. 2014-06-10 Anders Carlsson <andersca@apple.com> Fix availability declaration. * UIProcess/API/Cocoa/WKError.h: 2014-06-10 Anders Carlsson <andersca@apple.com> Address a comment about a comment. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView evaluateJavaScript:completionHandler:]): 2014-06-10 Anders Carlsson <andersca@apple.com> Add -[WKWebView evaluateJavaScript:completionHandler:] https://bugs.webkit.org/show_bug.cgi?id=133689 <rdar://problem/17152685> Reviewed by Geoffrey Garen. * Shared/API/c/WKErrorRef.h: Remove WKErrorCode typedef from here. * UIProcess/API/C/WKPageLoaderClient.h: Use uint32_t instead of WKErrorCode. * UIProcess/API/Cocoa/WKError.h: (NS_ENUM): Add a WKErrorDomain and a WKErrorCode enum. * UIProcess/API/Cocoa/WKError.mm: (localizedDescriptionForErrorCode): Helper that returns the localized description given an error code. (createNSError): Helper that creates an NSError with the correct localized description given an error code. * UIProcess/API/Cocoa/WKErrorInternal.h: Add helpers. * UIProcess/API/Cocoa/WKWebView.h: Add evaluateJavaScript:completionHandler: method. * UIProcess/API/Cocoa/WKWebView.mm: (callbackErrorCode): Helper that returns a WKErrorCode from a WebKit::CallbackBase::Error enum. (-[WKWebView evaluateJavaScript:completionHandler:]): Run the JavaScript code and handle all the error cases. (-[WKWebView _runJavaScriptInMainFrame:]): Reimplement this using the API method. * WebKit2.xcodeproj/project.pbxproj: Add new files. 2014-06-10 Anders Carlsson <andersca@apple.com> Don't call Connection::terminateSoon if the connection is null https://bugs.webkit.org/show_bug.cgi?id=133695 <rdar://problem/17069024> Reviewed by Tim Horton. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::removeWebPage): 2014-06-10 Oliver Hunt <oliver@apple.com> Add process entitlements https://bugs.webkit.org/show_bug.cgi?id=133693 Reviewed by Alexey Proskuryakov. Add entitlements description for Database process, and ensure that we reference the correct seatbelt profiles. * Configurations/DatabaseService.Development.xcconfig: * Configurations/DatabaseService.xcconfig: * Configurations/Databases-iOS.entitlements: * Configurations/Network-iOS.entitlements: * Configurations/WebContent-iOS.entitlements: * WebKit2.xcodeproj/project.pbxproj: 2014-06-10 Alexey Proskuryakov <ap@apple.com> Fix crashes on some plug-in tests. https://bugs.webkit.org/show_bug.cgi?id=133691 <rdar://problem/17255836> Reviewed by Anders Carlsson. * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::initialize): Cannot use TemporaryChange here, because the object may go away before stack unwinds. 2014-06-10 Antti Koivisto <antti@apple.com> Serialize ResourceRequests without platform request https://bugs.webkit.org/show_bug.cgi?id=133679 Reviewed by Alexey Proskuryakov. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<ResourceRequest>::encode): (IPC::ArgumentCoder<ResourceRequest>::decode): Encode ResourceRequest directly if possible. 2014-06-09 Anders Carlsson <andersca@apple.com> Fix build. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::resetState): 2014-06-09 Simon Fraser <simon.fraser@apple.com> Work towards having frames in the scrolling tree https://bugs.webkit.org/show_bug.cgi?id=133665 Reviewed by Tim Horton. Override coordinatesScrollingForFrameView() to always return true for composited frames, for iOS WK2 (eventually this class will have to be specialized for iOS and OS X). * WebProcess/Scrolling/RemoteScrollingCoordinator.h: * WebProcess/Scrolling/RemoteScrollingCoordinator.mm: (WebKit::RemoteScrollingCoordinator::coordinatesScrollingForFrameView): 2014-06-09 Anders Carlsson <andersca@apple.com> Give callbacks real status codes https://bugs.webkit.org/show_bug.cgi?id=133668 Reviewed by Dan Bernstein. This makes it possible to know whether a callback was invalidated due to the webpage being closed, or whether it was due the a web process crash. * UIProcess/GenericCallback.h: (WebKit::GenericCallback::create): (WebKit::GenericCallback::performCallbackWithReturnValue): (WebKit::GenericCallback::invalidate): (WebKit::invalidateCallbackMap): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::close): (WebKit::WebPageProxy::resetState): (WebKit::WebPageProxy::resetStateAfterProcessExited): * UIProcess/WebPageProxy.h: 2014-06-09 Enrica Casucci <enrica@apple.com> iOS WebKit: Crash in charactersAroundPosition. https://bugs.webkit.org/show_bug.cgi?id=133659 <rdar://problem/17220870> Reviewed by Benjamin Poulain. We only need to compute charactersAroundPosition when we are in editable content. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::editorState): 2014-06-06 Andy Estes <aestes@apple.com> [iOS] Expose _WKWebViewPrintFormatter and -_webView:printFrame: as SPI https://bugs.webkit.org/show_bug.cgi?id=133600 Reviewed by David Kilzer. Expose -_webView:printFrame: in WKUIDelegatePrivate so that clients can implement support for window.print(). Since window.print() can be called from a subframe, expose _WKWebViewPrintFormatter (renamed from WKWebViewPrintFormatter to reflect its new SPI status) as SPI and add a frameToPrint property. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Forward-declared _WKFrameHandle and declared -_webView:printFrame:. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _webViewPrintFormatter]): Added to get a _WKWebViewPrintFormatter. (-[WKWebView _printFormatterClass]): Updated the class name to _WKWebViewPrintFormatter. (-[WKWebView _computePageCountAndStartDrawingToPDFForFrame:printInfo:WebKit::firstPage:computedTotalScaleFactor:]): Added a frame argument. If frame is nil, print the main frame. (-[WKWebView _computePageCountAndStartDrawingToPDFWithPrintInfo:WebKit::firstPage:computedTotalScaleFactor:]): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: Forward-declared _WKFrameHandle; removed an unneccessary forward-declaration of WKWebViewPrintFormatter. * UIProcess/API/Cocoa/WKWebViewPrivate.h: Added a _webViewPrintFormatter property. * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::setDelegate): (WebKit::UIDelegate::UIClient::printFrame): Called -_webView:printFrame:. * UIProcess/_WKWebViewPrintFormatter.h: Renamed from Source/WebKit2/UIProcess/WKWebViewPrintFormatter.h. * UIProcess/_WKWebViewPrintFormatter.mm: Renamed from Source/WebKit2/UIProcess/WKWebViewPrintFormatter.mm. * WebKit2.xcodeproj/project.pbxproj: 2014-06-09 Beth Dakin <bdakin@apple.com> Flash video controls hit-test incorrectly after changing topContentInset https://bugs.webkit.org/show_bug.cgi?id=133658 -and corresponding- <rdar://problem/16978590> Reviewed by Anders Carlsson. When the topContent changes, the PluginView needs to be informed. New function PluginView::topContentInsetDidChange() calls viewGeometryDidChange(). * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::topContentInsetDidChange): * WebProcess/Plugins/PluginView.h: Call topContentInsetDidChange() after setting an inset only if it is a new inset. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setTopContentInset): 2014-06-09 Daniel Bates <dabates@apple.com> Another attempt to fix the EFL and GTK builds after <http://trac.webkit.org/changeset/169711> (https://bugs.webkit.org/show_bug.cgi?id=133657) Substitute WKErrorRef.h for WKError.h. * UIProcess/API/efl/ewk_error.cpp: * WebProcess/WebCoreSupport/efl/WebErrorsEfl.cpp: * WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp: 2014-06-09 Daniel Bates <dabates@apple.com> Attempt to fix the EFL and GTK builds after <http://trac.webkit.org/changeset/169711> (https://bugs.webkit.org/show_bug.cgi?id=133657) Rename Shared/API/c/WKError.cpp to Shared/API/c/WKErrorRef.cpp. * CMakeLists.txt: 2014-06-09 Anders Carlsson <andersca@apple.com> Address review feedback. * UIProcess/API/Cocoa/WKWebView.h: 2014-06-09 Anders Carlsson <andersca@apple.com> Add a WKError.h header and rename the existing WKError.h to WKErrorRef.h https://bugs.webkit.org/show_bug.cgi?id=133657 Reviewed by Dan Bernstein. * Shared/API/Cocoa/WebKit.h: * Shared/API/c/WKErrorRef.cpp: Renamed from Source/WebKit2/Shared/API/c/WKError.cpp. (WKErrorGetTypeID): (WKErrorCopyWKErrorDomain): (WKErrorCopyDomain): (WKErrorGetErrorCode): (WKErrorCopyFailingURL): (WKErrorCopyLocalizedDescription): * Shared/API/c/WKErrorRef.h: Renamed from Source/WebKit2/Shared/API/c/WKError.h. * UIProcess/API/C/WKPage.h: * UIProcess/API/C/WKPageLoaderClient.h: * UIProcess/API/C/WebKit2_C.h: * UIProcess/API/Cocoa/WKError.h: Copied from Source/WebKit2/Shared/API/Cocoa/WebKit.h. * UIProcess/API/Cocoa/WKError.mm: Copied from Source/WebKit2/Shared/API/Cocoa/WebKit.h. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm: 2014-06-09 Brady Eidson <beidson@apple.com> Use different AppKit API for all services menus <rdar://problem/16874403> and https://bugs.webkit.org/show_bug.cgi?id=133649 Reviewed by Tim Horton. * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::showContextMenu): 2014-06-09 Anders Carlsson <andersca@apple.com> Add WKWindowFeatures.h to the umbrella header. Reviewed by Dan Bernstein. * Shared/API/Cocoa/WebKit.h: 2014-06-09 Anders Carlsson <andersca@apple.com> Add -[WKWebView loadHTMLString:baseURL:] https://bugs.webkit.org/show_bug.cgi?id=133645 <rdar://problem/17170649> Reviewed by Sam Weinig. * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView loadHTMLString:baseURL:]): * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::createLoadDataNavigation): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::loadHTMLString): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadDataImpl): (WebKit::WebPage::loadString): (WebKit::WebPage::loadData): (WebKit::WebPage::loadHTMLString): (WebKit::WebPage::loadAlternateHTMLString): (WebKit::WebPage::loadPlainTextString): (WebKit::WebPage::loadWebArchiveData): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: 2014-06-09 Simon Fraser <simon.fraser@apple.com> Fix more latched scrolling test flakiness and slowness https://bugs.webkit.org/show_bug.cgi?id=133601 Reviewed by Brent Fulgham. Latched scrolling tests were flakey for two reasons. First, the EventSender wheel events were async from the web to the UI process, and the resulting synthetic events also async from the UI to the web process. Make them sync for testing. Secondly, the timer-based scrolling tree commit could result in the scrolling tree (specifically the frame node's notion of the scrollable area and content size) not being updated before the scrolling thread starts getting wheel events. Fix by having WebPage::wheelEventSyncForTesting() commit if necessary. Finally remove all the now-unnecessary timeouts from the tests. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::wheelEventSyncForTesting): 2014-06-09 Andrzej Badowski <a.badowski@samsung.com> [EFL] Add parameter to MiniBrowser to disable web security https://bugs.webkit.org/show_bug.cgi?id=121095 Reviewed by Gyuyoung Kim. -w (--web-security) commandline allows to disable/enable web security (enabled by default). The reason for this is to test and debug (using, for example, MiniBrowser) scripts accessing resources from other domains (cross-domain requests) such as access map location on another server. Another possibility is to launch in a webkit browser local file tests that will refer to the links in the http website loaded in an iframe. It will not be possible without deactivation of web security. * UIProcess/API/efl/ewk_settings.cpp: (ewk_settings_web_security_enabled_set): (ewk_settings_web_security_enabled_get): * UIProcess/API/efl/ewk_settings.h: * UIProcess/API/efl/tests/test_ewk2_settings.cpp: (TEST_F): 2014-06-08 Sam Weinig <sam@webkit.org> [Cocoa] WKScriptMessage should include the frame the message is from <rdar://problem/17210226> https://bugs.webkit.org/show_bug.cgi?id=133623 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKScriptMessage.h: Add WKFrameInfo property. * UIProcess/API/Cocoa/WKScriptMessage.mm: (-[WKScriptMessage _initWithBody:webView:frameInfo:name:]): Add WKFrameInfo to the initializer. (-[WKScriptMessage frameInfo]): Implement frameInfo accessor. * UIProcess/API/Cocoa/WKScriptMessageInternal.h: Add WKFrameInfo to the initializer. * UIProcess/API/Cocoa/WKUserContentController.mm: Pass the WKFrameInfo to the WKScriptMessage initializer. 2014-06-08 Dan Bernstein <mitz@apple.com> [Cococa] WKWindowFeatures.h is missing from WebKit.framework https://bugs.webkit.org/show_bug.cgi?id=133622 Reviewed by Sam Weinig. * WebKit2.xcodeproj/project.pbxproj: Promoted WKWindowFeatures.h to Public. 2014-06-08 Dan Bernstein <mitz@apple.com> <rdar://problem/17208234> [Mac] Client-certificate authentication isn’t working when using the modern API https://bugs.webkit.org/show_bug.cgi?id=133617 Reviewed by Sam Weinig. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<Credential>::encode): Encode certificate credentials on Mac as well. (IPC::ArgumentCoder<Credential>::decode): Decode certificate credentials on Mac as well. * Shared/cf/ArgumentCodersCF.cpp: (IPC::encode): Use OS X API for getting a persistent reference to a key. (IPC::decode): Use OS X API for getting a key from a persistent reference. * Shared/cf/ArgumentCodersCF.h: Make identity coding available on Mac as well. 2014-06-07 Anders Carlsson <andersca@apple.com> Get rid of _WKScriptWorld https://bugs.webkit.org/show_bug.cgi?id=133610 Reviewed by Dan Bernstein. * Shared/API/Cocoa/WebKitPrivate.h: * UIProcess/API/Cocoa/_WKScriptWorld.h: Removed. * UIProcess/API/Cocoa/_WKScriptWorld.mm: Removed. * WebKit2.xcodeproj/project.pbxproj: 2014-05-29 Anders Carlsson <andersca@apple.com> HTTPHeaderMap should not derive from HashMap https://bugs.webkit.org/show_bug.cgi?id=133392 Reviewed by Darin Adler. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<HTTPHeaderMap>::encode): (IPC::ArgumentCoder<HTTPHeaderMap>::decode): 2014-06-07 Alexey Proskuryakov <ap@apple.com> [iOS] Fix a path used for sandbox profiles https://bugs.webkit.org/show_bug.cgi?id=133602 <rdar://problem/17212011> Reviewed by David Kilzer. * WebKit2.xcodeproj/project.pbxproj: 2014-06-06 Enrica Casucci <enrica@apple.com> REGRESSION (iOS WebKit2): backspace key does not repeat beyond a single word. https://bugs.webkit.org/show_bug.cgi?id=133593 <rdar://problem/16352228> Reviewed by Benjamin Poulain. We need to provide a way for the keyboard layer to select from the current position to the beginning of the word moving backwards and implement the method to know when we have reached the beginning of the document. * UIProcess/WebPageProxy.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView selectWordBackward]): (-[WKContentView _selectionAtDocumentStart]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::selectWordBackward): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::selectWordBackward): 2014-06-06 Enrica Casucci <enrica@apple.com> Adopt the new UIAlertController API to replace UIActionSheet. https://bugs.webkit.org/show_bug.cgi?id=133582 <rdar://problem/16845223> Reviewed by Joseph Pecoraro. UIActionSheet is deprecated. We need to move out action sheets implementation to UIAlertView. * UIProcess/API/Cocoa/_WKElementAction.h: * UIProcess/API/Cocoa/_WKElementAction.mm: * UIProcess/ios/WKActionSheet.h: * UIProcess/ios/WKActionSheet.mm: (-[WKActionSheet presentSheetFromRect:]): (-[WKActionSheet doneWithSheet]): (-[WKActionSheet willRotate]): (-[WKActionSheet updateSheetPosition]): (-[WKActionSheet _didRotateAndLayout]): (-[WKActionSheet didRotate]): * UIProcess/ios/WKActionSheetAssistant.h: * UIProcess/ios/WKActionSheetAssistant.mm: (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]): (-[WKActionSheetAssistant showImageSheet]): (-[WKActionSheetAssistant showLinkSheet]): (-[WKActionSheetAssistant showDataDetectorsSheet]): (-[WKActionSheetAssistant cleanupSheet]): (-[WKActionSheetAssistant actionSheet:clickedButtonAtIndex:]): Deleted. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _longPressRecognized:]): 2014-06-06 Gavin Barraclough <baraclough@apple.com> Should boost ChildProcesses on iOS https://bugs.webkit.org/show_bug.cgi?id=133583 Reviewed by Sam Weinig. * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::connectToService): - boost all child processes on iOS. 2014-06-06 Alexey Proskuryakov <ap@apple.com> Build fix after <http://trac.webkit.org/changeset/169655>. The SPIs used do not exist on Mac, limit the code to iOS. * Shared/Authentication/mac/AuthenticationManager.mac.mm: * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<Credential>::encode): (IPC::ArgumentCoder<Credential>::decode): * Shared/cf/ArgumentCodersCF.cpp: (IPC::typeFromCFTypeRef): (IPC::encode): (IPC::decode): * Shared/cf/ArgumentCodersCF.h: 2014-06-06 Dan Bernstein <mitz@apple.com> <rdar://problem/17095692> [iOS] Client-certificate authentication isn’t working https://bugs.webkit.org/show_bug.cgi?id=133527 Reviewed by Darin Adler. * Configurations/Network-iOS.entitlements: Enabled the Network process to access the keys needed to create identities to authenticate with. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<Credential>::encode): Encode the credential type, and if it is a client certificate, encode the identity and the certificates. (IPC::ArgumentCoder<Credential>::decode): Decode the credential type. If it is a client certificate, decode the identity and the certificates and use the proper Credential constructor. * Shared/cf/ArgumentCodersCF.cpp: (IPC::typeFromCFTypeRef): Handle SecIdentityRef. (IPC::encode): Encode an identity by encoding its certificate and a persistent reference to its key. (IPC::decode): Decode a certificate and a persistent reference to a key, find the key, and create an identity. * Shared/cf/ArgumentCodersCF.h: 2014-06-05 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] WebPage sometimes forces two resize events on animated resize https://bugs.webkit.org/show_bug.cgi?id=133534 Reviewed by Enrica Casucci. When I updated the patch for resize events (r168556) to use the unobscured rect in scrollview coordinates, I forgot to update a snippet of code in dynamicViewportSizeUpdate(). Since that code was still using the scaled unobscured rect, there was sometimes a difference of 1 pixel between the size set by that call site and the others. This path nukes the bad code and use the unobscured rect in scrollview coordinates given by the UIProcess. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): 2014-06-05 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] Add device orientation https://bugs.webkit.org/show_bug.cgi?id=133530 <rdar://problem/16680041> Reviewed by Tim Horton. Add device orientation for WebKit2. For the public API, WKWebView get the updates through the notification UIWindowDidRotateNotification. We do not have any control over how the API is used, but we can expect the size will be updated before the end of rotation in most cases and the events should be sent in the right order. For Safari, we use an override to support animated resize (and some tabs corner cases). On the WebProcess side, we just get the new orientation directly or on DynamicViewportSizeUpdate. * UIProcess/API/Cocoa/WKWebView.mm: (deviceOrientationForUIInterfaceOrientation): (deviceOrientation): (-[WKWebView initWithFrame:configuration:]): (-[WKWebView _windowDidRotate:]): (-[WKWebView _setInterfaceOrientationOverride:]): (-[WKWebView _interfaceOrientationOverride]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::deviceOrientation): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::dynamicViewportSizeUpdate): (WebKit::WebPageProxy::setDeviceOrientation): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: (WebKit::WebChromeClient::deviceOrientation): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::deviceOrientation): * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::setDeviceOrientation): (WebKit::WebPage::dynamicViewportSizeUpdate): 2014-06-05 Oliver Hunt <oliver@apple.com> Enable SANDBOX_EXTENSIONS build flag universally on cocoa https://bugs.webkit.org/show_bug.cgi?id=133556 Reviewed by Alexey Proskuryakov. Remove unnecessary iOS exception. * WebKit2Prefix.h: 2014-06-05 Alexey Proskuryakov <ap@apple.com> [Mac] Tweak plug-in sandbox profiles https://bugs.webkit.org/show_bug.cgi?id=133549 Fix <rdar://problem/17068055> and <rdar://problem/17148837>. Reviewed by Sam Weinig and Simon Cooper. * Resources/PlugInSandboxProfiles/com.apple.ist.ds.appleconnect.webplugin.sb: * Resources/PlugInSandboxProfiles/com.microsoft.SilverlightPlugin.sb: 2014-06-05 Tanay C <tanay.c@samsung.com> Resolve compiler error (call of overloaded 'schedule' function is ambiguous) https://bugs.webkit.org/show_bug.cgi?id=133467 Reviewed by Carlos Garcia Campos. * Shared/Downloads/soup/DownloadSoup.cpp: (WebKit::DownloadClient::handleResponseLater): Explicitly casting second parameter to std::function<void()> 2014-06-04 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] Restore the visual scroll position instead of the dom scroll position when restoring states from the history https://bugs.webkit.org/show_bug.cgi?id=133490 Reviewed by Tim Horton. Instead of restoring the scroll position, restore the visual position. This makes pages appear at the same position on screen ignoring changes in the obscured top inset. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm: (WebKit::WebFrameLoaderClient::saveViewStateToItem): (WebKit::WebFrameLoaderClient::restoreViewState): Save and restore userHasChangedPageScaleFactor to handle rescaling correctly. Limit the scale into valid viewport limits in case the viewport meta tag has changed or the device has rotated. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::userHasChangedPageScaleFactor): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::restorePageState): (WebKit::WebPage::updateVisibleContentRects): In updateVisibleContentRects, we keep track or the current difference between the exposed rect and the unobscured rect. When restoring the page position, we use the current top inset and the saved exposed rect to restore the visual scroll position. It is not very robust as it does not resolve races between the two processes, but that is not worse than what we is there now. 2014-06-03 Timothy Horton <timothy_horton@apple.com> WebKit2 View Gestures (Zoom): Can show unpainted regions when zoom-pinching-out https://bugs.webkit.org/show_bug.cgi?id=133472 <rdar://problem/15686848> Reviewed by Simon Fraser. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::flushLayers): (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToLayers): (WebKit::TiledCoreAnimationDrawingArea::adjustTransientZoom): Use prepopulateRect() when zooming out to ensure that we have tiles for the current exposed area. Factor applyTransientZoomToLayers out of adjustTransientZoom, so that flushLayers can call applyTransientZoomToLayers without ending up calling prepopulateRect() during layer flushing, which causes trouble. It is OK to populate layers at the current scale even when zooming out, because the overdraw already covers most of the zoomed out area, and we're only adding a few more tiles at worst. 2014-06-03 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] Align the highlight rects with device pixels https://bugs.webkit.org/show_bug.cgi?id=133464 <rdar://problem/16708861> Reviewed by Enrica Casucci. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _showTapHighlightWithColor:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]): 2014-06-02 Enrica Casucci <enrica@apple.com> REGRESSION (iOS WebKit2): Single tap in pages with focus on load will clear the selection after the keyboard appears. https://bugs.webkit.org/show_bug.cgi?id=133465 <rdar://problem/17059189> Reviewed by Benjamin Poulain. If a page focuses an input field on load we don't bring the keyboard on screen since the keyboard is only shown when the user interacts with the page with gestures. Still the WebProcess sets the focus and the selection according to the rules. We need to make sure the UI process doesn't accidentally clear this selection when the user starts the interaction with the page. This patch also improves the function that retrieves the autocorrection data to be returned to the keyboard, making sure that we always send back a reply even when we don't have a valid selection. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _singleTapCommited:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::requestAutocorrectionData): 2014-05-31 Anders Carlsson <andersca@apple.com> Change DeferrableOneShotTimer to use std::function instead of being a class template https://bugs.webkit.org/show_bug.cgi?id=133423 Reviewed by Antti Koivisto. * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformSetCacheModel): * Shared/CacheModel.cpp: (WebKit::calculateCacheSizes): * Shared/CacheModel.h: * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::pluginSnapshotTimerFired): * WebProcess/Plugins/PluginView.h: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformSetCacheModel): 2014-06-02 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] Round the UIScrollView content size to device pixel https://bugs.webkit.org/show_bug.cgi?id=133417 <rdar://problem/15922440> Reviewed by Simon Fraser. We should really have the scaled content size floored to device pixels, but that will be for another time. This patch ensure the content size as seen by the API is rounded to device pixels. The value is floored to avoid showing partial pixels when the content is stable. * UIProcess/API/Cocoa/WKWebView.mm: (floorFloatToPixels): (roundScrollViewCountentSize): (-[WKWebView _setHasCustomContentView:loadedMIMEType:WTF::]): (-[WKWebView _didCommitLayerTree:WebKit::]): (-[WKWebView scrollView:contentSizeForZoomScale:withProposedSize:]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _endAnimatedResize]): 2014-06-02 Oliver Hunt <oliver@apple.com> Move ifdef to the right place. RS=Enrica * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::initializeSandbox): 2014-06-02 Gavin Barraclough <barraclough@apple.com> Set default voucher for XPC client processes https://bugs.webkit.org/show_bug.cgi?id=133458 Reviewed by Geoff Garen. * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h: (WebKit::XPCServiceInitializer): - add voucher_replace_default_voucher. * config.h: - add HAVE_VOUCHERS. 2014-06-02 Jeremy Jones <jeremyj@apple.com> Send external playback properties to fullscreen. https://bugs.webkit.org/show_bug.cgi?id=133366 Reviewed by Simon Fraser. Forward setExternalPlayback. * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: add setExternalPlaybackProperties * WebProcess/ios/WebVideoFullscreenManager.h: add setExternalPlaybackProperties * WebProcess/ios/WebVideoFullscreenManager.mm: add setExternalPlaybackProperties (WebKit::WebVideoFullscreenManager::setExternalPlaybackProperties): added 2014-06-02 Enrica Casucci <enrica@apple.com> Remove unintentional changes to WKContentViewInteraction.mm introduced in r169500. Unreviewed. * UIProcess/ios/WKContentViewInteraction.mm: (+[WKAutocorrectionContext autocorrectionContextWithData:markedText:selectedText:afterText:selectedRangeInMarkedText:]): 2014-06-02 Geoffrey Garen <ggaren@apple.com> Address some review comments on bug 133408 https://bugs.webkit.org/show_bug.cgi?id=133410 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKBackForwardListItem.h: * UIProcess/API/Cocoa/WKUIDelegate.h: 2014-06-02 Dan Bernstein <mitz@apple.com> [Cocoa] -[WKWebView activeURL] is unused https://bugs.webkit.org/show_bug.cgi?id=133440 Reviewed by Mark Rowe. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView activeURL]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: Removed the property declaration. 2014-05-31 Oliver Hunt <oliver@apple.com> Restructure initial distinct sandbox profiles https://bugs.webkit.org/show_bug.cgi?id=133415 Reviewed by Alexey Proskuryakov. Add support for manually instantiating the network and content process sandboxes, and add initial profiles. These profiles are completely generic so we can make sure nothing is broken by enabling them. This also adds a target to the WebKit2 project to correctly process the profiles. * DatabaseProcess/ios/DatabaseProcessIOS.mm: (WebKit::DatabaseProcess::initializeSandbox): * DatabaseProcess/ios/com.apple.WebKit.DatabasesIOS.sb: Removed. * NetworkProcess/ios/NetworkProcessIOS.mm: (WebKit::NetworkProcess::initializeSandbox): * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb: Added. * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Added. * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Added. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::initializeSandbox): 2014-06-01 Sam Weinig <sam@webkit.org> [Cocoa] Add SPI to get a WebArchive of the WKWebView <rdar://problem/16748120> https://bugs.webkit.org/show_bug.cgi?id=133439 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _getWebArchiveDataWithCompletionHandler:]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2014-05-31 Anders Carlsson <andersca@apple.com> Add a LazyNeverDestroyed class template and use it https://bugs.webkit.org/show_bug.cgi?id=133425 Reviewed by Darin Adler. * Shared/mac/SecItemShim.cpp: (WebKit::responseMap): 2014-05-31 Timothy Horton <timothy_horton@apple.com> View snapshots are sometimes taken at the wrong scale https://bugs.webkit.org/show_bug.cgi?id=133419 <rdar://problem/17087497> Reviewed by Sam Weinig. * UIProcess/API/mac/WKView.mm: (-[WKView _takeViewSnapshot]): Work around <rdar://problem/17084993> by re-requesting the snapshot at kCGWindowImageNominalResolution if it was captured at the wrong scale. 2014-05-31 Dan Bernstein <mitz@apple.com> [iOS] WebKit2.framework is unused https://bugs.webkit.org/show_bug.cgi?id=133424 Reviewed by Anders Carlsson. * Configurations/WebKit2.xcconfig: Set SKIP_INSTALL to YES when targeting iOS. 2014-05-30 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] When a page does not finish rotation before the end of the animation, synchronize explicitely https://bugs.webkit.org/show_bug.cgi?id=133364 <rdar://problem/17026333> Reviewed by Sam Weinig. When a page that does layout on rotation does not respond before the end of the animation, we end up with a completely inconsistent state on the UIProcess (because it is unware of the new states). The perfect way to fix this would be to make animated resize transactional and have the WebProcess resolve conflicts. That is very complicated and the issue is uncommon, so this patch does not do that. This patch force the synchronization whenever we finish the animation before we heard back from the WebProcess. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _endAnimatedResize]): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::resetState): * UIProcess/WebPageProxy.h: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::dynamicViewportSizeUpdate): (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate): (WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): (WebKit::WebPage::synchronizeDynamicViewportUpdate): 2014-05-30 Enrica Casucci <enrica@apple.com> REGRESSION (WebKit2): space space to insert period doesn't work in web forms. https://bugs.webkit.org/show_bug.cgi?id=133413 <rdar://problem/16948333> Reviewed by Benjamin Poulain. iOS TextInput needs to know about content surrounding the current position while editing. Since we don't want to query this information synchronously when asked, we cache it as part of the EditorState. EditorState now contains a vector of three characters representing the content after, before and two position before the caret position. The patch also replaces all calls to plainText with plainTextReplacingNoBreakSpace to work well with iOS text input. * Shared/EditorState.cpp: (WebKit::EditorState::encode): (WebKit::EditorState::decode): * Shared/EditorState.h: (WebKit::EditorState::EditorState): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _characterInRelationToCaretSelection:]): (+[WKAutocorrectionContext autocorrectionContextWithData:markedText:selectedText:afterText:selectedRangeInMarkedText:]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::editorState): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::requestDictationContext): (WebKit::WebPage::replaceSelectedText): (WebKit::WebPage::replaceDictatedText): (WebKit::WebPage::requestAutocorrectionData): (WebKit::WebPage::syncApplyAutocorrection): (WebKit::computeAutocorrectionContext): 2014-05-30 Geoffrey Garen <ggaren@apple.com> Fixed the build by adding back a declaration I deleted by accident :(. Unreviewed. * UIProcess/API/Cocoa/WKWebView.h: 2014-05-30 Geoffrey Garen <ggaren@apple.com> Unreviewed, rolling in r169490. I changed a non-ASCII apostrophe to ASCII. Restored changeset: "Some more copy-editing of the Modern WebKit headerdoc" https://bugs.webkit.org/show_bug.cgi?id=133408 http://trac.webkit.org/changeset/169490 * UIProcess/API/Cocoa/WKBackForwardList.h: * UIProcess/API/Cocoa/WKBackForwardListItem.h: * UIProcess/API/Cocoa/WKFrameInfo.h: * UIProcess/API/Cocoa/WKNavigation.h: * UIProcess/API/Cocoa/WKNavigationAction.h: (NS_ENUM): * UIProcess/API/Cocoa/WKNavigationDelegate.h: (NS_ENUM): * UIProcess/API/Cocoa/WKNavigationResponse.h: * UIProcess/API/Cocoa/WKPreferences.h: * UIProcess/API/Cocoa/WKProcessPool.h: * UIProcess/API/Cocoa/WKScriptMessage.h: * UIProcess/API/Cocoa/WKScriptMessageHandler.h: * UIProcess/API/Cocoa/WKUIDelegate.h: * UIProcess/API/Cocoa/WKUserContentController.h: * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.h: 2014-05-30 Geoffrey Garen <ggaren@apple.com> Unreviewed, rolling out r169490. It broke the build with a mysterious warning about ASCII. Reverted changeset: "Some more copy-editing of the Modern WebKit headerdoc" https://bugs.webkit.org/show_bug.cgi?id=133408 http://trac.webkit.org/changeset/169490 2014-05-30 Geoffrey Garen <ggaren@apple.com> Some more copy-editing of the Modern WebKit headerdoc https://bugs.webkit.org/show_bug.cgi?id=133408 Reviewed by Beth Dakin. A copy-editor suggested some edits to the headerdoc for clarity, style, and formatting. I reviewed the edits and accepted about 80% of them. * UIProcess/API/Cocoa/WKBackForwardList.h: * UIProcess/API/Cocoa/WKBackForwardListItem.h: * UIProcess/API/Cocoa/WKFrameInfo.h: * UIProcess/API/Cocoa/WKNavigation.h: * UIProcess/API/Cocoa/WKNavigationAction.h: (NS_ENUM): * UIProcess/API/Cocoa/WKNavigationDelegate.h: (NS_ENUM): * UIProcess/API/Cocoa/WKNavigationResponse.h: * UIProcess/API/Cocoa/WKPreferences.h: * UIProcess/API/Cocoa/WKProcessPool.h: * UIProcess/API/Cocoa/WKScriptMessage.h: * UIProcess/API/Cocoa/WKScriptMessageHandler.h: * UIProcess/API/Cocoa/WKUIDelegate.h: * UIProcess/API/Cocoa/WKUserContentController.h: * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.h: 2014-05-30 Timothy Horton <timothy_horton@apple.com> Crash loading skydrive.com (assertion under RemoteLayerTreeDisplayRefreshMonitor) https://bugs.webkit.org/show_bug.cgi?id=133370 <rdar://problem/17061361> Reviewed by Darin Adler. * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea): (WebKit::RemoteLayerTreeDrawingArea::willDestroyDisplayRefreshMonitor): (WebKit::RemoteLayerTreeDrawingArea::didUpdate): Post-landing review comments from Darin noted that checking if the DrawingArea's m_displayRefreshMonitors contains the monitor in the list to notify is insufficient, because a new one could have been added with the same address. Instead, copy the HashSet, removing at random from it and firing didUpdateLayers, but *also* removing from it in the willDestroyDisplayRefreshMonitor callback. This is very similar to what DisplayRefreshMonitor itself does internally (we don't have to duplicate its code to avoid re-entry because it is already impossible to re-enter didUpdate). 2014-05-29 Anders Carlsson <andersca@apple.com> -[WKProcessPoolConfiguration setCachePartitionedURLSchemes:] should do a deep copy https://bugs.webkit.org/show_bug.cgi?id=133393 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration setCachePartitionedURLSchemes:]): 2014-05-29 Mark Lam <mark.lam@apple.com> Restoring FloatingPointEnvironment initialization that was accidentally rolled out by r169176. <https://webkit.org/b/133389> Rubber stamped by Oliver Hunt. * Shared/ios/ChildProcessIOS.mm: (WebKit::ChildProcess::platformInitialize): 2014-05-29 Enrica Casucci <enrica@apple.com> Need to notify the keyboard about every KeyDown event. https://bugs.webkit.org/show_bug.cgi?id=133383 <rdar://problem/16633975> Reviewed by Benjamin Poulain. A key down will generate most of the time a call to the keyboard to add input or delete. But the event could be handled by JavaScript and its default prevented. We need to notify the keyboard in every case to allow updating its internal state about what has been typed. * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::doneWithKeyEvent): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _didHandleKeyEvent:]): 2014-05-29 Matthew Hanson <matthew_hanson@apple.com> Roll out r169439. <rdar://problem/17069364> 2014-05-28 Gavin Barraclough <baraclough@apple.com> viewStateDidChange should always fully update ViewState https://bugs.webkit.org/show_bug.cgi?id=133159 Reviewed by Anders Carlson. Currently WebPageProxy::viewStateDidChange is passed a mask of bits to update. This has the following negative consequences: – WKWebView implicitly requires more detailed knowledge of the internal implementation of the PageClient. – Updates may unnecessarily be split over multiple IPC messages. – In order to support partial updates we make multiple virtual function calls to PageClient, which then makes duplicate objc calls. Better to just always update the entire ViewState. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView didMoveToWindow]): - removed argument to viewStateDidChange. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::viewState): (WebKit::PageClientImpl::isViewWindowActive): Deleted. (WebKit::PageClientImpl::isViewFocused): Deleted. (WebKit::PageClientImpl::isViewVisible): Deleted. (WebKit::PageClientImpl::isViewInWindow): Deleted. * UIProcess/API/gtk/PageClientImpl.h: - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState. * UIProcess/API/mac/WKView.mm: (-[WKView becomeFirstResponder]): (-[WKView resignFirstResponder]): (-[WKView viewDidMoveToWindow]): (-[WKView _windowDidBecomeKey:]): (-[WKView _windowDidResignKey:]): (-[WKView _windowDidMiniaturize:]): (-[WKView _windowDidDeminiaturize:]): (-[WKView _windowDidOrderOffScreen:]): (-[WKView _windowDidOrderOnScreen:]): (-[WKView _windowDidChangeOcclusionState:]): (-[WKView viewDidHide]): (-[WKView viewDidUnhide]): (-[WKView _activeSpaceDidChange:]): (-[WKView _setThumbnailView:]): (-[WKView endDeferringViewInWindowChanges]): (-[WKView endDeferringViewInWindowChangesSync]): - removed argument to viewStateDidChange. * UIProcess/CoordinatedGraphics/WebView.cpp: (WebKit::WebView::viewState): (WebKit::WebView::isViewWindowActive): Deleted. (WebKit::WebView::isViewFocused): Deleted. (WebKit::WebView::isViewVisible): Deleted. (WebKit::WebView::isViewInWindow): Deleted. * UIProcess/CoordinatedGraphics/WebView.h: - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState. * UIProcess/PageClient.h: (WebKit::PageClient::isViewVisibleOrOccluded): Deleted. (WebKit::PageClient::isVisuallyIdle): Deleted. - merged isViewVisibleOrOccluded/isVisuallyIdle to subclass viewState methods. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::reattachToWebProcess): - updateViewState -> PageClient::viewState (WebKit::WebPageProxy::viewStateDidChange): - argument removed; updateViewState -> PageClient::viewState. (WebKit::WebPageProxy::setCursor): - call isViewWindowActive on WebPageProxy, rather than PageClient. (WebKit::WebPageProxy::updateBackingStoreDiscardableState): - call isViewWindowActive on WebPageProxy, rather than PageClient. (WebKit::WebPageProxy::updateViewState): Deleted. - removed - viewState method moved to PageClient. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::isViewWindowActive): - added missing implementation. (WebKit::WebPageProxy::isViewVisible): - removed argument to viewStateDidChange. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::windowServerConnectionStateChanged): - removed argument to viewStateDidChange. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::viewState): (WebKit::PageClientImpl::isViewWindowActive): Deleted. (WebKit::PageClientImpl::isViewFocused): Deleted. (WebKit::PageClientImpl::isViewVisible): Deleted. (WebKit::PageClientImpl::isViewInWindow): Deleted. (WebKit::PageClientImpl::isViewVisibleOrOccluded): Deleted. (WebKit::PageClientImpl::isVisuallyIdle): Deleted. - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState. * UIProcess/ios/WKContentView.mm: (-[WKContentView didMoveToWindow]): (-[WKContentView _applicationDidEnterBackground:]): (-[WKContentView _applicationWillEnterForeground:]): - removed argument to viewStateDidChange. * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::viewState): (WebKit::PageClientImpl::showCorrectionPanel): (WebKit::PageClientImpl::showDictationAlternativeUI): (WebKit::PageClientImpl::isViewWindowActive): Deleted. (WebKit::PageClientImpl::isViewFocused): Deleted. (WebKit::PageClientImpl::isViewVisibleOrOccluded): Deleted. (WebKit::PageClientImpl::isVisuallyIdle): Deleted. - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState. 2014-05-29 Dan Bernstein <mitz@apple.com> [Cocoa] Can’t recover from subframe load errors https://bugs.webkit.org/show_bug.cgi?id=133385 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new delegate method. * UIProcess/Cocoa/NavigationState.h: Added flag in m_navigationDelegateMethods struct. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::setNavigationDelegate): Initialize webViewNavigationDidFailProvisionalLoadInSubframeWithError flag in the delegate methods struct. (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame): If the error occurred in a subframe, invoke the new delegate method. 2014-05-29 Geoffrey Garen <ggaren@apple.com> Added a missing @result to WKPreferences headerdoc https://bugs.webkit.org/show_bug.cgi?id=133381 Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKPreferences.h: 2014-05-29 Alexey Proskuryakov <ap@apple.com> [Mac] Always use plug-in sandbox with sandboxed clients https://bugs.webkit.org/show_bug.cgi?id=133358 <rdar://problem/15637695> Reviewed by Anders Carlsson. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::initializeSandbox): Refuse to start if parent process is sandboxed, and plug-in process is not going to be. None of this should run in normal case, because there are also checks on UI process side. * Shared/Plugins/PluginModuleInfo.h: * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm: (WebKit::NetscapePluginModule::getPluginInfo): Added a member to PluginModuleInfo, telling whether the plug-in has a sandbox profile. * Shared/Plugins/Netscape/mac/PluginInformationMac.mm: (WebKit::getPlatformPluginModuleInformation): Use the new PluginModuleInfo member, we no longer need to check the file system here. * WebKit2.xcodeproj/project.pbxproj: * Shared/mac/SandboxUtilities.h: Added. * Shared/mac/SandboxUtilities.cpp: Added. (WebKit::processIsSandboxed): This code is simple, but include magic is not. Moved it to a separate file to avoid repeating. * UIProcess/API/C/mac/WKContextPrivateMac.mm: Removed an unused include. * UIProcess/Plugins/mac/PluginInfoStoreMac.mm: (WebKit::PluginInfoStore::shouldUsePlugin): Don't use unsandboxed plug-ins in sandboxed applications. * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: (WebKit::PluginProcessProxy::platformGetLaunchOptions): Don't ever pass disable-sandbox from sandboxed processes. * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm: (WebKit::XPCServiceInitializerDelegate::isClientSandboxed): Use the new shared code in SandboxUtilities.h. 2014-05-29 Timothy Horton <timothy_horton@apple.com> Crash loading skydrive.com (assertion under RemoteLayerTreeDisplayRefreshMonitor) https://bugs.webkit.org/show_bug.cgi?id=133370 <rdar://problem/17061361> Reviewed by Anders Carlsson. * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::didUpdate): Copy the set of refresh monitors so that we don't try to mutate the list we're iterating, and don't try to fire refresh monitors that were removed in a previous iteration of the loop. 2014-05-29 Timothy Horton <timothy_horton@apple.com> REGRESSION (iOS WebKit2): Find-in-Page doesn't work in subframes https://bugs.webkit.org/show_bug.cgi?id=133372 <rdar://problem/17045070> Reviewed by Simon Fraser. * WebProcess/WebPage/ios/FindControllerIOS.mm: (WebKit::FindController::willFindString): (WebKit::FindController::didFailToFindString): (WebKit::FindController::didHideFindIndicator): Flip ignoreCompositionSelectionChange and updateAppearanceEnabled on all frames, not just the main frame, because the found string can be in a subframe. Ideally we would flip it on/off for each frame as we move the selection between them, but would require a lot of work (and the overhead of touching each frame shouldn't be significant). 2014-05-29 Dan Bernstein <mitz@apple.com> WKBundleActivateMacFontAscentHack is unused https://bugs.webkit.org/show_bug.cgi?id=133379 Reviewed by Anders Carlsson. * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleActivateMacFontAscentHack): Deleted. * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: * WebProcess/InjectedBundle/InjectedBundle.h: * WebProcess/InjectedBundle/efl/InjectedBundleEfl.cpp: (WebKit::InjectedBundle::activateMacFontAscentHack): Deleted. * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp: (WebKit::InjectedBundle::activateMacFontAscentHack): Deleted. * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm: (WebKit::InjectedBundle::activateMacFontAscentHack): Deleted. 2014-05-29 Alexey Proskuryakov <ap@apple.com> Add a sandbox profile for com.apple.appstore.CodeRedeemerNetscapePlugin https://bugs.webkit.org/show_bug.cgi?id=133360 Reviewed by Sam Weinig. * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb: Looks like anyone using camera would need access to CoreMedia preferences. * Resources/PlugInSandboxProfiles/com.apple.appstore.CodeRedeemerNetscapePlugin.sb: Added. * WebKit2.xcodeproj/project.pbxproj: Added the profile. 2014-05-29 Carlos Garcia Campos <cgarcia@igalia.com> [GTK] Add support for HiDPI icons https://bugs.webkit.org/show_bug.cgi?id=133377 Reviewed by Martin Robinson. * PlatformGTK.cmake: Compile also the @2x versions for the builtin icons. 2014-05-29 Owen Taylor <otaylor@redhat.com> [GTK] Add HighDPI support for non-accelerated compositing contents https://bugs.webkit.org/show_bug.cgi?id=131562 Reviewed by Anders Carlsson. * UIProcess/API/gtk/WebKitWebViewBase.cpp: (deviceScaleFactorChanged): Added this callback to pass scale changes to the page proxy. (webkitWebViewBaseCreateWebPage): Attach the callback to the notify signal. * UIProcess/WebPageProxy.cpp: * UIProcess/cairo/BackingStoreCairo.cpp: (WebKit::WebPageProxy::setCustomDeviceScaleFactor): Do not set a custom device scale factor for cairo when it's not supported. (WebKit::createBackingStoreForGTK): Pass the scale factor to the WebCore backing store. (WebKit::BackingStore::incorporateUpdate): Ditto. 2014-05-28 Carlos Garcia Campos <cgarcia@igalia.com> [GTK] Use GMainLoopSource for idle and timeout sources in WebKit2 https://bugs.webkit.org/show_bug.cgi?id=130081 Reviewed by Martin Robinson. * Platform/WorkQueue.h: * Platform/gtk/WorkQueueGtk.cpp: (WorkQueue::registerSocketEventHandler): Stop pretending it's possible to register a socket event handler for more than one descriptor. (WorkQueue::unregisterSocketEventHandler): (WorkQueue::dispatch): (WorkQueue::dispatchAfter): * Shared/Downloads/soup/DownloadSoup.cpp: (WebKit::DownloadClient::DownloadClient): (WebKit::DownloadClient::~DownloadClient): (WebKit::DownloadClient::didReceiveData): (WebKit::DownloadClient::handleResponse): (WebKit::DownloadClient::handleResponseLater): * UIProcess/Plugins/gtk/PluginInfoCache.cpp: (WebKit::PluginInfoCache::PluginInfoCache): (WebKit::PluginInfoCache::~PluginInfoCache): (WebKit::PluginInfoCache::saveToFile): (WebKit::PluginInfoCache::updatePluginInfo): * UIProcess/Plugins/gtk/PluginInfoCache.h: * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: (WebKit::LayerTreeHostGtk::LayerTreeHostGtk): (WebKit::LayerTreeHostGtk::layerFlushTimerFired): (WebKit::LayerTreeHostGtk::scheduleLayerFlush): (WebKit::LayerTreeHostGtk::cancelPendingLayerFlush): * WebProcess/WebPage/gtk/LayerTreeHostGtk.h: 2014-05-28 Gavin Barraclough <baraclough@apple.com> viewStateDidChange should always fully update ViewState https://bugs.webkit.org/show_bug.cgi?id=133159 Reviewed by Anders Carlson. Currently WebPageProxy::viewStateDidChange is passed a mask of bits to update. This has the following negative consequences: – WKWebView implicitly requires more detailed knowledge of the internal implementation of the PageClient. – Updates may unnecessarily be split over multiple IPC messages. – In order to support partial updates we make multiple virtual function calls to PageClient, which then makes duplicate objc calls. Better to just always update the entire ViewState. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView didMoveToWindow]): - removed argument to viewStateDidChange. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::viewState): (WebKit::PageClientImpl::isViewWindowActive): Deleted. (WebKit::PageClientImpl::isViewFocused): Deleted. (WebKit::PageClientImpl::isViewVisible): Deleted. (WebKit::PageClientImpl::isViewInWindow): Deleted. * UIProcess/API/gtk/PageClientImpl.h: - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState. * UIProcess/API/mac/WKView.mm: (-[WKView becomeFirstResponder]): (-[WKView resignFirstResponder]): (-[WKView viewDidMoveToWindow]): (-[WKView _windowDidBecomeKey:]): (-[WKView _windowDidResignKey:]): (-[WKView _windowDidMiniaturize:]): (-[WKView _windowDidDeminiaturize:]): (-[WKView _windowDidOrderOffScreen:]): (-[WKView _windowDidOrderOnScreen:]): (-[WKView _windowDidChangeOcclusionState:]): (-[WKView viewDidHide]): (-[WKView viewDidUnhide]): (-[WKView _activeSpaceDidChange:]): (-[WKView _setThumbnailView:]): (-[WKView endDeferringViewInWindowChanges]): (-[WKView endDeferringViewInWindowChangesSync]): - removed argument to viewStateDidChange. * UIProcess/CoordinatedGraphics/WebView.cpp: (WebKit::WebView::viewState): (WebKit::WebView::isViewWindowActive): Deleted. (WebKit::WebView::isViewFocused): Deleted. (WebKit::WebView::isViewVisible): Deleted. (WebKit::WebView::isViewInWindow): Deleted. * UIProcess/CoordinatedGraphics/WebView.h: - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState. * UIProcess/PageClient.h: (WebKit::PageClient::isViewVisibleOrOccluded): Deleted. (WebKit::PageClient::isVisuallyIdle): Deleted. - merged isViewVisibleOrOccluded/isVisuallyIdle to subclass viewState methods. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): (WebKit::WebPageProxy::reattachToWebProcess): - updateViewState -> PageClient::viewState (WebKit::WebPageProxy::viewStateDidChange): - argument removed; updateViewState -> PageClient::viewState. (WebKit::WebPageProxy::setCursor): - call isViewWindowActive on WebPageProxy, rather than PageClient. (WebKit::WebPageProxy::updateBackingStoreDiscardableState): - call isViewWindowActive on WebPageProxy, rather than PageClient. (WebKit::WebPageProxy::updateViewState): Deleted. - removed - viewState method moved to PageClient. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::isViewWindowActive): - added missing implementation. (WebKit::WebPageProxy::isViewVisible): - removed argument to viewStateDidChange. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::windowServerConnectionStateChanged): - removed argument to viewStateDidChange. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::viewState): (WebKit::PageClientImpl::isViewWindowActive): Deleted. (WebKit::PageClientImpl::isViewFocused): Deleted. (WebKit::PageClientImpl::isViewVisible): Deleted. (WebKit::PageClientImpl::isViewInWindow): Deleted. (WebKit::PageClientImpl::isViewVisibleOrOccluded): Deleted. (WebKit::PageClientImpl::isVisuallyIdle): Deleted. - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState. * UIProcess/ios/WKContentView.mm: (-[WKContentView didMoveToWindow]): (-[WKContentView _applicationDidEnterBackground:]): (-[WKContentView _applicationWillEnterForeground:]): - removed argument to viewStateDidChange. * UIProcess/mac/PageClientImpl.h: * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::viewState): (WebKit::PageClientImpl::showCorrectionPanel): (WebKit::PageClientImpl::showDictationAlternativeUI): (WebKit::PageClientImpl::isViewWindowActive): Deleted. (WebKit::PageClientImpl::isViewFocused): Deleted. (WebKit::PageClientImpl::isViewVisibleOrOccluded): Deleted. (WebKit::PageClientImpl::isVisuallyIdle): Deleted. - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState. 2014-05-28 Jeffrey Pfau <jpfau@apple.com> Add Obj-C API for cache partitioned URL schemes https://bugs.webkit.org/show_bug.cgi?id=133361 <rdar://problem/17035415> Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _initWithConfiguration:]): * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration cachePartitionedURLSchemes]): (-[_WKProcessPoolConfiguration setCachePartitionedURLSchemes:]): (-[_WKProcessPoolConfiguration copyWithZone:]): 2014-05-28 Sam Weinig <sam@webkit.org> [iOS WebKit2] Sometimes Safari gets into a limbo state after web process crash <rdar://problem/17029526> https://bugs.webkit.org/show_bug.cgi?id=133362 Reviewed by Dan Bernstein. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): Remove unnecessary initialization of a unique_ptr. (WebKit::WebPageProxy::reattachToWebProcess): Move calls to update the view state and activity tokens to after we have swapped in the new process. (WebKit::WebPageProxy::resetStateAfterProcessExited): Clear the activity token on process exit. 2014-05-28 Timothy Horton <timothy_horton@apple.com> Add WKWebView SPI to forcefully kill the associated Web process https://bugs.webkit.org/show_bug.cgi?id=133357 Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _killWebContentProcess]): * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2014-05-28 Dan Bernstein <mitz@apple.com> [Cocoa] Crash when trying to decode an instance of a class inheriting from WKObject https://bugs.webkit.org/show_bug.cgi?id=133355 Reviewed by Anders Carlsson. * Shared/Cocoa/WKObject.mm: (-[WKObject classForCoder]): Override this NSObject method to forward to the target object. (-[WKObject classForKeyedArchiver]): Ditto. 2014-05-28 Simon Fraser <simon.fraser@apple.com> [iOS WK2] Improve behavior of position:fixed inside accelerated overflow-scroll https://bugs.webkit.org/show_bug.cgi?id=133352 Reviewed by Tim Horton. Pass the correct delta down to descendant nodes. * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll): 2014-05-28 Andy Estes <aestes@apple.com> [iOS] REGRESSION (r168388): DidNotHandleTapAsClick not sent when commitPotentialTap() fails https://bugs.webkit.org/show_bug.cgi?id=133349 Reviewed by Benjamin Poulain. WebPage::commitPotentialTap() fails when a recognized single tap cannot be sent as a synthetic click event. We should send WebPageProxy::DidNotHandleTapAsClick in these cases. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::commitPotentialTap): (WebKit::WebPage::commitPotentialTapFailed): 2014-05-28 Commit Queue <commit-queue@webkit.org> Unreviewed, rolling out r169423. https://bugs.webkit.org/show_bug.cgi?id=133348 It makes a lot of tests crash in assert (Requested by KaL on #webkit). Reverted changeset: "[GTK] Use GMainLoopSource for idle and timeout sources in WebKit2" https://bugs.webkit.org/show_bug.cgi?id=130081 http://trac.webkit.org/changeset/169423 2014-05-28 Carlos Garcia Campos <cgarcia@igalia.com> [GTK] Use GMainLoopSource for idle and timeout sources in WebKit2 https://bugs.webkit.org/show_bug.cgi?id=130081 Reviewed by Martin Robinson. * Platform/WorkQueue.h: * Platform/gtk/WorkQueueGtk.cpp: (WorkQueue::registerSocketEventHandler): Stop pretending it's possible to register a socket event handler for more than one descriptor. (WorkQueue::unregisterSocketEventHandler): (WorkQueue::dispatch): (WorkQueue::dispatchAfter): * Shared/Downloads/soup/DownloadSoup.cpp: (WebKit::DownloadClient::DownloadClient): (WebKit::DownloadClient::~DownloadClient): (WebKit::DownloadClient::didReceiveData): (WebKit::DownloadClient::handleResponse): (WebKit::DownloadClient::handleResponseLater): * UIProcess/Plugins/gtk/PluginInfoCache.cpp: (WebKit::PluginInfoCache::PluginInfoCache): (WebKit::PluginInfoCache::~PluginInfoCache): (WebKit::PluginInfoCache::saveToFile): (WebKit::PluginInfoCache::updatePluginInfo): * UIProcess/Plugins/gtk/PluginInfoCache.h: * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: (WebKit::LayerTreeHostGtk::LayerTreeHostGtk): (WebKit::LayerTreeHostGtk::layerFlushTimerFired): (WebKit::LayerTreeHostGtk::scheduleLayerFlush): (WebKit::LayerTreeHostGtk::cancelPendingLayerFlush): * WebProcess/WebPage/gtk/LayerTreeHostGtk.h: 2014-05-28 Dan Bernstein <mitz@apple.com> [Cocoa] Can't use bundle-defined classes for bundle parameters https://bugs.webkit.org/show_bug.cgi?id=133339 Reviewed by Anders Carlsson. Ensure that bundle parameters are decoded only after the injected bundle is loaded. * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::create): Moved the definition from the header to here, added the lagacy initializationUserData as a parameter, and made this function set the sandbox extension and load the bundle. (WebKit::InjectedBundle::InjectedBundle): Removed call to platformInitialize. * WebProcess/InjectedBundle/InjectedBundle.h: (WebKit::InjectedBundle::setSandboxExtension): Deleted. * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm: (WebKit::InjectedBundle::initialize): Renamed the load function to this, and added the creation parameters as a parameter. Moved code to initialize the bundle paramters from platformInitialize to here. Changed the class passed to -decodeObjectOfClass:forKey: to NSObject, to allow arbitrary types in the values, and added an assertion that the top-level object is a dictionary. (WebKit::InjectedBundle::platformInitialize): Deleted. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): Changed to pass the legacy initialization user data to InjectedBundle::create() and removed code to separately set the sandbox extension and load the bundle, which is now done by create(). 2014-05-28 Alberto Garcia <berto@igalia.com> Unreviewed. Fix warning: unused parameter 'frame' * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didFinishDocumentLoad): 2014-05-27 Simon Fraser <simon.fraser@apple.com> [iOS WK2] Fix behavior of position:sticky inside accelerated overflow-scroll https://bugs.webkit.org/show_bug.cgi?id=133334 <rdar://problem/16462535> Reviewed by Tim Horton. When the scroll position changes in an accelerated overflow-scroll element, we have to update child nodes in the scrolling tree for position:sticky. That requires a more generic ability to update the scrolling tree after some arbitrary zoom or scroll. To do this, we need to know the current fixed position rect, rather than having it passed in. So make the fixed position rect available from ScrollingTree, and make it possible to get the current scrollPosition() from any ScrollingTreeScrollingNode. Also, implement updateLayersAfterDelegatedScroll() in ScrollingTreeOverflowScrollingNodeIOS, and have it update descendant layers. Finally, fix ScrollingTreeOverflowScrollingNode to use the correct rectangle for its constraints math, using the scroll position of the parent node if appropriate. * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: * UIProcess/Scrolling/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::fixedPositionRect): * UIProcess/Scrolling/RemoteScrollingTree.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterDelegatedScroll): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll): * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect): 2014-05-27 Simon Fraser <simon.fraser@apple.com> Do some renaming in the scrolling tree https://bugs.webkit.org/show_bug.cgi?id=133333 Reviewed by Tim Horton. Rename ScrollingTreeNode::parentScrollPositionDidChange() to updateLayersAfterAncestorChange() since this goes deep and to indicate that it's about layer updating. Also rename the "viewportRect" parameter to "fixedPositionRect", since on iOS this is the custom fixed-position rect that changes on zooming. * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling): * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterViewportChange): 2014-05-27 Geoffrey Garen <ggaren@apple.com> Some proof-reading of the WebKit2 API headerdoc https://bugs.webkit.org/show_bug.cgi?id=133328 Reviewed by Anders Carlsson. Consistently say "item" to reference back-forward list items. Consistently say "webpage" instead of "page" or "web page". Consistently say "navigation" instead of "load". Plus a few fix-ups for run-on sentences, mismatched verb tense, and mismatched singular vs plural. * UIProcess/API/Cocoa/WKBackForwardList.h: * UIProcess/API/Cocoa/WKBackForwardListItem.h: * UIProcess/API/Cocoa/WKBrowsingContextController.h: * UIProcess/API/Cocoa/WKBrowsingContextGroup.h: * UIProcess/API/Cocoa/WKFrameInfo.h: * UIProcess/API/Cocoa/WKNavigation.h: * UIProcess/API/Cocoa/WKNavigationAction.h: * UIProcess/API/Cocoa/WKNavigationDelegate.h: * UIProcess/API/Cocoa/WKProcessPool.h: * UIProcess/API/Cocoa/WKUIDelegate.h: * UIProcess/API/Cocoa/WKWebView.h: 2014-05-27 Timothy Horton <timothy_horton@apple.com> [wk2] PDFPlugin snapshots are misplaced https://bugs.webkit.org/show_bug.cgi?id=133323 Reviewed by Simon Fraser. * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::paintControlForLayerInContext): (WebKit::PDFPlugin::snapshot): Include the scroll offset in the snapshot translation, and use the whole document size instead of just the view size. 2014-05-27 Sam Weinig <sam@webkit.org> [WebKit2] Move WebPreferences macro definitions and key names into their own files https://bugs.webkit.org/show_bug.cgi?id=133315 Reviewed by Anders Carlsson. * CMakeLists.txt: * Shared/WebPreferencesDefinitions.h: Copied from Source/WebKit2/Shared/WebPreferencesStore.h. * Shared/WebPreferencesKeys.cpp: Copied from Source/WebKit2/Shared/WebPreferencesStore.cpp. * Shared/WebPreferencesKeys.h: Copied from Source/WebKit2/Shared/WebPreferencesStore.h. * Shared/WebPreferencesStore.cpp: * Shared/WebPreferencesStore.h: * UIProcess/WebPreferences.cpp: * UIProcess/WebPreferences.h: * UIProcess/mac/WebContextMac.mm: * UIProcess/mac/WebPreferencesMac.mm: * UIProcess/mac/WebProcessProxyMac.mm: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/WebCoreSupport/WebChromeClient.cpp: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebProcess.cpp: 2014-05-27 Gavin Barraclough <baraclough@apple.com> Add UI process watchdog on iOS to ensure WebProcess connections close https://bugs.webkit.org/show_bug.cgi?id=133200 <rdar://problem/16997983> Mountain Lion build fix * Platform/IPC/mac/ConnectionMac.mm: (IPC::ConnectionTerminationWatchdog::watchdogTimerFired): 2014-05-27 Gavin Barraclough <baraclough@apple.com> importance_assertion -> denap_assertion https://bugs.webkit.org/show_bug.cgi?id=133294 iOS build fix * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::open): 2014-05-27 Gavin Barraclough <baraclough@apple.com> Add UI process watchdog on iOS to ensure WebProcess connections close https://bugs.webkit.org/show_bug.cgi?id=133200 <rdar://problem/16997983> Reviewed by Darin Adler. When the WebProcessProxy wants to disconnect from a WebContent process it just drops the connection, and hopes the connection closes. There is a watchdog thread in the ChildProcess to try to ensure this happens. On iOS the process may not be runnable at the time, preventing termination. Instead add a watchdog in the UI process to make the process runnable, and to terminate if it doesn't quit in a timely fashion. * Platform/IPC/Connection.h: - added terminateSoon. * Platform/IPC/mac/ConnectionMac.mm: (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog): - take an assertion to make the process runnable, and start a watchdog timer. (IPC::ConnectionTerminationWatchdog::watchdogTimerFired): - if the process hasn't quit by the timer the watchdog fires, kill it. (IPC::Connection::terminateSoon): - create a ConnectionTerminationWatchdog. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::removeWebPage): - when disconnecting from a process, first tell it to terminateSoon. 2014-05-26 Gavin Barraclough <barraclough@apple.com> importance_assertion -> denap_assertion https://bugs.webkit.org/show_bug.cgi?id=133294 Reviewed by Sam Weinig. Update in accordance with API change. The importance assertion is used on Mavericks & newer to ensure the WebContent process wakes from AppNap. * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::open): - MACH_PORT_IMPORTANCE_RECEIVER -> MACH_PORT_DENAP_RECEIVER * Platform/IPC/mac/ImportanceAssertion.h: (IPC::ImportanceAssertion::ImportanceAssertion): (IPC::ImportanceAssertion::~ImportanceAssertion): - proc_importance_assertion -> proc_denap_assertion 2014-05-27 Jessie Berlin <jberlin@apple.com> Revert r169362 since it broke the ML build. * Platform/IPC/Connection.h: * Platform/IPC/mac/ConnectionMac.mm: (IPC::ConnectionTerminationWatchdog::createConnectionTerminationWatchdog): Deleted. (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog): Deleted. (IPC::ConnectionTerminationWatchdog::watchdogTimerFired): Deleted. (IPC::Connection::terminateSoon): Deleted. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::removeWebPage): 2014-05-27 Jon Lee <jonlee@apple.com> Update ENABLE(MEDIA_SOURCE) on Mac https://bugs.webkit.org/show_bug.cgi?id=133141 Reviewed by Darin Adler. * Configurations/FeatureDefines.xcconfig: 2014-05-27 Tibor Meszaros <tmeszaros.u-szeged@partner.samsung.com> Remove BLOB guards https://bugs.webkit.org/show_bug.cgi?id=132863 Reviewed by Csaba Osztrogonác. * Configurations/FeatureDefines.xcconfig: * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: * NetworkProcess/FileAPI/NetworkBlobRegistry.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::didClose): (WebKit::NetworkConnectionToWebProcess::blobSize): * NetworkProcess/NetworkConnectionToWebProcess.h: * NetworkProcess/NetworkConnectionToWebProcess.messages.in: * NetworkProcess/NetworkProcessPlatformStrategies.cpp: * NetworkProcess/NetworkProcessPlatformStrategies.h: * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::NetworkResourceLoader): * WebProcess/FileAPI/BlobRegistryProxy.cpp: * WebProcess/FileAPI/BlobRegistryProxy.h: * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: * WebProcess/WebCoreSupport/WebPlatformStrategies.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::canHandleRequest): 2014-05-26 Tim Horton <timothy_horton@apple.com> [wk2] RemoteLayerBackingStore front buffers should be purgeable when unparented https://bugs.webkit.org/show_bug.cgi?id=133020 <rdar://problem/16521736> Reviewed by Simon Fraser. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::display): Let the context know whenever a RemoteLayerBackingStore is displayed, so that RemoteLayerBackingStoreCollection can (if needed) note that the backing store is active once again (because we only display parented backing store). (WebKit::RemoteLayerBackingStore::setBufferVolatility): Ensure that we never have live contexts attached to any buffers when marking them volatile, because checking isInUse() with live contexts is futile. * Shared/mac/RemoteLayerBackingStoreCollection.h: * Shared/mac/RemoteLayerBackingStoreCollection.mm: (WebKit::RemoteLayerBackingStoreCollection::RemoteLayerBackingStoreCollection): (WebKit::RemoteLayerBackingStoreCollection::willFlushLayers): (WebKit::RemoteLayerBackingStoreCollection::willCommitLayerTree): (WebKit::RemoteLayerBackingStoreCollection::didFlushLayers): (WebKit::RemoteLayerBackingStoreCollection::backingStoreWillBeDestroyed): (WebKit::RemoteLayerBackingStoreCollection::backingStoreWillBeDisplayed): (WebKit::RemoteLayerBackingStoreCollection::markBackingStoreVolatileImmediately): (WebKit::RemoteLayerBackingStoreCollection::markBackingStoreVolatile): (WebKit::RemoteLayerBackingStoreCollection::backingStoreBecameUnreachable): (WebKit::RemoteLayerBackingStoreCollection::volatilityTimerFired): (WebKit::RemoteLayerBackingStoreCollection::scheduleVolatilityTimer): (WebKit::RemoteLayerBackingStoreCollection::purgeabilityTimerFired): Deleted. (WebKit::RemoteLayerBackingStoreCollection::schedulePurgeabilityTimer): Deleted. Rename purgeable->volatile for accuracy. Keep track of two sets of backing store: those which are active/parented, and those which are not. Backing store is moved to the inactive set after building the transaction in which its owning layer is unparented. When backing store is unparented, try to mark it volatile immediately. Also, mark the backing store property as dirty on the owning layer so that when said layer is reparented, we encode the backing store in the commit that reparents it, as the UI process will throw away its reference to the backing store when the layer is unparented. Mark the front buffers of unparented layers as volatile, in addition to the others. * Shared/mac/RemoteLayerTreeTransaction.h: (WebKit::RemoteLayerTreeTransaction::layerIDsWithNewlyUnreachableBackingStore): * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTransaction::encode): (WebKit::RemoteLayerTreeTransaction::decode): (WebKit::RemoteLayerTreeTransaction::setLayerIDsWithNewlyUnreachableBackingStore): Include the list of layers (by ID) with backing store which just became unreachable in the transaction. * UIProcess/mac/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::updateLayerTree): Clear the contents of layers which now have unreachable backing store. Otherwise, the UI process would hold a 'use' on the IOSurface, and prevent the Web process from marking it volatile. * WebProcess/WebPage/mac/RemoteLayerTreeContext.h: * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm: (WebKit::RemoteLayerTreeContext::backingStoreWillBeDisplayed): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::flushLayers): Give RemoteLayerBackingStoreCollection a shot at the RemoteLayerTreeTransaction, so that it can fill in layerIDsWithNewlyUnreachableBackingStore. Also, let it know when the flush begins and ends, so that it can keep track of which layers were reached in the flush. 2014-05-26 Shivakumar JM <shiva.jm@samsung.com> [EFL][WK2] Fix EWK2BackForwardListTest test fails. https://bugs.webkit.org/show_bug.cgi?id=133171 Reviewed by Gyuyoung Kim. Use local test html pages instead of EWK2UnitTestServer, call ewk_view_url_set() to load test html pages. Since even after setting no_proxy="localhost,127.0.0.1", still test server was unable to load the test html pages for ewk2_back_forward_list tests, so changed to use local html pages. * UIProcess/API/efl/tests/test_ewk2_back_forward_list.cpp: (TEST_F): 2014-05-26 Shivakumar JM <shiva.jm@samsung.com> [EFL][WK2] Fix code style check errors in EFL API tests. https://bugs.webkit.org/show_bug.cgi?id=133170 Reviewed by Gyuyoung Kim. Omit int when using unsigned modifier, as per coding style rules. * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp: (EWK2UnitTest::EWK2UnitTestBase::SetUp): * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.h: (EWK2UnitTest::EWK2UnitTestEnvironment::defaultWidth): (EWK2UnitTest::EWK2UnitTestEnvironment::defaultHeight): 2014-05-22 Gavin Barraclough <baraclough@apple.com> Add UI process watchdog on iOS to ensure WebProcess connections close https://bugs.webkit.org/show_bug.cgi?id=133200 <rdar://problem/16997983> Reviewed by Darin Adler. When the WebProcessProxy wants to disconnect from a WebContent process it just drops the connection, and hopes the connection closes. There is a watchdog thread in the ChildProcess to try to ensure this happens. On iOS the process may not be runnable at the time, preventing termination. Instead add a watchdog in the UI process to make the process runnable, and to terminate if it doesn't quit in a timely fashion. * Platform/IPC/Connection.h: - added terminateSoon. * Platform/IPC/mac/ConnectionMac.mm: (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog): - take an assertion to make the process runnable, and start a watchdog timer. (IPC::ConnectionTerminationWatchdog::watchdogTimerFired): - if the process hasn't quit by the timer the watchdog fires, kill it. (IPC::Connection::terminateSoon): - create a ConnectionTerminationWatchdog. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::removeWebPage): - when disconnecting from a process, first tell it to terminateSoon. 2014-05-26 Sam Weinig <sam@webkit.org> [WebKit2] Add better default preferences while keeping backward compatibility for the C-SPI https://bugs.webkit.org/show_bug.cgi?id=133289 Reviewed by Anders Carlsson. * Shared/WebPreferencesStore.h: Change a few defaults: - PluginsEnabled -> false - JavaEnabled -> false - JavaEnabledForLocalFiles -> false - StorageBlockingPolicy -> BlockThirdPartyStorage * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesCreate): (WKPreferencesCreateWithIdentifier): * UIProcess/WebPageGroup.cpp: (WebKit::WebPageGroup::WebPageGroup): Switch to using WebPreferences::createWithLegacyDefaults(). * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::create): (WebKit::WebPreferences::createWithLegacyDefaults): * UIProcess/WebPreferences.h: Move create functions to the cpp file and add createWithLegacyDefaults() which keeps the old defaults; * UIProcess/API/C/WKPreferencesRef.h: Fix the comment. * UIProcess/API/Cocoa/WKPreferences.h: Update the comment to reflect the new defaults. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): Unconditionally set setShouldDispatchJavaScriptWindowOnErrorEvents() to true. This setting only exists for legacy WebKit. 2014-05-26 Dan Bernstein <mitz@apple.com> [Cocoa] Rewrite WK_DESIGNATED_INITIALIZER in installed headers https://bugs.webkit.org/show_bug.cgi?id=133290 Reviewed by Anders Carlsson. * Shared/API/Cocoa/WKFoundation.h: When WK_API_AVAILABILITY_ENABLED is defined, don’t provide definitions of WK_DESIGNATED_INITIALIZER and WK_UNAVAILABLE, since those macros will be rewritten out of the headers. When WK_API_AVAILABILITY_ENABLED isn’t defined, provide definitions of the other two macros as appropriate for the target OS. * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: Removed WK_DESIGNATED_INITIALIZER from a category method declaration. * UIProcess/API/Cocoa/WKWebView.h: Mark the superclass designated initializer -initWithCoder: as unavailable. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithCoder:]): Override this designated initializer of the superclass by returning nil. * mac/rewrite-availability-macros.sh: Rewrite WK_DESIGNATED_INITIALIZER to NS_DESIGNATED_INITIALIZER and WK_UNAVAILABLE to NS_UNAVAILABLE. Also make sure to process all headers if the script has changed since the last time it was run. 2014-05-26 Commit Queue <commit-queue@webkit.org> Unreviewed, rolling out r169122. https://bugs.webkit.org/show_bug.cgi?id=133288 Broke CJK font fallback (Requested by ap on #webkit). Reverted changeset: "[Mac] WebProcess doesn't follow localization of UI process when run as a service" https://bugs.webkit.org/show_bug.cgi?id=133126 http://trac.webkit.org/changeset/169122 2014-05-26 Anders Carlsson <andersca@apple.com> Convert a couple of loops over to range-based for https://bugs.webkit.org/show_bug.cgi?id=133287 Reviewed by Simon Fraser. * UIProcess/Plugins/PluginInfoStore.cpp: (WebKit::PluginInfoStore::findPluginForMIMEType): (WebKit::PluginInfoStore::findPluginForExtension): (WebKit::PluginInfoStore::infoForPluginWithPath): * UIProcess/Plugins/mac/PluginProcessManagerMac.mm: (WebKit::PluginProcessManager::setProcessSuppressionEnabled): 2014-05-26 Carlos Garcia Campos <cgarcia@igalia.com> [GTK] WebProcess leaked when closing pages with network process enabled https://bugs.webkit.org/show_bug.cgi?id=129684 Reviewed by Anders Carlsson. The problem is that the web process is not notified when the UI process closes the connection, because when close() is called on the socket by the UI process, the socket is shared by another web process launched later, preventing the connection from being shut down. We need to set the CLOEXEC flag on the sockets file descriptor to make sure they are not exposed to other processes. * Platform/IPC/Connection.h: Add ConnectionOptions parameter to createPlatformConnection() with a default value compatible with existing callers. * Platform/IPC/unix/ConnectionUnix.cpp: (IPC::Connection::createPlatformConnection): Set the CLOEXEC flag on the client and server socket file descriptors depending on the options passed. * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp: (WebKit::ProcessLauncher::launchProcess): Use IPC::Connection::createPlatformConnection() instead of socketpair() directly, setting the CLOEXEC flag on the server before spawning the new process and on the client right after spawning the new process. 2014-05-25 Anders Carlsson <andersca@apple.com> Initialize WKWebViewConfiguration ivars lazily https://bugs.webkit.org/show_bug.cgi?id=133270 <rdar://problem/17027606> Reviewed by Sam Weinig. Create a LazyInitialized class template and use it to lazily initialize WKWebViewConfiguration properties. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (LazyInitialized::get): Initialize m_value with the given function if it hasn't been initialized already. (LazyInitialized::set): Update m_value and set m_isInitialized to true. (LazyInitialized::peek): Return m_value without initializing it. (-[WKWebViewConfiguration description]): Use getters so we'll initialize variables if needed. (-[WKWebViewConfiguration copyWithZone:]): Ditto. (-[WKWebViewConfiguration processPool]): (-[WKWebViewConfiguration setProcessPool:]): (-[WKWebViewConfiguration preferences]): (-[WKWebViewConfiguration setPreferences:]): (-[WKWebViewConfiguration userContentController]): (-[WKWebViewConfiguration setUserContentController:]): (-[WKWebViewConfiguration _visitedLinkProvider]): (-[WKWebViewConfiguration _setVisitedLinkProvider:]): (-[WKWebViewConfiguration _websiteDataStore]): (-[WKWebViewConfiguration _setWebsiteDataStore:]): (-[WKWebViewConfiguration _contentProviderRegistry]): (-[WKWebViewConfiguration _setContentProviderRegistry:]): Pass initialization code to all getters. (-[WKWebViewConfiguration _validate]): Use getters. (-[WKWebViewConfiguration init]): Deleted. 2014-05-26 Martin Hodovan <mhodovan.u-szeged@partner.samsung.com> Remove WebKit2 framework from generate-forwarding-headers.pl https://bugs.webkit.org/show_bug.cgi?id=133214 Since renaming WebKit2.framework to WebKit.framework is done and all WebKit2/*.h includes were renamed to WebKit/*.h, generating forwarding headers for WebKit2/*.h framework style headers is not necessary anymore. Reviewed by Darin Adler. * Scripts/generate-forwarding-headers.pl: 2014-05-26 Zan Dobersek <zdobersek@igalia.com> WebPage::setComposition(), WebPageProxy::didFindStringMatches() should take Vector parameters by const reference https://bugs.webkit.org/show_bug.cgi?id=133264 Reviewed by Darin Adler. Taking the Vector parameters in the two methods (invoked through the IPC message handling) by value causes unnecessary copies. The methods don't modify the objects and don't want or need fresh copies, hence they should take in const references to Vector objects. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didFindStringMatches): * UIProcess/WebPageProxy.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setComposition): * WebProcess/WebPage/WebPage.h: 2014-05-25 Benjamin Poulain <benjamin@webkit.org> [iOS][WK2] Fix some state reset on crash on the WKWebView https://bugs.webkit.org/show_bug.cgi?id=133039 Reviewed by Sam Weinig. This is in no way complete, but this should reduce the undefined states on crash. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _processDidExit]): If the view is animating, nuke the resize animation. That should be invisible to the user because the background color is reset to white below. Reset the contentView frame and scrollview state. Reset the runtime states. We do not strictly need to reset _needsResetViewStateAfterCommitLoadForMainFrame, _delayUpdateVisibleContentRects and _hadDelayedUpdateVisibleContentRects but it seems better to have a clean slate. (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _endAnimatedResize]): We could have crashes during rotation. To simplify the reset code, the animated resize code no longer change any state when WKWebView is using a custom content view. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::processDidExit): Send a _processDidExit on the WKWebView too. 2014-05-25 Anders Carlsson <andersca@apple.com> Use the right paths for website data https://bugs.webkit.org/show_bug.cgi?id=133267 <rdar://problem/17027698> Reviewed by Sam Weinig. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _initWithConfiguration:]): Get the path of the absolute URL. * UIProcess/Storage/LocalStorageDatabaseTracker.cpp: (WebKit::LocalStorageDatabaseTracker::databasePath): Fix spelling error. * WebProcess/Network/NetworkProcessConnection.cpp: (WebKit::NetworkProcessConnection::didCacheResource): Ditto. 2014-05-25 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] Use ScrollView's scrollOffset as the unobscuredContentRect https://bugs.webkit.org/show_bug.cgi?id=133262 Reviewed by Simon Fraser. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): (WebKit::WebPage::viewportConfigurationChanged): (WebKit::WebPage::updateVisibleContentRects): 2014-05-25 Sam Weinig <sam@webkit.org> Build fix 2. * UIProcess/API/Cocoa/WKPreferences.h: 2014-05-25 Sam Weinig <sam@webkit.org> Fix build. * UIProcess/API/Cocoa/WKPreferences.h: 2014-05-24 Sam Weinig <sam@webkit.org> [WebKit2] Rework WebPreferencesStore to allow easier overriding of defaults https://bugs.webkit.org/show_bug.cgi?id=133258 Reviewed by Anders Carlsson. To support changing default values of preferences based on which API you are using (either the legacy C-SPI or the Objective-C API), overhaul the WebPreferencesStore to use a single HashMap of String -> Value (where Value is new type that can be a String, bool, uint32_t or double) instead of four HashMaps. This allows us to use two of these new HashMaps, one for the actual set values, and one for overridden defaults. This new Value class will also allow easier incremental updating of preferences in the future. Other notable changes: - Removed Float kind of preferences. There were none. - Move StorageBlockingPolicy preference to the correct group, it's a uint32_t, not bool. * Shared/WebPreferencesStore.cpp: * Shared/WebPreferencesStore.h: 2014-05-25 David Kilzer <ddkilzer@apple.com> Add type-checked casts for TransformOperations <http://webkit.org/b/133217> Reviewed by Simon Fraser. * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: (IPC::ArgumentCoder<TransformOperations>::encode): - Switch to type-checked casts. 2014-05-25 David Kilzer <ddkilzer@apple.com> Use type-checking FilterOperation casts in CoordinatedGraphicsArgumentCoders.cpp <http://webkit.org/b/133203> Reviewed by Simon Fraser. * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: (IPC::ArgumentCoder<WebCore::FilterOperations>::encode): - Replace static_cast<>() operators with type-checking FilterOperation casts. - Replace 'default' statement with 'case' statements so new filters added later require an explicit decision to be made. (IPC::ArgumentCoder<WebCore::FilterOperations>::decode): - Replace 'default' statement with 'case' statements so new filters added later require an explicit decision to be made. 2014-05-24 Jon Honeycutt <jhoneycutt@apple.com> Potential null dereference in WebFrameLoaderClient::dispatchDidFailProvisionalLoad() <https://bugs.webkit.org/show_bug.cgi?id=133193> WebFrameLoaderClient::dispatchDidFailProvisionalLoad() calls the InjectedBundleLoaderClient's didFailProvisionalLoadWithErrorForFrame() before sending a message to the UI process that a provisional load has failed. It's possible for the provisional document loader to become null while calling into the InjectedBundleLoaderClient (as is the case with the WebKitTestRunner's injected bundle), leading to a null dereference when trying to send the DidFailProvisionalLoadForFrame message. Reviewed by Darin Adler. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad): Get the navigation ID before calling into the injected bundle. 2014-05-23 Simon Fraser <simon.fraser@apple.com> Rename ScrollingTreeScrollingNode's m_scrollPosition to make it clear that it's the value committed from the state tree https://bugs.webkit.org/show_bug.cgi?id=133254 Reviewed by Tim Horton. Override scrollPosition() on ScrollingTreeOverflowScrollingNodeIOS. * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h: * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollPosition): 2014-05-24 Chris Fleizach <cfleizach@apple.com> AX: fix coordinate mapping for iOS accessibility https://bugs.webkit.org/show_bug.cgi?id=133188 Reviewed by Sam Weinig. Add in accessibility conversion methods that will check if the methods are present (if accessibility is not on, they won't be) and use those to convert points into the right coordinate space that VoiceOver is expecting. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::accessibilityScreenToRootView): (WebKit::WebPageProxy::rootViewToAccessibilityScreen): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::accessibilityScreenToRootView): (WebKit::PageClientImpl::rootViewToAccessibilityScreen): * UIProcess/mac/PageClientImpl.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::accessibilityScreenToRootView): (WebKit::WebChromeClient::rootViewToAccessibilityScreen): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm: (-[WKAccessibilityWebPageObject accessibilityHitTest:]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::accessibilityScreenToRootView): (WebKit::WebPage::rootViewToAccessibilityScreen): * WebProcess/WebPage/WebPage.h: 2014-05-24 Carlos Garcia Campos <cgarcia@igalia.com> REGRESSION(r165841): Messages sent before the child process is launched are never sent after r165841 https://bugs.webkit.org/show_bug.cgi?id=131675 Reviewed by Anders Carlsson. Since r165841 the connection is opened after the pending messages are sent, because connectionWillOpen might send messages that we want to happen after the ones already pending. The problem is that Connection::canSendOutgoingMessages() returns false when connection hasn't been opened. We should ensure no messages are sent by connectionWillOpen. * Shared/ChildProcessProxy.cpp: (WebKit::ChildProcessProxy::didFinishLaunching): Open the connection before sending pending messages. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::connectionWillOpen): Do not call VisitedLinkProvider::addProcess() here because it tries to send a message to the web process, but the connection hasn't be opened yet. (WebKit::WebPageProxy::processDidFinishLaunching): Call VisitedLinkProvider::addProcess() here instead. * UIProcess/WebPageProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::didFinishLaunching): Call WebPageProxy::processDidFinishLaunching() for every web page. 2014-05-23 Ian Henderson <ianh@apple.com> REGRESSION: Rubberbanding out jumps to top left corner on google.com https://bugs.webkit.org/show_bug.cgi?id=133253 <rdar://problem/17025664> Reviewed by Benjamin Poulain. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Avoid deceleration during zooming to work around a UIKit bug. 2014-05-23 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] Avoid updating the view from the viewport configuration unnecessarily https://bugs.webkit.org/show_bug.cgi?id=133255 <rdar://problem/16890926> Reviewed by Simon Fraser. All the updates were mostly harmless since they are pretty cheap, but they can be very annoying for debugging. This patch skips viewportUpdates in the trivial cases. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setMinimumLayoutSizeOverride:]): (-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::mainFrameDidLayout): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::viewportPropertiesDidChange): 2014-05-23 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] The page scale factor randomly resets to initial scale when editing https://bugs.webkit.org/show_bug.cgi?id=133244 Reviewed by Enrica Casucci. We were never telling the WebProcess that zoom is used triggered. As a result, the ViewportConfiguration was free to reset the scale whenever it felt like it. The fix is to call willStartUserTriggeredZoom before changing the scale. This patch also split _willStartUserTriggeredScrollingOrZooming from willStartUserTriggeredZoom and rename it to willStartPanOrPinchGesture. This is just a tiny cleanup since the only thing left in _willStartUserTriggeredScrollingOrZooming was gesture related. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _zoomToFocusRect:WebCore::selectionRect:WebCore::fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): (-[WKWebView scrollViewWillBeginZooming:withView:]): (-[WKWebView scrollViewWillBeginDragging:]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/ios/WKViewIOS.mm: (-[WKView scrollViewWillBeginDragging:]): * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView willStartUserTriggeredZoom]): (-[WKContentView willStartUserTriggeredScroll]): Deleted. * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView willStartPanOrPinchGesture]): (-[WKContentView _willStartUserTriggeredScrollingOrZooming]): Deleted. 2014-05-23 Tim Horton <timothy_horton@apple.com> REGRESSION (iOS WebKit2): requestAnimationFrame fires more than once between layer tree commits https://bugs.webkit.org/show_bug.cgi?id=132794 <rdar://problem/16877909> Reviewed by Simon Fraser. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::createDisplayRefreshMonitor): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::graphicsLayerFactory): (WebKit::DrawingArea::createDisplayRefreshMonitor): Plumb the DisplayRefreshMonitor request through to the DrawingArea. RemoteLayerTreeDrawingArea will implement and return a RemoteLayerTreeDisplayRefreshMonitor. * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.h: Added. (WebKit::RemoteLayerTreeDisplayRefreshMonitor::create): * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.mm: Added. (WebKit::RemoteLayerTreeDisplayRefreshMonitor::RemoteLayerTreeDisplayRefreshMonitor): (WebKit::RemoteLayerTreeDisplayRefreshMonitor::~RemoteLayerTreeDisplayRefreshMonitor): (WebKit::RemoteLayerTreeDisplayRefreshMonitor::requestRefreshCallback): When requesting a display refresh callback, schedule a layer commit. It may end up being empty, but will still call us back with a didUpdate, upon which we'll fire the callback. (WebKit::RemoteLayerTreeDisplayRefreshMonitor::didUpdateLayers): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::createDisplayRefreshMonitor): (WebKit::RemoteLayerTreeDrawingArea::willDestroyDisplayRefreshMonitor): Keep track of the set of DisplayRefreshMonitors. (WebKit::RemoteLayerTreeDrawingArea::didUpdate): Fire requestAnimationFrame callbacks once the UI process commits the new layer tree. 2014-05-23 Jeremy Jones <jeremyj@apple.com> Hide fullscreen immediately when switching tabs. https://bugs.webkit.org/show_bug.cgi?id=133239 Reviewed by Eric Carlson. Renamed a function to better describe it's new functionality. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::viewStateDidChange): now calls: requestHideAndExitFullscreen 2014-05-23 Enrica Casucci <enrica@apple.com> REGRESSION (WebKit2): Keyboard disappears/appears automatically between text boxes. https://bugs.webkit.org/show_bug.cgi?id=133243 <rdar://problem/16761913> Reviewed by Benjamin Poulain. We need to ensure that when an element loses focus and another one gets it, this is handled in one single message in the UI process to avoid seeing the keyboard animating in and out. This is accomplished by always postponing the blur notification until all events have been processed. If a new node is focused before the delayed blur notification is sent to the UI process, the message we send includes both blur and focus notification. In this case, the postponed blur notification is not sent. * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::startAssistingNode): * UIProcess/ios/WKContentViewInteraction.h: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): (-[WKContentView _startAssistingNode:userIsInteracting:userObject:]): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::startAssistingNode): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::elementDidFocus): (WebKit::WebPage::elementDidBlur): 2014-05-23 Anders Carlsson <andersca@apple.com> Remove an assertion. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadRequest): 2014-05-23 Tim Horton <timothy_horton@apple.com> [iOS] WKPDFView should have a page indicator https://bugs.webkit.org/show_bug.cgi?id=133109 <rdar://problem/16383003> Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setHasCustomContentView:loadedMIMEType:WTF::]): (-[WKWebView _setObscuredInsets:]): Forward obscured insets changes to the custom content view. (-[WKWebView _updateScrollViewBackground]): If we have a custom content view, use its background instead of the (likely nonexistent) page's when updaing the scroll view's background color. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/Cocoa/WKWebViewContentProvider.h: * UIProcess/Cocoa/WKWebViewContentProviderDelegate.h: Added. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setInsetForOverlaidAccessoryViews:]): Add SPI for clients to inform us about potential overlaid accessory views which should be taken into account e.g. for positioning the page indicator. Add a view that sits fixed on top of the WKWebView, ignores interaction, but provides the WKWebViewContentProvider a place to install views that don't scroll along with the content. * UIProcess/ios/WKPDFPageNumberIndicator.h: Added. * UIProcess/ios/WKPDFPageNumberIndicator.mm: Added. (-[WKPDFPageNumberIndicator initWithFrame:]): (-[WKPDFPageNumberIndicator dealloc]): (-[WKPDFPageNumberIndicator setCurrentPageNumber:]): (-[WKPDFPageNumberIndicator setPageCount:]): (-[WKPDFPageNumberIndicator show]): (-[WKPDFPageNumberIndicator hide:]): (-[WKPDFPageNumberIndicator moveToPoint:animated:]): (-[WKPDFPageNumberIndicator sizeThatFits:]): (-[WKPDFPageNumberIndicator _updateLabel]): (-[WKPDFPageNumberIndicator _makeRoundedCorners]): Add a page number indicator. * UIProcess/ios/WKPDFView.mm: (-[WKPDFView dealloc]): (-[WKPDFView web_setScrollView:]): (-[WKPDFView _revalidateViews]): (-[WKPDFView _offsetForPageNumberIndicator]): (-[WKPDFView _updatePageNumberIndicator]): (-[WKPDFView web_setObscuredInsets:]): (-[WKPDFView web_setInsetForOverlaidAccessoryViews:]): (-[WKPDFView web_setFixedOverlayView:]): (-[WKPDFView _computePageAndDocumentFrames]): Update the page number indicator when the topmost visible page changes. Move the page number indicator around when the obscured insets change. * WebKit2.xcodeproj/project.pbxproj: 2014-05-23 Anders Carlsson <andersca@apple.com> Fix test failures on the bot. * UIProcess/API/Cocoa/WKProcessPool.mm: (websiteDataDirectoryURL): If we have no bundle identifier, use the process name. 2014-05-23 Enrica Casucci <enrica@apple.com> REGRESSION (iOS WebKit2): Autocorrection is not accurate when changing selection. https://bugs.webkit.org/show_bug.cgi?id=133237 <rdar://problem/16655776> Reviewed by Ryosuke Niwa. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView beginSelectionChange]): (-[WKContentView endSelectionChange]): When the selection is changed with a gesture in an editable element, we must notify the keyboard to make sure the autocorrection engine updates its typing context. WKContentView must implement beginSelectionChange and endSelectionChange to call into the keyboard layer. 2014-05-22 Brent Fulgham <bfulgham@apple.com> [iOS] WK2: Provide implementation for windowFrame https://bugs.webkit.org/show_bug.cgi?id=133205 <rdar://problem/16894890> Reviewed by Benjamin Poulain. * UIProcess/Cocoa/UIDelegate.h: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::windowFrame): Added. * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::convertToUserSpace): Added. 2014-05-20 Anders Carlsson <andersca@apple.com> Use a per app directory structure for website data https://bugs.webkit.org/show_bug.cgi?id=133125 <rdar://problem/16830143> Reviewed by Dan Bernstein, Sam Weinig and Tim Horton. Put website data in subdirectories of ~/Library/WebKit/<bundle ID>/WebsiteData. We use "LocalStorage", "WebSQL", and "IndexedDB" subdirectories. * UIProcess/API/Cocoa/WKProcessPool.mm: (websiteDataDirectoryURL): (-[WKProcessPool _initWithConfiguration:]): 2014-05-23 Dan Bernstein <mitz@apple.com> [Cocoa] WKNavigationResponsePrivate.h is internal https://bugs.webkit.org/show_bug.cgi?id=133218 Reviewed by Dean Jackson. * WebKit2.xcodeproj/project.pbxproj: Promote WKNavigationResponsePrivate.h to private. 2014-05-23 Carlos Garcia Campos <cgarcia@igalia.com> [UNIX] Reorganize and cleanup main functions of GTK and EFL ports https://bugs.webkit.org/show_bug.cgi?id=131024 Reviewed by Gustavo Noronha Silva. Move main function implementation files to <process-dir>/EntryPoint/unix/<ProcessName>Main.cpp files that are now shared by GTK and EFL ports. These files call a main method that wraps a new method ChildProcessMain that contains the common code and uses a helper class for the platform specific code. GTK+ and EFL ports implement that helper class for every process type. * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp: Renamed from Source/WebKit2/efl/MainEfl.cpp. (main): * NetworkProcess/efl/NetworkProcessMainEfl.cpp: Renamed from Source/WebKit2/unix/NetworkMainUnix.cpp. (WebKit::NetworkProcessMainUnix): * NetworkProcess/gtk/NetworkProcessMainGtk.cpp: Renamed from Source/WebKit2/NetworkProcess/unix/NetworkProcessMainUnix.cpp. (WebKit::NetworkProcessMainUnix): * NetworkProcess/unix/NetworkProcessMainUnix.h: * PlatformEfl.cmake: * PlatformGTK.cmake: * PluginProcess/EntryPoint/unix/PluginProcessMain.cpp: Renamed from Source/WebKit2/unix/PluginMainUnix.cpp. (main): * PluginProcess/unix/PluginProcessMainUnix.cpp: (WebKit::webkitXError): (WebKit::PluginProcessMainUnix): * PluginProcess/unix/PluginProcessMainUnix.h: * Shared/unix/ChildProcessMain.cpp: Copied from Source/WebKit2/WebProcess/efl/WebProcessMainEfl.h. (WebKit::ChildProcessMainBase::parseCommandLine): * Shared/unix/ChildProcessMain.h: Renamed from Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.h. (WebKit::ChildProcessMainBase::platformInitialize): (WebKit::ChildProcessMainBase::platformFinalize): (WebKit::ChildProcessMainBase::initializationParameters): (WebKit::ChildProcessMain): * WebProcess/EntryPoint/unix/WebProcessMain.cpp: Renamed from Source/WebKit2/gtk/MainGtk.cpp. (main): * WebProcess/efl/WebProcessMainEfl.cpp: (WebKit::WebProcessMainUnix): (dummyExtensionErrorHandler): Deleted. * WebProcess/gtk/WebProcessMainGtk.cpp: (WebKit::WebProcessMainUnix): * WebProcess/unix/WebProcessMainUnix.h: Renamed from Source/WebKit2/WebProcess/efl/WebProcessMainEfl.h. 2014-05-22 Zan Dobersek <zdobersek@igalia.com> Have the decoded element in VectorArgumentCoder::decode() moved into Vector::append() https://bugs.webkit.org/show_bug.cgi?id=133082 Reviewed by Andreas Kling. * Platform/IPC/ArgumentCoders.h: Move the decoded element into the Vector::append() call. This enforces a move instead of a copy if the decoded element's type is move-constructible. 2014-05-22 Zan Dobersek <zdobersek@igalia.com> Move the passed-in Vector<Attachment> in MessageDecoder constructor down into ArgumentDecoder https://bugs.webkit.org/show_bug.cgi?id=133080 Reviewed by Andreas Kling. * Platform/IPC/MessageDecoder.cpp: (IPC::MessageDecoder::MessageDecoder): The Vector<Attachment> object was passed in by value. Move it into the ArgumentDecoder constructor as it is not used elsewhere in this constructor and produces a copy otherwise. 2014-05-22 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] Add support for minimal-ui viewports https://bugs.webkit.org/show_bug.cgi?id=133162 Reviewed by Simon Fraser. In the WebKit2 layers, we have two parts to minimal-ui. -In WebPage, we need to get the values from the UIProcess and setup the ViewportConfiguration. Another part is freezing the state on page load. -In the UIProcess, we need to get the right information for layout and styling, and we need to tell the UI clients about minimal-ui changes. * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _setUsesMinimalUI:]): (-[WKWebView _usesMinimalUI]): (-[WKWebView _didCommitLayerTree:WebKit::]): (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _minimumLayoutSizeOverride]): (-[WKWebView _setMinimumLayoutSizeOverride:]): (-[WKWebView _minimumLayoutSizeOverrideForMinimalUI]): (-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]): (-[WKWebView _largestUnobscuredSizeOverride]): (-[WKWebView _setMaximumUnobscuredSizeOverride:]): (-[WKWebView _beginAnimatedResizeWithUpdates:]): (setViewportConfigurationMinimumLayoutSize): Deleted. * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::setUsesMinimalUI): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::dynamicViewportSizeUpdate): (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSizeForMinimalUI): (WebKit::WebPageProxy::setMaximumUnobscuredSize): (WebKit::WebPageProxy::setUsesMinimalUI): (WebKit::WebPageProxy::setMinimumLayoutSizeForMinimalUI): Deleted. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): (WebKit::WebPage::didCommitLoad): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::setViewportConfigurationMinimumLayoutSizeForMinimalUI): (WebKit::WebPage::setMaximumUnobscuredSize): (WebKit::WebPage::willFlushLayers): (WebKit::WebPage::dynamicViewportSizeUpdate): (WebKit::WebPage::viewportConfigurationChanged): (WebKit::WebPage::updateViewportSizeForCSSViewportUnits): (WebKit::WebPage::setMinimumLayoutSizeForMinimalUI): Deleted. * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::flushLayers): 2014-05-22 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] Reset the special action-target of WKSyntheticClickTapGestureRecognizer on destruction https://bugs.webkit.org/show_bug.cgi?id=133165 <rdar://problem/16283914> Reviewed by Andy Estes. It is unclear why, but the WKSyntheticClickTapGestureRecognizer sometimes survives its own view and is reset after WKContentView was destructed. This patch cleans up the target-action on destruction to avoid accessing a destructed object. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView cleanupInteraction]): 2014-05-22 Benjamin Poulain <bpoulain@apple.com> Do not force a layout when changing the FixedLayoutSize in WebPage https://bugs.webkit.org/show_bug.cgi?id=133167 Reviewed by Andreas Kling. WebPage::setFixedLayoutSize was forcing a layout immediately after changing the layout size on FrameView. This is forcing plenty of extra layouts since the fixed layout size is one of many properties updated on the FrameView. FrameView marks that layout is needed. It is not clear why a layout was performed immediately. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setFixedLayoutSize): 2014-05-22 Andreas Kling <akling@apple.com> [iOS WebKit2] Web process should try to shrink its memory footprint when going into background. <https://webkit.org/b/133197> <rdar://problem/17011561> Try to free up as much memory as possible before going into background. Reviewed by Gavin Barraclough. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::processWillSuspend): 2014-05-22 Andreas Kling <akling@apple.com> Hook up a setting for showing detailed logging during memory pressure relief. <https://webkit.org/b/133194> Plumb through the same setting that we used for detailed logging in WK1. Reviewed by Gavin Barraclough. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::WebProcessCreationParameters): (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformInitializeWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2014-05-22 Andy Estes <aestes@apple.com> [iOS] Send shareable resources to QuickLook if enabled https://bugs.webkit.org/show_bug.cgi?id=133189 <rdar://problem/17003995> Reviewed by Brady Eidson. Like we do for didReceiveData(), we need to pass an incoming ShareableResource to QuickLook if a QuickLook handle exists. * Shared/ShareableResource.cpp: (WebKit::ShareableResource::Handle::tryWrapInCFData): Return the shared resource in a CFDataRef. (WebKit::ShareableResource::Handle::tryWrapInSharedBuffer): Implemented in terms of tryWrapInCFData(). * Shared/ShareableResource.h: * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveResource): If a QuickLook handle exists, send the shareable resource to it via a CFDataRef. 2014-05-22 Martin Hock <mhock@apple.com> [iOS] Enable -apple-system- styled elements to respond to system font size changes. https://bugs.webkit.org/show_bug.cgi?id=133186 <rdar://problem/16583782> Reviewed by Enrica Casucci. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): (-[WKWebView _contentSizeCategoryDidChange:]): (-[WKWebView _contentSizeCategory]): * UIProcess/WebPageProxy.h: * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::contentSizeCategoryDidChange): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::contentSizeCategoryDidChange): 2014-05-22 Alexey Proskuryakov <ap@apple.com> [iOS] Add CFBundleAllowMixedLocalizations to WebContentService https://bugs.webkit.org/show_bug.cgi?id=133187 <rdar://problem/16561084> Reviewed by Tim Horton. * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist: We already had it in WebContentService.Development, just not here. 2014-05-22 Alexey Proskuryakov <ap@apple.com> [iOS][WK2] Application cache is broken https://bugs.webkit.org/show_bug.cgi?id=133172 <rdar://problem/16994593> Reviewed by Andy Estes. * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformDefaultApplicationCacheDirectory): Use a proper path for application cache database (same as WebKit1). 2014-05-22 Enrica Casucci <enrica@apple.com> REGRESSION (WebKit2): Keyboard should have Search button in duckduckgo.com. https://bugs.webkit.org/show_bug.cgi?id=133183 <rdar://problem/17004207> Reviewed by Geoff Garen. The keyboard type should be search if the input type is search or if it is text and it is inside a form with an action and either name, id or title contain the word search. This matches the heuristics we have in WK1 for iOS. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getAssistedNodeInformation): 2014-05-21 Oliver Hunt <oliver@apple.com> Only enable sandbox extensions on mac. RS = Alexey. * WebKit2Prefix.h: 2014-05-21 Oliver Hunt <oliver@apple.com> [iOS] Enable sandboxing for the database process https://bugs.webkit.org/show_bug.cgi?id=132963 Reviewed by Alexey Proskuryakov. Simply ensure that the database process is running in a tight sandbox. As part of this i've separated out ChildProcessIOS and ensures that the database process loads a custom sandbox. * Configurations/WebKit.xcconfig: * DatabaseProcess/ios/DatabaseProcessIOS.mm: (WebKit::DatabaseProcess::initializeSandbox): * DatabaseProcess/ios/com.apple.WebKit.DatabasesIOS.sb: Added. * Shared/ios/ChildProcessIOS.mm: Added. Essentially cloned from the Mac version, only all the OSX specific logic has been stripped. (WebKit::ChildProcess::setApplicationIsDaemon): (WebKit::ChildProcess::platformInitialize): (WebKit::ChildProcess::initializeSandbox): (WebKit::ChildProcess::setQOS): * Shared/mac/ChildProcessMac.mm: Remove all the IOS ifdefs. (WebKit::ChildProcess::setApplicationIsDaemon): (WebKit::ChildProcess::platformInitialize): (WebKit::ChildProcess::initializeSandbox): (WebKit::ChildProcess::setQOS): * WebKit2.xcodeproj/project.pbxproj: 2014-05-21 Andy Estes <aestes@apple.com> [iOS] Create a UIPrintFormatter for WKWebView https://bugs.webkit.org/show_bug.cgi?id=133005 Reviewed by Tim Horton. Implemented a UIPrintFormatter subclass to support printing WKWebViews using UIPrintInteractionController. Overrode -_recalcPageCount: to synchronously ask the web process to lay out for printing and return the number of page rects. The web process returns the page rects immediately and then starts rendering the page to a PDF, returning the PDF data to the UI process asynchronously. When UIPrintInteractionController later calls our overridden -drawInRect:forPageAtIndex:, we block and wait for the PDF data to be returned. Since UIPrintInteractionController draws each page after a delay, it's possible that the web process has already returned the PDF data to us by the time we print the first page. * Shared/WebPreferencesStore.h: Correctly initialized shouldPrintBackgrounds for iOS. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _dataForDisplayedPDF]): Now that WKPDFView vends its CGPDFDocument directly, extract its data here. (-[WKWebView _printFormatterClass]): Tell UIView which UIPrintFormatter to alloc. (-[WKWebView _computePageCountAndStartDrawingToPDFWithPrintInfo:WebKit::firstPage:computedTotalScaleFactor:]): If we're displaying a PDF, return its page count directly. Otherwise, synchronously ask the web process to compute page rects for printing and then return the number of rects. (-[WKWebView _endPrinting]): Cleared state and sent the WebPage::EndPrinting message to the web process. (-[WKWebView _printedDocument]): If we're displaying a PDF, return its data directly. Otherwise, if we haven't received PDF data from the web process yet, wait for it indefinitely (there's no sensible timeout to use here since failing to receive the data results in printing some number of blank pages). (-[WKWebView _setPrintedDocument:]): Set the CGPDFDocument received from the web process. * UIProcess/API/Cocoa/WKWebViewInternal.h: Declared methods called by WKWebViewPrintFormatter. * UIProcess/PageClient.h: Declared didFinishDrawingPagesToPDF. * UIProcess/WKWebViewPrintFormatter.h: Added. * UIProcess/WKWebViewPrintFormatter.mm: Added. (-[WKWebViewPrintFormatter dealloc]): Cleared state and called -[WKWebView _endPrinting]. (-[WKWebViewPrintFormatter webView]): Returned the WKWebView for this print formatter. (-[WKWebViewPrintFormatter _recalcPageCount]): Set up a PrintInfo object given the formatter's content rect and called -_computePageCountAndStartDrawingToPDFWithPrintInfo:... (-[WKWebViewPrintFormatter rectForPageAtIndex:]): Called -_recalcIfNecessary and then returned the rect from -_pageContentRect. (-[WKWebViewPrintFormatter drawInRect:forPageAtIndex:]): Taught to draw the given page of the printed PDF document into the given rect and context provided to us. * UIProcess/WebPageProxy.h: Declared didFinishDrawingPagesToPDF. * UIProcess/WebPageProxy.messages.in: Added DidFinishDrawingPagesToPDF. Made this a delayed syncrhonous message so that additoinal work could be performed after sending the response. * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didFinishDrawingPagesToPDF): Created a CGPDFDocument from the data sent to us by the web process and called -[WKWebView _setPrintedDocument:]. * UIProcess/ios/WKPDFView.h: * UIProcess/ios/WKPDFView.mm: (-[WKPDFView pdfDocument]): Returned the underlying CGPDFDocument. (-[WKPDFView documentData]): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::didFinishDrawingPagesToPDF): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::computePagesForPrinting): Changed to call computePagesForPrintingImpl. (WebKit::WebPage::computePagesForPrintingImpl): Moved the common logic of computePagesForPrinting to here so it could be called by computePagesForPrintingAndStartDrawingToPDF. (WebKit::WebPage::drawPagesToPDF): Changed to call drawPagesToPDFImpl (WebKit::WebPage::drawPagesToPDFImpl): Moved the common logic of drawPagesToPDF to here so it could be called by computePagesForPrintingAndStartDrawingToPDF. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::computePagesForPrintingAndStartDrawingToPDF): Computed page rects and returned them as a synchronous response. Afterwards called drawPagesToPDFImpl() and returned the PDF data by sending WebPageProxy::DidFinishDrawingPagesToPDF. 2014-05-21 Michał Pakuła vel Rutka <m.pakula@samsung.com> [EFL] Turn on ENABLE_CSS_FILTERS https://bugs.webkit.org/show_bug.cgi?id=133153 Reviewed by Gyuyoung Kim. Make WebKit2 compile after r166741 when CSS_FILTERS are enabled. * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: (IPC::ArgumentCoder<WebCore::FilterOperations>::decode): 2014-05-21 Brady Eidson <beidson@apple.com> Special handling of telephone number detection menu. <rdar://problem/16967971> and https://bugs.webkit.org/show_bug.cgi?id=133143 Reviewed by Geoff Garen. Add a bool to ContextMenuContextData to represent telephone number menus: * Shared/ContextMenuContextData.cpp: (WebKit::ContextMenuContextData::ContextMenuContextData): (WebKit::ContextMenuContextData::operator=): (WebKit::ContextMenuContextData::encode): (WebKit::ContextMenuContextData::decode): * Shared/ContextMenuContextData.h: (WebKit::ContextMenuContextData::ContextMenuContextData): (WebKit::ContextMenuContextData::isTelephoneNumberContext): * UIProcess/mac/WebContextMenuProxyMac.mm: (WebKit::WebContextMenuProxyMac::showContextMenu): If the menu is a telephone number menu then display it using a specific AppKit API. * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::showTelephoneNumberMenu): Filter the array of menu items through a new WKSI call, and then show it using a telephone number context. 2014-05-21 Alexey Proskuryakov <ap@apple.com> [Mac] REGRESSION (Async text input): Asian text input doesn't work in Flash https://bugs.webkit.org/show_bug.cgi?id=133128 <rdar://problem/16890920> Reviewed by Anders Carlsson. * UIProcess/API/mac/WKView.mm: (-[WKView _interpretKeyEvent:completionHandler:]): Added a separate code path for plug-in input. Before async text input, we used to provide a nil input context due to having _data->_interpretKeyEventsParameters while this function was executing, and thus took a shortcut. The new behavior is different from pre-async in that we don't collect commands at all, but I couldn't find any case where that mattered. (-[WKView inputContext]): The _collectedKeypressCommands check was not a correct replacement for _interpretKeyEventsParameters one, because this variable is not always set within -_interpretKeyEvent:completionHandler:. * UIProcess/mac/WKTextInputWindowController.mm: (-[WKTextInputPanel _interpretKeyEvent:usingLegacyCocoaTextInput:string:]): While at it, fixed a separate issue with Cangjie predictive input. We shouldn't keep prediction pop-up on screen after hiding the bottom input window. 2014-05-16 Martin Robinson <mrobinson@igalia.com> [CMake] Improve handling of LIB_INSTALL_DIR, EXEC_INSTALL_DIR, and LIBEXEC_INSTALL_DIR https://bugs.webkit.org/show_bug.cgi?id=132819 Reviewed by Carlos Garcia Campos. * PlatformEfl.cmake: No need to prefix EXEC_INSTALL_DIR with the prefix any longer. * PlatformGtk.cmake: No longer use CMAKE_INSTALL_FULL_FOO variables, instead using the WebKit-specific ones. * efl/EWebKit2Config.cmake.in: Ditto. * efl/ewebkit2.pc.in: Instead of hard-coding the path to the library installation directory use LIB_INSTALL_DIR. * webkit2gtk-web-extension.pc.in: No longer use the pkg-config only variables. Instead use the common CMake ones. * webkit2gtk.pc.in: Ditto. 2014-05-21 Carlos Garcia Campos <cgarcia@igalia.com> REGRESSION(r168625): [GTK] Assertion failure in LocalStorageDatabaseTracker https://bugs.webkit.org/show_bug.cgi?id=133118 Reviewed by Philippe Normand. Call WebContext::applyPlatformSpecificConfigurationDefaults() to initialize the WebContextConfiguration before creating the default WebContext. * UIProcess/API/gtk/WebKitWebContext.cpp: (createDefaultWebContext): 2014-05-21 Shivakumar JM <shiva.jm@samsung.com> [WebKit2] Cleanup the build from unused variable in WebProcess module https://bugs.webkit.org/show_bug.cgi?id=133062 Reviewed by Csaba Osztrogonác. Fix unused parameter by using UNUSED_PARAM macro * WebProcess/UserContent/WebUserContentController.cpp: (WebKit::WebUserContentController::addUserScriptMessageHandlers): (WebKit::WebUserContentController::removeUserScriptMessageHandler): 2014-05-20 Enrica Casucci <enrica@apple.com> REGRESSION (WK2): Tapping on the input field in duckduckgo.com shows the keyboard but not the caret. https://bugs.webkit.org/show_bug.cgi?id=133140 <rdar://problem/16980898> Reviewed by Benjamin Poulain. When a page focuses a field on load, we receive the call to startAssistingNode but we don't create a text interaction assistant if the focus is not originated by a user action. Upon receiving the selection change notification we don't call the text interaction assistant, since we don't have one, but we do call the web selection assistant. We don't have any valid rects for web selection and we clear the selection on the page, causing the caret not to appear and the typing to have no effect. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _updateChangedSelection]): 2014-05-20 Dean Jackson <dino@apple.com> [Mac] Allow popup menus to override default appearance https://bugs.webkit.org/show_bug.cgi?id=133129 Reviewed by Tim Horton. Add an extra "hideArrows" flag to PlatformPopupMenuData and replace the call to WKPopupMenuWithSize with WKPopupMenu. * Shared/PlatformPopupMenuData.cpp: Encode and decode the new data value. (WebKit::PlatformPopupMenuData::encode): (WebKit::PlatformPopupMenuData::decode): * Shared/PlatformPopupMenuData.h: Add hideArrows boolean. * UIProcess/mac/WebPopupMenuProxyMac.mm: (WebKit::WebPopupMenuProxyMac::showPopupMenu): * WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm: (WebKit::WebPopupMenu::setUpPlatformData): The hideArrows flag is true if we don't have the default appearance. 2014-05-20 Eric Carlson <eric.carlson@apple.com> [Mac] do not deactivate an audio session that has running I/O https://bugs.webkit.org/show_bug.cgi?id=133127 Reviewed by Jer Noble. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): Settings::setShouldManageAudioSession renamed to setShouldManageAudioSessionCategory, deal with it. 2014-05-19 Simon Fraser <simon.fraser@apple.com> REGRESSION (r169063) Fixed and sticky nodes misplaced on scrolling sometimes https://bugs.webkit.org/show_bug.cgi?id=133106 <rdar://problem/16967648> Reviewed by Sam Weinig. Fix regression from r169063. That commit removed scrolledContentsLayers from frame scrolling nodes, but they do actually use them. So put them back; not in the base class, because they have a somewhat different meaning for overflow scrolling and frame scrolling. * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode): (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode): (WebKit::RemoteScrollingTreeTextStream::dump): * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): 2014-05-20 Alexey Proskuryakov <ap@apple.com> [Mac] WebProcess doesn't follow localization of UI process when run as a service https://bugs.webkit.org/show_bug.cgi?id=133126 <rdar://problem/13396515> <rdar://problem/16561084> Reviewed by Sam Weinig and Tim Horton. * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm: (WebKit::handleXPCBootstrap): (main): * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm: (WebKit::handleXPCBootstrap): (main): Set localization very early in process lifetime (in development builds, that's even before WebKit framework is loaded). * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::connectToService): Pass UI process localization to the service, computing it in the same way we do for child processes. 2014-05-20 Anders Carlsson <andersca@apple.com> Fix a header comment https://bugs.webkit.org/show_bug.cgi?id=133123 <rdar://problem/16973783> Reviewed by Geoffrey Garen. * UIProcess/API/Cocoa/WKUserContentController.h: 2014-05-20 Carlos Garcia Campos <cgarcia@igalia.com> [GTK] WebKitWebPage::send-request always pass a valid pointer for redirected response https://bugs.webkit.org/show_bug.cgi?id=133119 Reviewed by Sergio Villar Senin. The problem is that we were checking whether the passed in WKURLResponseRef is NULL or not, but it's always a valid object that can contain a NULL WebCore::ResourceResponse. * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: (willSendRequestForFrame): Pass NULL as redirect-response parameter of WebKitWebPage::send-request signal when the WebCore::ResourceResponse of the passed in WKURLResponseRef is NULL. 2014-05-20 Antti Koivisto <antti@apple.com> Double-tap zoom does not take obscuring insets into account https://bugs.webkit.org/show_bug.cgi?id=133116 <rdar://problem/16765604> Reviewed by Anders Carlsson. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _zoomToRect:WebCore::atScale:origin:WebCore::]): Compute the zoom target taking insets into account. 2014-05-19 Gavin Barraclough <baraclough@apple.com> WebKit2/iOS: parented view should be considered hidden if app is backgrounded https://bugs.webkit.org/show_bug.cgi?id=133099 radar://16942183 Reviewed by Simon Fraser. * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::isViewWindowActive): - implemented in terms of isViewVisible. - FIXME: https://bugs.webkit.org/show_bug.cgi?id=133098 (WebKit::PageClientImpl::isViewFocused): - implemented in terms of isViewWindowActive. - FIXME: https://bugs.webkit.org/show_bug.cgi?id=133098 (WebKit::PageClientImpl::isViewVisible): - take UIApplication applicationState into account in determining visibility. (WebKit::PageClientImpl::isViewVisibleOrOccluded): - implemented in terms of isViewVisible. (WebKit::PageClientImpl::isVisuallyIdle): - implemented in terms of isViewVisible. * UIProcess/ios/WKContentView.mm: (-[WKContentView initWithFrame:context:WebKit::configuration:WebKit::webView:]): - register for UIApplicationDidEnterBackgroundNotification. (-[WKContentView _applicationDidEnterBackground:]): (-[WKContentView _applicationWillEnterForeground:]): - when the application state changes all flags except IsInWindow may be affected. 2014-05-19 Enrica Casucci <enrica@apple.com> WK2 iOS: Pressing the form navigation button causes the keyboard to be dismissed. https://bugs.webkit.org/show_bug.cgi?id=133100 <rdar://problem/16808673> Reviewed by Benjamin Poulain. The call to focusNextAssistedNode is the result of a user action, since it is called when the user pressed the form navigation buttons. Therefore we must set m_userIsInteracting to true before changing the focus to make sure the focus change is honored. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::focusNextAssistedNode): 2014-05-19 Beth Dakin <bdakin@apple.com> TelephoneNumberOverlayController should use a modern loop for text quad bounding boxes https://bugs.webkit.org/show_bug.cgi?id=133096 Reviewed by Anders Carlsson. * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm: (WebKit::textQuadsToBoundingRectForRange): 2014-05-19 Jeremy Jones <jeremyj@apple.com> PlatformCALayerRemoteCustom properties aren't initialized to match the PlatformLayer https://bugs.webkit.org/show_bug.cgi?id=133025 Reviewed by Simon Fraser. * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm: (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom): Initialize PlatformCALayerRemote properties from the PlatformLayer. 2014-05-19 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] When a page relayout on dynamic resize, keep the same relative width in view https://bugs.webkit.org/show_bug.cgi?id=133026 <rdar://problem/16833971> Reviewed by Simon Fraser. When a page does not relayout, we keep the same width in view. When a page relayout, we should keep the same relative width in view. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::isResponsiveDesignWithContentLargerThanLayout): (WebKit::WebPage::dynamicViewportSizeUpdate): 2014-05-19 Benjamin Poulain <benjamin@webkit.org> [WK2] Add some missing state reset on crash https://bugs.webkit.org/show_bug.cgi?id=133036 Reviewed by Sam Weinig. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::resetState): The missing reset for m_isTrackingTouchEvents would cause the WebPageProxy to send touch events when it shouldn't. That would only be for an active touch sequence. The missing reset m_lastVisibleContentRectUpdate would prevent pushing the new UI state to the new page on reload, that is very bad. Also moved m_videoFullscreenManager to be in the same order as initialization, and invalidate the callbacks for dictation. 2014-05-19 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] Move scale noise filtering to the WebProcess https://bugs.webkit.org/show_bug.cgi?id=133021 Reviewed by Darin Adler. Filtering in the UIProcess was stupid. It forces to handle a third kind of scale just for updates. The WebProcess already adjusts the input scale based on the viewport. Changing the input scale at that level is already supported. It is a better place to have the filtering. * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateVisibleContentRects): 2014-05-19 Simon Fraser <simon.fraser@apple.com> Split scrolling tree ScrollingNodes into FrameScrollingNodes and OverflowScrollingNodes https://bugs.webkit.org/show_bug.cgi?id=133022 Reviewed by Sam Weinig. In both the scrolling state tree and the scrolling tree, split the "scrolling nodes" into FrameScrolling and OverflowScrolling nodes. Move what was the "viewportSize" property onto the base class for the scrolling nodes, calling it "scrollableAreaSize". Make minimum/maximumScrollPosition() virtual so we can share more code (and there is more code sharing to be done in future). * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder<ScrollingStateScrollingNode>::encode): (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode): (ArgumentCoder<ScrollingStateOverflowScrollingNode>::encode): (ArgumentCoder<ScrollingStateScrollingNode>::decode): (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode): (ArgumentCoder<ScrollingStateOverflowScrollingNode>::decode): (WebKit::encodeNodeAndDescendants): (WebKit::RemoteScrollingCoordinatorTransaction::decode): (WebKit::RemoteScrollingTreeTextStream::dump): * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): * UIProcess/Scrolling/RemoteScrollingTree.cpp: (WebKit::RemoteScrollingTree::createNode): * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollLayer): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterViewportChange): * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: (WebKit::ScrollingTreeOverflowScrollingNodeIOS::ScrollingTreeOverflowScrollingNodeIOS): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateBeforeChildren): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll): * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): 2014-05-19 Alexey Proskuryakov <ap@apple.com> [Mac] Fix a typo in plug-in sandbox https://bugs.webkit.org/show_bug.cgi?id=133074 Reviewed by Anders Carlsson. * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb: 2014-05-16 Andy Estes <aestes@apple.com> [WebKit2] Wake up threads blocked in waitForAndDispatchImmediately() if we lose our connection https://bugs.webkit.org/show_bug.cgi?id=133010 Reviewed by Geoffrey Garen. If a thread is blocked on m_waitForMessageCondition and we lose our connection, treat that like we do a timeout. * Platform/IPC/Connection.cpp: (IPC::Connection::Connection): (IPC::Connection::waitForMessage): (IPC::Connection::connectionDidClose): * Platform/IPC/Connection.h: 2014-05-19 Mark Rowe <mrowe@apple.com> Build fix after r169023. * Shared/API/Cocoa/WebKitPrivate.h: Stop including headers that no longer exist. I hope for weinig's sake that no-one was relying on them. 2014-05-18 Anders Carlsson <andersca@apple.com> Relax an assertion when creating document loaders https://bugs.webkit.org/show_bug.cgi?id=133058 Reviewed by Sam Weinig. When navigating back/forward items recursively, createDocumentLoader will be called for subframes before main frames so only associate the navigation with main frames. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::createDocumentLoader): 2014-05-18 Zsolt Borbely <zsborbely.u-szeged@partner.samsung.com> CMake Buildfix after r169023. Reviewed by Csaba Osztrogonác. * CMakeLists.txt: Add new files after r168994. 2014-05-18 Sam Weinig <sam@webkit.org> [WebKit2] Implement ScriptMessageHandlers https://bugs.webkit.org/show_bug.cgi?id=133053 Reviewed by Anders Carlsson. * DerivedSources.make: * Scripts/webkit2/messages.py: (struct_or_class): (argument_coder_headers_for_type): (headers_for_type): * UIProcess/API/Cocoa/WKScriptMessage.mm: (-[WKScriptMessage _initWithBody:webView:name:]): (-[WKScriptMessage body]): (-[WKScriptMessage webView]): (-[WKScriptMessage name]): (-[WKScriptMessage _scriptWorld]): Deleted. * UIProcess/API/Cocoa/WKScriptMessageInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKScriptMessagePrivate.h. * UIProcess/API/Cocoa/WKScriptMessagePrivate.h: Removed. * UIProcess/API/Cocoa/WKUserContentController.mm: (-[WKUserContentController addScriptMessageHandler:name:]): (-[WKUserContentController removeScriptMessageHandlerForName:]): (-[WKUserContentController _addScriptMessageHandler:name:world:]): Deleted. (-[WKUserContentController _removeScriptMessageHandlerForName:world:]): Deleted. * UIProcess/API/Cocoa/WKUserContentControllerInternal.h: * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h: Removed. * UIProcess/API/Cocoa/WKWebView.mm: (pageToViewMap): (fromWebPageProxy): (-[WKWebView initWithFrame:configuration:]): (-[WKWebView dealloc]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/UserContent/WebScriptMessageHandler.cpp: Added. (WebKit::WebScriptMessageHandlerHandle::encode): (WebKit::WebScriptMessageHandlerHandle::decode): (WebKit::generateIdentifier): (WebKit::WebScriptMessageHandler::create): (WebKit::WebScriptMessageHandler::WebScriptMessageHandler): (WebKit::WebScriptMessageHandler::~WebScriptMessageHandler): * UIProcess/UserContent/WebScriptMessageHandler.h: Added. (WebKit::WebScriptMessageHandler::Client::~Client): (WebKit::WebScriptMessageHandler::handle): (WebKit::WebScriptMessageHandler::identifier): (WebKit::WebScriptMessageHandler::name): (WebKit::WebScriptMessageHandler::client): * UIProcess/UserContent/WebUserContentControllerProxy.cpp: (WebKit::WebUserContentControllerProxy::addProcess): (WebKit::WebUserContentControllerProxy::removeProcess): (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler): (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName): (WebKit::WebUserContentControllerProxy::didPostMessage): * UIProcess/UserContent/WebUserContentControllerProxy.h: * UIProcess/UserContent/WebUserContentControllerProxy.messages.in: Added. * WebKit2.xcodeproj/project.pbxproj: * WebProcess/UserContent/WebUserContentController.cpp: (WebKit::WebUserMessageHandlerDescriptorProxy::create): (WebKit::WebUserMessageHandlerDescriptorProxy::~WebUserMessageHandlerDescriptorProxy): (WebKit::WebUserMessageHandlerDescriptorProxy::didPostMessage): (WebKit::WebUserMessageHandlerDescriptorProxy::descriptor): (WebKit::WebUserMessageHandlerDescriptorProxy::identifier): (WebKit::WebUserMessageHandlerDescriptorProxy::WebUserMessageHandlerDescriptorProxy): (WebKit::WebUserContentController::addUserScriptMessageHandlers): (WebKit::WebUserContentController::removeUserScriptMessageHandler): * WebProcess/UserContent/WebUserContentController.h: * WebProcess/UserContent/WebUserContentController.messages.in: 2014-05-18 Rik Cabanier <cabanier@adobe.com> support for navigator.hardwareConcurrency https://bugs.webkit.org/show_bug.cgi?id=132588 Reviewed by Filip Pizlo. * Configurations/FeatureDefines.xcconfig: 2014-05-18 Anders Carlsson <andersca@apple.com> Implement Navigations for all methods declared returning one https://bugs.webkit.org/show_bug.cgi?id=133048 <rdar://problem/16830064> Reviewed by Sam Weinig. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView goToBackForwardListItem:]): (-[WKWebView goBack]): (-[WKWebView goForward]): (-[WKWebView reload]): (-[WKWebView reloadFromOrigin]): Create and return navigations. (-[WKWebView _reload]): Call -[WKWebView reload]. * UIProcess/Cocoa/NavigationState.h: * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::createBackForwardNavigation): Create a back/forward navigation. (WebKit::NavigationState::createReloadNavigation): Create a reload navigation. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::reattachToWebProcessWithItem): Generate a navigation ID and send it with the GoToBackForwardItem message. (WebKit::WebPageProxy::reload): Return a navigation ID. (WebKit::WebPageProxy::goForward): Generate a navigation ID and send it with the GoForward message. (WebKit::WebPageProxy::goBack): Generate a navigation ID and send it with the GoBack message. (WebKit::WebPageProxy::goToBackForwardItem): Generate a navigation ID and send it with the GoToBackForwardItem message. * UIProcess/WebPageProxy.h: Return navigation IDs where appropriate. * UIProcess/cf/WebPageProxyCF.cpp: (WebKit::WebPageProxy::restoreFromSessionStateData): Generate a navigation ID and send it with the RestoreSessionAndNavigateToCurrentItem message. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::goForward): (WebKit::WebPage::goBack): (WebKit::WebPage::goToBackForwardItem): Set up the pending navigation ID. (WebKit::WebPage::restoreSessionAndNavigateToCurrentItem): Call goToBackForwardItem with a navigation ID. * WebProcess/WebPage/WebPage.h: Add navigation IDs. * WebProcess/WebPage/WebPage.messages.in: Add navigation IDs. 2014-05-18 Commit Queue <commit-queue@webkit.org> Unreviewed, rolling out r169001. https://bugs.webkit.org/show_bug.cgi?id=133050 We can't expose the C SPI from WKWebView (Requested by andersca on #webkit). Reverted changeset: "Need a way to get a WKPageRef from a WKWebView" https://bugs.webkit.org/show_bug.cgi?id=133015 http://trac.webkit.org/changeset/169001 2014-05-18 Martin Hodovan <mhodovan.u-szeged@partner.samsung.com> [WK2][GTK] Buildfix after r168999. Reviewed by Csaba Osztrogonác. * UIProcess/gtk/WebContextGtk.cpp: (WebKit::WebContext::platformDefaultWebSQLDatabaseDirectory): Renamed from WebKit::WebContext::platformDefaultDatabaseDirectory(). (WebKit::WebContext::platformDefaultIndexedDBDatabaseDirectory): Added. 2014-05-18 Martin Hodovan <mhodovan.u-szeged@partner.samsung.com> [WK2][EFL] Buildfix after r168999. Reviewed by Csaba Osztrogonác. * UIProcess/efl/WebContextEfl.cpp: (WebKit::WebContext::platformDefaultWebSQLDatabaseDirectory): Renamed from WebKit::WebContext::platformDefaultDatabaseDirectory(). (WebKit::WebContext::platformDefaultIndexedDBDatabaseDirectory): Added. 2014-05-18 Martin Hodovan <mhodovan.u-szeged@partner.samsung.com> [WK2][cmake] Buildfix after r168994. Reviewed by Csaba Osztrogonác. * CMakeLists.txt: Added new files to the build system introduced in r168994. 2014-05-17 Alexey Proskuryakov <ap@apple.com> REGRESSION (NetworkProcess): Trying to use appcache fallback crashes in ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache https://bugs.webkit.org/show_bug.cgi?id=133007 <rdar://problem/13702706> appcache tests often fail on the Mac WebKit2 bot https://bugs.webkit.org/show_bug.cgi?id=82061 Reviewed by Maciej Stachowiak. * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::willSendRequest): (WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo): (WebKit::WebResourceLoader::didFailResourceLoad): Perform the same appcache checks that ResourceHandleClient implementation in ResourceLoader does. We should eventually come up with a way to share the code. Perhaps add a class that isolates ResourceLoader from networking details? But ResourceLoader was itself supposed to be the class that isolates DocumentLoader from networking details. So, unsure. 2014-05-17 Jae Hyun Park <jaepark@webkit.org> [EFL] Remove m_contentPosition from PageViewportControllerClientEfl https://bugs.webkit.org/show_bug.cgi?id=132774 Reviewed by Anders Carlsson. m_contentPosition is not used anywhere. So, this patch removes m_contentPosition and reduces one unnecessary assignment in setViewportPosition. Also, it renames contentsPoint to contentsPosition. * UIProcess/PageViewportControllerClient.h: * UIProcess/efl/PageViewportControllerClientEfl.cpp: (WebKit::PageViewportControllerClientEfl::setViewportPosition): * UIProcess/efl/PageViewportControllerClientEfl.h: 2014-05-17 David Kilzer <ddkilzer@apple.com> Need a way to get a WKPageRef from a WKWebView <http://webkit.org/b/133015> Reviewed by Benjamin Poulain. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _pageRef]): Added. * UIProcess/API/Cocoa/WKWebViewPrivate.h: (-[WKWebView _pageRef]): Added declaration. 2014-05-17 Anders Carlsson <andersca@apple.com> Give user scripts custom URLs https://bugs.webkit.org/show_bug.cgi?id=133035 Reviewed by Beth Dakin. * UIProcess/API/Cocoa/WKUserContentController.mm: (-[WKUserContentController addUserScript:]): Create a user-script:<number> URL for user scripts. * UIProcess/API/Cocoa/WKUserScript.h: Move the init method after the properties. 2014-05-17 Anders Carlsson <andersca@apple.com> Replace WKContextSetDatabaseDirectory with two WKContextConfiguration parameters https://bugs.webkit.org/show_bug.cgi?id=133033 <rdar://problem/16830143> Reviewed by Sam Weinig. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: Rename databaseDirectory to webSQLDatabaseDirectory to better indicate the directory type. * UIProcess/API/C/WKContext.cpp: (WKContextSetDatabaseDirectory): Deleted. This is no longer needed. * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationCopyIndexedDBDatabaseDirectory): (WKContextConfigurationSetIndexedDBDatabaseDirectory): (WKContextConfigurationCopyWebSQLDatabaseDirectory): (WKContextConfigurationSetWebSQLDatabaseDirectory): * UIProcess/API/C/WKContextConfigurationRef.h: Add setters and getters. * UIProcess/API/C/WKContextPrivate.h: Remove WKContextSetDatabaseDirectory. * UIProcess/APIContextConfiguration.cpp: (API::ContextConfiguration::webContextConfiguration): Set m_indexedDBDatabaseDirectory and m_webSQLDatabaseDirectory on the configuration. * UIProcess/APIContextConfiguration.h: (API::ContextConfiguration::indexedDBDatabaseDirectory): (API::ContextConfiguration::setIndexedDBDatabaseDirectory): (API::ContextConfiguration::webSQLDatabaseDirectory): (API::ContextConfiguration::setWebSQLDatabaseDirectory): Add getters and setters to the C++ part of WKContextConfigurationRef. * UIProcess/WebContext.cpp: (WebKit::WebContext::applyPlatformSpecificConfigurationDefaults): Set webSQLDatabaseDirectory and indexedDBDatabaseDirectory. (WebKit::WebContext::WebContext): Initialize m_webSQLDatabaseDirectory and m_indexedDBDatabaseDirectory. (WebKit::WebContext::ensureDatabaseProcess): Set parameters.indexedDatabaseDirectory from m_indexedDBDatabaseDirectory. (WebKit::WebContext::createNewWebProcess): Set parameters.webSQLDatabaseDirectory from m_webSQLDatabaseDirectory. * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformDefaultWebSQLDatabaseDirectory): Rename this to indicate that it's about WebSQL databases. (WebKit::WebContext::platformDefaultIndexedDBDatabaseDirectory): Add this. * WebProcess/WebCoreSupport/WebDatabaseManager.cpp: (WebKit::WebDatabaseManager::initialize): Update for WebProcessCreationParameters rename. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): Update for WebProcessCreationParameters rename. 2014-05-17 Brent Fulgham <bfulgham@apple.com> [Phone Number Detection] drop-down menu in the phone number detection box doesn't appear. https://bugs.webkit.org/show_bug.cgi?id=133024 Reviewed by Sam Weinig. * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm: (WebKit::TelephoneNumberOverlayController::drawRect): Don't clear the set of found phone numbers each time we call drawRect. This gets called ~9 times per screen refresh, so end up with no active phone numbers to interact with. 2014-05-17 Alexey Proskuryakov <ap@apple.com> NetworkProcess can repeatedly crash handling Blob messages after any unrelated crash https://bugs.webkit.org/show_bug.cgi?id=133032 <rdar://problem/16951630> Reviewed by Geoffrey Garen. Replaced assertions with runtime checks. This can happen if NetworkProcess previously crashed for any unrelated reason. * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp: (WebKit::NetworkBlobRegistry::registerBlobURL): (WebKit::NetworkBlobRegistry::registerBlobURLForSlice): (WebKit::NetworkBlobRegistry::unregisterBlobURL): 2014-05-17 Anders Carlsson <andersca@apple.com> -[WKWebView dealloc] should close the page https://bugs.webkit.org/show_bug.cgi?id=133031 <rdar://problem/16929815> Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView dealloc]): 2014-05-16 Anders Carlsson <andersca@apple.com> Expose WKUserScript as API https://bugs.webkit.org/show_bug.cgi?id=133017 <rdar://problem/16948059> Reviewed by Sam Weinig. * DerivedSources.make: Add WebUserContentController. * Shared/API/Cocoa/WebKit.h: Add WKUserScript.h * Shared/API/c/WKSharedAPICast.h: (WebKit::toUserScriptInjectionTime): Update for WKUserScriptInjectionTime -> _WKUserScriptInjectionTime rename. * Shared/API/c/WKUserScriptInjectionTime.h: Rename WKUserScriptInjectionTime to _WKUserScriptInjectionTime to free up the name for the Objective-C API * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode): Encode the user content controller ID. (WebKit::WebPageCreationParameters::decode): Decode the user content controller ID. * Shared/WebPageCreationParameters.h: Add userContentControllerID. * UIProcess/API/C/WKPageGroup.cpp: (WKPageGroupAddUserScript): Update for WKUserScriptInjectionTime -> _WKUserScriptInjectionTime rename. * UIProcess/API/C/WKPageGroup.h: Update for WKUserScriptInjectionTime -> _WKUserScriptInjectionTime rename. * UIProcess/API/Cocoa/WKBrowsingContextGroup.h: Update for WKUserScriptInjectionTime -> _WKUserScriptInjectionTime rename. * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm: (-[WKBrowsingContextGroup addUserScript:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:injectionTime:mainFrameOnly:]): Update for WKUserScriptInjectionTime -> _WKUserScriptInjectionTime rename. * UIProcess/API/Cocoa/WKUserContentController.h: Add new methods. * UIProcess/API/Cocoa/WKUserContentController.mm: (-[WKUserContentController init]): Create the WebUserContentControllerProxy object and user scripts array. (-[WKUserContentController userScripts]): Return the user scripts array. (toWebCoreUserScriptInjectionTime): Helper for converting from a WKUserScriptInjectionTime enum to WebCore::UserScriptInjectionTime. (-[WKUserContentController addUserScript:]): Call through to the _userContentControllerProxy object. (-[WKUserContentController removeAllUserScripts]): Call through to the _userContentControllerProxy object. * UIProcess/API/Cocoa/WKUserContentControllerInternal.h: Added. Add WebUserContentControllerProxy ivar. * UIProcess/API/Cocoa/WKUserScript.h: Added. Add new header. * UIProcess/API/Cocoa/WKUserScript.mm: (-[WKUserScript initWithSource:injectionTime:forMainFrameOnly:]): Initialize the WKUserScript object. (-[WKUserScript source]): (-[WKUserScript injectionTime]): (-[WKUserScript isForMainFrameOnly]): Add getters. (-[WKUserScript copyWithZone:]): Since WKUserScript is immutable, just return a retained object. * UIProcess/API/Cocoa/WKUserScriptInternal.h: Add ivars. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): Set the user content controller from the configuration. * UIProcess/UserContent/WebUserContentControllerProxy.cpp: Added. (WebKit::generateIdentifier): Return a unique identifier. (WebKit::WebUserContentControllerProxy::create): Return a new WebUserContentControllerProxy object. (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy): Initialize m_identifier. (WebKit::WebUserContentControllerProxy::~WebUserContentControllerProxy): Add destructor. (WebKit::WebUserContentControllerProxy::addProcess): Add the process to the m_processes set. If it's the first time doing so, add the user scripts we know about. (WebKit::WebUserContentControllerProxy::removeProcess): Remove the process from m_processes. (WebKit::WebUserContentControllerProxy::addUserScript): Add the user script and let all the web processes know that it was added. (WebKit::WebUserContentControllerProxy::removeAllUserScripts): Remove all user scripts and tell all the web processes about it. * UIProcess/UserContent/WebUserContentControllerProxy.h: Add new class. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::WebPageProxy): If the process is already running, add it to the user content controller. (WebKit::WebPageProxy::close): If the process is running, remove it from the user content controller. (WebKit::WebPageProxy::connectionWillOpen): Add the process to the user content controller. (WebKit::WebPageProxy::resetStateAfterProcessExited): Remove the process from the user content controller. (WebKit::WebPageProxy::creationParameters): Pass along the user content controller ID when creating the web page. * UIProcess/WebPageProxy.h: Add a WebUserContentControllerProxy object to the web page configuration. * WebKit2.xcodeproj/project.pbxproj: Add new files. * WebProcess/InjectedBundle/API/c/WKBundle.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: Update for WKUserScriptInjectionTime -> _WKUserScriptInjectionTime rename. * WebProcess/UserContent/WebUserContentController.cpp: Added. New class that manages a WebCore::UserContentController object. (WebKit::WebUserContentController::getOrCreate): Look up (or create) a WebUserContentController object given its identifier. (WebKit::WebUserContentController::WebUserContentController): Add ourselves as a message receiver. (WebKit::WebUserContentController::~WebUserContentController): Remove ourselves as a message receiver. (WebKit::WebUserContentController::addUserScripts): Add all passed in user scripts to the WebCore user content controller object. (WebKit::WebUserContentController::removeAllUserScripts): Remove all user scripts from the WebCore user content controller object. * WebProcess/UserContent/WebUserContentController.messages.in: Added. Add new messages file. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): Get a WebUserContentController object and pass it along to WebCore. * WebProcess/WebPage/WebPage.h: Add WebUserContentController member. 2014-05-16 Piotr Grad <p.grad@samsung.com> [GTK] Build break after 168978. https://bugs.webkit.org/show_bug.cgi?id=133012. Reviewed by Simon Fraser. * UIProcess/API/gtk/WebKitSettings.cpp: (webKitSettingsConstructed): 2014-05-16 Simon Fraser <simon.fraser@apple.com> Put back a symbol removed in r168978 that Safari needs, but deprecate it. Reviewed by Anders Carlsson. * Shared/API/c/WKDeprecatedFunctions.cpp: (WKPreferencesSetRegionBasedColumnsEnabled): (WKPreferencesGetRegionBasedColumnsEnabled): 2014-05-16 Oliver Hunt <oliver@apple.com> Separate enabling sandbox extensions from the WEB_PROCESS_SANDBOX flag https://bugs.webkit.org/show_bug.cgi?id=133016 Reviewed by Alexey Proskuryakov. Add a distinct SANDBOX_EXTENSIONS flag to guard sandbox extensions and switch over to it in the places that extensions are used. * Shared/SandboxExtension.h: * Shared/mac/SandboxExtensionMac.mm: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didChooseFilesForOpenPanel): * WebKit2Prefix.h: * WebProcess/WebPage/WebPage.cpp: * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2014-05-16 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] Add a heuristic to set the right horizontal offset on rotation for responsive websites https://bugs.webkit.org/show_bug.cgi?id=132937 <rdar://problem/16710097> Reviewed by Simon Fraser. When responsive websites have the content size lay out larger than the minimal layout size, we should not keep the relative horizontal position into view, many of those websites have all the content on the left. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): 2014-05-16 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] On dynamic resize, the content offset is contrained to the old content size https://bugs.webkit.org/show_bug.cgi?id=132972 Reviewed by Simon Fraser. When we set the content offset, UIScrollView limits the value to the current valid range for content size. Since the content size was only updated after the animation, when the first frame comes in, the content offset would sometimes be limited to a smaller rect that the actual content. To fix this, set the expected future content size before changing the offset. During the animation, the content size could have changed arbitrarily. At the end of the animation, we take the actual frame and set the definite content size. Any update after that will be regular updates through didCommitLayer. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _beginAnimatedResizeWithUpdates:]): (-[WKWebView _endAnimatedResize]): 2014-05-16 Simon Fraser <simon.fraser@apple.com> Remove "region-based columns" prefs https://bugs.webkit.org/show_bug.cgi?id=133006 <rdar://problem/16945824> Reviewed by Dave Hyatt. Remove "region-based columns" prefs and related code, since this is only way to render columns now. * Shared/WebPreferencesStore.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetRegionBasedColumnsEnabled): Deleted. (WKPreferencesGetRegionBasedColumnsEnabled): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2014-05-16 Brent Fulgham <bfulgham@apple.com> Work around bug in Silverlight https://bugs.webkit.org/show_bug.cgi?id=133004 Reviewed by Anders Carlsson. * PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm: (WebKit::PluginProcessMainDelegate::doPreInitializationWork): Add low-resolution flag to user defaults prior to NSApplication invocation. This code was moved from PluginProcess::platformInitializeProcess. * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::platformInitializeProcess): Move low-resolution flag setting to PluginProcessMainDelegate. 2014-05-16 Martin Hodovan <mhodovan.u-szeged@partner.samsung.com> [WK2] Change the remaining framework includes from WebKit2 to WebKit https://bugs.webkit.org/show_bug.cgi?id=132956 Reviewed by Sam Weinig. * NetworkProcess/unix/NetworkProcessMainUnix.cpp: * NetworkProcess/unix/NetworkProcessMainUnix.h: * PluginProcess/unix/PluginProcessMainUnix.h: * Shared/API/c/cairo/WKImageCairo.h: * Shared/API/c/cf/WKURLRequestCF.h: * Shared/API/c/cf/WKURLResponseCF.h: * Shared/API/c/efl/WKArrayEfl.cpp: * Shared/API/c/efl/WKArrayEfl.h: * UIProcess/API/C/CoordinatedGraphics/WKView.h: * UIProcess/API/C/WKBatteryManager.h: * UIProcess/API/C/WKBatteryStatus.h: * UIProcess/API/C/WKGrammarDetail.h: * UIProcess/API/C/WKTextChecker.h: * UIProcess/API/C/WKVibration.h: * UIProcess/API/C/WKViewportAttributes.h: * UIProcess/API/C/cairo/WKIconDatabaseCairo.h: * UIProcess/API/C/efl/WKAPICastEfl.h: * UIProcess/API/C/efl/WKColorPickerResultListener.h: * UIProcess/API/C/efl/WKEventEfl.h: * UIProcess/API/C/efl/WKPageEfl.h: * UIProcess/API/C/efl/WKPopupItem.h: * UIProcess/API/C/efl/WKPopupMenuListener.h: * UIProcess/API/C/efl/WKViewEfl.cpp: * UIProcess/API/C/efl/WKViewEfl.h: * UIProcess/API/C/gtk/WKFullScreenClientGtk.h: * UIProcess/API/C/gtk/WKInspectorClientGtk.h: * UIProcess/API/C/gtk/WKView.h: * UIProcess/API/C/gtk/WKViewPrivate.h: * UIProcess/API/C/soup/WKContextSoup.h: * UIProcess/API/C/soup/WKCookieManagerSoup.h: * UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h: * UIProcess/API/C/soup/WKSoupRequestManager.h: * UIProcess/API/Cocoa/WKErrorRecoveryAttempting.h: * UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.h: * UIProcess/API/cpp/efl/WKEinaSharedString.cpp: * UIProcess/API/cpp/efl/WKEinaSharedString.h: * UIProcess/API/efl/EwkView.cpp: * UIProcess/API/efl/EwkView.h: * UIProcess/API/efl/EwkViewCallbacks.h: * UIProcess/API/efl/GestureRecognizer.h: * UIProcess/API/efl/ewk_application_cache_manager_private.h: * UIProcess/API/efl/ewk_auth_request_private.h: * UIProcess/API/efl/ewk_back_forward_list_item_private.h: * UIProcess/API/efl/ewk_back_forward_list_private.h: * UIProcess/API/efl/ewk_context_menu_item.cpp: * UIProcess/API/efl/ewk_context_private.h: * UIProcess/API/efl/ewk_cookie_manager_private.h: * UIProcess/API/efl/ewk_database_manager_private.h: * UIProcess/API/efl/ewk_error_private.h: * UIProcess/API/efl/ewk_favicon_database_private.h: * UIProcess/API/efl/ewk_file_chooser_request_private.h: * UIProcess/API/efl/ewk_page_group_private.h: * UIProcess/API/efl/ewk_popup_menu_item_private.h: * UIProcess/API/efl/ewk_popup_menu_private.h: * UIProcess/API/efl/ewk_security_origin_private.h: * UIProcess/API/efl/ewk_settings_private.h: * UIProcess/API/efl/ewk_storage_manager_private.h: * UIProcess/API/efl/ewk_view.cpp: * UIProcess/API/efl/ewk_view_private.h: * UIProcess/API/efl/ewk_window_features_private.h: * UIProcess/API/efl/tests/InjectedBundle/injected_bundle_sample.cpp: * UIProcess/API/efl/tests/test_ewk2_eina_shared_string.cpp: * UIProcess/API/gtk/WebKitDownloadClient.cpp: * UIProcess/API/gtk/WebKitPrivate.h: * UIProcess/CoordinatedGraphics/WKCoordinatedSceneAPICast.h: * UIProcess/efl/BatteryProvider.h: * UIProcess/efl/ContextHistoryClientEfl.h: * UIProcess/efl/DownloadManagerEfl.h: * UIProcess/efl/FindClientEfl.h: * UIProcess/efl/FormClientEfl.h: * UIProcess/efl/PageLoadClientEfl.h: * UIProcess/efl/PagePolicyClientEfl.h: * UIProcess/efl/PageUIClientEfl.h: * UIProcess/efl/RequestManagerClientEfl.h: * UIProcess/efl/TextCheckerClientEfl.h: * UIProcess/efl/VibrationClientEfl.h: * UIProcess/efl/ViewClientEfl.cpp: * UIProcess/efl/ViewClientEfl.h: * UIProcess/efl/WebInspectorProxyEfl.cpp: * WebProcess/WebCoreSupport/efl/WebErrorsEfl.cpp: * WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp: * WebProcess/efl/SeccompFiltersWebProcessEfl.cpp: * WebProcess/efl/SeccompFiltersWebProcessEfl.h: * WebProcess/efl/WebProcessMainEfl.cpp: * WebProcess/efl/WebProcessMainEfl.h: * WebProcess/gtk/WebGtkInjectedBundleMain.cpp: * WebProcess/gtk/WebProcessMainGtk.cpp: * WebProcess/gtk/WebProcessMainGtk.h: * mac/WKPreferences.h: 2014-05-15 Gyuyoung Kim <gyuyoung.kim@samsung.com> [EFL][WK2] Skip failing unit tests https://bugs.webkit.org/show_bug.cgi?id=132979 Reviewed by Daniel Bates. * PlatformEfl.cmake: Skip failing unit tests for now. 2014-05-15 Simon Fraser <simon.fraser@apple.com> [iOS WK2] When zoomed, fixed elements jump at the start of a scroll, and jump back at the end. https://bugs.webkit.org/show_bug.cgi?id=132978 <rdar://problem/16894428> Reviewed by Benjamin Poulain. Move the static function fixedPositionRectFromExposedRect() to a member function on WebPageProxy so we can call it from more places. Also never give WebCore a customFixedPosition rect that extends past the document bounds, but allow rubber-banding/pinching in the UI process to move fixed elements outside the document. * UIProcess/PageClient.h: Need to expose minimumZoomScale() and contentsSize() to WebPageProxy. * UIProcess/WebPageProxy.h: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::minimumZoomScale): (WebKit::PageClientImpl::contentsSize): * UIProcess/ios/WKContentView.mm: (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): Pass the computeCustomFixedPositionRect(ConstrainedToDocumentRect) to WebCore, but use computeCustomFixedPositionRect() for the ScrollingCoordinator update. (adjustedUnexposedEdge): Deleted. (adjustedUnexposedMaxEdge): Deleted. (fixedPositionRectFromExposedRect): Deleted. * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::adjustedUnexposedEdge): (WebKit::adjustedUnexposedMaxEdge): (WebKit::WebPageProxy::computeCustomFixedPositionRect): * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): This fixes some flashing when the scrolling tree was being updated while scrolling; we now pass the correct rect. 2014-05-15 Mark Rowe <mrowe@apple.com> <https://webkit.org/b/132976> Move discovery of sharing services off the main thread Discovery of sharing services can require disk access and IPC. Since the interface to ServicesController is already asynchronous, we can easily perform the discovery on a background queue. This can eliminate tens to hundreds of milliseconds worth of work from the main thread when creating the first web process. Reviewed by Brady Eidson. * UIProcess/mac/ServicesController.h: * UIProcess/mac/ServicesController.mm: (WebKit::ServicesController::ServicesController): (WebKit::ServicesController::refreshExistingServices): Bail out early if we're already in the process of refreshing the services. Kick the discovery over to a background queue, with it hopping back to the main queue to update the actual state and notify any contexts that were interested. 2014-05-15 Dan Bernstein <mitz@apple.com> Fixed a typo in a comment and updated previous change log entry. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::elementDidFocus): 2014-05-15 Dan Bernstein <mitz@apple.com> <rdar://problem/16844952> [iOS] www.wikipedia.org is loading much slower due to FormClient::willBeginInputSession https://bugs.webkit.org/show_bug.cgi?id=132974 Reviewed by Enrica Casucci. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::elementDidFocus): Don’t call FormClient::willBeginInputSession if the focus isn’t user-initiated, because in that case the UI process will bail out of -_startAssistingNode:userIsInteracting:userObject: before creating an input session and calling the -_webView:didStartInputSession:. 2014-05-15 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] WKWebView sends invalid content offsets at the end of animated resize https://bugs.webkit.org/show_bug.cgi?id=132941 <rdar://problem/16921557> Reviewed by Tim Horton. Since we cannot change the scale and content inset simultaneously while accounting for the obscured insets, we end up with invalid contentOffsets. To work around the problem, change the content scale outside of UIScrollView to ensure none of the side effect happens. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _endAnimatedResize]): 2014-05-15 Tim Horton <timothy_horton@apple.com> WebKit2 View Gestures (Zoom): Document size changes during zoom gesture cause erratic scrolling https://bugs.webkit.org/show_bug.cgi?id=132944 <rdar://problem/15769454> Reviewed by Simon Fraser. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::flushLayers): If a layer flush occurs and we have an active transient zoom, re-apply the transient zoom to the relevant platform layers, because WebCore might have overwritten the relevant layer properties. (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage): Reset m_transientZoomScale before flushLayers() so that we don't re-apply the transient zoom when we're actually trying to commit it. 2014-05-15 Alex Christensen <achristensen@webkit.org> Add pointer lock to features without enabling it. https://bugs.webkit.org/show_bug.cgi?id=132961 Reviewed by Sam Weinig. * Configurations/FeatureDefines.xcconfig: Added ENABLE_POINTER_LOCK to list of features. 2014-05-15 Simon Fraser <simon.fraser@apple.com> [UI-side compositing] Fix copying animations between layers, and pausing them https://bugs.webkit.org/show_bug.cgi?id=132943 <rdar://problem/16906369&16906541> Reviewed by Tim Horton. Fix PlatformCAAnimationRemote to support animation copying, and to record the beginTime for implicitly started animations. This fixes animation pausing, and copying of animations between layers when they go between tiled and non-tiled. This requires sending the animation key back through animationDidStart() so that we can record this beginTime on the PlatformCAAnimationRemote in the web process. This path doesn't set the "hasExplicitBeginTime" flag. PlatformCAAnimationRemote also now stores a hash of active animations, so that it can implement animationForKey(), and record the beginTime. * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart): * UIProcess/mac/RemoteLayerTreeHost.h: * UIProcess/mac/RemoteLayerTreeHost.mm: (WebKit::RemoteLayerTreeHost::animationDidStart): Grovel for the key for this animation; sadly CA doesn't give us an easier way. * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::acceleratedAnimationDidStart): * WebProcess/WebPage/DrawingArea.messages.in: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: (-[WKAnimationDelegate animationDidStart:]): (WebKit::PlatformCAAnimationRemote::copy): (WebKit::PlatformCAAnimationRemote::copyTimingFunctionFrom): (WebKit::PlatformCAAnimationRemote::copyFromValueFrom): (WebKit::PlatformCAAnimationRemote::copyToValueFrom): (WebKit::PlatformCAAnimationRemote::copyValuesFrom): (WebKit::PlatformCAAnimationRemote::copyKeyTimesFrom): (WebKit::PlatformCAAnimationRemote::copyTimingFunctionsFrom): (WebKit::addAnimationToLayer): * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: (WebKit::PlatformCALayerRemote::addAnimationForKey): (WebKit::PlatformCALayerRemote::removeAnimationForKey): (WebKit::PlatformCALayerRemote::animationForKey): (WebKit::PlatformCALayerRemote::animationStarted): * WebProcess/WebPage/mac/PlatformCALayerRemote.h: * WebProcess/WebPage/mac/RemoteLayerTreeContext.h: * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm: (WebKit::RemoteLayerTreeContext::animationDidStart): * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::acceleratedAnimationDidStart): 2014-05-14 Simon Fraser <simon.fraser@apple.com> Clean up "has non-zero begin time" terminology in animations https://bugs.webkit.org/show_bug.cgi?id=132942 Reviewed by Tim Horton. Change the "non-zero beginTime" terminology in the platform CA animations code to "explicit beginTime": this flag really means that we explicitly set the beginTime of the animation, rather than let CA set the beginTime when committing the animation. This flag is used for animations with negative delay, and when pausing. * Shared/mac/RemoteLayerTreeTransaction.mm: (WebKit::RemoteLayerTreeTextStream::operator<<): * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h: * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm: (-[WKAnimationDelegate animationDidStart:]): (WebKit::PlatformCAAnimationRemote::Properties::encode): (WebKit::PlatformCAAnimationRemote::Properties::decode): (WebKit::PlatformCAAnimationRemote::setBeginTime): (WebKit::addAnimationToLayer): 2014-05-15 Tim Horton <timothy_horton@apple.com> [iOS] Incremental updates during scroll-to-top shouldn’t count as “stable” updates https://bugs.webkit.org/show_bug.cgi?id=132934 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _updateVisibleContentRects]): If we're in a scroll-to-top programmatic scroll, the update is not stable. The last event comes in with _isScrollingToTop false, so we do our stable update. 2014-05-15 Carlos Garcia Campos <cgarcia@igalia.com> [GTK] Compile all installed resources as GResources https://bugs.webkit.org/show_bug.cgi?id=131099 Reviewed by Philippe Normand. It avoids conflicts with old WebKit versions, and resources are always found even without installing or using environment variables. * PlatformGTK.cmake: Add rules to write the xml file with the resources depending on the configure options and to generate and build the GResources file. 2014-05-14 Gyuyoung Kim <gyuyoung.kim@samsung.com> [EFL][WK2] Fix an unit test of ewk_context_url_scheme_register() https://bugs.webkit.org/show_bug.cgi?id=132902 Reviewed by Anders Carlsson. This test can be run when CUSTOM_PROTOCOL is enabled. Besides the test needs to check if registered callback function works well. * UIProcess/API/efl/tests/test_ewk2_context.cpp: (EWK2ContextTest::schemeRequestCallback): (TEST_F): 2014-05-14 Ryuan Choi <ryuan.choi@samsung.com> [EFL][WK2] Use default context for ewk_view_add https://bugs.webkit.org/show_bug.cgi?id=132936 Reviewed by Gyuyoung Kim. Since r146265, ewk_view_add created new context and it's regression. This patch restores the behavior of ewk_view_add to original one. * UIProcess/API/efl/ewk_view.cpp: (ewk_view_add): * UIProcess/API/efl/tests/test_ewk2_view.cpp: (TEST_F): 2014-05-14 Maciej Stachowiak <mjs@apple.com> Database Process crashes after loading html5test.com https://bugs.webkit.org/show_bug.cgi?id=132938 <rdar://problem/16241419> Reviewed by Ryosuke Niwa. * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: (WebKit::DatabaseProcessIDBConnection::disconnectedFromWebProcess): Expand comment about the null check. (WebKit::DatabaseProcessIDBConnection::deleteDatabase): Call disconnectedFromWebProcess to pick up its null check and to avoid duplicating code. 2014-05-14 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] The top/bottom edges should not be sticky when restoring the scroll position from the dynamic size update history https://bugs.webkit.org/show_bug.cgi?id=132931 Reviewed by Sam Weinig. The goal of dynamicSizeUpdateHistory is to make dynamic resize completely reversible. Because of the stick-to-edges heuristics, this was not true near the top and bottom edges. For example, start in landscape, scroll the page a bit, then rotate to portrait. Now you have a lot more vertical space, and the top edge of the document is at the edge of the scrollview. Rotate back to landscape: the position is restored correct, but it is then overriden by the stick-to-edges branch. When we restore the position from history, we should only put it back in the valid bounds, skipping stick-to-edges entirely. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): 2014-05-14 Tim Horton <timothy_horton@apple.com> Enable IOSurface view snapshots for 10.9+ https://bugs.webkit.org/show_bug.cgi?id=132932 <rdar://problem/16900619> Reviewed by Dean Jackson. * UIProcess/mac/ViewSnapshotStore.h: r166005 unintentionally worked around <rdar://problem/16734031>. r168689 fixed another bug that caused sometimes randomly white snapshots. It's safe to turn on IOSurface view snapshots where purgeability is supported. 2014-05-14 Alexey Proskuryakov <ap@apple.com> Use the correct client in WebPageProxy::unwrapCryptoKey https://bugs.webkit.org/show_bug.cgi?id=132924 Reviewed by Darin Adler. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::unwrapCryptoKey): Match what we now do in wrapCryptoKey(). 2014-05-14 Zalan Bujtas <zalan@apple.com> Subpixel layout: Change Element.offset* client* scroll* return type to double. https://bugs.webkit.org/show_bug.cgi?id=132895 Reviewed by Simon Fraser. This patch changes Element.offset*, Element.client* and Element.scroll* APIs return type from long to double to match the latest CSSOM View Module spec[1]. Element.offset* and Element.client* do return subpixel values from now on. Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet. subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off from WK2 preferences. It toggles the return value from subpixel to floored integral. It does not change layout/rendering behavior. Reference list of what other browsers do: IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx Blink: http://www.chromestatus.com/features/5497402177880064 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607 [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/ * Shared/WebPreferencesStore.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetSubpixelCSSOMElementMetricsEnabled): (WKPreferencesGetSubpixelCSSOMElementMetricsEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): 2014-05-14 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] Expose the viewport meta tag width on the UIProcess https://bugs.webkit.org/show_bug.cgi?id=132926 <rdar://problem/16892115> Reviewed by Sam Weinig. Safari requires the viewport meta tag width for legacy stuff on WebApps. Just send it over to the UIProcess when it changes. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): (-[WKWebView _setViewportMetaTagWidth:]): (-[WKWebView _viewportMetaTagWidth]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/PageClient.h: * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::didChangeViewportMetaTagWidth): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::viewportMetaTagWidthDidChange): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::viewportPropertiesDidChange): 2014-05-13 Simon Fraser <simon.fraser@apple.com> [iOS WK2] Make view debugging easier https://bugs.webkit.org/show_bug.cgi?id=132892 Reviewed by Tim Horton. Enhance -[WKCompositingView description] to show WebKit-related information which is useful when dumping a window's UIView hierarchy. Also have WKTransformView and WKRemoteView inherit from WKCompositingView, and thereby get the hitTest:withEvent: override for free, as well as better dumping. * UIProcess/ios/RemoteLayerTreeHostIOS.mm: (-[WKCompositingView description]): (-[WKTransformView hitTest:withEvent:]): Deleted. (-[WKRemoteView hitTest:withEvent:]): Deleted. 2014-05-14 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] Fixed positioned element must relayout correctly before sending resize events to the page https://bugs.webkit.org/show_bug.cgi?id=132920 <rdar://problem/16836866> Reviewed by Simon Fraser. During the dynamic resize operation, we do not update the fixed position elements because it is a very hard problem on the UI Process side. When the animation finishes, the fixed positioned rect is recomputed on the UIProcess and pushed to the WebProcess. The problem is sending the rect after the animation is too late, the content can observe the fixed elements layout through JavaScript and would get the old size. This patch fixes the issue updating the CustomFixedPositionLayoutRect on the WebProcess before notifying the content of the resize. First, we layout the content to the new fixed layout size to get the new content size. Then, we compute the new FixedPositionedLayoutRect with FrameView's viewportConstrainedObjectsRect(), this use the real content size and our estimated unobscured content rect. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::dynamicViewportSizeUpdate): 2014-05-14 Enrica Casucci <enrica@apple.com> REGRESSION(WK2): Many pages have very wrong text size after rotating. https://bugs.webkit.org/show_bug.cgi?id=132893 <rdar://problem/16806958> Reviewed by Benjamin Poulain. Whenever our viewport width changes we must reset text autosizing on the renderer. * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize): (WebKit::WebPage::setMinimumLayoutSizeForMinimalUI): (WebKit::WebPage::resetTextAutosizingBeforeLayoutIfNeeded): (WebKit::WebPage::dynamicViewportSizeUpdate): 2014-05-14 Alex Christensen <achristensen@webkit.org> Use references instead of pointers with ResourceLoadTiming. https://bugs.webkit.org/show_bug.cgi?id=132846 Reviewed by Alexey Proskuryakov. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<ResourceResponse>::encode): (IPC::ArgumentCoder<ResourceResponse>::decode): Use references instead of pointers and null checks. 2014-05-14 Tibor Meszaros <tmeszaros.u-szeged@partner.samsung.com> Remove CSS_STICKY_POSITION guards https://bugs.webkit.org/show_bug.cgi?id=132676 Reviewed by Simon Fraser. * Configurations/FeatureDefines.xcconfig: 2014-05-13 Gyuyoung Kim <gyuyoung.kim@samsung.com> [EFL][WK2] Add ewk_view_fixed_layout_size_set|get() https://bugs.webkit.org/show_bug.cgi?id=132811 Reviewed by Christophe Dumez. Some EFL applications need to set size of fixed layout when enabling fixed layout. This APIs can pass ownership regarding the size of fixed layout to application side. * UIProcess/API/efl/ewk_view.cpp: (ewk_view_layout_fixed_size_set): (ewk_view_layout_fixed_size_get): * UIProcess/API/efl/ewk_view.h: * UIProcess/API/efl/tests/test_ewk2_view.cpp: (TEST_F): 2014-05-13 Simon Fraser <simon.fraser@apple.com> Fix "ASSERTION FAILED: m_representation == PlatformLayerRepresentation" with UI-side compositing https://bugs.webkit.org/show_bug.cgi?id=132899 Reviewed by Beth Dakin. The new InsetClipLayer and ContentShadowLayer members on scrolling nodes need to be correctly encoded/decoded for UI-side compositing, and dumped correctly. * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: (ArgumentCoder<ScrollingStateScrollingNode>::encode): (ArgumentCoder<ScrollingStateScrollingNode>::decode): (WebKit::RemoteScrollingTreeTextStream::dump): * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): 2014-05-13 Anders Carlsson <andersca@apple.com> Another build fix. Reviewed by Dan Bernstein. * Shared/API/Cocoa/WKFoundation.h: Make sure to include Availability.h 2014-05-13 Beth Dakin <bdakin@apple.com> REGRESSION (topContentInset): Searching through Facebook Messenger's chat causes scrolling in News Feed https://bugs.webkit.org/show_bug.cgi?id=132889 -and corresponding- <rdar://problem/16715716> Reviewed by Simon Fraser. Re-name scrollOffsetRelativeToDocument() to documentScrollPositionRelativeToViewOrigin(). * WebProcess/WebPage/FindController.cpp: (WebKit::FindController::rectsForTextMatches): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::determinePrimarySnapshottedPlugIn): 2014-05-13 Dean Jackson <dino@apple.com> [iOS] Page scale update messages for media controls should only fire at the end of zooming https://bugs.webkit.org/show_bug.cgi?id=132857 <rdar://problem/16631009> Reviewed by Simon Fraser. As the user was zooming, the media controls that responded to the page scale (and resized themselves) would do so slightly out of sync with the screen refreshes, and it looked terrible. We already know if a pageScale change is happening inside a gesture using the inStableState property of the visibleContentRectUpdateInfo. Simply pass this along to WebCore::Page. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::updateVisibleContentRects): Pass inStableState onto the WebCore::Page. Note that we have to send this message even if the scale has not changed, since the last changing update might not have been stable. 2014-05-13 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] When the secondary UIScrollView delegates respond to callbacks, delay the state change until both delegates have finished https://bugs.webkit.org/show_bug.cgi?id=132849 <rdar://problem/16863716> Reviewed by Anders Carlsson. When there are two delegates responding to UIScrollView changes, there was often an intermediate invalid state forwarded to the UIProcess. For example, on scroll, WKWebView would update the state based on the current obscured insets in response to delegate callbacks. After that update, Safari would modify the insets, thus updating the state again. The first state changed by WKWebView is incomplete, and should never have been set. This patch works around the issue by delaying visible update rect in those cases. When the two delegates of WKScrollView respond to the same selector, WKScrollView invokes [UIWebView _willInvokeUIScrollViewDelegateCallback] on entry, and [UIWebView _didInvokeUIScrollViewDelegateCallback] on exit. Between those two calls, WKWebView does not forward the new UI state to the WebProcess. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _willInvokeUIScrollViewDelegateCallback]): (-[WKWebView _didInvokeUIScrollViewDelegateCallback]): (-[WKWebView _updateVisibleContentRects]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/API/ios/WKViewIOS.mm: (-[WKView _commonInitializationWithContextRef:pageGroupRef:relatedToPage:]): * UIProcess/ios/WKScrollView.h: * UIProcess/ios/WKScrollView.mm: (-[WKScrollViewDelegateForwarder initWithInternalDelegate:externalDelegate:]): (-[WKScrollViewDelegateForwarder forwardInvocation:]): (-[WKScrollView setInternalDelegate:]): 2014-05-13 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] Remove the _extendedBackgroundExclusionInsets SPI https://bugs.webkit.org/show_bug.cgi?id=132848 <rdar://problem/16875093> Reviewed by Darin Adler. The SPI is no longer needed by Safari. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): (-[WKWebView _updateScrollViewBackground]): (-[WKWebView _frameOrBoundsChanged]): (-[WKWebView _setObscuredInsets:]): (-[WKWebView _endAnimatedResize]): (updateTopAndBottomExtendedBackgroundExclusionIfNecessary): Deleted. (-[WKWebView _setExtendedBackgroundExclusionInsets:]): Deleted. (-[WKWebView _extendedBackgroundExclusionInsets]): Deleted. * UIProcess/API/Cocoa/WKWebViewPrivate.h: 2014-05-13 Samuel White <samuel_white@apple.com> AX: Hit testing not accounting for top content inset. https://bugs.webkit.org/show_bug.cgi?id=132876 Reviewed by Chris Fleizach. Updated accessibilityHitTest: to account for top content inset when converting from screen coords to WebKit coords. * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: (-[WKAccessibilityWebPageObject accessibilityHitTest:]): 2014-05-13 Enrica Casucci <enrica@apple.com> REGRESSION (WebKit2): Zooming to text field leaves it partially hidden by the form assistant. https://bugs.webkit.org/show_bug.cgi?id=132879 <rdar://problem/16318049> Reviewed by Benjamin Poulain. Adds the heuristics to zoom and scroll to ensure the element being focused is fully visible and its text readable. * Shared/AssistedNodeInformation.cpp: (WebKit::AssistedNodeInformation::encode): (WebKit::AssistedNodeInformation::decode): * Shared/AssistedNodeInformation.h: (WebKit::AssistedNodeInformation::AssistedNodeInformation): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _zoomToFocusRect:WebCore::selectionRect:WebCore::fontSize:minimumScale:maximumScale:allowUserScaling:forceScroll:]): (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowUserScaling:forceScroll:]): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _displayFormNodeInputView]): (-[WKContentView _startAssistingNode:userIsInteracting:userObject:]): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::getAssistedNodeInformation): 2014-05-13 Simon Fraser <simon.fraser@apple.com> Fix the iOS Simulator build. * UIProcess/mac/ViewSnapshotStore.h: 2014-05-13 Tim Horton <timothy_horton@apple.com> Speculative build fix for iOS. * UIProcess/ios/WebMemoryPressureHandlerIOS.cpp: Removed. * UIProcess/ios/WebMemoryPressureHandlerIOS.mm: Added. (WebKit::WebMemoryPressureHandler::shared): (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler): * WebKit2.xcodeproj/project.pbxproj: Make WebMemoryPressureHandlerIOS Obj-C. 2014-05-13 Anders Carlsson <andersca@apple.com> Another follow-up build fix. * Shared/API/Cocoa/WKFoundation.h: 2014-05-13 Anders Carlsson <andersca@apple.com> Another follow-up build fix. * Shared/API/Cocoa/WKFoundation.h: 2014-05-13 Anders Carlsson <andersca@apple.com> Follow-up fix. * UIProcess/API/Cocoa/WKNavigationAction.mm: (-[WKNavigationAction _initWithNavigationActionData:WebKit::]): (-[WKNavigationAction _isUserInitiated]): 2014-05-13 Anders Carlsson <andersca@apple.com> Add -[WKNavigationAction modifierFlags] and -[WKNavigationAction buttonNumber] https://bugs.webkit.org/show_bug.cgi?id=132880 <rdar://problem/16901354> Reviewed by Dan Bernstein. * Shared/API/Cocoa/WKFoundation.h: Add typedef for older systems. * UIProcess/API/Cocoa/WKNavigationAction.h: Add -[WKNavigationAction modifierFlags] and -[WKNavigationAction buttonNumber] * UIProcess/API/Cocoa/WKNavigationAction.mm: (toWKNavigationType): This can be static now. (toNSEventModifierFlags): Helper to convert WebEvent::Modifiers to NSEventModifierFlags. (toNSButtonNumber): Helper to convert WebMouseEvent::Button to an AppKit button number. (-[WKNavigationAction initWithNavigationActionData:WebKit::]): New initializer that takes a NavigationActionData and fills in the relevant ivars from it. (-[WKNavigationAction _isUserInitiated]): Return the new ivar. * UIProcess/API/Cocoa/WKNavigationActionInternal.h: Remove readwrite overrides. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction): Use initWithNavigationActionData: * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::createNewPage): Use initWithNavigationActionData: 2014-05-13 Tim Horton <timothy_horton@apple.com> WebKit2 View Gestures (Swipe): Encode snapshots as JPEG on some platforms https://bugs.webkit.org/show_bug.cgi?id=127788 <rdar://problem/15928241> Reviewed by Anders Carlsson. Allow JPEG snapshots. Compression is done asynchronously. Enable JPEG snapshots (for now) on all PLATFORM(MAC). We'll switch back to IOSurface snapshots on 10.9+ after <rdar://problem/16734031> is resolved. * UIProcess/API/Cocoa/WKWebView.mm: * UIProcess/API/mac/WKView.mm: (-[WKView _takeViewSnapshot]): Store the image size on the ViewSnapshot. Move IOSurface-related code to ViewSnapshotStore. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::beginSwipeGesture): Adopt asLayerContents(). * UIProcess/mac/ViewGestureController.h: * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::retrieveSnapshotForItem): (WebKit::ViewGestureController::beginSwipeGesture): (WebKit::ViewGestureController::removeSwipeSnapshot): Adopt asLayerContents(). Put the snapshot on the right layer (the parent of the snapshot image layer); if it's on the snapshot image layer itself, if there is no image, the shadow is displayed on top of the white placeholder. Only reset snapshot purgeability if we're using IOSurface snapshots. * UIProcess/mac/ViewSnapshotStore.h: Add a bunch of macros to allow us to switch the snapshot backing store implementation. * UIProcess/mac/ViewSnapshotStore.mm: (WebKit::ViewSnapshotStore::ViewSnapshotStore): (WebKit::ViewSnapshotStore::~ViewSnapshotStore): (WebKit::ViewSnapshotStore::recordSnapshot): If takeViewSnapshot() fails, don't remove the existing snapshot. (WebKit::createIOSurfaceFromImage): (WebKit::compressImageAsJPEG): (WebKit::ViewSnapshotStore::reduceSnapshotMemoryCost): (WebKit::ViewSnapshotStore::didCompressSnapshot): (WebKit::ViewSnapshot::clearImage): (WebKit::ViewSnapshot::asLayerContents): Asynchronously compress snapshots - if we're using JPEG snapshots - for a very large memory win (~20-30x). 2014-05-12 Darin Adler <darin@apple.com> Make a few icon database improvements https://bugs.webkit.org/show_bug.cgi?id=132812 Reviewed by Brady Eidson. * UIProcess/API/C/WKIconDatabase.cpp: (WKIconDatabaseCopyIconDataForPageURL): Moved the actual implementation of this out of the bindings into the WebIconDatabase class. * UIProcess/API/C/WKIconDatabase.h: Fixed argument names that were inconsistent. * UIProcess/WebIconDatabase.cpp: Removed unneeded includes. (WebKit::WebIconDatabase::create): Pass a reference instead of a pointer. (WebKit::WebIconDatabase::WebIconDatabase): Take a reference instead of a pointer. (WebKit::WebIconDatabase::invalidate): Use nullptr. (WebKit::WebIconDatabase::setDatabasePath): Use make_unique. (WebKit::WebIconDatabase::setIconDataForIconURL): Removed unneeded local variable. (WebKit::WebIconDatabase::imageForPageURL): Use nullptr. (WebKit::WebIconDatabase::nativeImageForPageURL): Ditto. (WebKit::WebIconDatabase::didFinishURLImport): Use a modern for loop. (WebKit::WebIconDatabase::iconDataForPageURL): Added. Moved this here from WKIconDatabase.cpp, but also changed to use createWithoutCopying to avoid making another copy of the data for each icon. * UIProcess/WebIconDatabase.h: Removed unneeded includes. Derive from IconDatabaseClient privately. Use nullptr. Added iconDataForPageURL member function. Use a reference for the constructor argument. Use override for virtual functions. Use unique_ptr instead of OwnPtr. 2014-05-12 Mark Lam <mark.lam@apple.com> WebKit2 on iOS needs to capture the main thread's floating point environment. <https://webkit.org/b/132755> Reviewed by Geoffrey Garen. * Shared/mac/ChildProcessMac.mm: (WebKit::ChildProcess::platformInitialize): - Call FloatingPointEnv::enableNeededFloatingPointModes() to initialize the ARMv7 FP env to support denormalized numbers. - Call FloatingPointEnv::saveMainThreadEnvironment() to capture the main thread fp env. 2014-05-12 Gyuyoung Kim <gyuyoung.kim@samsung.com> [EFL][WK2] Fix ewk_view_navigation test in EWK2ViewTest https://bugs.webkit.org/show_bug.cgi?id=132817 Reviewed by Dirk Schulze. To load test html pages, call ewk_view_uri_set() instead of EWK2UnitTestServer. Besides this patch adds test html page for ewk_view_navigation unit test. * UIProcess/API/efl/tests/resources/Page1.html: Added. * UIProcess/API/efl/tests/resources/Page2.html: Added. * UIProcess/API/efl/tests/resources/Page3.html: Added. * UIProcess/API/efl/tests/test_ewk2_view.cpp: (TEST_F): 2014-05-12 Gyuyoung Kim <gyuyoung.kim@samsung.com> Unreviewed, EFL build fix since r168625. * UIProcess/efl/WebContextEfl.cpp: (WebKit::WebContext::platformDefaultLocalStorageDirectory): Remove const keyword. 2014-05-12 Simon Fraser <simon.fraser@apple.com> [iOS WK2] Fuzzy tiles on some sites on loading https://bugs.webkit.org/show_bug.cgi?id=132847 <rdar://problem/16816178> Reviewed by Benjamin Poulain. PlatformCALayerRemoteTiledBacking overrode setContentsScale() but not contentsScale(), causing us to early-return from GraphicsLayerCA::updateContentsScale() and leave the scale wrong. Fix by overriding contentsScale() also. * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp: (WebKit::PlatformCALayerRemoteTiledBacking::contentsScale): * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h: 2014-05-12 Tim Horton <timothy_horton@apple.com> Triple-buffer RemoteLayerBackingStore https://bugs.webkit.org/show_bug.cgi?id=132786 <rdar://problem/16877498> Reviewed by Simon Fraser. We need three buffers because we're currently unable to synchronize with the render server to swap when they're not in use, so we were throwing surfaces away far too frequently. This hugely reduces time spent in IOSurface::create on various repaint benchmarks. * Shared/mac/RemoteLayerBackingStore.h: (WebKit::RemoteLayerBackingStore::hasFrontBuffer): (WebKit::RemoteLayerBackingStore::volatility): Deleted. * Shared/mac/RemoteLayerBackingStore.mm: (WebKit::RemoteLayerBackingStore::RemoteLayerBackingStore): (WebKit::RemoteLayerBackingStore::clearBackingStore): (WebKit::RemoteLayerBackingStore::encode): (WebKit::RemoteLayerBackingStore::decode): (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer): (WebKit::RemoteLayerBackingStore::display): (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer): (WebKit::RemoteLayerBackingStore::setBufferVolatility): (WebKit::RemoteLayerBackingStore::Buffer::discard): (WebKit::RemoteLayerBackingStore::setVolatility): Deleted. * Shared/mac/RemoteLayerBackingStoreCollection.mm: (WebKit::RemoteLayerBackingStoreCollection::purgeabilityTimerFired): Put the ShareableBitmap/IOSurface and a volatility bit in a Buffer struct. Also factor out "throw away this buffer and put it in the pool" into Buffer::discard(). We keep a volatility bit because querying IOSurface purgeability is expensive, and we have a guarantee that any changes will happen in the Web process and go through this class (the lack of this guarantee in most cases is why I'm not putting this bit in WebCore::IOSurface itself). Make it so that each buffer's volatility can be adjusted individually by setBufferVolatility(), and adopt in RemoteLayerBackingStoreCollection. Add a third buffer, m_secondaryBackBuffer, which will swap with the back buffer before swapping front and back if the back buffer (soon to be the front buffer) is still in use by the render server. This means that we will almost never have to throw away a surface because it's in use (and conversely never need to make a new surface). Adjust RemoteLayerBackingStoreCollection to make secondary back surfaces purgeable more aggressively than others. 2014-05-12 Alexey Proskuryakov <ap@apple.com> REGRESSION (r165972): Can't type into text fields in Flash https://bugs.webkit.org/show_bug.cgi?id=132840 <rdar://problem/16671969> Reviewed by Anders Carlsson. * UIProcess/API/mac/WKView.mm: (-[WKView inputContext]): Restore a function that got accidentally lost when adding async text input code. 2014-05-12 Chris Fleizach <cfleizach@apple.com> AX: .js dialogs shown in unload while AX is running crash WebKit. https://bugs.webkit.org/show_bug.cgi?id=123828 Reviewed by Anders Carlsson. Utilize platform API to inform AX clients when the WebProcess will suspend and resume. This allows us to avoid having special behavior for accessibility when the WebProcess needs to wait on a reply. * Platform/IPC/Connection.cpp: (IPC::Connection::waitForSyncReply): * Platform/IPC/Connection.h: * Platform/IPC/mac/ConnectionMac.cpp: (IPC::Connection::willSendSyncMessage): (IPC::Connection::didReceiveSyncReply): * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel): (WebKit::WebChromeClient::runJavaScriptAlert): (WebKit::WebChromeClient::runJavaScriptConfirm): (WebKit::WebChromeClient::runJavaScriptPrompt): (WebKit::WebChromeClient::print): (WebKit::WebChromeClient::exceededDatabaseQuota): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): 2014-05-12 Alex Christensen <achristensen@webkit.org> Progress on web timing. https://bugs.webkit.org/show_bug.cgi?id=132574 Reviewed by Alexey Proskuryakov. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<ResourceResponse>::encode): (IPC::ArgumentCoder<ResourceResponse>::decode): Transfer ResourceLoadTiming values if they exist. 2014-05-12 Dan Bernstein <mitz@apple.com> [Cocoa] Expose WebPage::usesEphemeralSession to the bundle https://bugs.webkit.org/show_bug.cgi?id=132836 Reviewed by Anders Carlsson. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _usesNonPersistentWebsiteDataStore]): * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h: 2014-05-12 Carlos Alberto Lopez Perez <clopez@igalia.com> REGRESSION(168625): [GTK] build broken due to WKContextSetLocalStorageDirectory https://bugs.webkit.org/show_bug.cgi?id=132831 Unreviewed GTK build fix. * UIProcess/gtk/WebContextGtk.cpp: (WebKit::WebContext::platformDefaultLocalStorageDirectory): This is now a static member function. 2014-05-12 Anders Carlsson <andersca@apple.com> WKWebViewConfiguration should fill in the blanks https://bugs.webkit.org/show_bug.cgi?id=132832 <rdar://problem/16886408> Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration init]): (-[WKWebViewConfiguration _validate]): * UIProcess/API/Cocoa/WKWebViewConfigurationInternal.h: 2014-05-12 Anders Carlsson <andersca@apple.com> WKWebView should default to _backgroundExtendsBeyondPage = YES https://bugs.webkit.org/show_bug.cgi?id=132829 <rdar://problem/16886364> Reviewed by Beth Dakin. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView initWithFrame:configuration:]): 2014-05-12 Anders Carlsson <andersca@apple.com> Pass local storage directory to StorageManager::create https://bugs.webkit.org/show_bug.cgi?id=132827 Reviewed by Tim Horton. Since we know the local storage directory at creation time and we know it never changes, we can get rid of setLocalStorageDirectory and just pass the local storage directory at creation time. * UIProcess/Storage/LocalStorageDatabaseTracker.cpp: (WebKit::LocalStorageDatabaseTracker::create): (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker): (WebKit::LocalStorageDatabaseTracker::~LocalStorageDatabaseTracker): (WebKit::LocalStorageDatabaseTracker::setLocalStorageDirectory): Deleted. (WebKit::LocalStorageDatabaseTracker::setLocalStorageDirectoryInternal): Deleted. * UIProcess/Storage/LocalStorageDatabaseTracker.h: * UIProcess/Storage/StorageManager.cpp: (WebKit::StorageManager::create): (WebKit::StorageManager::StorageManager): (WebKit::StorageManager::setLocalStorageDirectory): Deleted. * UIProcess/Storage/StorageManager.h: * UIProcess/WebContext.cpp: (WebKit::WebContext::WebContext): 2014-05-11 Anders Carlsson <andersca@apple.com> Replace WKContextSetLocalStorageDirectory with a context configuration getter/setter https://bugs.webkit.org/show_bug.cgi?id=132809 Reviewed by Dan Bernstein. * UIProcess/API/C/WKContext.cpp: (WKContextSetLocalStorageDirectory): Deleted. * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationCopyLocalStorageDirectory): (WKContextConfigurationSetLocalStorageDirectory): * UIProcess/API/C/WKContextConfigurationRef.h: Add getters and setters for the local storage directory. * UIProcess/API/C/WKContextPrivate.h: Remove WKContextSetLocalStorageDirectory. * UIProcess/API/Cocoa/WKProcessGroup.mm: (-[WKProcessGroup initWithInjectedBundleURL:]): Call WebContext::applyPlatformSpecificConfigurationDefaults. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _initWithConfiguration:]): Call WebContext::applyPlatformSpecificConfigurationDefaults (for now). * UIProcess/APIContextConfiguration.cpp: (API::ContextConfiguration::webContextConfiguration): Set the local storage. Also, call WebContext::applyPlatformSpecificConfigurationDefaults. * UIProcess/APIContextConfiguration.h: (API::ContextConfiguration::injectedBundlePath): This should be const. (API::ContextConfiguration::localStorageDirectory): (API::ContextConfiguration::setLocalStorageDirectory): Add getter and setter. * UIProcess/Storage/StorageManager.cpp: (WebKit::StorageManager::setLocalStorageDirectory): ASSERT that the path isn't null. * UIProcess/WebContext.cpp: (WebKit::WebContext::applyPlatformSpecificConfigurationDefaults): New helper function that will fill in platform specific defaults for empty parameters. (WebKit::WebContext::WebContext): Get the local storage directory from the configuration. (WebKit::WebContext::setLocalStorageDirectory): Deleted. (WebKit::WebContext::localStorageDirectory): Deleted. These are no longer needed. * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformDefaultLocalStorageDirectory): This should be a static member function. 2014-05-12 Martin Hodovan <mhodovan.u-szeged@partner.samsung.com> Typo fix in generate-forwarding-headers https://bugs.webkit.org/show_bug.cgi?id=132820 Reviewed by Anders Carlsson. * Scripts/generate-forwarding-headers.pl: (collectFrameworkHeaderPaths): 2014-05-12 Peter Molnar <pmolnar.u-szeged@partner.samsung.com> [EFL] TLSErrors do not cause page load to fail when not ignored https://bugs.webkit.org/show_bug.cgi?id=131104 Reviewed by Gyuyoung Kim. Added EFL unit test for the bug https://bugs.webkit.org/show_bug.cgi?id=121548 * UIProcess/API/efl/tests/test_ewk2_ssl.cpp: Added new test: ewk_ssl_bad_cert_redirect_https_to_http 2014-05-11 Gordon Sheridan <gordon_sheridan@apple.com> Expose a function to copy favicon data without image conversion. https://bugs.webkit.org/show_bug.cgi?id=132805 Reviewed by Darin Adler. * UIProcess/API/C/WKIconDatabase.cpp: (WKIconDatabaseCopyIconDataForPageURL): Add a function to copy the data from the image of a favicon for an associated page url. * UIProcess/API/C/WKIconDatabase.h: Declare WKIconDatabaseCopyIconDataForPageURL. 2014-05-11 Seongjun Kim <isAir@company100.com> REGRESSION(r168603): [GTK] Build broken. https://bugs.webkit.org/show_bug.cgi?id=132810 Reviewed by Carlos Garcia Campos. * UIProcess/API/gtk/WebKitWebContext.cpp: (createDefaultWebContext): Construct a WebContextConfiguration object and pass it to WebContext::create. 2014-05-11 Anders Carlsson <andersca@apple.com> Remove local storage directory and sandbox extension from WebProcessCreationParameters https://bugs.webkit.org/show_bug.cgi?id=132808 Reviewed by Beth Dakin. * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/WebContext.cpp: (WebKit::WebContext::createNewWebProcess): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): 2014-05-11 Jaehun Lim <ljaehun.lim@samsung.com> Unreviewed, CMake build fix after r168603 Add APIContextConfiguration.cpp and WKContextConfigurationRef.cpp to the source list. * CMakeLists.txt: 2014-05-11 Anders Carlsson <andersca@apple.com> Add a WKContextConfigurationRef object and make the injected bundle path part of the configuration https://bugs.webkit.org/show_bug.cgi?id=132806 <rdar://problem/16830143> Reviewed by Beth Dakin. Many setters on WKContextRef really only make sense to set early on, so move to a pattern where we create a configuration object, a WKContextConfiguration which WKContexts can be created from. Add the injected bundle path as a configuration property. More setters will follow. * Shared/API/c/WKBase.h: Add WKContextConfigurationRef. * Shared/APIObject.h: Add ContextConfiguration enum declaration. * UIProcess/API/C/WKAPICast.h: Handle WKContextConfigurationRef. * UIProcess/API/C/WKContext.cpp: (WKContextCreate): Create an empty WKContextConfigurationRef object and pass it to WKContextCreateWithConfiguration. (WKContextCreateWithInjectedBundlePath): Create a WKContextConfigurationRef object, set its bundle path and pass the configuration to WKContextCreateWithConfiguration. (WKContextCreateWithConfiguration): Convert the WKContextConfigurationRef object to a WebContextConfiguration and pass it to WebContext::create. * UIProcess/API/C/WKContext.h: Add WKContextCreateWithConfiguration. * UIProcess/API/C/WKContextConfigurationRef.cpp: Added. (WKContextConfigurationCreate): Create an API::ContextConfiguration object. (WKContextConfigurationCopyInjectedBundlePath): Return the injected bundle path. (WKContextConfigurationSetInjectedBundlePath): Set the injected bundle path. * UIProcess/API/C/WKContextConfigurationRef.h: Added. New C SPI header. * UIProcess/API/Cocoa/WKProcessGroup.mm: (-[WKProcessGroup initWithInjectedBundleURL:]): Construct a WebContextConfiguration object and pass it to WebContext::Create. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _initWithConfiguration:]): Construct a WebContextConfiguration object and pass it to WebContext::Create. * UIProcess/APIContextConfiguration.cpp: Added. New API::ContextConfiguration object. (API::ContextConfiguration::webContextConfiguration): Construct a WebContextConfiguration struct from our current configuration. * UIProcess/APIContextConfiguration.h: Added. * UIProcess/WebContext.cpp: (WebKit::WebContext::create): Pass the WebContextConfiguration to the constructor. (WebKit::WebContext::WebContext): Set the injected bundle path from the WebContextConfiguration object. * UIProcess/WebContext.h: Change the WebContext constructor and create function to take a WebContextConfiguration object. * WebKit2.xcodeproj/project.pbxproj: Add new files. 2014-05-10 Csaba Osztrogonác <ossy@webkit.org> [WK2] URTBF after r168585. * Platform/IPC/Connection.h: * Shared/ChildProcessProxy.cpp: (WebKit::ChildProcessProxy::terminate): 2014-05-10 Tim Horton <timothy_horton@apple.com> [WKWebView _updateScrollViewBackground] churns UI-and-CGColors while repainting https://bugs.webkit.org/show_bug.cgi?id=132793 <rdar://problem/16877870> Reviewed by Dan Bernstein. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _updateScrollViewBackground]): Don't bypass the cache and make a copy of the CGColor just to set its alpha. Cache the last color and don't bother creating a UIColor nor updating the color on our views if it hasn't changed. 2014-05-10 Tim Horton <timothy_horton@apple.com> Implement -forwardingTargetForSelector on WKScrollViewDelegateForwarder https://bugs.webkit.org/show_bug.cgi?id=132790 <rdar://problem/16877802> Reviewed by Dan Bernstein. * UIProcess/ios/WKScrollView.mm: (-[WKScrollViewDelegateForwarder forwardingTargetForSelector:]): If only one of the delegates will respond to a selector, we can return it from forwardingTargetForSelector: to avoid NSInvocation overhead. 2014-05-10 Dan Bernstein <mitz@apple.com> [Mac] Some targets that link or soft-link WebKit.framework don't depend on it https://bugs.webkit.org/show_bug.cgi?id=132776 Reviewed by Darin Adler. * WebKit2.xcodeproj/project.pbxproj: 2014-05-10 Ryuan Choi <ryuan.choi@samsung.com> [EFL][WK2] Move the ownership of EwkSettings from EwkView to EwkPageGroup https://bugs.webkit.org/show_bug.cgi?id=132771 Reviewed by Gyuyoung Kim. Moved ownership of EwkSettings from EwkView to EwkPageGroup. * UIProcess/API/efl/EwkView.cpp: (EwkView::EwkView): * UIProcess/API/efl/EwkView.h: (EwkView::settings): Deleted. * UIProcess/API/efl/ewk_page_group.cpp: (EwkPageGroup::EwkPageGroup): * UIProcess/API/efl/ewk_page_group_private.h: (EwkPageGroup::settings): * UIProcess/API/efl/ewk_settings_private.h: * UIProcess/API/efl/ewk_view.cpp: (ewk_view_settings_get): 2014-05-10 Tim Horton <timothy_horton@apple.com> [iOS WebKit2] REGRESSION (r168493): Canvasmark 2013 benchmark always hits the RELEASE_ASSERT in RemoteLayerTreeDrawingArea::flushLayers() https://bugs.webkit.org/show_bug.cgi?id=132783 <rdar://problem/16877326> Reviewed by Anders Carlsson. * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush): There's a race window between the BackingStoreFlusher sending the new layer tree to the UI process and updating m_hasFlushed where we can get a reply back in (on the Web process main thread) from the UI process that we committed the new layer tree (didUpdate). This will cause the RELEASE_ASSERT in flushLayers() to fire incorrectly. Since the RELEASE_ASSERT is there only to avoid painting garbage, move our code to set m_hasFlushed=true to after we finish calling CGContextFlush on all of the contexts, instead of after we send the layer tree commit message, which will remove the race entirely. 2014-05-10 Anders Carlsson <andersca@apple.com> ASSERTION FAILED: !m_connection under RunJavaScriptAlert https://bugs.webkit.org/show_bug.cgi?id=132792 <rdar://problem/16691138> Reviewed by Dan Bernstein. Detect if someone implementing a UI delegate method with a completion handler never calls the completion handler and raise an exception instead of asserting. * UIProcess/Cocoa/UIDelegate.mm: (WebKit::CompletionHandlerCallChecker::create): (WebKit::CompletionHandlerCallChecker::~CompletionHandlerCallChecker): (WebKit::CompletionHandlerCallChecker::didCallCompletionHandler): (WebKit::CompletionHandlerCallChecker::CompletionHandlerCallChecker): (WebKit::CompletionHandlerCallChecker::classImplementingDelegateMethod): (WebKit::UIDelegate::UIClient::runJavaScriptAlert): (WebKit::UIDelegate::UIClient::runJavaScriptConfirm): (WebKit::UIDelegate::UIClient::runJavaScriptPrompt): 2014-05-10 Anders Carlsson <andersca@apple.com> Use xpc_connection_kill for killing child processes where appropriate https://bugs.webkit.org/show_bug.cgi?id=132788 <rdar://problem/16664185> Reviewed by Sam Weinig. * Platform/IPC/Connection.h: * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::kill): * Platform/IPC/mac/XPCPtr.h: (IPC::XPCPtr::operator bool): * Shared/ChildProcessProxy.cpp: (WebKit::ChildProcessProxy::terminate): 2014-05-10 Anders Carlsson <andersca@apple.com> WebKit2 is leaking an xpc_connection per web process it creates https://bugs.webkit.org/show_bug.cgi?id=132785 <rdar://problem/14912160> Reviewed by Sam Weinig. Introduce an IPC::XPCPtr smart pointer class and use it for XPC connections inside Connection::Identifier and Connection itself. Make sure we always adopt any connections that are created. * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm: (DatabaseServiceInitializer): * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm: (WebKit::NetworkServiceInitializerDelegate::NetworkServiceInitializerDelegate): (NetworkServiceInitializer): * Platform/IPC/Connection.h: (IPC::Connection::Identifier::Identifier): (IPC::Connection::xpcConnection): * Platform/IPC/mac/ConnectionMac.mm: (IPC::Connection::platformInvalidate): (IPC::Connection::platformInitialize): (IPC::Connection::getAuditToken): * Platform/IPC/mac/XPCPtr.h: Added. (IPC::XPCPtr::XPCPtr): (IPC::XPCPtr::~XPCPtr): (IPC::XPCPtr::get): (IPC::XPCPtr::operator!): (IPC::XPCPtr::operator=): (IPC::adoptXPC): * PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm: (WebKit::PluginServiceInitializerDelegate::PluginServiceInitializerDelegate): (PluginServiceInitializer): * Shared/EntryPointUtilities/mac/LegacyProcess/ChildProcessMain.mm: (WebKit::BootstrapMain): * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h: (WebKit::XPCServiceInitializerDelegate::XPCServiceInitializerDelegate): (WebKit::XPCServiceInitializer): * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm: (WebKit::XPCServiceInitializerDelegate::hasEntitlement): (WebKit::XPCServiceInitializerDelegate::isClientSandboxed): * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm: (WebKit::XPCServiceEventHandler): * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm: (WebKit::XPCServiceEventHandler): * UIProcess/Launcher/ProcessLauncher.cpp: (WebKit::ProcessLauncher::didFinishLaunchingProcess): * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::connectToService): * WebKit2.xcodeproj/project.pbxproj: * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm: (WebContentServiceInitializer): 2014-05-10 Anders Carlsson <andersca@apple.com> Simplify createDataAvailableSource https://bugs.webkit.org/show_bug.cgi?id=132782 <rdar://problem/16815202> Reviewed by Sam Weinig. * Platform/IPC/mac/ConnectionMac.mm: Renamed from Source/WebKit2/Platform/IPC/mac/ConnectionMac.cpp. Rename to make this Objective-C++ so we get the lambda-to-block conversion. (IPC::createDataAvailableSource): Make this a function template and just pass the function directly to dispatch_source_set_event_handler. (IPC::Connection::open): Use lambdas instead of WTF::bind, so we'll make sure the connection is kept alive. * WebKit2.xcodeproj/project.pbxproj: Update for ConnectionMac.cpp to ConnectionMac.mm rename. 2014-05-10 Anders Carlsson <andersca@apple.com> Follow-up fix. Reviewed by Darin Adler. * UIProcess/API/Cocoa/WKNavigationResponse.h: * UIProcess/API/Cocoa/WKNavigationResponse.mm: (-[WKNavigationResponse isForMainFrame]): Use a slightly better name. 2014-05-10 Anders Carlsson <andersca@apple.com> Make -[WKNavigationResponse frame] SPI and only expose -[WKNavigationResponse isMainFrame] https://bugs.webkit.org/show_bug.cgi?id=132781 <rdar://problem/16868319> Reviewed by Darin Adler. * UIProcess/API/Cocoa/WKNavigationResponse.h: * UIProcess/API/Cocoa/WKNavigationResponse.mm: (-[WKNavigationResponse description]): (-[WKNavigationResponse isMainFrameNavigation]): (-[WKNavigationResponse _frame]): (-[WKNavigationResponse frame]): Deleted. (-[WKNavigationResponse setFrame:]): Deleted. * UIProcess/API/Cocoa/WKNavigationResponseInternal.h: * UIProcess/API/Cocoa/WKNavigationResponsePrivate.h: Added. * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::PolicyClient::decidePolicyForResponse): * WebKit2.xcodeproj/project.pbxproj: 2014-05-09 Dan Bernstein <mitz@apple.com> [Cocoa] Remove a deprecated bundle form delegate method now that no one implements it https://bugs.webkit.org/show_bug.cgi?id=132769 Reviewed by Sam Weinig. * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): 2014-05-09 Benjamin Poulain <bpoulain@apple.com> [iOS][WK2] Fix bugs exposed by r168556 https://bugs.webkit.org/show_bug.cgi?id=132768 Reviewed by Ryosuke Niwa. Fix two bugs exposed by r168556. 1) We were only changing the page scale factor when the scale was not adjusted by live resize. The idea was that the scale would either be the same (responsive content) or that it would be defined by the next viewContentRectUpdate. Now that we also send resize and scroll events, we must always update the scale since it affects some APIs observable from JavaScript (like scrolling bounds). 2) Internally, Page's scaleFactor is stored as a float and not double. The rounding error were causing us to send DynamicViewportUpdateChangedTarget() in cases were there is no change of target. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::withinEpsilon): (WebKit::WebPage::dynamicViewportSizeUpdate): 2014-05-09 Ryuan Choi <ryuan.choi@samsung.com> [EFL][WK2] Close icondatabase when EwkFaviconDatabase is destroyed https://bugs.webkit.org/show_bug.cgi?id=132767 Reviewed by Gyuyoung Kim. IconDatabase should be closed explicitly. * UIProcess/API/efl/ewk_favicon_database.cpp: (EwkFaviconDatabase::~EwkFaviconDatabase): 2014-05-09 Anders Carlsson <andersca@apple.com> Another build fix. * mac/MigrateHeadersToWebKit2.make: Don't migrate the WKPreferences.h header, WebKit2 provides its own header. 2014-05-09 Benjamin Poulain <benjamin@webkit.org> [iOS][WK2] Reset the scroll position on the first frame after didCommitLoad https://bugs.webkit.org/show_bug.cgi?id=132765 Reviewed by Tim Horton. Since WebCore does not update our scroll view on load, we need to do that ourself. In case where we need to restore the state from the history, RemoteLayerTreeDrawingAreaProxy will always invoke the scrolling after didCommitLayerTree() (since r167916). Consequently, it is now safe again to reset the scroll position ourself on the first frame. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _didCommitLoadForMainFrame]): (-[WKWebView _didCommitLayerTree:WebKit::]): * UIProcess/API/Cocoa/WKWebViewInternal.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView _didCommitLoadForMainFrame]): 2014-05-09 Anders Carlsson <andersca@apple.com> Update availability macros https://bugs.webkit.org/show_bug.cgi?id=132763 <rdar://problem/15311800> Reviewed by Dan Bernstein. * Configurations/WebKit.xcconfig: * Shared/API/Cocoa/WKBrowsingContextHandle.h: * Shared/API/Cocoa/WKFoundation.h: * Shared/API/Cocoa/_WKFrameHandle.h: * Shared/API/Cocoa/_WKRemoteObjectInterface.h: * Shared/API/Cocoa/_WKRemoteObjectRegistry.h: * UIProcess/API/Cocoa/WKBackForwardList.h: * UIProcess/API/Cocoa/WKBackForwardListItem.h: * UIProcess/API/Cocoa/WKBackForwardListPrivate.h: * UIProcess/API/Cocoa/WKBrowsingContextController.h: * UIProcess/API/Cocoa/WKBrowsingContextGroup.h: * UIProcess/API/Cocoa/WKConnection.h: * UIProcess/API/Cocoa/WKFrameInfo.h: * UIProcess/API/Cocoa/WKNavigation.h: * UIProcess/API/Cocoa/WKNavigationAction.h: (NS_ENUM): * UIProcess/API/Cocoa/WKNavigationData.h: * UIProcess/API/Cocoa/WKNavigationDelegate.h: (NS_ENUM): * UIProcess/API/Cocoa/WKNavigationResponse.h: * UIProcess/API/Cocoa/WKPreferences.h: * UIProcess/API/Cocoa/WKProcessGroup.h: * UIProcess/API/Cocoa/WKProcessPool.h: * UIProcess/API/Cocoa/WKScriptMessage.h: * UIProcess/API/Cocoa/WKScriptMessageHandler.h: * UIProcess/API/Cocoa/WKTypeRefWrapper.h: * UIProcess/API/Cocoa/WKUIDelegate.h: * UIProcess/API/Cocoa/WKUserContentController.h: * UIProcess/API/Cocoa/WKWebView.h: * UIProcess/API/Cocoa/WKWebViewConfiguration.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: (NS_OPTIONS): (NS_ENUM): * UIProcess/API/Cocoa/WKWindowFeatures.h: * UIProcess/API/Cocoa/_WKActivatedElementInfo.h: (NS_ENUM): * UIProcess/API/Cocoa/_WKDownload.h: * UIProcess/API/Cocoa/_WKElementAction.h: (NS_ENUM): * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKScriptWorld.h: * UIProcess/API/Cocoa/_WKThumbnailView.h: * UIProcess/API/Cocoa/_WKVisitedLinkProvider.h: * UIProcess/API/Cocoa/_WKWebsiteDataStore.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h: * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h: * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h: * WebProcess/InjectedBundle/API/mac/WKDOMElement.h: * WebProcess/InjectedBundle/API/mac/WKDOMNode.h: * WebProcess/InjectedBundle/API/mac/WKDOMRange.h: * WebProcess/InjectedBundle/API/mac/WKDOMText.h: * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.h: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h: * mac/rewrite-availability-macros.sh: Added. 2014-05-09 Joseph Pecoraro <pecoraro@apple.com> Web Inspector: Allow Remote Inspector to entitlement check UIProcess through WebProcess https://bugs.webkit.org/show_bug.cgi?id=132409 Reviewed by Timothy Hatcher. * WebProcess/WebCoreSupport/WebInspectorClient.h: * WebProcess/WebCoreSupport/WebInspectorClient.cpp: (WebKit::WebInspectorClient::parentProcessIdentifier): Deleted. pid per debuggable is no longer needed. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess): Immediately pass the parent process pid and audit_token on to the RemoteInspector singleton when the process is created so that it can be sent to webinspectord. 2014-05-09 Enrica Casucci <enrica@apple.com> REGRESSION (WebKit2): Tapping in search field at wikipedia.org doesn’t bring up the keyboard. https://bugs.webkit.org/show_bug.cgi?id=132761 <rdar://problem/16857491> Reviewed by Benjamin Poulain. The interactionAssistant accessor should never create an instance of UIWKTextInteractionAssistant, but simply return the value of _textInteractionAssistant. The text interaction assistant should only be created when needed so that the rest of the code could reliably check if we are interacting with text or not. * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView interactionAssistant]): 2014-05-09 Simon Fraser <simon.fraser@apple.com> Fix some issues with scrolling tree logging https://bugs.webkit.org/show_bug.cgi?id=132762 Reviewed by Tim Horton. Only dump viewport constraints when they change, and dump the primary layer on scrolling nodes. * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: (WebKit::RemoteScrollingTreeTextStream::dump): Dump the primary layer. 2014-05-09 Simon Fraser <simon.fraser@apple.com> [iOS WK2] Fixed elements can go outside the document on pinching https://bugs.webkit.org/show_bug.cgi?id=132759 <rdar://problem/16870835> Reviewed by Benjamin Poulain. Constrain the rect used to position fixed position objects when pinching (when the scale goes below the minimumScale). Do so in such a way that there's a smooth transition between rubber-banding and pinching. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _updateScrollViewBackground]): Use a nicer form for std::max<>. (-[WKWebView _updateVisibleContentRects]): Pass the minimum scale. * UIProcess/API/ios/WKViewIOS.mm: (-[WKView _updateVisibleContentRects]): Ditto. * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (adjustedUnexposedEdge): Helper to adjust the left/top. (adjustedUnexposedMaxEdge): Helper to adjust the right/bottom. (fixedPositionRectFromExposedRect): (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:minimumScale:inStableState:]): (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]): Deleted. 2014-05-09 Zalan Bujtas <zalan@apple.com> Subpixel rendering[iOS]: Top bar on apple.com/support jiggles when the swoosh animates. https://bugs.webkit.org/show_bug.cgi?id=132750 <rdar://pr