Logo Search packages:      
Sourcecode: xulrunner-1.9 version File versions  Download package

void nsGenericElement::SetFocus ( nsPresContext *  aPresContext  )  [virtual, inherited]

Set the focus on this content. This is generally something for the event state manager to do, not ordinary people. Ordinary people should do something like nsGenericHTMLElement::SetElementFocus(). This method is the end result, the point where the content finds out it has been focused.

All content elements are potentially focusable.

aPresContext the pres context
See also:

Reimplemented from nsIContent.

Reimplemented in nsHTMLSelectElement.

Definition at line 2527 of file nsGenericElement.cpp.

References nsIFrame::IsFocusable().

  // Traditionally focusable elements can take focus as long as they don't set
  // the disabled attribute

  nsCOMPtr<nsIPresShell> presShell = aPresContext->PresShell();
  if (!presShell) {
  nsIFrame* frame = presShell->GetPrimaryFrameFor(this);
  if (frame && frame->IsFocusable() &&
                                                         NS_EVENT_STATE_FOCUS)) {
    presShell->ScrollContentIntoView(this, NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,

Generated by  Doxygen 1.6.0   Back to index