[CSS Grid Layout] Add support for named grid areas
https://bugs.webkit.org/show_bug.cgi?id=120045

Reviewed by Andreas Kling.

From Blink r155555, r155850 and r155889 by <jchaffraix@chromium.org>

Source/WebCore:

Added support for named grid areas. Basically a named grid area is
now a valid grid position. The shorthand parsing of grid-area was
split from the grid-{row|column} as the rules for expanding are
slightly different.

Unknown grid area names are treated as 'auto' as per the
specification. This means that for those cases we need to trigger
the auto-placement algorithm.

Tests: fast/css-grid-layout/grid-item-bad-named-area-auto-placement.html
       fast/css-grid-layout/grid-item-named-grid-area-resolution.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForGridPosition):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseGridPosition):
(WebCore::gridMissingGridPositionValue):
(WebCore::CSSParser::parseGridItemPositionShorthand):
(WebCore::CSSParser::parseGridAreaShorthand):
(WebCore::CSSParser::parseSingleGridAreaLonghand):
* css/CSSParser.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):
(WebCore::StyleResolver::adjustGridItemPosition):
(WebCore::createGridPosition):
* css/StyleResolver.h:
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::resolveGridPositionFromStyle):
* rendering/style/GridPosition.h:
(WebCore::GridPosition::isNamedGridArea):
(WebCore::GridPosition::setNamedGridArea):
(WebCore::GridPosition::namedGridLine):

LayoutTests:

Added a couple of new tests to check that both known and unknown
named grid areas are properly handled.

Also extended some of the existing tests to use named grid areas
as any other possible grid position.

* fast/css-grid-layout/grid-item-area-get-set-expected.txt:
* fast/css-grid-layout/grid-item-area-get-set.html:
* fast/css-grid-layout/grid-item-bad-named-area-auto-placement-expected.txt: Added.
* fast/css-grid-layout/grid-item-bad-named-area-auto-placement.html: Added.
* fast/css-grid-layout/grid-item-column-row-get-set-expected.txt:
* fast/css-grid-layout/grid-item-column-row-get-set.html:
* fast/css-grid-layout/grid-item-end-after-get-set-expected.txt:
* fast/css-grid-layout/grid-item-end-after-get-set.html:
* fast/css-grid-layout/grid-item-named-grid-area-resolution-expected.txt: Added.
* fast/css-grid-layout/grid-item-named-grid-area-resolution.html: Added.
* fast/css-grid-layout/grid-item-start-before-get-set-expected.txt:
* fast/css-grid-layout/grid-item-start-before-get-set.html:
* fast/css-grid-layout/resources/grid-item-column-row-parsing-utils.js:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158744 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Playing many sounds with HTML5 Audio makes WebKit unresponsive
https://bugs.webkit.org/show_bug.cgi?id=116145

Reviewed by Eric Carlson.

Cache as much information as possible from AVPlayerItem to eliminate unneccesary
calls into AVFoundation.

Add WillChange/DidChange functions to handle the results of KVO notifications
from AVPlayerItem and AVPlayer:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformPlay):
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformPause):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateRate):
(WebCore::MediaPlayerPrivateAVFoundationObjC::playerItemStatusDidChange):
(WebCore::MediaPlayerPrivateAVFoundationObjC::playbackLikelyToKeepUpWillChange):
(WebCore::MediaPlayerPrivateAVFoundationObjC::playbackLikelyToKeepUpDidChange):
(WebCore::MediaPlayerPrivateAVFoundationObjC::playbackBufferEmptyWillChange):
(WebCore::MediaPlayerPrivateAVFoundationObjC::playbackBufferEmptyDidChange):
(WebCore::MediaPlayerPrivateAVFoundationObjC::playbackBufferFullWillChange):
(WebCore::MediaPlayerPrivateAVFoundationObjC::playbackBufferFullDidChange):
(WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesDidChange):
(WebCore::MediaPlayerPrivateAVFoundationObjC::loadedTimeRangesDidChange):
(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange):
(WebCore::MediaPlayerPrivateAVFoundationObjC::hasEnabledAudioDidChange):
(WebCore::MediaPlayerPrivateAVFoundationObjC::presentationSizeDidChange):
(WebCore::MediaPlayerPrivateAVFoundationObjC::durationDidChange):
(WebCore::MediaPlayerPrivateAVFoundationObjC::rateDidChange):
(WebCore::itemKVOProperties):
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):

Instruct the HTMLMediaElement to cache the currentTime value for 5 seconds:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
(WebCore::MediaPlayerPrivateAVFoundationObjC::maximumDurationToCacheMediaTime):

Add and initialize member variables to hold these cached values:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
(WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):

Add a new Notification type which can take (and call) a Function object:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
(WebCore::MediaPlayerPrivateAVFoundation::Notification::Notification):
(WebCore::MediaPlayerPrivateAVFoundation::Notification::function):

Implement queries in terms of the cached values of AVPlayerItem and AVPlayer
properties:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
(WebCore::MediaPlayerPrivateAVFoundationObjC::playerItemStatus):
(WebCore::MediaPlayerPrivateAVFoundationObjC::rate):
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformBufferedTimeRanges):
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformMinTimeSeekable):
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeSeekable):
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeLoaded):
(WebCore::MediaPlayerPrivateAVFoundationObjC::totalBytes):
(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
(WebCore::MediaPlayerPrivateAVFoundationObjC::sizeChanged):
(WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks):

Invalidate the cached currentTime before calling scheduleTimeUpdate so that the
correct movieTime is saved in m_clockTimeAtLastUpdateEvent:
* html/HTMLMediaElement.cpp:
(HTMLMediaElement::setReadyState):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158745 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed 32-bit Mac build fix; use an explicit FloatSize -> IntSize conversion function.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::sizeChanged):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158746 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix, style() return type is now a reference.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::resolveGridPositionFromStyle):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158747 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FTL should support StringCharCodeAt
https://bugs.webkit.org/show_bug.cgi?id=123854

Reviewed by Sam Weinig.

* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):
(JSC::FTL::LowerDFGToLLVM::compileStringCharCodeAt):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158748 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unrevewied Windows build fix after r158736; add InlineElementBox.cpp to the RenderingAllInOne.cpp file.

* rendering/RenderingAllInOne.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158749 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add ENABLE(TEXT_SELECTION)
https://bugs.webkit.org/show_bug.cgi?id=123827

Reviewed by Ryosuke Niwa.

Source/WebCore:

Add compile-time guard, ENABLE(TEXT_SELECTION), to enable or
disable selection painting in WebCore (enabled by default).

On iOS we disable WebCore selection painting and have UIKit
paint the selection.

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintSelection): Only paint selection when
TEXT_SELECTION is enabled.
* rendering/LogicalSelectionOffsetCaches.h:
(WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches):
For now, add a ENABLE(TEXT_SELECTION)-guard around an assertion. Added
a FIXME comment to investigate the callers and either move the assertion
to the appropriate callers or structure the code such that we can remove
the assertion.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintSelection): Only paint selection when
TEXT_SELECTION is enabled.
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextSelectionPaintStyle): Only compute the selection
paint style when TEXT_SELECTION is enabled. Otherwise, return a paint
style identical to the text paint style. Also, substitute nullptr for 0.

Source/WTF:

Enable selection painting by default on all ports except iOS.

* wtf/FeatureDefines.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158750 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Change ctiTrampoline into a thunk
https://bugs.webkit.org/show_bug.cgi?id=123844

Reviewed by Filip Pizlo.

Converted ctiTrampoline and ctiOpThrowNotCaught into thunks named callToJavaScript
and returnFromJavaScript.  Cleaned up and in some cases removed JITStubsXXX.h files
after removing ctiTrampoline and ctiOpThrowNotCaught.  Added callJavaScriptJITFunction
to VM that is a function pointer to the callToJavaScript thunk.

* GNUmakefile.list.am:
* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGDriver.cpp:
(JSC::DFG::compileImpl):
* jit/JITCode.cpp:
(JSC::JITCode::execute):
* jit/JITExceptions.cpp:
(JSC::genericUnwind):
* jit/JITStubs.cpp:
* jit/JITStubs.h:
* jit/JITStubsARM.h:
* jit/JITStubsARM64.h: Removed.
* jit/JITStubsARMv7.h:
* jit/JITStubsMIPS.h: Removed.
* jit/JITStubsMSVC64.asm:
* jit/JITStubsSH4.h: Removed.
* jit/JITStubsX86.h:
* jit/JITStubsX86_64.h:
* jit/JSInterfaceJIT.h:
* jit/ThunkGenerators.cpp:
(JSC::returnFromJavaScript):
(JSC::callToJavaScript):
* jit/ThunkGenerators.h:
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158751 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening; Fix expected results for video-seek-with-negative-playback.html,
and modify the test to conform to media test style.

* media/video-seek-with-negative-playback-expected.txt:
* media/video-seek-with-negative-playback.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158752 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] History delegate
https://bugs.webkit.org/show_bug.cgi?id=123837

Reviewed by Sam Weinig.

* Shared/Cocoa/APIObject.mm:
(WebKit::APIObject::newObject): Allocate a WKNavigationData if the object is a
WebNavigationData.

* Shared/Cocoa/WKNSString.h:
(WebKit::wrapper): Added. Returns a WebString’s wrapper as an NSString.

* Shared/Cocoa/WKNSURL.h:
(WebKit::wrapper): Added. Returns a WebURL’s wrapper as an NSURL.

* UIProcess/API/C/WKNavigationData.cpp: Renamed.
* UIProcess/API/C/WKNavigationData.h: Renamed.
* UIProcess/API/C/WKNavigationDataRef.cpp: Copied from Source/WebKit2/UIProcess/API/C/WKNavigationData.cpp.
* UIProcess/API/C/WKNavigationDataRef.h: Copied from Source/WebKit2/UIProcess/API/C/WKNavigationData.h.

* UIProcess/API/mac/WKBrowsingContextController.h: Declared historyDelegate property.

* UIProcess/API/mac/WKProcessGroup.mm:
(didNavigateWithNavigationData): Added history client callback that calls the browsing
context’s history delegate.
(didPerformClientRedirect): Ditto.
(didPerformServerRedirect): Ditto.
(didUpdateHistoryTitle): Ditto.
(setUpHistoryClient): Added.
(-[WKProcessGroup initWithInjectedBundleURL:]): Added call to setUpHistoryClient.
(-[WKProcessGroup dealloc]): Clear the history client.

* UIProcess/Cocoa/WKBrowsingContextHistoryDelegate.h: Added.

* UIProcess/Cocoa/WKNavigationData.h: Added.
* UIProcess/Cocoa/WKNavigationData.mm: Added.
(-[WKNavigationData dealloc]): Calls the WebNavigationData destructor.
(-[WKNavigationData title]): Added.
(-[WKNavigationData originalRequest]): Added.
(-[WKNavigationData destinationURL]): Added.
(-[WKNavigationData _apiObject]): Returns the wrapped WebNavigationData.
* UIProcess/Cocoa/WKNavigationDataInternal.h: Added.
(WebKit::wrapper): Added. Returns a WebNavigationData’s wrapper as a WKNavigationData.
* WebKit2.xcodeproj/project.pbxproj: Updated for renames and additions.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158753 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[ATK] Providing new table related accessibility expectations after r158742
https://bugs.webkit.org/show_bug.cgi?id=123893

Patch by Krzysztof Czech <k.czech@samsung.com> on 2013-11-06
Reviewed by Chris Fleizach.

New baselines after added missing implementation in r158742.

* platform/efl-wk1/TestExpectations: Tests are no longer failing.
* platform/efl-wk2/TestExpectations: Tests are no longer failing.
* platform/efl-wk2/accessibility/table-attributes-expected.txt: Added.
* platform/efl-wk2/accessibility/table-sections-expected.txt: Added.
* platform/efl/accessibility/table-attributes-expected.txt: Added.
* platform/efl/accessibility/table-sections-expected.txt: Added.
* platform/gtk-wk2/accessibility/table-attributes-expected.txt: Added.
* platform/gtk-wk2/accessibility/table-sections-expected.txt: Added.
* platform/gtk/TestExpectations: Tests are no longer failing.
* platform/gtk/accessibility/table-attributes-expected.txt: Added.
* platform/gtk/accessibility/table-sections-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158754 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed GTK gardening. Media elements wrongly exposed after r158743.

* platform/gtk/TestExpectations: Added failure expectations.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158755 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Promoted WKBrowsingContextHistoryDelegate.h to private.

Rubber-stamped by Sam Weinig.

* WebKit2.xcodeproj/project.pbxproj:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158756 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[ATK] accessibility/title-ui-element-correctness.html fails
https://bugs.webkit.org/show_bug.cgi?id=99825

Reviewed by Mario Sanchez Prada.

Source/WebCore:

When calling setAtkRelationSetFromCoreObject a new ATK_LABELLED_BY_RELATION
is added, adding proper label element as a relation. When the document structure
has been changed and a different label should be linked as a relation, current ATK
implementation adds it as a next target on relation's target list, while
WTR/DumpRenderTree implementation takes only first one into account.
This patch adds a new function removing current relations before adding new ones.

Covered by existing tests.

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(removeAtkRelationFromRelationSetByType):
(setAtkRelationSetFromCoreObject):

LayoutTests:

Remove failure test expectation for the test fixed by this patch.

* platform/efl-wk1/TestExpectations:
* platform/efl-wk2/TestExpectations:
* platform/gtk/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158757 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move array position caching out from HTMLCollection
https://bugs.webkit.org/show_bug.cgi?id=123895

Reviewed by Darin Adler.

This caching complicates the logic but is used by a single subclass
(HTMLFormControlsCollection) only. The subclass can do the caching itself.

* html/HTMLAllCollection.cpp:
(WebCore::HTMLAllCollection::HTMLAllCollection):
* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::HTMLCollection):
(WebCore::HTMLCollection::create):
(WebCore::HTMLCollection::item):
(WebCore::HTMLCollection::elementBeforeOrAfterCachedElement):
(WebCore::HTMLCollection::firstElement):
        
    Renamed from traverseFirstElement.

(WebCore::HTMLCollection::traverseForwardToOffset):
(WebCore::HTMLCollection::invalidateCache):
        
    Make cache invalidation virtual so we can clear HTMLTableRowsCollection index cache.

(WebCore::HTMLCollection::namedItem):
(WebCore::HTMLCollection::updateNameCache):
        
    Use traverseForwardToOffset instead traverseNextElement. This allows removal of traverseNextElement.

* html/HTMLCollection.h:
(WebCore::HTMLCollection::usesCustomForwardOnlyTraversal):
        
    Renamed the enum and the accessor to be more informative.

(WebCore::HTMLCollection::setCachedElement):
(WebCore::HTMLCollection::customElementAfter):
        
    Renamed from virtualItemAfter.

* html/HTMLFormControlsCollection.cpp:
(WebCore::HTMLFormControlsCollection::HTMLFormControlsCollection):
(WebCore::findFormAssociatedElement):
(WebCore::HTMLFormControlsCollection::customElementAfter):
        
    Move the array position caching logic here.

(WebCore::HTMLFormControlsCollection::invalidateCache):
* html/HTMLFormControlsCollection.h:
* html/HTMLNameCollection.cpp:
(WebCore::HTMLNameCollection::HTMLNameCollection):
* html/HTMLOptionsCollection.cpp:
(WebCore::HTMLOptionsCollection::HTMLOptionsCollection):
* html/HTMLTableRowsCollection.cpp:
(WebCore::HTMLTableRowsCollection::HTMLTableRowsCollection):
(WebCore::HTMLTableRowsCollection::customElementAfter):
* html/HTMLTableRowsCollection.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158758 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove dead code
https://bugs.webkit.org/show_bug.cgi?id=123902

Reviewed by Tim Horton.

Remove the PageClient::containingWindowGraphicsContext() as well as the
WKPageSetDebugPaintFlags and WKPageGetDebugPaintFlags API functions.

* UIProcess/API/C/WKPage.cpp:
* UIProcess/API/mac/PageClientImpl.h:
* UIProcess/API/mac/PageClientImpl.mm:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebPageProxy.h:
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::searchTheWeb):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158759 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add "id" attribute to TextTrack
https://bugs.webkit.org/show_bug.cgi?id=123825

Patch by Brendan Long <b.long@cablelabs.com> on 2013-11-06
Reviewed by Eric Carlson.

Source/WebCore:

Test: media/track/track-id.html

* html/HTMLMediaElement.cpp:
(HTMLMediaElement::addTextTrack): Add emptyString() for track id.
* html/track/AudioTrack.cpp:
(WebCore::AudioTrack::AudioTrack): Pass trackPrivate->id() to TrackBase.
(WebCore::AudioTrack::idChanged): Added, set id.
* html/track/AudioTrack.h: Move m_id to TrackBase.
* html/track/InbandTextTrack.cpp:
(WebCore::InbandTextTrack::InbandTextTrack): Pass trackPrivate->id() to TrackBase.
(WebCore::InbandTextTrack::idChanged): Added, set id.
* html/track/InbandTextTrack.h: Add idChanged().
* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::LoadableTextTrack): Add emptyString() for track id.
(WebCore::LoadableTextTrack::id): Override to return the track element's id.
* html/track/TextTrack.cpp:
(WebCore::TextTrack::captionMenuOffItem): Add empty string for track id.
(WebCore::TextTrack::captionMenuAutomaticItem): Add empty string for track id.
(WebCore::TextTrack::TextTrack): Pass id to TrackBase.
* html/track/TextTrack.h:
(WebCore::TextTrack::create): Add id parameter.
* html/track/TextTrack.idl: Add id attribute.
* html/track/TrackBase.cpp:
(WebCore::TrackBase::TrackBase): Add m_id.
* html/track/TrackBase.h: Add id attribute / m_id.
* html/track/VideoTrack.cpp:
(WebCore::VideoTrack::VideoTrack): Pass trackPrivate->id() to TrackBase.
(WebCore::VideoTrack::idChanged): Added, set id.
* html/track/VideoTrack.h: Move m_id to TrackBase.
* platform/graphics/TrackPrivateBase.h: Add idChanged() callback.

LayoutTests:

* media/track/track-id-expected.txt: Added.
* media/track/track-id.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158760 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix a Mountain Lion test failure.

NSURLRequest doesn't conform to NSSecureCoding on Mountain Lion, so don't try to test encoding it.

* TestWebKitAPI/Tests/WebKit2ObjC/WKRemoteObjectRegistry.mm:
(TestWebKitAPI::TEST):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158761 268f45cc-cd09-0410-ab3c-d52691b4dbfc
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