PRBool clipState; const nsStyleDisplay* display; aFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&) display);      if (display->IsAbsolutelyPositioned() && (display->mClipFlags & NS_STYLE_CLIP_RECT)) { nsSize  size;
nsRect clipRect;
SetClipRect(nsIRenderingContext& aRenderingContext, nsIFrame* aFrame){  PRBool clipState;  const nsStyleDisplay* display;  aFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&) display);    // 'clip' only applies to absolutely positioned elements, and is  // relative to the element's border edge. 'clip' applies to the entire  // element: border, padding, and content areas, and even scrollbars if  // there are any.  if (display->IsAbsolutelyPositioned() && (display->mClipFlags & NS_STYLE_CLIP_RECT)) {    nsSize  size;    // Start with the 'auto' values and then factor in user specified values    aFrame->GetSize(size);    nsRect  clipRect(0, 0, size.width, size.height);    if (display->mClipFlags & NS_STYLE_CLIP_RECT) {      if (0 == (NS_STYLE_CLIP_TOP_AUTO & display->mClipFlags)) {        clipRect.y = display->mClip.y;      }      if (0 == (NS_STYLE_CLIP_LEFT_AUTO & display->mClipFlags)) {        clipRect.x = display->mClip.x;      }      if (0 == (NS_STYLE_CLIP_RIGHT_AUTO & display->mClipFlags)) {        clipRect.width = display->mClip.width;      }      if (0 == (NS_STYLE_CLIP_BOTTOM_AUTO & display->mClipFlags)) {        clipRect.height = display->mClip.height;      }    }    // Set updated clip-rect into the rendering context    aRenderingContext.PushState();    aRenderingContext.SetClipRect(clipRect, nsClipCombine_kIntersect, clipState);    return PR_TRUE;  }  return PR_FALSE;}