Animated images are not restarted when page visibility changes
https://bugs.webkit.org/show_bug.cgi?id=122464
<rdar://problem/14293474>

Reviewed by Simon Fraser.

Always kickstart animated images when the page visibility changes,
which can occur via window occlusion, and which is independent of in-window
state, which we were previously using to advance animation.

No new tests; attempts to make a test have resulted only in a flaky, timing-dependent test.

* page/Frame.cpp:
(WebCore::Frame::resumeActiveDOMObjectsAndAnimations):
Move this call to resumeAnimatingImages() up to Page.

* page/FrameView.cpp:
(WebCore::FrameView::setIsInWindow):
Move this call to resumeAnimatingImages() up to Page.

* WebCore.exp.in
* page/FrameView.h:
* page/Page.h:
Move resumeAnimatingImages() itself up to Page.

* page/Page.cpp:
(WebCore::Page::setIsInWindow):
Resume animated images when we move in-window.

(WebCore::Page::setVisibilityState):
Resume animated images when we become visible.
This is the one we were previously missing.

(WebCore::Page::resumeActiveDOMObjectsAndAnimations):
Resume animated images when we're told to.

(WebCore::Page::resumeAnimatingImages):
Kickstart any animated images in all frames.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157056 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Always force discrete mode when running layout tests
https://bugs.webkit.org/show_bug.cgi?id=122465

Reviewed by Tim Horton.

This should speed up WebGL tests and hopefully prevent race conditions that may cause window server crashes from happening.

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
Link with IOKit.

* DumpRenderTree/mac/LayoutTestHelper.m:
(installLayoutTestColorProfile):
Check installColorProfile.

(restoreUserColorProfile):
Check installColorProfile.

(lockDownDiscreteGraphics):
New function to force discrete graphics.

(main):
Add '--install-color-profile' option.

* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager._set_up_run):
Always start the helper, but pass self._options.pixel_tests to it.

* Scripts/webkitpy/port/mac.py:
(MacPort.start_helper):
Pass --install-color-profile' to the helper if pixel_tests is true.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CTTE: Use references in and around DragController
https://bugs.webkit.org/show_bug.cgi?id=122427

Patch by Sam Weinig <sam@webkit.org> on 2013-10-07
Reviewed by Andreas Kling.

Source/WebCore:

Use references to indicate non-nullness of DragController related
objects.

Source/WebKit/efl:

* WebCoreSupport/DragClientEfl.cpp:
(WebCore::DragClientEfl::willPerformDragDestinationAction):
(WebCore::DragClientEfl::willPerformDragSourceAction):
(WebCore::DragClientEfl::actionMaskForDrag):
(WebCore::DragClientEfl::startDrag):
* WebCoreSupport/DragClientEfl.h:

Source/WebKit/gtk:

* WebCoreSupport/DragClientGtk.cpp:
(WebKit::DragClient::willPerformDragDestinationAction):
(WebKit::DragClient::willPerformDragSourceAction):
(WebKit::DragClient::actionMaskForDrag):
(WebKit::DragClient::startDrag):
* WebCoreSupport/DragClientGtk.h:
* webkit/webkitwebview.cpp:
(dragExitedCallback):
(webkit_web_view_drag_motion):
(webkit_web_view_drag_data_received):
(webkit_web_view_drag_drop):

Source/WebKit/mac:

* WebCoreSupport/WebDragClient.h:
* WebCoreSupport/WebDragClient.mm:
(WebDragClient::actionMaskForDrag):
(WebDragClient::willPerformDragDestinationAction):
(WebDragClient::willPerformDragSourceAction):
(WebDragClient::startDrag):
(WebDragClient::declareAndWriteDragImage):
* WebView/WebFrame.mm:
(-[WebFrame _replaceSelectionWithText:selectReplacement:smartReplace:]):
* WebView/WebHTMLView.mm:
(-[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:subresources:]):
* WebView/WebView.mm:
(-[WebView draggingEntered:]):
(-[WebView draggingUpdated:]):
(-[WebView draggingExited:]):
(-[WebView performDragOperation:]):

Source/WebKit/win:

* WebCoreSupport/WebDragClient.cpp:
(WebDragClient::actionMaskForDrag):
(WebDragClient::willPerformDragDestinationAction):
(WebDragClient::willPerformDragSourceAction):
(WebDragClient::startDrag):
* WebCoreSupport/WebDragClient.h:

Source/WebKit2:

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseDragDataReceived):
(webkitWebViewBaseDragMotion):
(dragExitedCallback):
(webkitWebViewBaseDragDrop):
* UIProcess/API/mac/WKView.mm:
(-[WKView draggingEntered:]):
(-[WKView draggingUpdated:]):
(-[WKView draggingExited:]):
(-[WKView performDragOperation:]):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::dragEntered):
(WebKit::WebPageProxy::dragUpdated):
(WebKit::WebPageProxy::dragExited):
(WebKit::WebPageProxy::performDrag):
(WebKit::WebPageProxy::performDragControllerAction):
* UIProcess/WebPageProxy.h:
* WebProcess/WebCoreSupport/WebDragClient.cpp:
(WebKit::WebDragClient::willPerformDragDestinationAction):
(WebKit::WebDragClient::willPerformDragSourceAction):
(WebKit::WebDragClient::actionMaskForDrag):
(WebKit::WebDragClient::dragSourceActionMaskForPoint):
(WebKit::WebDragClient::startDrag):
* WebProcess/WebCoreSupport/WebDragClient.h:
* WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
(WebKit::WebDragClient::startDrag):
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::startDrag):
(WebKit::cachedImage):
(WebKit::WebDragClient::declareAndWriteDragImage):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::performDragControllerAction):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157058 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FTL: Optimize IsString(@2<String>) -> JSConst(true) + Phantom()
https://bugs.webkit.org/show_bug.cgi?id=122363

Patch by Nadav Rotem <nrotem@apple.com> on 2013-10-07
Reviewed by Filip Pizlo.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157059 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modify WTF and JavaScriptCore makefiles for x64 build.
https://bugs.webkit.org/show_bug.cgi?id=122467.
<rdar://problem/15169174>.

Reviewed by Brent Fulgham.

* WTF.vcxproj/WTF.make:
* JavaScriptCore.vcxproj/JavaScriptCore.make:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157060 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Clean up ScriptExecutionContext::Task and subclasses
https://bugs.webkit.org/show_bug.cgi?id=122469

Reviewed by Andreas Kling.

* Modules/webdatabase/Database.cpp:
(WebCore::DerefContextTask::DerefContextTask):
(WebCore::Database::~Database):
(WebCore::DeliverPendingCallbackTask::DeliverPendingCallbackTask):
(WebCore::Database::scheduleTransactionCallback):
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseCreationCallbackTask::DatabaseCreationCallbackTask):
(WebCore::DatabaseManager::openDatabase):
* Modules/webdatabase/SQLCallbackWrapper.h:
(WebCore::SQLCallbackWrapper::clear):
(WebCore::SQLCallbackWrapper::SafeReleaseTask::SafeReleaseTask):
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
(WebCore::ThreadableWebSocketChannelClientWrapper::processPendingTasks):
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
(WebCore::WorkerThreadableWebSocketChannel::WorkerGlobalScopeDidInitializeTask::WorkerGlobalScopeDidInitializeTask):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadInitialize):
* bindings/js/JSCallbackData.h:
(WebCore::DeleteCallbackDataTask::DeleteCallbackDataTask):
* bindings/js/JSDOMGlobalObjectTask.h:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::queueTaskToEventLoop):
* bindings/js/JSWorkerGlobalScopeBase.cpp:
(WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateCallbackImplementation):
* dom/CrossThreadTask.h:
(WebCore::createCallbackTask):
* dom/Document.cpp:
(WebCore::Document::addConsoleMessage):
(WebCore::Document::addMessage):
(WebCore::PerformTaskContext::PerformTaskContext):
(WebCore::Document::postTask):
(WebCore::Document::pendingTasksTimerFired):
* dom/Document.h:
* dom/ScriptExecutionContext.cpp:
(WebCore::ProcessMessagesSoonTask::ProcessMessagesSoonTask):
(WebCore::ScriptExecutionContext::processMessagePortMessagesSoon):
* dom/ScriptExecutionContext.h:
* dom/StringCallback.cpp:
(WebCore::StringCallback::scheduleCallback):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::CallCacheListenerTask::CallCacheListenerTask):
(WebCore::ApplicationCacheGroup::postListenerTask):
* workers/DefaultSharedWorkerRepository.cpp:
(WebCore::SharedWorkerProxy::postTaskToLoader):
(WebCore::SharedWorkerProxy::postTaskForModeToWorkerGlobalScope):
(WebCore::DefaultSharedWorkerRepository::workerScriptLoaded):
(WebCore::DefaultSharedWorkerRepository::connectToWorker):
* workers/WorkerEventQueue.cpp:
(WebCore::WorkerEventQueue::enqueueEvent):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::close):
(WebCore::WorkerGlobalScope::postTask):
(WebCore::WorkerGlobalScope::addConsoleMessage):
(WebCore::WorkerGlobalScope::addMessage):
* workers/WorkerGlobalScope.h:
* workers/WorkerLoaderProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
(WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope):
(WebCore::WorkerMessagingProxy::postTaskForModeToWorkerGlobalScope):
(WebCore::WorkerMessagingProxy::postTaskToLoader):
(WebCore::WorkerMessagingProxy::postExceptionToWorkerObject):
(WebCore::WorkerMessagingProxy::workerThreadCreated):
(WebCore::WorkerMessagingProxy::notifyNetworkStateChange):
(WebCore::WorkerMessagingProxy::workerGlobalScopeDestroyed):
(WebCore::WorkerMessagingProxy::workerGlobalScopeClosed):
(WebCore::WorkerMessagingProxy::postMessageToPageInspector):
(WebCore::WorkerMessagingProxy::confirmMessageFromWorkerObject):
(WebCore::WorkerMessagingProxy::reportPendingActivity):
* workers/WorkerMessagingProxy.h:
* workers/WorkerRunLoop.cpp:
(WebCore::WorkerRunLoop::postTask):
(WebCore::WorkerRunLoop::postTaskAndTerminate):
(WebCore::WorkerRunLoop::postTaskForMode):
(WebCore::WorkerRunLoop::Task::Task):
* workers/WorkerRunLoop.h:
* workers/WorkerThread.cpp:
(WebCore::WorkerThreadShutdownFinishTask::WorkerThreadShutdownFinishTask):
(WebCore::WorkerThreadShutdownStartTask::performTask):
(WebCore::WorkerThread::stop):
(WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FTL memory allocator should be able to allocate data sections in non-executable memory
https://bugs.webkit.org/show_bug.cgi?id=116189

Reviewed by Sam Weinig.
        
Use a RefCountedArray<int64_t> for data sections. This works out great because
RefCountedArray<> knows its own size and because the reference counting makes passing
it around very easy (you don't have to stress out about ownership).

* ftl/FTLCompile.cpp:
(JSC::FTL::mmAllocateDataSection):
(JSC::FTL::compile):
* ftl/FTLJITCode.cpp:
(JSC::FTL::JITCode::addDataSection):
* ftl/FTLJITCode.h:
(JSC::FTL::JITCode::dataSections):



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

* Scripts/webkitpy/port/base.py:
(Port.to.start_helper):
* Scripts/webkitpy/port/mock_drt.py:
(MockDRTPort.start_helper):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157063 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reduce duplicated code in WebPageProxy
https://bugs.webkit.org/show_bug.cgi?id=122230

Patch by Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> on 2013-10-07
Reviewed by Darin Adler.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close): move duplicate code to resetState and call it.
(WebKit::WebPageProxy::resetState): new private method for code that is shared between
close and resetStateAfterProcessExited.
(WebKit::WebPageProxy::resetStateAfterProcessExited): move duplicate code to resetState
and call it.
* UIProcess/WebPageProxy.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157064 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CTTE: Live node lists always have an owner Node.
<https://webkit.org/b/122470>

Reviewed by Anders Carlsson.

Make LiveNodeListBase::m_ownerNode a Ref<Node> instead of a RefPtr
and have all constructors take Node&.

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

* wtf/StdLibExtras.h:
(std::make_unique):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Missing packages for APT on install-dependencies
https://bugs.webkit.org/show_bug.cgi?id=121555

Patch by Gustavo Noronha Silva <gns@gnome.org> on 2013-10-07
Reviewed by Martin Robinson.

* gtk/install-dependencies: add packages that are needed for
building WebKit itself and the jhbuild dependencies.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157067 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MediaStream API] update MediaStreamTrack object to match spec
https://bugs.webkit.org/show_bug.cgi?id=121940

Reviewed by Jer Noble.

Source/WebCore: 

No new tests, existing test updated.

Add new source files to the project:
* CMakeLists.txt:
* DerivedSources.make:
* GNUmakefile.list.am:
* WebCore.xcodeproj/project.pbxproj:

New capability dictionary objects:
* Modules/mediastream/AllAudioCapabilities.h: Added.
* Modules/mediastream/AllAudioCapabilities.idl: Added.
* Modules/mediastream/AllVideoCapabilities.h: Added.
* Modules/mediastream/AllVideoCapabilities.idl: Added.

* Modules/mediastream/AudioStreamTrack.cpp:
(WebCore::AudioStreamTrack::create): New version that takes a MediaStreamTrack*.
* Modules/mediastream/AudioStreamTrack.h:

New object for a capability range:
* Modules/mediastream/CapabilityRange.cpp: Added.
* Modules/mediastream/CapabilityRange.h: Added.
* Modules/mediastream/CapabilityRange.idl: Added.

* Modules/mediastream/MediaConstraintsImpl.h: Make initialize() public.

New object for the current states for a media source.
* Modules/mediastream/MediaSourceStates.cpp: Added.
* Modules/mediastream/MediaSourceStates.h: Added.
* Modules/mediastream/MediaSourceStates.idl: Added.

Don't call the media stream center to notify it when the state of other
objects change.
* Modules/mediastream/MediaStream.cpp:
(WebCore::processTrack): Remove the stream source duplication hack.
(WebCore::createFromSourceVectors): 
(WebCore::MediaStream::MediaStream):
(WebCore::MediaStream::addTrack):
(WebCore::MediaStream::removeTrack):
* Modules/mediastream/MediaStream.h:

New object for the capabilities of a source.
* Modules/mediastream/MediaStreamCapabilities.cpp: Added.
* Modules/mediastream/MediaStreamCapabilities.h: Added.
* Modules/mediastream/MediaStreamCapabilities.idl: Added.

Update interface to match spec.
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::MediaStreamTrack): Define a copy constructor to use in clone().
(WebCore::MediaStreamTrack::setSource): Call removeObserver if the track already has a source.
    Initialize m_muted from new source's muted state.
(WebCore::MediaStreamTrack::id): Allow source to provide ID as the spec suggests.
(WebCore::MediaStreamTrack::setEnabled): Add some spec text to clarify logic. Always call
    source->setEnabled, it can figure out if nothing needs to be done.
(WebCore::MediaStreamTrack::muted): Don't call the stream center when muted changes, the
    source can take care of notifying interested parties.
(WebCore::MediaStreamTrack::readonly): New.
(WebCore::MediaStreamTrack::remote): New.
(WebCore::MediaStreamTrack::constraints): New. 
(WebCore::MediaStreamTrack::states): New.
(WebCore::MediaStreamTrack::capabilities): New.
(WebCore::MediaStreamTrack::applyConstraints): New.
(WebCore::MediaStreamTrack::clone): New.
(WebCore::MediaStreamTrack::stopProducingData): New.
(WebCore::MediaStreamTrack::sourceStateChanged): Renamed from sourceChangedState.
(WebCore::MediaStreamTrack::sourceMutedChanged): New.
(WebCore::MediaStreamTrack::sourceEnabledChanged): New.
(WebCore::MediaStreamTrack::configureTrackRendering): New.
(WebCore::MediaStreamTrack::stopped): New. 
(WebCore::MediaStreamTrack::stop): Call stopProducingData.
(WebCore::MediaStreamTrack::scheduleEventDispatch): New.
(WebCore::MediaStreamTrack::dispatchQueuedEvents): New.
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/MediaStreamTrack.idl:

* Modules/mediastream/MediaTrackConstraint.cpp: Added.
* Modules/mediastream/MediaTrackConstraint.h: Added.
* Modules/mediastream/MediaTrackConstraint.idl: Added.

// Add empty classes/IDL for track constraint objects.
* Modules/mediastream/MediaTrackConstraintSet.cpp: Added.
* Modules/mediastream/MediaTrackConstraintSet.h: Added.
* Modules/mediastream/MediaTrackConstraintSet.idl: Added.
* Modules/mediastream/MediaTrackConstraints.cpp: Added.
* Modules/mediastream/MediaTrackConstraints.h: Added.
* Modules/mediastream/MediaTrackConstraints.idl: Added.

* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::callSuccessHandler): Don't call the stream center, the
    stream can take care of notifying interested parties.

// Add a constructor and create() that take a MediaStreamTrack*.
* Modules/mediastream/VideoStreamTrack.cpp:
(WebCore::VideoStreamTrack::create): 
(WebCore::VideoStreamTrack::VideoStreamTrack):
* Modules/mediastream/VideoStreamTrack.h:

// Create a MediaStreamSource subclass for WebAudio
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::createMediaStreamSource): Call isAudioStreamSource instead
    of checking deviceID.
* Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
(WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode): Create a
    MediaStreamAudioSource instead of a MediaStreamSource.
* Modules/webaudio/MediaStreamAudioDestinationNode.h:
* Modules/webaudio/MediaStreamAudioSource.cpp: Added.
* Modules/webaudio/MediaStreamAudioSource.h: Added.
(WebCore::MediaStreamAudioSource::~MediaStreamAudioSource):

// Add new generated files.
* bindings/js/JSMediaSourceStatesCustom.cpp: Added.
* bindings/js/JSMediaStreamCapabilitiesCustom.cpp: Added.

* dom/EventNames.h: Defined 'overconstrained' event.

* platform/mediastream/MediaStreamCenter.h: Get rid of all of the methods nobody uses.
    It isn't clear that they are necessary, and we can add them back if/when we need them.

* platform/mediastream/MediaStreamDescriptor.cpp:
(WebCore::MediaStreamDescriptor::~MediaStreamDescriptor): Clear the all source streams.
(WebCore::MediaStreamDescriptor::removeSource): Clear the source stream.
* platform/mediastream/MediaStreamDescriptor.h:

// Make MediaStreamSource an abstract base class, and remove everyting WebAudio-specific
//  to MediaStreamAudioSource. 
* platform/mediastream/MediaStreamSource.cpp:
(WebCore::MediaStreamSource::MediaStreamSource): Remove readyState and requiresConsumer
    parameters. Create new UUID for id if non was passed.
(WebCore::MediaStreamSource::reset): Reset internal state to just-constructed. Used for testing.
(WebCore::MediaStreamSource::setReadyState): sourceChangedState -> sourceStateChanged.
(WebCore::MediaStreamSource::setStream): Remove the ASSERT that check for a source being
    added to a new stream. This is still a problem, but it is required for testing and will
    be fixed as a part of bug 121954.
(WebCore::MediaStreamSource::setConstraints): Added.
(WebCore::MediaStreamSource::setMuted): Notify observers when muted changes.
(WebCore::MediaStreamSource::setEnabled): Notify observers when enabled changes.
(WebCore::MediaStreamSource::readonly): New.
(WebCore::MediaStreamSource::stop): New. Set state to Ended when all of the observers has
    stopped.
* platform/mediastream/MediaStreamSource.h:

// Define platform versions of the Capabilities classes.
* platform/mediastream/MediaStreamSourceCapabilities.h: Added.

// Update the non-functional platform stream centers for the API changes.
* platform/mediastream/blackberry/MediaStreamCenterBlackBerry.cpp:
* platform/mediastream/blackberry/MediaStreamCenterBlackBerry.h:
* platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp:
* platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h:
* platform/mediastream/mac/MediaStreamCenterMac.cpp:
* platform/mediastream/mac/MediaStreamCenterMac.h:

// Update the Mock stream center for the API changes. Add a concrete mock MediaStreamSource
//  subclass.
* platform/mock/MockMediaStreamCenter.cpp:
(WebCore::MockSource::MockSource): New, the mock media stream source.
(WebCore::MockSource::~MockSource):
(WebCore::MockSource::capabilities):
(WebCore::MockSource::states):
(WebCore::mockSourceMap):
(WebCore::mockAudioSourceID):
(WebCore::mockVideoSourceID):
(WebCore::initializeMockSources): Create one audio and one video mock source.
(WebCore::MockMediaStreamCenter::registerMockMediaStreamCenter): Call initializeMockSources.
(WebCore::MockMediaStreamCenter::createMediaStream): Use the already allocated mock media
    sources.
(WebCore::MockMediaStreamCenter::getMediaStreamTrackSources): Ditto.
* platform/mock/MockMediaStreamCenter.h:

LayoutTests: 

* fast/mediastream/MediaStreamTrack-expected.txt:
* fast/mediastream/MediaStreamTrack.html:
* fast/mediastream/MediaStreamTrack-getSources-expected.txt:
* fast/mediastream/MediaStreamTrack-getSources.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157068 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] run-gtk-tests does not distinguish between failure and crashes
https://bugs.webkit.org/show_bug.cgi?id=122135

Patch by Gustavo Noronha Silva <gustavo.noronha@collabora.com> on 2013-10-07
Reviewed by Martin Robinson.

The GTK+ API test runner does not distinguish between failures and crashes. This change
makes it do that, so it's easier for us to spot the more important/higher priority crash
case.

* Scripts/run-gtk-tests:
(TestRunner._run_test_command): return the exit code instead of a boolean true/false,
so we have more information on how the process ended.
(TestRunner._run_test): check the exit code to distinguish between crashes and failures.
(TestRunner.run_tests): report crashes.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157069 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MathML] Remove RenderTree modification during layout and refactor the StretchyOp code
https://bugs.webkit.org/show_bug.cgi?id=121416

Source/WebCore:

Reviewed by David Hyatt.

Tests: mathml/presentation/mo-minus.html
       mathml/presentation/mo-stacked-glyphs.html
       mathml/presentation/mo-stretchy-vertical-bar.html
       mathml/very-large-stretchy-operators.html

MathML stretched operators by both modifying the width of the operator
and adding children to the operator node in the render tree.

Instead we make the operator width equal to the widest glyph possible that we use
to represent the operator.  Additionally instead of rendering stretchy glyphs via
stacked operator pieces in separate render tree nodes, keep only one node for the
glyph, and use a custom paint method to paint the stacked representation.

With this patch, rendering seems roughly equivalent on Mac and markedly better
on Linux.

* css/mathml.css:
Not sure what this line-height:0 was here for, but it caused bugs with the new code

* mathml/MathMLTextElement.cpp:
(WebCore::MathMLTextElement::attach):
(WebCore):
(WebCore::MathMLTextElement::childrenChanged):
Need to update the anonymous render tree below <mo> elements when their
children change or when the renderer is first attached.

* mathml/MathMLTextElement.h:
(MathMLTextElement):
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::RenderMathMLBlock):
* rendering/mathml/RenderMathMLBlock.h:
Now that the preferred width doesn't depend on the height, we don't
need to override computePreferredLogicalWidths at all.

* rendering/mathml/RenderMathMLFenced.cpp:
(WebCore::RenderMathMLFenced::makeFences):
(WebCore::RenderMathMLFenced::styleDidChange):
Need to update the anonymous renderers for the anonymous RenderMathMLOperators.

* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::expandedStretchHeight):
Store the non-expanded stretch height so that we can detect when the height
actually changed.

(WebCore::RenderMathMLOperator::stretchToHeight):
Only update the style on the anonymous render tree since this is called
from RenderMathMLRow::layout

(WebCore::RenderMathMLOperator::styleDidChange):
(WebCore::RenderMathMLOperator::glyphBoundsForCharacter): A helper to get glyph boundaries.
(WebCore::RenderMathMLOperator::glyphHeightForCharacter): Ditto for glyph width.
(WebCore::RenderMathMLOperator::advanceForCharacter): The advance is different from the width,
and we want the width of the operator to be the advance instead of the tight bounding width.
(WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Use the max of all possible glyphs
we can use to render this operator.
(WebCore::RenderMathMLOperator::computeLogicalHeight): Return the stretched operator height, if appropriate.
(WebCore::RenderMathMLOperator::updateFromElement): We add a child for rendering the non-scaled
version of the glyph.
(WebCore::RenderMathMLOperator::firstCharacterForStretching): Helper to figure out what character
is the character used for stretching operations.
(WebCore::RenderMathMLOperator::findAcceptableStretchyCharacter): Helper to find an acceptable set
of glyph pieces for stretching characters.
(WebCore::RenderMathMLOperator::updateStyle): Resize the operator to the appropriate height and hide
the child if we are using the stretchy style.
(WebCore::RenderMathMLOperator::firstLineBoxBaseline):
(WebCore::RenderMathMLOperator::paintCharacter): Helper to paint a single character component of the
stretchy glyph.
(WebCore::RenderMathMLOperator::fillWithExtensionGlyph): Helper to paint the extender glue between
features of the stretchy glyph.
(WebCore::RenderMathMLOperator::paint): Properly paint stretchy glyphs.
* rendering/mathml/RenderMathMLOperator.h: Update method declarations.

LayoutTests:

Patch by Frédéric Wang <fred.wang@free.fr> on 2013-10-04
Reviewed by David Hyatt.

Add some reftests for stretchy operators.

* TestExpectations: The remaining MathML pixel tests are broken by this patch.
* LayoutTests/platform/gtk/TestExpectations:
* LayoutTests/platform/mac/TestExpectations:
* LayoutTests/platform/win/TestExpectations:
* mathml/presentation/mo-minus.html: Added.
* mathml/presentation/mo-stacked-glyphs-expected.html: Added.
* mathml/presentation/mo-stacked-glyphs.html: Added.
* mathml/presentation/mo-stretchy-vertical-bar-expected-mismatch.html: Added.
* mathml/presentation/mo-stretchy-vertical-bar.html: Added.
* mathml/very-large-stretchy-operators-expected.txt: Added.
* mathml/very-large-stretchy-operators.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157070 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update test results.

* bindings/scripts/test/JS/JSTestCallback.cpp:
(WebCore::JSTestCallback::~JSTestCallback):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157071 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Skipping API test that is causing the next one to crash,
see https://bugs.webkit.org/show_bug.cgi?id=121970.

* Scripts/run-gtk-tests:
(TestRunner):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[buildbot] parse tests that are reported as crashed correctly for GTK+
https://bugs.webkit.org/show_bug.cgi?id=122476

Reviewed by Martin Robinson.

* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(RunGtkAPITests.commandComplete): parse the crashed tests output so that is reported
as a failure of the API tests.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157073 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make Vector::insert work for move-only types
https://bugs.webkit.org/show_bug.cgi?id=122429

Reviewed by Anders Carlsson.

Source/WebCore:

* history/HistoryItem.cpp:
(WebCore::HistoryItem::padDailyCountsForNewVisit): Call insertVector.
Also added some inline capacity, which should make this faster.

Source/WTF:

* wtf/Vector.h:
(WTF::Vector::insert): Take an rvalue reference instead of a const reference.
(WTF::Vector::insertVector): Renamed to avoid overloading troubles, analogous
to what we did for appendVector.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157074 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r157061.
http://trac.webkit.org/changeset/157061
https://bugs.webkit.org/show_bug.cgi?id=122479

Broke worker tests (Requested by andersca on #webkit).

* Modules/webdatabase/Database.cpp:
(WebCore::DerefContextTask::create):
(WebCore::DerefContextTask::DerefContextTask):
(WebCore::Database::~Database):
(WebCore::DeliverPendingCallbackTask::create):
(WebCore::DeliverPendingCallbackTask::performTask):
(WebCore::DeliverPendingCallbackTask::DeliverPendingCallbackTask):
(WebCore::Database::scheduleTransactionCallback):
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseCreationCallbackTask::create):
(WebCore::DatabaseCreationCallbackTask::performTask):
(WebCore::DatabaseCreationCallbackTask::DatabaseCreationCallbackTask):
(WebCore::DatabaseManager::openDatabase):
* Modules/webdatabase/SQLCallbackWrapper.h:
(WebCore::SQLCallbackWrapper::clear):
(WebCore::SQLCallbackWrapper::SafeReleaseTask::create):
(WebCore::SQLCallbackWrapper::SafeReleaseTask::performTask):
(WebCore::SQLCallbackWrapper::SafeReleaseTask::isCleanupTask):
(WebCore::SQLCallbackWrapper::SafeReleaseTask::SafeReleaseTask):
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
(WebCore::ThreadableWebSocketChannelClientWrapper::processPendingTasks):
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
(WebCore::WorkerThreadableWebSocketChannel::WorkerGlobalScopeDidInitializeTask::create):
(WebCore::WorkerThreadableWebSocketChannel::WorkerGlobalScopeDidInitializeTask::~WorkerGlobalScopeDidInitializeTask):
(WebCore::WorkerThreadableWebSocketChannel::WorkerGlobalScopeDidInitializeTask::WorkerGlobalScopeDidInitializeTask):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadInitialize):
* bindings/js/JSCallbackData.h:
(WebCore::DeleteCallbackDataTask::create):
(WebCore::DeleteCallbackDataTask::performTask):
(WebCore::DeleteCallbackDataTask::isCleanupTask):
(WebCore::DeleteCallbackDataTask::DeleteCallbackDataTask):
* bindings/js/JSDOMGlobalObjectTask.h:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::queueTaskToEventLoop):
* bindings/js/JSWorkerGlobalScopeBase.cpp:
(WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateCallbackImplementation):
* dom/CrossThreadTask.h:
(WebCore::CrossThreadTask1::create):
(WebCore::CrossThreadTask1::performTask):
(WebCore::CrossThreadTask2::create):
(WebCore::CrossThreadTask2::performTask):
(WebCore::CrossThreadTask3::create):
(WebCore::CrossThreadTask3::performTask):
(WebCore::CrossThreadTask4::create):
(WebCore::CrossThreadTask4::performTask):
(WebCore::CrossThreadTask5::create):
(WebCore::CrossThreadTask5::performTask):
(WebCore::CrossThreadTask6::create):
(WebCore::CrossThreadTask6::performTask):
(WebCore::CrossThreadTask7::create):
(WebCore::CrossThreadTask7::performTask):
(WebCore::CrossThreadTask8::create):
(WebCore::CrossThreadTask8::performTask):
(WebCore::createCallbackTask):
* dom/Document.cpp:
(WebCore::Document::addConsoleMessage):
(WebCore::Document::addMessage):
(WebCore::PerformTaskContext::PerformTaskContext):
(WebCore::Document::postTask):
(WebCore::Document::pendingTasksTimerFired):
* dom/Document.h:
* dom/ScriptExecutionContext.cpp:
(WebCore::ProcessMessagesSoonTask::create):
(WebCore::ProcessMessagesSoonTask::performTask):
(WebCore::ScriptExecutionContext::processMessagePortMessagesSoon):
* dom/ScriptExecutionContext.h:
(WebCore::ScriptExecutionContext::AddConsoleMessageTask::create):
(WebCore::ScriptExecutionContext::AddConsoleMessageTask::AddConsoleMessageTask):
* dom/StringCallback.cpp:
(WebCore::StringCallback::scheduleCallback):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::CallCacheListenerTask::create):
(WebCore::CallCacheListenerTask::CallCacheListenerTask):
(WebCore::ApplicationCacheGroup::postListenerTask):
* workers/DefaultSharedWorkerRepository.cpp:
(WebCore::SharedWorkerProxy::postTaskToLoader):
(WebCore::SharedWorkerProxy::postTaskForModeToWorkerGlobalScope):
(WebCore::SharedWorkerConnectTask::create):
(WebCore::SharedWorkerConnectTask::performTask):
(WebCore::DefaultSharedWorkerRepository::workerScriptLoaded):
(WebCore::DefaultSharedWorkerRepository::connectToWorker):
* workers/WorkerEventQueue.cpp:
(WebCore::WorkerEventQueue::enqueueEvent):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::close):
(WebCore::WorkerGlobalScope::postTask):
(WebCore::WorkerGlobalScope::addConsoleMessage):
(WebCore::WorkerGlobalScope::addMessage):
* workers/WorkerGlobalScope.h:
* workers/WorkerLoaderProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::MessageWorkerGlobalScopeTask::create):
(WebCore::MessageWorkerGlobalScopeTask::performTask):
(WebCore::MessageWorkerTask::create):
(WebCore::MessageWorkerTask::performTask):
(WebCore::WorkerExceptionTask::create):
(WebCore::WorkerExceptionTask::performTask):
(WebCore::WorkerGlobalScopeDestroyedTask::create):
(WebCore::WorkerGlobalScopeDestroyedTask::performTask):
(WebCore::WorkerTerminateTask::create):
(WebCore::WorkerTerminateTask::WorkerTerminateTask):
(WebCore::WorkerTerminateTask::performTask):
(WebCore::WorkerThreadActivityReportTask::create):
(WebCore::WorkerThreadActivityReportTask::performTask):
(WebCore::PostMessageToPageInspectorTask::create):
(WebCore::PostMessageToPageInspectorTask::performTask):
(WebCore::NotifyNetworkStateChangeTask::create):
(WebCore::NotifyNetworkStateChangeTask::NotifyNetworkStateChangeTask):
(WebCore::NotifyNetworkStateChangeTask::performTask):
(WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
(WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope):
(WebCore::WorkerMessagingProxy::postTaskForModeToWorkerGlobalScope):
(WebCore::WorkerMessagingProxy::postTaskToLoader):
(WebCore::WorkerMessagingProxy::postExceptionToWorkerObject):
(WebCore::WorkerMessagingProxy::workerThreadCreated):
(WebCore::WorkerMessagingProxy::notifyNetworkStateChange):
(WebCore::WorkerMessagingProxy::workerGlobalScopeDestroyed):
(WebCore::WorkerMessagingProxy::workerGlobalScopeClosed):
(WebCore::WorkerMessagingProxy::postMessageToPageInspector):
(WebCore::WorkerMessagingProxy::confirmMessageFromWorkerObject):
(WebCore::WorkerMessagingProxy::reportPendingActivity):
* workers/WorkerMessagingProxy.h:
* workers/WorkerRunLoop.cpp:
(WebCore::WorkerRunLoop::postTask):
(WebCore::WorkerRunLoop::postTaskAndTerminate):
(WebCore::WorkerRunLoop::postTaskForMode):
(WebCore::WorkerRunLoop::Task::create):
(WebCore::WorkerRunLoop::Task::Task):
* workers/WorkerRunLoop.h:
* workers/WorkerThread.cpp:
(WebCore::WorkerThreadShutdownFinishTask::create):
(WebCore::WorkerThreadShutdownFinishTask::performTask):
(WebCore::WorkerThreadShutdownFinishTask::isCleanupTask):
(WebCore::WorkerThreadShutdownStartTask::performTask):
(WebCore::WorkerThread::stop):
(WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads):

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