From 0025130d3526222c5ea4aeb00a0bf9d69a4dfd1c Mon Sep 17 00:00:00 2001 From: "dbaron@dbaron.org" Date: Sun, 22 Jul 2007 10:57:35 -0700 Subject: [PATCH] Make CheckFontProperties consider font-size:larger and font-size:smaller as well. b=388548 r+sr=bzbarsky --- layout/style/nsRuleNode.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index 0230d86713c..16147316d5e 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -706,10 +706,14 @@ CheckFontCallback(const nsRuleDataStruct& aData, } } - // em, ex, and percentage values for font size require inheritance - if ((fontData.mSize.IsRelativeLengthUnit() && - fontData.mSize.GetUnit() != eCSSUnit_Pixel) || - fontData.mSize.GetUnit() == eCSSUnit_Percent) { + // em, ex, percent, 'larger', and 'smaller' values on font-size depend + // on the parent context's font-size + const nsCSSValue& size = fontData.mSize; + if ((size.IsRelativeLengthUnit() && size.GetUnit() != eCSSUnit_Pixel) || + size.GetUnit() == eCSSUnit_Percent || + (size.GetUnit() == eCSSUnit_Enumerated && + (size.GetIntValue() == NS_STYLE_FONT_SIZE_SMALLER || + size.GetIntValue() == NS_STYLE_FONT_SIZE_LARGER))) { NS_ASSERTION(aResult == nsRuleNode::eRulePartialReset || aResult == nsRuleNode::eRuleFullReset || aResult == nsRuleNode::eRulePartialMixed ||