Bug 890773 - Compute -x-text-zoom properly. r=dbaron

This commit is contained in:
Cameron McCormack 2013-07-25 10:42:11 +10:00
Родитель 92922b9c06
Коммит 1858ab68cb
1 изменённых файлов: 11 добавлений и 10 удалений

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

@ -3043,17 +3043,18 @@ nsRuleNode::SetFont(nsPresContext* aPresContext, nsStyleContext* aContext,
// -x-text-zoom: none, inherit, initial
bool allowZoom;
const nsCSSValue* textZoomValue = aRuleData->ValueForTextZoom();
if (eCSSUnit_Inherit == textZoomValue->GetUnit()) {
allowZoom = aParentFont->mAllowZoom;
} else if (eCSSUnit_None == textZoomValue->GetUnit()) {
allowZoom = false;
} else {
MOZ_ASSERT(eCSSUnit_Initial == textZoomValue->GetUnit() ||
eCSSUnit_Null == textZoomValue->GetUnit(),
"unexpected unit");
allowZoom = true;
if (eCSSUnit_Null != textZoomValue->GetUnit()) {
if (eCSSUnit_Inherit == textZoomValue->GetUnit()) {
allowZoom = aParentFont->mAllowZoom;
} else if (eCSSUnit_None == textZoomValue->GetUnit()) {
allowZoom = false;
} else {
MOZ_ASSERT(eCSSUnit_Initial == textZoomValue->GetUnit(),
"unexpected unit");
allowZoom = true;
}
aFont->EnableZoom(aPresContext, allowZoom);
}
aFont->EnableZoom(aPresContext, allowZoom);
// mLanguage must be set before before any of the CalcLengthWith calls
// (direct calls or calls via SetFontSize) for the cases where |aParentFont|