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
[Gtk][EFL] Fix build after r158759
https://bugs.webkit.org/show_bug.cgi?id=123910

Patch by Brendan Long <b.long@cablelabs.com> on 2013-11-06
Reviewed by Gustavo Noronha Silva.

* UIProcess/API/gtk/PageClientImpl.cpp: Remove flashBackingStoreUpdates().
* UIProcess/API/gtk/PageClientImpl.h: Same.
* UIProcess/CoordinatedGraphics/WebView.cpp: Same.
* UIProcess/CoordinatedGraphics/WebView.h: Same.
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::incorporateUpdate): Don't call flashBackingStoreUpdates().

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158782 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Disable "unused local typedefs" warning for GCC 4.7
https://bugs.webkit.org/show_bug.cgi?id=123913

Patch by Nick Diego Yamane <nick.yamane@openbossa.org> on 2013-11-06
Reviewed by Martin Robinson.

That warning was actually introduced in gcc 4.7.0.
See: http://gcc.gnu.org/gcc-4.7/changes.html

* wtf/Compiler.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement more decoding methods
https://bugs.webkit.org/show_bug.cgi?id=123922

Reviewed by Dan Bernstein.

* Shared/API/Cocoa/WKRemoteObjectCoder.mm:
(-[WKRemoteObjectDecoder decodeObjectForKey:]):
Call decodeObjectOfClasses:forKey: passing nil as the classes set.

(-[WKRemoteObjectDecoder decodeInt64ForKey:]):
Try to get a WebUInt64 and return its value.

(-[WKRemoteObjectDecoder decodeDoubleForKey:]):
Try to get a WebDouble and return its value.

(-[WKRemoteObjectDecoder decodeBytesForKey:returnedLength:]):
Move this method next to the other decoding methods.

(-[WKRemoteObjectDecoder requiresSecureCoding]):
Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158784 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove the flaky test expectation after r158720 now that the test is not flaky.

* platform/mac/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158785 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix test case

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: CSS Regions: When a flow is clicked the content of flow needs to be displayed
https://bugs.webkit.org/show_bug.cgi?id=122927

Reviewed by Joseph Pecoraro.

ContentFlowTreeContentView is now used to display the content nodes of a ContentFlow. It is
very similar to the DOMTreeContentView class, but can handle multiple root nodes.

* UserInterface/ContentFlowTreeContentView.js: Added.
(WebInspector.ContentFlowTreeContentView):
(WebInspector.ContentFlowTreeContentView.prototype.get selectionPathComponents):
(WebInspector.ContentFlowTreeContentView.prototype.updateLayout):
(WebInspector.ContentFlowTreeContentView.prototype.shown):
(WebInspector.ContentFlowTreeContentView.prototype.hidden):
(WebInspector.ContentFlowTreeContentView.prototype.closed):
(WebInspector.ContentFlowTreeContentView.prototype._selectedNodeDidChange):
(WebInspector.ContentFlowTreeContentView.prototype._pathComponentSelected):
(WebInspector.ContentFlowTreeContentView.prototype._createContentNodeTree):
(WebInspector.ContentFlowTreeContentView.prototype._createContentTrees):
(WebInspector.ContentFlowTreeContentView.prototype._contentNodeWasAdded):
(WebInspector.ContentFlowTreeContentView.prototype._contentNodeWasRemoved):
* UserInterface/ContentView.js:
(WebInspector.ContentView):
(WebInspector.ContentView.isViewable):
* UserInterface/DOMTreeElement.js:
(WebInspector.DOMTreeElement.prototype.ondeselect): We need to remove the selected "dom node"
so that the element is not going to stay selected after the we move to a different DOM tree.
* UserInterface/DOMTreeOutline.js:
(WebInspector.DOMTreeOutline.prototype.selectDOMNode):
* UserInterface/Main.html:
* UserInterface/Main.js:
(WebInspector.sidebarPanelForRepresentedObject):
* UserInterface/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel.prototype._treeElementSelected):


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