gecko-dev/dom/smil
Brian Birtles f7f386ac4e Bug 1371196 - Round font-weight when interpolating, don't floor; r=hiro
The spec says,

 font weight: interpolated via discrete steps (multiples of 100). The
 interpolation happens in real number space and is converted to an integer by
 rounding to the nearest multiple of 100, with values halfway between
 multiples of 100 rounded towards positive infinity.[1]

However, our implementation pre-dates this spec text (bug 528234 landed Nov 2009
whereas the spec was updated in Mar 2012[2]).

This patch rounds the result by simply adding 50 to the result before we floor
it (which is good enough in this case because we don't need to worry about
negative values).

It also slightly simplifies the logic by re-using Clamp from MathAlgorithms.h.

[1] https://drafts.csswg.org/css-transitions/#animtype-font-weight
[2] 00c6286109

MozReview-Commit-ID: BjCg7MG70hW

--HG--
extra : rebase_source : 879ea18d7d1a49ff425d6e467081983a130a65e3
2017-06-09 12:19:47 +09:00
..
crashtests Bug 1363880 - Enable crashtest for SVG that no longer cause panic. r=birtles 2017-05-17 05:50:58 +09:00
test Bug 1371196 - Round font-weight when interpolating, don't floor; r=hiro 2017-06-09 12:19:47 +09:00
SMILBoolType.cpp
SMILBoolType.h
SMILEnumType.cpp
SMILEnumType.h
SMILIntegerType.cpp
SMILIntegerType.h
SMILStringType.cpp
SMILStringType.h
TimeEvent.cpp
TimeEvent.h
moz.build Bug 1062106 part 3 - Remove SMIL MappedAttribute mechanism. r=birtles 2017-03-21 15:45:58 +09:00
nsISMILAttr.h
nsISMILType.h
nsSMILAnimationController.cpp Bug 1368889 - Post animation restyle hint againt pseudo element instead of its parent. r=birtles 2017-06-08 10:22:25 +09:00
nsSMILAnimationController.h Bug 1355348 - Add SMIL restyles in the stylo pretraverse; r=heycam 2017-04-26 13:00:11 +09:00
nsSMILAnimationFunction.cpp
nsSMILAnimationFunction.h
nsSMILCSSProperty.cpp Bug 1355349 - Treat properties that can't be animated by the Servo backend as unanimatable; r=hiro 2017-06-02 15:14:43 +09:00
nsSMILCSSProperty.h Bug 1355349 - Treat properties that can't be animated by the Servo backend as unanimatable; r=hiro 2017-06-02 15:14:43 +09:00
nsSMILCSSValueType.cpp Bug 1358966 - Enable shorthand properties for SMIL. r=birtles 2017-06-09 06:19:38 +09:00
nsSMILCSSValueType.h Bug 1355349 - Call Servo's add and accumulate methods for SMIL animations; r=hiro 2017-06-02 15:18:47 +09:00
nsSMILCompositor.cpp Bug 1355349 - Treat properties that can't be animated by the Servo backend as unanimatable; r=hiro 2017-06-02 15:14:43 +09:00
nsSMILCompositor.h Bug 1315874 - Pass a base style context to nsSMILCSSProperty; r=heycam 2017-04-03 16:49:10 +09:00
nsSMILCompositorTable.h
nsSMILFloatType.cpp
nsSMILFloatType.h
nsSMILInstanceTime.cpp Bug 1339591 - Rearrange construction order of RAII objects in SMIL code; r=mccr8 2017-02-16 15:36:04 +09:00
nsSMILInstanceTime.h
nsSMILInterval.cpp
nsSMILInterval.h
nsSMILKeySpline.cpp
nsSMILKeySpline.h
nsSMILMilestone.h
nsSMILNullType.cpp
nsSMILNullType.h
nsSMILParserUtils.cpp
nsSMILParserUtils.h
nsSMILRepeatCount.cpp
nsSMILRepeatCount.h
nsSMILSetAnimationFunction.cpp
nsSMILSetAnimationFunction.h
nsSMILTargetIdentifier.h Bug 1062106 part 1 - Remove special handling of attributeType='XML'. r=birtles,longsonr+218550 2017-03-21 15:42:17 +09:00
nsSMILTimeContainer.cpp Bug 1062106 part 3 - Remove SMIL MappedAttribute mechanism. r=birtles 2017-03-21 15:45:58 +09:00
nsSMILTimeContainer.h Bug 1321357 part 2 - Make nsSMILTimeContainer::mHoldingEntries debug-only; r=dholbert 2016-12-02 11:22:40 +09:00
nsSMILTimeValue.cpp
nsSMILTimeValue.h
nsSMILTimeValueSpec.cpp
nsSMILTimeValueSpec.h
nsSMILTimeValueSpecParams.h
nsSMILTimedElement.cpp
nsSMILTimedElement.h
nsSMILTypes.h
nsSMILValue.cpp
nsSMILValue.h