Fixing logic in Reflow for differrent objects. Still ifdefed out

This commit is contained in:
av%netscape.com 1999-04-15 20:07:01 +00:00
Родитель 9e41a47281
Коммит 46c59bdd29
2 изменённых файлов: 260 добавлений и 248 удалений

Просмотреть файл

@ -872,6 +872,11 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
// Get our desired size
GetDesiredSize(&aPresContext, aReflowState, aMetrics);
//~~~ could be an image
nsIFrame * child = mFrames.FirstChild();
if(child != nsnull)
return HandleImage(aPresContext, aMetrics, aReflowState, aStatus, child);
// if mInstance is null, we need to determine what kind of object we are and instantiate ourselves
if(!mInstanceOwner)
{
@ -943,9 +948,16 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
if((rv = aPresContext.GetContainer(&container)) != NS_OK)
return rv;
if((rv = container->QueryInterface(kIContentViewerContainerIID, (void **)&cv)) != NS_OK)
{ NS_RELEASE(container); return rv;}
{
NS_RELEASE(container);
return rv;
}
if((rv = cv->QueryCapability(kIPluginHostIID, (void **)&pluginHost)) != NS_OK)
{ NS_RELEASE(container); NS_RELEASE(cv); return rv;}
{
NS_RELEASE(container);
NS_RELEASE(cv);
return rv;
}
if(pluginHost->IsPluginEnabledForType("application/x-oleobject") == NS_OK)
rv = InstantiatePlugin(aPresContext, aMetrics, aReflowState, pluginHost, "application/x-oleobject", fullURL);
@ -961,15 +973,10 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
NS_RELEASE(container);
}
aStatus = NS_FRAME_COMPLETE;
return rv;
}
nsIFrame * child = mFrames.FirstChild();
if(child != nsnull)
return HandleImage(aPresContext, aMetrics, aReflowState, aStatus, child);
// if we're here, the object is either an applet or a plugin
nsIAtom* atom = nsnull;
@ -984,9 +991,16 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
if((rv = aPresContext.GetContainer(&container)) != NS_OK)
return rv;
if((rv = container->QueryInterface(kIContentViewerContainerIID, (void **)&cv)) != NS_OK)
{ NS_RELEASE(container); return rv;}
{
NS_RELEASE(container);
return rv;
}
if((rv = cv->QueryCapability(kIPluginHostIID, (void **)&pluginHost)) != NS_OK)
{ NS_RELEASE(container); NS_RELEASE(cv); return rv;}
{
NS_RELEASE(container);
NS_RELEASE(cv);
return rv;
}
mContent->GetTag(atom);
// check if it's an applet
@ -1015,7 +1029,7 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
NS_IF_RELEASE(group);
}
InstantiatePlugin(aPresContext, aMetrics, aReflowState, pluginHost, mimeType, fullURL);
rv = InstantiatePlugin(aPresContext, aMetrics, aReflowState, pluginHost, mimeType, fullURL);
}
else // traditional plugin
{
@ -1069,7 +1083,7 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
pluginHost->IsPluginEnabledForExtension(extension, mimeType);
}
InstantiatePlugin(aPresContext, aMetrics, aReflowState, pluginHost, mimeType, fullURL);
rv = InstantiatePlugin(aPresContext, aMetrics, aReflowState, pluginHost, mimeType, fullURL);
}
NS_IF_RELEASE(atom);
@ -1086,20 +1100,12 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
}
}
//~~~
// image handling
nsIFrame * child = mFrames.FirstChild();
if(child != nsnull)
return HandleImage(aPresContext, aMetrics, aReflowState, aStatus, child);
//~~~
nsIPresShell* presShell;
aPresContext.GetShell(&presShell);
presShell->CantRenderReplacedElement(&aPresContext, this);
NS_RELEASE(presShell);
aStatus = NS_FRAME_COMPLETE;
return NS_OK;
}
nsresult

Просмотреть файл

@ -872,6 +872,11 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
// Get our desired size
GetDesiredSize(&aPresContext, aReflowState, aMetrics);
//~~~ could be an image
nsIFrame * child = mFrames.FirstChild();
if(child != nsnull)
return HandleImage(aPresContext, aMetrics, aReflowState, aStatus, child);
// if mInstance is null, we need to determine what kind of object we are and instantiate ourselves
if(!mInstanceOwner)
{
@ -943,9 +948,16 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
if((rv = aPresContext.GetContainer(&container)) != NS_OK)
return rv;
if((rv = container->QueryInterface(kIContentViewerContainerIID, (void **)&cv)) != NS_OK)
{ NS_RELEASE(container); return rv;}
{
NS_RELEASE(container);
return rv;
}
if((rv = cv->QueryCapability(kIPluginHostIID, (void **)&pluginHost)) != NS_OK)
{ NS_RELEASE(container); NS_RELEASE(cv); return rv;}
{
NS_RELEASE(container);
NS_RELEASE(cv);
return rv;
}
if(pluginHost->IsPluginEnabledForType("application/x-oleobject") == NS_OK)
rv = InstantiatePlugin(aPresContext, aMetrics, aReflowState, pluginHost, "application/x-oleobject", fullURL);
@ -961,15 +973,10 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
NS_RELEASE(container);
}
aStatus = NS_FRAME_COMPLETE;
return rv;
}
nsIFrame * child = mFrames.FirstChild();
if(child != nsnull)
return HandleImage(aPresContext, aMetrics, aReflowState, aStatus, child);
// if we're here, the object is either an applet or a plugin
nsIAtom* atom = nsnull;
@ -984,9 +991,16 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
if((rv = aPresContext.GetContainer(&container)) != NS_OK)
return rv;
if((rv = container->QueryInterface(kIContentViewerContainerIID, (void **)&cv)) != NS_OK)
{ NS_RELEASE(container); return rv;}
{
NS_RELEASE(container);
return rv;
}
if((rv = cv->QueryCapability(kIPluginHostIID, (void **)&pluginHost)) != NS_OK)
{ NS_RELEASE(container); NS_RELEASE(cv); return rv;}
{
NS_RELEASE(container);
NS_RELEASE(cv);
return rv;
}
mContent->GetTag(atom);
// check if it's an applet
@ -1015,7 +1029,7 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
NS_IF_RELEASE(group);
}
InstantiatePlugin(aPresContext, aMetrics, aReflowState, pluginHost, mimeType, fullURL);
rv = InstantiatePlugin(aPresContext, aMetrics, aReflowState, pluginHost, mimeType, fullURL);
}
else // traditional plugin
{
@ -1069,7 +1083,7 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
pluginHost->IsPluginEnabledForExtension(extension, mimeType);
}
InstantiatePlugin(aPresContext, aMetrics, aReflowState, pluginHost, mimeType, fullURL);
rv = InstantiatePlugin(aPresContext, aMetrics, aReflowState, pluginHost, mimeType, fullURL);
}
NS_IF_RELEASE(atom);
@ -1086,20 +1100,12 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
}
}
//~~~
// image handling
nsIFrame * child = mFrames.FirstChild();
if(child != nsnull)
return HandleImage(aPresContext, aMetrics, aReflowState, aStatus, child);
//~~~
nsIPresShell* presShell;
aPresContext.GetShell(&presShell);
presShell->CantRenderReplacedElement(&aPresContext, this);
NS_RELEASE(presShell);
aStatus = NS_FRAME_COMPLETE;
return NS_OK;
}
nsresult