Implement new PropagateContentOffsets to avoid looking at floaters

This commit is contained in:
kipp 1998-06-30 20:21:57 +00:00
parent 0022cca732
commit 7dd41cfa7a
2 changed files with 32 additions and 1 deletions

View File

@ -388,6 +388,30 @@ void nsBodyFrame::AddFrame(nsIFrame* aFrame)
mChildCount++;
}
void
nsBodyFrame::PropagateContentOffsets(nsIFrame* aChild,
PRInt32 aFirstContentOffset,
PRInt32 aLastContentOffset,
PRBool aLastContentIsComplete)
{
NS_PRECONDITION(ChildIsPseudoFrame(aChild), "not a pseudo frame");
// First update our offsets
if (mFirstChild == aChild) {
mFirstContentOffset = aFirstContentOffset;
mLastContentOffset = aLastContentOffset;
mLastContentIsComplete = aLastContentIsComplete;
}
// If we are a pseudo-frame then we need to update our parent
if (IsPseudoFrame()) {
nsContainerFrame* parent = (nsContainerFrame*) mGeometricParent;
parent->PropagateContentOffsets(this, mFirstContentOffset,
mLastContentOffset,
mLastContentIsComplete);
}
}
/////////////////////////////////////////////////////////////////////////////
// nsIAnchoredItems

View File

@ -30,7 +30,8 @@ struct nsStylePosition;
class nsBodyFrame : public nsHTMLContainerFrame,
public nsIAnchoredItems,
public nsIAbsoluteItems {
public nsIAbsoluteItems
{
public:
static nsresult NewFrame(nsIFrame** aInstancePtrResult,
nsIContent* aContent,
@ -76,6 +77,12 @@ public:
NS_IMETHOD VerifyTree() const;
// nsContainerFrame
virtual void PropagateContentOffsets(nsIFrame* aChild,
PRInt32 aFirstContentOffset,
PRInt32 aLastContentOffset,
PRBool aLastContentIsComplete);
protected:
PRBool mIsPseudoFrame;