Skip to content

Commit

Permalink
Backout bug 449156 due to test-poster-9 failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
cpearce committed Jun 26, 2009
1 parent 7bb427a commit 55076f0
Show file tree
Hide file tree
Showing 33 changed files with 33 additions and 560 deletions.
10 changes: 1 addition & 9 deletions content/base/public/nsIImageLoadingContent.idl
Expand Up @@ -64,7 +64,7 @@ interface nsIURI;
* sufficient, when combined with the imageBlockingStatus information.)
*/

[scriptable, uuid(e036857e-3417-4812-a5f2-89668a616781)]
[scriptable, uuid(7744c6d3-5c60-4b7b-a526-4fe9d5ac7e97)]
interface nsIImageLoadingContent : imgIDecoderObserver
{
/**
Expand Down Expand Up @@ -167,12 +167,4 @@ interface nsIImageLoadingContent : imgIDecoderObserver
* @throws NS_ERROR_NOT_AVAILABLE if there is no current URI to reload
*/
void forceReload();

/**
* Enables/disables image state forcing. When |aForce| is PR_TRUE, we force
* nsImageLoadingContent::ImageState() to return |aState|. Call again with |aForce|
* as PR_FALSE to revert ImageState() to its original behaviour.
*/
void forceImageState(in boolean aForce, in long aState);

};
13 changes: 2 additions & 11 deletions content/base/src/nsImageLoadingContent.cpp
Expand Up @@ -109,8 +109,7 @@ nsImageLoadingContent::nsImageLoadingContent()
// mBroken starts out true, since an image without a URI is broken....
mBroken(PR_TRUE),
mUserDisabled(PR_FALSE),
mSuppressed(PR_FALSE),
mIsImageStateForced(PR_FALSE)
mSuppressed(PR_FALSE)
{
if (!nsContentUtils::GetImgLoader()) {
mLoadingEnabled = PR_FALSE;
Expand Down Expand Up @@ -618,18 +617,10 @@ nsImageLoadingContent::LoadImage(nsIURI* aNewURI,
return NS_OK;
}

nsresult
nsImageLoadingContent::ForceImageState(PRBool aForce, PRInt32 aState)
{
mIsImageStateForced = aForce;
mForcedImageState = aState;
return NS_OK;
}

PRInt32
nsImageLoadingContent::ImageState() const
{
return mIsImageStateForced ? mForcedImageState :
return
(mBroken * NS_EVENT_STATE_BROKEN) |
(mUserDisabled * NS_EVENT_STATE_USERDISABLED) |
(mSuppressed * NS_EVENT_STATE_SUPPRESSED) |
Expand Down
11 changes: 0 additions & 11 deletions content/base/src/nsImageLoadingContent.h
Expand Up @@ -260,21 +260,10 @@ class nsImageLoadingContent : public nsIImageLoadingContent
*/
ImageObserver mObserverList;

/**
* When mIsImageStateForced is true, this holds the ImageState that we'll
* return in ImageState().
*/
PRInt32 mForcedImageState;

PRInt16 mImageBlockingStatus;
PRPackedBool mLoadingEnabled : 1;
PRPackedBool mStartingLoad : 1;

/**
* When true, we return mForcedImageState from ImageState().
*/
PRPackedBool mIsImageStateForced : 1;

/**
* The state we had the last time we checked whether we needed to notify the
* document of a state change. These are maintained by UpdateImageState.
Expand Down
17 changes: 0 additions & 17 deletions content/html/content/public/nsHTMLMediaElement.h
Expand Up @@ -256,24 +256,11 @@ class nsHTMLMediaElement : public nsGenericHTMLElement
*/
already_AddRefed<nsILoadGroup> GetDocumentLoadGroup();

/**
* Returns PR_TRUE if the media has played or completed a seek.
* Used by video frame to determine whether to paint the poster.
*/
PRBool GetPlayedOrSeeked() { return mHasPlayedOrSeeked; }

protected:
class MediaLoadListener;
class LoadNextSourceEvent;
class SelectResourceEvent;

/**
* Changes mHasPlayedOrSeeked to aValue. If mHasPlayedOrSeeked changes
* we'll force a reflow so that the video frame gets reflowed to reflect
* the poster hiding or showing immediately.
*/
void SetPlayedOrSeeked(PRBool aValue);

/**
* Create a decoder for the given aMIMEType. Returns false if we
* were unable to create the decoder.
Expand Down Expand Up @@ -482,8 +469,4 @@ class nsHTMLMediaElement : public nsGenericHTMLElement
// PR_TRUE if we are allowed to suspend the decoder because we were paused,
// autobuffer and autoplay were not set, and we loaded the first frame.
PRPackedBool mAllowSuspendAfterFirstFrame;

// PR_TRUE if we've played or completed a seek. We use this to determine
// when the poster frame should be shown.
PRPackedBool mHasPlayedOrSeeked;
};
27 changes: 1 addition & 26 deletions content/html/content/src/nsHTMLMediaElement.cpp
Expand Up @@ -413,7 +413,6 @@ NS_IMETHODIMP nsHTMLMediaElement::Load()
{
if (mIsRunningLoadMethod)
return NS_OK;
SetPlayedOrSeeked(PR_FALSE);
mIsRunningLoadMethod = PR_TRUE;
AbortExistingLoads();
QueueSelectResourceTask();
Expand Down Expand Up @@ -785,8 +784,7 @@ nsHTMLMediaElement::nsHTMLMediaElement(nsINodeInfo *aNodeInfo, PRBool aFromParse
mDelayingLoadEvent(PR_FALSE),
mIsRunningSelectResource(PR_FALSE),
mSuspendedAfterFirstFrame(PR_FALSE),
mAllowSuspendAfterFirstFrame(PR_TRUE),
mHasPlayedOrSeeked(PR_FALSE)
mAllowSuspendAfterFirstFrame(PR_TRUE)
{
RegisterFreezableElement();
}
Expand Down Expand Up @@ -815,29 +813,9 @@ void nsHTMLMediaElement::StopSuspendingAfterFirstFrame()
}
}

void nsHTMLMediaElement::SetPlayedOrSeeked(PRBool aValue)
{
if (aValue == mHasPlayedOrSeeked)
return;

mHasPlayedOrSeeked = aValue;

// Force a reflow so that the poster frame hides or shows immediately.
nsIDocument *doc = GetDocument();
if (!doc) return;
nsIPresShell *presShell = doc->GetPrimaryShell();
if (!presShell) return;
nsIFrame* frame = presShell->GetPrimaryFrameFor(this);
if (!frame) return;
presShell->FrameNeedsReflow(frame,
nsIPresShell::eTreeChange,
NS_FRAME_IS_DIRTY);
}

NS_IMETHODIMP nsHTMLMediaElement::Play()
{
StopSuspendingAfterFirstFrame();
SetPlayedOrSeeked(PR_TRUE);

if (mNetworkState == nsIDOMHTMLMediaElement::NETWORK_EMPTY) {
nsresult rv = Load();
Expand Down Expand Up @@ -1226,7 +1204,6 @@ nsresult nsHTMLMediaElement::InitializeDecoderForChannel(nsIChannel *aChannel,
mDecoder->SetVolume(mMuted ? 0.0 : mVolume);

if (!mPaused) {
SetPlayedOrSeeked(PR_TRUE);
rv = mDecoder->Play();
}

Expand Down Expand Up @@ -1324,7 +1301,6 @@ void nsHTMLMediaElement::SeekStarted()
void nsHTMLMediaElement::SeekCompleted()
{
mPlayingBeforeSeek = PR_FALSE;
SetPlayedOrSeeked(PR_TRUE);
DispatchAsyncSimpleEvent(NS_LITERAL_STRING("seeked"));
}

Expand Down Expand Up @@ -1478,7 +1454,6 @@ void nsHTMLMediaElement::NotifyAutoplayDataReady()
mAutoplayEnabled) {
mPaused = PR_FALSE;
if (mDecoder) {
SetPlayedOrSeeked(PR_TRUE);
mDecoder->Play();
}
DispatchAsyncSimpleEvent(NS_LITERAL_STRING("play"));
Expand Down
2 changes: 0 additions & 2 deletions content/html/content/src/nsHTMLVideoElement.cpp
Expand Up @@ -158,5 +158,3 @@ nsHTMLVideoElement::GetAttributeMappingFunction() const
{
return &MapAttributesIntoRule;
}

NS_IMPL_URI_ATTR(nsHTMLVideoElement, Poster, poster)
3 changes: 1 addition & 2 deletions dom/interfaces/html/nsIDOMHTMLVideoElement.idl
Expand Up @@ -48,13 +48,12 @@
* @status UNDER_DEVELOPMENT
*/

[scriptable, uuid(edf468dc-42eb-4494-920b-56a315172640)]
[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;
};

0 comments on commit 55076f0

Please sign in to comment.