From 7c54e164911c25d5ca4ada0cb29abe7e1216cd94 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 0230d86713ca..16147316d5ef 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 ||