Video elements with MediaSource objects set by srcObject are not cleared when srcObje...
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Feb 2017 19:17:14 +0000 (19:17 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Feb 2017 19:17:14 +0000 (19:17 +0000)
commit2decad1c7db6cd5a0f712019fcafad1829f59223
tree9c876769a4772ca33cb4976f933b7b0d5b0c573d
parentf1a145dc0355201f8e23c0678693e5b5b210722a
Video elements with MediaSource objects set by srcObject are not cleared when srcObject is set to null
https://bugs.webkit.org/show_bug.cgi?id=168268

Reviewed by Eric Carlson.

Source/WebCore:

Test: fast/mediastream/MediaStream-MediaElement-setObject-null.html

Make the setSrcObject() operation compliant with the HTML spec. Since the specification defines
srcObject in terms of either a MediaSource, MediaStream, or Blob object, add the variant typedef
to HTMLMediaElement and move the definition out of the Modules/mediastream extension IDL and into
HTMLMediaElement.idl. Then bring the "media elements load" and "resource selection" algorithms up
to their most recent definitions in the HTML5 spec.

Drive-by fix: Allow the (admittedly weird) single-element-union type in IDL.

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* Modules/mediastream/HTMLMediaElementMediaStream.cpp: Removed.
* Modules/mediastream/HTMLMediaElementMediaStream.h: Removed.
* Modules/mediastream/HTMLMediaElementMediaStream.idl: Removed.
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/IDLParser.pm:
(parseUnionType):
* html/HTMLAudioElement.cpp:
(WebCore::HTMLAudioElement::createForJSConstructor):
* html/HTMLMediaElement.cpp:
(WebCore::actionName):
(WebCore::HTMLMediaElement::parseAttribute):
(WebCore::HTMLMediaElement::insertedInto):
(WebCore::HTMLMediaElement::scheduleDelayedAction):
(WebCore::HTMLMediaElement::scheduleNextSourceChild):
(WebCore::HTMLMediaElement::pendingActionTimerFired):
(WebCore::HTMLMediaElement::setSrcObject):
(WebCore::HTMLMediaElement::load):
(WebCore::HTMLMediaElement::prepareForLoad):
(WebCore::HTMLMediaElement::selectMediaResource):
(WebCore::HTMLMediaElement::loadResource):
(WebCore::HTMLMediaElement::playInternal):
(WebCore::HTMLMediaElement::pauseInternal):
(WebCore::HTMLMediaElement::sourceWasAdded):
(WebCore::HTMLMediaElement::clearMediaPlayer):
(WebCore::HTMLMediaElement::resume):
(WebCore::HTMLMediaElement::mediaCanStart):
(WebCore::HTMLMediaElement::createMediaPlayer):
(WebCore::HTMLMediaElement::loadInternal): Deleted.
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::srcObject):
* html/HTMLMediaElement.idl:
* platform/ContentType.h:

LayoutTests:

* fast/mediastream/MediaStream-MediaElement-setObject-null-expected.txt: Added.
* fast/mediastream/MediaStream-MediaElement-setObject-null.html: Added.
* fast/mediastream/MediaStream-video-element-expected.txt:
* fast/mediastream/MediaStream-video-element-track-stop-expected.txt:
* fast/mediastream/MediaStream-video-element-track-stop.html:
* fast/mediastream/MediaStream-video-element.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212311 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/mediastream/MediaStream-MediaElement-setObject-null-expected.txt [new file with mode: 0644]
LayoutTests/fast/mediastream/MediaStream-MediaElement-setObject-null.html [new file with mode: 0644]
LayoutTests/fast/mediastream/MediaStream-video-element-expected.txt
LayoutTests/fast/mediastream/MediaStream-video-element-track-stop-expected.txt
LayoutTests/fast/mediastream/MediaStream-video-element-track-stop.html
LayoutTests/fast/mediastream/MediaStream-video-element.html
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.cpp
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/mediastream/HTMLMediaElementMediaStream.cpp [deleted file]
Source/WebCore/Modules/mediastream/HTMLMediaElementMediaStream.h [deleted file]
Source/WebCore/Modules/mediastream/HTMLMediaElementMediaStream.idl [deleted file]
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/scripts/IDLParser.pm
Source/WebCore/html/HTMLAudioElement.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/HTMLMediaElement.idl
Source/WebCore/platform/ContentType.h