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
Родитель 22fa771d50
Коммит 9ed992748a
3 изменённых файлов: 19 добавлений и 5 удалений

Просмотреть файл

@ -440,6 +440,13 @@ nsHTMLScrollFrame::ReflowScrolledFrame(const ScrollReflowState& aState,
if (!aFirstPass) if (!aFirstPass)
mInner.mScrolledFrame->AddStateBits(NS_FRAME_IS_DIRTY); 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 // Pass PR_FALSE for aInit so we can pass in the correct padding
nsHTMLReflowState kidReflowState(presContext, aState.mReflowState, nsHTMLReflowState kidReflowState(presContext, aState.mReflowState,
mInner.mScrolledFrame, mInner.mScrolledFrame,

Просмотреть файл

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

Просмотреть файл

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