Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Member Functions | Protected Attributes
InlineBackgroundData Struct Reference
Collaboration diagram for InlineBackgroundData:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 InlineBackgroundData ()
 ~InlineBackgroundData ()
void Reset ()
nsRect GetContinuousRect (nsIFrame *aFrame)
nsRect GetBoundingRect (nsIFrame *aFrame)

Protected Member Functions

void SetFrame (nsIFrame *aFrame)
void Init (nsIFrame *aFrame)

Protected Attributes

nsIFramemFrame
nscoord mContinuationPoint
nscoord mUnbrokenWidth
nsRect mBoundingBox

Detailed Description

Definition at line 96 of file nsCSSRendering.cpp.


Constructor & Destructor Documentation

Definition at line 98 of file nsCSSRendering.cpp.

      : mFrame(nsnull)
  {
  }

Definition at line 103 of file nsCSSRendering.cpp.

  {
  }

Member Function Documentation

Definition at line 124 of file nsCSSRendering.cpp.

  {
    SetFrame(aFrame);

    // Move the offsets relative to (0,0) which puts the bounding box into
    // our coordinate system rather than our parent's.  We do this by
    // moving it the back distance from us to the bounding box.
    // This also assumes background-origin: border, so our caller will
    // need to deflate us if needed.
    nsRect boundingBox(mBoundingBox);
    nsPoint point = mFrame->GetPosition();
    boundingBox.MoveBy(-point.x, -point.y);

    return boundingBox;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 114 of file nsCSSRendering.cpp.

  {
    SetFrame(aFrame);

    // Assume background-origin: border and return a rect with offsets
    // relative to (0,0).  If we have a different background-origin,
    // then our rect should be deflated appropriately by our caller.
    return nsRect(-mContinuationPoint, 0, mUnbrokenWidth, mFrame->GetSize().height);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void InlineBackgroundData::Init ( nsIFrame aFrame) [inline, protected]

Definition at line 166 of file nsCSSRendering.cpp.

  {    
    // Start with the previous flow frame as our continuation point
    // is the total of the widths of the previous frames.
    nsIFrame* inlineFrame = aFrame->GetPrevInFlow();

    while (inlineFrame) {
      nsRect rect = inlineFrame->GetRect();
      mContinuationPoint += rect.width;
      mUnbrokenWidth += rect.width;
      mBoundingBox.UnionRect(mBoundingBox, rect);
      inlineFrame = inlineFrame->GetPrevInFlow();
    }

    // Next add this frame and subsequent frames to the bounding box and
    // unbroken width.
    inlineFrame = aFrame;
    while (inlineFrame) {
      nsRect rect = inlineFrame->GetRect();
      mUnbrokenWidth += rect.width;
      mBoundingBox.UnionRect(mBoundingBox, rect);
      inlineFrame = inlineFrame->GetNextInFlow();
    }

    mFrame = aFrame;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 107 of file nsCSSRendering.cpp.

  {
    mBoundingBox.SetRect(0,0,0,0);
    mContinuationPoint = mUnbrokenWidth = 0;
    mFrame = nsnull;    
  }

Here is the caller graph for this function:

void InlineBackgroundData::SetFrame ( nsIFrame aFrame) [inline, protected]

Definition at line 146 of file nsCSSRendering.cpp.

  {
    NS_PRECONDITION(aFrame, "Need a frame");

    nsIFrame *prevInFlow = aFrame->GetPrevInFlow();

    if (!prevInFlow || mFrame != prevInFlow) {
      // Ok, we've got the wrong frame.  We have to start from scratch.
      Reset();
      Init(aFrame);
      return;
    }

    // Get our last frame's size and add its width to our continuation
    // point before we cache the new frame.
    mContinuationPoint += mFrame->GetSize().width;

    mFrame = aFrame;
  }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 144 of file nsCSSRendering.cpp.

Definition at line 142 of file nsCSSRendering.cpp.

Definition at line 141 of file nsCSSRendering.cpp.

Definition at line 143 of file nsCSSRendering.cpp.


The documentation for this struct was generated from the following file: