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: 2zM7O0awynG
This commit is contained in:
Manish Goregaokar 2017-07-28 17:31:06 -07:00
parent e2a35da326
commit e2ffcaa665

View File

@ -3488,19 +3488,11 @@ nsRuleNode::SetFontSize(nsPresContext* aPresContext,
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");