if (IsInDoc()) { GetOwnerDoc()->FlushPendingNotifications(Flush_Layout);
nsIDocument* doc = GetCurrentDoc(); if (doc) { doc->FlushPendingNotifications(Flush_Layout);
nsHTMLAreaElement::SetFocus(nsPresContext* aPresContext){  if (!aPresContext)    return;  aPresContext->EventStateManager()->SetContentState(this,                                                     NS_EVENT_STATE_FOCUS);      // Make sure the presentation is up-to-date      if (IsInDoc()) {    GetOwnerDoc()->FlushPendingNotifications(Flush_Layout);  }  nsIPresShell *presShell = aPresContext->GetPresShell();  if (presShell) {    nsIFrame* frame = nsnull;    presShell->GetPrimaryFrameFor(this, &frame);    if (frame) {      presShell->ScrollFrameIntoView(frame, NS_PRESSHELL_SCROLL_ANYWHERE,                                     NS_PRESSHELL_SCROLL_ANYWHERE);    }  }}