REGRESSION (r168046): Incorrect layout for multicol spanners when moving from one thread to another
https://bugs.webkit.org/show_bug.cgi?id=133589

Reviewed by Antti Koivisto.

Source/WebCore:
When a spanner is moved from a multicol thread to another, its placeholder
must be properly repositioned.

Test: fast/multicol/newmulticol/spanner-crash.html

* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::flowThreadDescendantInserted):

LayoutTests:
* fast/multicol/newmulticol/spanner-crash-expected.txt: Added.
* fast/multicol/newmulticol/spanner-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170010 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Convert ASSERT in inlineFunctionForCapabilityLevel to early return
https://bugs.webkit.org/show_bug.cgi?id=133903

Reviewed by Mark Hahnenberg.

Hardened code by Converting ASSERT to return CannotCompile.

* dfg/DFGCapabilities.h:
(JSC::DFG::inlineFunctionForCapabilityLevel):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170011 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Page::findStringMatchingRanges() should take Vector<RefPtr<Range>> by reference instead of pointer
https://bugs.webkit.org/show_bug.cgi?id=133677

Reviewed by Anders Carlsson.


Source/WebCore: 
* WebCore.exp.in: Update the changed symbol.
* page/Page.cpp:
(WebCore::Page::findStringMatchingRanges): The method expects the matchRanges parameter to be non-null,
so it should take in that parameter by reference instead of pointer.
* page/Page.h:

Source/WebKit2: 
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::findString): Update the call to Page::findStringMatchingRanges() to pass
in a Vector<RefPtr<Range>> reference instead of a pointer.
(WebKit::FindController::findStringMatches): Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170012 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Have ScriptExecutionContext::Task functions take in a ScriptExecutionContext reference
https://bugs.webkit.org/show_bug.cgi?id=133795

Reviewed by Andreas Kling.

The pointer to the ScriptExecutionContext object that is passed to the C++11 lambdas or
helper functions wrapped in ScriptExecutionContext::Task is never null, so that parameter
should be a reference instead.

* Modules/webdatabase/Database.cpp:
(WebCore::Database::~Database):
(WebCore::Database::runTransaction):
(WebCore::Database::scheduleTransactionCallback):
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::openDatabase):
* Modules/webdatabase/SQLCallbackWrapper.h:
(WebCore::SQLCallbackWrapper::clear):
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
(WebCore::ThreadableWebSocketChannelClientWrapper::processPendingTasksCallback):
(WebCore::ThreadableWebSocketChannelClientWrapper::processPendingTasks): Dereference the
member variable that holds a never-null pointer to the ScriptExecutionContext. This should
similarly be a reference.
(WebCore::ThreadableWebSocketChannelClientWrapper::didConnectCallback):
(WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessageCallback):
(WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveBinaryDataCallback):
(WebCore::ThreadableWebSocketChannelClientWrapper::didUpdateBufferedAmountCallback):
(WebCore::ThreadableWebSocketChannelClientWrapper::didStartClosingHandshakeCallback):
(WebCore::ThreadableWebSocketChannelClientWrapper::didCloseCallback):
(WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveMessageErrorCallback):
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
(WebCore::workerGlobalScopeDidSend):
(WebCore::workerGlobalScopeDidGetBufferedAmount):
(WebCore::workerGlobalScopeDidConnect):
(WebCore::workerGlobalScopeDidReceiveMessage):
(WebCore::workerGlobalScopeDidReceiveBinaryData):
(WebCore::workerGlobalScopeDidUpdateBufferedAmount):
(WebCore::workerGlobalScopeDidStartClosingHandshake):
(WebCore::workerGlobalScopeDidClose):
(WebCore::workerGlobalScopeDidReceiveMessageError):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadInitialize):
(WebCore::WorkerThreadableWebSocketChannel::mainThreadConnect):
(WebCore::WorkerThreadableWebSocketChannel::mainThreadSend):
(WebCore::WorkerThreadableWebSocketChannel::mainThreadSendArrayBuffer):
(WebCore::WorkerThreadableWebSocketChannel::mainThreadSendBlob):
(WebCore::WorkerThreadableWebSocketChannel::mainThreadBufferedAmount):
(WebCore::WorkerThreadableWebSocketChannel::mainThreadClose):
(WebCore::WorkerThreadableWebSocketChannel::mainThreadFail):
(WebCore::WorkerThreadableWebSocketChannel::mainThreadDestroy):
(WebCore::WorkerThreadableWebSocketChannel::mainThreadSuspend):
(WebCore::WorkerThreadableWebSocketChannel::mainThreadResume):
* Modules/websockets/WorkerThreadableWebSocketChannel.h:
* bindings/js/JSCallbackData.h:
(WebCore::DeleteCallbackDataTask::DeleteCallbackDataTask):
* bindings/js/JSDOMGlobalObjectTask.cpp:
(WebCore::JSGlobalObjectTask::JSGlobalObjectTask):
* dom/Document.cpp:
(WebCore::Document::postTask):
(WebCore::Document::pendingTasksTimerFired):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::processMessagePortMessagesSoon):
* dom/ScriptExecutionContext.h:
(WebCore::ScriptExecutionContext::Task::performTask):
(WebCore::ScriptExecutionContext::AddConsoleMessageTask::AddConsoleMessageTask):
* dom/StringCallback.cpp:
(WebCore::StringCallback::scheduleCallback):
* fileapi/FileReader.cpp:
(WebCore::delayedAbort):
(WebCore::FileReader::abort):
(WebCore::FileReader::doAbort): Deleted.
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::mainThreadCreateLoader):
(WebCore::WorkerThreadableLoader::MainThreadBridge::mainThreadDestroy):
(WebCore::WorkerThreadableLoader::MainThreadBridge::mainThreadCancel):
(WebCore::workerGlobalScopeDidSendData):
(WebCore::workerGlobalScopeDidReceiveResponse):
(WebCore::workerGlobalScopeDidReceiveData):
(WebCore::workerGlobalScopeDidFinishLoading):
(WebCore::workerGlobalScopeDidFail):
(WebCore::workerGlobalScopeDidFailAccessControlCheck):
(WebCore::workerGlobalScopeDidFailRedirectCheck):
* loader/WorkerThreadableLoader.h:
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::postListenerTask):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::crossThreadRemoveRequestFromCache):
(WebCore::MemoryCache::crossThreadRemoveRequestFromSessionCaches):
* loader/cache/MemoryCache.h:
* workers/DefaultSharedWorkerRepository.cpp:
(WebCore::SharedWorkerProxy::postExceptionToWorkerObject):
(WebCore::SharedWorkerProxy::postConsoleMessageToWorkerObject):
(WebCore::SharedWorkerConnectTask::SharedWorkerConnectTask):
* workers/WorkerEventQueue.cpp:
(WebCore::WorkerEventQueue::enqueueEvent):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::close):
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
(WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope):
(WebCore::WorkerMessagingProxy::postExceptionToWorkerObject):
(WebCore::WorkerMessagingProxy::postConsoleMessageToWorkerObject):
(WebCore::WorkerMessagingProxy::workerObjectDestroyed):
(WebCore::WorkerMessagingProxy::notifyNetworkStateChange):
(WebCore::WorkerMessagingProxy::connectToInspector):
(WebCore::WorkerMessagingProxy::disconnectFromInspector):
(WebCore::WorkerMessagingProxy::sendMessageToInspector):
(WebCore::WorkerMessagingProxy::workerGlobalScopeDestroyed):
(WebCore::WorkerMessagingProxy::workerGlobalScopeClosed):
(WebCore::WorkerMessagingProxy::postMessageToPageInspector):
(WebCore::WorkerMessagingProxy::confirmMessageFromWorkerObject):
(WebCore::WorkerMessagingProxy::reportPendingActivity):
* workers/WorkerRunLoop.cpp:
(WebCore::WorkerRunLoop::Task::performTask):
* workers/WorkerScriptLoader.cpp:
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::stop):
(WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170013 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MSE][Mac] Occasional image corruption after seeking
https://bugs.webkit.org/show_bug.cgi?id=133879

Reviewed by Eric Carlson.

Change the order of operations for seeks: change the current time of the AVSampleBufferRenderSynchronizer
before flushing and appending non-displaying samples.

Rather than having a single function which retrieves the fast seek time and then seeks, split this out
into two functions: one which gets the fast seek time, and one which seeks. (The later of course already
exists: seekToTime()).

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::fastSeekTimeForMediaTime): Renamed from seekToTime()
(WebCore::MediaSourcePrivateAVFObjC::seekToTime): Deleted.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
"nullable" sequence support is incomplete (i.e. sequence<NativeType>?) https://bugs.webkit.org/show_bug.cgi?id=131240

eeviewed by Darin Adler.
Patch by Antonio Gomes <a1.gomes@sisa.samsung.com>

Nullable sequences are not fully supported in WebKit's
code generator machinery. Although the generated code
does add "is nullable" check to the evaluation condition
(i.e. if (arg.isNull() || ...)), when the JSValue
that holds a "null" JSObject is actually to be "converted"
to a native Vector<T>, it fails.

The reason for the failure is in JSDOMBindings::toNativeArray.
This method verifies that JSValue does not hold a "non-null"
object, and it bails out.
Analogly, the "ref ptr" variant of this method (toRefPtrNativeArray)
does support nullables.

Patch fixes it be checking for a "null" JSValue check before hand.

Tests: Binding tests updated.

* bindings/js/JSDOMBinding.h:
(WebCore::toNativeArray):
* bindings/scripts/CodeGeneratorJS.pm:
(JSValueToNative):
* Modules/websocket/WebSocket.idl:
Removed one overload ctor now that
we can use nullable sequences.

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