Replace AutoMaybeNullInflationContainer with AutoMaybeDisableInflationForShrinkWrap since the concept of the pres context's current inflation container will be going away. (Bug 747720, patch 2) r=roc

This commit is contained in:
L. David Baron
2012-05-20 22:18:27 -07:00
parent 8564a90e2c
commit 995ff8b9c1
10 changed files with 32 additions and 23 deletions

View File

@@ -2349,7 +2349,7 @@ GetIntrinsicCoord(const nsStyleCoord& aStyle,
// If aFrame is a container for font size inflation, then shrink
// wrapping inside of it should not apply font size inflation.
AutoMaybeNullInflationContainer an(aFrame);
AutoMaybeDisableFontInflation an(aFrame);
if (val == NS_STYLE_WIDTH_MAX_CONTENT)
aResult = aFrame->GetPrefWidth(aRenderingContext);
@@ -2381,7 +2381,7 @@ nsLayoutUtils::IntrinsicForContainer(nsRenderingContext *aRenderingContext,
// If aFrame is a container for font size inflation, then shrink
// wrapping inside of it should not apply font size inflation.
AutoMaybeNullInflationContainer an(aFrame);
AutoMaybeDisableFontInflation an(aFrame);
nsIFrame::IntrinsicWidthOffsetData offsets =
aFrame->IntrinsicWidthOffsets(aRenderingContext);
@@ -2640,7 +2640,7 @@ nsLayoutUtils::ComputeWidthValue(
} else if (eStyleUnit_Enumerated == aCoord.GetUnit()) {
// If aFrame is a container for font size inflation, then shrink
// wrapping inside of it should not apply font size inflation.
AutoMaybeNullInflationContainer an(aFrame);
AutoMaybeDisableFontInflation an(aFrame);
PRInt32 val = aCoord.GetIntValue();
switch (val) {
@@ -4815,12 +4815,13 @@ nsLayoutUtils::InflationMinFontSizeFor(const nsIFrame *aFrame,
}
#endif
if (!FontSizeInflationEnabled(aFrame->PresContext())) {
nsPresContext *presContext = aFrame->PresContext();
if (!FontSizeInflationEnabled(presContext) ||
presContext->mInflationDisabledForShrinkWrap) {
return 0;
}
if (aWidthDetermination == eInReflow) {
nsPresContext *presContext = aFrame->PresContext();
nsIFrame *container = presContext->mCurrentInflationContainer;
if (!container || !ShouldInflateFontsForContainer(container)) {
return 0;