mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 14:45:29 +00:00
Implement new PropagateContentOffsets to avoid looking at floaters
This commit is contained in:
parent
0022cca732
commit
7dd41cfa7a
@ -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
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user