We will use Servo backend on the compositor, so implement this for opacity.
MozReview-Commit-ID: BeWR2nBSbjb
--HG--
extra : rebase_source : eb5db3cf04640a83f13857984e792a949f26bcc7
After StyleBasicShape is set to StyleShapeSource, it's life cycle never go
beyond StyleShapeSource, so I make StyleBasicShape hold by a UniquePtr in
StyleShapeSource.
Also, replace all raw pointers to StyleBasicShape by UniquePtr in all APIs.
MozReview-Commit-ID: 1MfIFjP8TsQ
--HG--
extra : rebase_source : bdbbd47de57e0bc610e37913752ab8413f62588a
This function can be used to implement animation for <basic-shape> for
shape-outside, so I remove the clip path in naming to make it more general.
MozReview-Commit-ID: LwVe0Dk5Web
--HG--
extra : rebase_source : eb0136c79b494222cca38ebd68d62f3f825bd29e
We need to check whether the function fails or not in order to check whether
we support the specified paced animation values.
Current servo returns 0.0 when failed computing distance, so servo doesn't
distinguish its failure. This patch makes Servo_AnimationValue_ComputeDistance
return a negative value when the function fails.
MozReview-Commit-ID: 43Q4gu4xwHc
--HG--
extra : rebase_source : fa159b4b03e2e84c0a365455de4c0d2cf5d4f2ce
Also if |aCoeff1| is zero, we can just ignore the first list altogether.
MozReview-Commit-ID: LVZmAx0K574
--HG--
extra : rebase_source : f4419131590befde2a616d2e47785024f90f0719
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
We can get the parent style from element tree in servo side.
The parent style has been already restyled.
E.g.;
When we get target element style with nsComputedDOMStyle::GetStyleContext,
the function flushes styles so that the parent style has also
restyled.
When we call Servo_GetComputedKeyframeValues, it's called from a
SequentialTask, that means all elements have been already restyled.
Unfortunately we can't assert that the parent style is not stale
to check the parent element has no dirty descendant bit since
Servo_GetComputedKeyframeValues is called in a SequantialTask
that is processed before post traversal, that means elements
still have the dirty bit to update nsStyleContext in the
post traversal.
MozReview-Commit-ID: AC2ZRyzk3eu
--HG--
extra : rebase_source : b0ae8b52bb2daca6e634b66ffdfd41ffc3fa7b86
AnimationValue::FromString compute the AnimationValue from a string.
MozReview-Commit-ID: CX8wairpnfN
--HG--
extra : rebase_source : 05dbaa84bf40463a0021bd538d7baba5d591f992
We will use this API to compute the distance between two AnimationValues
in the patch series.
MozReview-Commit-ID: 2Tw9xumuz45
--HG--
extra : rebase_source : 298baaf597a81e03191a0468f9d7509e092a5e78
We have different interpolation implementations on Gecko and Servo, so
wrap the "Can be Interpolated" in AnimationValue. This patch also introduces
the FFI, Servo_Animationvalues_IsInterpolable.
MozReview-Commit-ID: 92Yf1u84A3c
--HG--
extra : rebase_source : 544d9db1b0d377006ae42b1242dc064bd5fa65d2
We also need to update the interpolation code based on ServoAnimationValue in
ElementPropertyTransition::UpdateStartValueFromReplacedTransition().
Therefore, ElementPropertyTransition can be used by both Gecko and Servo.
MozReview-Commit-ID: BrIpvRR3te8
--HG--
extra : rebase_source : df49fdf39811dcd1661cc815dbf0b1bc192f9d81
The FFI type conversion in AnimationValue::as_arc will check if the
parameter is nullptr or not. If it is, we will get a debug assertion, so
we shouldn't pass a nullptr into it.
MozReview-Commit-ID: KWko2ipJwbo
--HG--
extra : rebase_source : f3e284da008b6c3bb3c56eb26c485f825b1188a7
We will obsolete StyleAnimationValue in the future, and can treat
AnimationValue as a wrapper of RawServoAnimationValue to hide the FFIs
at that moment. For now, we still need both types, so it's better to make sure
they are mutually exclusive in AnimationValue. Therefore, let's add some
assertions.
Besides, I think those FFIs might do many things and it seems those methods
are not critical, so let's move them into the cpp file, so we can remove
some dependencies to avoid re-compiling so many files if someone needs
revise ServoBindings.h.
MozReview-Commit-ID: FJ1uTvEQ7NT
--HG--
extra : rebase_source : 8ef99c659f2721c8425364051db19b66536bccc6
Move the common part of GetScaleValue into nsStyleTransformMatrix, and add a
new method, GetScaleValue, on AnimationValue, which can get the scale value from
StyleAnimationValue or RawServoAnimationValue.
MozReview-Commit-ID: 4spi1LkZrWP
--HG--
extra : rebase_source : 81e352edb85c9abb16fb0ef2780ff27c4f264709
Currently, we have StyleAnimationValue for Gecko and
RawServoAnimationValue for Servo, and use this struct to wrap them to
avoid the duplicated code.
MozReview-Commit-ID: ATDBSCOX2C5
--HG--
extra : rebase_source : 85991ef5e23a445ae6302264508d1c06a46c0e29
The StyleAnimationValue for filter and shadow has no mCSSValueList in case of
initial style.
MozReview-Commit-ID: JigQQBbx77x
--HG--
extra : rebase_source : b2bb513424a7d089c8dfb6b880dd7c7239280efb
Because the new function checks types, we need to change the fullCorner type
in nsComputedDOMStyle::GetEllipseRadii() and
StyleAnimationValue::ExtractComputedValue() from uint8_t to |Corner| to fix
build error.
MozReview-Commit-ID: 5NuFE3yA2QD
--HG--
extra : rebase_source : 8f94209b24bd909839358cd502f462edb9ce3116
Some cubic-bezier functions, e.g. cubic-bezier(0,-0.5,0,0), produce values out
of range of [0, 1].
MozReview-Commit-ID: 9ZTsTRTcUaI
--HG--
extra : rebase_source : 7edf0c4d2702a502a9c0422be83ce7229751e815