Do the necessary reflow when our font inflation data changes. (Bug 759755, patch 2) r=roc
This commit is contained in:
@@ -38,7 +38,7 @@ nsFontInflationData::FindFontInflationDataFor(const nsIFrame *aFrame)
|
||||
bfc->Properties().Get(FontInflationDataProperty()));
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
/* static */ bool
|
||||
nsFontInflationData::UpdateFontInflationDataWidthFor(const nsHTMLReflowState& aReflowState)
|
||||
{
|
||||
nsIFrame *bfc = aReflowState.frame;
|
||||
@@ -47,12 +47,22 @@ nsFontInflationData::UpdateFontInflationDataWidthFor(const nsHTMLReflowState& aR
|
||||
FrameProperties bfcProps(bfc->Properties());
|
||||
nsFontInflationData *data = static_cast<nsFontInflationData*>(
|
||||
bfcProps.Get(FontInflationDataProperty()));
|
||||
if (!data) {
|
||||
bool oldInflationEnabled;
|
||||
nscoord oldNCAWidth;
|
||||
if (data) {
|
||||
oldNCAWidth = data->mNCAWidth;
|
||||
oldInflationEnabled = data->mInflationEnabled;
|
||||
} else {
|
||||
data = new nsFontInflationData(bfc);
|
||||
bfcProps.Set(FontInflationDataProperty(), data);
|
||||
oldNCAWidth = -1;
|
||||
oldInflationEnabled = true; /* not relevant */
|
||||
}
|
||||
|
||||
data->UpdateWidth(aReflowState);
|
||||
|
||||
return oldNCAWidth != data->mNCAWidth ||
|
||||
oldInflationEnabled != data->mInflationEnabled;
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
|
||||
Reference in New Issue
Block a user