if (aMetrics.width == NS_UNCONSTRAINEDSIZE) { aMetrics.width = (aReflowState.mComputedMinWidth != NS_UNCONSTRAINEDSIZE) ? aReflowState.mComputedMinWidth : 0;
if(mInstanceOwner != nsnull) {  if(NS_OK != mInstanceOwner->GetWidth(&width)) { width = EMBED_DEF_DIM; haveWidth = PR_FALSE; } else haveWidth = PR_FALSE;  if(NS_OK != mInstanceOwner->GetHeight(&height)) { height = EMBED_DEF_DIM; haveHeight = PR_FALSE; } else haveHeight = PR_FALSE;
nsObjectFrame::GetDesiredSize(nsPresContext* aPresContext,                              const nsHTMLReflowState& aReflowState,                              nsHTMLReflowMetrics& aMetrics){  // By default, we have no area  aMetrics.width = 0;  aMetrics.height = 0;  aMetrics.ascent = 0;  aMetrics.descent = 0;  if (IsHidden(PR_FALSE)) {    if (aMetrics.mComputeMEW) {      aMetrics.mMaxElementWidth = 0;    }          return;  }    aMetrics.width = aReflowState.mComputedWidth;  aMetrics.height = aReflowState.mComputedHeight;  // for EMBED and APPLET, default to 240x200 for compatibility  nsIAtom *atom = mContent->Tag();  if (atom == nsHTMLAtoms::applet || atom == nsHTMLAtoms::embed) {    float p2t = aPresContext->ScaledPixelsToTwips();    if (aMetrics.width == NS_UNCONSTRAINEDSIZE) {      aMetrics.width = PR_MIN(PR_MAX(NSIntPixelsToTwips(EMBED_DEF_WIDTH, p2t),                                     aReflowState.mComputedMinWidth),                              aReflowState.mComputedMaxWidth);    }    if (aMetrics.height == NS_UNCONSTRAINEDSIZE) {      aMetrics.height = PR_MIN(PR_MAX(NSIntPixelsToTwips(EMBED_DEF_HEIGHT, p2t),                                      aReflowState.mComputedMinHeight),                               aReflowState.mComputedMaxHeight);    }#if defined (MOZ_WIDGET_GTK) || defined (MOZ_WIDGET_GTK2) || defined (MOZ_WIDGET_XLIB)      // We need to make sure that the size of the object frame does not    // exceed the maximum size of X coordinates.  See bug #225357 for    // more information.  In theory Gtk2 can handle large coordinates,    // but underlying plugins can't.    aMetrics.height = PR_MIN(NSIntPixelsToTwips(PR_INT16_MAX, p2t), aMetrics.height);    aMetrics.width = PR_MIN(NSIntPixelsToTwips(PR_INT16_MAX, p2t), aMetrics.width);#endif  }  // At this point, the width has an unconstrained value only if we have  // nothing to go on (no width set, no information from the plugin, nothing).  // Make up a number.  if (aMetrics.width == NS_UNCONSTRAINEDSIZE) {    aMetrics.width =      (aReflowState.mComputedMinWidth != NS_UNCONSTRAINEDSIZE) ?        aReflowState.mComputedMinWidth : 0;  }  // At this point, the height has an unconstrained value only in two cases:  // a) We are in standards mode with percent heights and parent is auto-height  // b) We have no height information at all.  // In either case, we have to make up a number.  if (aMetrics.height == NS_UNCONSTRAINEDSIZE) {    aMetrics.height =      (aReflowState.mComputedMinHeight != NS_UNCONSTRAINEDSIZE) ?        aReflowState.mComputedMinHeight : 0;  }  // XXXbz don't add in the border and padding, because we screw up our  // plugin's size and positioning if we do...  Eventually we _do_ want to  // paint borders, though!  At that point, we will need to adjust the desired  // size either here or in Reflow....  Further, we will need to fix Paint() to  // call the superclass in all cases.    // ascent  aMetrics.ascent = aMetrics.height;  if (aMetrics.mComputeMEW) {    aMetrics.mMaxElementWidth = aMetrics.width;  }}