if (visible) {
nsIView* view = nsView::GetViewFor(childWidget); PRBool floating = PR_FALSE; view->GetFloating(floating);  if (visible && !floating) {
static void AddCoveringWidgetsToOpaqueRegion(nsIRegion* aRgn, nsIDeviceContext* aContext,                                             nsIView* aRootView) {    // We accumulate the bounds of widgets obscuring aRootView's widget into mOpaqueRgn.    // In OptimizeDisplayList, display list elements which lie behind obscuring native    // widgets are dropped.    // This shouldn't really be necessary, since the GFX/Widget toolkit should remove these    // covering widgets from the clip region passed into the paint command. But right now    // they only give us a paint rect and not a region, so we can't access that information.    // It's important to identifying areas that are covered by native widgets to avoid    // painting their views many times as we process invalidates from the root widget all the    // way down to the nested widgets.    if (nsnull != aRgn) {      aRgn->SetTo(0, 0, 0, 0);      nsCOMPtr<nsIWidget> widget;      aRootView->GetWidget(*getter_AddRefs(widget));      if (widget != nsnull) {        nsCOMPtr<nsIEnumerator> children(dont_AddRef(widget->GetChildren()));        if (children != nsnull) {          children->First();          do {            nsCOMPtr<nsISupports> child;            if (NS_SUCCEEDED(children->CurrentItem(getter_AddRefs(child)))) {              nsCOMPtr<nsIWidget> childWidget = do_QueryInterface(child);              if (childWidget != nsnull) {                PRBool visible = PR_FALSE;                       childWidget->IsVisible(visible);                if (visible) {                  nsRect bounds;                  float p2t;                  childWidget->GetBounds(bounds);                  aContext->GetDevUnitsToAppUnits(p2t);                  bounds.ScaleRoundIn(p2t);                  if (bounds.width > 0 && bounds.height > 0) {                    aRgn->Union(bounds.x, bounds.y, bounds.width, bounds.height);                  }                }              }            }          } while (NS_SUCCEEDED(children->Next()));        }      }    }}