Bug 1358688 - Part 1: Don't unzoom text for font-size:larger/smaller ; r?emilio
This used to be necessary when larger/smaller did a table lookup.
However as of
bug 1361550 these are simple ratios and should be treated
the same as em units.
MozReview-Commit-ID: EVzHe0B878K
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -3483,29 +3483,21 @@ nsRuleNode::SetFontSize(nsPresContext* a
else if (NS_STYLE_FONT_SIZE_XXXLARGE == value) {
// <font size="7"> is not specified in CSS, so we don't use eFontSize_CSS.
*aSize = CalcFontPointSize(value, baseSize, aPresContext);
}
else if (NS_STYLE_FONT_SIZE_LARGER == value ||
NS_STYLE_FONT_SIZE_SMALLER == value) {
aConditions.SetUncacheable();
- // Un-zoom so we use the tables correctly. We'll then rezoom due
- // to the |zoom = true| above.
- // Note that relative units here use the parent's size unadjusted
- // for scriptlevel changes. A scriptlevel change between us and the parent
- // is simply ignored.
- nscoord parentSize = aParentSize;
- if (aParentFont->mAllowZoom) {
- parentSize = nsStyleFont::UnZoomText(aPresContext, parentSize);
- }
-
float factor = (NS_STYLE_FONT_SIZE_LARGER == value) ? 1.2f : (1.0f / 1.2f);
- *aSize = parentSize * factor;
+ *aSize = NSToCoordFloorClamped(aParentSize * factor);
+
+ sizeIsZoomedAccordingToParent = true;
} else {
NS_NOTREACHED("unexpected value");
}
}
else if (sizeValue->IsLengthUnit() ||
sizeValue->GetUnit() == eCSSUnit_Percent ||
sizeValue->IsCalcUnit()) {