Rename -[WKBackForwardListItem originalURL] to -[WKBackForwardListItem initialURL]
https://bugs.webkit.org/show_bug.cgi?id=131116

Reviewed by Antti Koivisto.

* UIProcess/API/Cocoa/WKBackForwardListItem.h:
* UIProcess/API/Cocoa/WKBackForwardListItem.mm:
(-[WKBackForwardListItem initialURL]):
(-[WKBackForwardListItem originalURL]): Deleted.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166656 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove Input domain from the Web Inspector protocol.

https://bugs.webkit.org/show_bug.cgi?id=131073

Reviewed by Joseph Pecoraro.

Source/WebCore:

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorAllInOne.cpp:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
* inspector/InspectorInputAgent.cpp: Removed.
* inspector/InspectorInputAgent.h: Removed.
* inspector/protocol/Input.json: Removed.

Source/WebInspectorUI:

* UserInterface/Protocol/Legacy/7.0/InspectorWebBackendCommands.js: Updated.
* Versions/Inspector-iOS-7.0.json: Removed Input domain.

LayoutTests:

* inspector-protocol/input/dispatchKeyEvent-expected.txt: Removed.
* inspector-protocol/input/dispatchKeyEvent.html: Removed.
* inspector-protocol/input/dispatchMouseEvent-expected.txt: Removed.
* inspector-protocol/input/dispatchMouseEvent.html: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166657 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Adding Objective-C SPI for Find in Page.
https://bugs.webkit.org/show_bug.cgi?id=131000 Need an Objective-C API or SPI for Find in Page

Patch by Alice Barraclough <alice.liu@apple.com> on 2014-04-02
Reviewed by Dan Bernstein.

Find-on-page SPI added to WKWebView, which funnels the messages through the WebPageProxy.
Returning messages are designated by _WKFindDelegate protocol.
Also provide FindDelegate access on WKWebView.
WebPageProxy gets a new-style API::FindClient.
Also had to replicate WKFindOptions as _WKFindOptions in Cocoa SPI. This is unfortunate, but it 
does follow the pattern of other options & enums related to classes that are SPI-for-now.
        
PageClientImplIOS handles setFindIndicator function by forwarding to its WKContentView, 
but WKContentView _setFindIndicator remains unimplemented for now.
        
* UIProcess/API/APIFindClient.h: Added.
(API::FindClient::~FindClient):
(API::FindClient::didCountStringMatches):
(API::FindClient::didFindString):
(API::FindClient::didFailToFindString):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageFindClient):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
(-[WKWebView _findDelegate]):
(-[WKWebView _setFindDelegate:]):
(toFindOptions):
(-[WKWebView _countStringMatches:options:maxCount:]):
(-[WKWebView _findString:options:maxCount:]):
(-[WKWebView _hideFindUI]):
(-[WKWebView _hostForFindUI]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
(NS_OPTIONS):
* UIProcess/API/Cocoa/_WKFindDelegate.h: Added.
* UIProcess/Cocoa/FindClient.h: Added.
* UIProcess/Cocoa/FindClient.mm: Added.
(WebKit::FindClient::FindClient):
(WebKit::FindClient::delegate):
(WebKit::FindClient::setDelegate):
(WebKit::FindClient::didCountStringMatches):
(WebKit::FindClient::didFindString):
(WebKit::FindClient::didFailToFindString):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::setFindClient):
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::didCountStringMatches):
(WebKit::WebPageProxy::didFindString):
(WebKit::WebPageProxy::didFailToFindString):
(WebKit::WebPageProxy::initializeFindClient): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::findClient):
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::setFindIndicator):
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _setFindIndicator:WebKit::fadeOut:animate:]):
* WebKit2.xcodeproj/project.pbxproj:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166658 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Try to fix test failures.

* platform/graphics/ca/mac/TileGrid.mm:
(WebCore::TileGrid::TileGrid):  Initialize a field.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166659 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Enable the CANVAS_PATH feature.
https://bugs.webkit.org/show_bug.cgi?id=131114

Reviewed by Dean Jackson.

This code build and runs on Windows just fine. It was overlooked when the feature
was activated on other platforms.

* win/tools/vsprops/FeatureDefines.props: Turn on the feature.
* win/tools/vsprops/FeatureDefinesCairo.props: Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166660 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unify private browsing with sessions.
https://bugs.webkit.org/show_bug.cgi?id=130099

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Unless otherwise noted, the following consists solely of mechanical changes to replace querying WebCore::Settings::privateBrowsingEnabled() with Page::usesEphemeralSession().

* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::allowDatabaseAccess):
* WebCore.exp.in: Remove Settings::setPrivateBrowsingEnabled, add Page::legacyPrivateBrowsingEnabled.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
* loader/HistoryController.cpp:
(WebCore::HistoryController::updateForStandardLoad):
(WebCore::HistoryController::updateForRedirectWithLockedBackForwardList):
(WebCore::HistoryController::updateForClientRedirect):
(WebCore::HistoryController::updateForSameDocumentNavigation):
(WebCore::HistoryController::pushState):
(WebCore::HistoryController::replaceState):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::cacheForMainRequest):
(WebCore::ApplicationCacheGroup::selectCache):
(WebCore::ApplicationCacheGroup::selectCacheWithoutManifestURL):
(WebCore::ApplicationCacheGroup::update):
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::isApplicationCacheEnabled):
* loader/icon/IconController.cpp:
(WebCore::IconController::continueLoadWithDecision):
* page/Page.cpp:
(WebCore::Page::Page): Initialize with defaultSessionID.
(WebCore::Page::legacyPrivateBrowsingEnabled): Legacy setting for private browsing.
(WebCore::Page::privateBrowsingStateChanged): Move implementation to setSessionID.
(WebCore::Page::sessionID): Simplify to just return m_sessionID.
(WebCore::Page::setSessionID): Also perform privateBrowsingStateChanged action.a
(WebCore::Page::privateBrowsingStateChanged): Deleted.
(WebCore::Page::checkSubframeCountConsistency): Deleted.
* page/Page.h:
* page/PageConsole.cpp:
(WebCore::PageConsole::addMessage):
(WebCore::PageConsole::messageWithTypeAndLevel):
* page/Settings.cpp: Remove privateBrowsingEnabled setting.
(WebCore::Settings::Settings):
(WebCore::Settings::setPrivateBrowsingEnabled): Page reflects setting using session.
* page/Settings.h:
* plugins/PluginView.cpp:
(WebCore::PluginView::getValue):
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::addSearchResult):
* storage/Storage.cpp:
(WebCore::Storage::isDisabledByPrivateBrowsing):

Source/WebKit/efl:

* ewk/ewk_view.cpp:
(_ewk_view_priv_new): Change WebCore::Settings::privateBrowsingEnabled() to Page::sessionID().isEphemeral().
(ewk_view_setting_private_browsing_set): Change WebCore::Settings::setPrivateBrowsingEnabled() to Page::enableLegacyPrivateBrowsing().

Source/WebKit/gtk:

* WebCoreSupport/FrameLoaderClientGtk.cpp: Change WebCore::Settings::privateBrowsingEnabled() to Page:usesEphemeralSession().
(WebKit::FrameLoaderClient::dispatchDidReceiveAuthenticationChallenge):
* webkit/webkitwebview.cpp: Change Settings::setPrivateBrowsingEnabled() to Page::enablePrivateBrowsing().
(webkit_web_view_update_settings):
(webkit_web_view_settings_notify):

Source/WebKit/mac:

* WebCoreSupport/WebFrameLoaderClient.mm: Change WebCore::Settings::privateBrowsingEnabled() to Page::sessionID().isEphemeral().
(WebFrameLoaderClient::updateGlobalHistoryItemForPage):
* WebCoreSupport/WebFrameNetworkingContext.mm: Ditto.
(WebFrameNetworkingContext::storageSession):
* WebView/WebView.mm: Change WebCore::Settings::setPrivateBrowsingEnabled() to Page::enableLegacyPrivateBrowsing().
(-[WebView _preferencesChanged:]):

Source/WebKit/win:

* WebCoreSupport/WebFrameLoaderClient.cpp: Change WebCore::Settings::privateBrowsingEnabled() to Page::sessionID().isEphemeral().
(WebFrameLoaderClient::updateGlobalHistoryItemForPage):
* WebCoreSupport/WebFrameNetworkingContext.cpp: Ditto.
(WebFrameNetworkingContext::storageSession):
* WebView.cpp: Change WebCore::Settings::setPrivateBrowsingEnabled() to Page::enableLegacyPrivateBrowsing().
(WebView::notifyPreferencesChanged):

Source/WebKit2:

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: Change WebPage::isUsingEphemeralSession() to WebPage::usesEphemeralSession().
(WKBundlePageIsUsingEphemeralSession):
* WebProcess/InjectedBundle/InjectedBundle.cpp: Change Settings::setPrivateBrowsingEnabled() to Page::enableLegacyPrivateBrowsing().
(WebKit::InjectedBundle::setPrivateBrowsingEnabled):
* WebProcess/Plugins/PluginView.cpp: Change Settings::privateBrowsingEnabled() to Page::usesEphemeralSession().
(WebKit::PluginView::isPrivateBrowsingEnabled):
* WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp: Ditto.
(WebKit::WebFrameNetworkingContext::storageSession):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::usesEphemeralSession): Renamed from isUsingEphemeralSession.
(WebKit::WebPage::setSessionID): Ensure session before setting.
(WebKit::WebPage::updatePreferences): Set session to legacy private session if needed.
(WebKit::WebPage::sessionID): Moved to header.
(WebKit::WebPage::isUsingEphemeralSession): Renamed to usesEphemeralSession.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::sessionID): Just call down to m_page.

Tools:

Add an API test for ephemeral sessions similar to PrivateBrowsingPushStateNoHistoryCallback.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/EphemeralSessionPushStateNoHistoryCallback.cpp:
(TestWebKitAPI::didNavigateWithNavigationData):
(TestWebKitAPI::didSameDocumentNavigationForFrame):
(TestWebKitAPI::TEST):

* TestWebKitAPI/Tests/WebKit2/PrivateBrowsingPushStateNoHistoryCallback.cpp: Also test to make sure private browsing can be disabled.
(TestWebKitAPI::didNavigateWithoutNavigationData):
(TestWebKitAPI::didNavigateWithNavigationData):
(TestWebKitAPI::didSameDocumentNavigationForFrame):
(TestWebKitAPI::TEST):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166661 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Added some more dataLog info for OSR exits.
<https://webkit.org/b/131120>

Reviewed by Michael Saboff.

Adding info about the OSR exit index, the bytecode index of the bytecode
that is OSR exiting, and the reason for the OSR exit.  This change is
for debugging code which only comes into play when we use the
--printEachOSRExit option.

* dfg/DFGOSRExit.h:
* dfg/DFGOSRExitCompiler32_64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOSRExitCompiler64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOperations.cpp:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166662 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Expose geolocation provider on the process pool
https://bugs.webkit.org/show_bug.cgi?id=131125

Patch by Sam Weinig.
Reviewed by Dean Jackson.

* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _geolocationProvider]): Create and initialize WKGeolocationProviderIOS if necessary.
* UIProcess/API/Cocoa/WKProcessPoolInternal.h: Expose _geolocationProvider.
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _decidePolicyForGeolocationRequestFromOrigin:frame:request:]): Call into WKProcessPool.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166663 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Document WKUIDelegate and WKWindowFeatures
https://bugs.webkit.org/show_bug.cgi?id=131124

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKProcessPool.h:
* UIProcess/API/Cocoa/WKUIDelegate.h:
* UIProcess/API/Cocoa/WKWindowFeatures.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove Settings::maximumDecodedImageSize()
https://bugs.webkit.org/show_bug.cgi?id=131057
<rdar://problem/15626368>

Source/WebCore:

Reviewed by Darin Adler.

The setting Settings::maximumDecodedImageSize() and its related logic have various
shortcomings, including the inability to cancel an image load when the estimated
decoded image size exceeds the maximum decoded image size. In the iOS port, this
setting is less useful given image subsampling support. For now, we remove this
setting and its related logic. Should it turn out that such a setting is useful
then we can implement it again taking care to address the shortcomings in the
original design.

* html/HTMLCanvasElement.cpp: For the iOS port, define MaxCanvasArea to be 4580 * 1145
pixels such that the maximum size of the image buffer is 20 MB (assumes 4 bytes per pixel).
(WebCore::HTMLCanvasElement::HTMLCanvasElement):
(WebCore::HTMLCanvasElement::createImageBuffer):
* html/HTMLCanvasElement.h:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::createImageData):
(WebCore::CanvasRenderingContext2D::getImageData):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::addIncrementalDataBuffer):
(WebCore::CachedImage::finishLoading):
* loader/cache/CachedImage.h:
* page/Settings.in:

Source/WebKit/mac:

Reviewed by Darin Adler.

Remove preferences key WebKitMaximumImageSize.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences _maximumImageSize:]): Deleted.
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

LayoutTests:

Reviewed by Darin Adler.

Remove test LayoutTests/fast/images/decoded-size-exceeds-max-decoded-size.html as it
isn't applicable following the removal of the setting Settings::maximumDecodedImageSize().
Additionally update the test fast/images/bag-png.html to ensure that we dispatch
a DOM Error event when we fail to decode a malformed image.

* fast/images/bad-png.html:
* fast/images/decoded-size-exceeds-max-decoded-size-expected.txt: Removed.
* fast/images/decoded-size-exceeds-max-decoded-size.html: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166665 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Refactor the function call generator to take the arguments by value
https://bugs.webkit.org/show_bug.cgi?id=131129

Reviewed by Andreas Kling.

Nothing forces the pointed address to stay alive between setOneArgument/setTwoArguments
and prepareAndCall.

This patch changes FunctionCall to:
-Keep the register by value instead of using pointers.
-Crash at compile time if a register is invalid.

* cssjit/FunctionCall.h:
(WebCore::FunctionCall::FunctionCall):
(WebCore::FunctionCall::setOneArgument):
(WebCore::FunctionCall::setTwoArguments):
(WebCore::FunctionCall::swapArguments):
(WebCore::FunctionCall::prepareAndCall):
* cssjit/RegisterAllocator.h:
(WebCore::RegisterAllocator::isValidRegister):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166666 268f45cc-cd09-0410-ab3c-d52691b4dbfc