Bug 520485, patch 4 of 5: add support for 'font-size-adjust' property in SVG/SMIL. r=roc

This commit is contained in:
Daniel Holbert 2009-10-08 18:30:53 -07:00
parent 4a60a39633
commit 4541a570c6
5 changed files with 12 additions and 3 deletions

View File

@ -250,7 +250,7 @@ nsSMILCSSProperty::IsPropertyAnimatable(nsCSSProperty aPropID)
case eCSSProperty_flood_opacity:
// case eCSSProperty_font_family:
case eCSSProperty_font_size:
// case eCSSProperty_font_size_adjust:
case eCSSProperty_font_size_adjust:
// case eCSSProperty_font_stretch:
// case eCSSProperty_font_style:
// case eCSSProperty_font_variant:

View File

@ -202,6 +202,10 @@ nsSMILCSSValueType::Add(nsSMILValue& aDest, const nsSMILValue& aValueToAdd,
destWrapper->mPresContext = valueToAddWrapper->mPresContext;
}
// Special case: font-size-adjust is explicitly non-additive
if (destWrapper->mPropID == eCSSProperty_font_size_adjust) {
return NS_ERROR_FAILURE;
}
return nsStyleAnimation::Add(destWrapper->mCSSValue,
*valueToAddCSSValue, aCount) ?
NS_OK : NS_ERROR_FAILURE;

View File

@ -70,6 +70,11 @@ var gFromByBundles =
[
new TestcaseBundle(gPropList.fill, _fromByTestLists.color),
new TestcaseBundle(gPropList.font_size, _fromByTestLists.lengthPx),
new TestcaseBundle(gPropList.font_size_adjust, [
new AnimTestcaseFromBy("0.5", "0.1"),
new AnimTestcaseFromBy("none", "0.1"),
new AnimTestcaseFromBy("0.1", "none")
]),
new TestcaseBundle(gPropList.lighting_color, _fromByTestLists.color),
new TestcaseBundle(gPropList.opacity, _fromByTestLists.opacity),
new TestcaseBundle(gPropList.stroke_miterlimit, [

View File

@ -263,7 +263,7 @@ var gFromToBundles = [
new AnimTestcaseFromTo("0.9", "0.1", { midComp: "0.5" }),
new AnimTestcaseFromTo("0.5", "0.6", { midComp: "0.55" }),
new AnimTestcaseFromTo("none", "0.4"),
], "need support for all properties that get stored in nsFont"),
]),
new TestcaseBundle(gPropList.font_stretch, [
new AnimTestcaseFromTo("normal", "wider"),
new AnimTestcaseFromTo("narrower", "ultra-condensed"),

View File

@ -507,7 +507,7 @@ function AnimTestcaseFromBy(aFrom, aBy, aComputedValMap, aSkipReason)
this.by = aBy;
this.computedValMap = aComputedValMap;
this.skipReason = aSkipReason;
if (!this.computedValMap.toComp) {
if (this.computedValMap && !this.computedValMap.toComp) {
ok(false, "AnimTestcaseFromBy needs expected computed final value");
}
}