Bug 921731 - Part 5: Support eCSSUnit_Unset in nsRuleNode.cpp's SetFactor. r=bzbarsky

This commit is contained in:
Cameron McCormack 2013-10-04 04:49:18 +10:00
parent ae26d6be95
commit 6699cf7840

View File

@ -1229,6 +1229,8 @@ SetDiscrete(const nsCSSValue& aValue, FieldT & aField,
#define SETFCT_POSITIVE 0x01 // assert value is >= 0.0f #define SETFCT_POSITIVE 0x01 // assert value is >= 0.0f
#define SETFCT_OPACITY 0x02 // clamp value to [0.0f .. 1.0f] #define SETFCT_OPACITY 0x02 // clamp value to [0.0f .. 1.0f]
#define SETFCT_NONE 0x04 // allow _None (uses aInitialValue). #define SETFCT_NONE 0x04 // allow _None (uses aInitialValue).
#define SETFCT_UNSET_INHERIT 0x00400000
#define SETFCT_UNSET_INITIAL 0x00800000
static void static void
SetFactor(const nsCSSValue& aValue, float& aField, bool& aCanStoreInRuleTree, SetFactor(const nsCSSValue& aValue, float& aField, bool& aCanStoreInRuleTree,
@ -1269,6 +1271,18 @@ SetFactor(const nsCSSValue& aValue, float& aField, bool& aCanStoreInRuleTree,
} }
break; break;
case eCSSUnit_Unset:
if (aFlags & SETFCT_UNSET_INHERIT) {
aCanStoreInRuleTree = false;
aField = aParentValue;
return;
}
if (aFlags & SETFCT_UNSET_INITIAL) {
aField = aInitialValue;
return;
}
break;
default: default:
break; break;
} }