nsIWidget* aWidget; parentWithView->GetOffsetFromWidget(&offx, &offy, aWidget);  nsIFrame* parentFrame; GetParentWithView(aPresContext, &parentFrame);  if(parentFrame != nsnull) parentFrame->GetOffsetFromView(aPresContext, origin, &parentWithView);  }  window->x = NSTwipsToIntPixels(origin.x + offx, t2p); window->y = NSTwipsToIntPixels(origin.y + offy, t2p);
window->x = NSTwipsToIntPixels(origin.x, t2p); window->y = NSTwipsToIntPixels(origin.y, t2p);
nsObjectFrame::DidReflow(nsIPresContext* aPresContext,                         nsDidReflowStatus aStatus){  nsresult rv = nsObjectFrameSuper::DidReflow(aPresContext, aStatus);  // The view is created hidden; once we have reflowed it and it has been  // positioned then we show it.  if (NS_FRAME_REFLOW_FINISHED == aStatus && !IsHidden()) {    nsIView* view = nsnull;    GetView(aPresContext, &view);    if (nsnull != view) {      view->SetVisibility(nsViewVisibility_kShow);    }    if (nsnull != mInstanceOwner) {      nsPluginWindow    *window;      if (NS_OK == mInstanceOwner->GetWindow(window)) {        nsIView           *parentWithView;        nsPoint           origin;        nsIPluginInstance *inst;        float             t2p;        aPresContext->GetTwipsToPixels(&t2p);        nscoord           offx = 0;        nscoord           offy = 0;        GetOffsetFromView(aPresContext, origin, &parentWithView);        // if it's windowless we want to get the offset from the parent frame        if (window->type == nsPluginWindowType_Drawable)        {          nsIWidget* aWidget;          parentWithView->GetOffsetFromWidget(&offx, &offy, aWidget);          nsIFrame* parentFrame;          GetParentWithView(aPresContext, &parentFrame);          if(parentFrame != nsnull)            parentFrame->GetOffsetFromView(aPresContext, origin, &parentWithView);        }        window->x = NSTwipsToIntPixels(origin.x + offx, t2p);        window->y = NSTwipsToIntPixels(origin.y + offy, t2p);        // window->width = NSTwipsToIntPixels(aMetrics.width, t2p);        // window->height = NSTwipsToIntPixels(aMetrics.height, t2p);        // refresh the plugin port as well        window->window = mInstanceOwner->GetPluginPort();        // beard: to preserve backward compatibility with Communicator 4.X, the        // clipRect must be in port coordinates.#ifndef XP_MAC       // this is only well-defined on the Mac OS anyway, or perhaps for windowless plugins.        window->clipRect.top = 0;        window->clipRect.left = 0;        window->clipRect.bottom = window->clipRect.top + window->height;        window->clipRect.right = window->clipRect.left + window->width;#else        // now that we have finished the reflow process, the widget is properly positioned        // and we can validate the plugin clipping information by syncing the plugin        // window info to reflect the current widget location.        mInstanceOwner->FixUpPluginWindow();#endif        if (NS_OK == mInstanceOwner->GetInstance(inst)) {          inst->SetWindow(window);          NS_RELEASE(inst);        }        mInstanceOwner->ReleasePluginPort((nsPluginPort *)window->window);        if (mWidget)        {          PRInt32 x = NSTwipsToIntPixels(origin.x, t2p);          PRInt32 y = NSTwipsToIntPixels(origin.y, t2p);          mWidget->Move(x, y);        }      }    }  }  return rv;}