mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
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:
parent
e2a35da326
commit
e2ffcaa665
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user