vm->EnableRefresh();
vm->EnableRefresh(NS_VMREFRESH_IMMEDIATE);
nsImageDocument::StartLayout(){  PRInt32 i, ns = GetNumberOfShells();  for (i = 0; i < ns; i++) {    nsIPresShell* shell = GetShellAt(i);    if (nsnull != shell) {      // Make shell an observer for next time      shell->BeginObservingDocument();      // Resize-reflow this time      nsCOMPtr<nsIPresContext> cx;      shell->GetPresContext(getter_AddRefs(cx));      nsRect r;      cx->GetVisibleArea(r);      shell->InitialReflow(r.width, r.height);      // Now trigger a refresh      // XXX It's unfortunate that this has to be here      nsCOMPtr<nsIViewManager> vm;      shell->GetViewManager(getter_AddRefs(vm));      if (vm) {        vm->EnableRefresh();      }      NS_RELEASE(shell);    }  }}