Set an NS_FRAME_IN_CONSTRAINED_HEIGHT state bit on frames that are in a constrained space. (Bug 627842, patch 2) r=roc

This commit is contained in:
L. David Baron 2011-11-23 18:48:23 -08:00
parent f34af4cd8d
commit 5aaee7d865
2 changed files with 17 additions and 0 deletions

View File

@ -289,6 +289,19 @@ nsHTMLReflowState::Init(nsPresContext* aPresContext,
InitResizeFlags(aPresContext, type);
nsIFrame *parent = frame->GetParent();
if (parent &&
(parent->GetStateBits() & NS_FRAME_IN_CONSTRAINED_HEIGHT) &&
!(parent->GetType() == nsGkAtoms::scrollFrame &&
parent->GetStyleDisplay()->mOverflowY != NS_STYLE_OVERFLOW_HIDDEN)) {
frame->AddStateBits(NS_FRAME_IN_CONSTRAINED_HEIGHT);
} else if (mStylePosition->mHeight.GetUnit() != eStyleUnit_Auto ||
mStylePosition->mMaxHeight.GetUnit() != eStyleUnit_None) {
frame->AddStateBits(NS_FRAME_IN_CONSTRAINED_HEIGHT);
} else {
frame->RemoveStateBits(NS_FRAME_IN_CONSTRAINED_HEIGHT);
}
NS_WARN_IF_FALSE((mFrameType == NS_CSS_FRAME_TYPE_INLINE &&
!frame->IsFrameOfType(nsIFrame::eReplaced)) ||
type == nsGkAtoms::textFrame ||

View File

@ -293,6 +293,10 @@ typedef PRUint64 nsFrameState;
// A display item for this frame has been painted as part of a ThebesLayer.
#define NS_FRAME_PAINTED_THEBES NS_FRAME_STATE_BIT(38)
// Frame is or is a descendant of something with a fixed height, and
// has no closer ancestor that is overflow:auto or overflow:scroll.
#define NS_FRAME_IN_CONSTRAINED_HEIGHT NS_FRAME_STATE_BIT(39)
// The lower 20 bits and upper 32 bits of the frame state are reserved
// by this API.
#define NS_FRAME_RESERVED ~NS_FRAME_IMPL_RESERVED