b=462953 Remove unimplemented media attributes/methods from media IDL r=doublec,sr=roc
--- a/content/html/content/public/nsHTMLMediaElement.h
+++ b/content/html/content/public/nsHTMLMediaElement.h
@@ -205,28 +205,16 @@ protected:
// Value of the volume before it was muted
float mMutedVolume;
// Size of the media. Updated by the decoder on the main thread if
// it changes. Defaults to a width and height of -1 if not set.
nsIntSize mMediaSize;
- // The defaultPlaybackRate attribute gives the desired speed at
- // which the media resource is to play, as a multiple of its
- // intrinsic speed.
- float mDefaultPlaybackRate;
-
- // The playbackRate attribute gives the speed at which the media
- // resource plays, as a multiple of its intrinsic speed. If it is
- // not equal to the defaultPlaybackRate, then the implication is
- // that the user is using a feature such as fast forward or slow
- // motion playback.
- float mPlaybackRate;
-
// If true then we have begun downloading the media content.
// Set to false when completed, or not yet started.
PRPackedBool mBegun;
// If truen then the video playback has completed.
PRPackedBool mEnded;
// True when the decoder has loaded enough data to display the
--- a/content/html/content/src/nsHTMLMediaElement.cpp
+++ b/content/html/content/src/nsHTMLMediaElement.cpp
@@ -95,20 +95,16 @@ public:
mElement->DispatchSimpleEvent(mName);
}
};
// nsIDOMHTMLMediaElement
NS_IMPL_URI_ATTR(nsHTMLMediaElement, Src, src)
NS_IMPL_BOOL_ATTR(nsHTMLMediaElement, Controls, controls)
NS_IMPL_BOOL_ATTR(nsHTMLMediaElement, Autoplay, autoplay)
-NS_IMPL_FLOAT_ATTR(nsHTMLMediaElement, Start, start)
-NS_IMPL_FLOAT_ATTR(nsHTMLMediaElement, End, end)
-NS_IMPL_FLOAT_ATTR(nsHTMLMediaElement, LoopStart, loopstart)
-NS_IMPL_FLOAT_ATTR(nsHTMLMediaElement, LoopEnd, loopend)
/* readonly attribute nsIDOMHTMLMediaError error; */
NS_IMETHODIMP nsHTMLMediaElement::GetError(nsIDOMHTMLMediaError * *aError)
{
NS_IF_ADDREF(*aError = mError);
return NS_OK;
}
@@ -116,17 +112,16 @@ NS_IMETHODIMP nsHTMLMediaElement::GetErr
/* readonly attribute boolean ended; */
NS_IMETHODIMP nsHTMLMediaElement::GetEnded(PRBool *aEnded)
{
*aEnded = mEnded;
return NS_OK;
}
-
/* readonly attribute DOMString currentSrc; */
NS_IMETHODIMP nsHTMLMediaElement::GetCurrentSrc(nsAString & aCurrentSrc)
{
nsCAutoString src;
if (mDecoder) {
nsCOMPtr<nsIURI> uri;
mDecoder->GetCurrentURI(getter_AddRefs(uri));
@@ -135,90 +130,24 @@ NS_IMETHODIMP nsHTMLMediaElement::GetCur
}
}
aCurrentSrc = NS_ConvertUTF8toUTF16(src);
return NS_OK;
}
-/* attribute float defaultPlaybackRate; */
-NS_IMETHODIMP nsHTMLMediaElement::GetDefaultPlaybackRate(float *aDefaultPlaybackRate)
-{
- *aDefaultPlaybackRate = mDefaultPlaybackRate;
- return NS_OK;
-}
-
-NS_IMETHODIMP nsHTMLMediaElement::SetDefaultPlaybackRate(float aDefaultPlaybackRate)
-{
- if (aDefaultPlaybackRate == 0.0) {
- return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
- }
-
- mDefaultPlaybackRate = aDefaultPlaybackRate;
- DispatchAsyncSimpleEvent(NS_LITERAL_STRING("ratechange"));
-
- return NS_OK;
-}
-
-/* attribute float playbackRate; */
-NS_IMETHODIMP nsHTMLMediaElement::GetPlaybackRate(float *aPlaybackRate)
-{
- *aPlaybackRate = mPlaybackRate;
- return NS_OK;
-}
-
-NS_IMETHODIMP nsHTMLMediaElement::SetPlaybackRate(float aPlaybackRate)
-{
- if (aPlaybackRate == 0.0) {
- return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
- }
-
- mPlaybackRate = aPlaybackRate;
-
- if (mDecoder) {
- mDecoder->PlaybackRateChanged();
- }
-
- DispatchAsyncSimpleEvent(NS_LITERAL_STRING("ratechange"));
- return NS_OK;
-}
-
/* readonly attribute unsigned short networkState; */
NS_IMETHODIMP nsHTMLMediaElement::GetNetworkState(PRUint16 *aNetworkState)
{
*aNetworkState = mNetworkState;
return NS_OK;
}
-/* readonly attribute float bufferingRate; */
-NS_IMETHODIMP nsHTMLMediaElement::GetBufferingRate(float *aBufferingRate)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* readonly attribute boolean bufferingThrottled; */
-NS_IMETHODIMP nsHTMLMediaElement::GetBufferingThrottled(PRBool *aBufferingRate)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* readonly attribute nsIDOMTimeRanges buffered; */
-NS_IMETHODIMP nsHTMLMediaElement::GetBuffered(nsIDOMHTMLTimeRanges * *aBuffered)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* readonly attribute nsIDOMByteRanges bufferedBytes; */
-NS_IMETHODIMP nsHTMLMediaElement::GetBufferedBytes(nsIDOMHTMLByteRanges * *aBufferedBytes)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
/* readonly attribute unsigned long totalBytes; */
NS_IMETHODIMP nsHTMLMediaElement::GetTotalBytes(PRUint32 *aTotalBytes)
{
*aTotalBytes = mDecoder ? PRUint32(mDecoder->GetTotalBytes()) : 0;
return NS_OK;
}
/* void load (); */
@@ -244,19 +173,17 @@ nsresult nsHTMLMediaElement::LoadWithCha
DispatchProgressEvent(NS_LITERAL_STRING("abort"));
return NS_OK;
}
mError = nsnull;
mLoadedFirstFrame = PR_FALSE;
mAutoplaying = PR_TRUE;
- float rate = 1.0;
- GetDefaultPlaybackRate(&rate);
- SetPlaybackRate(rate);
+ // TODO: The playback rate must be set to the default playback rate.
if (mNetworkState != nsIDOMHTMLMediaElement::EMPTY) {
mNetworkState = nsIDOMHTMLMediaElement::EMPTY;
ChangeReadyState(nsIDOMHTMLMediaElement::DATA_UNAVAILABLE);
mPaused = PR_TRUE;
// TODO: The current playback position must be set to 0.
// TODO: The currentLoop DOM attribute must be set to 0.
DispatchSimpleEvent(NS_LITERAL_STRING("emptied"));
@@ -330,28 +257,16 @@ NS_IMETHODIMP nsHTMLMediaElement::GetDur
/* readonly attribute boolean paused; */
NS_IMETHODIMP nsHTMLMediaElement::GetPaused(PRBool *aPaused)
{
*aPaused = mPaused;
return NS_OK;
}
-/* readonly attribute nsIDOMHTMLTimeRanges played; */
-NS_IMETHODIMP nsHTMLMediaElement::GetPlayed(nsIDOMHTMLTimeRanges * *aPlayed)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* readonly attribute nsIDOMHTMLTimeRanges seekable; */
-NS_IMETHODIMP nsHTMLMediaElement::GetSeekable(nsIDOMHTMLTimeRanges * *aSeekable)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
/* void pause (); */
NS_IMETHODIMP nsHTMLMediaElement::Pause()
{
if (!mDecoder)
return NS_OK;
nsresult rv;
@@ -368,50 +283,16 @@ NS_IMETHODIMP nsHTMLMediaElement::Pause(
if (!oldPaused) {
DispatchAsyncSimpleEvent(NS_LITERAL_STRING("timeupdate"));
DispatchAsyncSimpleEvent(NS_LITERAL_STRING("pause"));
}
return NS_OK;
}
-/* attribute unsigned long playCount; */
-NS_IMETHODIMP nsHTMLMediaElement::GetPlayCount(PRUint32 *aPlayCount)
-{
- return GetIntAttr(nsGkAtoms::playcount, 1, reinterpret_cast<PRInt32*>(aPlayCount));
-}
-
-NS_IMETHODIMP nsHTMLMediaElement::SetPlayCount(PRUint32 aPlayCount)
-{
- return SetIntAttr(nsGkAtoms::playcount, static_cast<PRInt32>(aPlayCount));
-}
-
-/* attribute unsigned long currentLoop; */
-NS_IMETHODIMP nsHTMLMediaElement::GetCurrentLoop(PRUint32 *aCurrentLoop)
-{
- return GetIntAttr(nsGkAtoms::currentloop, 0, reinterpret_cast<PRInt32*>(aCurrentLoop));
-}
-
-NS_IMETHODIMP nsHTMLMediaElement::SetCurrentLoop(PRUint32 aCurrentLoop)
-{
- return SetIntAttr(nsGkAtoms::currentloop, static_cast<PRInt32>(aCurrentLoop));
-}
-
-/* void addCueRange (in DOMString className, in float start, in float end, in boolean pauseOnExit, in nsIDOMHTMLVoidCallback enterCallback, in nsIDOMHTMLVoidCallback exitCallback); */
-NS_IMETHODIMP nsHTMLMediaElement::AddCueRange(const nsAString & className, float start, float end, PRBool pauseOnExit, nsIDOMHTMLVoidCallback *enterCallback, nsIDOMHTMLVoidCallback *exitCallback)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* void removeCueRanges (in DOMString className); */
-NS_IMETHODIMP nsHTMLMediaElement::RemoveCueRanges(const nsAString & className)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
/* attribute float volume; */
NS_IMETHODIMP nsHTMLMediaElement::GetVolume(float *aVolume)
{
if (mMuted)
*aVolume = mMutedVolume;
else
*aVolume = mDecoder ? mDecoder->GetVolume() : 0.0;
return NS_OK;
@@ -463,18 +344,16 @@ NS_IMETHODIMP nsHTMLMediaElement::SetMut
}
nsHTMLMediaElement::nsHTMLMediaElement(nsINodeInfo *aNodeInfo, PRBool aFromParser)
: nsGenericHTMLElement(aNodeInfo),
mNetworkState(nsIDOMHTMLMediaElement::EMPTY),
mReadyState(nsIDOMHTMLMediaElement::DATA_UNAVAILABLE),
mMutedVolume(0.0),
mMediaSize(-1,-1),
- mDefaultPlaybackRate(1.0),
- mPlaybackRate(1.0),
mBegun(PR_FALSE),
mEnded(PR_FALSE),
mLoadedFirstFrame(PR_FALSE),
mAutoplaying(PR_TRUE),
mPaused(PR_TRUE),
mMuted(PR_FALSE),
mIsDoneAddingChildren(!aFromParser),
mPlayingBeforeSeek(PR_FALSE)
@@ -504,19 +383,17 @@ nsHTMLMediaElement::Play(void)
if (mEnded) {
mEnded = PR_FALSE;
SetCurrentTime(0);
}
// TODO: If the playback has ended, then the user agent must set
// currentLoop to zero and seek to the effective start.
- float rate = 1.0;
- GetDefaultPlaybackRate(&rate);
- SetPlaybackRate(rate);
+ // TODO: The playback rate must be set to the default playback rate.
rv = mDecoder->Play();
NS_ENSURE_SUCCESS(rv, rv);
PRBool oldPaused = mPaused;
mPaused = PR_FALSE;
mAutoplaying = PR_FALSE;
if (oldPaused)
@@ -795,20 +672,18 @@ nsresult nsHTMLMediaElement::InitializeD
return rv;
}
void nsHTMLMediaElement::MetadataLoaded()
{
mNetworkState = nsIDOMHTMLMediaElement::LOADED_METADATA;
DispatchAsyncSimpleEvent(NS_LITERAL_STRING("durationchange"));
DispatchAsyncSimpleEvent(NS_LITERAL_STRING("loadedmetadata"));
- float start = 0.0;
- nsresult rv = GetStart(&start);
- if (NS_SUCCEEDED(rv) && start > 0.0 && mDecoder)
- mDecoder->Seek(start);
+ // TODO: Seek to the start time, as set in the start attribute.
+ mDecoder->Seek(0.0);
}
void nsHTMLMediaElement::FirstFrameLoaded()
{
mNetworkState = nsIDOMHTMLMediaElement::LOADED_FIRST_FRAME;
ChangeReadyState(nsIDOMHTMLMediaElement::CAN_SHOW_CURRENT_FRAME);
mLoadedFirstFrame = PR_TRUE;
DispatchAsyncSimpleEvent(NS_LITERAL_STRING("loadedfirstframe"));
--- a/content/html/content/src/nsHTMLSourceElement.cpp
+++ b/content/html/content/src/nsHTMLSourceElement.cpp
@@ -99,18 +99,16 @@ NS_INTERFACE_TABLE_HEAD(nsHTMLSourceElem
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLSourceElement)
NS_IMPL_ELEMENT_CLONE(nsHTMLSourceElement)
NS_IMPL_URI_ATTR(nsHTMLSourceElement, Src, src)
NS_IMPL_STRING_ATTR(nsHTMLSourceElement, Type, type)
-NS_IMPL_STRING_ATTR(nsHTMLSourceElement, Media, media)
-NS_IMPL_FLOAT_ATTR(nsHTMLSourceElement, PixelRatio, pixelratio)
PRBool
nsHTMLSourceElement::ParseAttribute(PRInt32 aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult)
{
--- a/content/html/content/src/nsHTMLVideoElement.cpp
+++ b/content/html/content/src/nsHTMLVideoElement.cpp
@@ -79,17 +79,16 @@ NS_INTERFACE_TABLE_HEAD(nsHTMLVideoEleme
nsHTMLMediaElement)
NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLVideoElement)
NS_IMPL_ELEMENT_CLONE(nsHTMLVideoElement)
// nsIDOMHTMLVideoElement
NS_IMPL_INT_ATTR(nsHTMLVideoElement, Width, width)
NS_IMPL_INT_ATTR(nsHTMLVideoElement, Height, height)
-NS_IMPL_URI_ATTR(nsHTMLVideoElement, Poster, poster)
// nsIDOMHTMLVideoElement
/* readonly attribute unsigned long videoWidth; */
NS_IMETHODIMP nsHTMLVideoElement::GetVideoWidth(PRUint32 *aVideoWidth)
{
*aVideoWidth = mMediaSize.width == -1 ? 0 : mMediaSize.width;
return NS_OK;
}
--- a/content/media/video/test/Makefile.in
+++ b/content/media/video/test/Makefile.in
@@ -43,24 +43,21 @@ relativesrcdir = content/media/video/te
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
_TEST_FILES = test_autoplay.html \
test_bug461281.html \
test_constants.html \
test_controls.html \
test_currentTime.html \
- test_defaultPlaybackRate.html \
test_ended1.html \
test_ended2.html \
test_networkState.html \
test_paused.html \
- test_playbackRate.html \
test_readyState.html \
- test_start.html \
test_seek1.html \
test_seek2.html \
test_seek3.html \
test_seek4.html \
test_seek5.html \
test_seek6.html \
test_seek7.html \
test_seek8.html \
deleted file mode 100644
--- a/content/media/video/test/test_defaultPlaybackRate.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Media test: defaultPlaybackRate</title>
- <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<video id='v1'></video><audio id='a1'></audio>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-var v1 = document.getElementById('v1');
-var a1 = document.getElementById('a1');
-var passed = true;
-
-is(v1.defaultPlaybackRate, 1);
-is(a1.defaultPlaybackRate, 1);
-
-v1.defaultPlaybackRate = 2.5;
-a1.defaultPlaybackRate = 2.5;
-is(v1.defaultPlaybackRate, 2.5);
-is(a1.defaultPlaybackRate, 2.5);
-
-try {
- v1.defaultPlaybackRate = 0
- a1.defaultPlaybackRate = 0
- passed = false;
-} catch(e) { }
-ok(passed, "Should not be able to set defaultPlaybackRate to 0");
-
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/content/media/video/test/test_playbackRate.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Media test: playbackRate</title>
- <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<video id='v1'></video><audio id='a1'></audio>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-var v1 = document.getElementById('v1');
-var a1 = document.getElementById('a1');
-var passed = true;
-
-is(v1.playbackRate, 1);
-is(a1.playbackRate, 1);
-
-v1.playbackRate = 2.5;
-a1.playbackRate = 2.5;
-is(v1.playbackRate, 2.5);
-is(a1.playbackRate, 2.5);
-
-try {
- v1.playbackRate = 0
- a1.playbackRate = 0
- passed = false;
-} catch(e) { }
-ok(passed, "Should not be able to set playbackRate to 0");
-
-</script>
-</pre>
-</body>
-</html>
deleted file mode 100644
--- a/content/media/video/test/test_start.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Media test: start</title>
- <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<video id='v1'></video><audio id='a1'></audio>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-var v1 = document.getElementById('v1');
-var a1 = document.getElementById('a1');
-
-is(v1.start, 0);
-is(a1.start, 0);
-
-v1.start = 2.5;
-a1.start = 2.5;
-is(v1.start, 2.5);
-is(a1.start, 2.5);
-</script>
-</pre>
-</body>
-</html>
--- a/dom/public/idl/html/nsIDOMHTMLMediaElement.idl
+++ b/dom/public/idl/html/nsIDOMHTMLMediaElement.idl
@@ -33,83 +33,59 @@
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsIDOMHTMLElement.idl"
#include "nsIDOMHTMLMediaError.idl"
-#include "nsIDOMHTMLTimeRanges.idl"
-#include "nsIDOMHTMLByteRanges.idl"
-#include "nsIDOMHTMLVoidCallback.idl"
/**
* The nsIDOMHTMLMediaElement interface is an interface to be implemented by the HTML
* <audio> and <video> elements.
*
* For more information on this interface, please see
* http://www.whatwg.org/specs/web-apps/current-work/#htmlmediaelement
*
* @status UNDER_DEVELOPMENT
*/
-[scriptable, uuid(c8ce31b9-d18b-48c4-8309-944f0ccb1435)]
+[scriptable, uuid(d95c02ac-92dc-4fff-ad52-41e125340fab)]
interface nsIDOMHTMLMediaElement : nsIDOMHTMLElement
{
// error state
readonly attribute nsIDOMHTMLMediaError error;
// network state
attribute DOMString src;
readonly attribute DOMString currentSrc;
const unsigned short EMPTY = 0;
const unsigned short LOADING = 1;
const unsigned short LOADED_METADATA = 2;
const unsigned short LOADED_FIRST_FRAME = 3;
const unsigned short LOADED = 4;
readonly attribute unsigned short networkState;
- readonly attribute float bufferingRate;
- readonly attribute boolean bufferingThrottled;
- readonly attribute nsIDOMHTMLTimeRanges buffered;
- readonly attribute nsIDOMHTMLByteRanges bufferedBytes;
readonly attribute unsigned long totalBytes;
void load();
// ready state
const unsigned short DATA_UNAVAILABLE = 0;
const unsigned short CAN_SHOW_CURRENT_FRAME = 1;
const unsigned short CAN_PLAY = 2;
const unsigned short CAN_PLAY_THROUGH = 3;
readonly attribute unsigned short readyState;
readonly attribute boolean seeking;
// playback state
attribute float currentTime;
readonly attribute float duration;
readonly attribute boolean paused;
- attribute float defaultPlaybackRate;
- attribute float playbackRate;
- readonly attribute nsIDOMHTMLTimeRanges played;
- readonly attribute nsIDOMHTMLTimeRanges seekable;
readonly attribute boolean ended;
attribute boolean autoplay;
void play();
void pause();
- // looping
- attribute float start;
- attribute float end;
- attribute float loopStart;
- attribute float loopEnd;
- attribute unsigned long playCount;
- attribute unsigned long currentLoop;
-
- // cue points
- void addCueRange(in DOMString className, in float start, in float end, in boolean pauseOnExit, in nsIDOMHTMLVoidCallback enterCallback, in nsIDOMHTMLVoidCallback exitCallback);
- void removeCueRanges(in DOMString className);
-
-
// controls
attribute boolean controls;
attribute float volume;
attribute boolean muted;
};
--- a/dom/public/idl/html/nsIDOMHTMLSourceElement.idl
+++ b/dom/public/idl/html/nsIDOMHTMLSourceElement.idl
@@ -43,16 +43,14 @@
* <source> element.
*
* For more information on this interface, please see
* http://www.whatwg.org/specs/web-apps/current-work/#source
*
* @status UNDER_DEVELOPMENT
*/
-[scriptable, uuid(BF80FED9-BDBA-4C5A-AD23-203FAA4C4892)]
+[scriptable, uuid(be281029-7dd9-4268-963e-96f5196acc19)]
interface nsIDOMHTMLSourceElement : nsIDOMHTMLElement
{
attribute DOMString src;
attribute DOMString type;
- attribute DOMString media;
- attribute float pixelRatio;
};
--- a/dom/public/idl/html/nsIDOMHTMLVideoElement.idl
+++ b/dom/public/idl/html/nsIDOMHTMLVideoElement.idl
@@ -43,18 +43,17 @@
* <video> element.
*
* For more information on this interface, please see
* http://www.whatwg.org/specs/web-apps/current-work/#video
*
* @status UNDER_DEVELOPMENT
*/
-[scriptable, uuid(B08457F7-8709-4D70-AC19-90433C77CD1E)]
+[scriptable, uuid(4e3f05a5-ca9b-4576-af7f-b1d4038e6eb3)]
interface nsIDOMHTMLVideoElement : nsIDOMHTMLMediaElement
{
attribute long width;
attribute long height;
readonly attribute unsigned long videoWidth;
readonly attribute unsigned long videoHeight;
- attribute DOMString poster;
};