ChangeLog   [plain text]


2015-07-23  Babak Shafiei  <bshafiei@apple.com>

        Merge r187248.

    2015-07-23  Brady Eidson  <beidson@apple.com>

            Crash in WebPlatformStrategies::createPingHandle - Deref a null NetworkingContext.
            <rdar://problem/21949735> and https://bugs.webkit.org/show_bug.cgi?id=147227

            Reviewed by Alexey Proskuryakov.

            * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
            (WebKit::WebPlatformStrategies::createPingHandle): Skip it if there's a null NetworkingContext.

2015-07-21  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r185915. rdar://problem/21716368

    2015-06-24  Brady Eidson  <beidson@apple.com>

            Update JavaScript dialog delegates to include a WKSecurityOriginRef argument.
            <rdar://problem/21269187> and https://bugs.webkit.org/show_bug.cgi?id=146249

            Reviewed by Alex Christensen.

            * UIProcess/API/C/WKPage.cpp:
            (WKPageSetPageUIClient): Call the new signature if the client has it set.
              Otherwise fall back to the old signature.
            * UIProcess/API/C/WKPageUIClient.h: Deprecate the old method signature, and add the new
              one to the newest V5 client structure.

2015-07-21  Lucas Forschler  <lforschler@apple.com>

        Merge r186812

    2015-07-14  Sam Weinig  <sam@webkit.org>

            WebKit needs to serialize numeric values in NSError userInfo
            <rdar://problem/21818117>
            https://bugs.webkit.org/show_bug.cgi?id=146936

            Reviewed by Anders Carlsson.

            * Shared/mac/WebCoreArgumentCodersMac.mm:
            (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
            Encode userInfo values that are NSNumbers in addition to NSStrings and NSURLs. Decoding 
            is already handled.

2015-07-15  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r186838. rdar://problem/21716363

    2015-07-15  David Kilzer  <ddkilzer@apple.com>

            REGRESSION (r186559): Follow-up fix to merge r183861 for <rdar://problem/21716677>

            * NetworkProcess/NetworkResourceLoader.cpp:
            (WebKit::NetworkResourceLoader::cleanup): Restore call to
            deref() so we don't leak the NetworkResourceLoader.

2015-07-15  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r186559. rdar://problem/21716363

    2015-07-08  Matthew Hanson  <matthew_hanson@apple.com>

            Merge r183861. rdar://problem/21716677

        2015-05-05  Alexey Proskuryakov  <ap@apple.com>

                NetworkResourceLoader::cleanup() should clear ResourceHandle client pointer.
                https://bugs.webkit.org/show_bug.cgi?id=144641
                rdar://problem/20250960

                Reviewed by David Kilzer.

                * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::cleanup):
                Clear the client pointer.

                * Shared/Authentication/AuthenticationManager.cpp:
                (WebKit::AuthenticationManager::useCredentialForChallenge):
                (WebKit::AuthenticationManager::continueWithoutCredentialForChallenge):
                (WebKit::AuthenticationManager::cancelChallenge):
                (WebKit::AuthenticationManager::performDefaultHandling):
                (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinue):
                Updated comments, which were not accurate, at least on Mac.

2015-07-15  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r186781. rdar://problem/21708063

    2015-07-13  David Kilzer  <ddkilzer@apple.com>

            Merge r186530. rdar://problem/21708151

        2015-07-08  Brady Eidson  <beidson@apple.com>

            Move PingLoaders to the NetworkingProcess.
            <rdar://problem/18860263> and https://bugs.webkit.org/show_bug.cgi?id=146710

            Reviewed by Tim Horton.

            * NetworkProcess/NetworkConnectionToWebProcess.cpp:
            (WebKit::NetworkConnectionToWebProcess::loadPing): Create a PingHandle and then return.
            * NetworkProcess/NetworkConnectionToWebProcess.h:
            * NetworkProcess/NetworkConnectionToWebProcess.messages.in:

            * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
            (WebKit::WebPlatformStrategies::createPingHandle): If the Network process is enabled,
              compile the appropriate load parameters and then message to it.
              Otherwise, use the default in-process PingHandle.
            * WebProcess/WebCoreSupport/WebPlatformStrategies.h:

2015-07-15  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r186763. rdar://problem/21707917

    2015-07-13  David Kilzer  <ddkilzer@apple.com>

            Merge r186476. rdar://problem/21708269

        2015-07-07  Brady Eidson  <beidson@apple.com>

            HTTP Auth cached after disabling private browsing/reset.
            <rdar://problem/8293055> and https://bugs.webkit.org/show_bug.cgi?id=146654

            Reviewed by Tim Horton.

            * WebProcess/Plugins/PluginView.cpp:
            (WebKit::PluginView::getAuthenticationInfo):

2015-07-15  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r186804. rdar://problem/21716368

    2015-07-14  Lucas Forschler  <lforschler@apple.com>

            Merge r185877. <rdar://problem/21709291>

        2015-06-23  Brady Eidson  <beidson@apple.com>

                WKFrameInfo should have an accessor for the Frame's current security origin.
                https://bugs.webkit.org/show_bug.cgi?id=146162

                Reviewed by Dan Bernstein.

                This patch:
                - Promotes _WKSecurityOrigin to API.
                - Makes the WKSecurityOrigin Cocoa API object work with API::SecurityOrigin.
                - Adds a WKSecurityOrigin accessor to WKFrameInfo.
                - Changes IPC messaging so every handler that calls out with a WKFrameInfo object
                  gets a relevant SecurityOrigin to wrap.

                * Shared/API/APISecurityOrigin.h:
                (API::SecurityOrigin::create):
                (API::SecurityOrigin::SecurityOrigin):

                * Shared/API/Cocoa/WebKit.h:

                * Shared/API/c/WKSharedAPICast.h:
                (WebKit::toCopiedAPI):

                * Shared/Cocoa/APIObject.mm:
                (API::Object::newObject):

                * Shared/SecurityOriginData.cpp:
                (WebKit::SecurityOriginData::fromFrame):
                * Shared/SecurityOriginData.h:

                * UIProcess/API/APIFrameInfo.cpp:
                (API::FrameInfo::FrameInfo):
                * UIProcess/API/APIFrameInfo.h:

                * UIProcess/API/APINavigationClient.h:
                (API::NavigationClient::didFailProvisionalLoadInSubframeWithError):

                * UIProcess/API/APIUIClient.h:
                (API::UIClient::createNewPage):
                (API::UIClient::runJavaScriptAlert):
                (API::UIClient::runJavaScriptConfirm):
                (API::UIClient::runJavaScriptPrompt):

                * UIProcess/API/C/WKApplicationCacheManager.cpp:
                (WKApplicationCacheManagerGetApplicationCacheOrigins):

                * UIProcess/API/C/WKKeyValueStorageManager.cpp:
                (WKKeyValueStorageManagerGetKeyValueStorageOrigins):

                * UIProcess/API/C/WKOriginDataManager.cpp:
                (WKOriginDataManagerGetOrigins):

                * UIProcess/API/C/WKPage.cpp:
                (WKPageSetPageUIClient):
                (WKPageSetPageNavigationClient):

                * UIProcess/API/C/WKResourceCacheManager.cpp:
                (WKResourceCacheManagerGetCacheOrigins):

                * UIProcess/API/Cocoa/WKFrameInfo.h:
                * UIProcess/API/Cocoa/WKFrameInfo.mm:
                (-[WKFrameInfo securityOrigin]):

                * UIProcess/API/Cocoa/WKSecurityOrigin.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKSecurityOrigin.h.
                * UIProcess/API/Cocoa/WKSecurityOrigin.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKSecurityOrigin.mm.
                (-[WKSecurityOrigin dealloc]):
                (-[WKSecurityOrigin description]):
                (-[WKSecurityOrigin protocol]):
                (-[WKSecurityOrigin host]):
                (-[WKSecurityOrigin port]):
                (-[WKSecurityOrigin _apiObject]):
                * UIProcess/API/Cocoa/WKSecurityOriginInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/_WKSecurityOriginInternal.h.
                (API::wrapper):

                * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:

                * UIProcess/API/Cocoa/WKUserContentController.mm:

                * UIProcess/API/Cocoa/_WKSecurityOrigin.h:
                * UIProcess/API/Cocoa/_WKSecurityOrigin.mm:
                (-[_WKSecurityOrigin _initWithSecurityOrigin:]): Deleted.
                (-[_WKSecurityOrigin protocol]): Deleted.
                (-[_WKSecurityOrigin host]): Deleted.
                (-[_WKSecurityOrigin port]): Deleted.

                * UIProcess/Cocoa/NavigationState.h:
                * UIProcess/Cocoa/NavigationState.mm:
                (WebKit::NavigationState::NavigationClient::didFailProvisionalLoadInSubframeWithError):

                * UIProcess/Cocoa/UIDelegate.h:
                * UIProcess/Cocoa/UIDelegate.mm:
                (WebKit::UIDelegate::UIClient::createNewPage):
                (WebKit::UIDelegate::UIClient::runJavaScriptAlert):
                (WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
                (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
                (WebKit::UIDelegate::UIClient::exceededDatabaseQuota):
                (WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota):

                * UIProcess/UserContent/WebScriptMessageHandler.h:

                * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
                (WebKit::WebUserContentControllerProxy::didPostMessage):
                * UIProcess/UserContent/WebUserContentControllerProxy.h:
                * UIProcess/UserContent/WebUserContentControllerProxy.messages.in:

                * UIProcess/WebPageProxy.cpp:
                (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
                (WebKit::WebPageProxy::decidePolicyForNavigationAction):
                (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
                (WebKit::WebPageProxy::decidePolicyForResponse):
                (WebKit::WebPageProxy::decidePolicyForResponseSync):
                (WebKit::WebPageProxy::createNewPage):
                (WebKit::WebPageProxy::runJavaScriptAlert):
                (WebKit::WebPageProxy::runJavaScriptConfirm):
                (WebKit::WebPageProxy::runJavaScriptPrompt):
                * UIProcess/WebPageProxy.h:
                * UIProcess/WebPageProxy.messages.in:

                * WebKit2.xcodeproj/project.pbxproj:

                * WebProcess/UserContent/WebUserContentController.cpp:
                (WebKit::WebUserMessageHandlerDescriptorProxy::didPostMessage):

                * WebProcess/WebCoreSupport/WebChromeClient.cpp:
                (WebKit::WebChromeClient::createWindow):
                (WebKit::WebChromeClient::runJavaScriptAlert):
                (WebKit::WebChromeClient::runJavaScriptConfirm):
                (WebKit::WebChromeClient::runJavaScriptPrompt):

                * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
                (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
                (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
                (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
                (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

2015-07-09  David Kilzer  <ddkilzer@apple.com>

        Merge r184991. rdar://problem/21716403

    2015-05-28  Alexey Proskuryakov  <ap@apple.com>

        Clean up VisitedLinkProvider teardown
        https://bugs.webkit.org/show_bug.cgi?id=145450
        rdar://problem/20244726

        Reviewed by Brady Eidson.

        * UIProcess/VisitedLinkProvider.cpp:
        (WebKit::VisitedLinkProvider::~VisitedLinkProvider):

2015-07-09  Matthew Hanson  <matthew_hanson@apple.com>

        Roll out r186559. rdar://problem/21716363

    2015-07-09  Matthew Hanson  <matthew_hanson@apple.com>

            Merge r186559. rdar://problem/21716363

        2015-07-08  Matthew Hanson  <matthew_hanson@apple.com>

                Merge r183861. rdar://problem/21716677

            2015-05-05  Alexey Proskuryakov  <ap@apple.com>

                    NetworkResourceLoader::cleanup() should clear ResourceHandle client pointer.
                    https://bugs.webkit.org/show_bug.cgi?id=144641
                    rdar://problem/20250960

                    Reviewed by David Kilzer.

                    * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::cleanup):
                    Clear the client pointer.

                    * Shared/Authentication/AuthenticationManager.cpp:
                    (WebKit::AuthenticationManager::useCredentialForChallenge):
                    (WebKit::AuthenticationManager::continueWithoutCredentialForChallenge):
                    (WebKit::AuthenticationManager::cancelChallenge):
                    (WebKit::AuthenticationManager::performDefaultHandling):
                    (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinue):
                    Updated comments, which were not accurate, at least on Mac.

2015-07-09  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r186591. rdar://problem/21716407

    2015-07-09  David Kilzer  <ddkilzer@apple.com>

            <rdar://problem/21716549> Donner: Safari URL And Javascript Prompt Origin Spoof Vulnerability

            Merge r184151.

            * UIProcess/FrameLoadState.h:
            (WebKit::FrameLoadState::state):
            (WebKit::FrameLoadState::url):
            (WebKit::FrameLoadState::provisionalURL):
            (WebKit::FrameLoadState::unreachableURL):
            - Merge FrameLoadState getter methods from r183813.  Only
              FrameLoadState::state() is used in this patch, but there may
              be later patches that depend on these methods.

        2015-05-11  Dan Bernstein  <mitz@apple.com>

            WebKit2 part of <rdar://problem/20878075> Trying to navigate to an invalid URL loads about:blank, but -[WKWebView URL] returns the invalid URL

            Reviewed by Alexey Proskuryakov.

            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::didChangeProvisionalURLForFrame): Added. Update internal state the
            same way we update it for server redirects, but don’t make client callbacks. Clients
            observing the URL property will see it change.
            * UIProcess/WebPageProxy.h:

            * UIProcess/WebPageProxy.messages.in: Added DidChangeProvisionalURLForFrame.

            * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
            (WebKit::WebFrameLoaderClient::dispatchDidChangeProvisionalURL): Override this new
            FrameLoaderClient function to send a DidChangeProvisionalURLForFrame message to the UI
            process.
            * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

2015-07-09  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r186559. rdar://problem/21716363

    2015-07-08  Matthew Hanson  <matthew_hanson@apple.com>

            Merge r183861. rdar://problem/21716677

        2015-05-05  Alexey Proskuryakov  <ap@apple.com>

                NetworkResourceLoader::cleanup() should clear ResourceHandle client pointer.
                https://bugs.webkit.org/show_bug.cgi?id=144641
                rdar://problem/20250960

                Reviewed by David Kilzer.

                * NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::cleanup):
                Clear the client pointer.

                * Shared/Authentication/AuthenticationManager.cpp:
                (WebKit::AuthenticationManager::useCredentialForChallenge):
                (WebKit::AuthenticationManager::continueWithoutCredentialForChallenge):
                (WebKit::AuthenticationManager::cancelChallenge):
                (WebKit::AuthenticationManager::performDefaultHandling):
                (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinue):
                Updated comments, which were not accurate, at least on Mac.

2015-07-09  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r186539. rdar://problem/21707873

    2015-07-08  Lucas Forschler  <lforschler@apple.com>

            Merge r186232 rdar://problem/9091261

        2015-07-02  Brady Eidson  <beidson@apple.com>

                Add preference to disable all http-equiv.
                <rdar://problem/9091261> and https://bugs.webkit.org/show_bug.cgi?id=146553

                Reviewed by Sam Weinig.

                * Shared/WebPreferencesDefinitions.h:

                * UIProcess/API/C/WKPreferences.cpp:
                (WKPreferencesSetMetaRefreshEnabled): Still expose this SPI, but have it affect
                  the "httpEquivEnabled" setting.
                (WKPreferencesGetMetaRefreshEnabled): Ditto
                (WKPreferencesSetHTTPEquivEnabled):
                (WKPreferencesGetHTTPEquivEnabled):
                * UIProcess/API/C/WKPreferencesRefPrivate.h:

                * WebProcess/InjectedBundle/InjectedBundle.cpp:
                (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

                * WebProcess/WebPage/WebPage.cpp:
                (WebKit::WebPage::updatePreferences):

2015-06-08  Babak Shafiei  <bshafiei@apple.com>

        Merge r183682.

    2015-05-01  Brady Eidson  <beidson@apple.com>

            Add API to disable meta refreshes.
            <rdar://problem/20333198> and https://bugs.webkit.org/show_bug.cgi?id=144269

            Reviewed by Alexey Proskuryakov.

            Add a preference to enable/disable meta refreshes, enabled by default.

            * Shared/WebPreferencesDefinitions.h:
            * UIProcess/API/C/WKPreferences.cpp:
            (WKPreferencesSetMetaRefreshEnabled):
            (WKPreferencesGetMetaRefreshEnabled):
            (WKPreferencesGetIgnoreViewportScalingConstraints): Deleted.
            * UIProcess/API/C/WKPreferencesRefPrivate.h:
            * WebProcess/InjectedBundle/InjectedBundle.cpp:
            (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
            * WebProcess/WebPage/WebPage.cpp:
            (WebKit::WebPage::updatePreferences):

2015-04-23  Babak Shafiei  <bshafiei@apple.com>

        Merge r181656 & r182985.

    2015-04-18  Simon Fraser  <simon.fraser@apple.com>

            REGRESSION (r181656): Animated tiled layers are missing content
            https://bugs.webkit.org/show_bug.cgi?id=143911
            rdar://problem/20596328

            Reviewed by Darin Adler.
    
            After r181656, all requestAnimationFrame was falling back to timers, and not
            using the platform's DisplayRefreshMonitor, because of a Nullopt vs nullptr
            fumble.
    
            Replace this confusing Optional<> code with simpler code that just forces the
            clients to make a DisplayRefreshMonitor if they can, first asking
            ChromeClient, and then falling back to createDefaultDisplayRefreshMonitor().
    
            Make lots of things into references, and use C++11 initialization in some places.

            * WebProcess/WebCoreSupport/WebChromeClient.cpp:
            (WebKit::WebChromeClient::createDisplayRefreshMonitor):
            * WebProcess/WebCoreSupport/WebChromeClient.h:

    2015-03-17  Timothy Horton  <timothy_horton@apple.com>

            Reproducible null deref under ScriptedAnimationController::createDisplayRefreshMonitor
            https://bugs.webkit.org/show_bug.cgi?id=142776
            <rdar://problem/18921338>

            Reviewed by Alexey Proskuryakov.

            * WebProcess/WebCoreSupport/WebChromeClient.cpp:
            (WebKit::WebChromeClient::createDisplayRefreshMonitor):
            * WebProcess/WebCoreSupport/WebChromeClient.h:
            Adjust to the new signature.

2015-04-23  Babak Shafiei  <bshafiei@apple.com>

        Roll out r181656. rdar://problem/20545362

2015-04-22  Dana Burkart  <matthew_hanson@apple.com>

        Merge r181580 for rdar://problem/20545393.

    2015-03-13  Enrica Casucci  <enrica@apple.com>

            Webkit crash in WebKit::nextFocusableElement() when typing TAB on external keyboard
            rdar://problem/20155503

            Reviewed by David Kilzer.

            Adding null check!

            * WebProcess/WebPage/ios/WebPageIOS.mm:
            (WebKit::nextFocusableElement):

2015-04-22  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r182746. rdar://problem/20645260

    2015-04-13  Timothy Horton  <timothy_horton@apple.com>

            javascript: links in inline PDFs shouldn't execute JavaScript in the context of the host website
            https://bugs.webkit.org/show_bug.cgi?id=143642
            <rdar://problem/18259355>

            Reviewed by Darin Adler.

            * WebProcess/Plugins/PDF/PDFPlugin.mm:
            (WebKit::PDFPlugin::clickedLink):
            Don't follow javascript: URLs.

2015-04-22  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r182084. rdar://problem/20557359

    2015-03-27  Andreas Kling  <akling@apple.com>

            WebProcessProxy should not retain WebBackForwardListItems forever.
            <https://webkit.org/b/143152>
            <rdar://problem/19925709>

            Reviewed by Anders Carlsson.

            Have WebProcessProxy actually forget about a WebBackForwardListItem after it's removed from
            the WebBackForwardList.

            This ensures that we don't accumulate too many of these objects, which can get quite large
            due to the session state encoded in them.

            We already have graceful handling of the case where an incoming IPC message references
            a removed back/forward list item.

            * UIProcess/WebBackForwardList.cpp:
            (WebKit::WebBackForwardList::didRemoveItem):
            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::backForwardRemovedItem):
            * UIProcess/WebProcessProxy.cpp:
            (WebKit::WebProcessProxy::removeBackForwardItem):
            * UIProcess/WebProcessProxy.h:

2015-04-22  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r181991. rdar://problem/20545332

    2015-03-25  Chris Dumez  <cdumez@apple.com>

            [WK2] WebFrameLoaderClient::dispatchDecidePolicyForResponse() should always call the FramePolicyFunction
            https://bugs.webkit.org/show_bug.cgi?id=143036
            <rdar://problem/20252438>
            <rdar://problem/13811738>

            Reviewed by Alexey Proskuryakov.

            WebFrameLoaderClient::dispatchDecidePolicyForResponse() should always
            call the FramePolicyFunction. Previously, it would fail to do in 2
            cases:
            - m_frame->page() returns null
            or
            - webPage->sendSync() returns false

            If the FramePolicyFunction is not called, we will fail to clear the
            callback in the PolicyChecker and
            DocumentLoader::continueAfterContentPolicy() will not be called.

            DocumentLoader::continueAfterContentPolicy() is in charge of resetting
            m_waitingForContentPolicy flag to false. This could therefore explain
            the following assertion being hit in DocumentLoader::detachFromFrame()
            (see <rdar://problem/20252438>):
            RELEASE_ASSERT(!m_waitingForContentPolicy)

            Also, as the PolicyChecker callback is not cleared, it could make it
            possible for DocumentLoader::continueAfterContentPolicy() to be called
            *after* the load is finished, when later canceling the PolicyCallback:
            FrameLoader::stopAllLoaders()
             -> PolicyChecker::stopCheck()
              -> PolicyCallback::cancel()
               -> DocumentLoader::continueAfterContentPolicy(PolicyIgnore)

            Calling continueAfterContentPolicy(PolicyIgnore) after the load is
            finished would be bad and could explain some of the crashes we've seen
            in DocumentLoader::continueAfterContentPolicy() ->
            DocumentLoader:: stopLoadingForPolicyChange() (see
            <rdar://problem/13811738>).

            This patch also applies the same fix to
            dispatchDecidePolicyForNewWindowAction() and
            dispatchDecidePolicyForNavigationAction() as they use the same pattern.

            * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
            (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
            (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
            (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

2015-04-22  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r181812. rdar://problem/20557289

    2015-03-20  Beth Dakin  <bdakin@apple.com>

            [Immediate Actions] Should re-enable immediate actions for iBooks
            https://bugs.webkit.org/show_bug.cgi?id=142915
            -and corresponding-
            rdar://problem/19585689

            Reviewed by Tim Horton.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView initWithFrame:processPool:configuration:webView:]):

2015-04-22  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r181656. rdar://problem/20545362

    2015-03-17  Timothy Horton  <timothy_horton@apple.com>

            Reproducible null deref under ScriptedAnimationController::createDisplayRefreshMonitor
            https://bugs.webkit.org/show_bug.cgi?id=142776
            <rdar://problem/18921338>

            Reviewed by Alexey Proskuryakov.

            * WebProcess/WebCoreSupport/WebChromeClient.cpp:
            (WebKit::WebChromeClient::createDisplayRefreshMonitor):
            * WebProcess/WebCoreSupport/WebChromeClient.h:
            Adjust to the new signature.

2015-04-22  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r174288. rdar://problem/20368461

    2014-10-03  Jer Noble  <jer.noble@apple.com>

            Revert an accidental change introduced by r173318.

            Rubber-stamped by Tim Horton.

            * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
            (WebKit::TiledCoreAnimationDrawingArea::suspendPainting):
            (WebKit::TiledCoreAnimationDrawingArea::resumePainting):

2015-04-17  Lucas Forschler  <lforschler@apple.com>

        Merge r182285

    2015-04-02  Alexey Proskuryakov  <ap@apple.com>

            Make checkURLReceivedFromWebProcess not rely on details of platform URL implementation.
            https://bugs.webkit.org/show_bug.cgi?id=143222
            rdar://problem/19978997

            Reviewed by Sam Weinig.

            * UIProcess/WebProcessProxy.cpp:
            (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess):

2015-04-17  Lucas Forschler  <lforschler@apple.com>

        Merge r181864

    2015-03-23  Anders Carlsson  <andersca@apple.com>

            Make platform/mac-wk2/plugins/destroy-during-async-npp-new.html work again.
            https://bugs.webkit.org/show_bug.cgi?id=133692
            rdar://problem/17255947

            Reviewed by Alexey Proskuryakov.

            Add plug-in destruction protectors around message receiver code that can call out to NPObjects or JavaScript
            where we need the plug-in to stay around after the call.

            * Shared/Plugins/NPObjectMessageReceiver.cpp:
            (WebKit::NPObjectMessageReceiver::invoke):
            (WebKit::NPObjectMessageReceiver::invokeDefault):
            (WebKit::NPObjectMessageReceiver::getProperty):
            (WebKit::NPObjectMessageReceiver::setProperty):
            (WebKit::NPObjectMessageReceiver::construct):

2015-03-07  Babak Shafiei  <bshafiei@apple.com>

        Merge r181176.

    2015-03-06  Beth Dakin  <bdakin@apple.com>

            REGRESSION (r180782): Data Detector popovers are not dismissed on scroll or zoom
            https://bugs.webkit.org/show_bug.cgi?id=142371
            -and corresponding-
            rdar://problem/20059224

            Reviewed by Tim Horton.

            This patch has the WKImmediateActionController keep track of whether or not it has 
            an active immediate action. Then we only call into Lookup and DD if the window is 
            key OR if the WKView’s immediateActionController has an active action.
            * UIProcess/API/mac/WKView.mm:
            (-[WKView _dismissContentRelativeChildWindows]):
            * UIProcess/mac/WKImmediateActionController.h:
            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController initWithPage:view:recognizer:]):
            (-[WKImmediateActionController willDestroyView:]):
            (-[WKImmediateActionController _clearImmediateActionState]):
            (-[WKImmediateActionController hasActiveImmediateAction]):
            (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):

2015-03-04  Lucas Forschler  <lforschler@apple.com>

        Merge r180782

    2015-02-27  Beth Dakin  <bdakin@apple.com>

            Lookup panel dismisses when pages are loading in other tabs/windows
            https://bugs.webkit.org/show_bug.cgi?id=142104
            -and corresponding-
            rdar://problem/19882137

            Reviewed by Tim Horton.

            Until rdar://problem/13875766 is resolved, we should only call into Lookup and 
            DataDetectors for key windows.
            * UIProcess/API/mac/WKView.mm:
            (-[WKView _dismissContentRelativeChildWindows]):

2015-02-20  Dana Burkart  <dburkart@apple.com>

        Merged r180293. <rdar://problem/19890148>

    2015-02-18  Beth Dakin  <bdakin@apple.com>

            iBooks immediate action blacklist should not even create the gesture recognizer
            https://bugs.webkit.org/show_bug.cgi?id=141768
            -and corresponding-
            rdar://problem/19806770

            Reviewed by Tim Horton.

            Move the runtime-application check to the point where the gesture recognizer is 
            created so that we can avoid doing so.
            * UIProcess/API/mac/WKView.mm:
            (-[WKView initWithFrame:processPool:configuration:webView:]):
            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController _updateImmediateActionItem]):

2015-02-20  Dana Burkart  <dburkart@apple.com>

        Merged r180242. <rdar://problem/19870992>

    2015-02-17  Timothy Horton  <timothy_horton@apple.com>

            REGRESSION (r178595): Clicking on DD highlights sometimes do not work
            https://bugs.webkit.org/show_bug.cgi?id=141728
            <rdar://problem/19825372>

            Reviewed by Beth Dakin.

            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController _cancelImmediateActionIfNeeded]):
            (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
            The change that r178595 intended to make was purely that things that we
            have no immediate actions for should cancel the immediate action gesture recognizer.
            Moving the DataDetectors activation code as well breaks strict ordering
            of immediate action callbacks vs. shouldUseActionsWithContext: that they depend on.

2015-02-19  Dana Burkart  <dburkart@apple.com>

        Merged r180115. <rdar://problem/19850758>

    2015-02-14  Beth Dakin  <bdakin@apple.com>

            REGRESSION: Page opens with enlarged font after visiting PDF, navigating back, 
            then doing a process swap
            https://bugs.webkit.org/show_bug.cgi?id=141584
            -and corresponding-
            rdar://problem/18167729

            Reviewed by Tim Horton.

            This patch keeps the plugin zoom/scale factors separate from page zoom/scale 
            factors in the UI process since they are used for slightly different purposes for 
            plugins (i.e., PDFs) than they are for normal pages. Keeping track of the right 
            factor for the right type of document will ensure that we don’t use the wrong one.

            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::WebPageProxy):
            (WebKit::WebPageProxy::pageZoomFactor):
            (WebKit::WebPageProxy::pageScaleFactor):
            (WebKit::WebPageProxy::pluginScaleFactorDidChange):
            (WebKit::WebPageProxy::pluginZoomFactorDidChange):
            (WebKit::WebPageProxy::didCommitLoadForFrame):
            (WebKit::WebPageProxy::pageZoomFactorDidChange): Deleted.
            * UIProcess/WebPageProxy.h:
            (WebKit::WebPageProxy::pageZoomFactor): Deleted.
            (WebKit::WebPageProxy::pageScaleFactor): Deleted.
            * UIProcess/WebPageProxy.messages.in:
            * WebProcess/Plugins/PluginView.cpp:
            (WebKit::PluginView::setPageScaleFactor):

2015-02-19  Dana Burkart  <dburkart@apple.com>

        Merged r180094. <rdar://problem/19850716>

    2015-02-13  Simon Fraser  <simon.fraser@apple.com>

            Crash closing a tab when a context or popup menu is open
            https://bugs.webkit.org/show_bug.cgi?id=141582
            rdar://problem/17700475

            Reviewed by Anders Carlsson.

            If a context menu or a popup menu is open when a tab is programmatically closed,
            then we'd crash because both the WebContextMenuProxyMac/WebPopupMenuProxyMac
            and the WebPageProxy would be deleted while still in use, via messages
            handled via the nested event tracking runloop.

            Fix by protecting those things while showing the popup. Also programmatically
            dismiss the popup when closing the WebPageProxy.

            * UIProcess/WebContextMenuProxy.h:
            (WebKit::WebContextMenuProxy::cancelTracking):
            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::close):
            (WebKit::WebPageProxy::showPopupMenu): Clean up some EFL-related confusion that we don't need.
            Retaining |this| will also retain m_activePopupMenu.
            (WebKit::WebPageProxy::hidePopupMenu):
            (WebKit::WebPageProxy::showContextMenu):
            (WebKit::WebPageProxy::resetState):
            * UIProcess/WebPopupMenuProxy.h:
            (WebKit::WebPopupMenuProxy::cancelTracking):
            * UIProcess/mac/WebContextMenuProxyMac.h:
            * UIProcess/mac/WebContextMenuProxyMac.mm:
            (WebKit::WebContextMenuProxyMac::showContextMenu):
            (WebKit::WebContextMenuProxyMac::cancelTracking):
            * UIProcess/mac/WebPopupMenuProxyMac.h: For popups, we need to remember if we were
            canceled to avoid trying to send events after closing.
            * UIProcess/mac/WebPopupMenuProxyMac.mm:
            (WebKit::WebPopupMenuProxyMac::WebPopupMenuProxyMac):
            (WebKit::WebPopupMenuProxyMac::showPopupMenu):
            (WebKit::WebPopupMenuProxyMac::cancelTracking):

2015-02-19  Dana Burkart  <dburkart@apple.com>

        Merged r180076. <rdar://problem/19850750>

    2015-02-13  Brent Fulgham  <bfulgham@apple.com>

            [Mac, iOS] Adjust pagination behavior for Mail.app printing use
            https://bugs.webkit.org/show_bug.cgi?id=141569
            <rdar://problem/14912763>

            Reviewed by Anders Carlsson.

            * Shared/WebPageCreationParameters.cpp:
            (WebKit::WebPageCreationParameters::encode): Add new flag.
            (WebKit::WebPageCreationParameters::decode): Ditto.
            * Shared/WebPageCreationParameters.h: Ditto.
            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::creationParameters): Set new page construction flag.
            * UIProcess/WebPageProxy.h:
            * UIProcess/mac/WebPageProxyMac.mm:
            (WebKit::WebPageProxy::paginationQuirkEnabled): Ask for new pagination flag
            when running as a Mail client.
            * WebProcess/WebPage/WebPage.cpp:
            (WebKit::WebPage::WebPage): Set up pagination based on desired settings.

2015-02-19  Dana Burkart  <dburkart@apple.com>

        Merged r180062. <rdar://problem/19812938>

    2015-02-12  Simon Fraser  <simon.fraser@apple.com>

            determinePrimarySnapshottedPlugIn() should only traverse visible Frames
            https://bugs.webkit.org/show_bug.cgi?id=141547
            Part of rdar://problem/18445733.

            Reviewed by Anders Carlsson.
            
            Use FrameTree::traverseNextRendered() to avoid doing things in unrendered frames
            which are not guaranteed to have been laid out.

            * WebProcess/WebPage/WebPage.cpp:
            (WebKit::WebPage::determinePrimarySnapshottedPlugIn):

2015-02-11  Lucas Forschler  <lforschler@apple.com>

        Merge r179736

    2015-02-05  Tim Horton  <timothy_horton@apple.com>

            Null deref in ViewGestureController::beginSwipeGesture when swiping while script is navigating
            https://bugs.webkit.org/show_bug.cgi?id=141308
            <rdar://problem/18460046>

            Reviewed by Simon Fraser.

            * UIProcess/mac/ViewGestureControllerMac.mm:
            (WebKit::ViewGestureController::trackSwipeGesture):
            If script navigates (history.back, probably other cases too) while in the middle of
            building up enough scroll events to start a swipe, it can destroy the history item
            that we were planning to swipe to. If this happens, bail from the swipe.

2015-02-11  Lucas Forschler  <lforschler@apple.com>

        Merge r179586

    2015-02-03  Timothy Horton  <timothy_horton@apple.com>

            Every PageOverlayClientImpl leaks
            https://bugs.webkit.org/show_bug.cgi?id=141224
            <rdar://problem/19652939>

            Reviewed by Simon Fraser.

            * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
            (WKBundlePageOverlayCreate):
            * WebProcess/WebPage/WebPageOverlay.cpp:
            (WebKit::WebPageOverlay::create):
            (WebKit::WebPageOverlay::WebPageOverlay):
            (WebKit::WebPageOverlay::pageOverlayDestroyed):
            (WebKit::WebPageOverlay::willMoveToPage):
            (WebKit::WebPageOverlay::didMoveToPage):
            (WebKit::WebPageOverlay::drawRect):
            (WebKit::WebPageOverlay::mouseEvent):
            (WebKit::WebPageOverlay::didScrollFrame):
            (WebKit::WebPageOverlay::actionContextForResultAtPoint):
            (WebKit::WebPageOverlay::dataDetectorsDidPresentUI):
            (WebKit::WebPageOverlay::dataDetectorsDidChangeUI):
            (WebKit::WebPageOverlay::dataDetectorsDidHideUI):
            (WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
            (WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
            (WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
            * WebProcess/WebPage/WebPageOverlay.h:
            (WebKit::WebPageOverlay::client):
            Keep the PageOverlayClientImpl as a unique_ptr instead of a leaked reference,
            ensuring that it's cleaned up when the WebPageOverlay is torn down.

2015-02-10  Lucas Forschler  <lforschler@apple.com>

        Merge r177849

    2015-01-01  Jeff Miller  <jeffm@apple.com>

            Update user-visible copyright strings to include 2015
            https://bugs.webkit.org/show_bug.cgi?id=139880

            Reviewed by Darin Adler.

            * DatabaseProcess/EntryPoint/mac/LegacyProcess/Info.plist:
            * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService.Development/Info.plist:
            * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist:
            * Info.plist:
            * NetworkProcess/EntryPoint/mac/LegacyProcess/Info.plist:
            * NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/Info-OSX.plist:
            * NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/Info-iOS.plist:
            * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist:
            * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist:
            * PluginProcess/EntryPoint/mac/LegacyProcess/Info.plist:
            * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
            * PluginProcess/EntryPoint/mac/XPCService/PluginService.Development/Info.plist:
            * WebProcess/EntryPoint/mac/LegacyProcess/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:
            * mac/Info-WebKit2.plist:

2015-02-09  Babak Shafiei  <bshafiei@apple.com>

        Merge r179809.

    2015-02-08  Timothy Horton  <timothy_horton@apple.com>

            Null deref in _clearImmediateActionState when closing a view with a DataDetectors popover open
            https://bugs.webkit.org/show_bug.cgi?id=141377
            <rdar://problem/19711203>

            Reviewed by Darin Adler.

            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController _clearImmediateActionState]):
            We can have already detached the page when DataDetectors calls us back
            in interactionStoppedHandler. While we have kept a strong reference to the
            page in the interactionStoppedHandler block, _page is nulled out.
            It's OK to avoid doing this work, in any case, because closing a page
            tears down the TextIndicator anyway.

2015-02-02  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r179066. rdar://problem/19670515

    2015-01-24  David Kilzer  <ddkilzer@apple.com>

            <rdar://problem/19433134> REGRESSION (iOS 8): Reproducible null deref in WebKit::nextFocusableElement

            Merged small change from r175549.

            * WebProcess/WebPage/ios/WebPageIOS.mm:
            (WebKit::nextFocusableElement): Add isElementNode() check.

2015-01-20  Babak Shafiei  <bshafiei@apple.com>

        Merge r173737.

    2014-09-18  Simon Fraser  <simon.fraser@apple.com>

            Avoid divide by zero when we get an empty rect while snapshotting a node
            https://bugs.webkit.org/show_bug.cgi?id=136932
            rdar://problem/18383473

            Reviewed by Dean Jackson.

            renderer()->paintingRootRect() can return an empty rect for some inline configurations,
            for example an <a> containing a floated <span>

            When this occurs, avoid a divide by zero and return a null snapshot image.

            * WebProcess/WebPage/WebPage.cpp:
            (WebKit::WebPage::snapshotNode):

2015-01-20  Babak Shafiei  <bshafiei@apple.com>

        Merge r173071.

    2014-08-27  Enrica Casucci  <enrica@apple.com>

            textStylingAtPosition returns incorrect values after executing toggleBold, toggleItalic and toggleUnderline.
            https://bugs.webkit.org/show_bug.cgi?id=136323
            rdar://problem/18141964

            Reviewed by Antti Koivisto.

            For underline style we need to check typingStyle first and use that information to populate
            the dictionary. If there is no typing style we can use the render style.
            We also need to update the editor state for the toggle commands to reflect the state in the UIProcess
            even for commands that don't change the selection.

            * WebProcess/WebPage/WebPage.cpp:
            (WebKit::WebPage::editorState):
            * WebProcess/WebPage/ios/WebPageIOS.mm:
            (WebKit::WebPage::executeEditCommandWithCallback):

2015-01-29  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r179339. rdar://problem/19619999

    2015-01-29  Tim Horton  <timothy_horton@apple.com>

            Avoid manually handling quickLookWithEvent: if the immediate action gesture recognizer will do Lookup for us
            https://bugs.webkit.orgshow_bug.cgi?id=141018
            <rdar://problem/19619999>

            * UIProcess/API/mac/WKView.mm:
            (-[WKView quickLookWithEvent:]):
            Yosemite is 101000, not 10100.

2015-01-29  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r179320. rdar://problem/19619999

    2015-01-28  Timothy Horton  <timothy_horton@apple.com>

            Avoid manually handling quickLookWithEvent: if the immediate action gesture recognizer will do Lookup for us
            https://bugs.webkit.org/show_bug.cgi?id=141018
            <rdar://problem/19619999>

            Reviewed by Beth Dakin.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView quickLookWithEvent:]):
            If we have an immediate action gesture recognizer, just call super and
            avoid WebKit's special quickLookWithEvent: implementation.

2015-01-28  Babak Shafiei  <bshafiei@apple.com>

        Merge r179230.

    2015-01-27  Beth Dakin  <bdakin@apple.com>

            Immediate action gesture recognizer still doesn't work well with IB
            https://bugs.webkit.org/show_bug.cgi?id=140967
            -and corresponding-
            rdar://problem/19621509

            Reviewed by Tim Horton.

            We should add (or remove) the gesture recognizer in viewDidMoveToWindow because 
            initWithFrame it too early and IB might mess with it.
            * UIProcess/API/mac/WKView.mm:
            (-[WKView viewDidMoveToWindow]):
            (-[WKView initWithFrame:processPool:configuration:webView:]):

2015-01-28  Matthew  <matthew_hanson@apple.com>

        Merge r179195. rdar://problem/19572685

    2015-01-27  Beth Dakin  <bdakin@apple.com>

            Invoking an immediate action on link often dismisses selection
            https://bugs.webkit.org/show_bug.cgi?id=140911
            -and corresponding-
            rdar://problem/19572685

            Reviewed by Tim Horton.

            Calling _page->setMaintainsInactiveSelection(false) in complete is often
            too soon. Instead, call it in dismissContentRelativeChildWindows. This is more
            similar to the timing for the TextIndicator.
            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController dismissContentRelativeChildWindows]):
            (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
            (-[WKImmediateActionController immediateActionRecognizerDidCompleteAnimation:]):

2015-01-28  Matthew  <matthew_hanson@apple.com>

        Merge r179129. rdar://problem/19489518

    2015-01-26  Beth Dakin  <bdakin@apple.com>

            Blacklist iBooks for WebKit's default immediate actions
            https://bugs.webkit.org/show_bug.cgi?id=140854
            -and corresponding-
            rdar://problem/19489518

            Reviewed by Tim Horton.

            Blacklist iBooks.
            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController _updateImmediateActionItem]):

2015-01-28  Matthew  <matthew_hanson@apple.com>

        Merge r179087. rdar://problem/19571057

    2015-01-25  Timothy Horton  <timothy_horton@apple.com>

            Unresponsive Web processes sometimes throw ObjC exceptions under didPerformActionMenuHitTest:
            https://bugs.webkit.org/show_bug.cgi?id=140859
            <rdar://problem/19571057>

            Reviewed by Darin Adler.

            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController didPerformActionMenuHitTest:userData:]):
            If we've already given up on this gesture (either because it was canceled or the
            willBeginAnimation timeout expired), we shouldn't build a new animationController for it.
            This is true both because it wouldn't look good to swap animationControllers out
            from under the gesture, but also because AppKit throws an exception when you do this
            and that breaks a lot of things.

2015-01-28  Matthew  <matthew_hanson@apple.com>

        Merge r179023. rdar://problem/19573674

    2015-01-23  Timothy Horton  <timothy_horton@apple.com>

            Fix the pre-Yosemite build.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView _dismissContentRelativeChildWindows]):

2015-01-28  Matthew  <matthew_hanson@apple.com>

        Merge r179014. rdar://problem/19573674

    2015-01-23  Timothy Horton  <timothy_horton@apple.com>

            QLPreviewMenuItem popovers don't close when the page scrolls
            https://bugs.webkit.org/show_bug.cgi?id=140806
            <rdar://problem/19555618>

            Reviewed by Beth Dakin.

            Now that QLPreviewMenuItem's popover doesn't eat scrolls, we need to dismiss it if the page scrolls.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView _dismissContentRelativeChildWindows]):
            Send _dismissContentRelativeChildWindows on to WKImmediateActionController.

            * UIProcess/mac/WKImmediateActionController.h:
            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController _clearImmediateActionState]):
            (-[WKImmediateActionController dismissContentRelativeChildWindows]):
            (-[WKImmediateActionController _defaultAnimationController]):
            Keep track of the active QLPreviewMenuItem, and close it upon scroll.

2015-01-28  Matthew  <matthew_hanson@apple.com>

        Merge r179013. rdar://problem/19571601

    2015-01-23  Timothy Horton  <timothy_horton@apple.com>

            Infinite recursion in _clearImmediateActionState
            https://bugs.webkit.org/show_bug.cgi?id=140807
            <rdar://problem/19571601>

            Reviewed by Anders Carlsson.

            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController _clearImmediateActionState]):
            Clear _hasActivatedActionContext before calling didUseActions, because
            didUseActions can call _clearImmediateActionState.

2015-01-28  Matthew  <matthew_hanson@apple.com>

        Merge r178938. rdar://problem/19558472

    2015-01-22  Beth Dakin  <bdakin@apple.com>

            ibtoold crash below -[WebView close]
            https://bugs.webkit.org/show_bug.cgi?id=140782
            -and corresponding-
            rdar://problem/19558472

            Reviewed by Tim Horton.

            Retain the NSImmediateActionGestureRecognizer. This should not be necessary, but
            it is because interface builder can mess with our views.
            * UIProcess/mac/WKImmediateActionController.h:
            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController willDestroyView:]):
            (-[WKImmediateActionController _cancelImmediateAction]):
            (-[WKImmediateActionController _cancelImmediateActionIfNeeded]):
            (-[WKImmediateActionController _updateImmediateActionItem]):

2015-01-28  Matthew  <matthew_hanson@apple.com>

        Merge r178858. rdar://problem/19540806

    2015-01-21  Beth Dakin  <bdakin@apple.com>

            Crash in QuickLook preview delegate method
            https://bugs.webkit.org/show_bug.cgi?id=140740
            -and corresponding-
            rdar://problem/19540806

            Reviewed by Tim Horton.

            Clear out the delegate.
            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController willDestroyView:]):

2015-01-23  Babak Shafiei  <bshafiei@apple.com>

        Merge r178595. rdar://problem/19490114

    2015-01-16  Beth Dakin  <bdakin@apple.com>

            Should cancel immediate action sooner in WK2
            https://bugs.webkit.org/show_bug.cgi?id=140561
            -and corresponding-
            rdar://problem/19490114

            Reviewed by Tim Horton.

            _cancelImmediateActionIfNeeded will cancel the immediate action if there is no
            animation controller or if the DDActionContext doesn’t want to use its actions.
            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController _cancelImmediateActionIfNeeded]):

            Call _cancelImmediateActionIfNeeded to cancel earlier.
            (-[WKImmediateActionController didPerformActionMenuHitTest:userData:]):

            Re-factor this code to use the newly-added method _cancelImmediateActionIfNeeded
            (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):

2015-01-22  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r174708. rdar://problem/19451256

    2014-10-14  Alexey Proskuryakov  <ap@apple.com>

            REGRESSION (r165356): Issues with Japanese text input
            https://bugs.webkit.org/show_bug.cgi?id=137719
            rdar://problem/18431952
            rdar://problem/18483741

            Reviewed by Darin Adler.

            * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didChangeSelection):
            In sync code path, ensure consistent message delivery order by adding
            a DispatchMessageEvenWhenWaitingForSyncReply flag. This way, delayed
            EditorStateChanged messages won't confuse UI process.

2015-01-22  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177152. rdar://problem/19451288

    2014-12-11  Alexey Proskuryakov  <ap@apple.com>

            REGRESSION (Async Text Input): Text input method state is not reset when reloading a page
            https://bugs.webkit.org/show_bug.cgi?id=139504
            rdar://problem/19034674

            Reviewed by Enrica Casucci.

            WebKit2 used to look at EditorState changes and guess when to cancel a composition.
            This was quite unreliable, and needlessly complicated - WebCore knows when it decides
            to destroy a composition, so it now explicitly notifies the clients.

            * UIProcess/API/mac/WKView.mm: (-[WKView _processDidExit]): Address crashing case too.
            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::resetStateAfterProcessExited):
            * WebProcess/WebCoreSupport/WebEditorClient.cpp:
            (WebKit::WebEditorClient::discardedComposition):
            * WebProcess/WebCoreSupport/WebEditorClient.h:
            * WebProcess/WebPage/WebPage.cpp:
            (WebKit::WebPage::didChangeSelection):
            (WebKit::WebPage::discardedComposition):
            * WebProcess/WebPage/WebPage.h:

2015-01-22  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177033. rdar://problem/19451244

    2014-12-09  Chris Dumez  <cdumez@apple.com>

            [WK2] Crash when answering notification permission request after navigating
            https://bugs.webkit.org/show_bug.cgi?id=139429
            <rdar://problem/18921122>

            Reviewed by Andreas Kling.

            When requesting a notification permission, navigating away and then
            answering the permission, WebKit2 would crash. This is because upon
            navigating, the request is cancelled and removed from the HashMaps
            in NotificationPermissionRequestManager. When
            didReceiveNotificationPermissionDecision() is later called, it would
            look for the request identifier in m_idToOriginMap HashMap. As the
            request was cancelled, HashMap::take() call would return null for
            the SecurityOrigin*. This security origin pointer is then removed
            from m_originToIDMap, but the code was failing to do a null check
            first. Calling HashMap::remove(nullptr) would then crash.

            This patch adds the missing null check and a layout test to cover
            this case.

            Test: http/tests/notifications/legacy/notification-request-permission-then-navigate.html


            * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
            (WebKit::NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision):

2015-01-22  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175759. rdar://problem/19450899

    2014-11-07  Anshu Chimala  <anshu@apple.com>

            Make it possible to associate snapshots with back/forward list items other than the current item.
            https://bugs.webkit.org/show_bug.cgi?id=138490

            Reviewed by Tim Horton.

            * UIProcess/API/Cocoa/WKViewPrivate.h:
            Declare -saveBackForwardSnapshotForItem:, an alternative to -saveBackForwardSnapshotForCurrentItem that accepts a
            back/forward list item as an argument.
            * UIProcess/API/mac/WKView.mm:
            (-[WKView saveBackForwardSnapshotForItem:]):
            Pass the provided back/forward list item along to WebPageProxy::recordNavigationSnapshot().

            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::recordNavigationSnapshot):
            Overloaded to optionally take a back/forward list item as an argument. If one isn't provided, default to the current item
            as before; otherwise, associate the snapshot with whichever item was provided.
            * UIProcess/WebPageProxy.h:
            Declare the new recordNavigationSnapshot() overload.

            * UIProcess/mac/ViewSnapshotStore.h:
            Make recordSnapshot() take a back/forward list item as an argument.
            * UIProcess/mac/ViewSnapshotStore.mm:
            (WebKit::ViewSnapshotStore::recordSnapshot):
            Store the snapshot in the provided back/forward list item instead of in the current item.

2015-01-15  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175719. rdar://problem/19424169

    2014-11-05  Jer Noble  <jer.noble@apple.com>

            De-templatize Timer
            https://bugs.webkit.org/show_bug.cgi?id=138450

            Reviewed by Anders Carlsson.

            Remove template specifiers from Timer.

            * NetworkProcess/NetworkResourceLoader.cpp:
            (WebKit::NetworkResourceLoader::bufferingTimerFired):
            * NetworkProcess/NetworkResourceLoader.h:
            * Shared/WebMemorySampler.cpp:
            (WebKit::WebMemorySampler::sampleTimerFired):
            (WebKit::WebMemorySampler::stopTimerFired):
            * Shared/WebMemorySampler.h:
            * Shared/mac/RemoteLayerBackingStoreCollection.h:
            * Shared/mac/RemoteLayerBackingStoreCollection.mm:
            (WebKit::RemoteLayerBackingStoreCollection::volatilityTimerFired):
            * UIProcess/API/efl/EwkView.cpp:
            (EwkView::displayTimerFired):
            * UIProcess/API/efl/EwkView.h:
            * UIProcess/efl/TextCheckerClientEfl.cpp:
            (TextCheckerClientEfl::languagesUpdateTimerFired):
            (TextCheckerClientEfl::spellCheckingSettingChangeTimerFired):
            * UIProcess/efl/TextCheckerClientEfl.h:
            * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
            (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired):
            * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
            * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
            * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
            (WebKit::RemoteLayerTreeDrawingArea::layerFlushTimerFired):
            * WebProcess/WebProcess.cpp:
            (WebKit::WebProcess::processSuspensionCleanupTimerFired):
            (WebKit::WebProcess::nonVisibleProcessCleanupTimerFired):
            * WebProcess/WebProcess.h:

2015-01-15  Babak Shafiei  <bshafiei@apple.com>

        Merge r178290. rdar://problem/19441243

    2015-01-12  Timothy Horton  <timothy_horton@apple.com>

            Multi-rect TextIndicators are vertically flipped in WebKit1
            https://bugs.webkit.org/show_bug.cgi?id=140350
            <rdar://problem/19441243>

            Reviewed by Beth Dakin.

            * Shared/WebCoreArgumentCoders.cpp:
            (IPC::ArgumentCoder<TextIndicatorData>::encode):
            (IPC::ArgumentCoder<TextIndicatorData>::decode):
            Adjust to the field name changes.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView _setTextIndicator:fadeOut:]):
            Convert the textBoundingRect from root view to screen coordinates.

            * WebProcess/WebPage/FindController.cpp:
            (WebKit::FindController::updateFindIndicator):
            (WebKit::FindController::drawRect):
            Adjust to the new name, and use contentsToRootView when comparing against
            the stored m_findIndicatorRect.

2015-01-14  Dana Burkart  <dburkart@apple.com>

        Merged r175400. <rdar://problem/19424166>

    2014-10-30  Jer Noble  <jer.noble@apple.com>

            [EME] Add Setting for accessing storage location for MediaKeys data
            https://bugs.webkit.org/show_bug.cgi?id=138147

            Reviewed by Brady Eidson.

            * WebProcess/WebPage/WebPage.cpp:
            (WebKit::WebPage::WebPage): Pass from WebMediaKeyStorageManager into Settings.

2015-01-14  Dana Burkart  <dburkart@apple.com>

        Merged r175288. <rdar://problem/19480393>

    2014-10-28  Jer Noble  <jer.noble@apple.com>

            [EME] Pass location for media key storage through from WebKit/WebKit2.
            https://bugs.webkit.org/show_bug.cgi?id=137120

            Reviewed by Anders Carlsson.

            Allow the location for media key storage to be passed into the WebProcess from the UIProcess
            through the WebContextConfiguraiton struct.

            * Shared/WebProcessCreationParameters.cpp:
            (WebKit::WebProcessCreationParameters::encode): Add mediaKeysStorageDirectory.
            (WebKit::WebProcessCreationParameters::decode): Ditto.
            * Shared/WebProcessCreationParameters.h:
            * UIProcess/API/C/WKContextConfigurationRef.cpp:
            (WKContextConfigurationCopyMediaKeysStorageDirectory): Added getter.
            (WKContextConfigurationSetMediaKeysStorageDirectory): Added setter.
            * UIProcess/API/C/WKContextConfigurationRef.h:
            * UIProcess/API/C/WKOriginDataManager.h:
            * UIProcess/API/Cocoa/WKProcessPool.mm:
            (-[WKProcessPool _initWithConfiguration:]): Provide a default location.
            * UIProcess/APIContextConfiguration.cpp:
            (API::ContextConfiguration::webContextConfiguration): Set mediaKeysStorageDirectory.
            * UIProcess/APIContextConfiguration.h:
            (API::ContextConfiguration::mediaKeysStorageDirectory): Added getter.
            (API::ContextConfiguration::setMediaKeysStorageDirectory): Added setter.
            * UIProcess/WebContext.cpp:
            (WebKit::WebContext::applyPlatformSpecificConfigurationDefaults): Apply mediaKeysStorageDirectory.
            (WebKit::WebContext::WebContext): Initialize m_mediaKeysStorageDirectory.
            (WebKit::WebContext::createNewWebProcess): Create a sandbox extension handle for mediaKeysStorageDirectory.
            * UIProcess/WebContext.h:
            * UIProcess/efl/WebContextEfl.cpp:
            (WebKit::WebContext::platformDefaultMediaKeysStorageDirectory): Return a default location.
            * UIProcess/gtk/WebContextGtk.cpp:
            (WebKit::WebContext::platformDefaultMediaKeysStorageDirectory): Ditto.
            * UIProcess/mac/WebContextMac.mm:
            (WebKit::WebContext::platformDefaultMediaKeysStorageDirectory): Return an overridable default location.
            * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp: Added.
            (WebKit::WebMediaKeyStorageManager::initialize): Pull the mediaKeysStorageDirectory out of configuration.
            (WebKit::WebMediaKeyStorageManager::supplementName): Return a configuration name.
            (WebKit::WebMediaKeyStorageManager::mediaKeyStorageDirectoryForOrigin): Return the
                correct storage directory based on the SecureOrigin.
            (WebKit::WebMediaKeyStorageManager::getMediaKeyOrigins): Return the origins within the
                storage directory.
            (WebKit::removeAllMediaKeyStorageForOriginPath): Static, remove contents and directory at path.
            (WebKit::WebMediaKeyStorageManager::deleteMediaKeyEntriesForOrigin): Use
                removeAllMediaKeyStorageForOriginPath to remove origin data.
            (WebKit::WebMediaKeyStorageManager::deleteMediaKeyEntriesModifiedBetweenDates): Ditto.
            (WebKit::WebMediaKeyStorageManager::deleteAllMediaKeyEntries): Ditto.
            * WebProcess/MediaCache/WebMediaKeyStorageManager.h: Added.
            (WebKit::WebMediaKeyStorageManager::WebMediaKeyStorageManager): Default constructor.
            (WebKit::WebMediaKeyStorageManager::~WebMediaKeyStorageManager): Default virtual destructor.
            (WebKit::WebMediaKeyStorageManager::mediaKeyStorageDirectory): Simple accessor.
            * WebProcess/WebProcess.cpp:
            (WebKit::WebProcess::WebProcess): Add WebMediaKeyStorageManager as a supplement.
            * WebProcess/cocoa/WebProcessCocoa.mm:
            (WebKit::WebProcess::platformInitializeWebProcess): Create a sandbox extension from the sandbox extension handle.

            Add new source files to project(s).

            * PlatformEfl.cmake:
            * PlatformGTK.cmake:
            * WebKit2.xcodeproj/project.pbxproj:
            * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
            (WebKit::WebMediaKeyStorageManager::getMediaKeyOrigins):
            (WebKit::removeAllMediaKeyStorageForOriginPath):

            Drive-by fix: references to VoidCallback are ambiguous, since the same name is re-used in multiple namespaces.
            Make references to WebCore::VoidCallback explicit where the entire WebCore (and other) namespaces are pulled in.

            * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
            (WebKit::NotificationPermissionRequestManager::startRequest):
            (WebKit::NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision):
            * WebProcess/WebCoreSupport/WebNotificationClient.cpp:
            (WebKit::WebNotificationClient::requestPermission):

2015-01-14  Dana Burkart  <dburkart@apple.com>

        Merged r175188. <rdar://problem/19480522>

    2014-10-24  Jer Noble  <jer.noble@apple.com>

            Abstractify WebOriginDataManager to support arbitrary ChildProcess supplements.
            https://bugs.webkit.org/show_bug.cgi?id=137993

            Reviewed by Brady Eidson.

            To allow different ChildProcess subclasses to handle listing and deletion of origin
            data, make WebOriginDataManager more generic by having a supplement implement the
            details, leaving WebOriginDataManager to deal with cross-process messaging.

            De-virtualize AsyncTask, allowing a task to be created by passing in a
            function<void()>, rather than an object, method, and arguments.

            * Shared/AsyncTask.h:
            (WebKit::AsyncTask::AsyncTask):
            (WebKit::AsyncTask::performTask):
            (WebKit::AsyncTask::~AsyncTask): Deleted.

            Add a new virtual base class, to be implemented by various ChildProcesses, which
            WebOriginDataManager will use to implement listing and deletion requests.

            * WebProcess/OriginData/WebOriginDataManager.h:
            * WebProcess/OriginData/WebOriginDataManagerSupplement.h: Added.
            (WebKit::WebOriginDataManagerSupplement::WebOriginDataManagerSupplement):
            (WebKit::WebOriginDataManagerSupplement::~WebOriginDataManagerSupplement):
            (WebKit::WebOriginDataManagerSupplement::getOrigins):
            (WebKit::WebOriginDataManagerSupplement::deleteEntriesForOrigin):
            (WebKit::WebOriginDataManagerSupplement::deleteEntriesModifiedBetweenDates):
            (WebKit::WebOriginDataManagerSupplement::deleteAllEntries):
            * WebKit2.xcodeproj/project.pbxproj:

            WebOriginDataManager doesn't need to be a ChildSupplement. Remove the DatabaseProcess-
            specific implementations for its message handlers and replace with clean, generic calls
            to its supplement. Because these supplements may want to respond to the request
            asynchronously, pass a completion function in to be called by the supplement once its
            work is complete.

            * WebProcess/OriginData/WebOriginDataManager.cpp:
            (WebKit::WebOriginDataManager::WebOriginDataManager):
            (WebKit::WebOriginDataManager::getOrigins):
            (WebKit::WebOriginDataManager::deleteEntriesForOrigin):
            (WebKit::WebOriginDataManager::deleteEntriesModifiedBetweenDates):
            (WebKit::WebOriginDataManager::deleteAllEntries):
            (WebKit::WebOriginDataManager::supplementName): Deleted.

            DatabaseProcess already uses WebOriginDataManager, so it will be the first process
            to fall under the heel of the new regime. DatabaseProcess will subclass
            WebOriginDataManagerSupplement, and pass itself in twice to the WebOriginDataManager
            constructor. Create a lambda-based AsyncTask for each request, and call the completion
            function when each request is complete.

            * DatabaseProcess/DatabaseProcess.cpp:
            (WebKit::DatabaseProcess::DatabaseProcess):
            (WebKit::DatabaseProcess::getIndexedDatabaseOrigins):
            (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigin):
            (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedBetweenDates):
            (WebKit::DatabaseProcess::deleteAllIndexedDatabaseEntries):
            (WebKit::DatabaseProcess::getOrigins):
            (WebKit::DatabaseProcess::deleteEntriesForOrigin):
            (WebKit::DatabaseProcess::deleteEntriesModifiedBetweenDates):
            (WebKit::DatabaseProcess::deleteAllEntries):
            (WebKit::DatabaseProcess::doGetIndexedDatabaseOrigins): Deleted.
            (WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesForOrigin): Deleted.
            (WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesModifiedBetweenDates): Deleted.
            (WebKit::DatabaseProcess::doDeleteAllIndexedDatabaseEntries): Deleted.
            * DatabaseProcess/DatabaseProcess.h:

2015-01-07  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r178056. rdar://problem/19300492

    2015-01-07  Beth Dakin  <bdakin@apple.com>

            Adopt delegate callbacks so that standardQuickLookMenuItem does not obscure the 
            link
            https://bugs.webkit.org/show_bug.cgi?id=140206
            -and corresponding-
            rdar://problem/19300492

            Reviewed by Tim Horton.

            Providing and item frame will ensure that the original link is not obscured.
            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController menuItem:itemFrameForPoint:]):

            For now use a max size that is smaller than the WKView, with the screen’s aspect 
            ratio, and scaled down.
            (-[WKImmediateActionController menuItem:maxSizeForPoint:]):

2015-01-07  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r178003. rdar://problem/19255417

    2015-01-06  Timothy Horton  <timothy_horton@apple.com>

            View state change callbacks are sometimes dropped on the floor
            https://bugs.webkit.org/show_bug.cgi?id=140156
            <rdar://problem/19255417>

            Reviewed by Anders Carlsson.

            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::dispatchViewStateChange):
            Always send SetViewState to the Web process if we have any
            registered view state change callbacks. Otherwise, if nothing changed,
            we can end up never calling the callback.

2015-01-07  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177970. rdar://problem/19383425

    2015-01-06  Timothy Horton  <timothy_horton@apple.com>

            Make explicit which TextIndicator animations are driven manually, and which run automatically
            https://bugs.webkit.org/show_bug.cgi?id=140113
            <rdar://problem/19383425>

            Reviewed by Darin Adler.

            * UIProcess/mac/PageClientImpl.mm:
            (WebKit::PageClientImpl::didPerformDictionaryLookup):
            Delete an inaccurate comment.

2015-01-07  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177928. rdar://problem/19298391

    2015-01-05  Timothy Horton  <timothy_horton@apple.com>

            Implicitly dismissed DD popovers don't clear immediate action state, prematurely dismissing the next DD highlight
            https://bugs.webkit.org/show_bug.cgi?id=140088
            <rdar://problem/19298391>

            Reviewed by Anders Carlsson.

            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController _menuItemForDataDetectedText]):
            Instead of just tearing down the TextIndicator, clear all state.

2015-01-07  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177754. rdar://problem/19343307

    2014-12-26  Conrad Shultz  <conrad_shultz@apple.com>

            Safari build crashes when "zooming into"/choosing a tab from tab view
            https://bugs.webkit.org/show_bug.cgi?id=139934

            Reviewed by Dan Bernstein.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView _setIgnoresNonWheelEvents:]):
            Trying to add a nil gesture recognizer raises an exception. Stop assuming that a
            gesture recognizer is non-nil.

2015-01-07  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177705. rdar://problem/19333076

    2014-12-23  Timothy Horton  <timothy_horton@apple.com>

            Install a TextIndicator for link immediate actions
            https://bugs.webkit.org/show_bug.cgi?id=139897
            <rdar://problem/19333076>

            Reviewed by Anders Carlsson.

            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController _defaultAnimationController]):
            Install the link's TextIndicator.

            (-[WKImmediateActionController menuItemDidClose:]):
            Dismiss the TextIndicator and clean up when the item closes.

2015-01-07  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177704. rdar://problem/19333075

    2014-12-23  Timothy Horton  <timothy_horton@apple.com>

            Expose ElementBoundingBox on WKHitTestResult
            https://bugs.webkit.org/show_bug.cgi?id=139895
            <rdar://problem/19333075>

            Reviewed by Dan Bernstein.

            * UIProcess/API/C/WKHitTestResult.cpp:
            (WKHitTestResultGetElementBoundingBox):
            * UIProcess/API/C/WKHitTestResult.h:
            Expose the rect.

2015-01-07  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177702. rdar://problem/19333074

    2014-12-23  Timothy Horton  <timothy_horton@apple.com>

            Remove the custom web page preview code
            https://bugs.webkit.org/show_bug.cgi?id=139894
            <rdar://problem/19333074>

            Reviewed by Dan Bernstein.

            * UIProcess/API/Cocoa/WKViewPrivate.h:
            * UIProcess/API/mac/WKView.mm:
            (-[WKView _dismissContentRelativeChildWindows]):
            (-[WKView _viewForPreviewingURL:initialFrameSize:]): Deleted.
            (-[WKView _titleForPreviewOfURL:]): Deleted.
            (-[WKView _setPreviewTitle:]): Deleted.
            (-[WKView _setPreviewLoading:]): Deleted.
            (-[WKView _setPreviewOverrideImage:]): Deleted.
            (-[WKView _finishPreviewingURL:withPreviewView:]): Deleted.
            (-[WKView _handleClickInPreviewView:URL:]): Deleted.
            (-[WKView _shouldUseStandardQuickLookPreview]): Deleted.
            * UIProcess/mac/WKImmediateActionController.h:
            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController willDestroyView:]):
            (-[WKImmediateActionController _clearImmediateActionState]):
            (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
            (-[WKImmediateActionController _defaultAnimationController]):
            (-[WKImmediateActionController hidePreview]): Deleted.
            (-[WKImmediateActionController setPreviewTitle:]): Deleted.
            (-[WKImmediateActionController setPreviewLoading:]): Deleted.
            (-[WKImmediateActionController setPreviewOverrideImage:]): Deleted.
            (-[WKImmediateActionController _animationControllerForCustomPreview]): Deleted.
            * UIProcess/mac/WKPagePreviewViewController.h: Removed.
            * UIProcess/mac/WKPagePreviewViewController.mm: Removed.
            * UIProcess/mac/WKPreviewPopoverAnimationController.h: Removed.
            * UIProcess/mac/WKPreviewPopoverAnimationController.mm: Removed.
            * WebKit2.xcodeproj/project.pbxproj:
            Remove all of the custom web page preview code. Clients that want the custom
            preview can implement it by overriding the immediate action.

2015-01-07  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177604. rdar://problem/19312111

    2014-12-19  Timothy Horton  <timothy_horton@apple.com>

            Fix the build.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView _setIgnoresNonWheelEvents:]):

2015-01-07  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177601. rdar://problem/19301470

    2014-12-19  Beth Dakin  <bdakin@apple.com>

            Preview popovers don't show an arrow for large links
            https://bugs.webkit.org/show_bug.cgi?id=139842
            -and corresponding-
            <rdar://problem/19301470>

            Reviewed by Tim Horton.

            This patch addresses the case where the link is so large that there is no 
            available space on any side once you factor in screen padding. In that case, we 
            should give up early on not obscuring the link.
            * UIProcess/mac/WKPreviewPopoverAnimationController.mm:
            (-[WKPreviewPopoverAnimationController _targetSizeForPagePreview]):
            (-[WKPreviewPopoverAnimationController _effectivePaddingWithPreviewPadding:]):
            (-[WKPreviewPopoverAnimationController _maxSpaceAvailableOnYEdgeForOriginRect:withScreenRect:previewPadding:]):
            (-[WKPreviewPopoverAnimationController _maxSpaceAvailableOnXEdgeForOriginRect:withScreenRect:previewPadding:]):
            (-[WKPreviewPopoverAnimationController _preferredPopoverSizeWithPreviewPadding:forTargetSize:]):

2015-01-07  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177600. rdar://problem/19312111

    2014-12-19  Timothy Horton  <timothy_horton@apple.com>

            WKView's ignoresNonWheelEvents should ignore immediate actions
            https://bugs.webkit.org/show_bug.cgi?id=139839
            <rdar://problem/19312111>

            Reviewed by Anders Carlsson.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView initWithFrame:context:configuration:webView:]):
            (-[WKView _setIgnoresNonWheelEvents:]):
            Install/uninstall the immediate action gesture recognizer when
            toggling ignoresNonWheelEvents.

2015-01-06  Lucas Forschler  <lforschler@apple.com>

    Rollout r177932. rdar://problem/19312111

2015-01-06  Lucas Forschler  <lforschler@apple.com>

    Rollout r177933. rdar://problem/19301470

2015-01-06  Lucas Forschler  <lforschler@apple.com>

    Rollout r177934. rdar://problem/19312111

2015-01-06  Lucas Forschler  <lforschler@apple.com>

    Rollout r177939.

2015-01-05  Lucas Forschler  <lforschler@apple.com>

        Merge r177702. rdar://problem/19333074

    2014-12-23  Timothy Horton  <timothy_horton@apple.com>

            Remove the custom web page preview code
            https://bugs.webkit.org/show_bug.cgi?id=139894
            <rdar://problem/19333074>

            Reviewed by Dan Bernstein.

            * UIProcess/API/Cocoa/WKViewPrivate.h:
            * UIProcess/API/mac/WKView.mm:
            (-[WKView _dismissContentRelativeChildWindows]):
            (-[WKView _viewForPreviewingURL:initialFrameSize:]): Deleted.
            (-[WKView _titleForPreviewOfURL:]): Deleted.
            (-[WKView _setPreviewTitle:]): Deleted.
            (-[WKView _setPreviewLoading:]): Deleted.
            (-[WKView _setPreviewOverrideImage:]): Deleted.
            (-[WKView _finishPreviewingURL:withPreviewView:]): Deleted.
            (-[WKView _handleClickInPreviewView:URL:]): Deleted.
            (-[WKView _shouldUseStandardQuickLookPreview]): Deleted.
            * UIProcess/mac/WKImmediateActionController.h:
            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController willDestroyView:]):
            (-[WKImmediateActionController _clearImmediateActionState]):
            (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
            (-[WKImmediateActionController _defaultAnimationController]):
            (-[WKImmediateActionController hidePreview]): Deleted.
            (-[WKImmediateActionController setPreviewTitle:]): Deleted.
            (-[WKImmediateActionController setPreviewLoading:]): Deleted.
            (-[WKImmediateActionController setPreviewOverrideImage:]): Deleted.
            (-[WKImmediateActionController _animationControllerForCustomPreview]): Deleted.
            * UIProcess/mac/WKPagePreviewViewController.h: Removed.
            * UIProcess/mac/WKPagePreviewViewController.mm: Removed.
            * UIProcess/mac/WKPreviewPopoverAnimationController.h: Removed.
            * UIProcess/mac/WKPreviewPopoverAnimationController.mm: Removed.
            * WebKit2.xcodeproj/project.pbxproj:
            Remove all of the custom web page preview code. Clients that want the custom
            preview can implement it by overriding the immediate action.

2015-01-05  Lucas Forschler  <lforschler@apple.com>

        Merge r177604. rdar://problem/19312111

    2014-12-19  Timothy Horton  <timothy_horton@apple.com>

            Fix the build.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView _setIgnoresNonWheelEvents:]):

2015-01-05  Lucas Forschler  <lforschler@apple.com>

        Merge r177601. <rdar://problem/19301470>

    2014-12-19  Beth Dakin  <bdakin@apple.com>

            Preview popovers don't show an arrow for large links
            https://bugs.webkit.org/show_bug.cgi?id=139842
            -and corresponding-
            <rdar://problem/19301470>

            Reviewed by Tim Horton.

            This patch addresses the case where the link is so large that there is no 
            available space on any side once you factor in screen padding. In that case, we 
            should give up early on not obscuring the link.
            * UIProcess/mac/WKPreviewPopoverAnimationController.mm:
            (-[WKPreviewPopoverAnimationController _targetSizeForPagePreview]):
            (-[WKPreviewPopoverAnimationController _effectivePaddingWithPreviewPadding:]):
            (-[WKPreviewPopoverAnimationController _maxSpaceAvailableOnYEdgeForOriginRect:withScreenRect:previewPadding:]):
            (-[WKPreviewPopoverAnimationController _maxSpaceAvailableOnXEdgeForOriginRect:withScreenRect:previewPadding:]):
            (-[WKPreviewPopoverAnimationController _preferredPopoverSizeWithPreviewPadding:forTargetSize:]):

2015-01-05  Lucas Forschler  <lforschler@apple.com>

        Merge r177600. <rdar://problem/19312111>

    2014-12-19  Timothy Horton  <timothy_horton@apple.com>

            WKView's ignoresNonWheelEvents should ignore immediate actions
            https://bugs.webkit.org/show_bug.cgi?id=139839
            <rdar://problem/19312111>

            Reviewed by Anders Carlsson.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView initWithFrame:context:configuration:webView:]):
            (-[WKView _setIgnoresNonWheelEvents:]):
            Install/uninstall the immediate action gesture recognizer when
            toggling ignoresNonWheelEvents.

2014-12-18  Matthew Hanson  <matthew_hanson@apple.com>

        Build fix.

        Unreviewed.

        * UIProcess/mac/WKPreviewPopoverAnimationController.mm:
        (-[WKPreviewPopoverAnimationController setPreviewOverrideImage:]):
        Explicitly pass float into the std::min template.

2014-12-18  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177528. rdar://problem/19299367

    2014-12-18  Beth Dakin  <bdakin@apple.com>

            Need to re-enable action menus
            https://bugs.webkit.org/show_bug.cgi?id=139795
            -and corresponding-
            rdar://problem/19299367

            Reviewed by Tim Horton.

            Re-enable the menus by un-commenting the code to create the menu and controller.
            * UIProcess/API/mac/WKView.mm:
            (-[WKView initWithFrame:context:configuration:webView:]):

            performActionMenuHitTest already takes a parameter indicating whether the hit test 
            is for an immediate action or not. The callback didPerformActionMenuHitTest needs 
            that information too so that it knows whether to call into the 
            ActionMenuController or the ImmediateActionController.
            (-[WKView _didPerformActionMenuHitTest:forImmediateAction:userData:]):
            (-[WKView _didPerformActionMenuHitTest:userData:]): Deleted.
            * UIProcess/API/mac/WKViewInternal.h:
            * UIProcess/PageClient.h:
            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::didPerformActionMenuHitTest):
            * UIProcess/WebPageProxy.h:
            * UIProcess/WebPageProxy.messages.in:
            * UIProcess/mac/PageClientImpl.h:
            * UIProcess/mac/PageClientImpl.mm:
            (WebKit::PageClientImpl::didPerformActionMenuHitTest):
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::WebPage::performActionMenuHitTestAtLocation):

2014-12-18  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177525. rdar://problem/19288547

    2014-12-18  Timothy Horton  <timothy_horton@apple.com>

            Fix the build.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView _setPreviewOverrideImage:]):

2014-12-18  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177522. rdar://problem/19288547

    2014-12-18  Timothy Horton  <timothy_horton@apple.com>

            Change page preview loading order, and add a TextIndicator
            https://bugs.webkit.org/show_bug.cgi?id=139793
            <rdar://problem/19288547>

            Reviewed by Beth Dakin.

            * Shared/mac/ActionMenuHitTestResult.h:
            * Shared/mac/ActionMenuHitTestResult.mm:
            (WebKit::ActionMenuHitTestResult::encode):
            (WebKit::ActionMenuHitTestResult::decode):
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::WebPage::performActionMenuHitTestAtLocation):
            Build a TextIndicator for links.

            * UIProcess/API/Cocoa/WKViewPrivate.h:
            * UIProcess/API/mac/WKView.mm:
            (-[WKView _dismissContentRelativeChildWindows]):
            (-[WKView _setPreviewTitle:]):
            (-[WKView _setPreviewLoading:]):
            Remove unneeded WK_API_ENABLED #ifs.

            (-[WKView _setPreviewOverrideImage:]):
            Add; forward to WKImmediateActionController.

            * UIProcess/mac/WKImmediateActionController.h:
            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController willDestroyView:]):
            Shut down the WKPreviewPopoverAnimationController.

            (-[WKImmediateActionController _clearImmediateActionState]):
            (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
            Don't build an immediate action item here; we'll always build it in
            willBeginAnimation, and the one we build here is likely to be wrong.

            (-[WKImmediateActionController _defaultAnimationController]):
            (-[WKImmediateActionController hidePreview]):
            (-[WKImmediateActionController setPreviewTitle:]):
            (-[WKImmediateActionController setPreviewLoading:]):
            (-[WKImmediateActionController setPreviewOverrideImage:]):
            (-[WKImmediateActionController _animationControllerForCustomPreview]):
            (-[WKImmediateActionController _createPreviewPopoverIfNeededForURL:]): Deleted.
            (-[WKImmediateActionController popoverWillClose:]): Deleted.
            (targetSizeFitsInAvailableSpace): Deleted.
            (-[WKImmediateActionController largestPopoverSize]): Deleted.
            (-[WKImmediateActionController _preferredPopoverSizeWithPreviewPadding:]): Deleted.
            (-[WKImmediateActionController pagePreviewViewController:viewForPreviewingURL:initialFrameSize:]): Deleted.
            (-[WKImmediateActionController pagePreviewViewController:titleForPreviewOfURL:]): Deleted.
            (-[WKImmediateActionController pagePreviewViewControllerWasClicked:]): Deleted.
            Move preview popover code to WKPreviewPopoverAnimationController.
            Install and uninstall the link text indicator when necessary.

            * UIProcess/mac/WKPagePreviewViewController.h:
            * UIProcess/mac/WKPagePreviewViewController.mm:
            (-[WKPagePreviewViewController setLoading:]):
            (-[WKPagePreviewViewController loadView]):
            (-[WKPagePreviewViewController replacePreviewWithImage:atSize:]):
            Allow overriding the preview with a full-view NSImage.
            Hide the preview view until the loading spinner goes away.

            * UIProcess/mac/WKPreviewPopoverAnimationController.h: Copied from Source/WebKit2/UIProcess/mac/WKImmediateActionController.h.
            * UIProcess/mac/WKPreviewPopoverAnimationController.mm: Added.
            (+[WKPreviewPopoverAnimationController _shouldImmediatelyShowPreview]):
            (-[WKPreviewPopoverAnimationController initWithURL:view:page:originRect:eventLocationInView:]):
            (-[WKPreviewPopoverAnimationController close]):
            (-[WKPreviewPopoverAnimationController setPreviewLoading:]):
            (-[WKPreviewPopoverAnimationController setPreviewOverrideImage:]):
            If we have shown the popover, choose a size strictly smaller than
            its current size.

            (-[WKPreviewPopoverAnimationController _hidePreview]):
            (-[WKPreviewPopoverAnimationController setPreviewTitle:]):
            (-[WKPreviewPopoverAnimationController _createPreviewPopover]):
            (-[WKPreviewPopoverAnimationController _showPreview]):
            (targetSizeFitsInAvailableSpace):
            (-[WKPreviewPopoverAnimationController largestPopoverSize]):
            (-[WKPreviewPopoverAnimationController _targetSizeForPagePreview]):
            (-[WKPreviewPopoverAnimationController _preferredPopoverSizeWithPreviewPadding:forTargetSize:]):
            (-[WKPreviewPopoverAnimationController _previewWatchdogTimerFired:]):
            (-[WKPreviewPopoverAnimationController recognizerWillBeginAnimation:]):
            (-[WKPreviewPopoverAnimationController recognizerDidUpdateAnimation:]):
            (-[WKPreviewPopoverAnimationController recognizerDidCancelAnimation:]):
            (-[WKPreviewPopoverAnimationController recognizerDidCompleteAnimation:]):
            (-[WKPreviewPopoverAnimationController recognizerDidDismissAnimation:]):
            (-[WKPreviewPopoverAnimationController pagePreviewViewController:viewForPreviewingURL:initialFrameSize:]):
            (-[WKPreviewPopoverAnimationController pagePreviewViewController:titleForPreviewOfURL:]):
            (-[WKPreviewPopoverAnimationController pagePreviewViewControllerWasClicked:]):
            (-[WKPreviewPopoverAnimationController popoverWillClose:]):
            Move code in from WKImmediateActionController.
            Forward NSImmediateActionAnimationControllerDelegate methods
            to the popover's animation controller if we've popped it.
            Pop the popover if we've loaded or 1 second has passed, whichever
            comes first.

            * WebKit2.xcodeproj/project.pbxproj:

2014-12-17  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177473. rdar://problem/19286550

    2014-12-17  Beth Dakin  <bdakin@apple.com>

            Page previews are sometimes sized much smaller than it seems they should be
            https://bugs.webkit.org/show_bug.cgi?id=139754
            -and corresponding-
            rdar://problem/19286550        

            Reviewed by Tim Horton.

            Increase the minimum size and add in a missing else!!
            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController _preferredPopoverSizeWithPreviewPadding:]):

2014-12-17  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177427. rdar://problem/19237945

    2014-12-16  Timothy Horton  <timothy_horton@apple.com>

            Implement and adopt two new TextIndicator presentation animations
            https://bugs.webkit.org/show_bug.cgi?id=139715
            <rdar://problem/19237945>

            Reviewed by Anders Carlsson.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView _setTextIndicator:fadeOut:]):
            (-[WKView _setTextIndicatorAnimationProgress:]):
            (-[WKView _setTextIndicator:fadeOut:animationCompletionHandler:]): Deleted.
            * UIProcess/API/mac/WKViewInternal.h:
            * UIProcess/PageClient.h:
            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::WebPageProxy):
            (WebKit::WebPageProxy::setTextIndicatorAnimationProgress):
            (WebKit::WebPageProxy::performActionMenuHitTestAtLocation):
            * UIProcess/WebPageProxy.h:
            * UIProcess/mac/PageClientImpl.h:
            * UIProcess/mac/PageClientImpl.mm:
            (WebKit::PageClientImpl::setTextIndicatorAnimationProgress):
            (WebKit::PageClientImpl::didPerformDictionaryLookup):
            Remove the completion handler block argument from TextIndicator
            installation.
            Plumb animation progress through PageClient to TextIndicatorWindow.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController prepareForMenu:withEvent:]):
            (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController _clearImmediateActionState]):
            (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
            (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
            (-[WKImmediateActionController immediateActionRecognizerDidCancelAnimation:]):
            (-[WKImmediateActionController immediateActionRecognizerDidCompleteAnimation:]):
            (-[WKImmediateActionController _menuItemForDataDetectedText]):
            (-[WKImmediateActionController _animationControllerForText]):
            Forward immediate action gesture recognizer animation progress
            to TextIndicator. Force us to keep the selection when immediate
            action popovers steal first responder status from the WebView.

            * WebProcess/WebPage/WebPage.h:
            * WebProcess/WebPage/WebPage.messages.in:
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::textIndicatorTransitionForActionMenu):
            (WebKit::WebPage::performActionMenuHitTestAtLocation):
            Factor out the presentation animation decision code.
            For immediate actions, of the Lookup range is equal to the
            selection range, use a Crossfade animation; otherwise, use a FadeIn
            animation.
            Push whether the actionMenuHitTest is for an immediate action
            or a menu to the Web process, to make the presentation animation
            decision code live entirely in the Web process.
            Avoid extracting encoded image data if we know we're doing
            an immediate action and will never need it.

2014-12-17  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177411. rdar://problem/19271854

    2014-12-16  Beth Dakin  <bdakin@apple.com>

            Speculative build fix.

            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController _animationControllerForCustomPreview]):

2014-12-17  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177409. rdar://problem/19271854

    2014-12-16  Beth Dakin  <bdakin@apple.com>

            REGRESSION: Preview popovers obscure the link, look wrong
            https://bugs.webkit.org/show_bug.cgi?id=139711
            -and corresponding-
            rdar://problem/19271854

            Reviewed by Tim Horton.

            Switch to using NSPopoverAnimationController.
            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController _defaultAnimationController]):
            (-[WKImmediateActionController _animationControllerForCustomPreview]):

2014-12-17  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177402. rdar://problem/19266297

    2014-12-16  Conrad Shultz  <conrad_shultz@apple.com>

            Add a progress indicator to the preview popover
            https://bugs.webkit.org/show_bug.cgi?id=139699

            Reviewed by Tim Horton.

            * UIProcess/API/Cocoa/WKViewPrivate.h:
            * UIProcess/API/mac/WKView.mm:
            (-[WKView _setPreviewLoading:]):
            Wrap -[WKImmediateActionController setPreviewLoading:].

            * UIProcess/mac/WKImmediateActionController.h:
            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController _createPreviewPopoverIfNeededForURL:]):
            Flag the preview view controller as loading before beginning the load.
            (-[WKImmediateActionController setPreviewLoading:]):
            Wrap -[WKPagePreviewViewController setLoading:].

            * UIProcess/mac/WKPagePreviewViewController.h:
            * UIProcess/mac/WKPagePreviewViewController.mm:
            (-[WKPagePreviewViewController setLoading:]):
            Toggle the progress indicator animation state.
            (-[WKPagePreviewViewController isLoading]):
            Accessor.
            (-[WKPagePreviewViewController loadView]):
            Create and center an indeterminate progress indicator that won't scale with the preview content.

2014-12-16  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177406. rdar://problem/19270279

    2014-12-16  Timothy Horton  <timothy_horton@apple.com>

            Immediate action popovers can get stuck open
            https://bugs.webkit.org/show_bug.cgi?id=139709
            <rdar://problem/19270279>

            Reviewed by Beth Dakin.

            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController _clearImmediateActionState]):
            Don't clear the animation controller; it breaks things and was unnecessary.

2014-12-16  Matthew Hanson  <matthew_hanson@apple.com>

        Build Fix.

        Reviewed by Dana Burkart.

        * UIProcess/mac/WKImmediateActionController.h:
        Hide the method declaration for setPreviewTitle: into an WK_API_ENABLED ifdef

2014-12-16  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177371. rdar://problem/19266902

    2014-12-16  Tim Horton  <timothy_horton@apple.com>

            Disable TextIndication for Lookup immediate actions
            https://bugs.webkit.org/show_bug.cgi?id=139684

            Reviewed by Anders Carlsson.

            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController _animationControllerForText]):

2014-12-16  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177230. rdar://problem/19208291

    2014-12-12  Mark Rowe  <mrowe@apple.com>

            Fix the 32-bit build.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView _setPreviewTitle:]):

2014-12-16  Dana Burkart  <dburkart@apple.com>

        Merged r177323. <rdar://problem/19198414>

    2014-12-15  Beth Dakin  <bdakin@apple.com>

            Make lookup an immediate action instead of an action menu item
            https://bugs.webkit.org/show_bug.cgi?id=139661
            -and corresponding-
            rdar://problem/19198414

            Reviewed by Tim Horton.

            New type.
            * Shared/API/c/WKImmediateActionTypes.h:

            ActionMenuHitTestResult now includes a DictionaryPopupInfo.
            * Shared/mac/ActionMenuHitTestResult.h:
            * Shared/mac/ActionMenuHitTestResult.mm:
            (WebKit::ActionMenuHitTestResult::encode):
            (WebKit::ActionMenuHitTestResult::decode):

            Remove all lookup menu items.
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _defaultMenuItemsForText]):
            (-[WKActionMenuController _defaultMenuItemsForEditableText]):
            (-[WKActionMenuController _defaultMenuItemsForEditableTextWithSuggestions]):
            (-[WKActionMenuController _createActionMenuItemForTag:]):
            (-[WKActionMenuController _lookupText:]): Deleted.

            Set the defaultAnimationController to the lookup-provided animation controller 
            when appropriate.
            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController _defaultAnimationController]):
            (-[WKImmediateActionController _animationControllerForText]):

            Re-factor performDictionaryLookupForRange() so that most of the work is done in a 
            new function called dictionaryPopupInfoForRange(). This was that code can be used 
            for both performing a dictionary lookup and just getting the DictionaryPopupInfo 
            for the ActionMenuHitTest.
            * WebProcess/WebPage/WebPage.h:
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::WebPage::dictionaryPopupInfoForRange):
            (WebKit::WebPage::performDictionaryLookupForRange):
            (WebKit::WebPage::performActionMenuHitTestAtLocation):
            (WebKit::WebPage::lookupTextAtLocation):

2014-12-16  Dana Burkart  <dburkart@apple.com>

        Merged r177303. <rdar://problem/19198539>

    2014-12-15  Timothy Horton  <timothy_horton@apple.com>

            Implement Data Detectors immediate actions for WebKit2
            https://bugs.webkit.org/show_bug.cgi?id=139617
            <rdar://problem/19198539>

            Reviewed by Beth Dakin.

            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController _menuItemForDataDetectedText]):
            Note that this action context is only for immediate actions.

    2014-12-15  Myles C. Maxfield  <mmaxfield@apple.com>

            Addressing post-review comments in r177035
            https://bugs.webkit.org/show_bug.cgi?id=139557

            Reviewed by Darin Adler.

            * Shared/WebHitTestResult.cpp:
            (WebKit::WebHitTestResult::Data::elementBoundingBoxInWindowCoordinates): Migrate off rendererBoundingBox().
            * WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp:
            (WebKit::WebPage::findZoomableAreaForPoint): Ditto.

2014-12-16  Dana Burkart  <dburkart@apple.com>

        Merged r177298. <rdar://problem/19198539>

    2014-12-15  Timothy Horton  <timothy_horton@apple.com>

            Implement Data Detectors immediate actions for WebKit2
            https://bugs.webkit.org/show_bug.cgi?id=139617
            <rdar://problem/19198539>

            Reviewed by Beth Dakin.

            * Shared/API/c/WKImmediateActionTypes.h:
            Add a new type.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView mouseDown:]):
            Send mouseDown along to the WKImmediateActionController too.

            (-[WKView initWithFrame:context:configuration:webView:]):
            Temporarily disable action menus.

            (-[WKView _dismissContentRelativeChildWindows]):
            Hide the immediate action preview when detaching child windows.

            * UIProcess/mac/WKImmediateActionController.h:
            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController willDestroyView:]):
            Clear the DDActionContext when tearing down the view.

            (-[WKImmediateActionController wkView:willHandleMouseDown:]):
            (-[WKImmediateActionController _cancelImmediateAction]):
            (-[WKImmediateActionController _clearImmediateActionState]):
            (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
            (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
            (-[WKImmediateActionController _defaultAnimationController]):
            (-[WKImmediateActionController _updateImmediateActionItem]):
            (-[WKImmediateActionController hidePreview]):
            (-[WKImmediateActionController popoverWillClose:]):
            (-[WKImmediateActionController _menuItemForDataDetectedText]):
            Copy most of the DataDetectors implementation into WKImmediateActionController.

    2014-12-15  Myles C. Maxfield  <mmaxfield@apple.com>

            Delete Notation because we don't use it
            https://bugs.webkit.org/show_bug.cgi?id=139171

            Reviewed by Kent Tamura.

            * WebProcess/InjectedBundle/API/mac/WKDOMInternals.mm:
            (WebKit::WKDOMNodeClass):
            * mac/MigrateHeadersFromWebKitLegacy.make:

2014-12-16  Dana Burkart  <dburkart@apple.com>

        Merged r177242. <rdar://problem/19226350>

    2014-12-12  Timothy Horton  <timothy_horton@apple.com>

            TextIndicator (and other view-relative subwindows) is not dismissed on zoom gesture
            https://bugs.webkit.org/show_bug.cgi?id=139580
            <rdar://problem/19226350>

            Reviewed by Anders Carlsson.

            * UIProcess/PageClient.h:
            * UIProcess/mac/PageClientImpl.h:
            * UIProcess/mac/PageClientImpl.mm:
            (WebKit::PageClientImpl::dismissContentRelativeChildWindows):
            (WebKit::PageClientImpl::dismissDictionaryLookupPanel): Deleted.
            (WebKit::PageClientImpl::dismissActionMenuPopovers): Deleted.
            Merge dismissDictionaryLookupPanel and dismissActionMenuPopovers into
            _dismissContentRelativeChildWindows, which also dismisses TextIndicator and the
            text correction panel. Dismissal of any child windows which are anchored to
            the page content now bottlenecks through this function.

            (WebKit::PageClientImpl::navigationGestureDidBegin):
            Dismiss all anchored subwindows when starting a navigation gesture, not
            just TextIndicator and action menu popovers.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView scrollWheel:]):
            No need to dismiss TextIndicator here; we've got this covered in the more-inclusive
            WebPageProxy::pageDidScroll, and will now dismiss more things.

            (-[WKView mouseDown:]):
            Dismiss more things.

            (-[WKView viewDidMoveToWindow]):
            Dismiss more things.

            (-[WKView _dismissContentRelativeChildWindows]):
            The aforementioned combined dismissal function.

            (-[WKView magnifyWithEvent:]):
            (-[WKView smartMagnifyWithEvent:]):
            (-[WKView setMagnification:centeredAtPoint:]):
            (-[WKView setMagnification:]):
            Any time the page magnification changes, dismiss all the things.

            * UIProcess/API/mac/WKViewPrivate.h:
            Expose _dismissContentRelativeChildWindows instead of _dismissActionMenuPopovers;
            for all existing clients, it makes more sense to dismiss all view-relative subwindows
            than just a subset of them.
            
            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::didCommitLoadForFrame):
            (WebKit::WebPageProxy::pageDidScroll):
            (WebKit::WebPageProxy::resetStateAfterProcessExited):
            Make use of dismissAnchoredSubwindows.

            * UIProcess/mac/WKActionMenuController.h:
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController prepareForMenu:withEvent:]):
            Dismiss more things.

            (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
            (-[WKActionMenuController dismissActionMenuPopovers]): Deleted.
            dismissActionMenuPopovers is folded into WKView's _dismissContentRelativeChildWindows.

            (-[WKActionMenuController _showTextIndicator]): Deleted.
            (-[WKActionMenuController _hideTextIndicator]): Deleted.
            Fold _showTextIndicator and _hideTextIndicator into their only callers.
            _isShowingTextIndicator was never necessary, because it's OK to change
            the current TextIndicator at any time, and a newer one is always more relevant.

2014-12-16  Dana Burkart  <dburkart@apple.com>

        Merged r177192. <rdar://problem/19225448>

    2014-12-11  Beth Dakin  <bdakin@apple.com>

            WK2: Need new SPI for Webkit clients to override default immediate action
            https://bugs.webkit.org/show_bug.cgi?id=139564
            -and corresponding-
            rdar://problem/19225448

            Reviewed by Tim Horton.

            New SPI _immediateActionAnimationControllerForHitTestResult:withType:userData:
            * UIProcess/API/Cocoa/WKViewPrivate.h:
            * UIProcess/API/mac/WKView.mm:
            (-[WKView _immediateActionAnimationControllerForHitTestResult:withType:userData:]):

            Keep at ivar for the userData so that it can be passed to the new SPI.
            * UIProcess/mac/WKImmediateActionController.h:
            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController _clearImmediateActionState]):
            (-[WKImmediateActionController didPerformActionMenuHitTest:userData:]):

            Always give the SPI a chance to override the animationController.
            (-[WKImmediateActionController _updateImmediateActionItem]):

            Need to mark WKImmediateActionTypes.h as Private.
            * WebKit2.xcodeproj/project.pbxproj:

2014-12-16  Dana Burkart  <dburkart@apple.com>

        Merged r177186. <rdar://problem/19208291>

    2014-12-11  Timothy Horton  <timothy_horton@apple.com>

            Move the preview popover to WebImmediateActionController
            https://bugs.webkit.org/show_bug.cgi?id=139563
            <rdar://problem/19208291>

            Reviewed by Beth Dakin.

            * UIProcess/mac/WKImmediateActionController.h:
            Remove an unnecessary forward declaration.

            * UIProcess/mac/WKImmediateActionController.mm:
            (-[WKImmediateActionController willDestroyView:]):
            Clear the immediate action recognizer when the view goes away.

2014-12-16  Dana Burkart  <dburkart@apple.com>

        Merged r177183. <rdar://problem/19208291>

    2014-12-11  Timothy Horton  <timothy_horton@apple.com>

            Fix the build.

            * UIProcess/mac/WKImmediateActionController.h:
            * UIProcess/mac/WKImmediateActionController.mm:

2014-12-16  Dana Burkart  <dburkart@apple.com>

        Merged r177180. <rdar://problem/19208291>

    2014-12-11  Timothy Horton  <timothy_horton@apple.com>

            Move the preview popover to WKImmediateActionController
            https://bugs.webkit.org/show_bug.cgi?id=139560
            <rdar://problem/19208291>

            Reviewed by Beth Dakin.

            * Shared/API/c/WKImmediateActionTypes.h:
            Add a link preview type.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView initWithFrame:context:configuration:webView:]):
            Pass the gesture recognizer to the WKImmediateActionController.

            (-[WKView _setPreviewTitle:]):
            Forward preview title changes to the WKImmediateActionController,
            because that's where the preview popover lives now.

            * UIProcess/mac/WKActionMenuController.h:
            * UIProcess/mac/WKActionMenuController.mm:
            Move WKPagePreviewViewController into its own file.
            Move page preview popover related code to WKImmediateActionController.

            * UIProcess/mac/WKImmediateActionController.h:
            * UIProcess/mac/WKImmediateActionController.mm:
            Compare the gesture recognizers directly instead of their views, for accuracy.
            Move page preview popover related code in from WKActionMenuController.
            Some of this should eventually move to WKPagePreviewViewController, but
            for now for ease of transition we will move it here.

            * UIProcess/mac/WKPagePreviewViewController.h: Added.
            * UIProcess/mac/WKPagePreviewViewController.mm: Added.
            * WebKit2.xcodeproj/project.pbxproj:
            Move WKPagePreviewViewController into its own file.

2014-12-16  Dana Burkart  <dburkart@apple.com>

        Merged r177116. <rdar://problem/19198539>

    2014-12-10  Beth Dakin  <bdakin@apple.com>

             Follow-up build fix.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView initWithFrame:context:configuration:webView:]):

2014-12-16  Dana Burkart  <dburkart@apple.com>

        Merged r177114. <rdar://problem/19198539>

    2014-12-10  Beth Dakin  <bdakin@apple.com>

            Speculative build fix.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView initWithFrame:context:configuration:webView:]):

2014-12-15  Dana Burkart  <dburkart@apple.com>

        Merged r177113. <rdar://problem/19198539>

    2014-12-10  Beth Dakin  <bdakin@apple.com>

            WK2: Add initial support for immediate actions
            https://bugs.webkit.org/show_bug.cgi?id=139511

            Reviewed by Tim Horton.

            New enum to track immediate action types as we add them.
            * Shared/API/c/WKImmediateActionTypes.h: Added.

            Create an NSImmediateActionGestureRecognizer if possible and a controller.
            * UIProcess/API/mac/WKView.mm:
            (-[WKView dealloc]):
            (-[WKView initWithFrame:context:configuration:webView:]):
            (-[WKView _didPerformActionMenuHitTest:userData:]):

            This basic implementation of the controller will use the delegate methods to 
            perform an ActionMenuHitTest when relevant. Future patches will patch 
            _updateImmediateActionItem to use the hit test result to determine if there is any 
            immediate action that should be taken.
            * UIProcess/mac/WKImmediateActionController.h: Added.
            * UIProcess/mac/WKImmediateActionController.mm: Added.
            (-[WKImmediateActionController willDestroyView:]):
            (-[WKImmediateActionController _clearImmediateActionState]):
            (-[WKImmediateActionController didPerformActionMenuHitTest:userData:]):

            Does much of the work done in Action Menu’s prepareForMenu.
            (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):

            Does much of the work done in Action Menu’s menuNeedsUpdate.
            (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):

            Does much of the work done in Action Menu’s didCloseMenu.
            (-[WKImmediateActionController immediateActionRecognizerDidCancelAnimation:]):

            Does much of the work done in Action Menu’s willOpenMenu.
            (-[WKImmediateActionController immediateActionRecognizerDidCompleteAnimation:]):

            To be filled in.
            (-[WKImmediateActionController _updateImmediateActionItem]):
            * WebKit2.xcodeproj/project.pbxproj:

2014-12-15  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177253. rdar://problem/19221935

    2014-12-12  Beth Dakin  <bdakin@apple.com>

            Need a fake mouse move after hiding data detectors UI
            https://bugs.webkit.org/show_bug.cgi?id=139608
            -and corresponding-
            rdar://problem/19221935

            Reviewed by Tim Horton.

            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::WebPage::dataDetectorsDidHideUI):

2014-12-11  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177106. rdar://problem/19135389

    2014-12-10  Timothy Horton  <timothy_horton@apple.com>

            Fix the build.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView _targetWindowForMovePreparation]):

2014-12-11  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177104. rdar://problem/19135389

    2014-12-10  Timothy Horton  <timothy_horton@apple.com>

            Provide SPI to asynchronously move a WKView into a window and know when it has painted
            https://bugs.webkit.org/show_bug.cgi?id=139460
            <rdar://problem/19135389>

            Reviewed by Anders Carlsson.

            * UIProcess/API/Cocoa/WKViewPrivate.h:
            Add _prepareForMoveToWindow:withCompletionHandler:, which internally
            goes through the motions of being parented in that window and calls
            the completion handler once painting is done and the view is ready
            to be displayed (upon which we expect the view to actually move into the window).

            * UIProcess/API/mac/WKView.mm:
            (-[WKView viewWillMoveToWindow:]):
            If we currently have a _targetWindowForMovePreparation (and are
            pretending to be in that window), avoid performing viewWillMoveToWindow:
            for a different window.

            (-[WKView viewDidMoveToWindow]):
            (-[WKView doWindowDidChangeScreen]):
            (-[WKView _intrinsicDeviceScaleFactor]):
            (-[WKView _colorSpace]):
            (-[WKView _targetWindowForMovePreparation]):
            If we have a _targetWindowForMovePreparation, use its properties instead
            of self.window's.

            (-[WKView _prepareForMoveToWindow:withCompletionHandler:]):
            Simulate a move into the target window, but defer sending the view state update.
            Then, send the view state update after registering the completion handler.

            * UIProcess/API/mac/WKViewInternal.h:
            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::WebPageProxy):
            Rename m_viewStateChangeWantsReply to m_viewStateChangeWantsSynchronousReply.

            (WebKit::WebPageProxy::installViewStateChangeCompletionHandler):
            Added. Allow installing a block that will be called the next time
            we get a didUpdateViewState back from the WebProcess after pushing the
            current view state changes.

            (WebKit::WebPageProxy::viewStateDidChange):
            Adapt to the aforementioned rename.

            (WebKit::WebPageProxy::dispatchViewStateChange):
            Adapt to the aforementioned rename.
            Send the view state change callback IDs along with SetViewState.

            (WebKit::WebPageProxy::updateViewState):
            Adapt to the aforementioned rename.

            * UIProcess/WebPageProxy.h:
            * UIProcess/mac/PageClientImpl.h:
            * UIProcess/mac/PageClientImpl.mm:
            (WebKit::PageClientImpl::activeWindow):
            (WebKit::PageClientImpl::isViewWindowActive):
            (WebKit::PageClientImpl::isViewVisible):
            (WebKit::PageClientImpl::isViewVisibleOrOccluded):
            (WebKit::PageClientImpl::isViewInWindow):
            (WebKit::PageClientImpl::viewLayerHostingMode):
            If we have a _targetWindowForMovePreparation, use its properties instead
            of the WKView's window's.

            * WebProcess/WebPage/DrawingArea.h:
            (WebKit::DrawingArea::viewStateDidChange):
            * WebProcess/WebPage/WebPage.cpp:
            (WebKit::WebPage::reinitializeWebPage):
            (WebKit::WebPage::setViewState):
            * WebProcess/WebPage/WebPage.h:
            * WebProcess/WebPage/WebPage.messages.in:
            * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
            * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
            (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange):
            * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
            * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
            (WebKit::TiledCoreAnimationDrawingArea::viewStateDidChange):
            Push the callback IDs to the WebProcess, and accumulate them in TiledCoreAnimationDrawingArea.

            (WebKit::TiledCoreAnimationDrawingArea::didUpdateViewStateTimerFired):
            Call all of the callbacks after one runloop cycle, just like DidUpdateViewState.

2014-12-11  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r177111. rdar://problem/19198388

    2014-12-10  Timothy Horton  <timothy_horton@apple.com>

            Should have copy and paste items in all text menus
            https://bugs.webkit.org/show_bug.cgi?id=139510
            <rdar://problem/19198388>

            Reviewed by Beth Dakin.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _defaultMenuItemsForText]):
            Add a disabled paste menu item into the read-only text menu.

            (-[WKActionMenuController _defaultMenuItemsForWhitespaceInEditableArea]):
            Add a disabled copy menu item into the editable whitespace text menu.

2014-12-10  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r176999. rdar://problem/19149219

    2014-12-08  Beth Dakin  <bdakin@apple.com>

            Copy and Lookup menu items should be disabled when something is not copyable
            https://bugs.webkit.org/show_bug.cgi?id=139423

            Reviewed by Tim Horton.

            Add allowsCopy to the WebHitTestResult.
            * Shared/WebHitTestResult.cpp:
            (WebKit::WebHitTestResult::Data::Data):
            (WebKit::WebHitTestResult::Data::encode):
            (WebKit::WebHitTestResult::Data::decode):
            * Shared/WebHitTestResult.h:
            (WebKit::WebHitTestResult::allowsCopy):

            Set autoenablesItems to NO. It’s messing with our ability to control the enable/
            disable state otherwise.
            * UIProcess/API/mac/WKView.mm:
            (-[WKView initWithFrame:context:configuration:webView:]):

            Disable both lookup and copy when a WebHitTestResult does not allow copy.
            * UIProcess/mac/WKActionMenuController.mm:

2014-12-08  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r176883. <rdar://problem/19158331>

    2014-12-05  Tim Horton  <timothy_horton@apple.com>

            If the action menu hit test times out, a menu with a single separator appears
            https://bugs.webkit.org/show_bug.cgi?id=139320
            <rdar://problem/19158331>

            Reviewed by Beth Dakin.

            * UIProcess/mac/WKActionMenuController.h:
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController menuNeedsUpdate:]):
            (-[WKActionMenuController _defaultMenuItems]):
            Add a new "TimedOut" state, which we get into if the sync wait for
            didPerformActionMenuHitTest times out. In this case, we'll drop the
            separator item and give up on the menu. This way, the menu will never
            have just a single separator item at the end of menuNeedsUpdate:.


2014-12-08  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r176870. <rdar://problem/19052381>

    2014-12-05  Tim Horton  <timothy_horton@apple.com>

            Keyboard input should be disabled in the preview popover
            https://bugs.webkit.org/show_bug.cgi?id=139219
            <rdar://problem/19052381>

            Reviewed by Anders Carlsson.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView performKeyEquivalent:]):
            (-[WKView keyUp:]):
            (-[WKView keyDown:]):
            (-[WKView flagsChanged:]):
            There are two implementations of each of these methods in this file.
            Adjust the ones that the original patch missed.


2014-12-08  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r176116. <rdar://problem/19052381>

    2014-11-13  Dan Bernstein  <mitz@apple.com>

            Two WKWebView internal methods are implemented in a category
            https://bugs.webkit.org/show_bug.cgi?id=138728

            Reviewed by Tim HOrton.

            Moved the implementations from the category to the class.

            * UIProcess/API/Cocoa/WKWebView.mm:
            (-[WKWebView _ignoresNonWheelMouseEvents]):
            (-[WKWebView _setIgnoresNonWheelMouseEvents:]):

2014-12-08  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r176596. <rdar://problem/19176127>

    2014-12-01  Joseph Pecoraro  <pecoraro@apple.com>

            Web Inspector: Crash in WebInspectorClient::hideHighlight when page is destroyed
            https://bugs.webkit.org/show_bug.cgi?id=139136

            Reviewed by Simon Fraser.

            * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
            (WebKit::WebInspectorClient::hideHighlight):
            Speculatively fix by null-checking the main frame which
            can be null during page destruction.


2014-12-05  Dana Burkart  <dburkart@apple.com>

        Merge r176820. <rdar://problem/19147218>

    2014-12-04  Beth Dakin  <bdakin@apple.com>

            Clients disabling action menus sometimes still invoke action menu behaviors
            https://bugs.webkit.org/show_bug.cgi?id=139270
            -and corresponding-
            rdar://problem/19147218

            Reviewed by Tim Horton.

            By default, we will keep a single item in the action menu up until the point where 
            _state == ActionMenuState::Ready. So by checking _state here, we are preventing 
            clients from opting out of our choice to wait. Ideally we would always still wait 
            for the Ready state, but this will get the best behavior in the mean time.
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _updateActionMenuItems]):


2014-12-05  Dana Burkart  <dburkart@apple.com>

        Merge r176811. <rdar://problem/19140827>

    2014-12-04  Timothy Horton  <timothy_horton@apple.com>

            Fix the 32-bit build.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView _setTextIndicator:fadeOut:animationCompletionHandler:]):


2014-12-05  Dana Burkart  <dburkart@apple.com>

        Merge r176810. <rdar://problem/19140827>

    2014-12-04  Tim Horton  <timothy_horton@apple.com>

            TextIndicator::createWithSelectionInFrame does synchronous IPC in WebKit2
            https://bugs.webkit.org/show_bug.cgi?id=139252
            <rdar://problem/19140827>

            Reviewed by Anders Carlsson.

            It turns out contentsToScreen requires sync IPC in Mac WebKit2, which we
            really don't want to be doing here (especially since the UI process will often
            be sitting in waitForAndDispatchImmediately waiting for didPerformActionMenuHitTest).

            Go back to keeping TextIndicator rects in "window" coordinates and do the conversion
            in each of the WebKits instead of trying to share that code.

            * Shared/WebCoreArgumentCoders.cpp:
            (IPC::ArgumentCoder<TextIndicatorData>::encode):
            (IPC::ArgumentCoder<TextIndicatorData>::decode):
            * UIProcess/API/mac/WKView.mm:
            (-[WKView _setTextIndicator:fadeOut:animationCompletionHandler:]):
            * WebProcess/WebPage/FindController.cpp:
            (WebKit::FindController::updateFindIndicator):
            (WebKit::FindController::drawRect):
            Adjust to the WebCore changes.


2014-12-05  Dana Burkart  <dburkart@apple.com>

        Merge r173566. <rdar://problem/19150984>

    2014-09-11  Andy Estes  <aestes@apple.com>

            [WebKit2] WKImageCreateCGImage crashes when passed a null WKImage
            https://bugs.webkit.org/show_bug.cgi?id=136768

            Reviewed by Tim Horton.

            WKImageCreateFromCGImage can return null, so it only seems fair that WKImageCreateCGImage should tolerate null.

            * Shared/API/c/cg/WKImageCG.cpp:
            (WKImageCreateCGImage):


2014-12-04  Dana Burkart  <dburkart@apple.com>

        Merge r176766. <rdar://problem/19072083>

   2014-12-03  Beth Dakin  <bdakin@apple.com> 
    
            <input> elements get whitespace action menu instead of editable text menu 
            https://bugs.webkit.org/show_bug.cgi?id=139241 
            -and corresponding- 
            rdar://problem/19072083 
     
            Reviewed by Sam Weinig. 

            Add isOverTextInsideFormControlElement to WebHitTestResult. 
            * Shared/WebHitTestResult.cpp: 
            (WebKit::WebHitTestResult::Data::Data): 
            (WebKit::WebHitTestResult::Data::encode): 
            (WebKit::WebHitTestResult::Data::decode): 
            * Shared/WebHitTestResult.h: 
            (WebKit::WebHitTestResult::isOverTextInsideFormControlElement): 
   
            Offer the text menus for text inside form controls. 
            * UIProcess/mac/WKActionMenuController.mm: 
            (-[WKActionMenuController _defaultMenuItems]): 
   
            We should disallow shadow content in the hit test. This is the default and it is  
            how context menus behave. We originally wanted to text inside shadow content so  
            that we could find the text, but the new function I added to HitTestResult will  
            allow that. 
            * WebProcess/WebPage/mac/WebPageMac.mm: 

            Adjust to the fact that we don’t hit test shadow content any more. 
            (WebKit::WebPage::performActionMenuHitTestAtLocation): 
            (WebKit::WebPage::lookupTextAtLocation): 
            (WebKit::WebPage::focusAndSelectLastActionMenuHitTestResult): 

2014-12-04  Dana Burkart  <dburkart@apple.com>

        Merge r173235. <rdar://problem/19072083>

    2014-09-03  Enrica Casucci  <enrica@apple.com>

            Remove PLATFORM(IOS) from WebCore/editing (Part 1).
            https://bugs.webkit.org/show_bug.cgi?id=136474

            Reviewed by Tim Horton.

            * UIProcess/WebEditCommandProxy.cpp:
            (WebKit::WebEditCommandProxy::nameForEditAction):

2014-12-04  Dana Burkart  <dburkart@apple.com>

        Merge r176763. <rdar://problem/19115662>

    2014-12-03  Tim Horton  <timothy_horton@apple.com>

            Implement action menus for tel: URLs
            https://bugs.webkit.org/show_bug.cgi?id=139240
            <rdar://problem/19115662>

            Reviewed by Anders Carlsson.

            * Shared/API/c/WKActionMenuTypes.h:
            Add a new type.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _defaultMenuItemsForDataDetectableLink]):
            Rename this function as it will work for both mailto and tel URLs.
            Adjust it to use contextForView:.

            (-[WKActionMenuController _clearActionMenuState]):
            (-[WKActionMenuController menuNeedsUpdate:]):
            (-[WKActionMenuController _defaultMenuItems]):
            Don't check the menu type when going to interact with _currentActionContext.
            We'll only have a _currentActionContext if we have a data detected item,
            and there are multiple menu types that end up using DDActionContext.


2014-12-03  Dana Burkart  <dburkart@apple.com>

        Merge r176753. <rdar://problem/19052381>

    2014-12-03  Tim Horton  <timothy_horton@apple.com>

            Keyboard input should be disabled in the preview popover
            https://bugs.webkit.org/show_bug.cgi?id=139219
            <rdar://problem/19052381>

            Reviewed by Anders Carlsson.

            Make sure that keyboard input, Quick Look, etc. are blocked in preview popovers
            and WKThumbnailViews. Also block the fake mouseMove events that originate in
            the Web process upon scrolling, because we were missing those despite blocking
            ordinary mouseMove events.

            * UIProcess/API/Cocoa/WKViewPrivate.h:
            * UIProcess/API/mac/WKView.mm:
            Rename _ignoresNonWheelMouseEvents to _ignoresNonWheelEvents, because it will
            apply not only to mouse events but also key events, Quick Look events, menu
            preparation events, swipe events, etc.

            Add _ignoresAllEvents, which means the same thing as _ignoresNonWheelEvents
            with the addition of ignoring scrollWheel events.

            (-[WKView scrollWheel:]):
            (-[WKView swipeWithEvent:]):
            (-[WKView mouseMoved:]):
            (-[WKView mouseDown:]):
            (-[WKView mouseUp:]):
            (-[WKView mouseDragged:]):
            Adjust to the new name.

            (-[WKView performKeyEquivalent:]):
            (-[WKView keyUp:]):
            (-[WKView keyDown:]):
            (-[WKView flagsChanged:]):
            (-[WKView quickLookWithEvent:]):
            (-[WKView prepareForMenu:withEvent:]):
            (-[WKView willOpenMenu:withEvent:]):
            (-[WKView didCloseMenu:withEvent:]):
            Block all of these events as well as those we were previously blocking.

            (-[WKView _setIgnoresAllEvents:]):
            (-[WKView _setIgnoresNonWheelMouseEvents:]):
            (-[WKView _setIgnoresNonWheelEvents:]):
            (-[WKView _ignoresNonWheelEvents]):
            (-[WKView _ignoresAllEvents]):
            * UIProcess/API/mac/WKViewInternal.h:
            Adjust to the new names and the addition of ignoresAllEvents.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKPagePreviewViewController loadView]):
            Adjust to the new name.

            (-[WKActionMenuController prepareForMenu:withEvent:]):
            Move bailing from prepareForMenu: up to WKView.

            * UIProcess/API/Cocoa/WKWebView.mm:
            (-[WKWebView _ignoresNonWheelEvents]):
            (-[WKWebView _setIgnoresNonWheelEvents:]):
            (-[WKWebView _ignoresNonWheelMouseEvents]): Deleted.
            (-[WKWebView _setIgnoresNonWheelMouseEvents:]): Deleted.
            * UIProcess/API/Cocoa/WKWebViewInternal.h:
            Adjust to the new name (without "mouse" in it).

            * UIProcess/API/Cocoa/_WKThumbnailView.mm:
            (-[_WKThumbnailView _viewWasUnparented]):
            (-[_WKThumbnailView _viewWasParented]):
            Explicitly tell WKView to disable event handling while thumbnailed,
            instead of having WKView special-case thumbnail views internally.

            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::setShouldDispatchFakeMouseMoveEvents):
            * UIProcess/WebPageProxy.h:
            * WebProcess/WebCoreSupport/WebChromeClient.cpp:
            (WebKit::WebChromeClient::shouldDispatchFakeMouseMoveEvents):
            * WebProcess/WebCoreSupport/WebChromeClient.h:
            * WebProcess/WebPage/WebPage.cpp:
            (WebKit::WebPage::WebPage):
            * WebProcess/WebPage/WebPage.h:
            (WebKit::WebPage::shouldDispatchFakeMouseMoveEvents):
            (WebKit::WebPage::setShouldDispatchFakeMouseMoveEvents):
            * WebProcess/WebPage/WebPage.messages.in:
            Plumb shouldDispatchFakeMouseMoveEvents from the UI process to the Web process
            and through to WebKit2's ChromeClient implementation.

2014-12-04  Dana Burkart  <dburkart@apple.com>

        Merge r176707. <rdar://problem/19037590>

    2014-12-02  Conrad Shultz  <conrad_shultz@apple.com>

            Don't block menu highlighting when presenting a page preview
            https://bugs.webkit.org/show_bug.cgi?id=139217

            Reviewed by Tim Horton.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _previewURLFromActionMenu:]):
            Defer popover presentation to the next turn of the runloop.


2014-12-03  Dana Burkart  <dburkart@apple.com>

        Merge r176691. <rdar://problem/18944696>

    2014-12-02  Beth Dakin  <bdakin@apple.com>

            Build fix.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _defaultMenuItemsForLink]):


2014-12-03  Dana Burkart  <dburkart@apple.com>

        Merge r176690. <rdar://problem/18944696>

    2014-12-02  Beth Dakin  <bdakin@apple.com>

            More build fix.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _defaultMenuItemsForLink]):


2014-12-03  Dana Burkart  <dburkart@apple.com>

        Merge r176684. <rdar://problem/18944696>

    2014-12-02  Beth Dakin  <bdakin@apple.com>

            Should use standardQuickLookMenuItem for apps that don't implement customizations
            https://bugs.webkit.org/show_bug.cgi?id=139193
            -and corresponding-
            rdar://problem/18944696

            Reviewed by Anders Carlsson.

            New SPI will allow clients to opt-out of the standardQuickLookMenuItem. By 
            default, opt in.
            * UIProcess/API/Cocoa/WKViewPrivate.h:
            * UIProcess/API/mac/WKView.mm:
            (-[WKView _shouldUseStandardQuickLookPreview]):
            * UIProcess/mac/WKActionMenuController.mm:

            Use [NSMenuItem standardQuickLookMenuItem] unless the client has requested 
            otherwise.
            (-[WKActionMenuController _defaultMenuItemsForLink]):

            Delegate methods to set up the standardQuickLookMenuItem.
            (-[WKActionMenuController menuItem:viewAtScreenPoint:]):
            (-[WKActionMenuController menuItem:previewItemAtPoint:]):
            (-[WKActionMenuController menuItem:preferredEdgeForPoint:]):

2014-12-03  Dana Burkart  <dburkart@apple.com>

        Merge r176678. <rdar://problem/19072236>

    2014-12-02  Tim Horton  <timothy_horton@apple.com>

            TextIndicator can get stuck (especially if we don't get LUNotificationPopoverWillClose when we should)
            https://bugs.webkit.org/show_bug.cgi?id=139175
            <rdar://problem/19072236>

            Reviewed by Beth Dakin.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView scrollWheel:]):
            (-[WKView mouseDown:]):
            Work around <rdar://problem/19086993> by always explicitly clearing the
            active text indicator in mouseDown: and scrollWheel:.
            This way, even if you manage to get a text indicator that outlives the
            Look Up popover (or find-in-page, or whatever), it will be dismissed
            by clicking or scrolling the view.


2014-12-02  Dana Burkart  <dburkart@apple.com>

        Merge r176474. <rdar://problem/19063717>

    2014-11-21  Tim Horton  <timothy_horton@apple.com>

            Crashes while encoding a TextIndicator with no contentImageWithHighlight
            https://bugs.webkit.org/show_bug.cgi?id=138984
            <rdar://problem/19063717>

            Reviewed by Sam Weinig.

            * Shared/WebCoreArgumentCoders.cpp:
            (IPC::ArgumentCoder<TextIndicatorData>::encode):
            (IPC::ArgumentCoder<TextIndicatorData>::decode):
            encodeImage doesn't deal with null images, so handle that case gracefully.


2014-12-02  Dana Burkart  <dburkart@apple.com>

        Merge r176613. <rdar://problem/19108805>

    2014-12-01  Conrad Shultz  <conrad_shultz@apple.com>

            Clients need a way to explicitly set the title of a page preview
            https://bugs.webkit.org/show_bug.cgi?id=139161

            Reviewed by Beth Dakin.

            This implicitly assumes that only one page preview can be associate with a given WKView at a time.

            * UIProcess/API/Cocoa/WKViewPrivate.h:
            * UIProcess/API/mac/WKView.mm:
            (-[WKView _setPreviewTitle:]):
            Wrap -[WKActionMenuController setPreviewTitle:]

            * UIProcess/mac/WKActionMenuController.h:
            * UIProcess/mac/WKActionMenuController.mm:
            Add ivars for the title and the title text field (previously not independently exposed).
            (-[WKPagePreviewViewController previewTitle]):
            Accessor.
            (-[WKPagePreviewViewController setPreviewTitle:]):
            Accessor; set the text field's string value.
            (-[WKPagePreviewViewController loadView]):
            Adopt the _titleTextField ivar; assume that if a client has explicitly set the previewTitle then we don't
            need to ask for it again.
            (-[WKActionMenuController setPreviewTitle:]):
            Wrap -[WKPagePreviewViewController setPreviewTitle:].


2014-12-02  Dana Burkart  <dburkart@apple.com>

        Merge r176599. <rdar://problem/18992185>

    2014-12-01  Tim Horton  <timothy_horton@apple.com>

            Implement yellow highlight for WebKit1 data detectors
            https://bugs.webkit.org/show_bug.cgi?id=138956
            <rdar://problem/18992185>

            Reviewed by Beth Dakin.

            * Shared/WebCoreArgumentCoders.cpp:
            (IPC::ArgumentCoder<TextIndicatorData>::encode):
            (IPC::ArgumentCoder<TextIndicatorData>::decode):
            * WebProcess/WebPage/FindController.cpp:
            (WebKit::FindController::updateFindIndicator):
            (WebKit::FindController::drawRect):
            Adjust to the fact that TextIndicator keeps screen-relative rects.

2014-12-02  Dana Burkart  <dburkart@apple.com>

        Merge r176462. <rdar://problem/18992185>

    2014-11-21  Tim Horton  <timothy_horton@apple.com>

            Move TextIndicator{Window} to WebCore
            https://bugs.webkit.org/show_bug.cgi?id=138954
            <rdar://problem/18992185>

            Some adjustments by Csaba Osztrogonác.
            Reviewed by Anders Carlsson.

            * CMakeLists.txt:
            Remove TextIndicator.cpp.

            * Scripts/webkit/messages.py:
            (struct_or_class):
            (headers_for_type):
            Tell messages.py that TextIndicatorData is a struct, and comes from TextIndicator.h.

            * Shared/WebCoreArgumentCoders.h:
            * Shared/WebCoreArgumentCoders.cpp:
            (IPC::ArgumentCoder<TextIndicatorData>::encode):
            (IPC::ArgumentCoder<TextIndicatorData>::decode):
            Add argument coders for TextIndicatorData.

            * Shared/DictionaryPopupInfo.h:        
            * Shared/mac/ActionMenuHitTestResult.h:
            * Shared/mac/ActionMenuHitTestResult.mm:
            * UIProcess/API/gtk/PageClientImpl.h:
            * UIProcess/API/gtk/PageClientImpl.cpp:
            * UIProcess/API/mac/WKView.mm:
            * UIProcess/API/mac/WKViewInternal.h:
            * UIProcess/CoordinatedGraphics/WebView.h:
            * UIProcess/CoordinatedGraphics/WebView.cpp:
            * UIProcess/PageClient.h:
            * UIProcess/WebPageProxy.cpp:
            * UIProcess/WebPageProxy.h:
            * UIProcess/WebPageProxy.messages.in:
            * UIProcess/ios/PageClientImplIOS.h:
            * UIProcess/ios/WKContentView.h:
            * UIProcess/mac/PageClientImpl.h:
            * UIProcess/mac/PageClientImpl.mm:
            * UIProcess/mac/WKActionMenuController.mm:
            * WebKit2.xcodeproj/project.pbxproj:
            * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
            * WebProcess/WebPage/FindController.cpp:
            * WebProcess/WebPage/WebPage.h:
            * WebProcess/WebPage/ios/WebPageIOS.mm:
            * WebProcess/WebPage/mac/WebPageMac.mm:
            Adjust to TextIndicator and TextIndicatorWindow's new home.

2014-12-02  Dana Burkart  <dburkart@apple.com>

        Merge r176574. <rdar://problem/19052564>

    2014-11-29  Anders Carlsson  <andersca@apple.com>

            Crash when calling WKPageClose on the originated page from within createNewPage callback
            https://bugs.webkit.org/show_bug.cgi?id=139099
            <rdar://problem/19052564>

            Reviewed by Sam Weinig.

            Null check the namespace ID.

            * UIProcess/Storage/StorageManager.cpp:
            (WebKit::StorageManager::cloneSessionStorageNamespaceInternal):


2014-12-02  Dana Burkart  <dburkart@apple.com>

        Merge r176570. <rdar://problem/19075587>

    2014-11-28  Tim Horton  <timothy_horton@apple.com>

            Stale userData is handed to WKView _actionMenuItemsForHitTestResult under prepareForMenu
            https://bugs.webkit.org/show_bug.cgi?id=139069
            <rdar://problem/19075587>

            Reviewed by Sam Weinig.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController wkView:willHandleMouseDown:]):
            (-[WKActionMenuController didCloseMenu:withEvent:]):
            (-[WKActionMenuController _clearActionMenuState]):
            Previously, _userData was not being cleared in didCloseMenu, so a subsequent
            action menu invocation would end up sending stale userData to _actionMenuItemsForHitTestResult.

            Additionally, factor all of the cleanup code out into _clearActionMenuState,
            and call it from both wkView:willHandleMouseDown: and didCloseMenu:withEvent:.


2014-12-02  Dana Burkart  <dburkart@apple.com>

        Merge r176569. <rdar://problem/19086676>

    2014-11-26  Timothy Horton  <timothy_horton@apple.com>

            DataDetectors PageOverlay callbacks are never called
            https://bugs.webkit.org/show_bug.cgi?id=139067
            <rdar://problem/19086676>

            Reviewed by Anders Carlsson.

            * Shared/mac/ActionMenuHitTestResult.mm:
            (WebKit::ActionMenuHitTestResult::encode):
            (WebKit::ActionMenuHitTestResult::decode):
            Encode/decode the PageOverlay ID.


2014-12-02  Dana Burkart  <dburkart@apple.com>

        Merge r176511. <rdar://problem/19070840>

    2014-11-23  Conrad Shultz  <conrad_shultz@apple.com>

            Page previews should have titles
            https://bugs.webkit.org/show_bug.cgi?id=139020

            Reviewed by Tim Horton.

            * UIProcess/API/Cocoa/WKViewPrivate.h:
            Declare -_titleForPreviewOfURL:.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView _titleForPreviewOfURL:]):
            Stub implementation.

            * UIProcess/mac/WKActionMenuController.mm:
            (+[WKPagePreviewViewController previewPadding]):
            Account for the title height.
            (-[WKPagePreviewViewController loadView]):
            Set correct autoresize masks on some views; create and configure a title view that is
            horizontally and vertically centered.
            (-[WKActionMenuController pagePreviewViewController:titleForPreviewOfURL:]):
            WKPagePreviewViewControllerDelegate method; wrap -[WKView _titleForPreviewOfURL:].


2014-11-21  Jer Noble  <jer.noble@apple.com>

        Support multiple signatures of diagnostic logging.
        https://bugs.webkit.org/show_bug.cgi?id=138690

        Reviewed by Anders Carlsson.

        Extend the existing WKBundlePageDiagnosticLoggingClient interface by deprecating
        the original logDiagnosticMessage client method in V1 and adding three new,
        explicit client methods.

        * CMakeLists.txt:
        * WebKit2.xcodeproj/project.pbxproj:
        * WebProcess/InjectedBundle/API/c/WKBundlePageDiagnosticLoggingClient.h:
        * WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.cpp:
        (WebKit::InjectedBundlePageDiagnosticLoggingClient::logDiagnosticMessageDeprecated):
            Renamed from logDiagnosticMessage().
        (WebKit::InjectedBundlePageDiagnosticLoggingClient::logDiagnosticMessage): Pass to the client.
        (WebKit::InjectedBundlePageDiagnosticLoggingClient::logDiagnosticMessageWithResult): Ditto.
        (WebKit::InjectedBundlePageDiagnosticLoggingClient::logDiagnosticMessageWithValue): Ditto.
        * WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.h:
        * WebProcess/WebCoreSupport/WebChromeClient.h:
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::logDiagnosticMessage): Deleted.
        * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp: Added.
        (WebKit::WebDiagnosticLoggingClient::WebDiagnosticLoggingClient): Simple constructor.
        (WebKit::WebDiagnosticLoggingClient::~WebDiagnosticLoggingClient): Simple destructor.
        (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessage): Pass to the injected bundle.
        (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithResult): Ditto.
        (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValue): Ditto.
        * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h: Added.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::WebPage): Initialize the new client.

2014-12-02  Dana Burkart  <dburkart@apple.com>

        Merge r176486. <rdar://problem/19056442>

    2014-11-21  Timothy Horton  <timothy_horton@apple.com>

            Fix the build.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView mouseDown:]):


2014-12-02  Dana Burkart  <dburkart@apple.com>

        Merge r176485. <rdar://problem/19061959>

    2014-11-21  Beth Dakin  <bdakin@apple.com>

            The preview action menu item should not have a title
            https://bugs.webkit.org/show_bug.cgi?id=138989
            -and corresponding-
            rdar://problem/19061959

            Reviewed by Anders Carlsson.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _createActionMenuItemForTag:]):


2014-12-02  Dana Burkart  <dburkart@apple.com>

        Merge r176483. <rdar://problem/19064523>

    2014-11-21  Conrad Shultz  <conrad_shultz@apple.com>

            Page previews should have a margin.
            https://bugs.webkit.org/show_bug.cgi?id=138990

            Reviewed by Beth Dakin.

            Enclose the WKWebView (or client-supplied preview view) in a container slightly larger
            than the preview view. Adjust sizing code to accommodate the margin.

            * UIProcess/mac/WKActionMenuController.mm:
            (+[WKPagePreviewViewController previewPadding]):
            Return the total amount of fixed padding surrounding the preview
            (-[WKPagePreviewViewController loadView]):
            Store the actual previewView in an ivar so that clients can distinguish it from the container
            view; wrap the preview in a container view; set frames appropriately.
            (-[WKActionMenuController _createPreviewPopover]):
            Update to reflect method rename; supplement the popover size with the fixed padding.
            (-[WKActionMenuController _preferredPopoverSizeWithPreviewPadding:]):
            Renamed from -_preferredPopoverSize; account for the fixed padding when computing the preferred size.
            (-[WKActionMenuController _clearPreviewPopover]):
            Use the previewView ivar instead of the view controller's view.
            (-[WKActionMenuController pagePreviewViewControllerWasClicked:]):
            Ditto.
            (-[WKActionMenuController _preferredPopoverSize]): Deleted.


2014-12-02  Dana Burkart  <dburkart@apple.com>

        Merge r176480. <rdar://problem/19056442>

    2014-11-21  Tim Horton  <timothy_horton@apple.com>

            REGRESSION (r176415): Can get stuck, unable to invoke any DataDetectors popovers
            https://bugs.webkit.org/show_bug.cgi?id=138955
            <rdar://problem/19056442>

            Reviewed by Anders Carlsson.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView mouseDown:]):
            * UIProcess/mac/WKActionMenuController.h:
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController wkView:willHandleMouseDown:]):
            (-[WKActionMenuController didCloseMenu:withEvent:]):
            (-[WKActionMenuController menuNeedsUpdate:]):
            Keep track of whether we have called shouldUseActionsWithContext: on a
            DDActionContext; if we get a mouseDown without having seen didCloseMenu:
            (and thus don't properly pair the shouldUseActionsWithContext: with a didUseActions),
            tear down the old DDActionContext before proceeding.


2014-12-02  Dana Burkart  <dburkart@apple.com>

        Merge r176477. <rdar://problem/19056715>

    2014-11-21  Tim Horton  <timothy_horton@apple.com>

            REGRESSION (r176351): Parts of apple.com/contact aren't Lookup-able
            ​https://bugs.webkit.org/show_bug.cgi?id=138960
            <rdar://problem/19056715>

            Reviewed by Anders Carlsson.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
            (-[WKActionMenuController _defaultMenuItemsForMailtoLink]): Deleted.
            Use DataDetectors SPI instead of an explicit blacklist.


2014-12-02  Dana Burkart  <dburkart@apple.com>

        Merge r176463. <rdar://problem/19056715>

    2014-11-21  Tim Horton  <timothy_horton@apple.com>

            REGRESSION (r176351): Parts of apple.com/contact aren't Lookup-able
            https://bugs.webkit.org/show_bug.cgi?id=138960
            <rdar://problem/19056715>

            Reviewed by Beth Dakin.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
            Blacklist contact results, because they don't have useful menus. If we
            bail before setting up _currentActionContext, we'll still allow fallthrough
            to ordinary text actions, avoiding mysterious failure when a contact is detected.

            This doesn't break the case that r176351 was intended to fix,
            because in that case we were detecting e.g. addresses.


2014-12-02  Dana Burkart  <dburkart@apple.com>

        Merge r176460. <rdar://problem/19059946>

    2014-11-21  Tim Horton  <timothy_horton@apple.com>

            REGRESSION (r176238): Mailto links are getting preloaded, which results in a compose window
            https://bugs.webkit.org/show_bug.cgi?id=138972

            Reviewed by Beth Dakin.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController willOpenMenu:withEvent:]):
            Only preload links.


2014-12-02  Dana Burkart  <dburkart@apple.com>

        Merge r176430. <rdar://problem/18904651>

    2014-11-20  Beth Dakin  <bdakin@apple.com>

            Preview popover needs minimum and maximum sizes
            https://bugs.webkit.org/show_bug.cgi?id=138943
            -and corresponding-
            rdar://problem/18904651

            Reviewed by Tim Horton.

            Quick follow-up to get the right screen.
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController largestPopoverSize]):


2014-12-02  Dana Burkart  <dburkart@apple.com>

        Merge r176429. <rdar://problem/18904651>

    2014-11-20  Beth Dakin  <bdakin@apple.com>

            Preview popover needs minimum and maximum sizes
            https://bugs.webkit.org/show_bug.cgi?id=138943
            -and corresponding-
            rdar://problem/18904651

            Reviewed by Tim Horton.

            This patch enforces minimum and maximum popover sizes. If the popover needs to be 
            sized up to be above the minimum, it will end up covering some of the 
            _hitTestResult, so we should compute a new origin rect based on the original 
            event location. 
            * UIProcess/mac/WKActionMenuController.h:
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController prepareForMenu:withEvent:]):
            (-[WKActionMenuController _previewURLFromActionMenu:]):
            (-[WKActionMenuController _createPreviewPopover]):
            (-[WKActionMenuController largestPopoverSize]):
            (-[WKActionMenuController _preferredPopoverSize]):
            (-[WKActionMenuController _preferredSizeForPopoverPresentedFromOriginRect:]): Deleted.


2014-12-02  Dana Burkart  <dburkart@apple.com>

        Merge r176428. <rdar://problem/19052196>

    2014-11-20  Conrad Shultz  <conrad_shultz@apple.com>

            Clicks on previews can be recognized multiple times
            https://bugs.webkit.org/show_bug.cgi?id=138944

            Reviewed by Tim Horton.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKPagePreviewViewController _clickRecognized:]):
            Only dispatch the delegate message on the appropriate gesture recognizer state transition.


2014-11-20  Conrad Shultz  <conrad_shultz@apple.com>

        Clients should be able to customize preview click behavior
        https://bugs.webkit.org/show_bug.cgi?id=138940

        Reviewed by Tim Horton.

        * UIProcess/API/Cocoa/WKViewPrivate.h:
        Declare -_handleClickInPreviewView:URL:.

        * UIProcess/API/mac/WKView.mm:
        (-[WKView _handleClickInPreviewView:URL:]):
        Extracted from -[WKActionMenuController pagePreviewViewControllerWasClicked:].

        * UIProcess/mac/WKActionMenuController.mm:
        (-[WKActionMenuController pagePreviewViewControllerWasClicked:]):
        Extract code to -[WKView _handleClickInPreviewView:URL:].

2014-12-02  Dana Burkart  <dburkart@apple.com>

        Merge r176418. <rdar://problem/19042323>

    2014-11-20  Tim Horton  <timothy_horton@apple.com>

            TextIndicator should have getters for TextIndicator::Data properties
            https://bugs.webkit.org/show_bug.cgi?id=138920

            Reviewed by Beth Dakin.

            Instead of having clients reach into the data(), add getters.
            Remove frameRect(), which is identical to the textBoundingRectInWindowCoordinates getter.
            Remove declarations for draw/drawContentImage, which were already removed.

            * Shared/TextIndicator.cpp:
            (WebKit::TextIndicator::frameRect): Deleted.
            * Shared/TextIndicator.h:
            (WebKit::TextIndicator::textBoundingRectInWindowCoordinates):
            (WebKit::TextIndicator::textRectsInBoundingRectCoordinates):
            (WebKit::TextIndicator::contentImageScaleFactor):
            (WebKit::TextIndicator::contentImageWithHighlight):
            (WebKit::TextIndicator::contentImage):
            * UIProcess/mac/TextIndicatorWindow.mm:
            (-[WKTextIndicatorView initWithFrame:textIndicator:margin:]):
            (-[WKTextIndicatorView presentWithCompletionHandler:]):
            (WebKit::TextIndicatorWindow::setTextIndicator):


2014-12-02  Dana Burkart  <dburkart@apple.com>

        Merge r176415. rdar://problem/18950441

    2014-11-20  Tim Horton  <timothy_horton@apple.com>

            Cancel DataDetectors menu earlier if we know it can't be presented
            https://bugs.webkit.org/show_bug.cgi?id=138922
            <rdar://problem/18950441>

            Reviewed by Beth Dakin.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController willOpenMenu:withEvent:]):
            If we end up with a menu with no items, don't change selection or anything.

            (-[WKActionMenuController menuNeedsUpdate:]):
            Move our call to shouldUseActionsWithContext earlier, to menuNeedsUpdate,
            and use a bigger hammer (removeAllItems).

2014-12-02  Dana Burkart  <dburkart@apple.com>

        Merge r176414. rdar://problem/19042207

    2014-11-20  Tim Horton  <timothy_horton@apple.com>

            Don't use a TextIndicator BounceAndCrossfade transition if the selection highlight is never shown
            https://bugs.webkit.org/show_bug.cgi?id=138919
            <rdar://problem/19042207>

            Reviewed by Beth Dakin.

            * Shared/TextIndicator.h:
            (WebKit::TextIndicator::presentationTransition):
            (WebKit::TextIndicator::setPresentationTransition):
            Add getter and setter pair.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
            If the selection highlight will never be shown because there's only a single menu item,
            use a normal bounce animation instead of bounce + crossfade.

2014-12-02  Dana Burkart  <dburkart@apple.com>

        Merge r176412. rdar://problem/18904600

    2014-11-20  Beth Dakin  <bdakin@apple.com>

            Invalid message WebPageProxy.DidPerformDictionaryLookup on Google stocks result
            https://bugs.webkit.org/show_bug.cgi?id=138568
            -and corresponding-
            rdar://problem/18904600

            Reviewed by Tim Horton.

            Skip images for lookup.
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::WebPage::performDictionaryLookupForRange):

2014-11-19  Dana Burkart  <dburkart@apple.com>

        Merge r176374. rdar://problem/18840128

    2014-11-19  Timothy Horton  <timothy_horton@apple.com>

            Try to fix the iOS build

            * WebProcess/WebPage/ios/WebPageIOS.mm:
            (WebKit::WebPage::performDictionaryLookupForSelection):
            (WebKit::WebPage::performDictionaryLookupForRange):

2014-11-19  Dana Burkart  <dburkart@apple.com>

        Merge r176370. rdar://problem/18840128

    2014-11-19  Timothy Horton  <timothy_horton@apple.com>

            Fix the 32-bit build

            * UIProcess/mac/TextIndicatorWindow.mm:
            (WebKit::TextIndicatorWindow::setTextIndicator):

2014-11-19  Dana Burkart  <dburkart@apple.com>

        Merge r176363. rdar://problem/18840128    

    2014-11-19  Tim Horton  <timothy_horton@apple.com>

            Add an optional entry transition (from selection highlight) to TextIndicator
            https://bugs.webkit.org/show_bug.cgi?id=138856
            <rdar://problem/18840128>

            Reviewed by Anders Carlsson.

            * Shared/TextIndicator.cpp:
            (WebKit::outsetIndicatorRectIncludingShadow):
            (WebKit::TextIndicator::createWithRange):
            (WebKit::snapshotSelectionWithHighlight):
            (WebKit::TextIndicator::createWithSelectionInFrame):
            (WebKit::TextIndicator::frameRect):
            (WebKit::TextIndicator::Data::encode):
            (WebKit::TextIndicator::Data::decode):
            Remove TextIndicator::draw and related functions; drawing is handled entirely
            by the TextIndicatorWindow now, and TextIndicator just stores the required data.

            Unify outsetIndicatorRectIncludingShadow.

            Add an argument to createWithRange/createWithSelectionInFrame to indicate
            if the TextIndicator should transition from the selection highlight to
            the yellow bubble.

            If we're doing the transition, paint the selection into a second bitmap,
            without forcing the text to black and without hiding the blue highlight.

            Encode/decode the second bitmap.

            * Shared/TextIndicator.h:
            * UIProcess/mac/TextIndicatorWindow.h:
            * UIProcess/mac/TextIndicatorWindow.mm:
            (-[WKTextIndicatorView initWithFrame:textIndicator:margin:transitionFromSelectionColor:]):
            (-[WKTextIndicatorView presentWithCompletionHandler:]):
            (-[WKTextIndicatorView hideWithCompletionHandler:]):
            (-[WKTextIndicatorView isFlipped]):
            (WebKit::TextIndicatorWindow::TextIndicatorWindow):
            (WebKit::TextIndicatorWindow::setTextIndicator):
            (WebKit::TextIndicatorWindow::closeWindow):
            (WebKit::TextIndicatorWindow::startFadeOutTimerFired):
            Re-implement the bounce animation using CoreAnimation instead of
            the WKSI-based WKWindowBounceAnimation*.

            * WebProcess/WebPage/WebPage.h:
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::WebPage::performDictionaryLookupForSelection):
            (WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
            (WebKit::WebPage::performDictionaryLookupForRange):
            (WebKit::WebPage::performActionMenuHitTestAtLocation):
            * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
            Use the aforementioned transition animation for performDictionaryLookupOfCurrentSelection,
            the context menu lookup item, and for Data Detectors.

2014-11-19  Dana Burkart  <dburkart@apple.com>

        Merge r176356. rdar://problem/18996776

    2014-11-19  Beth Dakin  <bdakin@apple.com>

            Invoking an action menu on a selection should result in the text menu
            https://bugs.webkit.org/show_bug.cgi?id=138892
            -and corresponding-
            rdar://problem/18996776

            Reviewed by Tim Horton.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _defaultMenuItems]):

2014-11-19  Dana Burkart  <dburkart@apple.com>

        Merge r176351. rdar://problem/18971616

    2014-11-19  Beth Dakin  <bdakin@apple.com>

            Data detected results with no menu items should not fall through to regular text 
            action menus
            https://bugs.webkit.org/show_bug.cgi?id=138887
            -and corresponding-
            rdar://problem/18971616

            Reviewed by Tim Horton.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _defaultMenuItems]):

2014-11-19  Dana Burkart  <dburkart@apple.com>

        Merge r176299. rdar://problem/19024541

    2014-11-18  Conrad Shultz  <conrad_shultz@apple.com>

            Give clients a way to cancel preview popovers
            https://bugs.webkit.org/show_bug.cgi?id=138855

            Reviewed by Tim Horton.

            Promote -[WKView _dismissActionMenuPopovers] from internal to private.

            * UIProcess/API/Cocoa/WKViewPrivate.h:
            * UIProcess/API/mac/WKView.mm:
            (-[WKView _dismissActionMenuPopovers]):
            * UIProcess/API/mac/WKViewInternal.h:

2014-11-19  Dana Burkart  <dburkart@apple.com>

        Merge r176288. rdar://problem/18840382

    2014-11-18  Tim Horton  <timothy_horton@apple.com>

            Avoid re-encoding action menu image data
            https://bugs.webkit.org/show_bug.cgi?id=138817
            <rdar://problem/18840382>

            Reviewed by Anders Carlsson.

            * Shared/mac/ActionMenuHitTestResult.h:
            * Shared/mac/ActionMenuHitTestResult.mm:
            (WebKit::ActionMenuHitTestResult::encode):
            (WebKit::ActionMenuHitTestResult::decode):
            Store and encode a SharedMemory with the raw encoded image data,
            instead of re-painting the image into a ShareableBitmap.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _hitTestResultImage]):
            (-[WKActionMenuController _defaultMenuItemsForImage]):
            (-[WKActionMenuController _copyImage:]):
            (-[WKActionMenuController _addImageToPhotos:]):
            (-[WKActionMenuController _defaultMenuItems]):
            (-[WKActionMenuController _canAddMediaToPhotos]): Deleted.
            Build a temporary filename from a UUID and the image's desired extension.
            Use the Image's encoded data instead of re-encoding it with CGImageDestination.
            Build an image menu only if we have an image, URL, data, and extension.

            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::WebPage::performActionMenuHitTestAtLocation):

2014-11-19  Dana Burkart  <dburkart@apple.com>

        Merge r176238. rdar://problem/18990674

    2014-11-17  Conrad Shultz  <conrad_shultz@apple.com>

            Page previews should be loaded sooner
            https://bugs.webkit.org/show_bug.cgi?id=138814

            Reviewed by Tim Horton.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController willOpenMenu:withEvent:]):
            Send -_createPreviewPopover..
            (-[WKActionMenuController _previewURLFromActionMenu:]):
            Relocate some logic to the new -_createPreviewPopover; gate early return on popover visibility.
            (-[WKActionMenuController _createPreviewPopover]):
            Renamed from -_createPreviewPopoverForURL:originRect:; explicitly send -loadView to warm up the preview view.
            (-[WKActionMenuController _createPreviewPopoverForURL:originRect:]): Deleted.

2014-11-19  Dana Burkart  <dburkart@apple.com>

        Merge r176237. rdar://problem/18900839

    2014-11-17  Beth Dakin  <bdakin@apple.com>

            Preview is sometimes dismissed too early
            https://bugs.webkit.org/show_bug.cgi?id=138811
            -and corresponding-
            rdar://problem/18900839

            Reviewed by Tim Horton.

            Don’t make the popover transient until didCloseMenu: time.
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController didCloseMenu:withEvent:]):
            (-[WKActionMenuController _createPreviewPopoverForURL:originRect:]):

2014-11-19  Dana Burkart  <dburkart@apple.com>

        Merge r176221. rdar://problem/18991369

    2014-11-17  Tim Horton  <timothy_horton@apple.com>

            DataDetectors PageOverlay callbacks can come in to the wrong overlay
            https://bugs.webkit.org/show_bug.cgi?id=138801
            <rdar://problem/18991369>

            Reviewed by Anders Carlsson.

            We can call dataDetectorsDidHideUI on the wrong (or no) PageOverlay,
            because it's possible to have another performActionMenuHitTestAtLocation
            between the first one and the dataDetectorsDid*UI that correspond to it.

            To make sure that the callbacks come to the right PageOverlay, plumb
            an integer ID through all of the callbacks and find the overlay based on that.

            * Shared/mac/ActionMenuHitTestResult.h:
            Store the ID of the PageOverlay that overrode data detection.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
            Send the ID back to the Web process when replying from DD callbacks.

            * WebProcess/WebPage/WebPage.h:
            * WebProcess/WebPage/WebPage.messages.in:
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::WebPage::performActionMenuHitTestAtLocation):
            Store the ID of the PageOverlay that overrode data detection instead of
            keeping the PageOverlay itself.

            (WebKit::WebPage::dataDetectorsDidPresentUI):
            (WebKit::WebPage::dataDetectorsDidChangeUI):
            (WebKit::WebPage::dataDetectorsDidHideUI):
            Find and reply to the correct page overlay.

2014-11-19  Dana Burkart  <dburkart@apple.com>

        Merge r176220. rdar://problem/18944893

    2014-11-17  Beth Dakin  <bdakin@apple.com>

            Whitespace action menus should focus the HitTestResult and create an insertion 
            point
            https://bugs.webkit.org/show_bug.cgi?id=138786
            -and corresponding-
            rdar://problem/18944893

            Reviewed by Tim Horton.

            Whitespace menus should cause the HitTestResult to be focused, and they should set 
            the selection based on the HitTest location.
            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::focusAndSelectLastActionMenuHitTestResult):
            * UIProcess/WebPageProxy.h:
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController isMenuForTextContent]):
            (-[WKActionMenuController willOpenMenu:withEvent:]):
            * WebProcess/WebPage/WebPage.h:
            * WebProcess/WebPage/WebPage.messages.in:
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::WebPage::performActionMenuHitTestAtLocation):
            (WebKit::WebPage::focusAndSelectLastActionMenuHitTestResult):

2014-11-18  Dana Burkart  <dburkart@apple.com>

        Merge r176166. rdar://problem/18953982

    2014-11-16  Tim Horton  <timothy_horton@apple.com>

            Use TextIndicator instead of the built in Lookup highlight
            https://bugs.webkit.org/show_bug.cgi?id=138775
            <rdar://problem/18953982>

            Follow-up to r176164.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView dealloc]):
            (-[WKView initWithFrame:context:configuration:webView:]):
            * UIProcess/mac/PageClientImpl.mm:
            (WebKit::PageClientImpl::didPerformDictionaryLookup):
            Include the softlinking macros directly in the files they're used
            in, as they're supposed to be used.

2014-11-18  Dana Burkart  <dburkart@apple.com>

        Merge r176164. rdar://problem/18953982

    2014-11-16  Tim Horton  <timothy_horton@apple.com>

            Use TextIndicator instead of the built in Lookup highlight
            https://bugs.webkit.org/show_bug.cgi?id=138775
            <rdar://problem/18953982>

            Reviewed by Anders Carlsson.

            In order to make the yellow highlight for Lookup more accurately match the
            painted content of the web page (in light of e.g. Web fonts, and interesting
            text features that only WebKit implements and cannot round-trip through
            NSAttributedString), use a TextIndicator instead of the built-in Lookup
            highlight where possible.

            * Configurations/BaseTarget.xcconfig:
            Make it possible to include headers from private frameworks. This matches WebCore.

            * Shared/DictionaryPopupInfo.cpp:
            (WebKit::DictionaryPopupInfo::encode):
            (WebKit::DictionaryPopupInfo::decode):
            * Shared/DictionaryPopupInfo.h:
            Include the attributed string inside the DictionaryPopupInfo, instead of
            as a secondary argument to DidPerformDictionaryLookup.
            Add a TextIndicator to DictionaryPopupInfo, which can be used to highlight
            the text in the UI process.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView dealloc]):
            (-[WKView viewDidMoveToWindow]):
            (-[WKView _dictionaryLookupPopoverWillClose:]):
            (-[WKView _setTextIndicator:fadeOut:animate:animationCompletionHandler:]):
            (-[WKView _setTextIndicator:fadeOut:animate:]):
            (-[WKView initWithFrame:context:configuration:webView:]):
            (+[WKView hideWordDefinitionWindow]):
            * UIProcess/API/mac/WKViewInternal.h:
            Adopt the Lookup SPI header.
            If we have the requisite API, register the notification that Lookup sends
            when the popover closes, and hook that up to hide the text indicator.
            Add a version of _setTextIndicator: that takes an animation completion handler.

            * UIProcess/PageClient.h:
            * UIProcess/WebPageProxy.h:
            * UIProcess/WebPageProxy.messages.in:
            * UIProcess/ios/WebPageProxyIOS.mm:
            (WebKit::WebPageProxy::didPerformDictionaryLookup):
            * UIProcess/mac/WebPageProxyMac.mm:
            (WebKit::WebPageProxy::didPerformDictionaryLookup):
            Adjust to the new didPerformDictionaryLookup signature.

            * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
            (InitWebCoreSystemInterface):
            Remove a WKSI import.

            * UIProcess/mac/PageClientImpl.h:
            * UIProcess/mac/PageClientImpl.mm:
            (WebKit::PageClientImpl::didPerformDictionaryLookup):
            If we have the requisite API, disable Lookup's built-in highlight and
            present a TextIndicator instead.
            We currently have to run the animations serially (first bounce the TextIndicator,
            then animate in the Lookup popover) because the act of adding the Lookup popover
            blocks us from getting any animation events for the TextIndicator, and breaks
            the bounce. We could also fix this by using a threaded animation for the TextIndicator,
            but it's not clear that it's safe to do so.

            (WebKit::PageClientImpl::dismissDictionaryLookupPanel):
            When explicitly dismissing the Lookup panel, also hide the text indicator.

            * UIProcess/mac/TextIndicatorWindow.h:
            * UIProcess/mac/TextIndicatorWindow.mm:
            (WebKit::TextIndicatorWindow::setTextIndicator):
            Store the completion handler.

            (WebKit::TextIndicatorWindow::bounceAnimationDidEnd):
            Call the completion handler when the animation completes.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _createActionMenuItemForTag:]):
            Disable the Lookup item if lookup is not available.

            * WebProcess/Plugins/PDF/PDFPlugin.mm:
            (WebKit::PDFPlugin::showDefinitionForAttributedString):
            Adjust to the new didPerformDictionaryLookup signature.
            Since PDFPlugin can't trivially repaint the required part of the PDF,
            we don't build a TextIndicator. This will result in PDFPlugin continuing
            to use Lookup's built-in highlight.
            
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::WebPage::performDictionaryLookupForRange):
            Build a TextIndicator from the Lookup range and pass it along with
            the DictionaryPopupInfo.

2014-11-18  Dana Burkart  <dburkart@apple.com>

        Merge r176108. rdar://problem/19005904

    2014-11-13  Eric Carlson  <eric.carlson@apple.com>

            Context menus should not offer the "Download video" option for videos that cannot 
            be downloaded
            https://bugs.webkit.org/show_bug.cgi?id=138530
            -and corresponding-
            rdar://problem/18919130

            Reviewed by Tim Horton.

            Expose isDownloadableMedia() to the InjectedBundleHitTestResult.
            * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
            (WKBundleHitTestResultIsDownloadableMedia):
            * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h:
            * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
            (WebKit::InjectedBundleHitTestResult::isDownloadableMedia):
            * WebProcess/InjectedBundle/InjectedBundleHitTestResult.h:
            
2014-11-17  Dana Burkart  <dburkart@apple.com>

        Merge r176150. <rdar://problem/18982046>

    2014-11-14  Tim Horton  <timothy_horton@apple.com>
    
            Remove pre-[DDActionContext contextForView:...] fallback path
            https://bugs.webkit.org/show_bug.cgi?id=138735
            <rdar://problem/18982046>
    
            Reviewed by Simon Fraser.
    
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController willOpenMenu:withEvent:]):
            (-[WKActionMenuController didCloseMenu:withEvent:]):
            (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
            (hasDataDetectorsCompletionAPI): Deleted.
            Remove the now-unnecessary fallback path.
    
2014-11-17  Dana Burkart  <dburkart@apple.com>

        Merge r176148. <rdar://problem/18990684>

    2014-11-14  Tim Horton  <timothy_horton@apple.com>
    
            Frequent crashes under actionContextForResultAtPoint
            https://bugs.webkit.org/show_bug.cgi?id=138761
            <rdar://problem/18990684>
    
            Reviewed by Dean Jackson.
    
            * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
            (PageOverlayClientImpl::actionContextForResultAtPoint):
            Initialize apiRange.
    
2014-11-17  Dana Burkart  <dburkart@apple.com>

        Merge r176131. <rdar://problem/18941927>

    2014-11-14  Beth Dakin  <bdakin@apple.com>

            URLs for some videos are not valid URLs, should not be exposed to action menu
            https://bugs.webkit.org/show_bug.cgi?id=138746
            -and corresponding-
            rdar://problem/18941927

            Reviewed by Tim Horton.

            If the video cannot be downloaded, that is also an indication that the URL of the 
            video will not be valid on its own. In these cases, we should share or copy the 
            main page’s URL.
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _defaultMenuItemsForVideo]):
            (-[WKActionMenuController _copyVideoURL:]):

2014-11-17  Dana Burkart  <dburkart@apple.com>

        Merge r176156. <rdar://problem/18877535>

    2014-11-15  David Kilzer  <ddkilzer@apple.com>
    
            REGRESSION (r176137): iOS build broke after moving DataDetectors scanning code to WebCore
    
            This regressed with the following commit:
    
                Move DataDetectors scanning code to WebCore
                https://bugs.webkit.org/show_bug.cgi?id=138731
                <rdar://problem/18877535>
    
            * Shared/mac/ActionMenuHitTestResult.mm: Add PLATFORM(MAC) check
            around the entire implementation since it it unused on iOS.
    
2014-11-17  Dana Burkart  <dburkart@apple.com>

        Merge r176153. <rdar://problem/18877535>

    2014-11-15  Tim Horton  <timothy_horton@apple.com>
    
            Implement data detectors and mailto action menus for WebKit1
            https://bugs.webkit.org/show_bug.cgi?id=138765
            <rdar://problem/18877535>
    
            Reviewed by Beth Dakin.
    
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _defaultMenuItemsForMailtoLink]):
    
2014-11-17  Dana Burkart  <dburkart@apple.com>

        Merge r176137. <rdar://problem/18877535>

    2014-11-14  Tim Horton  <timothy_horton@apple.com>
    
            Move DataDetectors scanning code to WebCore
            https://bugs.webkit.org/show_bug.cgi?id=138731
            <rdar://problem/18877535>
    
            Reviewed by Anders Carlsson.
    
            Move DataDetectors scanning code to WebCore, so that both WebKits can use it.
    
            * Shared/TextIndicator.cpp:
            (WebKit::TextIndicator::createWithRange):
            Move createWithRange in from WebPageMac's textIndicatorForRange.
    
            (WebKit::TextIndicator::createWithSelectionInFrame):
            * Shared/TextIndicator.h:
            * WebProcess/WebPage/WebFrame.cpp:
            (WebKit::WebFrame::createSelectionSnapshot):
            * WebProcess/WebPage/WebFrame.h:
            Constify some things.
    
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::WebPage::performActionMenuHitTestAtLocation):
            Avoid using the DD result if it didn't come with a non-null Range.
            Make use of detectItemAroundHitTestResult and TextIndicator::createWithRange.
    
            (WebKit::scanForDataDetectedItems): Deleted.
            (WebKit::textIndicatorForRange): Deleted.
            Moved these two to other places.
    
2014-11-13  Tim Horton  <timothy_horton@apple.com>

        Adjust the WKBundlePageOverlay Data Detectors SPI
        https://bugs.webkit.org/show_bug.cgi?id=138685
        <rdar://problem/18947156>

        Reviewed by Anders Carlsson.

        * UIProcess/mac/WKActionMenuController.mm:
        (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
        Forward DDActionContext callbacks to the Web process.

        * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
        * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
        * WebProcess/WebPage/WebPageOverlay.cpp:
        * WebProcess/WebPage/WebPageOverlay.h:
        Add four DataDetectors-related WebKit2-only page overlay callbacks:

        (WebKit::WebPageOverlay::actionContextForResultAtPoint):
        Called during the action menu hit test; clients can reply with a DDActionContext
        and a DOM range, and WebKit will treat that result and range as if it had
        detected it itself, building the action menu and showing the yellow highlight as usual.

        (WebKit::WebPageOverlay::dataDetectorsPresentedUI):
        (WebKit::WebPageOverlay::dataDetectorsChangedUI):
        (WebKit::WebPageOverlay::dataDetectorsHidUI):
        These correspond to the DDActionContext callbacks, and can be used by clients
        to show/hide corresponding UI while DataDetectors in the UI process is presenting UI.

        (WebKit::WebPageOverlay::prepareForActionMenu): Deleted.
        Get rid of prepareForActionMenu, as nobody ever used it.

        * WebProcess/WebPage/WebPage.cpp:
        Add WebPageOverlay.h so that we can build, because the destructor lives here.

        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::performActionMenuHitTestAtLocation):
        Give all of the WebPageOverlays the first shot at data detection; if none of them
        reply with a valid DDActionContext/DOM range, we'll go ahead and do our normal detection.

        (WebKit::WebPage::dataDetectorsPresentedUI):
        (WebKit::WebPage::dataDetectorsChangedUI):
        (WebKit::WebPage::dataDetectorsHidUI):
        Forward these along to the active WebPageOverlay.

2014-11-12  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175966. <rdar://problem/18866308>

    2014-11-11  Tim Horton  <timothy_horton@apple.com>

            DataDetectors' menu items aren't presented in the telephone number menu
            https://bugs.webkit.org/show_bug.cgi?id=138602
            <rdar://problem/18866308>

            Reviewed by Beth Dakin.

            We currently round-trip the DataDetectors telephone number NSMenuItems
            through the very-lossy WebContextMenuItemData, for no real reason.
            We should avoid this so that DataDetectors' actual NSMenuItems are
            presented in the final menu, so that they can adjust their items after
            providing them to us.

            * Platform/mac/MenuUtilities.h:
            * Platform/mac/MenuUtilities.mm:
            (WebKit::menuItemTitleForTelephoneNumber): Deleted.
            Stop adjusting the menu item titles, as they come correct now.

            (WebKit::menuItemsForTelephoneNumber): Deleted.
            (WebKit::menuForTelephoneNumber):
            Return a fully-formed menu for the single telephone number case.

            * UIProcess/mac/WebPageProxyMac.mm:
            (WebKit::WebPageProxy::showTelephoneNumberMenu):
            Present the fully-formed menu, without round-tripping through
            WebContextMenuItemData, because we do not need to hand the items to
            the context menu client (and indeed, were not), and because this
            allows us to use the exact items returned by DataDetectors, so they
            can keep ahold of the items that we actually present.

            * UIProcess/PageClient.h:
            * UIProcess/mac/PageClientImpl.h:
            * UIProcess/mac/PageClientImpl.mm:
            (WebKit::PageClientImpl::showPlatformContextMenu):
            Add a Mac-only PageClient function for presenting a NSMenu at a
            WKView-relative point.


2014-11-12  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r176038. <rdar://problem/18960409>

    2014-11-12  Tim Horton  <timothy_horton@apple.com>

            Two action menu item titles are swapped
            https://bugs.webkit.org/show_bug.cgi?id=138667
            <rdar://problem/18960409>

            Reviewed by Beth Dakin.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _createActionMenuItemForTag:]):
            Swap them back.


2014-11-12  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r176037. <rdar://problem/18869900>

    2014-11-12  Tim Horton  <timothy_horton@apple.com>

            Need to show the text indicator when Data Detectors shows a popover
            https://bugs.webkit.org/show_bug.cgi?id=138664
            <rdar://problem/18869900>

            Reviewed by Beth Dakin.

            * UIProcess/mac/WKActionMenuController.h:
            * UIProcess/mac/WKActionMenuController.mm:
            (hasDataDetectorsCompletionAPI):
            Determine if we have the new API.

            (-[WKActionMenuController willDestroyView:]):
            (-[WKActionMenuController willOpenMenu:withEvent:]):
            Make use of the new API.
            If we wanted to show a Data Detectors menu but have no items (or they're all
            disabled), cancel the menu.
            If we don't have it, manually manipulate the highlight.

            (-[WKActionMenuController didCloseMenu:withEvent:]):
            Make use of the new API.
            If we don't have it, manually manipulate the highlight.

            (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
            Set up completion handlers if we have the new API; when DataDetectors
            presents UI, show the text indicator, when it dismisses, hide it.
            If we don't have the API, manually manipulate the highlight.


2014-11-12  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r176027. <rdar://problem/18909111>

    2014-11-12  Tim Horton  <timothy_horton@apple.com>

            Make action menus much more reliable
            https://bugs.webkit.org/show_bug.cgi?id=138654
            <rdar://problem/18909111>

            Reviewed by Anders Carlsson.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController prepareForMenu:withEvent:]):
            Remove MenuUpdateStage; nothing actually uses this value, we just pass it around.

            (-[WKActionMenuController didPerformActionMenuHitTest:userData:]):
            Update the menu as soon as we have a reply from the Web process.

            (-[WKActionMenuController menuNeedsUpdate:]):
            If our sync-wait for the Web process' reply times out, we should still update
            the menu to remove the placeholder separator item.

            (-[WKActionMenuController _updateActionMenuItems]):
            (-[WKActionMenuController _updateActionMenuItemsForStage:]): Deleted.
            If we have our final answer for this menu (_state == Ready), and the final answer
            has no items in the menu, cancel tracking on the menu.


2014-11-11  Tim Horton  <timothy_horton@apple.com>

        Add support for mailto: link action menus
        https://bugs.webkit.org/show_bug.cgi?id=138641
        <rdar://problem/18741567>

        Reviewed by Beth Dakin.

        * Shared/API/c/WKActionMenuTypes.h:
        Add a new type for mailto links.

        * UIProcess/mac/WKActionMenuController.mm:
        (-[WKActionMenuController _defaultMenuItemsForMailtoLink]):
        Build a DDActionContext and grab menu items for our mailto link.

        (-[WKActionMenuController _defaultMenuItems]):
        Get menu items from _defaultMenuItemsForMailtoLink if needed.

2014-11-12  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175985. <rdar://problem/18947400>

    2014-11-11  Conrad Shultz  <conrad_shultz@apple.com>

            Clients should be notified when a page preview finishes
            https://bugs.webkit.org/show_bug.cgi?id=138635

            Reviewed by Tim Horton.

            Add SPI to WKView to allow clients to do any cleanup that might be necessary when the preview closes.

            * UIProcess/API/Cocoa/WKViewPrivate.h:
            Declare new SPI.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView _finishPreviewingURL:withPreviewView:]):
            Stub SPI implementation.

            * UIProcess/mac/WKActionMenuController.h:
            Add an ivar for the preview view controller.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _createPreviewPopoverForURL:originRect:]):
            Update to use the ivar.
            (-[WKActionMenuController _clearPreviewPopover]):
            Send -_finishPreviewingURL:withPreviewView: and nil out the view controller ivar.


2014-11-12  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175983. <rdar://problem/18871984>

    2014-11-11  Tim Horton  <timothy_horton@apple.com>

            Update artwork for some action menu items
            https://bugs.webkit.org/show_bug.cgi?id=138634
            <rdar://problem/18871984>

            Reviewed by Anders Carlsson.

            * Resources/OpenInNewWindowTemplate.pdf: Removed.
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _createActionMenuItemForTag:]):
            (webKitBundleImageNamed): Deleted.
            * WebKit2.xcodeproj/project.pbxproj:
            Get rid of our custom art, and use system art for two more items.


2014-11-12  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175973. <rdar://problem/18855914>

    2014-11-11  Tim Horton  <timothy_horton@apple.com>

            Occasional assertion failure under recommendedScrollbarStyleDidChange()
            https://bugs.webkit.org/show_bug.cgi?id=138604
            <rdar://problem/18855914>

            Reviewed by Beth Dakin.

            It is possible for AppKit to install tracking areas into our view
            behind our back, but we have code that depends on knowing exactly
            the set of tracking areas installed on WKView.

            Make this more robust by keeping a reference to the tracking area we
            use for many things and manipulating that instead of making assumptions
            about the total set of tracking areas on WKView.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView _primaryTrackingArea]):
            (-[WKView _replacePrimaryTrackingArea:]):
            Provide a 'primary' tracking area setter/getter.

            (-[WKView initWithFrame:context:configuration:webView:]):
            Keep a reference to the original tracking area installed at initialization time.

            * UIProcess/API/mac/WKViewInternal.h:
            * UIProcess/mac/PageClientImpl.mm:
            (WebKit::PageClientImpl::recommendedScrollbarStyleDidChange):
            Instead of walking the set of tracking areas, make use of the fact that
            we know exactly which tracking area we installed, and uninstall just that
            one, and replace it with our newly-built one.


2014-11-12  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175969. <rdar://problem/18932770>

    2014-11-11  Timothy Horton  <timothy_horton@apple.com>

            Add a respondsToSelector check to dismissActionMenuPopovers
            ​https://bugs.webkit.org/show_bug.cgi?id=138600
            <rdar://problem/18932770>

            Reviewed by Beth Dakin.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController dismissActionMenuPopovers]):
            Avoid calling this wherever it doesn't exist.


2014-11-12  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175964. <rdar://problem/18867627>

    2014-11-11  Tim Horton  <timothy_horton@apple.com>

            Adopt DDActionContext menu type SPI
            https://bugs.webkit.org/show_bug.cgi?id=138603
            <rdar://problem/18867627>

            Reviewed by Anders Carlsson.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
            Use the new SPI instead of WKSI.


2014-11-12  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175963. <rdar://problem/18932770>

    2014-11-11  Tim Horton  <timothy_horton@apple.com>

            Data Detectors popovers should be dismissed upon scrolling
            https://bugs.webkit.org/show_bug.cgi?id=138600
            <rdar://problem/18932770>

            Reviewed by Beth Dakin.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController prepareForMenu:withEvent:]):
            Dismiss popovers when we start preparing another menu.

            (-[WKActionMenuController dismissActionMenuPopovers]):
            Use the new DataDetectors SPI.


2014-11-12  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175962. <rdar://problem/18815343>

    2014-11-11  Tim Horton  <timothy_horton@apple.com>

            Localize strings for action menus
            https://bugs.webkit.org/show_bug.cgi?id=138591
            <rdar://problem/18815343>

            Reviewed by Dan Bates.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _showTextIndicator]):
            (-[WKActionMenuController _hideTextIndicator]):
            (-[WKActionMenuController _createActionMenuItemForTag:]):
            Make use of the new strings.


2014-11-07  Tim Horton  <timothy_horton@apple.com>

        Popovers do not dismiss when navigating back and forth using gestures
        https://bugs.webkit.org/show_bug.cgi?id=138512
        <rdar://problem/18900200>

        Reviewed by Beth Dakin.

        * UIProcess/mac/PageClientImpl.mm:
        (WebKit::PageClientImpl::navigationGestureDidBegin):
        Dismiss action menu related popovers when navigation gestures begin.

2014-11-11  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175835. <rdar://problem/18933586>

    2014-11-10  Beth Dakin  <bdakin@apple.com>
    
            Whitespace action menus aren't working properly
            https://bugs.webkit.org/show_bug.cgi?id=138585
            -and corresponding-
            rdar://problem/18933586
    
            Reviewed by Tim Horton.
    
            Treat the whitespace menu as a text menu.
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController isMenuForTextContent]):
    

2014-11-10  Beth Dakin  <bdakin@apple.com>

        WK1: Support default actions for read-only text
        https://bugs.webkit.org/show_bug.cgi?id=138552
        -and corresponding-
        rdar://problem/18877483

        Reviewed by Tim Horton.

        WK1 now needs to do a lot of dictionary lookup operations that it did not 
        previously have to handle. So this patch takes a lot of that functionality, which 
        was implemented as static functions in WebPageMac for WK2 and moves it into 
        WebCore.

        * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
        (InitWebCoreSystemInterface):
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::performDictionaryLookupForRange):
        (WebKit::isPositionInRange): Deleted.
        (WebKit::shouldUseSelection): Deleted.
        (WebKit::rangeExpandedAroundPositionByCharacters): Deleted.
        (WebKit::rangeForDictionaryLookupForSelection): Deleted.
        (WebKit::rangeForDictionaryLookupAtHitTestResult): Deleted.

2014-11-11  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175790. <rdar://problem/18919700>

    2014-11-09  Conrad Shultz  <conrad_shultz@apple.com>
    
            Move _ignoresNonWheelMouseEvents implementation to WKView(Private)
            https://bugs.webkit.org/show_bug.cgi?id=138487
    
            Reviewed by Dan Bernstein.
    
            Relocate some methods that should have been in a category implementation.
    
            * UIProcess/API/mac/WKView.mm:
            (-[WKView _setIgnoresNonWheelMouseEvents:]):
            (-[WKView _ignoresNonWheelMouseEvents]):
    

2014-11-11  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175780. <rdar://problem/18919195>

    2014-11-08  Beth Dakin  <bdakin@apple.com>
    
            WKActionMenuController methods should be more careful to use the best 
            WebHitTestResult
            https://bugs.webkit.org/show_bug.cgi?id=138536
            -and corresponding-
            rdar://problem/18919195
    
            Reviewed by Tim Horton.
    
            This patch re-names _hitTestResultForStage to _webHitTestResult. The method no 
            longer takes a stage since that value is really not necessary to determine the 
            correct WebHitTestResult. This patch also makes all spots in this file that access 
            a WebHitTestResult go through _webHitTestResult to ensure that they get the most 
            up-to-date option.
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController willOpenMenu:withEvent:]):
            (-[WKActionMenuController _openURLFromActionMenu:]):
            (-[WKActionMenuController _addToReadingListFromActionMenu:]):
            (-[WKActionMenuController _previewURLFromActionMenu:]):
            (-[WKActionMenuController _defaultMenuItemsForVideo]):
            (-[WKActionMenuController _copyVideoURL:]):
            (-[WKActionMenuController _saveVideoToDownloads:]):
            (-[WKActionMenuController _saveImageToDownloads:]):
            (-[WKActionMenuController _defaultMenuItems]):
            (-[WKActionMenuController _updateActionMenuItemsForStage:]):
            (imageForResource:name::switch): Deleted.
            (-[WKActionMenuController _defaultMenuItems:]): Deleted.
    

2014-11-11  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175779. <rdar://problem/18742164>

    2014-11-08  Beth Dakin  <bdakin@apple.com>
    
            Implement action menu support for videos
            https://bugs.webkit.org/show_bug.cgi?id=138534
            -and corresponding-
            rdar://problem/18742164
    
            Reviewed by Tim Horton.
    
            New menu type and items types.
            * Shared/API/c/WKActionMenuItemTypes.h:
            * Shared/API/c/WKActionMenuTypes.h:
    
            Plumb isMediaThatCanBeDownloaded() up to WebHitTestResult.
            * Shared/WebHitTestResult.cpp:
            (WebKit::WebHitTestResult::Data::Data):
            (WebKit::WebHitTestResult::Data::encode):
            (WebKit::WebHitTestResult::Data::decode):
            * Shared/WebHitTestResult.h:
            (WebKit::WebHitTestResult::isMediaThatCanBeDownloaded):
    
            Re-name _canAddImageToPhotos to _canAddMediaToPhotos, which is more accurate. We 
            might use this method for videos some day, so now it has an accurate name.
            * UIProcess/mac/WKActionMenuController.mm:
    
            Default items and their actions.
            (-[WKActionMenuController _defaultMenuItemsForVideo]):
            (-[WKActionMenuController _copyVideoURL:]):
            (-[WKActionMenuController _saveVideoToDownloads:]):
            (-[WKActionMenuController _defaultMenuItemsForImage]):
            (-[WKActionMenuController _canAddMediaToPhotos]):
            (-[WKActionMenuController _addImageToPhotos:]):
            (-[WKActionMenuController _createActionMenuItemForTag:]):
            (-[WKActionMenuController _defaultMenuItems:]):
            (-[WKActionMenuController _canAddImageToPhotos]): Deleted.
    
            We hit test including shadow content to get the desired result for editable text 
            regions. But for media, we want to re-set to the shadow root.
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::WebPage::performActionMenuHitTestAtLocation):
    

2014-11-11  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175770. <rdar://problem/18909717>

    2014-11-07  Conrad Shultz  <conrad_shultz@apple.com>
    
            "Lookup" action menu should read "Look up"
            https://bugs.webkit.org/show_bug.cgi?id=138509
    
            Reviewed by Tim Horton.
    
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _createActionMenuItemForTag:]):
    

2014-11-11  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175761. <rdar://problem/18909699>

    2014-11-07  Beth Dakin  <bdakin@apple.com>
    
            Null deref performing Lookup on Apple Trailers full screen button
            https://bugs.webkit.org/show_bug.cgi?id=138513
            -and corresponding-
            rdar://problem/18909699
    
            Reviewed by Tim Horton.
    
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::WebPage::performDictionaryLookupForSelection):
    

2014-11-11  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175756. <rdar://problem/18901445>

    2014-11-07  Beth Dakin  <bdakin@apple.com>
    
            Action menu preview popover should dismiss on scroll
            https://bugs.webkit.org/show_bug.cgi?id=138511
            -and corresponding-
            rdar://problem/18901445
    
            Reviewed by Tim Horton.
    
            This patch re-names dismissActionMenuDataDetectorPopovers() to 
            dismissActionMenuPopovers() and also calls _clearPreviewPopover from that method 
            as well.
            * UIProcess/API/mac/WKView.mm:
            (-[WKView viewDidMoveToWindow]):
            (-[WKView _dismissActionMenuPopovers]):
            (-[WKView _dismissActionMenuDataDetectorPopovers]): Deleted.
            * UIProcess/API/mac/WKViewInternal.h:
            * UIProcess/PageClient.h:
            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::didCommitLoadForFrame):
            (WebKit::WebPageProxy::pageDidScroll):
            (WebKit::WebPageProxy::resetStateAfterProcessExited):
            * UIProcess/mac/PageClientImpl.h:
            * UIProcess/mac/PageClientImpl.mm:
            (WebKit::PageClientImpl::dismissActionMenuPopovers):
            (WebKit::PageClientImpl::dismissActionMenuDataDetectorPopovers): Deleted.
            * UIProcess/mac/WKActionMenuController.h:
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController dismissActionMenuPopovers]):
            (-[WKActionMenuController dismissActionMenuDataDetectorPopovers]): Deleted.
    

2014-11-11  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175754. <rdar://problem/18877717>

    2014-11-07  Beth Dakin  <bdakin@apple.com>
    
            Support action menus for whitespace in editable areas
            https://bugs.webkit.org/show_bug.cgi?id=138488
            -and corresponding-
            rdar://problem/18877717
    
            Reviewed by Tim Horton.
    
            Very simple menu for whitespace in editable areas.
            * Shared/API/c/WKActionMenuTypes.h:
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _defaultMenuItemsForWhitespaceInEditableArea]):
            (-[WKActionMenuController _defaultMenuItems:]):
    

2014-11-11  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175753. <rdar://problem/18892787>

    2014-11-07  Beth Dakin  <bdakin@apple.com>
    
            Invoking an action menu should dismiss existing selection
            https://bugs.webkit.org/show_bug.cgi?id=138496
            -and corresponding-
            rdar://problem/18892787
    
            Reviewed by Tim Horton.
    
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController willOpenMenu:withEvent:]):
    

2014-11-11  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175732. <rdar://problem/18889231>

    2014-11-06  Conrad Shultz  <conrad_shultz@apple.com>
    
            Clients should be able to customize the view used for page previews
            https://bugs.webkit.org/show_bug.cgi?id=138447
    
            Reviewed by Tim Horton.
    
            Add SPI to WKView that clients can use to customize the view used in the page preview popover.
    
            * UIProcess/API/Cocoa/WKViewPrivate.h:
            Declare -_viewForPreviewingURL:initialFrameSize:.
    
            * UIProcess/API/mac/WKView.mm:
            (-[WKView _viewForPreviewingURL:initialFrameSize:]):
            Return nil in the default implementation.
    
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKPagePreviewViewController loadView]):
            Only spin up a WKWebView if the delegate (and, therefore, the presenting WKView) doesn't supply a custom view.
            (-[WKActionMenuController pagePreviewViewController:viewForPreviewingURL:initialFrameSize:]):
            WKPagePreviewViewControllerDelegate method; wrap the WKView SPI.
    

2014-11-10  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175711. <rdar://problem/18893079>

    2014-11-06  Tim Horton  <timothy_horton@apple.com>
    
            Data detectors popover points at the first line of the detected item
            https://bugs.webkit.org/show_bug.cgi?id=138471
            <rdar://problem/18893079>
    
            Reviewed by Sam Weinig.
    
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::scanForDataDetectedItems):
            Determine the bounding box of all quads of the detected item's text.
            This way, the popover will point at the border of the item, instead of
            right at the very first line.
    

2014-11-10  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175705. <rdar://problem/18892496>

    2014-11-06  Tim Horton  <timothy_horton@apple.com>
    
            TextIndicatorWindow's bounce animation is lopsided when indicating two short lines of text
            https://bugs.webkit.org/show_bug.cgi?id=138458
    
            Reviewed by Simon Fraser.
    
            Previously, the TextIndicator's frame() covered the entire selection highlight bounds.
            This was undesirable in cases where the highlight included areas far outside the
            bounds of the selected text, as the TextIndicatorWindow's 'bounce' animation
            would be misaligned (centered on the highlight instead of on the text).
    
            * Shared/TextIndicator.cpp:
            Get rid of the many-argument TextIndicator::create, because it was only used
            internally, and have createWithSelectionInFrame make a ::Data instead.
    
            (WebKit::TextIndicator::createWithSelectionInFrame):
            Compute and store the bounding rect of all of the selected text rects, and store
            all of the text rects relative to that bounding rect instead of relative to the
            selection highlight bounds. We do this because the selection highlight bounds
            often includes area which is far outside of the text bounds (in the case of a
            selection that spans multiple lines), and causes the text indicator bounce
            animation to bounce in a lopsided manner.
    
            (WebKit::TextIndicator::TextIndicator):
            Adjust to the rename of textRectsInSelectionRectCoordinates -> textRectsInBoundingRectCoordinates.
    
            (WebKit::TextIndicator::frameRect):
            Instead of the TextIndicator's frame being the selection highlight bounds,
            it is now the bounds of all of the text rects.
    
            (WebKit::TextIndicator::draw):
            Translate into the image by the difference between the selection highlight bounds
            and the text bounding rect. This is necessary because the content image is still generated
            covering the entire selection highlight bounds, but the text rects are in text-rect-bounds coordinates.
    
            (WebKit::TextIndicator::Data::encode):
            (WebKit::TextIndicator::Data::decode):
            Adjust to the rename of textRectsInSelectionRectCoordinates -> textRectsInBoundingRectCoordinates.
            Encode/decode textBoundingRectInWindowCoordinates.
    
            * Shared/TextIndicator.h:
            (WebKit::TextIndicator::contentImage): Deleted.
            Get rid of an unnecessary getter and constructor.
    

2014-11-10  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175704. <rdar://problem/18869036>

    2014-11-06  Tim Horton  <timothy_horton@apple.com>
    
            Only provide a single result to the action menu DDActionContext
            https://bugs.webkit.org/show_bug.cgi?id=138469
            <rdar://problem/18869036>
    
            Reviewed by Anders Carlsson.
    
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::scanForDataDetectedItems):
            Only provide one result; secondary results can be extremely unrelated to
            the primary one and confuse Data Detectors further down the line.
    

2014-11-10  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175702. <rdar://problem/18872825>

    2014-11-06  Tim Horton  <timothy_horton@apple.com>
    
            Null deref in rangeForDictionaryLookupAtHitTestResult on occasion
            https://bugs.webkit.org/show_bug.cgi?id=138459
            <rdar://problem/18872825>
    
            Reviewed by Andreas Kling.
    
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::rangeForDictionaryLookupAtHitTestResult):
            rangeExpandedAroundPositionByCharacters can return null.
    

2014-11-10  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175701. <rdar://problem/18768377>

    2014-11-06  Tim Horton  <timothy_horton@apple.com>
    
            Prefer link action menus over images
            https://bugs.webkit.org/show_bug.cgi?id=138461
            <rdar://problem/18768377>
    
            Reviewed by Anders Carlsson.
    
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _defaultMenuItems:]):
            Swap the priority of links and images.
    

2014-11-06  Dana Burkart  <dburkart@apple.com>

        Merge r175710. <rdar://problem/18898712>

    2014-11-06  Beth Dakin  <bdakin@apple.com>
    
            Preview views often misplaced inside popover
            https://bugs.webkit.org/show_bug.cgi?id=138472
    
            Reviewed by Tim Horton.
    
            This patch makes the popover maintain aspect ratio, and it uses the final scale of 
            that popover to scale the preview view as well.
    
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKPagePreviewViewController initWithPageURL:mainViewSize:popoverToViewScale:]):
            (-[WKPagePreviewViewController loadView]):
            (-[WKActionMenuController _createPreviewPopoverForURL:originRect:]):
            (-[WKActionMenuController _targetSize:fitsInAvailableSpace:]):
            (-[WKActionMenuController _preferredSizeForPopoverPresentedFromOriginRect:]):
            (-[WKPagePreviewViewController initWithPageURL:]): Deleted.
    

2014-11-05  Dana Burkart  <dburkart@apple.com>

        Merge r175649. <rdar://problem/18887140>

    2014-11-05  Timothy Horton  <timothy_horton@apple.com>
    
            Fix the build.
    
            * UIProcess/mac/WKActionMenuController.mm:
    

2014-11-05  Dana Burkart  <dburkart@apple.com>

        Merge r175646. <rdar://problem/18887218>

    2014-11-05  Conrad Shultz  <conrad_shultz@apple.com>
    
            It should be possible to open a page preview by clicking on it
            https://bugs.webkit.org/show_bug.cgi?id=138445
    
            Reviewed by Tim Horton.
    
            Add a click recognizer to WKPagePreviewViewController and plumb it through to WKActionMenuController.
    
            * UIProcess/mac/WKActionMenuController.mm:
            Declare <WKPagePreviewViewControllerDelegate>, currently home to just a single method.
            (-[WKPagePreviewViewController loadView]):
            Configure and add a click gesture recognizer to the WKWebView.
            (-[WKPagePreviewViewController _clickRecognized:]):
            Gesture recognizer action; send -pagePreviewViewControllerWasClicked: to the delegate.
            (-[WKActionMenuController willDestroyView:]):
            Extract code to -_clearPreviewPopover.
            (-[WKActionMenuController didCloseMenu:withEvent:]):
            Ditto.
            (-[WKActionMenuController _createPreviewPopoverForURL:]):
            Set ourself as the delegate of the page preview controller.
            (-[WKActionMenuController _clearPreviewPopover]):
            Extracted from various other methods; if appropriate, nil out the preview view controller's delegate.
            (-[WKActionMenuController popoverWillClose:]):
            Extract code to -_clearPreviewPopover.
            (-[WKActionMenuController pagePreviewViewControllerWasClicked:]):
            WKPagePreviewViewControllerDelegate method; open the URL of the clicked page.
    

2014-11-05  Dana Burkart  <dburkart@apple.com>

        Merge r175645. <rdar://problem/18887140>

    2014-11-05  Beth Dakin  <bdakin@apple.com>
    
            Page preview popover should show scaled-down web content
            https://bugs.webkit.org/show_bug.cgi?id=138444
    
            Reviewed by Anders Carlsson.
    
            Instead of keeping the preferred size in the controller, keep the main view’s 
            size, and then scale the bounds of the popover’s view using that and the scale 
            factor as a constant. Set the size of the popover explicitly so that it doesn’t 
            get the view’s size. This will cause it to scale the WKWebView.
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKPagePreviewViewController initWithPageURL:]):
            (-[WKPagePreviewViewController loadView]):
            (-[WKActionMenuController _createPreviewPopoverForURL:originRect:]):
            (-[WKActionMenuController _preferredSizeForPopoverPresentedFromOriginRect:]):
    

2014-11-05  Dana Burkart  <dburkart@apple.com>

        Merge r175643. <rdar://problem/18885782>

    2014-11-05  Conrad Shultz  <conrad_shultz@apple.com>
    
            Page preview popovers sometimes cover their originating element
            https://bugs.webkit.org/show_bug.cgi?id=138437
    
            Reviewed by Beth Dakin.
    
            If a popover is sufficiently large, and the originating element is in a particular location, it's
            possible that the popover can't be positioned in a manner that doesn't occlude the originating element.
            Address this by scaling down the popover content if it can't fit entirely between the originating
            element and the screen edge.
    
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _previewURLFromActionMenu:]):
            Update to use -_createPreviewPopoverForURL:originRect:.
            (-[WKActionMenuController _createPreviewPopoverForURL:originRect:]):
            Renamed from -_createPreviewPopoverForURL:; extract code to -_preferredSizeForPopoverPresentedFromOriginRect:.
            (-[WKActionMenuController _preferredSizeForPopoverPresentedFromOriginRect:]):
            Compute a size that is as large as possible while keeping the popover between the origin rect and screen edge
            (with an arbitrary padding applied to keep from directly abutting the screen edge).
            (-[WKActionMenuController _createPreviewPopoverForURL:]): Deleted.
    

2014-11-05  Dana Burkart  <dburkart@apple.com>

        Merge r175637. <rdar://problem/18877675>

    2014-11-05  Tim Horton  <timothy_horton@apple.com>
    
            Select Data Detectors results instead of just highlighting them
            https://bugs.webkit.org/show_bug.cgi?id=138435
            <rdar://problem/18877675>
    
            Reviewed by Beth Dakin.
    
            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::selectLastActionMenuRange):
            (WebKit::WebPageProxy::selectLookupTextAtLocation): Deleted.
            Rename selectLookupTextAtLocation to selectLastActionMenuRange.
    
            * UIProcess/WebPageProxy.h:
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController willOpenMenu:withEvent:]):
            Do a real selection for single-item Data Detector menus; show the yellow highlight otherwise.
            Adopt selectLastActionMenuRange for non-detected text.
    
            * WebProcess/WebPage/WebPage.h:
            * WebProcess/WebPage/WebPage.messages.in:
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::WebPage::performActionMenuHitTestAtLocation):
            (WebKit::WebPage::selectLastActionMenuRange):
            (WebKit::WebPage::selectLookupTextAtLocation): Deleted.
            Store the last (detected data or Lookup-derived) action menu range.
            Select it upon selectLastActionMenuRange.
    

2014-11-05  Dana Burkart  <dburkart@apple.com>

        Merge r175635. <rdar://problem/18884674>

    2014-11-05  Conrad Shultz  <conrad_shultz@apple.com>
    
            Disable action menus on page previews
            https://bugs.webkit.org/show_bug.cgi?id=138431
    
            Reviewed by Anders Carlsson.
    
            * UIProcess/API/mac/WKView.mm:
            (-[WKView _shouldIgnoreMouseEvents]):
            Renamed from -shouldIgnoreMouseEvents since this isn't actually public.
            (-[WKView swipeWithEvent:]):
            (-[WKView mouseMoved:]):
            (-[WKView mouseDown:]):
            (-[WKView mouseUp:]):
            (-[WKView mouseDragged:]):
            Updated to reflect method rename.
            (-[WKView shouldIgnoreMouseEvents]): Deleted.
    
            * UIProcess/API/mac/WKViewInternal.h:
            Expose -_shouldIgnoreMouseEvents.
    
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController prepareForMenu:withEvent:]):
            Cancel the menu if the presenting WKView should ignore mouse events.
    

2014-11-05  Dana Burkart  <dburkart@apple.com>

        Merge r175632. <rdar://problem/18774264>

    2014-11-05  Beth Dakin  <bdakin@apple.com>
    
            Action menu URL preview should "peek," i.e. appear when the menu item is 
            highlighted
            https://bugs.webkit.org/show_bug.cgi?id=138432
            -and corresponding-
            rdar://problem/18774264
    
            Reviewed by Anders Carlsson.
    
            New ivars. Keep a reference to the popover, and a BOOL that indicates whether we 
            should close the popover when the menu goes away.
            * UIProcess/mac/WKActionMenuController.h:
            * UIProcess/mac/WKActionMenuController.mm:
    
            Re-set the preview bool to NO whenever we are about to pop up a new menu.
            (-[WKActionMenuController prepareForMenu:withEvent:]):
    
            Close the popover when the menu closes unless _shouldKeepPreviewPopoverOpen has 
            been set.
            (-[WKActionMenuController didCloseMenu:withEvent:]):
    
            Set _shouldKeepPreviewPopoverOpen.
            (-[WKActionMenuController _keepPreviewOpen:]):
    
            Re-factored to use ivar.
            (-[WKActionMenuController _previewURLFromActionMenu:]):
            (-[WKActionMenuController _createPreviewPopoverForURL:]):
    
            Now call _previewURLFromActionMenu on menu item highlight.
            (-[WKActionMenuController menu:willHighlightItem:]):
    
            NSPopover delegate method so that we can keep our BOOL and ivar accurate in the 
            case where the popover is closed by some other mechanism than the action menu 
            going away.
            (-[WKActionMenuController popoverWillClose:]):
    
            New selector for the preview. Now when this item is actually selected, we just 
            want to set the BOOL _shouldKeepPreviewPopoverOpen to YES so that we keep the 
            preview open.
            (-[WKActionMenuController _createActionMenuItemForTag:]):
    

2014-11-05  Dana Burkart  <dburkart@apple.com>

        Merge r175630. <rdar://problem/18876437>

    2014-11-05  Conrad Shultz  <conrad_shultz@apple.com>
    
            Disable interaction with action menu page previews
            https://bugs.webkit.org/show_bug.cgi?id=138400
    
            Reviewed by Tim Horton.
    
            Expand on the existing -[WKView shouldIgnoreMouseEvents] by adding facilities to suppress handling
            of all non-wheel events, effectively creating a scroll-only web view. Deploy this in
            WKPagePreviewViewController.
    
            * UIProcess/API/Cocoa/WKViewPrivate.h:
            Declare the OS X-only ignoresNonWheelMouseEvents SPI.
    
            * UIProcess/API/Cocoa/WKWebView.mm:
            (-[WKWebView _ignoresNonWheelMouseEvents]):
            (-[WKWebView _setIgnoresNonWheelMouseEvents:]):
            Wrap the underlying WKView methods.
    
            * UIProcess/API/Cocoa/WKWebViewInternal.h:
            Declare the OS X-only ignoresNonWheelMouseEvents property.
    
            * UIProcess/API/mac/WKView.mm:
            Add _ignoresNonWheelMouseEvents to WKViewData.
            (-[WKView shouldIgnoreMouseEvents]):
            Include a check for _ignoresNonWheelMouseEvents.
            (-[WKView _setIgnoresNonWheelMouseEvents:]):
            Set the ivar in WKViewData.
            (-[WKView _ignoresNonWheelMouseEvents]):
            Fetch the ivar in WKViewData.
            (-[WKView _shouldIgnoreWheelEvents]):
            Implement the old -shouldIgnoreMouseEvents behavior.
            (-[WKView scrollWheel:]):
            -shouldIgnoreMouseEvents -> -_shouldIgnoreWheelEvents.
    
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKPagePreviewViewController loadView]):
            Configure the WKWebView to ignore non-wheel mouse events; use RetainPtr for the WKWebView.
    

2014-11-05  Dana Burkart  <dburkart@apple.com>

        Merge r175591. <rdar://problem/18871842>

    2014-11-04  Anders Carlsson  <andersca@apple.com>
    
            Try to fix the 32-bit build.
    
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _defaultMenuItemsForLink]):
            (-[WKActionMenuController _createActionMenuItemForTag:]):
    

2014-11-05  Dana Burkart  <dburkart@apple.com>

        Merge r175589. <rdar://problem/18871842>

    2014-11-04  Conrad Shultz  <conrad_shultz@apple.com>
    
            Use a web view for Quick Look in action menus
            https://bugs.webkit.org/show_bug.cgi?id=138370
    
            Reviewed by Anders Carlsson.
    
            Instead of using the QLPreviewBubble SPI, show a popover containing a web view. This currently
            does not inherit any configuration from the presenting WKView and does not expose any
            customization options.
    
            * UIProcess/mac/WKActionMenuController.mm:
            Declare new internal NSViewController subclass, WKPagePreviewViewController.
            (-[WKPagePreviewViewController initWithPageURL:]):
            Store the passed-in URL and set a somewhat arbitrary (iPhone 5 screen size) default preferred size.
            (-[WKPagePreviewViewController loadView]):
            Create a WKWebView and load the URL passed into the initializer.
            (-[WKActionMenuController _previewURLFromActionMenu:]):
            Renamed from -_quickLookURLFromActionMenu:; present the popover returned by -_createPreviewPopoverForURL:.
            (-[WKActionMenuController _createPreviewPopoverForURL:]):
            New helper method; return a popover that owns a _WKPagePreviewViewController configured to show a scaled-down web page.
            (-[WKActionMenuController _createActionMenuItemForTag:]):
            Update to reflect method rename.
            (-[WKActionMenuController _quickLookURLFromActionMenu:]): Deleted.
    

2014-11-05  Dana Burkart  <dburkart@apple.com>

        Merge r175610. <rdar://problem/18869345>

    2014-11-04  Beth Dakin  <bdakin@apple.com>
    
            Speculative build fix.
    
            * UIProcess/API/mac/WKView.mm:
            (-[WKView _dismissActionMenuDataDetectorPopovers]):
            * UIProcess/API/mac/WKViewInternal.h:
    

2014-11-05  Dana Burkart  <dburkart@apple.com>

        Merge r175609. <rdar://problem/18869345>

    2014-11-04  Beth Dakin  <bdakin@apple.com>
    
            Un-anchor data detector popovers on scroll
            https://bugs.webkit.org/show_bug.cgi?id=138385
            -and corresponding-
            rdar://problem/18869345
    
            Reviewed by Tim Horton.
    
            Whenever we dismiss the dictionary popover, and on scroll, we should try to 
            dismiss the data detector popovers. Right now we don’t have the ability to know if 
            a dismiss succeeded, so we will settle for un-anchoring the popover.
    
            * UIProcess/API/mac/WKView.mm:
            (-[WKView viewDidMoveToWindow]):
            (-[WKView _dismissActionMenuDataDetetcorPopovers]):
            * UIProcess/API/mac/WKViewInternal.h:
            * UIProcess/PageClient.h:
            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::didCommitLoadForFrame):
            (WebKit::WebPageProxy::pageDidScroll):
            (WebKit::WebPageProxy::resetStateAfterProcessExited):
            * UIProcess/mac/PageClientImpl.h:
            * UIProcess/mac/PageClientImpl.mm:
            (WebKit::PageClientImpl::dismissActionMenuDataDetetcorPopovers):
            * UIProcess/mac/WKActionMenuController.h:
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController dismissActionMenuDataDetetcorPopovers]):
    

2014-11-05  Dana Burkart  <dburkart@apple.com>

        Merge r175597. <rdar://problem/18875579>

    2014-11-04  Tim Horton  <timothy_horton@apple.com>
    
            Add bundle SPI allowing PageOverlay to customize the action menu
            https://bugs.webkit.org/show_bug.cgi?id=138388
            <rdar://problem/18875579>
    
            Reviewed by Anders Carlsson.
    
            * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
            Bump the BundlePageOverlay client version.
    
            (WKBundlePageOverlayCreate):
            (WKBundlePageOverlaySetAccessibilityClient):
            Don't return if we have a version; the version check happens later anyway,
            and now it is valid to have a version >0.
    
            * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
            Bump the BundlePageOverlay client version.
            Add prepareForActionMenu callback.
    
            * WebProcess/WebPage/WebPageOverlay.h:
            (WebKit::WebPageOverlay::Client::prepareForActionMenu):
            * WebProcess/WebPage/WebPageOverlay.cpp:
            (WebKit::overlayMap):
            (WebKit::WebPageOverlay::WebPageOverlay):
            (WebKit::WebPageOverlay::~WebPageOverlay):
            (WebKit::WebPageOverlay::fromCoreOverlay):
            (WebKit::WebPageOverlay::pageOverlayDestroyed):
            Keep track of a map of PageOverlay to WebPageOverlay.
    
            (WebKit::WebPageOverlay::prepareForActionMenu):
            Forward prepareForActionMenu to the client.
            
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::WebPage::performActionMenuHitTestAtLocation):
            Iterate through the overlays and let them prepareForActionMenu;
            the first overlay that returns true wins. If no overlays want to
            do anything, hand preparation along to the context menu client.
    

2014-11-05  Dana Burkart  <dburkart@apple.com>

        Merge r175568. <rdar://problem/18840102>

    2014-11-04  Csaba Osztrogonác  <ossy@webkit.org>
    
             URTBF after r175564 for !PLATFORM(COCOA).
    
            * Shared/TextIndicator.cpp:
    

2014-11-05  Dana Burkart  <dburkart@apple.com>

        Merge r175564. <rdar://problem/18840102>

    2014-11-04  Tim Horton  <timothy_horton@apple.com>
    
            Implement yellow highlight over data detected items
            https://bugs.webkit.org/show_bug.cgi?id=138340
            <rdar://problem/18840102>
    
            Reviewed by Anders Carlsson.
    
            * Shared/TextIndicator.cpp: Renamed from Source/WebKit2/UIProcess/TextIndicator.cpp.
            * Shared/TextIndicator.h: Renamed from Source/WebKit2/UIProcess/TextIndicator.h.
            Move TextIndicator to Shared.
            Move all of the members to a Data struct.
            Implement encode/decode for TextIndicator::Data, so it can be passed as
            the argument to SetTextIndicator, and also as a field on ActionMenuHitTestResult.
            Add 'createWithSelectionInFrame', which builds a TextIndicator
            from the selection in the given frame.
    
            * Shared/mac/ActionMenuHitTestResult.h:
            * Shared/mac/ActionMenuHitTestResult.mm:
            (WebKit::ActionMenuHitTestResult::encode):
            (WebKit::ActionMenuHitTestResult::decode):
            Rename actionBoundingBox to detectedDataBoundingBox.
            Store/encode/decode detectedDataTextIndicator.
    
            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::setTextIndicator):
            * UIProcess/WebPageProxy.h:
            * UIProcess/WebPageProxy.messages.in:
            Create a TextIndicator from the TextIndicator::Data.
            Add an explicit ClearTextIndicator message instead of sending empty Data.
            
            * UIProcess/mac/WKActionMenuController.h:
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController prepareForMenu:withEvent:]):
            If the text indicator is up when preparing for a new menu invocation, hide it.
    
            (-[WKActionMenuController willOpenMenu:withEvent:]):
            Show the text indicator when the menu opens, for data detected items.
    
            (-[WKActionMenuController didCloseMenu:withEvent:]):
            Hide the text indicator when the menu closes, unless we only had one item.
            Then, we'll hide it in the DDActionContext completionHandler block.
            
            (-[WKActionMenuController _showTextIndicator]):
            (-[WKActionMenuController _hideTextIndicator]):
            Added. Show and hide the text indicator based on the TextIndicator
            data included in the action menu hit test result.
    
            (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
            Hide the text indicator when the data detector popover completes.
    
            * WebKit2.xcodeproj/project.pbxproj:
            * WebProcess/WebPage/FindController.cpp:
            (WebKit::FindController::getImageForFindMatch):
            Make use of the newly-moved createSelectionSnapshot.
    
            (WebKit::FindController::updateFindIndicator):
            Make use of TextIndicator::createWithSelectionInFrame, which allows
            us to share this code for building a TextIndicator with other callers.
    
            (WebKit::FindController::hideFindIndicator):
    
            (WebKit::getFindIndicatorBitmap): Deleted.
            Move getFindIndicatorBitmap to WebFrame::createSelectionSnapshot.
    
            * WebProcess/WebPage/WebFrame.cpp:
            (WebKit::WebFrame::createSelectionSnapshot):
            Moved from FindController's getFindIndicatorBitmap.
            Now returns a ShareableBitmap instead of going ahead and making a Handle.
    
            * WebProcess/WebPage/WebFrame.h:
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::scanForDataDetectedItems):
            (WebKit::textIndicatorForRange):
            Temporarily change the selection to the given range, then use
            TextIndicator::indicatorWithSelectionInFrame to acquire a TextIndicator,
            then reset the selection.
    
            (WebKit::WebPage::performActionMenuHitTestAtLocation):
            Create a TextIndicator from the data detected range.
    

2014-11-05  Dana Burkart  <dburkart@apple.com>

        Merge r175524. <rdar://problem/18861406>

    2014-11-04  Tim Horton  <timothy_horton@apple.com>
    
            Dictionary lookup panel pops up at random when clicking on selected text
            https://bugs.webkit.org/show_bug.cgi?id=138353
            <rdar://problem/18861406>
    
            * WebProcess/WebPage/WebPage.h:
            Fix the build; this needs to be public.
    
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::rangeForDictionaryLookupAtHitTestResult):
            Use the right selection (the one we just tested) in the change from r175517.
    

2014-11-05  Dana Burkart  <dburkart@apple.com>

        Merge r175517. <rdar://problem/18861406>

    2014-11-04  Tim Horton  <timothy_horton@apple.com>
    
            Dictionary lookup panel pops up at random when clicking on selected text
            https://bugs.webkit.org/show_bug.cgi?id=138353
            <rdar://problem/18861406>
    
            Reviewed by Andreas Kling.
    
            * WebProcess/WebPage/WebPage.h:
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::rangeForDictionaryLookupForSelection):
            (WebKit::rangeForDictionaryLookupAtHitTestResult):
            Factor rangeForDictionaryLookupForSelection out of performDictionaryLookupForSelection.
    
            Make use of rangeForDictionaryLookupForSelection in rangeForDictionaryLookupAtHitTestResult,
            returning the selection-based range if the hit test intersects the selected text.
            Previously, we were just going forward with performDictionaryLookupForSelection,
            which would actually *do* the lookup, even if we just wanted to retrieve the range.
    
            Make rangeForDictionaryLookup* static.
    
            (WebKit::WebPage::performDictionaryLookupForSelection):
            Make use of rangeForDictionaryLookupForSelection.
    

2014-11-03  Beth Dakin  <bdakin@apple.com>

        Implement action menus for editable text with spelling suggestions
        https://bugs.webkit.org/show_bug.cgi?id=138333
        -and corresponding-
        rdar://problem/18742371

        Reviewed by Tim Horton.

        New types.
        * Shared/API/c/WKActionMenuItemTypes.h:
        * Shared/API/c/WKActionMenuTypes.h:

        ActionMenuHitTestResult now stores the String result of the lookup.
        * Shared/mac/ActionMenuHitTestResult.h:
        * Shared/mac/ActionMenuHitTestResult.mm:
        (WebKit::ActionMenuHitTestResult::encode):
        (WebKit::ActionMenuHitTestResult::decode):

        Make getGuessesForWord() public so we can call it from WKActionMenuController.
        * UIProcess/WebPageProxy.h:
        * UIProcess/mac/WKActionMenuController.mm:

        Select the text for all types of text menus.
        (-[WKActionMenuController isMenuForTextContent]):
        (-[WKActionMenuController willOpenMenu:withEvent:]):

        Spelling suggestions are presented in a sub-menu and will replace the selection 
        when chosen.
        (-[WKActionMenuController _defaultMenuItemsForEditableTextWithSuggestions:]):
        (-[WKActionMenuController _changeSelectionToSuggestion:]):
        (-[WKActionMenuController _createActionMenuItemForTag:]):
        (-[WKActionMenuController _defaultMenuItems:]):

        New function to store the lookupText as a String on the ActionMenuHitTestResult.
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::performActionMenuHitTestAtLocation):
        (WebKit::WebPage::lookupTextAtLocation):

2014-10-29  Tim Horton  <timothy_horton@apple.com>

        Rename WebPageProxy::activeActionMenuHitTestResult to lastMouseMoveHitTestResult
        https://bugs.webkit.org/show_bug.cgi?id=138137
        <rdar://problem/18798257>

        Reviewed by Anders Carlsson.

        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::mouseDidMoveOverElement):
        * UIProcess/WebPageProxy.h:
        (WebKit::WebPageProxy::lastMouseMoveHitTestResult):
        (WebKit::WebPageProxy::activeActionMenuHitTestResult): Deleted.
        * UIProcess/mac/WKActionMenuController.mm:
        (-[WKActionMenuController _defaultMenuItemsForLink]):
        (-[WKActionMenuController _openURLFromActionMenu:]):
        (-[WKActionMenuController _addToReadingListFromActionMenu:]):
        (-[WKActionMenuController _quickLookURLFromActionMenu:]):
        (-[WKActionMenuController _saveImageToDownloads:]):
        (imageForResource:name::if):
        (-[WKActionMenuController _updateActionMenuItems]):
        Rename to the more accurate and general name.

2014-11-03  Tim Horton  <timothy_horton@apple.com>

        _actionMenuItemsForHitTestResult is given kWKActionMenuLink but an empty array of defaultMenuItems
        https://bugs.webkit.org/show_bug.cgi?id=138321
        <rdar://problem/18855134>

        Reviewed by Beth Dakin.

        * UIProcess/mac/WKActionMenuController.mm:
        (-[WKActionMenuController _defaultMenuItemsForLink]):
        (-[WKActionMenuController _defaultMenuItems:]):
        Move the HTTP-family-URLs-only condition to the place where we decide what kind of menu to
        show. We depend on _defaultMenuItemsForLink returning the link menu, and should never
        set the link menu type if we aren't going to build a link menu.

2014-11-03  Tim Horton  <timothy_horton@apple.com>

        Use FrameSnapshotting functions in FindController::getFindIndicatorBitmap
        https://bugs.webkit.org/show_bug.cgi?id=138300
        <rdar://problem/18855863>

        Reviewed by Simon Fraser.

        Share more code by using WebCore's FrameSnapshotting::snapshotSelection
        in FindController instead of copying it into FindController wholesale.

        * WebProcess/WebPage/FindController.cpp:
        (WebKit::getFindIndicatorBitmap):
        Make getFindIndicatorBitmap static, rename it from getFindIndicatorBitmapAndRect,
        and drop the rect argument because only one caller wanted it, and we no longer need
        to compute it (this happens in WebCore now).

        Use snapshotSelection; all of the removed paint behaviors get added by
        code in or underneath snapshotSelection now.

        Draw the snapshot into our ShareableBitmap; we could avoid this in a future patch
        by refactoring the FrameSnapshotting functions to take GraphicsContexts.

        (WebKit::FindController::getImageForFindMatch):
        (WebKit::FindController::updateFindIndicator):
        Adopt the new getFindIndicatorBitmap.

        * WebProcess/WebPage/FindController.h:
        Remove getFindIndicatorBitmap(AndRect), which is now static.

2014-11-03  Beth Dakin  <bdakin@apple.com>

        Implement action menus for editable text
        https://bugs.webkit.org/show_bug.cgi?id=138284
        -and corresponding-
        rdar://problem/18742323

        Reviewed by Tim Horton.

        New item type for paste.
        * Shared/API/c/WKActionMenuItemTypes.h:

        New menu type for editable text.
        * Shared/API/c/WKActionMenuTypes.h:
        * UIProcess/mac/WKActionMenuController.mm:

        willOpenMenu should select text for both regular text menus and editable text 
        menus. 
        (-[WKActionMenuController willOpenMenu:withEvent:]):

        Default items for editable text.
        (-[WKActionMenuController _defaultMenuItemsForEditableText]):
        (-[WKActionMenuController _paste:]):
        (-[WKActionMenuController _createActionMenuItemForTag:]):

        New method _hitTestResultForStage:(MenuUpdateStage)stage will figure out whether 
        we can use the WebHitTestResult from the ActionMenuHitTestResult or if we have to 
        use the potentially out-of-date WebHitTestResult that is cached on WebPageProxy. 
        An important difference between these results is that the ActionMenuHitTest 
        result, in addition to being more recent and accurate, also now includes shadow 
        content, which affects some editable regions on important sites such as 
        bugs.webkit.org and nytimes.com.
        (-[WKActionMenuController _defaultMenuItems:]):
        (-[WKActionMenuController _updateActionMenuItemsForStage:]):
        (imageForResource:name::if): Deleted.

        Allow shadow content in action menu hit testing.
        * WebProcess/WebPage/mac/WebPageMac.mm:
        (WebKit::WebPage::performActionMenuHitTestAtLocation):
        (WebKit::WebPage::selectLookupTextAtLocation):

2014-11-04  Dana Burkart  <dburkart@apple.com>

        Merge r175482. <rdar://problem/18855190>

    2014-11-03  Csaba Osztrogonác  <ossy@webkit.org>
    
            URTBF after r175476 to make GTK and EFL build happy.
    
            * UIProcess/API/gtk/PageClientImpl.cpp:
            (WebKit::PageClientImpl::setTextIndicator):
            (WebKit::PageClientImpl::setFindIndicator): Deleted.
            * UIProcess/API/gtk/PageClientImpl.h:
            * UIProcess/CoordinatedGraphics/WebView.cpp:
            (WebKit::WebView::setTextIndicator):
            (WebKit::WebView::setFindIndicator): Deleted.
            * UIProcess/CoordinatedGraphics/WebView.h:
    
2014-11-04  Dana Burkart  <dburkart@apple.com>

        Merge r175476. <rdar://problem/18855190>

    2014-11-03  Tim Horton  <timothy_horton@apple.com>
    
            Rename FindIndicator{Window} to TextIndicator{Window}
            https://bugs.webkit.org/show_bug.cgi?id=138302
            <rdar://problem/18855190>
    
            Reviewed by Anders Carlsson.
    
            Rename FindIndicator{Window} to TextIndicator{Window} (and related),
            because it will soon be used to indicate ranges of text that are not
            necessarily find-in-page results.
    
            FindController still has things named 'findIndicator' internally,
            and I left the API alone (because all the API bits are actually find-specific),
            but the actual FindIndicator/Window and the message to set it up, etc. are all
            now called Text*.
    
            * CMakeLists.txt:
            * UIProcess/API/mac/WKView.mm:
            * UIProcess/API/mac/WKViewInternal.h:
            * UIProcess/PageClient.h:
            * UIProcess/TextIndicator.cpp: Renamed from Source/WebKit2/UIProcess/FindIndicator.cpp.
            * UIProcess/TextIndicator.h: Renamed from Source/WebKit2/UIProcess/FindIndicator.h.
            * UIProcess/WebPageProxy.cpp:
            * UIProcess/WebPageProxy.h:
            * UIProcess/WebPageProxy.messages.in:
            * UIProcess/ios/PageClientImplIOS.h:
            * UIProcess/ios/PageClientImplIOS.mm:
            * UIProcess/ios/WKContentView.h:
            * UIProcess/mac/PageClientImpl.h:
            * UIProcess/mac/PageClientImpl.mm:
            * UIProcess/mac/TextIndicatorWindow.h: Renamed from Source/WebKit2/UIProcess/mac/FindIndicatorWindow.h.
            * UIProcess/mac/TextIndicatorWindow.mm: Renamed from Source/WebKit2/UIProcess/mac/FindIndicatorWindow.mm.
            * WebKit2.xcodeproj/project.pbxproj:
            * WebProcess/WebPage/FindController.cpp:
    
2014-11-04  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175425. <rdar://problem/18841659>

    2014-10-31  Beth Dakin  <bdakin@apple.com>
    
            Use system art for action menus when possible
            https://bugs.webkit.org/show_bug.cgi?id=138260
    
            Reviewed by Tim Horton.
    
            * Resources/AddImageToPhotosTemplate.pdf: Removed.
            * Resources/CopyImageTemplate.pdf: Removed.
            * Resources/SaveImageToDownloadsTemplate.pdf: Removed.
            * Resources/ShareImageTemplate.pdf: Removed.
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _createActionMenuItemForTag:]):
            * WebKit2.xcodeproj/project.pbxproj:
    

2014-11-04  Dana Burkart  <dburkart@apple.com>

        Merge r175444. <rdar://problem/18830771>

    2014-10-31  Sam Weinig  <sam@webkit.org>
    
            Add bundle SPI to customize the action menu
            <rdar://problem/18830771>
            https://bugs.webkit.org/show_bug.cgi?id=138271
    
            Reviewed by Anders Carlsson.
    
            - Adds a new function to the WKBundlePageContextMenuClient that allows the client to pass construct
              user data in the bundle that can be available when customizing the menu in -[WKView _actionMenuItemsForHitTestResult...].
            - Changes the signature of  -[WKView _actionMenuItemsForHitTestResult...] to add userData.
            - Makes the actual hit test result available in the second invocation of -[WKView _actionMenuItemsForHitTestResult...]
              by serializing it in the ActionMenuHitTestResult.
    
            * Shared/mac/ActionMenuHitTestResult.h:
            * Shared/mac/ActionMenuHitTestResult.mm:
            (WebKit::ActionMenuHitTestResult::encode):
            (WebKit::ActionMenuHitTestResult::decode):
            Adds the WebHitTestResult and the original hit test request location.
            
            * UIProcess/API/Cocoa/WKViewPrivate.h:
            Adds a new version of _actionMenuItemsForHitTestResult that passes userData along.
    
            * UIProcess/API/mac/WKView.mm:
            (-[WKView _didPerformActionMenuHitTest:userData:]):
            (-[WKView _actionMenuItemsForHitTestResult:withType:defaultActionMenuItems:userData:]):
            * UIProcess/API/mac/WKViewInternal.h:
            * UIProcess/PageClient.h:
            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::didPerformActionMenuHitTest):
            * UIProcess/WebPageProxy.h:
            * UIProcess/WebPageProxy.messages.in:
            * UIProcess/mac/PageClientImpl.h:
            * UIProcess/mac/PageClientImpl.mm:
            (WebKit::PageClientImpl::didPerformActionMenuHitTest):
            Pipe the user data through to the WKView.
    
            * UIProcess/mac/WKActionMenuController.h:
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController prepareForMenu:withEvent:]):
            (-[WKActionMenuController didPerformActionMenuHitTest:userData:]):
            (-[WKActionMenuController menuNeedsUpdate:]):
            (-[WKActionMenuController _updateActionMenuItemsForStage:]):
            Differentiate between the two times _updateActionMenuItems was called via a new stage parameter,
            (it is called once in prepareForMenu, and once in menuNeedsUpdate). Use the last mouse move hit
            test result in the prepareForMenu case (as we don't have a real result yet), and the hit result
            passed in via didPerformActionMenuHitTest in the menuNeedsUpdate case (assuming we didn't time out)
            waiting on the web process.
    
            * WebProcess/InjectedBundle/API/c/WKBundlePageContextMenuClient.h:
            * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
            (WebKit::InjectedBundlePageContextMenuClient::prepareForActionMenu):
            * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h:
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::WebPage::performActionMenuHitTestAtLocation):
            Adds new bundle SPI to collect user data to pass to the -[WKView _actionMenuItemsForHitTestResult...] method.
    
2014-11-04  Dana Burkart  <dburkart@apple.com>

        Merge r175428. <rdar://problem/18841709>

    2014-10-31  Tim Horton  <timothy_horton@apple.com>
    
            REGRESSION (r175376): Occasional null deref when doing a dictionary lookup
            https://bugs.webkit.org/show_bug.cgi?id=138261
            <rdar://problem/18841709>
    
            Reviewed by Anders Carlsson.
    
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::WebPage::performDictionaryLookupAtLocation):
            rangeForDictionaryLookupAtHitTestResult can easily return null.
    
2014-11-04  Dana Burkart  <dburkart@apple.com>

        Merge r175422. <rdar://problem/18837197>

    2014-10-31  Timothy Horton  <timothy_horton@apple.com>
    
            Fix the build for Yosemite systems after r175417
    
            * UIProcess/mac/WKActionMenuController.mm:
    
2014-11-04  Dana Burkart  <dburkart@apple.com>

        Merge r175420. <rdar://problem/18837197>

    2014-10-31  Timothy Horton  <timothy_horton@apple.com>
    
            Fix the build for pre-Yosemite systems after r175417
    
            * UIProcess/API/mac/WKView.mm:
            (-[WKView dealloc]):
            (-[WKView initWithFrame:context:configuration:webView:]):
            * UIProcess/API/mac/WKViewInternal.h:
            * UIProcess/mac/PageClientImpl.mm:
            (WebKit::PageClientImpl::didPerformActionMenuHitTest):
            * UIProcess/mac/WKActionMenuController.h:
            * UIProcess/mac/WKActionMenuController.mm:
    
2014-11-04  Dana Burkart  <dburkart@apple.com>

        Merge r175418. <rdar://problem/18837197>

    2014-10-31  Timothy Horton  <timothy_horton@apple.com>
    
            Remove "Add to iPhoto" from the action menu's sharing menu
            https://bugs.webkit.org/show_bug.cgi?id=138251
            <rdar://problem/18837197>
    
            Reviewed by Anders Carlsson.
    
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]):
            Retain/autorelease the new array.
    
2014-11-04  Dana Burkart  <dburkart@apple.com>

        Merge r175417. <rdar://problem/18837197>

    2014-10-31  Tim Horton  <timothy_horton@apple.com>
    
            Remove "Add to iPhoto" from the action menu's sharing menu
            https://bugs.webkit.org/show_bug.cgi?id=138251
            <rdar://problem/18837197>
    
            Reviewed by Anders Carlsson.
    
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]):
            Filter out "Add to iPhoto".
    
2014-11-04  Dana Burkart  <dburkart@apple.com>

        Merge r175388. <rdar://problem/18819547>

    2014-10-30  Tim Horton  <timothy_horton@apple.com>
    
            Long spins under rangeExpandedAroundPosition on Yahoo Mail
            https://bugs.webkit.org/show_bug.cgi?id=138223
            <rdar://problem/18819547>
    
            Reviewed by Enrica Casucci.
    
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::rangeExpandedAroundPositionByCharacters):
            Reimplement rangeExpandedAroundPosition to operate on characters instead of lines,
            and to use Position. Moving VisiblePositions by line can be very expensive in some cases,
            and for generating lookup/Data Detectors context, we don't care about that kind of precision.
            This makes this function ~1000x faster when it hits on a row in the Yahoo Mail message list.
    
            (WebKit::WebPage::performDictionaryLookupAtLocation):
            (WebKit::scanForDataDetectedItems):
            Adopt the new rangeExpandedAroundPositionByCharacters, expanding 250 characters
            before and after, which roughly matches what we were usually getting going by line,
            and is a reasonable amount of context for these operations.
    
2014-11-04  Dana Burkart  <dburkart@apple.com>

        Merge r175349. <rdar://problem/18855953>

    2014-10-29  Anders Carlsson  <andersca@apple.com>
    
            Clear ViewSnapshots when back/forward list items are removed from their list
            https://bugs.webkit.org/show_bug.cgi?id=138188
            <rdar://problem/18817001>
    
            Reviewed by Tim Horton.
    
            Ideally we should remove the WebBackForwardListItem objects as well, but this is a somewhat safer fix.
    
            Change all the "remove item" codepaths to call WebBackForwardList::didRemoveItem and have it clear out the snapshot.
    
            * UIProcess/WebBackForwardList.cpp:
            (WebKit::WebBackForwardList::pageClosed):
            (WebKit::WebBackForwardList::addItem):
            (WebKit::WebBackForwardList::removeAllItems):
            (WebKit::WebBackForwardList::clear):
            (WebKit::WebBackForwardList::didRemoveItem):
            * UIProcess/WebBackForwardList.h:
    
2014-11-04  Dana Burkart  <dburkart@apple.com>

        Merge r175339. <rdar://problem/18814999>

    2014-10-29  Tim Horton  <timothy_horton@apple.com>
    
            Hide the 'Add to Photos' item if it isn't available
            https://bugs.webkit.org/show_bug.cgi?id=138182
            <rdar://problem/18814999>
    
            Reviewed by Beth Dakin.
    
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _defaultMenuItemsForImage]):
            (-[WKActionMenuController _canAddImageToPhotos]):
            (-[WKActionMenuController _addImageToPhotos:]):
            Factor _canAddImageToPhotos out of _addImageToPhotos:, and use it in
            _defaultMenuItemsForImage to avoid including the menu item in the first place.
    
2014-10-31  Dana Burkart  <dburkart@apple.com>

        Rollout rollout of r174369. <rdar://problem/18813684>

    2014-10-06  Chris Dumez  <cdumez@apple.com>
    
            [Mac] We are spending too much time serializing ProtectionSpace objects
            https://bugs.webkit.org/show_bug.cgi?id=137367
    
            Reviewed by Dan Bernstein.
    
            When profiling the load of nytimes.com, I noticed that we were spending
            a lot of CPU time serializing ProtectionSpace objects (in particular
            the NSURLProtectionSpace platform data):
            - 5.6% of CPU time for Network Process
            - 2.5% of CPU time for WebProcess
    
            Serializing an NSURLProtectionSpace seems to be costly due to server
            trust verification. We do this for every sub-resource load over HTTPS
            due to the canAuthenticateAgainstProtectionSpace() callback for server
            trust validation, from the NetworkProcess to the WebProcess and then to
            the UIProcess.
    
            This patch adds a WKContextSetCanHandleHTTPSServerTrustEvaluation(bool)
            WK2 private API that the client can call to indicate that it cannot
            handle HTTPS server trust evaluation and that it is thus unnecessary to
            call the canAuthenticateAgainstProtectionSpace() callback for such
            evaluations. This reduces the amount of IPC between the process and
            thus the number of times we have to serialize the ProtectionSpace.
    
            In the case of the nytimes.com load, there is no longer any
            ProtectionSpace serialization happening as
            canAuthenticateAgainstProtectionSpace() was only called for HTTPS
            server trust evaluation.
    
            * NetworkProcess/NetworkProcess.cpp:
            (WebKit::NetworkProcess::NetworkProcess):
            (WebKit::NetworkProcess::initializeNetworkProcess):
            (WebKit::NetworkProcess::setCanHandleHTTPSServerTrustEvaluation):
            * NetworkProcess/NetworkProcess.h:
            (WebKit::NetworkProcess::canHandleHTTPSServerTrustEvaluation):
            * NetworkProcess/NetworkProcess.messages.in:
            * NetworkProcess/NetworkResourceLoader.cpp:
            (WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
            * Shared/Network/NetworkProcessCreationParameters.cpp:
            (WebKit::NetworkProcessCreationParameters::encode):
            (WebKit::NetworkProcessCreationParameters::decode):
            * Shared/Network/NetworkProcessCreationParameters.h:
            * UIProcess/API/C/WKContext.cpp:
            (WKContextSetCanHandleHTTPSServerTrustEvaluation):
            * UIProcess/API/C/WKContextPrivate.h:
            * UIProcess/API/Cocoa/WKProcessPool.mm:
            (-[WKProcessPool _setCanHandleHTTPSServerTrustEvaluation:]):
            * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
            * UIProcess/WebContext.cpp:
            (WebKit::WebContext::WebContext):
            (WebKit::WebContext::ensureNetworkProcess):
            (WebKit::WebContext::setCanHandleHTTPSServerTrustEvaluation):
            * UIProcess/WebContext.h:

2014-10-29  Tim Horton  <timothy_horton@apple.com>

        Merge r175376 and r175390. <rdar://problem/18742297>

    2014-10-30  Beth Dakin  <bdakin@apple.com>

            Implement action menus for text
            https://bugs.webkit.org/show_bug.cgi?id=138220
            -and corresponding-
            rdar://problem/18742297

            Reviewed by Tim Horton.

            Two new types of actions for the two text actions.
            * Shared/API/c/WKActionMenuItemTypes.h:

            One new type of menu.
            * Shared/API/c/WKActionMenuTypes.h:

            Pass willOpenMenu on to the WKActionMenuController.
            * UIProcess/API/mac/WKView.mm:
            (-[WKView willOpenMenu:withEvent:]):

            Two new WebPageProxy functions that will pass messages along to the web process.
            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::selectLookupTextAtLocation):
            * UIProcess/WebPageProxy.h:

            At willOpenMenu time, text menus should select text so that it is clear what the 
            menu actions will apply to.
            * UIProcess/mac/WKActionMenuController.h:
            * UIProcess/mac/WKActionMenuController.mm:

            Menu items for text menus.
            (-[WKActionMenuController willOpenMenu:withEvent:]):
            (-[WKActionMenuController _defaultMenuItemsForText]):
            (-[WKActionMenuController _copyText:]):
            (-[WKActionMenuController _lookupText:]):
            (-[WKActionMenuController _createActionMenuItemForTag:]):
            (imageForResource:name::if):

            New messages to the web process.
            * UIProcess/mac/WebPageProxyMac.mm:
            (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
            * WebProcess/WebPage/WebPage.h:
            * WebProcess/WebPage/WebPage.messages.in:

            Re-factor performDictionaryLookupAtLocation() to re-use the code that finds the 
            Range for the dictionary lookup. That code now lives in 
            rangeForDictionaryLookupAtHitTestResult() and can be used by 
            performDictionaryLookupAtLocation() and our new function 
            selectLookupTextAtLocation().
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::WebPage::rangeForDictionaryLookupAtHitTestResult):
            (WebKit::WebPage::performDictionaryLookupAtLocation):

            Since the action menu text is always selected, when the lookup action is chosen, 
            we can just lookup the current selection.
            (WebKit::WebPage::performDictionaryLookupOfCurrentSelection):

            Uses the new function rangeForDictionaryLookupAtHitTestResult() to get a lookup 
            range and then select it.
            (WebKit::WebPage::selectLookupTextAtLocation):

2014-10-29  Tim Horton  <timothy_horton@apple.com>

        Merge r175160. <rdar://problem/18742297>

    2014-10-24  Marcos Chavarría Teijeiro  <chavarria1991@gmail.com>

            [GTK] Implement is_selected method on WebKitHitTestResult
            https://bugs.webkit.org/show_bug.cgi?id=137110

            Reviewed by Tim Horton.

            Expose CONTEXT_SELECTION for WebKitHitTestResult.

            * Shared/WebHitTestResult.cpp: Add is_selected field and getter for this field.
            (WebKit::WebHitTestResult::Data::Data):
            (WebKit::WebHitTestResult::Data::encode):
            (WebKit::WebHitTestResult::Data::decode):
            * Shared/WebHitTestResult.h:
            (WebKit::WebHitTestResult::isSelected):
            * UIProcess/API/gtk/WebKitHitTestResult.cpp: Add WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION context and method to check it.
            (webkitHitTestResultCreate):
            (webkitHitTestResultCompare):
            (webkit_hit_test_result_context_is_selection):
            * UIProcess/API/gtk/WebKitHitTestResult.h:
            * UIProcess/API/gtk/WebKitWebView.cpp: Modify context-menu callback to set the new context option.
            (webkitWebViewPopulateContextMenu):
            * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add documentation about new function.

2014-10-29  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175353. rdar://problem/18817803

    2014-10-29  Tim Horton  <timothy_horton@apple.com>

            Null deref under performActionMenuHitTestAtLocation
            https://bugs.webkit.org/show_bug.cgi?id=138197
            <rdar://problem/18817803>

            Reviewed by Beth Dakin.

            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::scanForDataDetectedItems):
            Null-check the expanded range.

2014-10-29  Matthew Hanson  <matthew_hanson@apple.com>

        Rollout r174369. <rdar://problem/18640842>

    2014-10-06  Chris Dumez  <cdumez@apple.com>
    
            [Mac] We are spending too much time serializing ProtectionSpace objects
            https://bugs.webkit.org/show_bug.cgi?id=137367
    
            Reviewed by Dan Bernstein.
    
            When profiling the load of nytimes.com, I noticed that we were spending
            a lot of CPU time serializing ProtectionSpace objects (in particular
            the NSURLProtectionSpace platform data):
            - 5.6% of CPU time for Network Process
            - 2.5% of CPU time for WebProcess
    
            Serializing an NSURLProtectionSpace seems to be costly due to server
            trust verification. We do this for every sub-resource load over HTTPS
            due to the canAuthenticateAgainstProtectionSpace() callback for server
            trust validation, from the NetworkProcess to the WebProcess and then to
            the UIProcess.
    
            This patch adds a WKContextSetCanHandleHTTPSServerTrustEvaluation(bool)
            WK2 private API that the client can call to indicate that it cannot
            handle HTTPS server trust evaluation and that it is thus unnecessary to
            call the canAuthenticateAgainstProtectionSpace() callback for such
            evaluations. This reduces the amount of IPC between the process and
            thus the number of times we have to serialize the ProtectionSpace.
    
            In the case of the nytimes.com load, there is no longer any
            ProtectionSpace serialization happening as
            canAuthenticateAgainstProtectionSpace() was only called for HTTPS
            server trust evaluation.
    
            * NetworkProcess/NetworkProcess.cpp:
            (WebKit::NetworkProcess::NetworkProcess):
            (WebKit::NetworkProcess::initializeNetworkProcess):
            (WebKit::NetworkProcess::setCanHandleHTTPSServerTrustEvaluation):
            * NetworkProcess/NetworkProcess.h:
            (WebKit::NetworkProcess::canHandleHTTPSServerTrustEvaluation):
            * NetworkProcess/NetworkProcess.messages.in:
            * NetworkProcess/NetworkResourceLoader.cpp:
            (WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
            * Shared/Network/NetworkProcessCreationParameters.cpp:
            (WebKit::NetworkProcessCreationParameters::encode):
            (WebKit::NetworkProcessCreationParameters::decode):
            * Shared/Network/NetworkProcessCreationParameters.h:
            * UIProcess/API/C/WKContext.cpp:
            (WKContextSetCanHandleHTTPSServerTrustEvaluation):
            * UIProcess/API/C/WKContextPrivate.h:
            * UIProcess/API/Cocoa/WKProcessPool.mm:
            (-[WKProcessPool _setCanHandleHTTPSServerTrustEvaluation:]):
            * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
            * UIProcess/WebContext.cpp:
            (WebKit::WebContext::WebContext):
            (WebKit::WebContext::ensureNetworkProcess):
            (WebKit::WebContext::setCanHandleHTTPSServerTrustEvaluation):
            * UIProcess/WebContext.h:
    
2014-08-29  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175335. rdar://problem/18709436

    2014-10-29  Tim Horton  <timothy_horton@apple.com>

            Implement action menus for data detected items
            https://bugs.webkit.org/show_bug.cgi?id=138178
            <rdar://problem/18709436>

            Reviewed by Anders Carlsson.

            * Shared/API/c/WKActionMenuTypes.h:
            Add a new type.

            * Shared/WebHitTestResult.cpp:
            (WebKit::WebHitTestResult::Data::Data):
            (WebKit::WebHitTestResult::Data::encode):
            (WebKit::WebHitTestResult::Data::decode):
            * Shared/WebHitTestResult.h:
            (WebKit::WebHitTestResult::isTextNode):
            Determine, store, encode, and decode whether or not the hit node is a text node.

            * Shared/mac/ActionMenuHitTestResult.h:
            * Shared/mac/ActionMenuHitTestResult.mm: Renamed from Source/WebKit2/Shared/mac/ActionMenuHitTestResult.cpp.
            (WebKit::ActionMenuHitTestResult::encode):
            (WebKit::ActionMenuHitTestResult::decode):
            Make ActionMenuHitTestResult an Obj-C++ file.
            Store, encode, and decode (securely!) a DDActionContext and FloatRect
            representing the bounding box of the data detected item, if any.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView initWithFrame:context:configuration:webView:]):
            (-[WKView willOpenMenu:withEvent:]): Deleted.
            Stop using willOpenMenu; we'll use NSMenuDelegate's menuNeedsUpdate: instead.
            Hook up WKActionMenuController as our action menu's delegate.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController prepareForMenu:withEvent:]):
            Call _updateActionMenuItems *after* we've adjusted _state, so that it
            can depend on the value being correct.

            (-[WKActionMenuController willOpenMenu:withEvent:]):
            (-[WKActionMenuController didPerformActionMenuHitTest:]):
            Move menu updating to menuNeedsUpdate for more accurate timing.

            (_updateActionMenuItems):
            When building the menu, if we have a text node that is not a link,
            and hit a data detected item, retrieve the menu from the DDActionContext.
            If we have nothing, make sure to reset _type, and if the final hit-test
            is still pending, build a menu with a dummy item.

            * WebKit2.xcodeproj/project.pbxproj:
            * WebProcess/WebPage/WebPage.cpp:
            (WebKit::WebPage::performActionMenuHitTestAtLocation): Moved to WebPageMac.
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::rangeExpandedAroundPosition):
            Factor this out of performDictionaryLookupAtLocation.

            (WebKit::WebPage::performDictionaryLookupAtLocation):
            Make use of rangeExpandedAroundPosition.

            (WebKit::scanForDataDetectedItems):
            Expand to four lines of context around the hit point.
            Convert that range to plain text, and feed it to DataDetectors.
            Find the result that intersects the hit point, and make a DDActionContext
            for it. Also, store the bounding box of the first quad of the detected
            text, to provide to Data Detectors as a hint for UI placement.

            (WebKit::WebPage::performActionMenuHitTestAtLocation):
            If the hit node is a text node, call scanForDataDetectedItems and
            store the resultant DDActionContext and bounding rect on our
            ActionMenuHitTestResult for transfer to the UI process.

2014-10-29  Lucas Forschler  <lforschler@apple.com>

        Merge r175256

    2014-10-28  Tim Horton  <timothy_horton@apple.com>

            Remove an inaccurate comment in WKActionMenuController
            https://bugs.webkit.org/show_bug.cgi?id=138135

            Reviewed by Anders Carlsson.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _defaultMenuItemsForLink]):
            The comment is wrong; the separator is there for spacing, not just as a workaround.

2014-10-29  Lucas Forschler  <lforschler@apple.com>

        Merge r175238

    2014-10-27  Conrad Shultz  <conrad_shultz@apple.com>

            NSSharingService protocol conformance should be internal to WKActionMenuController
            https://bugs.webkit.org/show_bug.cgi?id=138112

            Reviewed by Tim Horton.

            * UIProcess/mac/WKActionMenuController.h:
            * UIProcess/mac/WKActionMenuController.mm:
            Move protocol conformance from the interface to a class extension.

2014-10-29  Lucas Forschler  <lforschler@apple.com>

        Merge r175193

    2014-10-24  Beth Dakin  <bdakin@apple.com>

            _actionMenuItemsForHitTestResult should also take a type indicating what the menu 
            was built for
            https://bugs.webkit.org/show_bug.cgi?id=138063

            Reviewed by Dan Bernstein.

            New type enum that can be used by clients.
            * Shared/API/c/WKActionMenuTypes.h: Added.

            Remove the old SPI and add the new.
            * UIProcess/API/Cocoa/WKViewPrivate.h:
            * UIProcess/API/mac/WKView.mm:
            (-[WKView _actionMenuItemsForHitTestResult:withType:defaultActionMenuItems:]):
            (-[WKView _actionMenuItemsForHitTestResult:defaultActionMenuItems:]): Deleted.

            Now keep an ivar for the type.
            * UIProcess/mac/WKActionMenuController.h:

            Create a category for the old SPI so that we can still call it if clients have 
            implemented it.
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController initWithPage:view:]):
            (-[WKActionMenuController didCloseMenu:withEvent:]):
            (imageForResource:name::if):
            (-[WKActionMenuController _updateActionMenuItems]):
            * WebKit2.xcodeproj/project.pbxproj:

2014-10-29  Lucas Forschler  <lforschler@apple.com>

        Merge r175190

    2014-10-24  Tim Horton  <timothy_horton@apple.com>

            Share sheet doesn't attach to the window
            https://bugs.webkit.org/show_bug.cgi?id=138062
            <rdar://problem/18767397>

            Reviewed by Beth Dakin.

            * UIProcess/mac/WKActionMenuController.h:
            WKActionMenuController is now a NSSharingService{Picker}Delegate.

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _defaultMenuItemsForImage]):
            Set us up as the NSSharingServicePicker delegate.

            (-[WKActionMenuController sharingServicePicker:delegateForSharingService:]):
            Set us up as the NSSharingService delegate.

            (-[WKActionMenuController sharingService:sourceWindowForShareItems:sharingContentScope:]):
            Return the appropriate window to attach to.

2014-10-29  Lucas Forschler  <lforschler@apple.com>

        Merge r175187

    2014-10-24  Beth Dakin  <bdakin@apple.com>

            Very large images crash in action menu code
            https://bugs.webkit.org/show_bug.cgi?id=138059
            -and corresponding-
            rdar://problem/18767859

            Reviewed by Tim Horton.

            If the HitTestResult failed to create and image, then don’t go for the image 
            action menu.
            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController _defaultMenuItems]):

            ShareableBitmap::createShareable() can fail. The result needs to be null-checked.
            * WebProcess/WebPage/WebPage.cpp:
            (WebKit::WebPage::performActionMenuHitTestAtLocation):

2014-10-29  Lucas Forschler  <lforschler@apple.com>

        Merge r175185

    2014-10-24  Beth Dakin  <bdakin@apple.com>

            Build fix.

            * UIProcess/mac/WKActionMenuController.h:
            * UIProcess/mac/WKActionMenuController.mm:

2014-10-29  Lucas Forschler  <lforschler@apple.com>

        Merge r175184

    2014-10-24  Tim Horton  <timothy_horton@apple.com>

            Blindly try to fix all the builds.

            * UIProcess/mac/WKActionMenuController.h:
            * UIProcess/mac/WKActionMenuController.mm:

2014-10-29  Lucas Forschler  <lforschler@apple.com>

        Merge r175181

    2014-10-24  Timothy Horton  <timothy_horton@apple.com>

            Blindly try to fix all the builds.

            * UIProcess/mac/WKActionMenuController.h:

2014-10-29  Lucas Forschler  <lforschler@apple.com>

        Merge r175180

    2014-10-24  Timothy Horton  <timothy_horton@apple.com>

            Blindly try to fix the 32-bit build.

            * UIProcess/mac/WKActionMenuController.h:
            * UIProcess/mac/WKActionMenuController.mm:

2014-10-29  Lucas Forschler  <lforschler@apple.com>

        Merge r175179

    2014-10-24  Tim Horton  <timothy_horton@apple.com>

            [Mac][WebKit2] Move action menu code into its own file
            https://bugs.webkit.org/show_bug.cgi?id=138034
            <rdar://problem/18758758>

            * UIProcess/mac/WKActionMenuController.mm:
            (-[WKActionMenuController prepareForMenu:withEvent:]):
            (-[WKActionMenuController _addImageToPhotos:]):
            Review comments that were not previously addressed.

2014-10-29  Lucas Forschler  <lforschler@apple.com>

        Merge r175178

    2014-10-24  Tim Horton  <timothy_horton@apple.com>

            [Mac][WebKit2] Move action menu code into its own file
            https://bugs.webkit.org/show_bug.cgi?id=138034
            <rdar://problem/18758758>

            Reviewed by Dan Bernstein.

            * UIProcess/API/mac/WKView.mm:
            (-[WKView initWithFrame:context:configuration:webView:]):
            Make a WKActionMenuController if needed.

            (-[WKView prepareForMenu:withEvent:]):
            (-[WKView willOpenMenu:withEvent:]):
            (-[WKView didCloseMenu:withEvent:]):
            (-[WKView _didPerformActionMenuHitTest:]):
            Forward these to WKActionMenuController.

            (-[WKView _openURLFromActionMenu:]): Deleted.
            (-[WKView _addToReadingListFromActionMenu:]): Deleted.
            (-[WKView _quickLookURLFromActionMenu:]): Deleted.
            (-[WKView _createActionMenuItemForTag:]): Deleted.
            (webKitBundleImageNamed): Deleted.
            (-[WKView _copyImage:]): Deleted.
            (-[WKView _saveImageToDownloads:]): Deleted.
            (temporaryPhotosDirectoryPath): Deleted.
            (pathToPhotoOnDisk): Deleted.
            (-[WKView _addImageToPhotos:]): Deleted.
            (-[WKView _defaultMenuItemsForImage]): Deleted.
            (-[WKView _defaultMenuItems]): Deleted.
            (-[WKView _updateActionMenu]): Deleted.
            Moved to WKActionMenuController.

            * UIProcess/mac/WKActionMenuController.h: Added.
            * UIProcess/mac/WKActionMenuController.mm: Added.
            (-[WKActionMenuController initWithPage:view:]):
            (-[WKActionMenuController prepareForMenu:withEvent:]):
            (-[WKActionMenuController willOpenMenu:withEvent:]):
            (-[WKActionMenuController didCloseMenu:withEvent:]):
            (-[WKActionMenuController didPerformActionMenuHitTest:]):
            (-[WKActionMenuController _defaultMenuItemsForLink]):
            (-[WKActionMenuController _openURLFromActionMenu:]):
            (-[WKActionMenuController _addToReadingListFromActionMenu:]):
            (-[WKActionMenuController _quickLookURLFromActionMenu:]):
            (-[WKActionMenuController _defaultMenuItemsForImage]):
            (-[WKActionMenuController _copyImage:]):
            (-[WKActionMenuController _saveImageToDownloads:]):
            (temporaryPhotosDirectoryPath):
            (pathToPhotoOnDisk):
            (-[WKActionMenuController _addImageToPhotos:]):
            (-[WKActionMenuController _createActionMenuItemForTag:]):
            (webKitBundleImageNamed):
            (imageForResource:name::if):
            (-[WKActionMenuController _updateActionMenuItems]):
            Moved from WKView.

            * WebKit2.xcodeproj/project.pbxproj:

2014-10-29  Lucas Forschler  <lforschler@apple.com>

        Merge r175147

    2014-10-23  Tim Horton  <timothy_horton@apple.com>

            Add some SPI headers for NSExtension and NSSharingService{Picker}
            https://bugs.webkit.org/show_bug.cgi?id=138027

            Reviewed by Anders Carlsson.

            * UIProcess/API/mac/WKView.mm:
            * UIProcess/mac/ServicesController.mm:
            * UIProcess/mac/WebContextMenuProxyMac.mm:
            Replace redefinitions with SPI header #imports.

2014-10-29  Lucas Forschler  <lforschler@apple.com>

        Merge r172542

    2014-08-13  Mark Rowe  <mrowe@apple.com>

            <https://webkit.org/b/135911> WebKit should build on Yosemite with the public SDK.

            Reviewed by Darin Adler.

            * Platform/IPC/mac/ImportanceAssertion.h: Forward-declare the new assertion functions we use.
            * UIProcess/mac/WebContextMenuProxyMac.mm: Forward-declare some details related to NSSharingServicePicker.

2014-10-28  Dana Burkart  <dburkart@apple.com>

        Merge r174791. <rdar://problem/18753175>

    2014-10-16  Tim Horton  <timothy_horton@apple.com>
    
            Implement selection services menu for Legacy WebKit
            https://bugs.webkit.org/show_bug.cgi?id=137582
            <rdar://problem/18604241>
    
            Reviewed by Brady Eidson.
    
            * UIProcess/mac/WebContextMenuProxyMac.mm:
            (-[WKSharingServicePickerDelegate sharingService:didShareItems:]):
            Add a note that we should transition to using replaceSelectionWithAttributedString.
    
            * WebProcess/WebPage/mac/WebPageMac.mm:
            (WebKit::WebPage::handleSelectionServiceClick):
            Allow editor services in editable-but-not-rich-text areas, just like in WebKit1.
    
2014-10-28  Dana Burkart  <dburkart@apple.com>

        Merge r174524. <rdar://problem/18640868>

    2014-10-09  Tim Horton  <timothy_horton@apple.com>
    
            Move ServicesOverlayController to WebCore
            https://bugs.webkit.org/show_bug.cgi?id=137416
            <rdar://problem/18546283>
    
            Reviewed by Anders Carlsson.
    
            * Platform/Logging.h:
            Move Services logging channel to WebCore.
    
            * WebKit2.xcodeproj/project.pbxproj:
            * WebProcess/WebCoreSupport/WebChromeClient.cpp:
            (WebKit::WebChromeClient::handleTelephoneNumberClick):
            (WebKit::WebChromeClient::handleSelectionServiceClick):
            (WebKit::WebChromeClient::hasRelevantSelectionServices):
            Implement services-related ChromeClient callbacks.
            Clicks are forwarded to WebPageMac where they do what they used to;
            hasRelevantSelectionServices is implemented as it was when it lived
            inside ServicesOverlayController.
    
            * WebProcess/WebCoreSupport/WebChromeClient.h:
            * WebProcess/WebCoreSupport/WebEditorClient.cpp:
            (WebKit::WebEditorClient::selectedTelephoneNumberRangesChanged): Deleted.
            (WebKit::WebEditorClient::selectionRectsDidChange): Deleted.
            * WebProcess/WebCoreSupport/WebEditorClient.h:
            Remove WebEditorClient overrides for now-removed functions.
    
            * WebProcess/WebPage/WebPage.cpp:
            (WebKit::WebPage::WebPage):
            (WebKit::WebPage::updatePreferences):
            Forward serviceControlsEnabled setting to WebCore.
    
            (WebKit::WebPage::servicesOverlayController): Deleted.
            * WebProcess/WebPage/WebPage.h:
            (WebKit::WebPage::serviceControlsEnabled): Deleted.
    
2014-10-28  Dana Burkart  <dburkart@apple.com>

        Merge r174231. <rdar://problem/18640833>

    2014-10-02  Tim Horton  <timothy_horton@apple.com>
    
            Move PageOverlay[Controller] to WebCore
            https://bugs.webkit.org/show_bug.cgi?id=137164
            <rdar://problem/18508258>
    
            Reviewed by Anders Carlsson.
    
            * CMakeLists.txt:
            * WebKit2.xcodeproj/project.pbxproj:
            Make the appropriate build system changes.
    
            * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
            Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
    
            * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
            (WKBundlePageInstallPageOverlay):
            (WKBundlePageUninstallPageOverlay):
            (WKBundlePageInstallPageOverlayWithAnimation):
            (WKBundlePageUninstallPageOverlayWithAnimation):
            Forward PageOverlay installation/uninstallation to WebCore.
    
            * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
            (WKBundlePageOverlayGetTypeID):
            (WKBundlePageOverlayCreate):
            (WKBundlePageOverlaySetAccessibilityClient):
            Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
            We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
    
            (PageOverlayClientImpl::copyAccessibilityAttributeValue):
            (PageOverlayClientImpl::copyAccessibilityAttributeNames):
            Convert from wtf types to WebKit2 types.
    
            * WebProcess/WebCoreSupport/WebChromeClient.cpp:
            (WebKit::WebChromeClient::graphicsLayerFactory):
            If we don't have a drawing area, don't dereference it!
    
            (WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
            Forward attachViewOverlayGraphicsLayer to the DrawingArea.
    
            * WebProcess/WebCoreSupport/WebChromeClient.h:
    
            * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
            * WebProcess/WebCoreSupport/WebInspectorClient.h:
            * WebProcess/WebPage/FindController.cpp:
            * WebProcess/WebPage/FindController.h:
            * WebProcess/WebPage/ios/FindControllerIOS.mm:
            * WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
            * WebProcess/WebPage/mac/ServicesOverlayController.mm:
            * WebProcess/WebPage/ServicesOverlayController.h:
            Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
    
            * WebProcess/WebPage/LayerTreeHost.h:
            * WebProcess/WebPage/WebPage.cpp:
            * WebProcess/WebPage/WebPage.h:
            Remove support for WebKit2-based page overlays.
            Return MainFrame instead of Frame from mainFrame().
    
            * WebProcess/WebPage/WebPageOverlay.cpp: Added.
            * WebProcess/WebPage/WebPageOverlay.h: Added.
            (WebKit::WebPageOverlay::create):
            (WebKit::WebPageOverlay::WebPageOverlay):
            (WebKit::WebPageOverlay::~WebPageOverlay):
            (WebKit::WebPageOverlay::setNeedsDisplay):
            (WebKit::WebPageOverlay::clear):
            (WebKit::WebPageOverlay::pageOverlayDestroyed):
            (WebKit::WebPageOverlay::willMoveToPage):
            (WebKit::WebPageOverlay::didMoveToPage):
            (WebKit::WebPageOverlay::drawRect):
            (WebKit::WebPageOverlay::mouseEvent):
            (WebKit::WebPageOverlay::didScrollFrame):
            (WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
            (WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
            (WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
            WebPageOverlay exists to be our API object, but forwards everything
            to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
            forwards client callbacks to its WebPageOverlay::Client (which
            WKBundlePageOverlay implements).
    
            * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
            (-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
            (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
            Forward the three AX properties that PageOverlays are ever queried for
            to the appropriate PageOverlayController function.
            
            * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
            * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
            (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
            (WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
            Factor updateRootLayers out of setRootCompositingLayer.
    
            (WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
            If we attach/detach the view-relative page overlay root layer,
            reattach the root compositing layer's children.
    
            (WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
            Ditto for the root compositing layer.
    
            (WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
            (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
            (WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
            Informing PageOverlayController of exposed rect/document size changes is now
            WebCore's job.
    
            * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
            * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
            (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
            (WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
            Factor updateRootLayers out of setRootCompositingLayer.
    
            (WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
            (WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
            Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
    
            (WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
            (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
            (WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
            Informing PageOverlayController of exposed rect/document size changes is now
            WebCore's job.
    
            * WebProcess/WebPage/DrawingArea.h:
            (WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
    
            * Shared/WebRenderLayer.cpp:
            * Shared/WebRenderObject.cpp:
            * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
            * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
            * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
            * WebProcess/WebProcess.cpp:
            Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
    
2014-10-28  Dana Burkart  <dburkart@apple.com>

        Merge r174369. <rdar://problem/18640842>

    2014-10-06  Chris Dumez  <cdumez@apple.com>
    
            [Mac] We are spending too much time serializing ProtectionSpace objects
            https://bugs.webkit.org/show_bug.cgi?id=137367
    
            Reviewed by Dan Bernstein.
    
            When profiling the load of nytimes.com, I noticed that we were spending
            a lot of CPU time serializing ProtectionSpace objects (in particular
            the NSURLProtectionSpace platform data):
            - 5.6% of CPU time for Network Process
            - 2.5% of CPU time for WebProcess
    
            Serializing an NSURLProtectionSpace seems to be costly due to server
            trust verification. We do this for every sub-resource load over HTTPS
            due to the canAuthenticateAgainstProtectionSpace() callback for server
            trust validation, from the NetworkProcess to the WebProcess and then to
            the UIProcess.
    
            This patch adds a WKContextSetCanHandleHTTPSServerTrustEvaluation(bool)
            WK2 private API that the client can call to indicate that it cannot
            handle HTTPS server trust evaluation and that it is thus unnecessary to
            call the canAuthenticateAgainstProtectionSpace() callback for such
            evaluations. This reduces the amount of IPC between the process and
            thus the number of times we have to serialize the ProtectionSpace.
    
            In the case of the nytimes.com load, there is no longer any
            ProtectionSpace serialization happening as
            canAuthenticateAgainstProtectionSpace() was only called for HTTPS
            server trust evaluation.
    
            * NetworkProcess/NetworkProcess.cpp:
            (WebKit::NetworkProcess::NetworkProcess):
            (WebKit::NetworkProcess::initializeNetworkProcess):
            (WebKit::NetworkProcess::setCanHandleHTTPSServerTrustEvaluation):
            * NetworkProcess/NetworkProcess.h:
            (WebKit::NetworkProcess::canHandleHTTPSServerTrustEvaluation):
            * NetworkProcess/NetworkProcess.messages.in:
            * NetworkProcess/NetworkResourceLoader.cpp:
            (WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
            * Shared/Network/NetworkProcessCreationParameters.cpp:
            (WebKit::NetworkProcessCreationParameters::encode):
            (WebKit::NetworkProcessCreationParameters::decode):
            * Shared/Network/NetworkProcessCreationParameters.h:
            * UIProcess/API/C/WKContext.cpp:
            (WKContextSetCanHandleHTTPSServerTrustEvaluation):
            * UIProcess/API/C/WKContextPrivate.h:
            * UIProcess/API/Cocoa/WKProcessPool.mm:
            (-[WKProcessPool _setCanHandleHTTPSServerTrustEvaluation:]):
            * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
            * UIProcess/WebContext.cpp:
            (WebKit::WebContext::WebContext):
            (WebKit::WebContext::ensureNetworkProcess):
            (WebKit::WebContext::setCanHandleHTTPSServerTrustEvaluation):
            * UIProcess/WebContext.h:
    
2014-10-28  Dana Burkart  <dburkart@apple.com>

        Merge r174257. <rdar://problem/18753175>

    2014-10-02  Csaba Osztrogonác  <ossy@webkit.org>
    
            URTBF after r174231 to fix non Apple builds.
    
            * WebProcess/WebPage/WebPage.h:
    
2014-10-23  Matthew Hanson  <matthew_hanson@apple.com>

        Correcting the merge for r175075. <rdar://problem/18717767>

        Rubber-stamped by Tim Horton.

        * UIProcess/WebPageProxy.messages.in:

2014-10-23  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175127. <rdar://problem/18717767>

    2014-10-23  Tim Horton  <timothy_horton@apple.com>
    
            Assertion failures in ImageKit soft linking
            https://bugs.webkit.org/show_bug.cgi?id=138009
    
            Reviewed by Anders Carlsson.
    
            * UIProcess/API/mac/WKView.mm:
            Soft-link ImageKit correctly.
            ImageKit is inside the Quartz umbrella framework.
    
2014-10-23  Matthew Hanson  <matthew_hanson@apple.com>

        Correcting the merge for r175075. <rdar://problem/18717767>

        Rubber-stamped by Tim Horton.

        * Scripts/webkit2/messages.py:
        (struct_or_class):

2014-10-23  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175075. <rdar://problem/18717767>

    2014-10-22  Tim Horton  <timothy_horton@apple.com>
    
            Add action menu support for images
            https://bugs.webkit.org/show_bug.cgi?id=137987
            <rdar://problem/18717767>
    
            Reviewed by Anders Carlsson, Sam Weinig, and Beth Dakin.
    
            * Resources/AddImageToPhotos.pdf: Added.
            * Resources/CopyImage.pdf: Added.
            * Resources/SaveImageToDownloads.pdf: Added.
            * Resources/ShareImage.pdf: Added.
            Add some temporary artwork.
    
            * Scripts/webkit/messages.py:
            (struct_or_class):
            ActionMenuHitTestResult is a struct.
    
            * Shared/API/c/WKActionMenuItemTypes.h:
            Add new items for image menus.
    
            * Shared/mac/ActionMenuHitTestResult.cpp:
            (WebKit::ActionMenuHitTestResult::encode):
            (WebKit::ActionMenuHitTestResult::decode):
            For now, pass the hit image data across to the UI process as a ShareableBitmap.
    
            * Shared/mac/ActionMenuHitTestResult.h:
    
            * UIProcess/API/mac/WKView.mm:
            (-[WKView _createActionMenuItemForTag:]):
            Refactor action menu item creation into a single function, so that
            callers can share code and be much simpler.
    
            (webKitBundleImageNamed):
            Add a helper to acquire an image from the WebKit2 bundle.
    
            (-[WKView _copyImage:]):
            (-[WKView _saveImageToDownloads:]):
            (temporaryPhotosDirectoryPath):
            (pathToPhotoOnDisk):
            (-[WKView _addImageToPhotos:]):
            Add rudimentary implementations of image actions.
    
            (-[WKView _defaultMenuItemsForImage]):
            Support the image menu, plus a submenu acquired from NSSharingServicePicker
            for the Share menu.
    
            (-[WKView _defaultMenuItems]):
            Call _defaultMenuItemsForImage if needed.
    
            (-[WKView _updateActionMenu]):
            Refactor _updateActionMenu out of prepareForMenu:withEvent:.
    
            (-[WKView prepareForMenu:withEvent:]):
            Ask the Web process to re-hit-test under the location that the menu
            will appear. Mark the menu as pending.
    
            (-[WKView _didPerformActionMenuHitTest:]):
            When we get the hit test reply, record the result for future use.
    
            (-[WKView willOpenMenu:withEvent:]):
            If we got a hit test reply, rebuild the menu immediately. If not, wait
            up to 500ms for the reply to come in. This eventually needs to be
            cancellable if the menu is rejected in the interim.
    
            (-[WKView didCloseMenu:withEvent:]):
            Clear all state when the menu closes.
    
            * UIProcess/API/mac/WKViewInternal.h:
            * UIProcess/PageClient.h:
            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::performActionMenuHitTestAtLocation):
            (WebKit::WebPageProxy::didPerformActionMenuHitTest):
            * UIProcess/WebPageProxy.h:
            * UIProcess/WebPageProxy.messages.in:
            * UIProcess/mac/PageClientImpl.h:
            * UIProcess/mac/PageClientImpl.mm:
            (WebKit::PageClientImpl::didPerformActionMenuHitTest):
            * UIProcess/ios/PageClientImplIOS.h:
            * UIProcess/ios/PageClientImplIOS.mm:
            * WebProcess/WebPage/WebPage.h:
            * WebProcess/WebPage/WebPage.messages.in:
            Plumb didPerformActionMenuHitTest back from WebPageProxy to WKView.
    
            * WebProcess/WebPage/WebPage.cpp:
            (WebKit::WebPage::performActionMenuHitTestAtLocation):
            Hit test at the given location, recording the image data if there is any,
            and return the result to the UI process.
    
            * WebKit2.xcodeproj/project.pbxproj:
            Add the PDFs.
    
2014-10-23  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175016. <rdar://problem/18731860>

    2014-10-21  Tim Horton  <timothy_horton@apple.com>
    
            Quick Look preview bubble has unnecessary controls
            https://bugs.webkit.org/show_bug.cgi?id=137940
            <rdar://problem/18731860>
    
            Reviewed by Simon Fraser.
    
            * UIProcess/API/mac/WKView.mm:
            (-[WKView _quickLookURLFromActionMenu:]):
            Temporarily use more SPI to allow us to hide the preview bubble's controls.
    
2014-10-23  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r174913. <rdar://problem/18712808>

    2014-10-20  Beth Dakin  <bdakin@apple.com>
    
            Action menu items should have tags
            https://bugs.webkit.org/show_bug.cgi?id=137898
    
            Reviewed by Anders Carlsson.
    
            * Shared/API/c/WKActionMenuItemTypes.h: Added.
            * UIProcess/API/mac/WKView.mm:
            (-[WKView _defaultMenuItemsForLink]):
            * WebKit2.xcodeproj/project.pbxproj:
    
2014-10-23  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r175061. <rdar://problem/18694470>

    2014-10-22  Beth Dakin  <bdakin@apple.com>
    
            Remove action menu web preference
            https://bugs.webkit.org/show_bug.cgi?id=137975
    
            Reviewed by Tim Horton.
    
            * Shared/WebPreferencesDefinitions.h:
            * UIProcess/API/C/WKPreferences.cpp:
            (WKPreferencesSetActionMenuSupportEnabled): Deleted.
            (WKPreferencesGetActionMenuSupportEnabled): Deleted.
            * UIProcess/API/C/WKPreferencesRefPrivate.h:
            * UIProcess/API/mac/WKView.mm:
            (-[WKView initWithFrame:context:configuration:webView:]):
    
2014-10-23  Matthew Hanson  <matthew_hanson@apple.com>

        Merge r174908. <rdar://problem/18694470>

    2014-10-20  Beth Dakin  <bdakin@apple.com>
    
            Add support for action menus
            https://bugs.webkit.org/show_bug.cgi?id=137891
            rdar://problem/18451638
            rdar://problem/18694470
    
            Reviewed by Anders Carlsson.
    
            Temporary artwork needed for menu item.
            * Resources/OpenInNewWindowTemplate.pdf: Added.
            * WebKit2.xcodeproj/project.pbxproj:
    
            Add a preference that defaults to false for action menu support.
            * Shared/WebPreferencesDefinitions.h:
            * UIProcess/API/C/WKPreferences.cpp:
            (WKPreferencesSetActionMenuSupportEnabled):
            (WKPreferencesGetActionMenuSupportEnabled):
            * UIProcess/API/C/WKPreferencesRefPrivate.h:
    
            New SPI. WebKit clients can implement this method to customize the action menu.
            * UIProcess/API/Cocoa/WKViewPrivate.h:
    
            Create the action menu if it is supported.
            * UIProcess/API/mac/WKView.mm:
            (-[WKView initWithFrame:context:configuration:webView:]):
    
            Methods to implement the default menu actions.
            (-[WKView _openURLFromActionMenu:]):
            (-[WKView _addToReadingListFromActionMenu:]):
            (-[WKView _quickLookURLFromActionMenu:]):
    
            Add action menus support for links. Populate the menu at the right time.
            (-[WKView _defaultMenuItemsForLink]):
            (-[WKView _defaultMenuItems]):
            (-[WKView prepareForMenu:withEvent:]):
            (-[WKView _actionMenuItemsForHitTestResult:defaultActionMenuItems:]):
    
            New member variable caches the HitTestResult on mouse move.
            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::mouseDidMoveOverElement):
            * UIProcess/WebPageProxy.h:
            (WebKit::WebPageProxy::activeActionMenuHitTestResult):
    
2014-10-23  Babak Shafiei  <bshafiei@apple.com>

        Merge r173694.

    2014-09-17  Gavin Barraclough  <barraclough@apple.com>

            DOM timer throttling for hidden plugins
            https://bugs.webkit.org/show_bug.cgi?id=136197

            Reviewed by Geoff Garen & Andreas Kling.

            For non-visible web pages we slow timers (since they can't be driving animations, etc).
            We should do the same for plugins.

            * PluginProcess/WebProcessConnection.cpp:
            * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
                - remove now redundant includes.
            * WebProcess/Plugins/PluginView.h:
                - audioHardwareActivity is now virtual, override.

2014-10-23  Babak Shafiei  <bshafiei@apple.com>

        Merge r172653.

    2014-08-15  Gavin Barraclough  <barraclough@apple.com>

            Fix plugin visibility check.
            https://bugs.webkit.org/show_bug.cgi?id=135991

            D'oh, more unreviewed typo fix. :-(

            * PluginProcess/PluginControllerProxy.cpp:
            (WebKit::PluginControllerProxy::visibilityDidChange):
            (WebKit::PluginControllerProxy::windowVisibilityChanged):
            (WebKit::PluginControllerProxy::updateVisibilityActivity):
            (WebKit::PluginControllerProxy::updateVisiblityActivity): Deleted.
            * PluginProcess/PluginControllerProxy.h:

2014-10-23  Babak Shafiei  <bshafiei@apple.com>

        Merge r172646.

    2014-08-15  Gavin Barraclough  <barraclough@apple.com>

            Fix plugin visibility check.
            https://bugs.webkit.org/show_bug.cgi?id=135991

            Unreviewed typo fix.

            * PluginProcess/PluginControllerProxy.cpp:
            (WebKit::PluginControllerProxy::PluginControllerProxy):
            (WebKit::PluginControllerProxy::visibilityDidChange):
            (WebKit::PluginControllerProxy::windowVisibilityChanged):
            (WebKit::PluginControllerProxy::updateVisiblityActivity):
            * PluginProcess/PluginControllerProxy.h:

2014-10-23  Babak Shafiei  <bshafiei@apple.com>

        Merge r172645.

    2014-08-15  Gavin Barraclough  <barraclough@apple.com>

            Fix plugin visibility check.
            https://bugs.webkit.org/show_bug.cgi?id=135991

            Reviewed by Andreas Kling.

            We should only take a UserActivity if the plugin is in a visible window,
            and also is itself visible.

            * PluginProcess/PluginControllerProxy.cpp:
            (WebKit::PluginControllerProxy::PluginControllerProxy):
                - initialize member state.
            (WebKit::PluginControllerProxy::visibilityDidChange):
            (WebKit::PluginControllerProxy::windowVisibilityChanged):
                - update member state & call updateVisiblityActivity.
            (WebKit::PluginControllerProxy::updateVisiblityActivity):
                - enable the UserActivity only if both visibilities are true.
            * PluginProcess/PluginControllerProxy.h:
                - added m_isVisible, m_isWindowVisible, updateVisibilityActivity.

2014-10-23  Babak Shafiei  <bshafiei@apple.com>

        Merge r172637.

    2014-08-15  Gavin Barraclough  <barraclough@apple.com>

            de-PLATFORM(COCOA) a couple of methods in plugin code
            https://bugs.webkit.org/show_bug.cgi?id=135987

            Reviewed by Sam Weinig.

            Pass through the visibility & focus on all platforms, to simplify & avoid
            any weird inconsistencies between platforms.

            * PluginProcess/PluginControllerProxy.cpp:
            (WebKit::PluginControllerProxy::windowFocusChanged):
            (WebKit::PluginControllerProxy::windowVisibilityChanged):
            * PluginProcess/PluginControllerProxy.h:
            * PluginProcess/PluginControllerProxy.messages.in:
            * PluginProcess/mac/PluginControllerProxyMac.mm:
            (WebKit::PluginControllerProxy::windowFocusChanged): Deleted.
            (WebKit::PluginControllerProxy::windowVisibilityChanged): Deleted.
            * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
            (WebKit::NetscapePlugin::windowFocusChanged):
            (WebKit::NetscapePlugin::windowVisibilityChanged):
            * WebProcess/Plugins/Netscape/NetscapePlugin.h:
            * WebProcess/Plugins/Plugin.h:
            * WebProcess/Plugins/PluginProxy.cpp:
            (WebKit::PluginProxy::windowAndViewFramesChanged):
            * WebProcess/Plugins/PluginProxy.h:
            * WebProcess/Plugins/PluginView.cpp:
            (WebKit::PluginView::viewStateDidChange):
            (WebKit::PluginView::platformViewStateDidChange): Deleted.
            * WebProcess/Plugins/PluginView.h:

2014-10-23  Babak Shafiei  <bshafiei@apple.com>

        Merge r172634.

    2014-08-15  Gavin Barraclough  <barraclough@apple.com>

            Fix plugin visibility initialization
            https://bugs.webkit.org/show_bug.cgi?id=135985

            Reviewed by Geoffrey Garen.

            * WebProcess/Plugins/PluginView.cpp:
            (WebKit::PluginView::didInitializePlugin):
                - We're not currently initializing the plugin visibility state,
                  and we're passing the wrong value for window visibility.

2014-10-23  Babak Shafiei  <bshafiei@apple.com>

        Merge r172629.

    2014-08-15  Gavin Barraclough  <barraclough@apple.com>

            Simplify visibility activity accounting for plugins
            https://bugs.webkit.org/show_bug.cgi?id=135981

            Reviewed by Dan Bernstein.

            Just take one per connection, rather than implementing a counting mechanism.

            * PluginProcess/PluginControllerProxy.cpp:
            (WebKit::PluginControllerProxy::PluginControllerProxy):
            * PluginProcess/PluginControllerProxy.h:
                - added m_visiblityActivity.
            * PluginProcess/PluginProcess.cpp:
            (WebKit::PluginProcess::PluginProcess):
            (WebKit::PluginProcess::pluginsForWebProcessDidBecomeVisible): Deleted.
            (WebKit::PluginProcess::pluginsForWebProcessDidBecomeHidden): Deleted.
            * PluginProcess/PluginProcess.h:
                - removed pluginsForWebProcessDidBecomeVisible/Hidden.
            * PluginProcess/WebProcessConnection.cpp:
            (WebKit::WebProcessConnection::removePluginControllerProxy):
            (WebKit::WebProcessConnection::pluginDidBecomeVisible): Deleted.
            (WebKit::WebProcessConnection::pluginDidBecomeHidden): Deleted.
            * PluginProcess/WebProcessConnection.h:
                - removed pluginDidBecomeVisible/Hidden.
            * PluginProcess/mac/PluginControllerProxyMac.mm:
            (WebKit::PluginControllerProxy::windowVisibilityChanged):
                - windowVisibilityChanged uses m_visiblityActivity, rather than calling to PluginControllerProxy.

2014-10-21  Dana Burkart  <dburkart@apple.com>

        Merge r174708

    2014-10-14  Alexey Proskuryakov  <ap@apple.com>

            REGRESSION (r165356): Issues with Japanese text input
            https://bugs.webkit.org/show_bug.cgi?id=137719
            rdar://problem/18431952
            rdar://problem/18483741

            Reviewed by Darin Adler.

            * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::didChangeSelection):
            In sync code path, ensure consistent message delivery order by adding
            a DispatchMessageEvenWhenWaitingForSyncReply flag. This way, delayed
            EditorStateChanged messages won't confuse UI process.

2014-10-21  Dana Burkart  <dburkart@apple.com>

        Merge r173888

    2014-09-23  Jer Noble  <jer.noble@apple.com>

            REGRESSION (r171197): Clip's content is drawn behind Safari window when entering Full Screen youtube html5 first time
            https://bugs.webkit.org/show_bug.cgi?id=137029

            Reviewed by Brent Fulgham.

            In r171197, we ordered the full screen window on- and off-screen so that the fullscreen animation went to the
            correct screen, which introduced a subtle glitch at the beginning and end of an animation. For entering, ensure
            that the window is scaled to its starting size before ordering on-screen. For exiting, order the window off-
            screen before resetting its clipping rect.

            * UIProcess/mac/WKFullScreenWindowController.mm:
            (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
            (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):

2014-10-21  Dana Burkart  <dburkart@apple.com>

        Merge r172968

    2014-08-26  Simon Fraser  <simon.fraser@apple.com>

            Crashes in hit testing under WebPage::determinePrimarySnapshottedPlugIn()
            https://bugs.webkit.org/show_bug.cgi?id=136240
            rdar://problem/17231462

            Reviewed by Darin Adler.
            
            determinePrimarySnapshottedPlugIn() does render tree hit testing, so needs
            to ensure that layout is up-to-date.

            * WebProcess/WebPage/WebPage.cpp:
            (WebKit::WebPage::determinePrimarySnapshottedPlugIn):

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:
        (WKKeyValueStorageManagerGetKeyValueS