JSExport doesn't support constructors
https://bugs.webkit.org/show_bug.cgi?id=123380

Reviewed by Geoffrey Garen.

Needed another linked-on-or-after check for when we're deciding whether
we should copy over init family methods.

Factored out the link time checks into a separate function so that they can be cached.

Factored out the check for init-family method selectors into helper function and changed it to
match the description in the clang docs, namely that there can be underscores at the beginning
and the first letter after 'init' part of the selector (if there is one) must be a capital letter.

Updated tests to make sure we don't treat "initialize" as an init-family method and that we do
treat "_init" as an init-family method.

* API/JSWrapperMap.h:
* API/JSWrapperMap.mm:
(isInitFamilyMethod):
(shouldSkipMethodWithName):
(copyMethodsToObject):
(allocateConstructorForCustomClass):
(supportsInitMethodConstructors):
* API/tests/testapi.mm:
(-[ClassA initialize]):
(-[ClassD initialize]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158762 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WKRemoteObjectInterface should keep track of allowed decodable classes
https://bugs.webkit.org/show_bug.cgi?id=123903

Reviewed by Sam Weinig.

* Shared/API/Cocoa/WKRemoteObjectInterface.mm:
(allowedArgumentClassesForMethod):
Helper function that returns a vector of sets of allowed classes for each method argument.

(initializeAllowedArgumentClasses):
Iterate over the methods in the protocol, get the extended method type encoding and create an
NSMethodSignature from it. Finally, pass the signature to allowedArgumentClassesForMethod.

(initializeAllowedArgumentClasses):
Call the other initializeAllowedArgumentClasses twice, once for required methods,
and once for optional methods.

(-[WKRemoteObjectInterface initWithProtocol:identifier:]):
Call initializeAllowedArgumentClasses.

(-[WKRemoteObjectInterface _allowedArgumentClassesForSelector:]):
Add new getter.

* Shared/API/Cocoa/WKRemoteObjectInterfaceInternal.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158763 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add WKBrowsingContextPolicyDelegate
https://bugs.webkit.org/show_bug.cgi?id=123904

Reviewed by Anders Carlsson.

* UIProcess/API/mac/WKBrowsingContextController.h:
* UIProcess/API/mac/WKBrowsingContextController.mm:
Implement a WKPagePolicyClient in terms of the new WKBrowsingContextPolicyDelegate protocol.
        
* UIProcess/API/mac/WKBrowsingContextPolicyDelegate.h: 
Added.

* UIProcess/API/mac/WebKit2.h:
Add new #include of WKBrowsingContextPolicyDelegate.h

* WebKit2.xcodeproj/project.pbxproj:
Add new file.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158764 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] run-webkit-tests on the win platform should fall back to mac-mountainlion, not mac-lion.
https://bugs.webkit.org/show_bug.cgi?id=123905

Reviewed by Brent Fulgham.

Now that the mac-lion results have been removed, the win port should fall back to
the mac-mountainlion results.

* Scripts/webkitpy/port/win.py:
(WinPort.default_baseline_search_path):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158765 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed webkitpy unit test fix; update baselines after r158765

* Scripts/webkitpy/port/win_unittest.py:
(WinPortTest.test_baseline_search_path):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158767 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Encode parameters as objects
https://bugs.webkit.org/show_bug.cgi?id=123912

Reviewed by Beth Dakin.

We want to ensure that the objects have the right types when decoded, so just encode them as objects.

* Shared/API/Cocoa/WKRemoteObjectCoder.mm:
(encodeInvocation):
(-[WKRemoteObjectEncoder encodeValueOfObjCType:at:]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DFG CheckArray(NonArray) should prove that the child isn't an array
https://bugs.webkit.org/show_bug.cgi?id=123911
<rdar://problem/15202803>

Reviewed by Mark Hahnenberg.

Source/JavaScriptCore: 

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::jumpSlowForUnwantedArrayMode):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::isArrayType):

LayoutTests: 

* js/dfg-check-array-non-array-expected.txt: Added.
* js/dfg-check-array-non-array.html: Added.
* js/script-tests/dfg-check-array-non-array.js: Added.
(foo):
(bar):
(baz):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158773 268f45cc-cd09-0410-ab3c-d52691b4dbfc
HTMLCollection should use CollectionIndexCache
https://bugs.webkit.org/show_bug.cgi?id=123906

Reviewed by Ryosuke Niwa.
        
More code sharing.

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::namedItemGetter):
* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::JSHTMLDocument::nameGetter):
* dom/ChildNodeList.h:
* dom/CollectionIndexCache.h:
(WebCore::::nodeBeforeCached):
(WebCore::::nodeAfterCached):
(WebCore::::nodeAt):
            
    Add a mechanism for disabling use of backward traversal.

* dom/LiveNodeList.h:
(WebCore::LiveNodeList::collectionCanTraverseBackward):
* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::HTMLCollection):
(WebCore::isMatchingElement):
(WebCore::HTMLCollection::iterateForPreviousElement):
(WebCore::firstMatchingElement):
(WebCore::nextMatchingElement):
(WebCore::HTMLCollection::length):
(WebCore::HTMLCollection::item):
(WebCore::nameShouldBeVisibleInDocumentAll):
(WebCore::firstMatchingChildElement):
(WebCore::nextMatchingSiblingElement):
(WebCore::HTMLCollection::firstElement):
(WebCore::HTMLCollection::traverseForward):
(WebCore::HTMLCollection::collectionFirst):
(WebCore::HTMLCollection::collectionLast):
(WebCore::HTMLCollection::collectionTraverseForward):
(WebCore::HTMLCollection::collectionTraverseBackward):
(WebCore::HTMLCollection::invalidateCache):
(WebCore::HTMLCollection::namedItem):
(WebCore::HTMLCollection::updateNameCache):
* html/HTMLCollection.h:
(WebCore::HTMLCollection::collectionCanTraverseBackward):
        
    Disable use of backward traversal for collections that use custom traversal.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158774 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] Add -[WKBrowsingContextController unreachableURL]
https://bugs.webkit.org/show_bug.cgi?id=123909

Reviewed by Anders Carlsson.

* UIProcess/API/mac/WKBrowsingContextController.h: Declared unreachableURL property.
* UIProcess/API/mac/WKBrowsingContextController.mm:
(-[WKBrowsingContextController unreachableURL]): Added.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::unreachableURL): Added.
* UIProcess/WebPageProxy.h:



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

* UIProcess/API/mac/WKBrowsingContextController.h:
* UIProcess/API/mac/WKBrowsingContextController.mm:
(-[WKBrowsingContextController dealloc]):
(-[WKBrowsingContextController _initWithPageRef:]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158776 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename region line offset methods
https://bugs.webkit.org/show_bug.cgi?id=123897

Reviewed by Sam Weinig.

Because of the large number of overloads on the line offset methods,
it is very hard to read code using them, which also makes it harder to
move them out of RenderBlock. This patch renames the methods that take
a region as an argument to make it clearer when looking at the code
how the differ from the ones that don't.

No new tests, no behavior change.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeStartPositionDeltaForChildAvoidingFloats):
* rendering/RenderBlock.h:
(WebCore::RenderBlock::availableLogicalWidthForLineInRegion):
(WebCore::RenderBlock::logicalRightOffsetForLineInRegion):
(WebCore::RenderBlock::logicalLeftOffsetForLineInRegion):
(WebCore::RenderBlock::startOffsetForLineInRegion):
(WebCore::RenderBlock::endOffsetForLineInRegion):
(WebCore::RenderBlock::availableLogicalWidthForLine):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::shrinkLogicalWidthToAvoidFloats):
(WebCore::RenderBox::containingBlockAvailableLineWidthInRegion):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158777 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] Add -[WKNavigationData response]
https://bugs.webkit.org/show_bug.cgi?id=123918

Reviewed by Sam Weinig.

* Shared/WebNavigationDataStore.h: Added a ResourceResponse data member.
(WebKit::WebNavigationDataStore::encode): Encode the response.
(WebKit::WebNavigationDataStore::decode): Decode the response.
* UIProcess/Cocoa/WKNavigationData.h: Declared new property.
* UIProcess/Cocoa/WKNavigationData.mm:
(-[WKNavigationData response]): Added.
* UIProcess/WebNavigationData.h:
(WebKit::WebNavigationData::response): Added.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::updateGlobalHistory): Set the response in the data store.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158779 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Decode invocation arguments
https://bugs.webkit.org/show_bug.cgi?id=123917

Reviewed by Sam Weinig.

* Shared/API/Cocoa/WKRemoteObjectCoder.mm:
(-[WKRemoteObjectDecoder initWithInterface:rootObjectDictionary:WebKit::]):
Initialize the object stream.

(decodeObjectFromObjectStream):
Check that we're not reading past the end of the stream, then decode the object.

(decodeInvocationArguments):
Decode arguments from the object stream.

(decodeInvocation):
Call decodeInvocationArguments and set up the selector argument.

* Shared/ImmutableArray.h:
(WebKit::ImmutableArray::at):
(WebKit::ImmutableArray::size):
(WebKit::ImmutableArray::entries):
Constify.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed Mac build fix; include ResourceResponse.

* Shared/WebNavigationDataStore.h:

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