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

nsIView * nsIFrame::GetClosestView ( nsPoint *  aOffset = nsnull  )  const [inherited]

Find the closest view (on |this| or an ancestor). If aOffset is non-null, it will be set to the offset of |this| from the returned view.

Definition at line 5303 of file nsFrame.cpp.

References nsIFrame::GetParent(), nsIFrame::GetPosition(), nsIFrame::GetView(), and nsIFrame::HasView().

Referenced by nsIFrame::AreAncestorViewsVisible(), nsIFrame::GetOffsetTo(), nsIFrame::GetParentViewForChildFrame(), nsIFrame::GetScreenRectInAppUnits(), nsIFrame::GetWindow(), and nsContainerFrame::PositionFrameView().

  nsPoint offset(0,0);
  for (const nsIFrame *f = this; f; f = f->GetParent()) {
    if (f->HasView()) {
      if (aOffset)
        *aOffset = offset;
      return f->GetView();
    offset += f->GetPosition();

  NS_NOTREACHED("No view on any parent?  How did that happen?");
  return nsnull;

Generated by  Doxygen 1.6.0   Back to index