Changing MediaStreamDescriptor to MediaStreamPrivate
https://bugs.webkit.org/show_bug.cgi?id=123935

Patch by Thiago de Barros Lacerda <thiago.lacerda@openbossa.org> on 2013-11-07
Reviewed by Eric Carlson.

Source/WebCore:

No new tests needed.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::create):
(WebCore::MediaStream::MediaStream):
(WebCore::MediaStream::~MediaStream):
(WebCore::MediaStream::ended):
(WebCore::MediaStream::setEnded):
(WebCore::MediaStream::addTrack):
(WebCore::MediaStream::removeTrack):
(WebCore::MediaStream::removeRemoteSource):
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/MediaStreamRegistry.cpp:
(WebCore::MediaStreamRegistry::registerURL):
(WebCore::MediaStreamRegistry::unregisterURL):
(WebCore::MediaStreamRegistry::lookupMediaStreamPrivate):
* Modules/mediastream/MediaStreamRegistry.h:
* Modules/mediastream/MediaStreamTrack.cpp:
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::addStream):
(WebCore::RTCPeerConnection::removeStream):
(WebCore::RTCPeerConnection::didAddRemoteStream):
(WebCore::RTCPeerConnection::didRemoveRemoteStream):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::didCreateStream):
(WebCore::UserMediaRequest::callSuccessHandler):
* Modules/mediastream/UserMediaRequest.h:
* Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
(WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
(HTMLMediaElement::loadResource):
* platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp:
(WebCore::toWebMediaStreamPrivate):
(WebCore::MediaPlayerPrivate::lookupMediaStream):
* platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h:
* platform/mediastream/MediaStreamCenter.cpp:
* platform/mediastream/MediaStreamCreationClient.h:
* platform/mediastream/MediaStreamPrivate.cpp: Renamed from Source/WebCore/platform/mediastream/MediaStreamDescriptor.cpp.
(WebCore::MediaStreamPrivate::create):
(WebCore::MediaStreamPrivate::addSource):
(WebCore::MediaStreamPrivate::removeSource):
(WebCore::MediaStreamPrivate::addRemoteSource):
(WebCore::MediaStreamPrivate::removeRemoteSource):
(WebCore::MediaStreamPrivate::addRemoteTrack):
(WebCore::MediaStreamPrivate::removeRemoteTrack):
(WebCore::MediaStreamPrivate::MediaStreamPrivate):
(WebCore::MediaStreamPrivate::setEnded):
(WebCore::MediaStreamPrivate::addTrack):
(WebCore::MediaStreamPrivate::removeTrack):
* platform/mediastream/MediaStreamPrivate.h: Renamed from Source/WebCore/platform/mediastream/MediaStreamDescriptor.h.
(WebCore::MediaStreamPrivateClient::~MediaStreamPrivateClient):
(WebCore::MediaStreamPrivate::~MediaStreamPrivate):
(WebCore::MediaStreamPrivate::client):
(WebCore::MediaStreamPrivate::setClient):
(WebCore::MediaStreamPrivate::id):
(WebCore::MediaStreamPrivate::numberOfAudioSources):
(WebCore::MediaStreamPrivate::audioSources):
(WebCore::MediaStreamPrivate::numberOfVideoSources):
(WebCore::MediaStreamPrivate::videoSources):
(WebCore::MediaStreamPrivate::numberOfAudioTracks):
(WebCore::MediaStreamPrivate::audioTracks):
(WebCore::MediaStreamPrivate::numberOfVideoTracks):
(WebCore::MediaStreamPrivate::videoTracks):
(WebCore::MediaStreamPrivate::ended):
* platform/mediastream/MediaStreamSource.cpp:
* platform/mediastream/MediaStreamSource.h:
* platform/mediastream/RTCPeerConnectionHandler.h:
* platform/mediastream/RTCPeerConnectionHandlerClient.h:
* 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:
(WebCore::MediaStreamCenterMac::createMediaStream):
* platform/mock/MockMediaStreamCenter.cpp:
(WebCore::MockMediaStreamCenter::createMediaStream):
* platform/mock/RTCPeerConnectionHandlerMock.cpp:
(WebCore::RTCPeerConnectionHandlerMock::addStream):
(WebCore::RTCPeerConnectionHandlerMock::removeStream):
* platform/mock/RTCPeerConnectionHandlerMock.h:

Source/WebKit/blackberry:

* WebCoreSupport/UserMediaClientImpl.cpp:
(WebCore::toMediaStreamPrivate):
(WebCore::WebUserMediaRequestClientImpl::requestSucceeded):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158849 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Removed QMake related filters
https://bugs.webkit.org/show_bug.cgi?id=123992

Patch by Dániel Bátyai <Batyai.Daniel@stud.u-szeged.hu> on 2013-11-07
Reviewed by Csaba Osztrogonác.

* Scripts/webkitpy/tool/commands/rebaseline_unittest.py:
(TestRebaseline.test_rebaseline):
(TestRebaselineExpectations.test_rebaseline_expectations):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158850 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Removed retrieveQMakespecVar function
https://bugs.webkit.org/show_bug.cgi?id=123996

Patch by Dániel Bátyai <Batyai.Daniel@stud.u-szeged.hu> on 2013-11-07
Reviewed by Csaba Osztrogonác.

* Scripts/webkitdirs.pm:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158851 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: DRT AccessibilityUIElement::isFocused methods should be finished.
https://bugs.webkit.org/show_bug.cgi?id=123774

Reviewed by Chris Fleizach.

Tools:

Implemented AccessibilityUIElement::isFocused methods and removed FIXMEs.

* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::isFocused):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::isFocused):

LayoutTests:

Added Mac platform test so we can validate our AccessibilityUIElement convenience method expectations.

* platform/mac/accessibility/test-convenience-methods-expected.txt: Added.
* platform/mac/accessibility/test-convenience-methods.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158852 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MSE] Add mock MediaSource classes for testing.
https://bugs.webkit.org/show_bug.cgi?id=123322

Reviewed by Eric Carlson.

Source/WebCore:

Tests: media/media-source/media-source-addsourcebuffer.html
       media/media-source/media-source-append-buffer.html
       media/media-source/media-source-canplaythrough.html
       media/media-source/media-source-closed.html
       media/media-source/media-source-play.html
       media/media-source/media-source-track-enabled.html
       media/media-source/media-source-tracks.html

Add mock implementation of platform MediaSource classes, allowing ports to test the
MediaSource API without having a platform implementation.

The MockMediaSource will support a byteformat defined in MockBox.h: a simple box-style media
format with an initialization segment containing a number of tracks, followed by a list of
samples.

Add a means to insert a new media engine factory at runtime, so the internals object can add
a MockMediaSourceMediaPlayer:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayerFactorySupport::callRegisterMediaEngine):
* platform/graphics/MediaPlayer.h:
* testing/Internals.cpp:
(WebCore::Internals::initializeMockMediaSource):
* testing/Internals.h:
* testing/Internals.idl:

For non-media-source supporting media engines, fail immediately when asked to load a media
source, so that the MockMediaSourceMediaPlayer will be instantiated as a fall-back:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::load):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
* platform/graphics/mac/MediaPlayerPrivateQTKit.h:
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivateQTKit::load):
(WebCore::MediaPlayerPrivateQTKit::supportsType):

Add new files to the project:
* WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/WebCore.exp.in:

Update the MediaSource implementation:
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::monitorSourceBuffers): Add a link to the spec.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::buffered): Ditto.
(WebCore::SourceBuffer::setTimestampOffset): Ditto.
(WebCore::SourceBuffer::validateInitializationSegment): Ditto.
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): Ditto. Also,
    bring the implementation up to date with part of the spec.
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Remove "Predicate" from
    SampleIsRandomAccessPredicate.

Add utility classes to parse and represent the bytestream supported by the MockMediaSource:
* platform/mock/mediasource/MockBox.cpp: Added.
(WebCore::MockBox::MockBox):
(WebCore::MockBox::peekType):
(WebCore::MockBox::peekLength):
(WebCore::MockTrackBox::MockTrackBox):
(WebCore::MockTrackBox::type):
(WebCore::MockInitializationBox::MockInitializationBox):
(WebCore::MockInitializationBox::type):
(WebCore::MockSampleBox::MockSampleBox):
(WebCore::MockSampleBox::type):
* platform/mock/mediasource/MockBox.h: Added.
(WebCore::MockBox::length):
(WebCore::MockBox::type):
(WebCore::MockTrackBox::trackID):
(WebCore::MockTrackBox::codec):
(WebCore::MockTrackBox::kind):
(WebCore::MockInitializationBox::duration):
(WebCore::MockInitializationBox::tracks):
(WebCore::MockSampleBox::presentationTimestamp):
(WebCore::MockSampleBox::decodeTimestamp):
(WebCore::MockSampleBox::duration):
(WebCore::MockSampleBox::trackID):
(WebCore::MockSampleBox::flags):
(WebCore::MockSampleBox::isSync):

Add a MediaPlayerPrivate implementation which uses MockMediaSource:
* platform/mock/mediasource/MockMediaPlayerMediaSource.cpp: Added.
(WebCore::MockMediaPlayerMediaSource::registerMediaEngine):
(WebCore::MockMediaPlayerMediaSource::create):
(WebCore::mimeTypeCache):
(WebCore::MockMediaPlayerMediaSource::getSupportedTypes):
(WebCore::MockMediaPlayerMediaSource::supportsType):
(WebCore::MockMediaPlayerMediaSource::MockMediaPlayerMediaSource):
(WebCore::MockMediaPlayerMediaSource::~MockMediaPlayerMediaSource):
(WebCore::MockMediaPlayerMediaSource::load):
(WebCore::MockMediaPlayerMediaSource::cancelLoad):
(WebCore::MockMediaPlayerMediaSource::play):
(WebCore::MockMediaPlayerMediaSource::pause):
(WebCore::MockMediaPlayerMediaSource::naturalSize):
(WebCore::MockMediaPlayerMediaSource::hasVideo):
(WebCore::MockMediaPlayerMediaSource::hasAudio):
(WebCore::MockMediaPlayerMediaSource::setVisible):
(WebCore::MockMediaPlayerMediaSource::seeking):
(WebCore::MockMediaPlayerMediaSource::paused):
(WebCore::MockMediaPlayerMediaSource::networkState):
(WebCore::MockMediaPlayerMediaSource::readyState):
(WebCore::MockMediaPlayerMediaSource::buffered):
(WebCore::MockMediaPlayerMediaSource::didLoadingProgress):
(WebCore::MockMediaPlayerMediaSource::setSize):
(WebCore::MockMediaPlayerMediaSource::paint):
(WebCore::MockMediaPlayerMediaSource::currentTimeDouble):
(WebCore::MockMediaPlayerMediaSource::durationDouble):
(WebCore::MockMediaPlayerMediaSource::seekDouble):
(WebCore::MockMediaPlayerMediaSource::advanceCurrentTime):
(WebCore::MockMediaPlayerMediaSource::updateDuration):
(WebCore::MockMediaPlayerMediaSource::setReadyState):
* platform/mock/mediasource/MockMediaPlayerMediaSource.h: Added.

Add a mock implementation of MediaSourcePrivate, which uses MockSourceBuffer:
* platform/mock/mediasource/MockMediaSourcePrivate.cpp: Added.
(WebCore::MockMediaSourcePrivate::create):
(WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate):
(WebCore::MockMediaSourcePrivate::~MockMediaSourcePrivate):
(WebCore::MockMediaSourcePrivate::addSourceBuffer):
(WebCore::MockMediaSourcePrivate::removeSourceBuffer):
(WebCore::MockMediaSourcePrivate::duration):
(WebCore::MockMediaSourcePrivate::setDuration):
(WebCore::MockMediaSourcePrivate::markEndOfStream):
(WebCore::MockMediaSourcePrivate::unmarkEndOfStream):
(WebCore::MockMediaSourcePrivate::readyState):
(WebCore::MockMediaSourcePrivate::setReadyState):
(WebCore::MockMediaSourcePrivate::sourceBufferPrivateDidChangeActiveState):
(WebCore::MockSourceBufferPrivateHasAudio):
(WebCore::MockMediaSourcePrivate::hasAudio):
(WebCore::MockSourceBufferPrivateHasVideo):
(WebCore::MockMediaSourcePrivate::hasVideo):
* platform/mock/mediasource/MockMediaSourcePrivate.h: Added.
(WebCore::MockMediaSourcePrivate::activeSourceBuffers):
(WebCore::MockMediaSourcePrivate::player):

Add a mock implementation of SourceBufferPrivate, which uses MockBoxes to parse the
bytestream provided by SourceBuffer:
* platform/mock/mediasource/MockSourceBufferPrivate.cpp: Added.
(WebCore::MockMediaSample::create):
(WebCore::MockMediaSample::~MockMediaSample):
(WebCore::MockMediaSample::MockMediaSample):
(WebCore::MockMediaSample::platformSample):
(WebCore::MockMediaDescription::create):
(WebCore::MockMediaDescription::~MockMediaDescription):
(WebCore::MockMediaDescription::MockMediaDescription):
(WebCore::MockSourceBufferPrivate::create):
(WebCore::MockSourceBufferPrivate::MockSourceBufferPrivate):
(WebCore::MockSourceBufferPrivate::~MockSourceBufferPrivate):
(WebCore::MockSourceBufferPrivate::setClient):
(WebCore::MockSourceBufferPrivate::append):
(WebCore::MockSourceBufferPrivate::didReceiveInitializationSegment):
(WebCore::MockSourceBufferPrivate::didReceiveSample):
(WebCore::MockSourceBufferPrivate::abort):
(WebCore::MockSourceBufferPrivate::removedFromMediaSource):
(WebCore::MockSourceBufferPrivate::readyState):
(WebCore::MockSourceBufferPrivate::setReadyState):
(WebCore::MockSourceBufferPrivate::hasVideo):
(WebCore::MockSourceBufferPrivate::hasAudio):
* platform/mock/mediasource/MockSourceBufferPrivate.h: Added.

Create mock implementations of AudioTrackPrivate, VideoTrackPrivate, and TextTrackPrivate
which wrap the MockTrackBox class:
* platform/mock/mediasource/MockTracks.cpp: Added.
* platform/mock/mediasource/MockTracks.h: Added.
(WebCore::MockAudioTrackPrivate::create):
(WebCore::MockAudioTrackPrivate::~MockAudioTrackPrivate):
(WebCore::MockAudioTrackPrivate::id):
(WebCore::MockAudioTrackPrivate::MockAudioTrackPrivate):
(WebCore::MockTextTrackPrivate::create):
(WebCore::MockTextTrackPrivate::~MockTextTrackPrivate):
(WebCore::MockTextTrackPrivate::id):
(WebCore::MockTextTrackPrivate::MockTextTrackPrivate):
(WebCore::MockVideoTrackPrivate::create):
(WebCore::MockVideoTrackPrivate::~MockVideoTrackPrivate):
(WebCore::MockVideoTrackPrivate::id):
(WebCore::MockVideoTrackPrivate::MockVideoTrackPrivate):

LayoutTests:

* media/media-source/media-source-addsourcebuffer-expected.txt: Added.
* media/media-source/media-source-addsourcebuffer.html: Added.
* media/media-source/media-source-append-buffer-expected.txt: Added.
* media/media-source/media-source-append-buffer.html: Added.
* media/media-source/media-source-canplaythrough-expected.txt: Added.
* media/media-source/media-source-canplaythrough.html: Added.
* media/media-source/media-source-closed-expected.txt: Added.
* media/media-source/media-source-closed.html: Added.
* media/media-source/media-source-play-expected.txt: Added.
* media/media-source/media-source-play.html: Added.
* media/media-source/mock-media-source.js: Added.
* media/video-test.js:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158853 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: CSS Regions: Removing a content node of a ContentFlow from the DOM will send a 0 nodeId
https://bugs.webkit.org/show_bug.cgi?id=123577

Source/WebCore:

Reviewed by Timothy Hatcher.

Test: inspector-protocol/model/content-flow-content-removal.html

Do not send unregister events for the content nodes of a flow when the element is not part of the DOM
anymore. We already send an unbind event, so the inspector is already notified that the node was removed.

* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::didUnregisterNamedFlowContentElement):

Source/WebInspectorUI:

Reviewed by  Timothy Hatcher.

Fixed the content node removal from the content flow.

* UserInterface/ContentFlowTreeContentView.js:
* UserInterface/DOMTreeManager.js:
(WebInspector.DOMTreeManager):
(WebInspector.DOMTreeManager.prototype._createContentFlowFromPayload): Registered all the content nodes
in the _contentNodesToFlowsMap.
(WebInspector.DOMTreeManager.prototype._unbind): Added call to _removeContentNodeFromFlowIfNeeded.
(WebInspector.DOMTreeManager.prototype._removeContentNodeFromFlowIfNeeded): Called from _unbind to check
and remove a node from it's parent content flow if needed.
(WebInspector.DOMTreeManager.prototype.unregisteredNamedFlowContentElement):

LayoutTests:

Reviewed by Timothy Hatcher.

Added test to check that the notification that an element was removed from the ContentFlow is handled
correctly in the WebInspector even if the element is not part of the DOM anymore.

* inspector-protocol/model/content-flow-content-removal-expected.txt: Added.
* inspector-protocol/model/content-flow-content-removal.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158854 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Refactor logical left/right offset for line methods
https://bugs.webkit.org/show_bug.cgi?id=123898

Reviewed by David Hyatt.

Simplify the logical left/right offset for line methods and their
implementation, including the ComputeFloatOffsetAdapter. This also
reduces the number of line offset methods in RenderBlock.

No new tests, no behavior change.

* rendering/FloatingObjects.cpp:
(WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter):
(WebCore::ComputeFloatOffsetAdapter::offset): Add a method to return
    the offset instead of using a confusing out parameter.
(WebCore::::shapeOffset): Method to return the offset modified by the
    shape delta. Moving the computation to this method allowed for
    simplification of the users of ComputeFloatOffsetAdapter.
(WebCore::FloatingObjects::logicalLeftOffsetForPositioningFloat): Added this
    method so that ShapeOutsideFloatOffsetMode isn't needed. Returns the
    offset based on the float margin box.
(WebCore::FloatingObjects::logicalRightOffsetForPositioningFloat): Ditto.
(WebCore::FloatingObjects::logicalLeftOffset): This now only returns
    the offset based on the shape's contour.
(WebCore::FloatingObjects::logicalRightOffset): Ditto.
(WebCore::::heightRemaining): Rename to properly follow the getter
    naming convention.
* rendering/FloatingObjects.h:
* rendering/RenderBlock.h:
(WebCore::RenderBlock::logicalRightOffsetForLine): Update to remove
    use of ShapeOutsideFloatOffsetMode and heightRemaining.
(WebCore::RenderBlock::logicalLeftOffsetForLine): Ditto.
(WebCore::RenderBlock::logicalRightFloatOffsetForLine): Ditto.
(WebCore::RenderBlock::logicalLeftFloatOffsetForLine): Ditto.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::logicalLeftOffsetForPositioningFloat):
    Positioning a float is the only case where the float margin box
    should be used, and also the only case where heightRemaining is
    needed. This handles that case.
(WebCore::RenderBlockFlow::logicalRightOffsetForPositioningFloat):
    Ditto.
(WebCore::RenderBlockFlow::computeLogicalLocationForFloat): Update to
    use logical(Left|Right)OffsetForPositioningFloatOnLine.
(WebCore::RenderBlockFlow::logicalLeftFloatOffsetForLine): Update to
    remove use for ShapeOutsideFloatOffsetMode and heightRemaining.
(WebCore::RenderBlockFlow::logicalRightFloatOffsetForLine): Ditto.
* rendering/RenderBlockFlow.h:


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