зеркало из https://github.com/mozilla/gecko-dev.git
f7f386ac4e
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]
|
||
---|---|---|
.. | ||
crashtests | ||
test | ||
SMILBoolType.cpp | ||
SMILBoolType.h | ||
SMILEnumType.cpp | ||
SMILEnumType.h | ||
SMILIntegerType.cpp | ||
SMILIntegerType.h | ||
SMILStringType.cpp | ||
SMILStringType.h | ||
TimeEvent.cpp | ||
TimeEvent.h | ||
moz.build | ||
nsISMILAttr.h | ||
nsISMILType.h | ||
nsSMILAnimationController.cpp | ||
nsSMILAnimationController.h | ||
nsSMILAnimationFunction.cpp | ||
nsSMILAnimationFunction.h | ||
nsSMILCSSProperty.cpp | ||
nsSMILCSSProperty.h | ||
nsSMILCSSValueType.cpp | ||
nsSMILCSSValueType.h | ||
nsSMILCompositor.cpp | ||
nsSMILCompositor.h | ||
nsSMILCompositorTable.h | ||
nsSMILFloatType.cpp | ||
nsSMILFloatType.h | ||
nsSMILInstanceTime.cpp | ||
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 | ||
nsSMILTimeContainer.cpp | ||
nsSMILTimeContainer.h | ||
nsSMILTimeValue.cpp | ||
nsSMILTimeValue.h | ||
nsSMILTimeValueSpec.cpp | ||
nsSMILTimeValueSpec.h | ||
nsSMILTimeValueSpecParams.h | ||
nsSMILTimedElement.cpp | ||
nsSMILTimedElement.h | ||
nsSMILTypes.h | ||
nsSMILValue.cpp | ||
nsSMILValue.h |