-[WKWebView loadRequest:] should return a WKNavigation
https://bugs.webkit.org/show_bug.cgi?id=127873

Reviewed by Dan Bernstein.

Source/WebKit2:

For now this just returns a dummy navigation.

* UIProcess/API/Cocoa/WKNavigation.h:
* UIProcess/API/Cocoa/WKNavigation.mm:
(-[WKNavigation initWithRequest:]):
(-[WKNavigation request]):
* UIProcess/API/Cocoa/WKNavigationInternal.h: Added.
* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView loadRequest:]):
* WebKit2.xcodeproj/project.pbxproj:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/Navigation.mm: Added.
(TEST):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163053 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Run JSC Inspector EventLoop in a custom run loop mode to prevent default observers from running
https://bugs.webkit.org/show_bug.cgi?id=127865

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-01-29
Reviewed by Geoffrey Garen.

When hitting a breakpoint in a JSContext Inspector we want to entirely
pause the process and all access to the JSContext and only move forward
based on debugger commands. Having the nested run loop run in a default
mode allowed NSTimers scheduled on the thread to regularly run and
evaluate code in the JSContext. Using a custom run loop mode gets us
a bit closer to locking down the context. This doesn't handle scenarios
where background threads also access the JSContext, but it handles the
most common scenario.

* inspector/EventLoop.cpp:
(Inspector::EventLoop::cycle):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163054 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed iOS build fix after 163050.

Import CALayer.h explicitly as (on iOS) it is not included by other headers.

* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163055 268f45cc-cd09-0410-ab3c-d52691b4dbfc
EventHandler::handleMouseReleaseEvent shouldn't call updateSelectionCachesIfSelectionIsInsideTextFormControl
and selectFrameElementInParentIfFullySelected
https://bugs.webkit.org/show_bug.cgi?id=127834

Reviewed by Alexey Proskuryakov.

Removed the calls and made setNonDirectionalSelectionIfNeeded pass in UserTriggered option.

In addition, removed the rather error-prone function override of setSelection since TextGranularity,
which is an enum, could be implicitly coerced into SetSelectionOptions which is a typedefed unsigned int.

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelectionByMouseIfDifferent): Renamed from setNonDirectionalSelectionIfNeeded.
Pass in DoNotRevealSelection to avoid revealing the selection to preserve the existing behavior.
There are two layout tests that fail without this.
(WebCore::FrameSelection::setSelection): Check the newly addeed DoNotRevealSelection option.
(WebCore::FrameSelection::wordSelectionContainingCaretSelection): Call

* editing/FrameSelection.h: Made updateSelectionCachesIfSelectionIsInsideTextFormControl and
selectFrameElementInParentIfFullySelected private as they are no longer called outside of FrameSelection.

* page/EventHandler.cpp:
(WebCore::EventHandler::updateSelectionForMouseDownDispatchingSelectStart):
(WebCore::EventHandler::updateSelectionForMouseDrag):
(WebCore::EventHandler::handleMouseReleaseEvent): Removed calls to the functions.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163056 268f45cc-cd09-0410-ab3c-d52691b4dbfc
50% time on Dromaeo Selector * benchmark spent allocating oversized backing stores (but not in Chrome)
https://bugs.webkit.org/show_bug.cgi?id=127879

Reviewed by Gavin Barraclough.

Let's not dynamically resize an array whose size is statically known,
mmmkay?

* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncConcat): Use nullptr to disambiguate vs the numeric
argument.

(JSC::arrayProtoFuncSlice): The fix.

(JSC::arrayProtoFuncSort):
(JSC::arrayProtoFuncSplice):
(JSC::arrayProtoFuncFilter):
(JSC::arrayProtoFuncMap): Use nullptr.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
js/function-apply-aliased.html is timing out
https://bugs.webkit.org/show_bug.cgi?id=127860

Reviewed by Michael Saboff.

* TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163058 268f45cc-cd09-0410-ab3c-d52691b4dbfc
checkTextOfParagraph releases NSString twice
https://bugs.webkit.org/show_bug.cgi?id=127881
<rdar://problem/15937446>

Reviewed by Anders Carlsson.

textString is released once by an explicit call to release and again by it going out of scope.
Don't do the explicit release.

The bug was spotted by Sam Weinig.

* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::checkTextOfParagraph):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163059 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Pass navigation IDs along to LoadRequest and Reload
https://bugs.webkit.org/show_bug.cgi?id=127883

Reviewed by Sam Weinig.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::loadRequest):
(WebKit::WebPageProxy::loadFile):
(WebKit::WebPageProxy::reload):
(WebKit::WebPageProxy::generateNavigationID):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebDocumentLoader.cpp:
(WebKit::WebDocumentLoader::setNavigationID):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::WebPage::loadRequest):
(WebKit::WebPage::reload):
(WebKit::WebPage::createDocumentLoader):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163060 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add IsVisibleOrOccluded to ViewState
https://bugs.webkit.org/show_bug.cgi?id=127875

Reviewed by Anders Carlsson.

../WebCore: 

* page/ViewState.h:
    - added IsVisibleOrOccluded

../WebKit2: 

When the WKView associated with a plugin becomes occluded
we tell the plugin it is no longer visible. This is a problem
if the plugin is being occluded by its own fullscreen window.

Instead, consider plugins to be visible any time they are in
a visible window – i.e. when they are visible or occluded.

* UIProcess/API/mac/PageClientImpl.h:
* UIProcess/API/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::isViewVisibleOrOccluded):
* UIProcess/PageClient.h:
(WebKit::PageClient::isViewVisibleOrOccluded):
    - added isViewVisibleOrOccluded.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateViewState):
    - update IsVisibleOrOccluded.
(WebKit::WebPageProxy::viewStateDidChange):
    - when updating IsVisible also update IsVisibleOrOccluded.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::platformViewStateDidChange):
    - use isVisibleOrOccluded to determine plugin visibility.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::isVisibleOrOccluded):
    - accessor.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a NavigationState object to keep track of the navigations for a given page
https://bugs.webkit.org/show_bug.cgi?id=127884

Reviewed by Sam Weinig.

* UIProcess/API/Cocoa/WKNavigation.mm:
(-[WKNavigation request]):
(-[WKNavigation setRequest:]):
* UIProcess/API/Cocoa/WKNavigationInternal.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
(-[WKWebView loadRequest:]):
* UIProcess/Cocoa/NavigationState.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKNavigation.mm.
* UIProcess/Cocoa/NavigationState.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKNavigation.mm.
(WebKit::NavigationState::NavigationState):
(WebKit::NavigationState::~NavigationState):
(WebKit::NavigationState::createLoadRequestNavigation):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadRequest):
* UIProcess/WebPageProxy.h:
* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163062 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Moved linking against common frameworks and a library from the .xcconfig file into the target.

Reviewed by Tim Horton.

../WebKit: 

* WebKit.xcodeproj/project.pbxproj:

../WebKit/mac: 

* Configurations/WebKit.xcconfig:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163063 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix 32-bit build.

* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:

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