Set the used padding on the scrolled frame, since we're munging its padding.

Bug 370794, r+sr=dbaron
This commit is contained in:
bzbarsky%mit.edu 2007-02-20 18:54:16 +00:00
parent 167347dbb5
commit 023de09ffa
3 changed files with 19 additions and 5 deletions

View File

@ -440,6 +440,13 @@ nsHTMLScrollFrame::ReflowScrolledFrame(const ScrollReflowState& aState,
if (!aFirstPass)
mInner.mScrolledFrame->AddStateBits(NS_FRAME_IS_DIRTY);
// We're forcing the padding on our scrolled frame, so let it know what that
// padding is.
mInner.mScrolledFrame->
SetProperty(nsGkAtoms::usedPaddingProperty,
new nsMargin(aState.mReflowState.mComputedPadding),
nsCSSOffsetState::DestroyMarginFunc);
// Pass PR_FALSE for aInit so we can pass in the correct padding
nsHTMLReflowState kidReflowState(presContext, aState.mReflowState,
mInner.mScrolledFrame,

View File

@ -1923,11 +1923,12 @@ nsHTMLReflowState::CalcLineHeight(nsPresContext* aPresContext,
return lineHeight;
}
static void
DestroyMarginFunc(void* aFrame,
nsIAtom* aPropertyName,
void* aPropertyValue,
void* aDtorData)
/* static */
void
nsCSSOffsetState::DestroyMarginFunc(void* aFrame,
nsIAtom* aPropertyName,
void* aPropertyValue,
void* aDtorData)
{
delete NS_STATIC_CAST(nsMargin*, aPropertyValue);
}

View File

@ -172,6 +172,12 @@ public:
const nsMargin *aBorder = nsnull,
const nsMargin *aPadding = nsnull);
// Destructor for usedPaddingProperty
static void DestroyMarginFunc(void* aFrame,
nsIAtom* aPropertyName,
void* aPropertyValue,
void* aDtorData);
private:
// Computes margin values from the specified margin style information, and
// fills in the mComputedMargin member