Back out due to failed mochitest

git-svn-id: svn://10.0.0.236/trunk@247519 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jonas%sicking.cc
2008-03-11 02:18:16 +00:00
parent ef7fb4b878
commit fbfd1bd5fa
20 changed files with 264 additions and 486 deletions

View File

@@ -127,11 +127,10 @@ nsAsyncInstantiateEvent::Run()
mContent->mPendingInstantiateEvent = nsnull;
// Make sure that we still have the right frame (NOTE: we don't need to check
// the type here - GetExistingFrame() only returns object frames, and that
// means we're a plugin)
// the type here - GetFrame() only returns object frames, and that means we're
// a plugin)
// Also make sure that we still refer to the same data.
nsIObjectFrame* frame = mContent->
GetExistingFrame(nsObjectLoadingContent::eFlushContent);
nsIObjectFrame* frame = mContent->GetFrame(PR_FALSE);
if (frame == mFrame &&
mContent->mURI == mURI &&
mContent->mContentType.Equals(mContentType)) {
@@ -517,7 +516,7 @@ nsObjectLoadingContent::OnStartRequest(nsIRequest *aRequest, nsISupports *aConte
notifier.Notify();
}
nsIObjectFrame* frame;
frame = GetExistingFrame(eFlushLayout);
frame = GetFrame(PR_TRUE);
if (!frame) {
// Do nothing in this case: This is probably due to a display:none
// frame. If we ever get a frame, HasNewFrame will do the right thing.
@@ -583,7 +582,7 @@ nsObjectLoadingContent::OnStartRequest(nsIRequest *aRequest, nsISupports *aConte
#endif
Fallback(PR_FALSE);
} else if (mType == eType_Plugin) {
nsIObjectFrame* frame = GetExistingFrame(eFlushContent);
nsIObjectFrame* frame = GetFrame(PR_FALSE);
if (frame) {
// We have to notify the wrapper here instead of right after
// Instantiate because the plugin only gets instantiated by
@@ -672,7 +671,7 @@ nsObjectLoadingContent::EnsureInstantiation(nsIPluginInstance** aInstance)
return NS_OK;
}
nsIObjectFrame* frame = GetExistingFrame(eFlushContent);
nsIObjectFrame* frame = GetFrame(PR_FALSE);
if (frame) {
// If we have a frame, we may have pending instantiate events; revoke
// them.
@@ -709,7 +708,7 @@ nsObjectLoadingContent::EnsureInstantiation(nsIPluginInstance** aInstance)
mInstantiating = PR_FALSE;
frame = GetExistingFrame(eFlushContent);
frame = GetFrame(PR_FALSE);
if (!frame) {
return NS_OK;
}
@@ -772,19 +771,6 @@ nsObjectLoadingContent::HasNewFrame(nsIObjectFrame* aFrame)
return NS_OK;
}
NS_IMETHODIMP
nsObjectLoadingContent::GetPluginInstance(nsIPluginInstance** aInstance)
{
*aInstance = nsnull;
nsIObjectFrame* objFrame = GetExistingFrame(eDontFlush);
if (!objFrame) {
return NS_OK;
}
return objFrame->GetPluginInstance(*aInstance);
}
NS_IMETHODIMP
nsObjectLoadingContent::GetContentTypeForMIMEType(const nsACString& aMIMEType,
PRUint32* aType)
@@ -1541,12 +1527,13 @@ nsObjectLoadingContent::GetObjectBaseURI(nsIContent* thisContent, nsIURI** aURI)
}
nsIObjectFrame*
nsObjectLoadingContent::GetExistingFrame(FlushType aFlushType)
nsObjectLoadingContent::GetFrame(PRBool aFlushLayout)
{
nsCOMPtr<nsIContent> thisContent =
do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
NS_ASSERTION(thisContent, "must be a content");
PRBool flushed = PR_FALSE;
nsIFrame* frame;
do {
nsIDocument* doc = thisContent->GetCurrentDoc();
@@ -1564,17 +1551,17 @@ nsObjectLoadingContent::GetExistingFrame(FlushType aFlushType)
return nsnull;
}
if (aFlushType == eDontFlush) {
if (flushed) {
break;
}
// OK, let's flush out and try again. Note that we want to reget
// the document, etc, since flushing might run script.
mozFlushType flushType =
aFlushType == eFlushLayout ? Flush_Layout : Flush_ContentAndNotify;
aFlushLayout ? Flush_Layout : Flush_ContentAndNotify;
doc->FlushPendingNotifications(flushType);
aFlushType = eDontFlush;
flushed = PR_TRUE;
} while (1);
nsIObjectFrame* objFrame;
@@ -1603,7 +1590,7 @@ nsresult
nsObjectLoadingContent::TryInstantiate(const nsACString& aMIMEType,
nsIURI* aURI)
{
nsIObjectFrame* frame = GetExistingFrame(eFlushContent);
nsIObjectFrame* frame = GetFrame(PR_FALSE);
if (!frame) {
LOG(("OBJLC [%p]: No frame yet\n", this));
return NS_OK; // Not a failure to have no frame